[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Only call EvtchnFlush on valid Cpus


  • To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Paul Durrant <xadimgnik@xxxxxxxxx>
  • Date: Mon, 3 Jul 2023 18:13:31 +0100
  • Delivery-date: Mon, 03 Jul 2023 17:13:39 +0000
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

On 03/07/2023 17:46, Paul Durrant wrote:
On 20/06/2023 15:33, Owen Smith wrote:
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 <owen.smith@xxxxxxxxx>

Acked-by: Paul Durrant <paul@xxxxxxx>


Actually, taking another look I think we should actually fix EvtchnTwoLevelIsProcessorEnabled() to check SystemProcessorVcpuId() rather than blindly returning TRUE (the FIFO variant already checks) and then we can use EvtchnIsProcessorEnabled()...

---
  src/xenbus/evtchn.c | 6 ++++++
  1 file changed, 6 insertions(+)

diff --git a/src/xenbus/evtchn.c b/src/xenbus/evtchn.c
index 2e63edb..ec4ac28 100644
--- a/src/xenbus/evtchn.c
+++ b/src/xenbus/evtchn.c
@@ -1752,10 +1752,16 @@ EvtchnRelease(
      for (Cpu = 0; Cpu < Context->ProcessorCount; Cpu++) {
          PXENBUS_EVTCHN_PROCESSOR Processor;
+        unsigned int             vcpu_id;
+        NTSTATUS                 status;
          ASSERT(Context->Processor != NULL);
          Processor = &Context->Processor[Cpu];
+        status = SystemProcessorVcpuId(Cpu, &vcpu_id);

... here instead. I'll send a follow-up patch.

  Paul

+        if (!NT_SUCCESS(status))
+            continue;
+
          EvtchnFlush(Context, Cpu);
          (VOID) KeRemoveQueueDpc(&Processor->Dpc);





 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.