PCI/VGA: Don't assume the only VGA device on a system is `boot_vga`
PATCH 1/1 PCI/VGA: Don't assume the only VGA device on a system is `boot_vga`
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.
--- drivers/pci/vgaarb.c | 7 ------- 1 file changed, 7 deletions(-)
drivers/pci/vgaarb.c +0 -7
@@ -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; }
Signature · 1 line
2.43.0
Quoted 8 lines · Mario Limonciello (AMD)
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_vgabecause 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.
Quoted 7 lines
As there is an accurate
boot_displaysysfs file stop lying aboutboot_vgaby assuming if nothing is found it's the right device.Reported-by Aaron Erhardt <[email protected]>Tested-by Aaron Erhardt <[email protected]>Signed-off-by Mario Limonciello (AMD) <[email protected]>
Do we need a Fixes: here? A stable cc?
The bugzilla suggests this might be a regression and hence v6.18 material?
Quoted 25 lines
--- drivers/pci/vgaarb.c | 7 ------- 1 file changed, 7 deletions(-)drivers/pci/vgaarb.c +0
-7@@ -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; }Signature · 1 line
2.43.0
+Thomas
Quoted 17 lines · Bjorn Helgaas
Quoted 8 lines · Mario Limonciello (AMD)
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_vgabecause 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.
Quoted 7 lines
As there is an accurate
boot_displaysysfs file stop lying aboutboot_vgaby assuming if nothing is found it's the right device.Reported-by Aaron Erhardt <[email protected]>Tested-by Aaron Erhardt <[email protected]>Signed-off-by Mario Limonciello (AMD) <[email protected]>
Quoted 4 lines
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.
But let's also make sure Thomas Zimmermann agrees with this change.
Quoted 26 lines
Quoted 26 lines
--- drivers/pci/vgaarb.c | 7 ------- 1 file changed, 7 deletions(-)drivers/pci/vgaarb.c +0
-7@@ -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; }Signature · 1 line
2.43.0
Quoted 25 lines · Mario Limonciello
+Thomas
Quoted 17 lines · Bjorn Helgaas
Quoted 8 lines · Mario Limonciello (AMD)
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_vgabecause 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.
Quoted 7 lines
As there is an accurate
boot_displaysysfs file stop lying aboutboot_vgaby assuming if nothing is found it's the right device.Reported-by Aaron Erhardt <[email protected]>Tested-by Aaron Erhardt <[email protected]>Signed-off-by Mario Limonciello (AMD) <[email protected]>Quoted 4 lines
Do we need a Fixes: here? A stable cc?
The bugzilla suggests this might be a regression and hence v6.18 material?
Quoted 7 lines
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.
Fixes ad90860bd10ee ("fbcon: Use screen info to find primary device")But let's also make sure Thomas Zimmermann agrees with this change.
ping?
Quoted 27 lines
Quoted 25 lines
Quoted 25 lines
---
drivers/pci/vgaarb.c| 7 -------1 file changed, 7 deletions(-)drivers/pci/vgaarb.c +0
-7@@ -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; }Signature · 1 line
2.43.0
Thomas Zimmermann
Acked-byHi
Am 17.11.25 um 06:20 schrieb Mario Limonciello:
Quoted 30 lines · Mario Limonciello
Quoted 27 lines
+Thomas
Quoted 17 lines · Bjorn Helgaas
Quoted 8 lines · Mario Limonciello (AMD)
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_vgabecause 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.
Quoted 7 lines
As there is an accurate
boot_displaysysfs file stop lying aboutboot_vgaby assuming if nothing is found it's the right device.Reported-by Aaron Erhardt <[email protected]>Tested-by Aaron Erhardt <[email protected]>Signed-off-by Mario Limonciello (AMD) <[email protected]>Quoted 4 lines
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.
Quoted 7 lines
Quoted 5 lines
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
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
Quoted 30 lines
Quoted 29 lines
Quoted 27 lines
Quoted 27 lines
---
drivers/pci/vgaarb.c| 7 -------1 file changed, 7 deletions(-)drivers/pci/vgaarb.c +0
-2@@ -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;
}Signature · 1 line
2.43.0
Signature · 6 lines
-- 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)
Quoted 37 lines · Thomas Zimmermann
Am 17.11.25 um 06:20 schrieb Mario Limonciello:
Quoted 29 lines · Mario Limonciello
Quoted 28 lines · Bjorn Helgaas
Quoted 19 lines
Quoted 9 lines · Mario Limonciello (AMD)
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_vgabecause 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.
Quoted 7 lines
As there is an accurate
boot_displaysysfs file stop lying aboutboot_vgaby assuming if nothing is found it's the right device.Reported-by Aaron Erhardt <[email protected]>Tested-by Aaron Erhardt <[email protected]>Signed-off-by Mario Limonciello (AMD) <[email protected]>Quoted 4 lines
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.
Quoted 6 lines
Quoted 4 lines
Fixes ad90860bd10ee ("fbcon: Use screen info to find primary device")But let's also make sure Thomas Zimmermann agrees with this change.
ping?
Quoted 8 lines
Sorry, this fell though the cracks. I can see that this backfires, but still
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.
Quoted 38 lines
Quoted 28 lines
Quoted 27 lines
Quoted 25 lines
Quoted 25 lines
---
drivers/pci/vgaarb.c| 7 -------1 file changed, 7 deletions(-)drivers/pci/vgaarb.c +0
-2@@ -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;
}Signature · 1 line
2.43.0Signature · 6 lines
-- 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)
Quoted 42 lines · Bjorn Helgaas
Quoted 41 lines · Thomas Zimmermann
Am 17.11.25 um 06:20 schrieb Mario Limonciello:
Quoted 29 lines · Mario Limonciello
Quoted 28 lines · Bjorn Helgaas
Quoted 19 lines
Quoted 9 lines · Mario Limonciello (AMD)
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_vgabecause 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.
Quoted 7 lines
As there is an accurate
boot_displaysysfs file stop lying aboutboot_vgaby assuming if nothing is found it's the right device.Reported-by Aaron Erhardt <[email protected]>Tested-by Aaron Erhardt <[email protected]>Signed-off-by Mario Limonciello (AMD) <[email protected]>Quoted 4 lines
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.
Quoted 6 lines
Quoted 4 lines
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
Quoted 8 lines
Quoted 4 lines
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.
Quoted 39 lines
Quoted 39 lines
Quoted 29 lines
Quoted 28 lines
Quoted 26 lines
Quoted 26 lines
--- drivers/pci/vgaarb.c | 7 ------- 1 file changed, 7 deletions(-)drivers/pci/vgaarb.c +0
-2@@ -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;
}Signature · 1 line
2.43.0Signature · 6 lines
-- 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)