summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/relocate_kernel_64.S
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2022-03-08 16:30:36 +0100
committerPeter Zijlstra <peterz@infradead.org>2022-03-15 10:32:39 +0100
commitaf22700390c2f1d92dadd3eedf2738525a3a2f3a (patch)
tree6535421fd452e6eb54f4cb2aef55782d7ee34949 /arch/x86/kernel/relocate_kernel_64.S
parent991625f3dd2cbc4b787deb0213e2bcf8fa264b21 (diff)
downloadlinux-af22700390c2f1d92dadd3eedf2738525a3a2f3a.tar.bz2
x86/ibt,kexec: Disable CET on kexec
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Josh Poimboeuf <jpoimboe@redhat.com> Link: https://lore.kernel.org/r/20220308154318.641454603@infradead.org
Diffstat (limited to 'arch/x86/kernel/relocate_kernel_64.S')
-rw-r--r--arch/x86/kernel/relocate_kernel_64.S8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/x86/kernel/relocate_kernel_64.S b/arch/x86/kernel/relocate_kernel_64.S
index 399f075ccdc4..5b65f6ec5ee6 100644
--- a/arch/x86/kernel/relocate_kernel_64.S
+++ b/arch/x86/kernel/relocate_kernel_64.S
@@ -115,6 +115,14 @@ SYM_CODE_START_LOCAL_NOALIGN(identity_mapped)
pushq %rdx
/*
+ * Clear X86_CR4_CET (if it was set) such that we can clear CR0_WP
+ * below.
+ */
+ movq %cr4, %rax
+ andq $~(X86_CR4_CET), %rax
+ movq %rax, %cr4
+
+ /*
* Set cr0 to a known state:
* - Paging enabled
* - Alignment check disabled