git: 615f1b9eb17c - main - kern/amd64/machdep: Replace memset in wrmsr_early_safe_end
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 25 Mar 2026 02:25:41 UTC
The branch main has been updated by kevans:
URL: https://cgit.FreeBSD.org/src/commit/?id=615f1b9eb17c921bbcb0cce2b9ad61910361325b
commit 615f1b9eb17c921bbcb0cce2b9ad61910361325b
Author: Kristofer Peterson <kris@tranception.com>
AuthorDate: 2026-03-09 19:40:34 +0000
Commit: Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2026-03-25 02:24:17 +0000
kern/amd64/machdep: Replace memset in wrmsr_early_safe_end
GENERIC-KASAN kernel failed to boot on a Dell PowerEdge C6615 with
an AMD EPYC 8224P CPU; UEFI BIOS caught a #GP exception with %RIP
in kasan_memset where %GS relative pointer (curthread->td_pflags2)
was dereferenced. Investigation led to wrmsr_early_safe_end which
calls memset to clear early #GP IDT entry. Replacing memset with
__builtin_memset_inline still resulted in the compiler emitting a
call to the memset resolver in GENERIC-KASAN build and the kernel
stil faulted during boot. This version which has been successfully
tested with both GENERIC and GENERIC-KASAN kernels uses memset_early.
Signed-off-by: Kristofer Peterson <kris@tranception.com>
Reviewed-by: kib
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2069
---
sys/amd64/amd64/machdep.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index e9bb27a54dfb..78199cb2ac03 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -1850,7 +1850,7 @@ wrmsr_early_safe_end(void)
lidt(&wrmsr_early_safe_orig_efi_idt);
gpf_descr = &idt0[IDT_GP];
- memset(gpf_descr, 0, sizeof(*gpf_descr));
+ memset_early(gpf_descr, 0, sizeof(*gpf_descr));
}
#ifdef KDB