From a497caadad91824da9773da255c25d0e9b984984 Mon Sep 17 00:00:00 2001 From: Owen Smith Date: Tue, 20 Jun 2023 15:33:19 +0100 Subject: [PATCH] Only call EvtchnFlush on valid Cpus The Evtchn processor array is created using KeQueryMaximumProcessorCountEx, which can include processors that do not get initialized. Skip cleanup and flushing uninitialized event channels Signed-off-by: Owen Smith Use EvtchnIsProcessorEnabled() rather than SystemProcessorVcpuId() as the test. Signed-off-by: Paul Durrant --- src/xenbus/evtchn.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/xenbus/evtchn.c b/src/xenbus/evtchn.c index 2e63edb..9f7026d 100644 --- a/src/xenbus/evtchn.c +++ b/src/xenbus/evtchn.c @@ -1753,6 +1753,9 @@ EvtchnRelease( for (Cpu = 0; Cpu < Context->ProcessorCount; Cpu++) { PXENBUS_EVTCHN_PROCESSOR Processor; + if (!EvtchnIsProcessorEnabled(Context, Cpu)) + continue; + ASSERT(Context->Processor != NULL); Processor = &Context->Processor[Cpu]; -- 2.39.5