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: <ef7b3899-7d18-8018-47fa-aac0efaa61f4@suse.de>
Date:   Fri, 30 Jun 2023 09:46:11 +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-kernel@...r.kernel.org, linux-alpha@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-efi@...r.kernel.org,
        "linux-csky@...r.kernel.org" <linux-csky@...r.kernel.org>,
        linux-hexagon@...r.kernel.org, linux-ia64@...r.kernel.org,
        loongarch@...ts.linux.dev, linux-mips@...r.kernel.org,
        linuxppc-dev@...ts.ozlabs.org, linux-riscv@...ts.infradead.org,
        linux-sh@...r.kernel.org, sparclinux@...r.kernel.org,
        dri-devel@...ts.freedesktop.org, linux-hyperv@...r.kernel.org,
        linux-fbdev@...r.kernel.org, linux-staging@...ts.linux.dev,
        Linux-Arch <linux-arch@...r.kernel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
        "H. Peter Anvin" <hpa@...or.com>,
        Kees Cook <keescook@...omium.org>,
        "Paul E. McKenney" <paulmck@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Frederic Weisbecker <frederic@...nel.org>,
        Nicholas Piggin <npiggin@...il.com>,
        Ard Biesheuvel <ardb@...nel.org>,
        Sami Tolvanen <samitolvanen@...gle.com>,
        Juerg Haefliger <juerg.haefliger@...onical.com>
Subject: Re: [PATCH 07/12] arch/x86: Declare edid_info in <asm/screen_info.h>

Hi

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:
>>>> The global variable edid_info contains the firmware's EDID information
>>>> as an extension to the regular screen_info on x86. Therefore move it to
>>>> <asm/screen_info.h>.
>>>>
>>>> Add the Kconfig token ARCH_HAS_EDID_INFO to guard against access on
>>>> architectures that don't provide edid_info. Select it on x86.
>>>
>>> I'm not sure we need another symbol in addition to
>>> CONFIG_FIRMWARE_EDID. Since all the code behind that
>>> existing symbol is also x86 specific, would it be enough
>>> to just add either 'depends on X86' or 'depends on X86 ||
>>> COMPILE_TEST' there?
>>
>> 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

#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.

> 
>> Right now, ARCH_HAS_EDID_INFO only works on the old BIOS-based VESA
>> systems. In the future, I want to add support for EDID data from EFI and
>> OF as well. It would be stored in edid_info. I assume that the new
>> symbol will become useful then.
> 
> I don't see why an OF based system would have the same limitation
> as legacy BIOS with supporting only a single monitor, if we need
> to have a generic representation of EDID data in DT, that would
> probably be in a per device property anyway.

Sorry that was my mistake. OF has nothing to do with this.

> 
> 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.

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