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: <ed87b8de-9fb6-fbee-2c6d-cebf712ccda5@loongson.cn>
Date:   Sat, 19 Aug 2023 10:40:28 +0800
From:   suijingfeng <suijingfeng@...ngson.cn>
To:     Bjorn Helgaas <helgaas@...nel.org>
Cc:     Bjorn Helgaas <bhelgaas@...gle.com>,
        loongson-kernel@...ts.loongnix.cn, linux-pci@...r.kernel.org,
        linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org,
        dri-devel@...ts.freedesktop.org
Subject: Re: [PATCH v4] PCI/VGA: Make the vga_is_firmware_default() less
 arch-dependent

Hi,


On 2023/8/18 06:08, Bjorn Helgaas wrote:
> I guess the point here is that:
>
>    - 03:00.0 BAR 0 is [mem 0xe0050000000-0xe005fffffff]
>
>    - screen_info says the framebuffer is
>      [mem 0xe0050000000-0xe005fffffff] (or part of it)
>
>    - Therefore, we want 03:00.0 to be the default VGA
>
>    - PCI core reassigns 03:00.0 BAR 0 to
>      [mem 0xe0030000000-0xe003fffffff]
>
>    - PCI core assigns a 00:06.1 BAR to contain
>      [mem 0xe0050000000-0xe005fffffff]
>
>    - vga_is_firmware_default() incorrectly decides 00:06.1 should be
>      the default VGA because it has a BAR that contains the screen_info
>      address range
>
> Is that right?

Yes, The 00:06.1 is loongson integrated display controller, integrated in LS7A1000 North bridge.


On loongarch, before apply apply any patch, VGAARB always select 00:06.1 as the default boot device.
because it is enumerated first. It is always the first VGA compatible device found on our system.
Because its PCI domain, bus, function number is smallest. And it own IO and MEM, so the 00:06.1 will
always be selected as the default boot device. Even you plug a discrete GPU on the mother board.


Therefore we need help the vga_is_firmware_default() to overriding previous.
On a multiple GPU co-exist case (on loongson platform), if no "overriding previous" being printed.
then there something wrong. On normal case, we need the discrete GPU overriding the integrated one.
Because the discrete GPU is more powerful than the platform integrated.

But what we want is let the VGAARB determine the primary GPU by referencing the firmware.

If firmware put the firmware framebuffer in the VRAM of the integrated display card(00:06.1).
then the integrated display card should be the primary GPU.

If firmware put the firmware framebuffer in the VRAM of the discrete display card,
then the discrete display card should be the primary GPU.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ