diff options
author | Ian Moffett <ian@osmora.org> | 2025-07-11 22:17:08 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-07-13 03:30:26 -0400 |
commit | 529ceba1f90f995c690fdb71143bc4b293ace55e (patch) | |
tree | 3b53cececedd5a8a9b87ddeaa1a31f4a4b33ff3a /sys/arch | |
parent | 27d410ab748905a21204f5a5749c175df4e4d988 (diff) |
kernel/amd64: Return NULL if IA32_GS_BASE is unset
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/amd64/amd64/machdep.c | 4 |
1 files changed, 4 insertions, 0 deletions
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 |