On 21/01/2025 9:57 am, Roger Pau Monne wrote:
> diff --git a/xen/drivers/passthrough/amd/iommu_intr.c 
> b/xen/drivers/passthrough/amd/iommu_intr.c
> index 7fc796dec25b..efa9ddc62458 100644
> --- a/xen/drivers/passthrough/amd/iommu_intr.c
> +++ b/xen/drivers/passthrough/amd/iommu_intr.c
> @@ -223,14 +224,36 @@ static void update_intremap_entry(const struct 
> amd_iommu *iommu,
>              },
>          };
>  
> -        ASSERT(!entry.ptr128->full.remap_en);
> -        entry.ptr128->raw[1] = irte.raw[1];
> -        /*
> -         * High half needs to be set before low one (containing RemapEn).  
> See
> -         * comment in free_intremap_entry() regarding the choice of barrier.
> -         */
> -        smp_wmb();
> -        ACCESS_ONCE(entry.ptr128->raw[0]) = irte.raw[0];
> +        if ( cpu_has_cx16 )

cx16 is always available.  Teddy even submitted patches, but it looks
like they succumbed.

We need to take Teddy's patches, then ~half this one.

As proved by this patch alone, it's already hard enough getting this
right, without introducing dead logic paths into the mix.

~Andrew

Reply via email to