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: e941abd7ca ("ACPI: eliminate duplicate IVRS definitions")
Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
Acked-by: Roger Pau Monné <roger@xenproject.org>
This commit is contained in:
Stefano Stabellini committed 2026-10-23 17:25:20 -07:00
1 parent e4d90abb26
commit db85cf0d08
1 file changed
+2 -2
+2 -2
View File
@@ -414,8 +414,8 @@ static int __init parse_ivmd_block(const struct acpi_ivrs_memory *ivmd_block)
exclusion = true; exclusion = true;
else if ( ivmd_block->header.flags & ACPI_IVMD_UNITY ) else if ( ivmd_block->header.flags & ACPI_IVMD_UNITY )
{ {
iw = ivmd_block->header.flags & ACPI_IVMD_READ; iw = ivmd_block->header.flags & ACPI_IVMD_WRITE;
ir = ivmd_block->header.flags & ACPI_IVMD_WRITE; ir = ivmd_block->header.flags & ACPI_IVMD_READ;
} }
else else
{ {
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.