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]
Message-ID: <25c22370-b67a-33a6-f1e6-abf70760d866@infradead.org>
Date:   Wed, 23 Nov 2022 02:02:18 -0800
From:   Randy Dunlap <rdunlap@...radead.org>
To:     Arnd Bergmann <arnd@...db.de>, linux-kernel@...r.kernel.org
Cc:     linux-fbdev@...r.kernel.org,
        Thomas Zimmermann <tzimmermann@...e.de>,
        Masahiro Yamada <masahiroy@...nel.org>,
        dri-devel@...ts.freedesktop.org, Daniel Vetter <daniel@...ll.ch>,
        Michal Suchanek <msuchanek@...e.de>,
        linuxppc-dev@...ts.ozlabs.org, Helge Deller <deller@....de>
Subject: Re: [PATCH -next] fbdev: offb: allow build when DRM_OFDRM=m

Hi Arnd,

On 11/23/22 01:08, Arnd Bergmann wrote:
> On Wed, Nov 23, 2022, at 04:16, Randy Dunlap wrote:
>> Fix build when CONFIG_FB_OF=y and CONFIG_DRM_OFDRM=m.
>> When the latter symbol is =m, kconfig downgrades (limits) the 'select's
>> under FB_OF to modular (=m). This causes undefined symbol references:
>>
>> powerpc64-linux-ld: drivers/video/fbdev/offb.o:(.data.rel.ro+0x58): 
>> undefined reference to `cfb_fillrect'
>> powerpc64-linux-ld: drivers/video/fbdev/offb.o:(.data.rel.ro+0x60): 
>> undefined reference to `cfb_copyarea'
>> powerpc64-linux-ld: drivers/video/fbdev/offb.o:(.data.rel.ro+0x68): 
>> undefined reference to `cfb_imageblit'
>>
>> Fix this by allowing FB_OF any time that DRM_OFDRM != y so that the
>> selected FB_CFB_* symbols will become =y instead of =m.
>>
>> In tristate logic (for DRM_OFDRM), this changes the dependency from
>>     !DRM_OFDRM	== 2 - 1 == 1 => modular only (or disabled)
>> to (boolean)
>>     DRM_OFDRM != y == y, allowing the 'select's to cause the
>> FB_CFB_* symbols to =y instead of =m.
>>
> 
> Is it actually a useful configuration to have OFDRM=m and
> FB_OF=y though? I would expect in that case that the OFDRM
> driver never binds to a device because it's already owned
> by FB_OF.
> 
>> diff -- a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
>> --- a/drivers/video/fbdev/Kconfig
>> +++ b/drivers/video/fbdev/Kconfig
>> @@ -455,7 +455,7 @@ config FB_ATARI
>>  config FB_OF
>>  	bool "Open Firmware frame buffer device support"
>>  	depends on (FB = y) && PPC && (!PPC_PSERIES || PCI)
>> -	depends on !DRM_OFDRM
>> +	depends on DRM_OFDRM != y
>>  	select APERTURE_HELPERS
> 
> I would instead make this 'depends on DRM_OFDRM=n', which
> completely eliminates configs that have both driver enabled.

Yep, that works for me. Thanks.

Thomas, Michal, are you OK with that change?

> A nicer change would be to make FB_OF a tristate symbol,
> which makes it possible to load one of the two modules if
> both are enabled =m, while only allowing one of them to
> be =y if the other is completely disabled. It looks like
> offb was originally written to be usable as a loadable module,
> but Kconfig has prevented this since at least the start of
> the git history.

-- 
~Randy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ