summaryrefslogtreecommitdiff
path: root/xen
diff options
context:
space:
mode:
Diffstat (limited to 'xen')
-rw-r--r--xen/drivers/passthrough/amd/iommu_guest.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/xen/drivers/passthrough/amd/iommu_guest.c b/xen/drivers/passthrough/amd/iommu_guest.c
index 30b7353cd6..2a3def9a5d 100644
--- a/xen/drivers/passthrough/amd/iommu_guest.c
+++ b/xen/drivers/passthrough/amd/iommu_guest.c
@@ -70,7 +70,8 @@ static void guest_iommu_disable(struct guest_iommu *iommu)
static uint64_t get_guest_cr3_from_dte(struct amd_iommu_dte *dte)
{
- return ((dte->gcr3_trp_51_31 << 31) | (dte->gcr3_trp_30_15 << 15) |
+ return (((uint64_t)dte->gcr3_trp_51_31 << 31) |
+ (dte->gcr3_trp_30_15 << 15) |
(dte->gcr3_trp_14_12 << 12)) >> PAGE_SHIFT;
}