From ea711415c49d27f4a3c0c050d0d5e801f3bde412 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 2 Mar 2024 13:49:21 +0200 Subject: [PATCH] [NTOS:KE/x64] Lower IRQL to passive while running idle function --- ntoskrnl/ke/amd64/stubs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ntoskrnl/ke/amd64/stubs.c b/ntoskrnl/ke/amd64/stubs.c index 7bfdb98f00e..98c420ade8f 100644 --- a/ntoskrnl/ke/amd64/stubs.c +++ b/ntoskrnl/ke/amd64/stubs.c @@ -156,9 +156,15 @@ KiIdleLoop(VOID) { Prcb->IdleHalt = 1; + /* Lower IRQL to passive */ + KeLowerIrql(PASSIVE_LEVEL); + /* Continue staying idle. Note the HAL returns with interrupts on */ Prcb->PowerState.IdleFunction(&Prcb->PowerState); + /* Raise IRQL back to DISPATCH_LEVEL */ + KfRaiseIrql(DISPATCH_LEVEL); + Prcb->IdleHalt = 0; } }