lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 18 Jul 2023 21:27:32 +0200
From:   "Arnd Bergmann" <arnd@...db.de>
To:     "Javier Martinez Canillas" <javierm@...hat.com>,
        linux-kernel@...r.kernel.org
Cc:     "Geert Uytterhoeven" <geert@...ux-m68k.org>,
        "Thomas Zimmermann" <tzimmermann@...e.de>,
        "Andy Shevchenko" <andriy.shevchenko@...ux.intel.com>,
        "Borislav Petkov" <bp@...en8.de>,
        "Daniel Thompson" <daniel.thompson@...aro.org>,
        "Daniel Vetter" <daniel@...ll.ch>,
        "Dave Hansen" <dave.hansen@...ux.intel.com>,
        "Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
        "H. Peter Anvin" <hpa@...or.com>, "Helge Deller" <deller@....de>,
        "Ingo Molnar" <mingo@...hat.com>,
        "Jingoo Han" <jingoohan1@...il.com>, "Lee Jones" <lee@...nel.org>,
        "Randy Dunlap" <rdunlap@...radead.org>,
        "Sam Ravnborg" <sam@...nborg.org>,
        "Thomas Gleixner" <tglx@...utronix.de>,
        dri-devel@...ts.freedesktop.org, linux-fbdev@...r.kernel.org,
        x86@...nel.org
Subject: Re: [PATCH v5 3/4] fbdev: Split frame buffer support in FB and FB_CORE symbols

On Fri, Jul 14, 2023, at 19:16, Javier Martinez Canillas wrote:
> Currently the CONFIG_FB option has to be enabled even if no legacy fbdev
> drivers are needed (e.g: only to have support for framebuffer consoles).
>
> The DRM subsystem has a fbdev emulation layer, but depends on CONFIG_FB
> and so it can only be enabled if that dependency is enabled as well.
>
> That means fbdev drivers have to be explicitly disabled if users want to
> enable CONFIG_FB, only to use fbcon and/or the DRM fbdev emulation layer.
>
> This patch introduces a non-visible CONFIG_FB_CORE symbol that could be
> enabled just to have core support needed for CONFIG_DRM_FBDEV_EMULATION,
> allowing CONFIG_FB to be disabled (and automatically disabling all the
> fbdev drivers).
>
> Nothing from fb_backlight.o and fbmon.o is used by the DRM fbdev emulation
> layer so these two objects can be compiled out when CONFIG_FB is disabled.

I gave this a spin in my randconfig build setup and found one small
mistake:

> diff --git a/drivers/video/fbdev/core/Makefile 
> b/drivers/video/fbdev/core/Makefile
> index 9150bafd9e89..2cd213716c12 100644
> --- a/drivers/video/fbdev/core/Makefile
> +++ b/drivers/video/fbdev/core/Makefile
> @@ -1,10 +1,10 @@
>  # SPDX-License-Identifier: GPL-2.0
>  obj-$(CONFIG_FB_NOTIFY)           += fb_notify.o
> -obj-$(CONFIG_FB)                  += fb.o
> -fb-y                              := fb_backlight.o \
> -                                     fb_info.o \
> -                                     fbmem.o fbmon.o fbcmap.o \
> +obj-$(CONFIG_FB_CORE)             += fb.o
> +fb-y                              := fb_info.o \
> +                                     fbmem.o fbcmap.o \
>                                       modedb.o fbcvt.o fb_cmdline.o 
> fb_io_fops.o
> +fb-$(CONFIG_FB)                   += fb_backlight.o fbmon.o

With CONFIG_FB_CORE=y and CONFIG_FB=m, Kbuild does not include
the fb_backlight.o and fbmon.o files in fb.ko because they are not
set to =y, causing link failures for fbdev drivers later:

ERROR: modpost: "of_get_fb_videomode" [drivers/video/fbdev/clps711x-fb.ko] undefined!
ERROR: modpost: "fb_videomode_from_videomode" [drivers/video/fbdev/atmel_lcdfb.ko] undefined!
ERROR: modpost: "of_get_fb_videomode" [drivers/video/fbdev/imxfb.ko] undefined!
ERROR: modpost: "fb_destroy_modedb" [drivers/video/fbdev/udlfb.ko] undefined!
ERROR: modpost: "fb_edid_to_monspecs" [drivers/video/fbdev/udlfb.ko] undefined!
ERROR: modpost: "fb_destroy_modedb" [drivers/video/fbdev/smscufx.ko] undefined!
ERROR: modpost: "fb_edid_to_monspecs" [drivers/video/fbdev/smscufx.ko] undefined!
ERROR: modpost: "fb_destroy_modedb" [drivers/video/fbdev/uvesafb.ko] undefined!
ERROR: modpost: "fb_validate_mode" [drivers/video/fbdev/uvesafb.ko] undefined!
ERROR: modpost: "fb_get_mode" [drivers/video/fbdev/uvesafb.ko] undefined!


Folding this fixup into the patch makes it work:

diff --git a/drivers/video/fbdev/core/Makefile b/drivers/video/fbdev/core/Makefile
index 2cd213716c12f..84ddc5d308b58 100644
--- a/drivers/video/fbdev/core/Makefile
+++ b/drivers/video/fbdev/core/Makefile
@@ -4,7 +4,9 @@ obj-$(CONFIG_FB_CORE)             += fb.o
 fb-y                              := fb_info.o \
                                      fbmem.o fbcmap.o \
                                      modedb.o fbcvt.o fb_cmdline.o fb_io_fops.o
-fb-$(CONFIG_FB)                   += fb_backlight.o fbmon.o
+ifdef CONFIG_FB
+fb-y		                   += fb_backlight.o fbmon.o
+endif
 fb-$(CONFIG_FB_DEFERRED_IO)       += fb_defio.o
 fb-$(CONFIG_FB_DEVICE)            += fb_chrdev.o \
                                      fb_procfs.o \


     Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ