Skip to contentSkip to conversation

PCI/VGA: Don't assume the only VGA device on a system is `boot_vga`

PATCH Superseded Mario Limonciello (AMD) 3 participants 7 messages Oct 29, 2025 – Nov 17, 2025 PCI

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

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
index 436fa7f4c3873..baa242b140993 100644
@@ -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
#1 lore raw
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_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.

Quoted 7 lines

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.

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
index 436fa7f4c3873..baa242b140993 100644
@@ -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
#2 lore raw

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

Quoted 7 lines

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.

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.

Fixes ad90860bd10ee ("fbcon: Use screen info to find primary device")

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
index 436fa7f4c3873..baa242b140993 100644
@@ -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
#3 lore raw
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_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.

Quoted 7 lines

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.

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
index 436fa7f4c3873..baa242b140993 100644
@@ -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
#4 lore raw

Hi

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

Quoted 7 lines

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.

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
index 436fa7f4c3873..baa242b140993 100644
@@ -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)
#5 lore raw
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_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.

Quoted 7 lines

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.

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
index 436fa7f4c3873..baa242b140993 100644
@@ -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)
#6 lore raw
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_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.

Quoted 7 lines

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.

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
index 436fa7f4c3873..baa242b140993 100644
@@ -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)