From: Owen Smith Date: Tue, 20 Jun 2023 14:33:19 +0000 (+0100) Subject: Only call EvtchnFlush on valid Cpus X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=a497caadad91824da9773da255c25d0e9b984984;p=pvdrivers%2Fwin%2Fxenbus.git 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 --- 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];