]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
iommu/amd: Make CMD_INV_IOMMU_ALL_PAGES_ADDRESS match the spec
authorJason Gunthorpe <jgg@nvidia.com>
Fri, 27 Mar 2026 15:23:58 +0000 (12:23 -0300)
committerJoerg Roedel <joerg.roedel@amd.com>
Fri, 12 Jun 2026 07:47:46 +0000 (09:47 +0200)
The spec in Table 14 defines the "Entire Cache" case as having the low
12 bits as zero. Indeed the command format doesn't even have the low
12 bits. Since there is only one user now, fix the constant to have 0
in the low 12 bits instead of 1 and remove the masking.

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Wei Wang <wei.w.wang@hotmail.com>
Tested-by: Dheeraj Kumar Srivastava <dheerajkumar.srivastava@amd.com>
Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
drivers/iommu/amd/amd_iommu_types.h
drivers/iommu/amd/iommu.c

index 96038b2e24d58a742c09f62f462fd449d49ef2bf..093643061597978bfb3f613c2a45547eb3ca5f81 100644 (file)
 #define PPR_STATUS_MASK                        0xf
 #define PPR_STATUS_SHIFT               12
 
-#define CMD_INV_IOMMU_ALL_PAGES_ADDRESS        0x7fffffffffffffffULL
+#define CMD_INV_IOMMU_ALL_PAGES_ADDRESS        0x7ffffffffffff000ULL
 
 /* macros and definitions for device table entries */
 #define DEV_ENTRY_VALID         0x00
index 703cbb84953b5fdb3a77d6b9b92e694aaeab4efa..15bd0f3e22ccd8d415389aa1cba6fcc3c9bf89aa 100644 (file)
@@ -1288,7 +1288,7 @@ static inline u64 build_inv_address(u64 address, u64 last)
         *
         */
        if (unlikely(sz_lg2 > 52))
-               return (CMD_INV_IOMMU_ALL_PAGES_ADDRESS & PAGE_MASK) |
+               return CMD_INV_IOMMU_ALL_PAGES_ADDRESS |
                       CMD_INV_IOMMU_PAGES_SIZE_MASK;
 
        /*