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] [day] [month] [year] [list]
Message-ID: <2cf50ad0-e4fa-17a3-3e22-7fd8d4a316ed@189.cn>
Date:   Sat, 10 Jun 2023 01:43:39 +0800
From:   Sui Jingfeng <15330273260@....cn>
To:     Bjorn Helgaas <helgaas@...nel.org>,
        Sui Jingfeng <suijingfeng@...ngson.cn>
Cc:     Somalapuram Amaranath <Amaranath.Somalapuram@....com>,
        Karol Herbst <kherbst@...hat.com>,
        nouveau@...ts.freedesktop.org,
        Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
        dri-devel@...ts.freedesktop.org, YiPeng Chai <YiPeng.Chai@....com>,
        Mario Limonciello <mario.limonciello@....com>,
        David Airlie <airlied@...il.com>,
        Ville Syrjala <ville.syrjala@...ux.intel.com>,
        Yi Liu <yi.l.liu@...el.com>, kvm@...r.kernel.org,
        amd-gfx@...ts.freedesktop.org, Jason Gunthorpe <jgg@...pe.ca>,
        Ben Skeggs <bskeggs@...hat.com>, linux-pci@...r.kernel.org,
        Andrey Grodzovsky <andrey.grodzovsky@....com>,
        Kevin Tian <kevin.tian@...el.com>,
        Lijo Lazar <lijo.lazar@....com>,
        Daniel Vetter <daniel@...ll.ch>,
        Bokun Zhang <Bokun.Zhang@....com>,
        intel-gfx@...ts.freedesktop.org,
        Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
        Maxime Ripard <mripard@...nel.org>,
        loongson-kernel@...ts.loongnix.cn,
        Alex Williamson <alex.williamson@...hat.com>,
        Abhishek Sahu <abhsahu@...dia.com>,
        Jani Nikula <jani.nikula@...ux.intel.com>,
        Rodrigo Vivi <rodrigo.vivi@...el.com>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        Tvrtko Ursulin <tvrtko.ursulin@...ux.intel.com>,
        Yishai Hadas <yishaih@...dia.com>, Li Yi <liyi@...ngson.cn>,
        Pan Xinhui <Xinhui.Pan@....com>, linux-kernel@...r.kernel.org,
        Thomas Zimmermann <tzimmermann@...e.de>,
        Cornelia Huck <cohuck@...hat.com>,
        Alex Deucher <alexander.deucher@....com>,
        Christian Konig <christian.koenig@....com>,
        Hawking Zhang <Hawking.Zhang@....com>
Subject: Re: [Intel-gfx] [PATCH v3 4/4] PCI/VGA: introduce is_boot_device
 function callback to vga_client_register


On 2023/6/10 00:48, Bjorn Helgaas wrote:
> On Fri, Jun 09, 2023 at 10:27:39AM +0800, Sui Jingfeng wrote:
>> On 2023/6/9 03:19, Bjorn Helgaas wrote:
>>> On Thu, Jun 08, 2023 at 07:43:22PM +0800, Sui Jingfeng wrote:
>>>> From: Sui Jingfeng <suijingfeng@...ngson.cn>
>>>>
>>>> The vga_is_firmware_default() function is arch-dependent, which doesn't
>>>> sound right. At least, it also works on the Mips and LoongArch platforms.
>>>> Tested with the drm/amdgpu and drm/radeon drivers. However, it's difficult
>>>> to enumerate all arch-driver combinations. I'm wrong if there is only one
>>>> exception.
>>>>
>>>> With the observation that device drivers typically have better knowledge
>>>> about which PCI bar contains the firmware framebuffer, which could avoid
>>>> the need to iterate all of the PCI BARs.
>>>>
>>>> But as a PCI function at pci/vgaarb.c, vga_is_firmware_default() is
>>>> probably not suitable to make such an optimization for a specific device.
>>>>
>>>> There are PCI display controllers that don't have a dedicated VRAM bar,
>>>> this function will lose its effectiveness in such a case. Luckily, the
>>>> device driver can provide an accurate workaround.
>>>>
>>>> Therefore, this patch introduces a callback that allows the device driver
>>>> to tell the VGAARB if the device is the default boot device. This patch
>>>> only intends to introduce the mechanism, while the implementation is left
>>>> to the device driver authors. Also honor the comment: "Clients have two
>>>> callback mechanisms they can use"
>>> s/bar/BAR/ (several)
>>>
>>> Nothing here uses the callback.  I don't want to merge this until we
>>> have a user.
>> This is chicken and egg question.
>>
>> If you could help get this merge first, I will show you the first user.
>>
>>> I'm not sure why the device driver should know whether its device is
>>> the default boot device.
>> It's not that the device driver should know,
>>
>> but it's about that the device driver has the right to override.
>>
>> Device driver may have better approach to identify the default boot
>> device.
> The way we usually handle this is to include the new callback in the
> same series as the first user of it.  That has two benefits:
> (1) everybody can review the whole picture and possibly suggest
> different approaches, and (2) when we merge the infrastructure,
> we also merge a user of it at the same time, so the whole thing can be
> tested and we don't end up with unused code.

OK, acceptable

I will try to prepare the user code of this callback and respin the patch.

I may resend it with another patch set in the future, this series 
already drop it,

see v5[1]

[1] https://patchwork.freedesktop.org/series/119134/

> Bjorn

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ