summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2020-04-19 19:29:53 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2020-04-19 19:29:53 +0000
commitab44d15883bc339365c22a203923ac8fee64be6a (patch)
treea96701dd5f48faec230ff5eb41dbd54400fd3e92 /sys/arch/amd64
parent2840c89697e3be98f1bf84a7264fa4a41df72454 (diff)
(1 << 39) is not well defined on a 32-bit int. Use same casts for
low_mask as already used on high_mask to convince compiler to use 64 bits. CID 1480717 CID 1480778 ok pd@
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/vmm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/amd64/amd64/vmm.c b/sys/arch/amd64/amd64/vmm.c
index f308948ef4f..84fcb23a5af 100644
--- a/sys/arch/amd64/amd64/vmm.c
+++ b/sys/arch/amd64/amd64/vmm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmm.c,v 1.272 2020/04/19 13:44:14 krw Exp $ */
+/* $OpenBSD: vmm.c,v 1.273 2020/04/19 19:29:52 krw Exp $ */
/*
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
*
@@ -4448,7 +4448,7 @@ vmm_translate_gva(struct vcpu *vcpu, uint64_t va, uint64_t *pa, int mode)
}
}
- low_mask = (1 << shift) - 1;
+ low_mask = ((uint64_t)1ULL << shift) - 1;
high_mask = (((uint64_t)1ULL << ((pte_size * 8) - 1)) - 1) ^ low_mask;
*pa = (pte & high_mask) | (va & low_mask);