vPCI: really no ext-caps without extended config space

For DomU-s, whether to emulate accesses to the first 32 bits of extended
config space as read-as-zero or read-as-all-ones depends on whether a
device actually has extended config space. If it doesn't, read-as-zero
isn't correct; not getting this right may confuse functions like Linux
6.19-rc's pci_ext_cfg_is_aliased().

For Dom0 this then simply allows dropping a later conditional.

Fixes: a845b50c12 ("vpci/header: Emulate extended capability list for dom0")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
This commit is contained in:
Jan Beulich committed 2026-02-02 10:20:54 +01:00
1 parent b1543cf575
commit 873c3db6d2
1 file changed
+6 -4
+6 -4
View File
@@ -829,6 +829,9 @@ static int vpci_init_ext_capability_list(const struct pci_dev *pdev)
{
unsigned int pos = PCI_CFG_SPACE_SIZE;
if ( !pdev->ext_cfg )
return 0;
if ( !is_hardware_domain(pdev->domain) )
/* Extended capabilities read as zero, write ignore for DomU */
return vpci_add_register(pdev->vpci, vpci_read_val, NULL,
@@ -841,10 +844,9 @@ static int vpci_init_ext_capability_list(const struct pci_dev *pdev)
if ( header == 0xffffffffU )
{
if ( pos != PCI_CFG_SPACE_SIZE )
printk(XENLOG_WARNING
"%pd %pp: broken extended cap list, offset %#x\n",
pdev->domain, &pdev->sbdf, pos);
printk(XENLOG_WARNING
"%pd %pp: broken extended cap list, offset %#x\n",
pdev->domain, &pdev->sbdf, pos);
return 0;
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.