Skip to content

Commit 6078b0f

Browse files
committed
Log fsgsbase support configuration
1 parent 5fcb259 commit 6078b0f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

kos/src/kernel/core/arch/i386/misc/fsgsbase.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#ifdef __x86_64__
2929

3030
#include <kernel/panic.h>
31+
#include <kernel/printk.h>
3132
#include <kernel/types.h>
3233
#include <kernel/x86/cpuid.h>
3334
#include <kernel/x86/fsgsbase.h> /* x86_fsgsbase_patch() */
@@ -190,11 +191,13 @@ NOTHROW(KCALL x86_initialize_fsgsbase)(void) {
190191
/* Check if our CPU supports fsgsbase. If it does, the we don't have
191192
* to do anything, and we can NOP out calls to `x86_fsgsbase_patch()' */
192193
if (X86_HAVE_FSGSBASE) {
194+
printk(FREESTR(KERN_INFO "[fsgsbase] Supported by CPU\n"));
193195
*((byte_t *)&x86_fsgsbase_patch + 0) = 0xc3; /* ret */
194196
return;
195197
}
196198

197199
/* Patch all fsgsbase instructions within the kernel core. */
200+
printk(FREESTR(KERN_INFO "[fsgsbase] Not supported by CPU (patching kernel for MSR usage...)\n"));
198201
for (iter = __x86_fixup_fsgsbase_start;
199202
iter < __x86_fixup_fsgsbase_end; ++iter) {
200203
void *pc = (byte_t *)KERNEL_CORE_BASE + *iter;

0 commit comments

Comments
 (0)