The 64-bit key used by vtd_lookup_iotlb() to search the cached mappings is formed by combining the GFN, source id and the page level. To cover 57-bit IOVA, the shift of source id and of page level need to be enlarged by 9 - the stride of one paging structure level.
Signed-off-by: Yu Zhang <[email protected]> --- Cc: "Michael S. Tsirkin" <[email protected]> Cc: Marcel Apfelbaum <[email protected]> Cc: Paolo Bonzini <[email protected]> Cc: Richard Henderson <[email protected]> Cc: Eduardo Habkost <[email protected]> Cc: Peter Xu <[email protected]> --- hw/i386/intel_iommu_internal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_internal.h index a7ef24b..2b29b6f 100644 --- a/hw/i386/intel_iommu_internal.h +++ b/hw/i386/intel_iommu_internal.h @@ -114,8 +114,8 @@ VTD_INTERRUPT_ADDR_FIRST + 1) /* The shift of source_id in the key of IOTLB hash table */ -#define VTD_IOTLB_SID_SHIFT 36 -#define VTD_IOTLB_LVL_SHIFT 52 +#define VTD_IOTLB_SID_SHIFT 45 +#define VTD_IOTLB_LVL_SHIFT 61 #define VTD_IOTLB_MAX_SIZE 1024 /* Max size of the hash table */ /* IOTLB_REG */ -- 1.9.1
