* [PATCH] PCI/VGA: Don't assume the only VGA device on a system is `boot_vga` @ 2025-10-29 18:59 Mario Limonciello (AMD) 2025-10-29 19:34 ` Bjorn Helgaas 0 siblings, 1 reply; 7+ messages in thread From: Mario Limonciello (AMD) @ 2025-10-29 18:59 UTC (permalink / raw) To: mario.limonciello, bhelgaas Cc: Mario Limonciello (AMD), Aaron Erhardt, linux-pci Some systems ship with multiple display class devices but not all of them are VGA devices. If the "only" VGA device on the system is not used for displaying the image on the screen marking it as `boot_vga` because nothing was found is totally wrong. This behavior actually leads to mistakes of the wrong device being advertised to userspace and then userspace can make incorrect decisions. As there is an accurate `boot_display` sysfs file stop lying about `boot_vga` by assuming if nothing is found it's the right device. Reported-by: Aaron Erhardt <aer@tuxedocomputers.com> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220712 Tested-by: Aaron Erhardt <aer@tuxedocomputers.com> Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org> --- drivers/pci/vgaarb.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c index 436fa7f4c3873..baa242b140993 100644 --- a/drivers/pci/vgaarb.c +++ b/drivers/pci/vgaarb.c @@ -652,13 +652,6 @@ static bool vga_is_boot_device(struct vga_device *vgadev) return true; } - /* - * Vgadev has neither IO nor MEM enabled. If we haven't found any - * other VGA devices, it is the best candidate so far. - */ - if (!boot_vga) - return true; - return false; } -- 2.43.0 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] PCI/VGA: Don't assume the only VGA device on a system is `boot_vga` 2025-10-29 18:59 [PATCH] PCI/VGA: Don't assume the only VGA device on a system is `boot_vga` Mario Limonciello (AMD) @ 2025-10-29 19:34 ` Bjorn Helgaas 2025-10-29 19:38 ` Mario Limonciello 0 siblings, 1 reply; 7+ messages in thread From: Bjorn Helgaas @ 2025-10-29 19:34 UTC (permalink / raw) To: Mario Limonciello (AMD) Cc: mario.limonciello, bhelgaas, Aaron Erhardt, linux-pci On Wed, Oct 29, 2025 at 01:59:33PM -0500, Mario Limonciello (AMD) wrote: > Some systems ship with multiple display class devices but not all > of them are VGA devices. If the "only" VGA device on the system is not > used for displaying the image on the screen marking it as `boot_vga` > because nothing was found is totally wrong. > > This behavior actually leads to mistakes of the wrong device being > advertised to userspace and then userspace can make incorrect decisions. > > As there is an accurate `boot_display` sysfs file stop lying about > `boot_vga` by assuming if nothing is found it's the right device. > > Reported-by: Aaron Erhardt <aer@tuxedocomputers.com> > Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220712 > Tested-by: Aaron Erhardt <aer@tuxedocomputers.com> > Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org> Do we need a Fixes: here? A stable cc? The bugzilla suggests this might be a regression and hence v6.18 material? > --- > drivers/pci/vgaarb.c | 7 ------- > 1 file changed, 7 deletions(-) > > diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c > index 436fa7f4c3873..baa242b140993 100644 > --- a/drivers/pci/vgaarb.c > +++ b/drivers/pci/vgaarb.c > @@ -652,13 +652,6 @@ static bool vga_is_boot_device(struct vga_device *vgadev) > return true; > } > > - /* > - * Vgadev has neither IO nor MEM enabled. If we haven't found any > - * other VGA devices, it is the best candidate so far. > - */ > - if (!boot_vga) > - return true; > - > return false; > } > > -- > 2.43.0 > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] PCI/VGA: Don't assume the only VGA device on a system is `boot_vga` 2025-10-29 19:34 ` Bjorn Helgaas @ 2025-10-29 19:38 ` Mario Limonciello 2025-11-17 5:20 ` Mario Limonciello 0 siblings, 1 reply; 7+ messages in thread From: Mario Limonciello @ 2025-10-29 19:38 UTC (permalink / raw) To: Bjorn Helgaas, Thomas Zimmermann Cc: mario.limonciello, bhelgaas, Aaron Erhardt, linux-pci +Thomas On 10/29/25 2:34 PM, Bjorn Helgaas wrote: > On Wed, Oct 29, 2025 at 01:59:33PM -0500, Mario Limonciello (AMD) wrote: >> Some systems ship with multiple display class devices but not all >> of them are VGA devices. If the "only" VGA device on the system is not >> used for displaying the image on the screen marking it as `boot_vga` >> because nothing was found is totally wrong. >> >> This behavior actually leads to mistakes of the wrong device being >> advertised to userspace and then userspace can make incorrect decisions. >> >> As there is an accurate `boot_display` sysfs file stop lying about >> `boot_vga` by assuming if nothing is found it's the right device. >> >> Reported-by: Aaron Erhardt <aer@tuxedocomputers.com> >> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220712 >> Tested-by: Aaron Erhardt <aer@tuxedocomputers.com> >> Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org> > > Do we need a Fixes: here? A stable cc? > > The bugzilla suggests this might be a regression and hence v6.18 > material? Yeah I think you're right, we should add these two tags and this should go to 6.18 if it's a reasonable change. Cc: stable@vger.kernel.org Fixes: ad90860bd10ee ("fbcon: Use screen info to find primary device") But let's also make sure Thomas Zimmermann agrees with this change. > >> --- >> drivers/pci/vgaarb.c | 7 ------- >> 1 file changed, 7 deletions(-) >> >> diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c >> index 436fa7f4c3873..baa242b140993 100644 >> --- a/drivers/pci/vgaarb.c >> +++ b/drivers/pci/vgaarb.c >> @@ -652,13 +652,6 @@ static bool vga_is_boot_device(struct vga_device *vgadev) >> return true; >> } >> >> - /* >> - * Vgadev has neither IO nor MEM enabled. If we haven't found any >> - * other VGA devices, it is the best candidate so far. >> - */ >> - if (!boot_vga) >> - return true; >> - >> return false; >> } >> >> -- >> 2.43.0 >> ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] PCI/VGA: Don't assume the only VGA device on a system is `boot_vga` 2025-10-29 19:38 ` Mario Limonciello @ 2025-11-17 5:20 ` Mario Limonciello 2025-11-17 7:25 ` Thomas Zimmermann 0 siblings, 1 reply; 7+ messages in thread From: Mario Limonciello @ 2025-11-17 5:20 UTC (permalink / raw) To: Bjorn Helgaas, Thomas Zimmermann Cc: mario.limonciello, bhelgaas, Aaron Erhardt, linux-pci On 10/29/25 2:38 PM, Mario Limonciello wrote: > +Thomas > > On 10/29/25 2:34 PM, Bjorn Helgaas wrote: >> On Wed, Oct 29, 2025 at 01:59:33PM -0500, Mario Limonciello (AMD) wrote: >>> Some systems ship with multiple display class devices but not all >>> of them are VGA devices. If the "only" VGA device on the system is not >>> used for displaying the image on the screen marking it as `boot_vga` >>> because nothing was found is totally wrong. >>> >>> This behavior actually leads to mistakes of the wrong device being >>> advertised to userspace and then userspace can make incorrect decisions. >>> >>> As there is an accurate `boot_display` sysfs file stop lying about >>> `boot_vga` by assuming if nothing is found it's the right device. >>> >>> Reported-by: Aaron Erhardt <aer@tuxedocomputers.com> >>> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220712 >>> Tested-by: Aaron Erhardt <aer@tuxedocomputers.com> >>> Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org> >> >> Do we need a Fixes: here? A stable cc? >> >> The bugzilla suggests this might be a regression and hence v6.18 >> material? > > Yeah I think you're right, we should add these two tags and this should > go to 6.18 if it's a reasonable change. > > Cc: stable@vger.kernel.org > Fixes: ad90860bd10ee ("fbcon: Use screen info to find primary device") > > But let's also make sure Thomas Zimmermann agrees with this change. > ping? >> >>> --- >>> drivers/pci/vgaarb.c | 7 ------- >>> 1 file changed, 7 deletions(-) >>> >>> diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c >>> index 436fa7f4c3873..baa242b140993 100644 >>> --- a/drivers/pci/vgaarb.c >>> +++ b/drivers/pci/vgaarb.c >>> @@ -652,13 +652,6 @@ static bool vga_is_boot_device(struct vga_device >>> *vgadev) >>> return true; >>> } >>> - /* >>> - * Vgadev has neither IO nor MEM enabled. If we haven't found any >>> - * other VGA devices, it is the best candidate so far. >>> - */ >>> - if (!boot_vga) >>> - return true; >>> - >>> return false; >>> } >>> -- >>> 2.43.0 >>> > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] PCI/VGA: Don't assume the only VGA device on a system is `boot_vga` 2025-11-17 5:20 ` Mario Limonciello @ 2025-11-17 7:25 ` Thomas Zimmermann 2025-11-17 15:44 ` Bjorn Helgaas 0 siblings, 1 reply; 7+ messages in thread From: Thomas Zimmermann @ 2025-11-17 7:25 UTC (permalink / raw) To: Mario Limonciello, Bjorn Helgaas Cc: mario.limonciello, bhelgaas, Aaron Erhardt, linux-pci Hi Am 17.11.25 um 06:20 schrieb Mario Limonciello: > > > On 10/29/25 2:38 PM, Mario Limonciello wrote: >> +Thomas >> >> On 10/29/25 2:34 PM, Bjorn Helgaas wrote: >>> On Wed, Oct 29, 2025 at 01:59:33PM -0500, Mario Limonciello (AMD) >>> wrote: >>>> Some systems ship with multiple display class devices but not all >>>> of them are VGA devices. If the "only" VGA device on the system is not >>>> used for displaying the image on the screen marking it as `boot_vga` >>>> because nothing was found is totally wrong. >>>> >>>> This behavior actually leads to mistakes of the wrong device being >>>> advertised to userspace and then userspace can make incorrect >>>> decisions. >>>> >>>> As there is an accurate `boot_display` sysfs file stop lying about >>>> `boot_vga` by assuming if nothing is found it's the right device. >>>> >>>> Reported-by: Aaron Erhardt <aer@tuxedocomputers.com> >>>> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220712 >>>> Tested-by: Aaron Erhardt <aer@tuxedocomputers.com> >>>> Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org> >>> >>> Do we need a Fixes: here? A stable cc? >>> >>> The bugzilla suggests this might be a regression and hence v6.18 >>> material? >> >> Yeah I think you're right, we should add these two tags and this >> should go to 6.18 if it's a reasonable change. >> >> Cc: stable@vger.kernel.org >> Fixes: ad90860bd10ee ("fbcon: Use screen info to find primary device") >> >> But let's also make sure Thomas Zimmermann agrees with this change. >> > > ping? Sorry, this fell though the cracks. I can see that this backfires, but still Acked-by: Thomas Zimmermann <tzimmermann@suse.de> because the overall logic of detecting the boot-up VGA is questionable. It picks the first possible candidate instead of looking at all devices before making the decision. If we see regressions from the patch here, this would be the place to fix it. Best regards Thomas > >>> >>>> --- >>>> drivers/pci/vgaarb.c | 7 ------- >>>> 1 file changed, 7 deletions(-) >>>> >>>> diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c >>>> index 436fa7f4c3873..baa242b140993 100644 >>>> --- a/drivers/pci/vgaarb.c >>>> +++ b/drivers/pci/vgaarb.c >>>> @@ -652,13 +652,6 @@ static bool vga_is_boot_device(struct >>>> vga_device *vgadev) >>>> return true; >>>> } >>>> - /* >>>> - * Vgadev has neither IO nor MEM enabled. If we haven't found >>>> any >>>> - * other VGA devices, it is the best candidate so far. >>>> - */ >>>> - if (!boot_vga) >>>> - return true; >>>> - >>>> return false; >>>> } >>>> -- >>>> 2.43.0 >>>> >> >> > -- -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg) ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] PCI/VGA: Don't assume the only VGA device on a system is `boot_vga` 2025-11-17 7:25 ` Thomas Zimmermann @ 2025-11-17 15:44 ` Bjorn Helgaas 2025-11-17 15:55 ` Mario Limonciello (AMD) (kernel.org) 0 siblings, 1 reply; 7+ messages in thread From: Bjorn Helgaas @ 2025-11-17 15:44 UTC (permalink / raw) To: Thomas Zimmermann Cc: Mario Limonciello, mario.limonciello, bhelgaas, Aaron Erhardt, linux-pci On Mon, Nov 17, 2025 at 08:25:05AM +0100, Thomas Zimmermann wrote: > Am 17.11.25 um 06:20 schrieb Mario Limonciello: > > On 10/29/25 2:38 PM, Mario Limonciello wrote: > > > On 10/29/25 2:34 PM, Bjorn Helgaas wrote: > > > > On Wed, Oct 29, 2025 at 01:59:33PM -0500, Mario Limonciello > > > > (AMD) wrote: > > > > > Some systems ship with multiple display class devices but not all > > > > > of them are VGA devices. If the "only" VGA device on the system is not > > > > > used for displaying the image on the screen marking it as `boot_vga` > > > > > because nothing was found is totally wrong. > > > > > > > > > > This behavior actually leads to mistakes of the wrong device being > > > > > advertised to userspace and then userspace can make > > > > > incorrect decisions. > > > > > > > > > > As there is an accurate `boot_display` sysfs file stop lying about > > > > > `boot_vga` by assuming if nothing is found it's the right device. > > > > > > > > > > Reported-by: Aaron Erhardt <aer@tuxedocomputers.com> > > > > > Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220712 > > > > > Tested-by: Aaron Erhardt <aer@tuxedocomputers.com> > > > > > Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org> > > > > > > > > Do we need a Fixes: here? A stable cc? > > > > > > > > The bugzilla suggests this might be a regression and hence v6.18 > > > > material? > > > > > > Yeah I think you're right, we should add these two tags and this > > > should go to 6.18 if it's a reasonable change. > > > > > > Cc: stable@vger.kernel.org > > > Fixes: ad90860bd10ee ("fbcon: Use screen info to find primary device") > > > > > > But let's also make sure Thomas Zimmermann agrees with this change. > > > > ping? > > Sorry, this fell though the cracks. I can see that this backfires, but still > > Acked-by: Thomas Zimmermann <tzimmermann@suse.de> > > because the overall logic of detecting the boot-up VGA is questionable. It > picks the first possible candidate instead of looking at all devices before > making the decision. If we see regressions from the patch here, this would > be the place to fix it. One problem is that it's hard to know when we've looked at all the devices. I don't think we currently have a special hook for VGA after boot-time enumeration. > > > > > --- > > > > > drivers/pci/vgaarb.c | 7 ------- > > > > > 1 file changed, 7 deletions(-) > > > > > > > > > > diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c > > > > > index 436fa7f4c3873..baa242b140993 100644 > > > > > --- a/drivers/pci/vgaarb.c > > > > > +++ b/drivers/pci/vgaarb.c > > > > > @@ -652,13 +652,6 @@ static bool vga_is_boot_device(struct > > > > > vga_device *vgadev) > > > > > return true; > > > > > } > > > > > - /* > > > > > - * Vgadev has neither IO nor MEM enabled. If we > > > > > haven't found any > > > > > - * other VGA devices, it is the best candidate so far. > > > > > - */ > > > > > - if (!boot_vga) > > > > > - return true; > > > > > - > > > > > return false; > > > > > } > > > > > -- > > > > > 2.43.0 > > > > > > > > > > > > > > > -- > -- > Thomas Zimmermann > Graphics Driver Developer > SUSE Software Solutions Germany GmbH > Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com > GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg) > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] PCI/VGA: Don't assume the only VGA device on a system is `boot_vga` 2025-11-17 15:44 ` Bjorn Helgaas @ 2025-11-17 15:55 ` Mario Limonciello (AMD) (kernel.org) 0 siblings, 0 replies; 7+ messages in thread From: Mario Limonciello (AMD) (kernel.org) @ 2025-11-17 15:55 UTC (permalink / raw) To: Bjorn Helgaas, Thomas Zimmermann Cc: mario.limonciello, bhelgaas, Aaron Erhardt, linux-pci On 11/17/2025 9:44 AM, Bjorn Helgaas wrote: > On Mon, Nov 17, 2025 at 08:25:05AM +0100, Thomas Zimmermann wrote: >> Am 17.11.25 um 06:20 schrieb Mario Limonciello: >>> On 10/29/25 2:38 PM, Mario Limonciello wrote: >>>> On 10/29/25 2:34 PM, Bjorn Helgaas wrote: >>>>> On Wed, Oct 29, 2025 at 01:59:33PM -0500, Mario Limonciello >>>>> (AMD) wrote: >>>>>> Some systems ship with multiple display class devices but not all >>>>>> of them are VGA devices. If the "only" VGA device on the system is not >>>>>> used for displaying the image on the screen marking it as `boot_vga` >>>>>> because nothing was found is totally wrong. >>>>>> >>>>>> This behavior actually leads to mistakes of the wrong device being >>>>>> advertised to userspace and then userspace can make >>>>>> incorrect decisions. >>>>>> >>>>>> As there is an accurate `boot_display` sysfs file stop lying about >>>>>> `boot_vga` by assuming if nothing is found it's the right device. >>>>>> >>>>>> Reported-by: Aaron Erhardt <aer@tuxedocomputers.com> >>>>>> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220712 >>>>>> Tested-by: Aaron Erhardt <aer@tuxedocomputers.com> >>>>>> Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org> >>>>> >>>>> Do we need a Fixes: here? A stable cc? >>>>> >>>>> The bugzilla suggests this might be a regression and hence v6.18 >>>>> material? >>>> >>>> Yeah I think you're right, we should add these two tags and this >>>> should go to 6.18 if it's a reasonable change. >>>> >>>> Cc: stable@vger.kernel.org >>>> Fixes: ad90860bd10ee ("fbcon: Use screen info to find primary device") >>>> >>>> But let's also make sure Thomas Zimmermann agrees with this change. >>> >>> ping? >> >> Sorry, this fell though the cracks. I can see that this backfires, but still >> >> Acked-by: Thomas Zimmermann <tzimmermann@suse.de> >> >> because the overall logic of detecting the boot-up VGA is questionable. It >> picks the first possible candidate instead of looking at all devices before >> making the decision. If we see regressions from the patch here, this would >> be the place to fix it. > > One problem is that it's hard to know when we've looked at all the > devices. I don't think we currently have a special hook for VGA after > boot-time enumeration. I fail to understand why this fallback was even there in the first place. How can we have a VGA device that doesn't have IO or MEM enabled? It seemed like it was specifically (37114e4d1547e) for hot added devices, but that sounds like faulty logic to me. The whole point of it is the device that displayed the boot image - which shouldn't be hot added. > >>>>>> --- >>>>>> drivers/pci/vgaarb.c | 7 ------- >>>>>> 1 file changed, 7 deletions(-) >>>>>> >>>>>> diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c >>>>>> index 436fa7f4c3873..baa242b140993 100644 >>>>>> --- a/drivers/pci/vgaarb.c >>>>>> +++ b/drivers/pci/vgaarb.c >>>>>> @@ -652,13 +652,6 @@ static bool vga_is_boot_device(struct >>>>>> vga_device *vgadev) >>>>>> return true; >>>>>> } >>>>>> - /* >>>>>> - * Vgadev has neither IO nor MEM enabled. If we >>>>>> haven't found any >>>>>> - * other VGA devices, it is the best candidate so far. >>>>>> - */ >>>>>> - if (!boot_vga) >>>>>> - return true; >>>>>> - >>>>>> return false; >>>>>> } >>>>>> -- >>>>>> 2.43.0 >>>>>> >>>> >>>> >>> >> >> -- >> -- >> Thomas Zimmermann >> Graphics Driver Developer >> SUSE Software Solutions Germany GmbH >> Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com >> GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg) >> >> ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-11-17 15:55 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-10-29 18:59 [PATCH] PCI/VGA: Don't assume the only VGA device on a system is `boot_vga` Mario Limonciello (AMD) 2025-10-29 19:34 ` Bjorn Helgaas 2025-10-29 19:38 ` Mario Limonciello 2025-11-17 5:20 ` Mario Limonciello 2025-11-17 7:25 ` Thomas Zimmermann 2025-11-17 15:44 ` Bjorn Helgaas 2025-11-17 15:55 ` Mario Limonciello (AMD) (kernel.org)
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).