From 529ceba1f90f995c690fdb71143bc4b293ace55e Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Fri, 11 Jul 2025 22:17:08 -0400 Subject: kernel/amd64: Return NULL if IA32_GS_BASE is unset Signed-off-by: Ian Moffett --- sys/arch/amd64/amd64/machdep.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sys') diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c index af00c5a..d310460 100644 --- a/sys/arch/amd64/amd64/machdep.c +++ b/sys/arch/amd64/amd64/machdep.c @@ -298,6 +298,10 @@ this_cpu(void) { struct cpu_info *ci; + if (rdmsr(IA32_GS_BASE) == 0) { + return NULL; + } + /* * This might look crazy but we are just leveraging the "m" * constraint to add the offset of the self field within -- cgit v1.2.3