From 0e2deb640007fc4ce4bbc5b0eecb67175c6af52f Mon Sep 17 00:00:00 2001 From: deraadt Date: Mon, 17 Apr 2023 00:03:59 +0000 Subject: [PATCH] IDTVEC_NOALIGN() was the incorrect way to create a label in two places, use GENTRY() instead. Also add two endbr64 which cannot be supplied by macros ok guenther --- sys/arch/amd64/amd64/locore.S | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/arch/amd64/amd64/locore.S b/sys/arch/amd64/amd64/locore.S index 50e6f07ca37..cbdaccb65fe 100644 --- a/sys/arch/amd64/amd64/locore.S +++ b/sys/arch/amd64/amd64/locore.S @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.S,v 1.132 2023/01/20 16:01:04 deraadt Exp $ */ +/* $OpenBSD: locore.S,v 1.133 2023/04/17 00:03:59 deraadt Exp $ */ /* $NetBSD: locore.S,v 1.13 2004/03/25 18:33:17 drochner Exp $ */ /* @@ -540,6 +540,7 @@ XUsyscall_meltdown: * In case the CPU speculates past the mov to cr3, we put a * retpoline-style pause-lfence-jmp-to-pause loop. */ + endbr64 swapgs movq %rax,CPUVAR(SCRATCH) movq CPUVAR(KERN_CR3),%rax @@ -551,11 +552,12 @@ KUTEXT_PAGE_END KTEXT_PAGE_START .align NBPG, 0xcc -IDTVEC_NOALIGN(syscall_meltdown) +GENTRY(Xsyscall_meltdown) /* pad to match real Xsyscall_meltdown positioning above */ movq CPUVAR(KERN_CR3),%rax movq %rax,%cr3 -IDTVEC_NOALIGN(syscall) +GENTRY(Xsyscall) + endbr64 swapgs movq %rax,CPUVAR(SCRATCH) SYSCALL_ENTRY /* create trapframe */ -- 2.20.1