[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen stable-4.21] xen/amd/iommu: Don't swap the IVMD read and write permissions



commit 0e41d50ed21874e9230eb73798582d5320277a1b
Author:     Stefano Stabellini <stefano.stabellini@xxxxxxx>
AuthorDate: Thu Oct 29 13:25:13 2026 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Oct 29 13:25:13 2026 +0100

    xen/amd/iommu: Don't swap the IVMD read and write permissions
    
    Per the IVMD Flags definition, bit 1 is IR and bit 2 is IW, matching
    ACPI_IVMD_READ and ACPI_IVMD_WRITE.  parse_ivmd_block() takes iw from
    the former and ir from the latter, so a unity range firmware declares
    read-only is mapped write-only, and vice versa.
    
    Ranges with both permissions, including Xen's own, are unaffected.
    
    Fixes: e941abd7cab1 ("ACPI: eliminate duplicate IVRS definitions")
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>
    Reviewed-by: Teddy Astie <teddy.astie@xxxxxxxxxx>
    Acked-by: Roger Pau Monné <roger@xxxxxxxxxxxxxx>
    master commit: db85cf0d08a318444b4c28a0fc5fcb125e679a11
    master date: 2026-10-23 17:25:20 -0700
---
 xen/drivers/passthrough/amd/iommu_acpi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_acpi.c 
b/xen/drivers/passthrough/amd/iommu_acpi.c
index 39ae637959..d118b36d80 100644
--- a/xen/drivers/passthrough/amd/iommu_acpi.c
+++ b/xen/drivers/passthrough/amd/iommu_acpi.c
@@ -414,8 +414,8 @@ static int __init parse_ivmd_block(const struct 
acpi_ivrs_memory *ivmd_block)
         exclusion = true;
     else if ( ivmd_block->header.flags & ACPI_IVMD_UNITY )
     {
-        iw = ivmd_block->header.flags & ACPI_IVMD_READ;
-        ir = ivmd_block->header.flags & ACPI_IVMD_WRITE;
+        iw = ivmd_block->header.flags & ACPI_IVMD_WRITE;
+        ir = ivmd_block->header.flags & ACPI_IVMD_READ;
     }
     else
     {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.