summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-06-22 03:22:52 -0400
committerIan Moffett <ian@osmora.org>2025-06-22 03:23:29 -0400
commitde130e9873a1f2e3c275c0f091482e9e18e05466 (patch)
treeda71f3bdd9ff75c8053e7d8d865b131dfd10098e
parentbee68b89ef60aa40cbefe305c7f0c738cf3c2a9d (diff)
kernel/amd64: Only print SIMD logs on BSP init
Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r--sys/arch/amd64/amd64/machdep.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index a99c4bd..8258f8e 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -47,6 +47,10 @@
#define pr_trace(fmt, ...) kprintf("cpu: " fmt, ##__VA_ARGS__)
#define pr_error(...) pr_trace(__VA_ARGS__)
+#define pr_trace_bsp(...) \
+ if (!bsp_init) { \
+ pr_trace(__VA_ARGS__); \
+ }
#define HALT_VECTOR 0x21
#define TLB_VECTOR 0x22
@@ -63,6 +67,7 @@ void syscall_isr(void);
void pin_isr_load(void);
struct cpu_info g_bsp_ci = {0};
+static bool bsp_init = false;
__attribute__((__interrupt__))
static void
@@ -165,11 +170,11 @@ enable_simd(void)
int retval;
if ((retval = simd_init()) < 0) {
- pr_error("SIMD not supported\n");
+ pr_trace_bsp("SIMD not supported\n");
}
if (retval == 1) {
- pr_trace("SSE enabled but not AVX\n");
+ pr_trace_bsp("SSE enabled but not AVX\n");
}
}
@@ -310,4 +315,8 @@ cpu_startup(struct cpu_info *ci)
enable_simd();
lapic_init();
+
+ if (!bsp_init) {
+ bsp_init = true;
+ }
}