summaryrefslogtreecommitdiff
path: root/arch/arm64/include/asm/processor.h
diff options
context:
space:
mode:
authorMark Rutland <mark.rutland@arm.com>2018-04-12 14:11:00 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-20 09:20:42 +0300
commitc910086de5c484cc435c35017b3d222be652872c (patch)
treecd48efbf70b5c9b0f458cd640cd266aee8406ebd /arch/arm64/include/asm/processor.h
parent27eeceda11e50477b11a35573776c4622aff5c29 (diff)
downloadlinux-c910086de5c484cc435c35017b3d222be652872c.tar.xz
arm64: Make USER_DS an inclusive limit
From: Robin Murphy <robin.murphy@arm.com> commit 51369e398d0d33e8f524314e672b07e8cf870e79 upstream. Currently, USER_DS represents an exclusive limit while KERNEL_DS is inclusive. In order to do some clever trickery for speculation-safe masking, we need them both to behave equivalently - there aren't enough bits to make KERNEL_DS exclusive, so we have precisely one option. This also happens to correct a longstanding false negative for a range ending on the very top byte of kernel memory. Mark Rutland points out that we've actually got the semantics of addresses vs. segments muddled up in most of the places we need to amend, so shuffle the {USER,KERNEL}_DS definitions around such that we can correct those properly instead of just pasting "-1"s everywhere. Signed-off-by: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> [v4.9: avoid dependence on TTBR0 SW PAN and THREAD_INFO_IN_TASK_STRUCT] Signed-off-by: Mark Rutland <mark.rutland@arm.com> [v4.9 backport] Tested-by: Greg Hackmann <ghackmann@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/arm64/include/asm/processor.h')
-rw-r--r--arch/arm64/include/asm/processor.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h
index 4258f4d594b5..5917147af0c4 100644
--- a/arch/arm64/include/asm/processor.h
+++ b/arch/arm64/include/asm/processor.h
@@ -21,6 +21,9 @@
#define TASK_SIZE_64 (UL(1) << VA_BITS)
+#define KERNEL_DS UL(-1)
+#define USER_DS (TASK_SIZE_64 - 1)
+
#ifndef __ASSEMBLY__
/*