Re: [PATCH 4/5] vtd: Don't disable hwdom passthrough on unhandled SAGAW bits

Jan Beulich <[email protected]> Wed, 5 Aug 2026 11:41:16 +0200
Newsgroups gmane.comp.emulators.xen.devel
Message-ID <[email protected]>
On 29.07.2026 11:59, Teddy Astie wrote:
> On recent VT-d spec, bit 3 indicates support for 5-level pagetables,
> this is currently considered unhandled and causes "hwdom passthrough"
> to be disabled, even though it's unrelated.
> 
> Given these are is capability bits, we don't need to consider unhandled
> bits, but only make sure that the ones we want (e.g 39-bit or 48-bit AGAW)
> are set.
> 
> Fixes: 474fc7d3c652 ("iommu/vt-d: fix SAGAW capability parsing")

The description of that commit explains pretty well why pass-through mode
does need disabling in that case. If there's anything wrong with that
explanation, this would need calling out here.

Additionally I can only repeat my proposal to finally default to strict
mode. In strict mode, pass-through mode is disabled anyway. (IOW there's
the additional question of why you need pass-through mode in the first
place.)

> --- a/xen/drivers/passthrough/vtd/iommu.c
> +++ b/xen/drivers/passthrough/vtd/iommu.c
> @@ -1327,14 +1327,7 @@ int __init iommu_alloc(struct acpi_drhd_unit *drhd)
>      }
>  
>      if ( sagaw >> 3 )
> -    {
> -        printk_once(XENLOG_WARNING VTDPREFIX
> -                    " Unhandled bits in SAGAW %#x%s\n",
> -                    sagaw,
> -                    iommu_hwdom_passthrough ? ", disabling passthrough" : "");
> -
> -        iommu_hwdom_passthrough = false;
> -    }
> +        printk_once(XENLOG_WARNING VTDPREFIX " Unhandled bits in SAGAW %#x\n", sagaw);

Also please adhere to the line length limit.

Jan