From 531a027122fb6838afb45c9a59d42be5210603ed Mon Sep 17 00:00:00 2001 From: "Chloe M." Date: Tue, 23 Jun 2026 22:05:02 +0000 Subject: [PATCH] stos/amd64: cpu: Default to IRQL_PASSIVE on startup We cannot be certain that the CR8 register will be zeroed by the time we have control passed to us, therefore it is wise to set it ourselves. Signed-off-by: Chloe M. --- paw/stos/arch/amd64/cpu/init.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/paw/stos/arch/amd64/cpu/init.c b/paw/stos/arch/amd64/cpu/init.c index 7c16d45..02ec45e 100644 --- a/paw/stos/arch/amd64/cpu/init.c +++ b/paw/stos/arch/amd64/cpu/init.c @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -122,4 +123,11 @@ HalKpcrP1Init(KPCR *Kpcr) MdVectorInit(); MdIdtLoad(); + /* Default to IRQL_PASSIVE */ + ASMV( + "mov %0, %%cr8" + : + : "r" ((UQUAD)IRQL_PASSIVE) + : "memory" + ); }