]> xenbits.xensource.com Git - pvdrivers/win/xenbus.git/commitdiff
Fix EvtchnTwoLevelIsProcessorEnabled()
authorPaul Durrant <pdurrant@amazon.com>
Tue, 4 Jul 2023 17:21:29 +0000 (18:21 +0100)
committerPaul Durrant <pdurrant@amazon.com>
Tue, 4 Jul 2023 17:21:29 +0000 (18:21 +0100)
It should take account of whether the vCPU is enabled, as
EvtchnFifoIsProcessorEnabled() already does.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
src/xenbus/evtchn_2l.c

index f63ef3e33ea2e86821f890a044342a7cc3fe672a..6585f73579b64587316700753428dd4942a7439e 100644 (file)
@@ -72,10 +72,15 @@ EvtchnTwoLevelIsProcessorEnabled(
     IN  ULONG                       Index
     )
 {
+    unsigned int                    vcpu_id;
+    NTSTATUS                        status;
+
     UNREFERENCED_PARAMETER(_Context);
     UNREFERENCED_PARAMETER(Index);
 
-    return TRUE;
+    status = SystemProcessorVcpuId(Index, &vcpu_id);
+
+    return NT_SUCCESS(status) ? TRUE : FALSE;
 }
 
 static BOOLEAN