summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2017-02-03 09:47:26 +0000
committerpatrick <patrick@openbsd.org>2017-02-03 09:47:26 +0000
commitf098301c61116d932546e9d32c879e5ff0f9001b (patch)
treea25c264f885caa6932c78e82b8ae85629ce79ca0
parentDon't use PTE_RPGN to mask away the lower page bits from a virtual (diff)
downloadwireguard-openbsd-f098301c61116d932546e9d32c879e5ff0f9001b.tar.xz
wireguard-openbsd-f098301c61116d932546e9d32c879e5ff0f9001b.zip
ARM64 has an 48-bit physical address space, so bump PTE_RPGN to reflect
it. Otherwise we might truncate physical addresses.
-rw-r--r--sys/arch/arm64/include/pte.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/arm64/include/pte.h b/sys/arch/arm64/include/pte.h
index 05b3d067a7d..78bb2588eb2 100644
--- a/sys/arch/arm64/include/pte.h
+++ b/sys/arch/arm64/include/pte.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pte.h,v 1.1 2016/12/17 23:38:33 patrick Exp $ */
+/* $OpenBSD: pte.h,v 1.2 2017/02/03 09:47:26 patrick Exp $ */
/*
* Copyright (c) 2014 Dale Rahn <drahn@dalerahn.com>
*
@@ -97,7 +97,7 @@
#define Ln_TABLE_MASK ((1 << 12) - 1)
/* physical page mask */
-#define PTE_RPGN 0x3ffffff000ULL
+#define PTE_RPGN (((1ULL << 48) - 1) & ~PAGE_MASK)
/* XXX */
#ifndef _LOCORE