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

[PATCH] Remove MRSW shared acquire from VifReceiverReturnPacket


  • To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
  • Date: Mon, 18 May 2026 11:39:51 +0200
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Feedback-ID"
  • Cc: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>, Owen Smith <owen.smith@xxxxxxxxxx>
  • Delivery-date: Mon, 18 May 2026 09:40:07 +0000
  • Feedback-id: default:8631fc262581453bbf619ec5b2062170:Sweego
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

VifReceiverReturnPacket may be called early/late during the enable/
disable sequence respectively. Notably, this can happen during the
exclusive window of VifEnable/VifDisable, and so acquiring a shared lock
via spinning will cause a deadlock.

As ReceiverReturnPacket is protected by the VIF refcount (and in fact
can be called regardless of enabled/disabled state), remove the MRSW
shared lock requirement from it.

Reported-by: Owen Smith <owen.smith@xxxxxxxxxx>
Signed-off-by: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
---
 src/xenvif/vif.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/src/xenvif/vif.c b/src/xenvif/vif.c
index 6782cc7..38b6b71 100644
--- a/src/xenvif/vif.c
+++ b/src/xenvif/vif.c
@@ -565,13 +565,8 @@ VifReceiverReturnPacket(
 {
     PXENVIF_VIF_CONTEXT Context = Interface->Context;
 
-    // Called from MINIPORT_RETURN_NET_BUFFER_LISTS
-    SpinAcquireMrswLockShared(&Context->Lock);
-
     ReceiverReturnPacket(FrontendGetReceiver(Context->Frontend),
                          Cookie);
-
-    ReleaseMrswLockShared(&Context->Lock);
 }
 
 static NTSTATUS
-- 
2.54.0.windows.1



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech

 


Rackspace

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