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: <150c0fa2-bff2-0644-d6e5-c4dab7f79048@suse.de>
Date:   Wed, 5 Jul 2023 10:18:18 +0200
From:   Thomas Zimmermann <tzimmermann@...e.de>
To:     Arnd Bergmann <arnd@...db.de>, Helge Deller <deller@....de>,
        Daniel Vetter <daniel@...ll.ch>,
        Dave Airlie <airlied@...il.com>
Cc:     linux-hyperv@...r.kernel.org, linux-efi@...r.kernel.org,
        linux-ia64@...r.kernel.org, linux-sh@...r.kernel.org,
        Peter Zijlstra <peterz@...radead.org>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        linux-fbdev@...r.kernel.org, dri-devel@...ts.freedesktop.org,
        linux-mips@...r.kernel.org, "H. Peter Anvin" <hpa@...or.com>,
        sparclinux@...r.kernel.org, linux-riscv@...ts.infradead.org,
        Ard Biesheuvel <ardb@...nel.org>,
        Linux-Arch <linux-arch@...r.kernel.org>,
        linux-hexagon@...r.kernel.org, linux-staging@...ts.linux.dev,
        "linux-csky@...r.kernel.org" <linux-csky@...r.kernel.org>,
        Ingo Molnar <mingo@...hat.com>,
        Sami Tolvanen <samitolvanen@...gle.com>,
        Kees Cook <keescook@...omium.org>,
        "Paul E. McKenney" <paulmck@...nel.org>,
        Frederic Weisbecker <frederic@...nel.org>,
        Nicholas Piggin <npiggin@...il.com>,
        Borislav Petkov <bp@...en8.de>, loongarch@...ts.linux.dev,
        Thomas Gleixner <tglx@...utronix.de>,
        linux-arm-kernel@...ts.infradead.org, x86@...nel.org,
        linux-kernel@...r.kernel.org,
        Juerg Haefliger <juerg.haefliger@...onical.com>,
        linux-alpha@...r.kernel.org,
        Andrew Morton <akpm@...ux-foundation.org>,
        linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH 07/12] arch/x86: Declare edid_info in <asm/screen_info.h>

Hi Arnd

Am 30.06.23 um 13:53 schrieb Arnd Bergmann:
> On Fri, Jun 30, 2023, at 09:46, Thomas Zimmermann wrote:
>> Am 29.06.23 um 15:21 schrieb Arnd Bergmann:
>>> On Thu, Jun 29, 2023, at 15:01, Thomas Zimmermann wrote:
>>>> Am 29.06.23 um 14:35 schrieb Arnd Bergmann:
>>>>> On Thu, Jun 29, 2023, at 13:45, Thomas Zimmermann wrote:
>>
>>>>
>>>> FIRMWARE_EDID is a user-selectable feature, while ARCH_HAS_EDID_INFO
>>>> announces an architecture feature. They do different things.
>>>
>>> I still have trouble seeing the difference.
>>
>> The idea here is that ARCH_HAS_ signals the architecture's support for
>> the feature.  Drivers set 'depends on' in their Kconfig.
>>
>> Another Kconfig token, VIDEO_SCREEN_INFO or FIRMWARE_EDID, would then
>> actually enable the feature.  Drivers select VIDEO_SCREEN_INFO or
>> FIRMWARE_EDID and the architectures contains code like
> 
> Fair enough. In that case, I guess FIRMWARE_EDID will just depend on
> ARCH_HAS_EDID_INFO, or possibly "depends on FIRMWARE_EDID || EFI"
> after it starts calling into an EFI specific function, right?
> 
>> #ifdef VIDEO_SCREEN_INFO
>> struct screen_info screen_info = {
>> 	/* set values here */
>> }
>> #endif
>>
>> This allows us to disable code that requires screen_info/edid_info, but
>> also disable screen_info/edid_info unless such code has been enabled in
>> the kernel config.
>>
>> Some architectures currently mimic this by guarding screen_info with
>> ifdef CONFIG_VT or similar. I'd like to make this more flexible. The
>> cost of a few more internal Kconfig tokens seems negligible.
> 
> I definitely get it for the screen_info, which needs the complexity.
> For ARCHARCH_HAS_EDID_INFO I would hope that it's never selected by
> anything other than x86, so I would still go with just a dependency
> on x86 for simplicity, but I don't mind having the extra symbol if that
> keeps it more consistent with how the screen_info is handled.

Well, I'd like to add edid_info to platforms with EFI. What would be 
arm/arm64 and loongarch, I guess. See below for the future plans.

> 
>>> I suppose you could use FIRMWARE_EDID on EFI or OF systems without
>>> the need for a global edid_info structure, but that would not
>>> share any code with the current fb_firmware_edid() function.
>>
>> The current code is build on top of screen_info and edid_info. I'd
>> preferably not replace that, if possible.
> 
> One way I could imagine this looking in the end would be
> something like
> 
> struct screen_info *fb_screen_info(struct device *dev)
> {
>        struct screen_info *si = NULL;
> 
>        if (IS_ENABLED(CONFIG_EFI))
>              si = efi_get_screen_info(dev);
> 
>        if (IS_ENABLED(CONFIG_ARCH_HAS_SCREEN_INFO) && !si)
>              si = screen_info;
> 
>        return si;
> }
> 
> corresponding to fb_firmware_edid(). With this, any driver
> that wants to access screen_info would call this function
> instead of using the global pointer, plus either NULL pointer
> check or a CONFIG_ARCH_HAS_SCREEN_INFO dependency.
> 
> This way we could completely eliminate the global screen_info
> on arm64, riscv, and loongarch but still use the efi and
> hyperv framebuffer/drm drivers.

If possible, I'd like to remove global screen_info and edid_info 
entirely from fbdev and the various consoles.

We currently use screen_info to set up the generic framebuffer device in 
drivers/firmware/sysfb.c. I'd like to use edid_info here as well, so 
that the generic graphics drivers can get EDID information.

For the few fbdev drivers and consoles that require the global 
screen_info/edid_info, I'd rather provide lookup functions in sysfb 
(e.g., sysfb_get_screen_info(), sysfb_get_edid_info()). The global 
screen_info/edid_info state would then become an internal artifact of 
the sysfb code.

Hopefully that explains some of the decisions made in this patchset.

Best regards
Thomas

> 
>      Arnd

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)

Download attachment "OpenPGP_signature" of type "application/pgp-signature" (841 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ