On Mon, Jan 19, 2026 at 03:48:01PM +0100, Jan Beulich wrote:
> 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().
>
> Fixes: a845b50c12f3 ("vpci/header: Emulate extended capability list for dom0")
> Signed-off-by: Jan Beulich <[email protected]>
>
> --- a/xen/drivers/vpci/header.c
> +++ b/xen/drivers/vpci/header.c
> @@ -830,9 +830,14 @@ static int vpci_init_ext_capability_list
> unsigned int pos = PCI_CFG_SPACE_SIZE;
>
> if ( !is_hardware_domain(pdev->domain) )
> + {
> + if ( !pdev->ext_cfg )
> + return 0;
Don't you want to possibly put this as a top-level check, so if
there's no extended config space we avoid doing the PCI_CFG_SPACE_SIZE
read for dom0 also?
Thanks, Roger.