From win-pv-devel-bounces@lists.xenproject.org Mon Jan 04 13:15:46 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 04 Jan 2016 13:15:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aG4zA-0001hh-09; Mon, 04 Jan 2016 13:15:44 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aG4z8-0001hZ-6k
	for win-pv-devel@lists.xenproject.org; Mon, 04 Jan 2016 13:15:42 +0000
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	FE/6E-25438-8707A865; Mon, 04 Jan 2016 13:15:36 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1451913331!14500539!1
X-Originating-IP: [209.85.192.50]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 60706 invoked from network); 4 Jan 2016 13:15:32 -0000
Received: from mail-qg0-f50.google.com (HELO mail-qg0-f50.google.com)
	(209.85.192.50)
	by server-9.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 4 Jan 2016 13:15:32 -0000
Received: by mail-qg0-f50.google.com with SMTP id o11so253304366qge.2
	for <win-pv-devel@lists.xenproject.org>;
	Mon, 04 Jan 2016 05:15:32 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=WyIY4lULiuqABuvtv/cm0wTSfoiFb35pr/0G0OXc+Dg=;
	b=SHLAchU2n8vFYZiW3jZXlDmJ0PfgDXzUbrMTEefXxI2F2ycO1iOB0E5UBYLJAUQM1O
	fCKcf+0VLPbJcgZwCaXEx7ek9rh2kBzYvQjb1dMPVQK5crc8L7EU4Uz9cPHj4t3fWm+v
	ncyIT50rNDBPPEGO1Ye4ezPXb3I1iWczlPCeZKaC9Mb4uavGmwGol5fstSUjFJzwT6HU
	zAjLIwEMNUMEIAhe9pP+l1J/4/1E7hHk3FZ2nP6Kep2ibV/BiZ6bgJPjF1gDZgrzqlT5
	MOVA+T6QrsnCQROmrTHDd3C7VWJxhqdmBHy1tKeb2vJ0wb83r4JHxlUBQr1GWhtM4onl
	gX2Q==
X-Received: by 10.140.171.9 with SMTP id r9mr123658465qhr.93.1451913331468;
	Mon, 04 Jan 2016 05:15:31 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	h99sm22975023qge.7.2016.01.04.05.15.30
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Mon, 04 Jan 2016 05:15:31 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Mon,  4 Jan 2016 13:15:50 +0000
Message-Id: <1451913350-19380-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Update VIF interface to version 5
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Unfortunately VIF interface version 4 suffers from a shutdown race with
the TransmitterQueuePacket method. If a call to this races with the Disable
method then a NULL callback function pointer can be invoked.
This patch fixes the race by having TransmitterQueuePacket return a status
code to indicate whether a packet has been queued (rather than invoking the
completion callback if it has not), but this necessitates a interface change
so the VIF interface version is also updated to 5 and a new PDO revision is
added.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 include/revision.h      |  3 +-
 include/vif_interface.h | 48 ++++++++++++++++++++++++++--
 src/xenvif/vif.c        | 83 ++++++++++++++++++++++++++++++++++++++++++++++++-
 3 files changed, 129 insertions(+), 5 deletions(-)

diff --git a/include/revision.h b/include/revision.h
index eda8871..78de3a1 100644
--- a/include/revision.h
+++ b/include/revision.h
@@ -43,7 +43,8 @@
     DEFINE_REVISION(0x08000002,  1,  2,  0,  0),    \
     DEFINE_REVISION(0x08000003,  1,  3,  0,  0),    \
     DEFINE_REVISION(0x08000004,  1,  3,  2,  1),    \
-    DEFINE_REVISION(0x08000006,  1,  4,  2,  1)
+    DEFINE_REVISION(0x08000006,  1,  4,  2,  1),    \
+    DEFINE_REVISION(0x08000007,  1,  5,  2,  1)
 
 // Revision 0x08000005 is already in use in the staging-8.1 branch.
 
diff --git a/include/vif_interface.h b/include/vif_interface.h
index 27c5d2d..5a064fd 100644
--- a/include/vif_interface.h
+++ b/include/vif_interface.h
@@ -460,6 +460,19 @@ typedef NTSTATUS
     IN  PLIST_ENTRY List
     );
 
+typedef VOID
+(*XENVIF_VIF_TRANSMITTER_QUEUE_PACKET_V4)(
+    IN  PINTERFACE                  Interface,
+    IN  PMDL                        Mdl,
+    IN  ULONG                       Offset,
+    IN  ULONG                       Length,
+    IN  XENVIF_VIF_OFFLOAD_OPTIONS  OffloadOptions,
+    IN  USHORT                      MaximumSegmentSize,
+    IN  USHORT                      TagControlInformation,
+    IN  PXENVIF_PACKET_HASH         Hash,
+    IN  PVOID                       Cookie
+    );
+
 /*! \typedef XENVIF_VIF_TRANSMITTER_QUEUE_PACKET
     \brief Queue a packet at the provider's transmit side
 
@@ -473,7 +486,7 @@ typedef NTSTATUS
     \param Hash Hash information for the packet
     \param Cookie A cookie specified by the caller that will be passed to the XENVIF_TRANSMITTER_RETURN_PACKET callback
 */
-typedef VOID
+typedef NTSTATUS
 (*XENVIF_VIF_TRANSMITTER_QUEUE_PACKET)(
     IN  PINTERFACE                  Interface,
     IN  PMDL                        Mdl,
@@ -766,6 +779,35 @@ struct _XENVIF_VIF_INTERFACE_V4 {
     XENVIF_VIF_RECEIVER_SET_OFFLOAD_OPTIONS         ReceiverSetOffloadOptions;
     XENVIF_VIF_RECEIVER_SET_BACKFILL_SIZE           ReceiverSetBackfillSize;
     XENVIF_VIF_RECEIVER_QUERY_RING_SIZE             ReceiverQueryRingSize;
+    XENVIF_VIF_TRANSMITTER_QUEUE_PACKET_V4          TransmitterQueuePacketVersion4;
+    XENVIF_VIF_TRANSMITTER_QUERY_OFFLOAD_OPTIONS    TransmitterQueryOffloadOptions;
+    XENVIF_VIF_TRANSMITTER_QUERY_LARGE_PACKET_SIZE  TransmitterQueryLargePacketSize;
+    XENVIF_VIF_TRANSMITTER_QUERY_RING_SIZE          TransmitterQueryRingSize;
+    XENVIF_VIF_MAC_QUERY_STATE                      MacQueryState;
+    XENVIF_VIF_MAC_QUERY_MAXIMUM_FRAME_SIZE         MacQueryMaximumFrameSize;
+    XENVIF_VIF_MAC_QUERY_PERMANENT_ADDRESS          MacQueryPermanentAddress;
+    XENVIF_VIF_MAC_QUERY_CURRENT_ADDRESS            MacQueryCurrentAddress;
+    XENVIF_VIF_MAC_QUERY_MULTICAST_ADDRESSES        MacQueryMulticastAddresses;
+    XENVIF_VIF_MAC_SET_MULTICAST_ADDRESSES          MacSetMulticastAddresses;
+    XENVIF_VIF_MAC_SET_FILTER_LEVEL                 MacSetFilterLevel;
+    XENVIF_VIF_MAC_QUERY_FILTER_LEVEL               MacQueryFilterLevel;
+};
+
+/*! \struct _XENVIF_VIF_INTERFACE_V5
+    \brief VIF interface version 5
+    \ingroup interfaces
+*/
+struct _XENVIF_VIF_INTERFACE_V5 {
+    INTERFACE                                       Interface;
+    XENVIF_VIF_ACQUIRE                              Acquire;
+    XENVIF_VIF_RELEASE                              Release;
+    XENVIF_VIF_ENABLE                               Enable;
+    XENVIF_VIF_DISABLE                              Disable;
+    XENVIF_VIF_QUERY_STATISTIC                      QueryStatistic;
+    XENVIF_VIF_RECEIVER_RETURN_PACKET               ReceiverReturnPacket;
+    XENVIF_VIF_RECEIVER_SET_OFFLOAD_OPTIONS         ReceiverSetOffloadOptions;
+    XENVIF_VIF_RECEIVER_SET_BACKFILL_SIZE           ReceiverSetBackfillSize;
+    XENVIF_VIF_RECEIVER_QUERY_RING_SIZE             ReceiverQueryRingSize;
     XENVIF_VIF_TRANSMITTER_QUEUE_PACKET             TransmitterQueuePacket;
     XENVIF_VIF_TRANSMITTER_QUERY_OFFLOAD_OPTIONS    TransmitterQueryOffloadOptions;
     XENVIF_VIF_TRANSMITTER_QUERY_LARGE_PACKET_SIZE  TransmitterQueryLargePacketSize;
@@ -780,7 +822,7 @@ struct _XENVIF_VIF_INTERFACE_V4 {
     XENVIF_VIF_MAC_QUERY_FILTER_LEVEL               MacQueryFilterLevel;
 };
 
-typedef struct _XENVIF_VIF_INTERFACE_V4 XENVIF_VIF_INTERFACE, *PXENVIF_VIF_INTERFACE;
+typedef struct _XENVIF_VIF_INTERFACE_V5 XENVIF_VIF_INTERFACE, *PXENVIF_VIF_INTERFACE;
 
 /*! \def XENVIF_VIF
     \brief Macro at assist in method invocation
@@ -791,6 +833,6 @@ typedef struct _XENVIF_VIF_INTERFACE_V4 XENVIF_VIF_INTERFACE, *PXENVIF_VIF_INTER
 #endif  // _WINDLL
 
 #define XENVIF_VIF_INTERFACE_VERSION_MIN    2
-#define XENVIF_VIF_INTERFACE_VERSION_MAX    4
+#define XENVIF_VIF_INTERFACE_VERSION_MAX    5
 
 #endif  // _XENVIF_INTERFACE_H
diff --git a/src/xenvif/vif.c b/src/xenvif/vif.c
index cd8aafc..3d40ad0 100644
--- a/src/xenvif/vif.c
+++ b/src/xenvif/vif.c
@@ -396,7 +396,7 @@ done:
 }
 
 static VOID
-VifTransmitterQueuePacket(
+VifTransmitterQueuePacketVersion4(
     IN  PINTERFACE                  Interface,
     IN  PMDL                        Mdl,
     IN  ULONG                       Offset,
@@ -444,6 +444,45 @@ done:
     }
 }
 
+static NTSTATUS
+VifTransmitterQueuePacket(
+    IN  PINTERFACE                  Interface,
+    IN  PMDL                        Mdl,
+    IN  ULONG                       Offset,
+    IN  ULONG                       Length,
+    IN  XENVIF_VIF_OFFLOAD_OPTIONS  OffloadOptions,
+    IN  USHORT                      MaximumSegmentSize,
+    IN  USHORT                      TagControlInformation,
+    IN  PXENVIF_PACKET_HASH         Hash,
+    IN  PVOID                       Cookie
+    )
+{
+    PXENVIF_VIF_CONTEXT             Context = Interface->Context;
+    NTSTATUS                        status;
+
+    AcquireMrswLockShared(&Context->Lock);
+
+    status = STATUS_UNSUCCESSFUL;
+    if (Context->Enabled == FALSE)
+        goto done;
+
+    ASSERT3U(VifGetVersion(Context), >=, 5);
+    status = TransmitterQueuePacket(FrontendGetTransmitter(Context->Frontend),
+                                    Mdl,
+                                    Offset,
+                                    Length,
+                                    OffloadOptions,
+                                    MaximumSegmentSize,
+                                    TagControlInformation,
+                                    Hash,
+                                    Cookie);
+
+done:
+    ReleaseMrswLockShared(&Context->Lock);
+
+    return status;
+}
+
 static VOID
 VifTransmitterQueryOffloadOptions(
     IN  PINTERFACE                  Interface,
@@ -809,6 +848,31 @@ static struct _XENVIF_VIF_INTERFACE_V4 VifInterfaceVersion4 = {
     VifReceiverSetOffloadOptions,
     VifReceiverSetBackfillSize,
     VifReceiverQueryRingSize,
+    VifTransmitterQueuePacketVersion4,
+    VifTransmitterQueryOffloadOptions,
+    VifTransmitterQueryLargePacketSize,
+    VifTransmitterQueryRingSize,
+    VifMacQueryState,
+    VifMacQueryMaximumFrameSize,
+    VifMacQueryPermanentAddress,
+    VifMacQueryCurrentAddress,
+    VifMacQueryMulticastAddresses,
+    VifMacSetMulticastAddresses,
+    VifMacSetFilterLevel,
+    VifMacQueryFilterLevel
+};
+
+static struct _XENVIF_VIF_INTERFACE_V5 VifInterfaceVersion5 = {
+    { sizeof (struct _XENVIF_VIF_INTERFACE_V5), 5, NULL, NULL, NULL },
+    VifAcquire,
+    VifRelease,
+    VifEnable,
+    VifDisable,
+    VifQueryStatistic,
+    VifReceiverReturnPacket,
+    VifReceiverSetOffloadOptions,
+    VifReceiverSetBackfillSize,
+    VifReceiverQueryRingSize,
     VifTransmitterQueuePacket,
     VifTransmitterQueryOffloadOptions,
     VifTransmitterQueryLargePacketSize,
@@ -938,6 +1002,23 @@ VifGetInterface(
         status = STATUS_SUCCESS;
         break;
     }
+    case 5: {
+        struct _XENVIF_VIF_INTERFACE_V5 *VifInterface;
+
+        VifInterface = (struct _XENVIF_VIF_INTERFACE_V5 *)Interface;
+
+        status = STATUS_BUFFER_OVERFLOW;
+        if (Size < sizeof (struct _XENVIF_VIF_INTERFACE_V5))
+            break;
+
+        *VifInterface = VifInterfaceVersion5;
+
+        ASSERT3U(Interface->Version, ==, Version);
+        Interface->Context = Context;
+
+        status = STATUS_SUCCESS;
+        break;
+    }
     default:
         status = STATUS_NOT_SUPPORTED;
         break;
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Mon Jan 04 13:15:46 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 04 Jan 2016 13:15:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aG4zA-0001hh-09; Mon, 04 Jan 2016 13:15:44 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aG4z8-0001hZ-6k
	for win-pv-devel@lists.xenproject.org; Mon, 04 Jan 2016 13:15:42 +0000
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	FE/6E-25438-8707A865; Mon, 04 Jan 2016 13:15:36 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1451913331!14500539!1
X-Originating-IP: [209.85.192.50]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 60706 invoked from network); 4 Jan 2016 13:15:32 -0000
Received: from mail-qg0-f50.google.com (HELO mail-qg0-f50.google.com)
	(209.85.192.50)
	by server-9.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 4 Jan 2016 13:15:32 -0000
Received: by mail-qg0-f50.google.com with SMTP id o11so253304366qge.2
	for <win-pv-devel@lists.xenproject.org>;
	Mon, 04 Jan 2016 05:15:32 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=WyIY4lULiuqABuvtv/cm0wTSfoiFb35pr/0G0OXc+Dg=;
	b=SHLAchU2n8vFYZiW3jZXlDmJ0PfgDXzUbrMTEefXxI2F2ycO1iOB0E5UBYLJAUQM1O
	fCKcf+0VLPbJcgZwCaXEx7ek9rh2kBzYvQjb1dMPVQK5crc8L7EU4Uz9cPHj4t3fWm+v
	ncyIT50rNDBPPEGO1Ye4ezPXb3I1iWczlPCeZKaC9Mb4uavGmwGol5fstSUjFJzwT6HU
	zAjLIwEMNUMEIAhe9pP+l1J/4/1E7hHk3FZ2nP6Kep2ibV/BiZ6bgJPjF1gDZgrzqlT5
	MOVA+T6QrsnCQROmrTHDd3C7VWJxhqdmBHy1tKeb2vJ0wb83r4JHxlUBQr1GWhtM4onl
	gX2Q==
X-Received: by 10.140.171.9 with SMTP id r9mr123658465qhr.93.1451913331468;
	Mon, 04 Jan 2016 05:15:31 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	h99sm22975023qge.7.2016.01.04.05.15.30
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Mon, 04 Jan 2016 05:15:31 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Mon,  4 Jan 2016 13:15:50 +0000
Message-Id: <1451913350-19380-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Update VIF interface to version 5
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Unfortunately VIF interface version 4 suffers from a shutdown race with
the TransmitterQueuePacket method. If a call to this races with the Disable
method then a NULL callback function pointer can be invoked.
This patch fixes the race by having TransmitterQueuePacket return a status
code to indicate whether a packet has been queued (rather than invoking the
completion callback if it has not), but this necessitates a interface change
so the VIF interface version is also updated to 5 and a new PDO revision is
added.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 include/revision.h      |  3 +-
 include/vif_interface.h | 48 ++++++++++++++++++++++++++--
 src/xenvif/vif.c        | 83 ++++++++++++++++++++++++++++++++++++++++++++++++-
 3 files changed, 129 insertions(+), 5 deletions(-)

diff --git a/include/revision.h b/include/revision.h
index eda8871..78de3a1 100644
--- a/include/revision.h
+++ b/include/revision.h
@@ -43,7 +43,8 @@
     DEFINE_REVISION(0x08000002,  1,  2,  0,  0),    \
     DEFINE_REVISION(0x08000003,  1,  3,  0,  0),    \
     DEFINE_REVISION(0x08000004,  1,  3,  2,  1),    \
-    DEFINE_REVISION(0x08000006,  1,  4,  2,  1)
+    DEFINE_REVISION(0x08000006,  1,  4,  2,  1),    \
+    DEFINE_REVISION(0x08000007,  1,  5,  2,  1)
 
 // Revision 0x08000005 is already in use in the staging-8.1 branch.
 
diff --git a/include/vif_interface.h b/include/vif_interface.h
index 27c5d2d..5a064fd 100644
--- a/include/vif_interface.h
+++ b/include/vif_interface.h
@@ -460,6 +460,19 @@ typedef NTSTATUS
     IN  PLIST_ENTRY List
     );
 
+typedef VOID
+(*XENVIF_VIF_TRANSMITTER_QUEUE_PACKET_V4)(
+    IN  PINTERFACE                  Interface,
+    IN  PMDL                        Mdl,
+    IN  ULONG                       Offset,
+    IN  ULONG                       Length,
+    IN  XENVIF_VIF_OFFLOAD_OPTIONS  OffloadOptions,
+    IN  USHORT                      MaximumSegmentSize,
+    IN  USHORT                      TagControlInformation,
+    IN  PXENVIF_PACKET_HASH         Hash,
+    IN  PVOID                       Cookie
+    );
+
 /*! \typedef XENVIF_VIF_TRANSMITTER_QUEUE_PACKET
     \brief Queue a packet at the provider's transmit side
 
@@ -473,7 +486,7 @@ typedef NTSTATUS
     \param Hash Hash information for the packet
     \param Cookie A cookie specified by the caller that will be passed to the XENVIF_TRANSMITTER_RETURN_PACKET callback
 */
-typedef VOID
+typedef NTSTATUS
 (*XENVIF_VIF_TRANSMITTER_QUEUE_PACKET)(
     IN  PINTERFACE                  Interface,
     IN  PMDL                        Mdl,
@@ -766,6 +779,35 @@ struct _XENVIF_VIF_INTERFACE_V4 {
     XENVIF_VIF_RECEIVER_SET_OFFLOAD_OPTIONS         ReceiverSetOffloadOptions;
     XENVIF_VIF_RECEIVER_SET_BACKFILL_SIZE           ReceiverSetBackfillSize;
     XENVIF_VIF_RECEIVER_QUERY_RING_SIZE             ReceiverQueryRingSize;
+    XENVIF_VIF_TRANSMITTER_QUEUE_PACKET_V4          TransmitterQueuePacketVersion4;
+    XENVIF_VIF_TRANSMITTER_QUERY_OFFLOAD_OPTIONS    TransmitterQueryOffloadOptions;
+    XENVIF_VIF_TRANSMITTER_QUERY_LARGE_PACKET_SIZE  TransmitterQueryLargePacketSize;
+    XENVIF_VIF_TRANSMITTER_QUERY_RING_SIZE          TransmitterQueryRingSize;
+    XENVIF_VIF_MAC_QUERY_STATE                      MacQueryState;
+    XENVIF_VIF_MAC_QUERY_MAXIMUM_FRAME_SIZE         MacQueryMaximumFrameSize;
+    XENVIF_VIF_MAC_QUERY_PERMANENT_ADDRESS          MacQueryPermanentAddress;
+    XENVIF_VIF_MAC_QUERY_CURRENT_ADDRESS            MacQueryCurrentAddress;
+    XENVIF_VIF_MAC_QUERY_MULTICAST_ADDRESSES        MacQueryMulticastAddresses;
+    XENVIF_VIF_MAC_SET_MULTICAST_ADDRESSES          MacSetMulticastAddresses;
+    XENVIF_VIF_MAC_SET_FILTER_LEVEL                 MacSetFilterLevel;
+    XENVIF_VIF_MAC_QUERY_FILTER_LEVEL               MacQueryFilterLevel;
+};
+
+/*! \struct _XENVIF_VIF_INTERFACE_V5
+    \brief VIF interface version 5
+    \ingroup interfaces
+*/
+struct _XENVIF_VIF_INTERFACE_V5 {
+    INTERFACE                                       Interface;
+    XENVIF_VIF_ACQUIRE                              Acquire;
+    XENVIF_VIF_RELEASE                              Release;
+    XENVIF_VIF_ENABLE                               Enable;
+    XENVIF_VIF_DISABLE                              Disable;
+    XENVIF_VIF_QUERY_STATISTIC                      QueryStatistic;
+    XENVIF_VIF_RECEIVER_RETURN_PACKET               ReceiverReturnPacket;
+    XENVIF_VIF_RECEIVER_SET_OFFLOAD_OPTIONS         ReceiverSetOffloadOptions;
+    XENVIF_VIF_RECEIVER_SET_BACKFILL_SIZE           ReceiverSetBackfillSize;
+    XENVIF_VIF_RECEIVER_QUERY_RING_SIZE             ReceiverQueryRingSize;
     XENVIF_VIF_TRANSMITTER_QUEUE_PACKET             TransmitterQueuePacket;
     XENVIF_VIF_TRANSMITTER_QUERY_OFFLOAD_OPTIONS    TransmitterQueryOffloadOptions;
     XENVIF_VIF_TRANSMITTER_QUERY_LARGE_PACKET_SIZE  TransmitterQueryLargePacketSize;
@@ -780,7 +822,7 @@ struct _XENVIF_VIF_INTERFACE_V4 {
     XENVIF_VIF_MAC_QUERY_FILTER_LEVEL               MacQueryFilterLevel;
 };
 
-typedef struct _XENVIF_VIF_INTERFACE_V4 XENVIF_VIF_INTERFACE, *PXENVIF_VIF_INTERFACE;
+typedef struct _XENVIF_VIF_INTERFACE_V5 XENVIF_VIF_INTERFACE, *PXENVIF_VIF_INTERFACE;
 
 /*! \def XENVIF_VIF
     \brief Macro at assist in method invocation
@@ -791,6 +833,6 @@ typedef struct _XENVIF_VIF_INTERFACE_V4 XENVIF_VIF_INTERFACE, *PXENVIF_VIF_INTER
 #endif  // _WINDLL
 
 #define XENVIF_VIF_INTERFACE_VERSION_MIN    2
-#define XENVIF_VIF_INTERFACE_VERSION_MAX    4
+#define XENVIF_VIF_INTERFACE_VERSION_MAX    5
 
 #endif  // _XENVIF_INTERFACE_H
diff --git a/src/xenvif/vif.c b/src/xenvif/vif.c
index cd8aafc..3d40ad0 100644
--- a/src/xenvif/vif.c
+++ b/src/xenvif/vif.c
@@ -396,7 +396,7 @@ done:
 }
 
 static VOID
-VifTransmitterQueuePacket(
+VifTransmitterQueuePacketVersion4(
     IN  PINTERFACE                  Interface,
     IN  PMDL                        Mdl,
     IN  ULONG                       Offset,
@@ -444,6 +444,45 @@ done:
     }
 }
 
+static NTSTATUS
+VifTransmitterQueuePacket(
+    IN  PINTERFACE                  Interface,
+    IN  PMDL                        Mdl,
+    IN  ULONG                       Offset,
+    IN  ULONG                       Length,
+    IN  XENVIF_VIF_OFFLOAD_OPTIONS  OffloadOptions,
+    IN  USHORT                      MaximumSegmentSize,
+    IN  USHORT                      TagControlInformation,
+    IN  PXENVIF_PACKET_HASH         Hash,
+    IN  PVOID                       Cookie
+    )
+{
+    PXENVIF_VIF_CONTEXT             Context = Interface->Context;
+    NTSTATUS                        status;
+
+    AcquireMrswLockShared(&Context->Lock);
+
+    status = STATUS_UNSUCCESSFUL;
+    if (Context->Enabled == FALSE)
+        goto done;
+
+    ASSERT3U(VifGetVersion(Context), >=, 5);
+    status = TransmitterQueuePacket(FrontendGetTransmitter(Context->Frontend),
+                                    Mdl,
+                                    Offset,
+                                    Length,
+                                    OffloadOptions,
+                                    MaximumSegmentSize,
+                                    TagControlInformation,
+                                    Hash,
+                                    Cookie);
+
+done:
+    ReleaseMrswLockShared(&Context->Lock);
+
+    return status;
+}
+
 static VOID
 VifTransmitterQueryOffloadOptions(
     IN  PINTERFACE                  Interface,
@@ -809,6 +848,31 @@ static struct _XENVIF_VIF_INTERFACE_V4 VifInterfaceVersion4 = {
     VifReceiverSetOffloadOptions,
     VifReceiverSetBackfillSize,
     VifReceiverQueryRingSize,
+    VifTransmitterQueuePacketVersion4,
+    VifTransmitterQueryOffloadOptions,
+    VifTransmitterQueryLargePacketSize,
+    VifTransmitterQueryRingSize,
+    VifMacQueryState,
+    VifMacQueryMaximumFrameSize,
+    VifMacQueryPermanentAddress,
+    VifMacQueryCurrentAddress,
+    VifMacQueryMulticastAddresses,
+    VifMacSetMulticastAddresses,
+    VifMacSetFilterLevel,
+    VifMacQueryFilterLevel
+};
+
+static struct _XENVIF_VIF_INTERFACE_V5 VifInterfaceVersion5 = {
+    { sizeof (struct _XENVIF_VIF_INTERFACE_V5), 5, NULL, NULL, NULL },
+    VifAcquire,
+    VifRelease,
+    VifEnable,
+    VifDisable,
+    VifQueryStatistic,
+    VifReceiverReturnPacket,
+    VifReceiverSetOffloadOptions,
+    VifReceiverSetBackfillSize,
+    VifReceiverQueryRingSize,
     VifTransmitterQueuePacket,
     VifTransmitterQueryOffloadOptions,
     VifTransmitterQueryLargePacketSize,
@@ -938,6 +1002,23 @@ VifGetInterface(
         status = STATUS_SUCCESS;
         break;
     }
+    case 5: {
+        struct _XENVIF_VIF_INTERFACE_V5 *VifInterface;
+
+        VifInterface = (struct _XENVIF_VIF_INTERFACE_V5 *)Interface;
+
+        status = STATUS_BUFFER_OVERFLOW;
+        if (Size < sizeof (struct _XENVIF_VIF_INTERFACE_V5))
+            break;
+
+        *VifInterface = VifInterfaceVersion5;
+
+        ASSERT3U(Interface->Version, ==, Version);
+        Interface->Context = Context;
+
+        status = STATUS_SUCCESS;
+        break;
+    }
     default:
         status = STATUS_NOT_SUPPORTED;
         break;
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Mon Jan 04 13:18:11 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 04 Jan 2016 13:18:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aG51X-0001l0-BX; Mon, 04 Jan 2016 13:18:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aG51V-0001kv-Pi
	for win-pv-devel@lists.xenproject.org; Mon, 04 Jan 2016 13:18:10 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	FE/26-23747-1117A865; Mon, 04 Jan 2016 13:18:09 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1451913485!13501203!1
X-Originating-IP: [209.85.192.52]
X-SpamReason: No, hits=0.2 required=7.0 tests=UPPERCASE_50_75
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 65214 invoked from network); 4 Jan 2016 13:18:06 -0000
Received: from mail-qg0-f52.google.com (HELO mail-qg0-f52.google.com)
	(209.85.192.52)
	by server-15.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 4 Jan 2016 13:18:06 -0000
Received: by mail-qg0-f52.google.com with SMTP id e32so162854670qgf.3
	for <win-pv-devel@lists.xenproject.org>;
	Mon, 04 Jan 2016 05:18:05 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=RsHb/ZAS0UplABlPWSFPwEOu8qSYl+FyGxkhsmNfgaE=;
	b=R+jV754OvV/dEJaOtIcGH+M31XqLs9dNlfa3konvgBpJAGwm+LCXdynD49HnfNJp7W
	e/M1Uv0tTYmBVScRT6B0/wQvSOuaQHAdFHPzVOY7mNKXdRlRn4MrpiFkn8FnsBTxmn44
	U2Gj79yh7kouDXFDDVb18PeDzzGdyxuQeeb9oWIp6fvFlSQNkhji6013eYiOVOjN7ZCP
	P32WB8cVZuaFEUMuKvc8EBK2M5r+5nKMnyFLqiR+S/PXwD/lajAIPvY3KCxo+QaI4Iqf
	NpQtpkaWRkkDPGxqqGsG27tn9xKA95pzwZU5rKR/rN7zJW9CyMmSi0wM8DuO77P1Lqws
	Aj3g==
X-Received: by 10.141.7.9 with SMTP id j9mr67651753qhd.71.1451913485116;
	Mon, 04 Jan 2016 05:18:05 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	107sm14337070qge.16.2016.01.04.05.18.04
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Mon, 04 Jan 2016 05:18:04 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Mon,  4 Jan 2016 13:18:24 +0000
Message-Id: <1451913504-9628-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Update to VIF interface version 5
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Use version 5 of the interface to avoid the shutdown race present in
version 4.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 include/vif_interface.h  | 48 +++++++++++++++++++++++++++++++++++++++++++++---
 src/xennet.inf           |  6 +++---
 src/xennet/transmitter.c | 26 ++++++++++++++++----------
 3 files changed, 64 insertions(+), 16 deletions(-)

diff --git a/include/vif_interface.h b/include/vif_interface.h
index 27c5d2d..5a064fd 100644
--- a/include/vif_interface.h
+++ b/include/vif_interface.h
@@ -460,6 +460,19 @@ typedef NTSTATUS
     IN  PLIST_ENTRY List
     );
 
+typedef VOID
+(*XENVIF_VIF_TRANSMITTER_QUEUE_PACKET_V4)(
+    IN  PINTERFACE                  Interface,
+    IN  PMDL                        Mdl,
+    IN  ULONG                       Offset,
+    IN  ULONG                       Length,
+    IN  XENVIF_VIF_OFFLOAD_OPTIONS  OffloadOptions,
+    IN  USHORT                      MaximumSegmentSize,
+    IN  USHORT                      TagControlInformation,
+    IN  PXENVIF_PACKET_HASH         Hash,
+    IN  PVOID                       Cookie
+    );
+
 /*! \typedef XENVIF_VIF_TRANSMITTER_QUEUE_PACKET
     \brief Queue a packet at the provider's transmit side
 
@@ -473,7 +486,7 @@ typedef NTSTATUS
     \param Hash Hash information for the packet
     \param Cookie A cookie specified by the caller that will be passed to the XENVIF_TRANSMITTER_RETURN_PACKET callback
 */
-typedef VOID
+typedef NTSTATUS
 (*XENVIF_VIF_TRANSMITTER_QUEUE_PACKET)(
     IN  PINTERFACE                  Interface,
     IN  PMDL                        Mdl,
@@ -766,6 +779,35 @@ struct _XENVIF_VIF_INTERFACE_V4 {
     XENVIF_VIF_RECEIVER_SET_OFFLOAD_OPTIONS         ReceiverSetOffloadOptions;
     XENVIF_VIF_RECEIVER_SET_BACKFILL_SIZE           ReceiverSetBackfillSize;
     XENVIF_VIF_RECEIVER_QUERY_RING_SIZE             ReceiverQueryRingSize;
+    XENVIF_VIF_TRANSMITTER_QUEUE_PACKET_V4          TransmitterQueuePacketVersion4;
+    XENVIF_VIF_TRANSMITTER_QUERY_OFFLOAD_OPTIONS    TransmitterQueryOffloadOptions;
+    XENVIF_VIF_TRANSMITTER_QUERY_LARGE_PACKET_SIZE  TransmitterQueryLargePacketSize;
+    XENVIF_VIF_TRANSMITTER_QUERY_RING_SIZE          TransmitterQueryRingSize;
+    XENVIF_VIF_MAC_QUERY_STATE                      MacQueryState;
+    XENVIF_VIF_MAC_QUERY_MAXIMUM_FRAME_SIZE         MacQueryMaximumFrameSize;
+    XENVIF_VIF_MAC_QUERY_PERMANENT_ADDRESS          MacQueryPermanentAddress;
+    XENVIF_VIF_MAC_QUERY_CURRENT_ADDRESS            MacQueryCurrentAddress;
+    XENVIF_VIF_MAC_QUERY_MULTICAST_ADDRESSES        MacQueryMulticastAddresses;
+    XENVIF_VIF_MAC_SET_MULTICAST_ADDRESSES          MacSetMulticastAddresses;
+    XENVIF_VIF_MAC_SET_FILTER_LEVEL                 MacSetFilterLevel;
+    XENVIF_VIF_MAC_QUERY_FILTER_LEVEL               MacQueryFilterLevel;
+};
+
+/*! \struct _XENVIF_VIF_INTERFACE_V5
+    \brief VIF interface version 5
+    \ingroup interfaces
+*/
+struct _XENVIF_VIF_INTERFACE_V5 {
+    INTERFACE                                       Interface;
+    XENVIF_VIF_ACQUIRE                              Acquire;
+    XENVIF_VIF_RELEASE                              Release;
+    XENVIF_VIF_ENABLE                               Enable;
+    XENVIF_VIF_DISABLE                              Disable;
+    XENVIF_VIF_QUERY_STATISTIC                      QueryStatistic;
+    XENVIF_VIF_RECEIVER_RETURN_PACKET               ReceiverReturnPacket;
+    XENVIF_VIF_RECEIVER_SET_OFFLOAD_OPTIONS         ReceiverSetOffloadOptions;
+    XENVIF_VIF_RECEIVER_SET_BACKFILL_SIZE           ReceiverSetBackfillSize;
+    XENVIF_VIF_RECEIVER_QUERY_RING_SIZE             ReceiverQueryRingSize;
     XENVIF_VIF_TRANSMITTER_QUEUE_PACKET             TransmitterQueuePacket;
     XENVIF_VIF_TRANSMITTER_QUERY_OFFLOAD_OPTIONS    TransmitterQueryOffloadOptions;
     XENVIF_VIF_TRANSMITTER_QUERY_LARGE_PACKET_SIZE  TransmitterQueryLargePacketSize;
@@ -780,7 +822,7 @@ struct _XENVIF_VIF_INTERFACE_V4 {
     XENVIF_VIF_MAC_QUERY_FILTER_LEVEL               MacQueryFilterLevel;
 };
 
-typedef struct _XENVIF_VIF_INTERFACE_V4 XENVIF_VIF_INTERFACE, *PXENVIF_VIF_INTERFACE;
+typedef struct _XENVIF_VIF_INTERFACE_V5 XENVIF_VIF_INTERFACE, *PXENVIF_VIF_INTERFACE;
 
 /*! \def XENVIF_VIF
     \brief Macro at assist in method invocation
@@ -791,6 +833,6 @@ typedef struct _XENVIF_VIF_INTERFACE_V4 XENVIF_VIF_INTERFACE, *PXENVIF_VIF_INTER
 #endif  // _WINDLL
 
 #define XENVIF_VIF_INTERFACE_VERSION_MIN    2
-#define XENVIF_VIF_INTERFACE_VERSION_MAX    4
+#define XENVIF_VIF_INTERFACE_VERSION_MAX    5
 
 #endif  // _XENVIF_INTERFACE_H
diff --git a/src/xennet.inf b/src/xennet.inf
index 88aaac4..058b5ac 100644
--- a/src/xennet.inf
+++ b/src/xennet.inf
@@ -61,9 +61,9 @@ xennet_coinst_@MAJOR_VERSION@_@MINOR_VERSION@_@MICRO_VERSION@_@BUILD_NUMBER@.dll
 ; DisplayName		Section		DeviceID
 ; -----------		-------		--------
 
-%XenNetDesc%		=XenNet_Inst,	XENVIF\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_NET&REV_08000006
-%XenNetDesc%		=XenNet_Inst,	XENVIF\VEN_@VENDOR_PREFIX@0001&DEV_NET&REV_08000006
-%XenNetDesc%		=XenNet_Inst,	XENVIF\VEN_@VENDOR_PREFIX@0002&DEV_NET&REV_08000006
+%XenNetDesc%		=XenNet_Inst,	XENVIF\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_NET&REV_08000007
+%XenNetDesc%		=XenNet_Inst,	XENVIF\VEN_@VENDOR_PREFIX@0001&DEV_NET&REV_08000007
+%XenNetDesc%		=XenNet_Inst,	XENVIF\VEN_@VENDOR_PREFIX@0002&DEV_NET&REV_08000007
 
 [XenNet_Inst] 
 Characteristics=0x84
diff --git a/src/xennet/transmitter.c b/src/xennet/transmitter.c
index 5574b9c..b5e110a 100644
--- a/src/xennet/transmitter.c
+++ b/src/xennet/transmitter.c
@@ -252,21 +252,27 @@ TransmitterSendNetBufferLists(
         while (NetBuffer != NULL) {
             PVOID               Cookie = NetBufferList;
             XENVIF_PACKET_HASH  Hash;
+            NTSTATUS            status;
 
             ListReserved->Reference++;
 
             Hash.Algorithm = XENVIF_PACKET_HASH_ALGORITHM_NONE;
 
-            XENVIF_VIF(TransmitterQueuePacket,
-                       AdapterGetVifInterface(Transmitter->Adapter),
-                       NET_BUFFER_CURRENT_MDL(NetBuffer),
-                       NET_BUFFER_CURRENT_MDL_OFFSET(NetBuffer),
-                       NET_BUFFER_DATA_LENGTH(NetBuffer),
-                       OffloadOptions,
-                       MaximumSegmentSize,
-                       TagControlInformation,
-                       &Hash,
-                       Cookie);
+            status = XENVIF_VIF(TransmitterQueuePacket,
+                                AdapterGetVifInterface(Transmitter->Adapter),
+                                NET_BUFFER_CURRENT_MDL(NetBuffer),
+                                NET_BUFFER_CURRENT_MDL_OFFSET(NetBuffer),
+                                NET_BUFFER_DATA_LENGTH(NetBuffer),
+                                OffloadOptions,
+                                MaximumSegmentSize,
+                                TagControlInformation,
+                                &Hash,
+                                Cookie);
+            if (!NT_SUCCESS(status)) {
+                __TransmitterReturnPacket(Transmitter, Cookie,
+                                          NDIS_STATUS_NOT_ACCEPTED);
+                break;
+            }
 
             NetBuffer = NET_BUFFER_NEXT_NB(NetBuffer);
         }
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Mon Jan 04 13:18:11 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 04 Jan 2016 13:18:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aG51X-0001l0-BX; Mon, 04 Jan 2016 13:18:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aG51V-0001kv-Pi
	for win-pv-devel@lists.xenproject.org; Mon, 04 Jan 2016 13:18:10 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	FE/26-23747-1117A865; Mon, 04 Jan 2016 13:18:09 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1451913485!13501203!1
X-Originating-IP: [209.85.192.52]
X-SpamReason: No, hits=0.2 required=7.0 tests=UPPERCASE_50_75
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 65214 invoked from network); 4 Jan 2016 13:18:06 -0000
Received: from mail-qg0-f52.google.com (HELO mail-qg0-f52.google.com)
	(209.85.192.52)
	by server-15.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 4 Jan 2016 13:18:06 -0000
Received: by mail-qg0-f52.google.com with SMTP id e32so162854670qgf.3
	for <win-pv-devel@lists.xenproject.org>;
	Mon, 04 Jan 2016 05:18:05 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=RsHb/ZAS0UplABlPWSFPwEOu8qSYl+FyGxkhsmNfgaE=;
	b=R+jV754OvV/dEJaOtIcGH+M31XqLs9dNlfa3konvgBpJAGwm+LCXdynD49HnfNJp7W
	e/M1Uv0tTYmBVScRT6B0/wQvSOuaQHAdFHPzVOY7mNKXdRlRn4MrpiFkn8FnsBTxmn44
	U2Gj79yh7kouDXFDDVb18PeDzzGdyxuQeeb9oWIp6fvFlSQNkhji6013eYiOVOjN7ZCP
	P32WB8cVZuaFEUMuKvc8EBK2M5r+5nKMnyFLqiR+S/PXwD/lajAIPvY3KCxo+QaI4Iqf
	NpQtpkaWRkkDPGxqqGsG27tn9xKA95pzwZU5rKR/rN7zJW9CyMmSi0wM8DuO77P1Lqws
	Aj3g==
X-Received: by 10.141.7.9 with SMTP id j9mr67651753qhd.71.1451913485116;
	Mon, 04 Jan 2016 05:18:05 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	107sm14337070qge.16.2016.01.04.05.18.04
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Mon, 04 Jan 2016 05:18:04 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Mon,  4 Jan 2016 13:18:24 +0000
Message-Id: <1451913504-9628-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Update to VIF interface version 5
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Use version 5 of the interface to avoid the shutdown race present in
version 4.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 include/vif_interface.h  | 48 +++++++++++++++++++++++++++++++++++++++++++++---
 src/xennet.inf           |  6 +++---
 src/xennet/transmitter.c | 26 ++++++++++++++++----------
 3 files changed, 64 insertions(+), 16 deletions(-)

diff --git a/include/vif_interface.h b/include/vif_interface.h
index 27c5d2d..5a064fd 100644
--- a/include/vif_interface.h
+++ b/include/vif_interface.h
@@ -460,6 +460,19 @@ typedef NTSTATUS
     IN  PLIST_ENTRY List
     );
 
+typedef VOID
+(*XENVIF_VIF_TRANSMITTER_QUEUE_PACKET_V4)(
+    IN  PINTERFACE                  Interface,
+    IN  PMDL                        Mdl,
+    IN  ULONG                       Offset,
+    IN  ULONG                       Length,
+    IN  XENVIF_VIF_OFFLOAD_OPTIONS  OffloadOptions,
+    IN  USHORT                      MaximumSegmentSize,
+    IN  USHORT                      TagControlInformation,
+    IN  PXENVIF_PACKET_HASH         Hash,
+    IN  PVOID                       Cookie
+    );
+
 /*! \typedef XENVIF_VIF_TRANSMITTER_QUEUE_PACKET
     \brief Queue a packet at the provider's transmit side
 
@@ -473,7 +486,7 @@ typedef NTSTATUS
     \param Hash Hash information for the packet
     \param Cookie A cookie specified by the caller that will be passed to the XENVIF_TRANSMITTER_RETURN_PACKET callback
 */
-typedef VOID
+typedef NTSTATUS
 (*XENVIF_VIF_TRANSMITTER_QUEUE_PACKET)(
     IN  PINTERFACE                  Interface,
     IN  PMDL                        Mdl,
@@ -766,6 +779,35 @@ struct _XENVIF_VIF_INTERFACE_V4 {
     XENVIF_VIF_RECEIVER_SET_OFFLOAD_OPTIONS         ReceiverSetOffloadOptions;
     XENVIF_VIF_RECEIVER_SET_BACKFILL_SIZE           ReceiverSetBackfillSize;
     XENVIF_VIF_RECEIVER_QUERY_RING_SIZE             ReceiverQueryRingSize;
+    XENVIF_VIF_TRANSMITTER_QUEUE_PACKET_V4          TransmitterQueuePacketVersion4;
+    XENVIF_VIF_TRANSMITTER_QUERY_OFFLOAD_OPTIONS    TransmitterQueryOffloadOptions;
+    XENVIF_VIF_TRANSMITTER_QUERY_LARGE_PACKET_SIZE  TransmitterQueryLargePacketSize;
+    XENVIF_VIF_TRANSMITTER_QUERY_RING_SIZE          TransmitterQueryRingSize;
+    XENVIF_VIF_MAC_QUERY_STATE                      MacQueryState;
+    XENVIF_VIF_MAC_QUERY_MAXIMUM_FRAME_SIZE         MacQueryMaximumFrameSize;
+    XENVIF_VIF_MAC_QUERY_PERMANENT_ADDRESS          MacQueryPermanentAddress;
+    XENVIF_VIF_MAC_QUERY_CURRENT_ADDRESS            MacQueryCurrentAddress;
+    XENVIF_VIF_MAC_QUERY_MULTICAST_ADDRESSES        MacQueryMulticastAddresses;
+    XENVIF_VIF_MAC_SET_MULTICAST_ADDRESSES          MacSetMulticastAddresses;
+    XENVIF_VIF_MAC_SET_FILTER_LEVEL                 MacSetFilterLevel;
+    XENVIF_VIF_MAC_QUERY_FILTER_LEVEL               MacQueryFilterLevel;
+};
+
+/*! \struct _XENVIF_VIF_INTERFACE_V5
+    \brief VIF interface version 5
+    \ingroup interfaces
+*/
+struct _XENVIF_VIF_INTERFACE_V5 {
+    INTERFACE                                       Interface;
+    XENVIF_VIF_ACQUIRE                              Acquire;
+    XENVIF_VIF_RELEASE                              Release;
+    XENVIF_VIF_ENABLE                               Enable;
+    XENVIF_VIF_DISABLE                              Disable;
+    XENVIF_VIF_QUERY_STATISTIC                      QueryStatistic;
+    XENVIF_VIF_RECEIVER_RETURN_PACKET               ReceiverReturnPacket;
+    XENVIF_VIF_RECEIVER_SET_OFFLOAD_OPTIONS         ReceiverSetOffloadOptions;
+    XENVIF_VIF_RECEIVER_SET_BACKFILL_SIZE           ReceiverSetBackfillSize;
+    XENVIF_VIF_RECEIVER_QUERY_RING_SIZE             ReceiverQueryRingSize;
     XENVIF_VIF_TRANSMITTER_QUEUE_PACKET             TransmitterQueuePacket;
     XENVIF_VIF_TRANSMITTER_QUERY_OFFLOAD_OPTIONS    TransmitterQueryOffloadOptions;
     XENVIF_VIF_TRANSMITTER_QUERY_LARGE_PACKET_SIZE  TransmitterQueryLargePacketSize;
@@ -780,7 +822,7 @@ struct _XENVIF_VIF_INTERFACE_V4 {
     XENVIF_VIF_MAC_QUERY_FILTER_LEVEL               MacQueryFilterLevel;
 };
 
-typedef struct _XENVIF_VIF_INTERFACE_V4 XENVIF_VIF_INTERFACE, *PXENVIF_VIF_INTERFACE;
+typedef struct _XENVIF_VIF_INTERFACE_V5 XENVIF_VIF_INTERFACE, *PXENVIF_VIF_INTERFACE;
 
 /*! \def XENVIF_VIF
     \brief Macro at assist in method invocation
@@ -791,6 +833,6 @@ typedef struct _XENVIF_VIF_INTERFACE_V4 XENVIF_VIF_INTERFACE, *PXENVIF_VIF_INTER
 #endif  // _WINDLL
 
 #define XENVIF_VIF_INTERFACE_VERSION_MIN    2
-#define XENVIF_VIF_INTERFACE_VERSION_MAX    4
+#define XENVIF_VIF_INTERFACE_VERSION_MAX    5
 
 #endif  // _XENVIF_INTERFACE_H
diff --git a/src/xennet.inf b/src/xennet.inf
index 88aaac4..058b5ac 100644
--- a/src/xennet.inf
+++ b/src/xennet.inf
@@ -61,9 +61,9 @@ xennet_coinst_@MAJOR_VERSION@_@MINOR_VERSION@_@MICRO_VERSION@_@BUILD_NUMBER@.dll
 ; DisplayName		Section		DeviceID
 ; -----------		-------		--------
 
-%XenNetDesc%		=XenNet_Inst,	XENVIF\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_NET&REV_08000006
-%XenNetDesc%		=XenNet_Inst,	XENVIF\VEN_@VENDOR_PREFIX@0001&DEV_NET&REV_08000006
-%XenNetDesc%		=XenNet_Inst,	XENVIF\VEN_@VENDOR_PREFIX@0002&DEV_NET&REV_08000006
+%XenNetDesc%		=XenNet_Inst,	XENVIF\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_NET&REV_08000007
+%XenNetDesc%		=XenNet_Inst,	XENVIF\VEN_@VENDOR_PREFIX@0001&DEV_NET&REV_08000007
+%XenNetDesc%		=XenNet_Inst,	XENVIF\VEN_@VENDOR_PREFIX@0002&DEV_NET&REV_08000007
 
 [XenNet_Inst] 
 Characteristics=0x84
diff --git a/src/xennet/transmitter.c b/src/xennet/transmitter.c
index 5574b9c..b5e110a 100644
--- a/src/xennet/transmitter.c
+++ b/src/xennet/transmitter.c
@@ -252,21 +252,27 @@ TransmitterSendNetBufferLists(
         while (NetBuffer != NULL) {
             PVOID               Cookie = NetBufferList;
             XENVIF_PACKET_HASH  Hash;
+            NTSTATUS            status;
 
             ListReserved->Reference++;
 
             Hash.Algorithm = XENVIF_PACKET_HASH_ALGORITHM_NONE;
 
-            XENVIF_VIF(TransmitterQueuePacket,
-                       AdapterGetVifInterface(Transmitter->Adapter),
-                       NET_BUFFER_CURRENT_MDL(NetBuffer),
-                       NET_BUFFER_CURRENT_MDL_OFFSET(NetBuffer),
-                       NET_BUFFER_DATA_LENGTH(NetBuffer),
-                       OffloadOptions,
-                       MaximumSegmentSize,
-                       TagControlInformation,
-                       &Hash,
-                       Cookie);
+            status = XENVIF_VIF(TransmitterQueuePacket,
+                                AdapterGetVifInterface(Transmitter->Adapter),
+                                NET_BUFFER_CURRENT_MDL(NetBuffer),
+                                NET_BUFFER_CURRENT_MDL_OFFSET(NetBuffer),
+                                NET_BUFFER_DATA_LENGTH(NetBuffer),
+                                OffloadOptions,
+                                MaximumSegmentSize,
+                                TagControlInformation,
+                                &Hash,
+                                Cookie);
+            if (!NT_SUCCESS(status)) {
+                __TransmitterReturnPacket(Transmitter, Cookie,
+                                          NDIS_STATUS_NOT_ACCEPTED);
+                break;
+            }
 
             NetBuffer = NET_BUFFER_NEXT_NB(NetBuffer);
         }
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Mon Jan 04 13:36:58 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 04 Jan 2016 13:36:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aG5Jh-0002fF-48; Mon, 04 Jan 2016 13:36:57 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aG5Jg-0002fA-6n
	for win-pv-devel@lists.xenproject.org; Mon, 04 Jan 2016 13:36:56 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	A6/6E-09570-7757A865; Mon, 04 Jan 2016 13:36:55 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1451914614!13859305!1
X-Originating-IP: [209.85.192.53]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 49175 invoked from network); 4 Jan 2016 13:36:54 -0000
Received: from mail-qg0-f53.google.com (HELO mail-qg0-f53.google.com)
	(209.85.192.53)
	by server-5.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 4 Jan 2016 13:36:54 -0000
Received: by mail-qg0-f53.google.com with SMTP id o11so253718663qge.2
	for <win-pv-devel@lists.xenproject.org>;
	Mon, 04 Jan 2016 05:36:54 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=HIGRUOLNWWlw3g5jHx67TL8hI0uvqYopArbvsUZMtbE=;
	b=EzxN1YrviMVrKi75OVritMitPqM7qo0NLOTcHvoPnzfe9b/rwOIAj1UiYaVFY497BN
	uUq1ea8sy+OU8EwKmIoWo5tZmyCjCAGFIi/N8enIzxjji5UCgCfm3i8GVikYPRY7Vgqg
	AKeiIiQiBF5lhW3Ba/rq2TdRXMPekY4CDLdZi1UTUFQF8096FlAvF3gU17jJkeJpRuFN
	52Psr45JxRRjvKxOV1wN4amIdtqWsZhqvGDF2yI0kpyxapDsGTlRmPJ3JkaJsmLWUbPT
	v+1au39DMUUjOgvOjaE+wnBqSX3XUFse8KSHkGDi1MQyY0CFvZrHhRQIn3mlE6dnNCPh
	PpCw==
X-Received: by 10.140.138.69 with SMTP id 66mr123916673qhk.18.1451914613963;
	Mon, 04 Jan 2016 05:36:53 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	w75sm40243530qka.49.2016.01.04.05.36.53
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Mon, 04 Jan 2016 05:36:53 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Mon,  4 Jan 2016 13:37:09 +0000
Message-Id: <1451914629-12912-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Fix revision number to avoid collision with
	staging-8.1
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

My previous patch incorrectly used a PDO revision that was already in use
on the staging-8.1 branch.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 include/revision.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/revision.h b/include/revision.h
index 78de3a1..6458bfd 100644
--- a/include/revision.h
+++ b/include/revision.h
@@ -44,8 +44,9 @@
     DEFINE_REVISION(0x08000003,  1,  3,  0,  0),    \
     DEFINE_REVISION(0x08000004,  1,  3,  2,  1),    \
     DEFINE_REVISION(0x08000006,  1,  4,  2,  1),    \
-    DEFINE_REVISION(0x08000007,  1,  5,  2,  1)
+    DEFINE_REVISION(0x08000009,  1,  5,  2,  1)
 
-// Revision 0x08000005 is already in use in the staging-8.1 branch.
+// Revision 0x08000005, 0x08000007 and 0x08000008 are already in use in
+// the staging-8.1 branch.
 
 #endif  // _REVISION_H
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Mon Jan 04 13:36:58 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 04 Jan 2016 13:36:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aG5Jh-0002fF-48; Mon, 04 Jan 2016 13:36:57 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aG5Jg-0002fA-6n
	for win-pv-devel@lists.xenproject.org; Mon, 04 Jan 2016 13:36:56 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	A6/6E-09570-7757A865; Mon, 04 Jan 2016 13:36:55 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1451914614!13859305!1
X-Originating-IP: [209.85.192.53]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 49175 invoked from network); 4 Jan 2016 13:36:54 -0000
Received: from mail-qg0-f53.google.com (HELO mail-qg0-f53.google.com)
	(209.85.192.53)
	by server-5.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 4 Jan 2016 13:36:54 -0000
Received: by mail-qg0-f53.google.com with SMTP id o11so253718663qge.2
	for <win-pv-devel@lists.xenproject.org>;
	Mon, 04 Jan 2016 05:36:54 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=HIGRUOLNWWlw3g5jHx67TL8hI0uvqYopArbvsUZMtbE=;
	b=EzxN1YrviMVrKi75OVritMitPqM7qo0NLOTcHvoPnzfe9b/rwOIAj1UiYaVFY497BN
	uUq1ea8sy+OU8EwKmIoWo5tZmyCjCAGFIi/N8enIzxjji5UCgCfm3i8GVikYPRY7Vgqg
	AKeiIiQiBF5lhW3Ba/rq2TdRXMPekY4CDLdZi1UTUFQF8096FlAvF3gU17jJkeJpRuFN
	52Psr45JxRRjvKxOV1wN4amIdtqWsZhqvGDF2yI0kpyxapDsGTlRmPJ3JkaJsmLWUbPT
	v+1au39DMUUjOgvOjaE+wnBqSX3XUFse8KSHkGDi1MQyY0CFvZrHhRQIn3mlE6dnNCPh
	PpCw==
X-Received: by 10.140.138.69 with SMTP id 66mr123916673qhk.18.1451914613963;
	Mon, 04 Jan 2016 05:36:53 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	w75sm40243530qka.49.2016.01.04.05.36.53
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Mon, 04 Jan 2016 05:36:53 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Mon,  4 Jan 2016 13:37:09 +0000
Message-Id: <1451914629-12912-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Fix revision number to avoid collision with
	staging-8.1
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

My previous patch incorrectly used a PDO revision that was already in use
on the staging-8.1 branch.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 include/revision.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/revision.h b/include/revision.h
index 78de3a1..6458bfd 100644
--- a/include/revision.h
+++ b/include/revision.h
@@ -44,8 +44,9 @@
     DEFINE_REVISION(0x08000003,  1,  3,  0,  0),    \
     DEFINE_REVISION(0x08000004,  1,  3,  2,  1),    \
     DEFINE_REVISION(0x08000006,  1,  4,  2,  1),    \
-    DEFINE_REVISION(0x08000007,  1,  5,  2,  1)
+    DEFINE_REVISION(0x08000009,  1,  5,  2,  1)
 
-// Revision 0x08000005 is already in use in the staging-8.1 branch.
+// Revision 0x08000005, 0x08000007 and 0x08000008 are already in use in
+// the staging-8.1 branch.
 
 #endif  // _REVISION_H
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Mon Jan 04 13:41:15 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 04 Jan 2016 13:41:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aG5Nr-0002yW-20; Mon, 04 Jan 2016 13:41:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aG5Np-0002yB-Av
	for win-pv-devel@lists.xenproject.org; Mon, 04 Jan 2016 13:41:13 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	44/C6-09570-8767A865; Mon, 04 Jan 2016 13:41:12 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1451914872!13742382!1
X-Originating-IP: [74.125.82.46]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22709 invoked from network); 4 Jan 2016 13:41:12 -0000
Received: from mail-wm0-f46.google.com (HELO mail-wm0-f46.google.com)
	(74.125.82.46)
	by server-12.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 4 Jan 2016 13:41:12 -0000
Received: by mail-wm0-f46.google.com with SMTP id b14so185073826wmb.1
	for <win-pv-devel@lists.xenproject.org>;
	Mon, 04 Jan 2016 05:41:12 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=C6NA+xuzH0PbWoyztNYA6AdzCaf1mIo4iRlA5INMAwY=;
	b=jqZ3VEa5dc7gDH9DnIZsUZOLyRqx5kF5Zf5w8hNIU5xgqERCYhyMQdEKXdr2huUwid
	pIbbfeGnisOuIyacs/VANg9rXHTnrvA7KttJ5GcFsfsWE6EAFF+WBBa2S2Owo2ygtG9h
	vXlzqYnUPJVyJdSRAVRVFKvqCheEenAZJ0wETmrxogKjR5B4uLVD78At2IbYGQKuXZXA
	N4fSGiyQKcoDXvKngVic1HsOkG6CXAyjfV4CWIokJiqM8s3t84u28IqQ7Ifj7CCm/TrQ
	/NVxI1IA3v2qnKMsIioDL7bDw5HbGgllZU0T88b/BD8L2wJA0DjpDl0Q3TeqpMgzn2mV
	x8Pg==
X-Received: by 10.194.9.42 with SMTP id w10mr57517099wja.159.1451914871837;
	Mon, 04 Jan 2016 05:41:11 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	l7sm86253339wjx.14.2016.01.04.05.41.11
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Mon, 04 Jan 2016 05:41:11 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Mon,  4 Jan 2016 13:41:32 +0000
Message-Id: <1451914893-14156-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Update to correct PDO revision
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

The correct PDO revision for the latest VIF interface is 0x08000009, not
0x08000007.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xennet.inf | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/xennet.inf b/src/xennet.inf
index 058b5ac..31b2f64 100644
--- a/src/xennet.inf
+++ b/src/xennet.inf
@@ -61,9 +61,9 @@ xennet_coinst_@MAJOR_VERSION@_@MINOR_VERSION@_@MICRO_VERSION@_@BUILD_NUMBER@.dll
 ; DisplayName		Section		DeviceID
 ; -----------		-------		--------
 
-%XenNetDesc%		=XenNet_Inst,	XENVIF\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_NET&REV_08000007
-%XenNetDesc%		=XenNet_Inst,	XENVIF\VEN_@VENDOR_PREFIX@0001&DEV_NET&REV_08000007
-%XenNetDesc%		=XenNet_Inst,	XENVIF\VEN_@VENDOR_PREFIX@0002&DEV_NET&REV_08000007
+%XenNetDesc%		=XenNet_Inst,	XENVIF\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_NET&REV_08000009
+%XenNetDesc%		=XenNet_Inst,	XENVIF\VEN_@VENDOR_PREFIX@0001&DEV_NET&REV_08000009
+%XenNetDesc%		=XenNet_Inst,	XENVIF\VEN_@VENDOR_PREFIX@0002&DEV_NET&REV_08000009
 
 [XenNet_Inst] 
 Characteristics=0x84
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Mon Jan 04 13:41:15 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 04 Jan 2016 13:41:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aG5Nr-0002yW-20; Mon, 04 Jan 2016 13:41:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aG5Np-0002yB-Av
	for win-pv-devel@lists.xenproject.org; Mon, 04 Jan 2016 13:41:13 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	44/C6-09570-8767A865; Mon, 04 Jan 2016 13:41:12 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1451914872!13742382!1
X-Originating-IP: [74.125.82.46]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22709 invoked from network); 4 Jan 2016 13:41:12 -0000
Received: from mail-wm0-f46.google.com (HELO mail-wm0-f46.google.com)
	(74.125.82.46)
	by server-12.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 4 Jan 2016 13:41:12 -0000
Received: by mail-wm0-f46.google.com with SMTP id b14so185073826wmb.1
	for <win-pv-devel@lists.xenproject.org>;
	Mon, 04 Jan 2016 05:41:12 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=C6NA+xuzH0PbWoyztNYA6AdzCaf1mIo4iRlA5INMAwY=;
	b=jqZ3VEa5dc7gDH9DnIZsUZOLyRqx5kF5Zf5w8hNIU5xgqERCYhyMQdEKXdr2huUwid
	pIbbfeGnisOuIyacs/VANg9rXHTnrvA7KttJ5GcFsfsWE6EAFF+WBBa2S2Owo2ygtG9h
	vXlzqYnUPJVyJdSRAVRVFKvqCheEenAZJ0wETmrxogKjR5B4uLVD78At2IbYGQKuXZXA
	N4fSGiyQKcoDXvKngVic1HsOkG6CXAyjfV4CWIokJiqM8s3t84u28IqQ7Ifj7CCm/TrQ
	/NVxI1IA3v2qnKMsIioDL7bDw5HbGgllZU0T88b/BD8L2wJA0DjpDl0Q3TeqpMgzn2mV
	x8Pg==
X-Received: by 10.194.9.42 with SMTP id w10mr57517099wja.159.1451914871837;
	Mon, 04 Jan 2016 05:41:11 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	l7sm86253339wjx.14.2016.01.04.05.41.11
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Mon, 04 Jan 2016 05:41:11 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Mon,  4 Jan 2016 13:41:32 +0000
Message-Id: <1451914893-14156-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Update to correct PDO revision
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

The correct PDO revision for the latest VIF interface is 0x08000009, not
0x08000007.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xennet.inf | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/xennet.inf b/src/xennet.inf
index 058b5ac..31b2f64 100644
--- a/src/xennet.inf
+++ b/src/xennet.inf
@@ -61,9 +61,9 @@ xennet_coinst_@MAJOR_VERSION@_@MINOR_VERSION@_@MICRO_VERSION@_@BUILD_NUMBER@.dll
 ; DisplayName		Section		DeviceID
 ; -----------		-------		--------
 
-%XenNetDesc%		=XenNet_Inst,	XENVIF\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_NET&REV_08000007
-%XenNetDesc%		=XenNet_Inst,	XENVIF\VEN_@VENDOR_PREFIX@0001&DEV_NET&REV_08000007
-%XenNetDesc%		=XenNet_Inst,	XENVIF\VEN_@VENDOR_PREFIX@0002&DEV_NET&REV_08000007
+%XenNetDesc%		=XenNet_Inst,	XENVIF\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_NET&REV_08000009
+%XenNetDesc%		=XenNet_Inst,	XENVIF\VEN_@VENDOR_PREFIX@0001&DEV_NET&REV_08000009
+%XenNetDesc%		=XenNet_Inst,	XENVIF\VEN_@VENDOR_PREFIX@0002&DEV_NET&REV_08000009
 
 [XenNet_Inst] 
 Characteristics=0x84
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Mon Jan 04 15:34:30 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 04 Jan 2016 15:34:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aG79R-0004bz-Nt; Mon, 04 Jan 2016 15:34:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aG79Q-0004bq-GS
	for win-pv-devel@lists.xenproject.org; Mon, 04 Jan 2016 15:34:28 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	D1/F0-21571-3019A865; Mon, 04 Jan 2016 15:34:27 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1451921666!8325939!1
X-Originating-IP: [209.85.192.41]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25557 invoked from network); 4 Jan 2016 15:34:27 -0000
Received: from mail-qg0-f41.google.com (HELO mail-qg0-f41.google.com)
	(209.85.192.41)
	by server-6.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 4 Jan 2016 15:34:27 -0000
Received: by mail-qg0-f41.google.com with SMTP id 6so178101317qgy.1
	for <win-pv-devel@lists.xenproject.org>;
	Mon, 04 Jan 2016 07:34:26 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=1KAfcNPACgEW9S3JjW+iMjjmbPdKTfPbiSbEKU91Tgo=;
	b=W3o4jzZjEbgoFjg1gaRqDH1O0N3xreat5L4LhYnvYdofTMlfZnce5yCBO2lQIxm8TR
	L2sqkl9s1HSCYorOW5AE3JybhWf3zFvnzqgKEvlBo6ta5WkXXT5MGHPNTJJCZevaG4lF
	UnaPq9Fc97FFB1kYwDJUH8ADeEqpwRXoy+eort2rNkhEr7nFtMXS4h3LYrKb/tvGEMJS
	fTiwiGEDGr2R+XJAeHDV8EXD78/yLixbxPRJIH5CqvoiEozTJKy0dzYIwEUbFlCuSNRC
	1CFXkMteak7hxZtbwPGRnoIbVvkGy0NLPnxDzKMwmYVynRLyeEWUF8hD32T5bLGOo2xD
	gBwA==
X-Received: by 10.140.140.80 with SMTP id 77mr50949504qhm.61.1451921665960;
	Mon, 04 Jan 2016 07:34:25 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	z2sm39894201qhz.38.2016.01.04.07.34.24
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Mon, 04 Jan 2016 07:34:25 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Mon,  4 Jan 2016 15:34:45 +0000
Message-Id: <1451921685-18764-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Turn off ASSERTions in free builds
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xenvbd/assert.h   | 57 +++++++++++++++++++++++++++++++++++++++++++--------
 src/xenvbd/notifier.c |  4 ++--
 2 files changed, 50 insertions(+), 11 deletions(-)

diff --git a/src/xenvbd/assert.h b/src/xenvbd/assert.h
index 9c43560..a0ffcf0 100644
--- a/src/xenvbd/assert.h
+++ b/src/xenvbd/assert.h
@@ -91,6 +91,8 @@ __BugCheck(
 #define BUG_ON_MSG(_EXP, _TEXT)                \
         if (_EXP) BUG_MSG(#_EXP, _TEXT)
 
+#undef  ASSERT
+
 #if DBG
 
 #define __NT_ASSERT(_EXP)                                       \
@@ -110,15 +112,6 @@ __BugCheck(
 #define __ASSERT(_EXP)              __NT_ASSERT(_EXP)
 #define __ASSERT_MSG(_EXP, _TEXT)   __NT_ASSERT_MSG(_EXP, _TEXT)
 
-#else   // DBG
-
-#define __ASSERT(_EXP)              BUG_ON(!(_EXP))
-#define __ASSERT_MSG(_EXP, _TEXT)   BUG_ON_MSG(!(_EXP), _TEXT)
-
-#endif  // DBG
-
-#undef  ASSERT
-
 #define ASSERT(_EXP)                    \
         do {                            \
             __ASSERT(_EXP);             \
@@ -175,6 +168,52 @@ __BugCheck(
             }                                       \
         } while (FALSE)
 
+#else   // DBG
+
+static FORCEINLINE VOID
+_IgnoreAssertion(
+    IN  BOOLEAN Value
+    )
+{
+    UNREFERENCED_PARAMETER(Value);
+}
+
+#define ASSERT(_EXP)                    \
+        do {                            \
+            _IgnoreAssertion(_EXP);     \
+            __analysis_assume(_EXP);    \
+        } while (FALSE)
+
+static FORCEINLINE VOID
+_IgnoreAssertionMessage(
+    IN  BOOLEAN Value,
+    IN  const CHAR *Text
+    )
+{
+    UNREFERENCED_PARAMETER(Value);
+    UNREFERENCED_PARAMETER(Text);
+}
+
+#define ASSERT_MSG(_EXP, _TEXT)                     \
+        do {                                        \
+            _IgnoreAssertionMessage(_EXP, _TEXT);   \
+            __analysis_assume(_EXP);                \
+        } while (FALSE)
+
+#define ASSERT3U(_X, _OP, _Y)           \
+        ASSERT((_X) _OP (_Y))
+
+#define ASSERT3S(_X, _OP, _Y)           \
+        ASSERT((_X) _OP (_Y))
+
+#define ASSERT3P(_X, _OP, _Y)           \
+        ASSERT((_X) _OP (_Y))
+
+#define ASSERTREFCOUNT(_X, _OP, _Y, _Z) \
+        ASSERT_MSG((_X) _OP (_Y), (_Z))
+
+#endif  // DBG
+
 #ifndef TEST_MEMORY
 #define TEST_MEMORY DBG
 #endif
diff --git a/src/xenvbd/notifier.c b/src/xenvbd/notifier.c
index e9943fa..0b2664f 100644
--- a/src/xenvbd/notifier.c
+++ b/src/xenvbd/notifier.c
@@ -86,7 +86,7 @@ NotifierInterrupt(
     
     UNREFERENCED_PARAMETER(Interrupt);
 
-    ASSERT(Notifier);
+    ASSERT(Notifier != NULL);
 
 	++Notifier->NumInts;
 	if (Notifier->Connected) {
@@ -115,7 +115,7 @@ NotifierDpc(
     UNREFERENCED_PARAMETER(Arg1);
     UNREFERENCED_PARAMETER(Arg2);
 
-    ASSERT(Notifier);
+    ASSERT(Notifier != NULL);
     Pdo = FrontendGetPdo(Notifier->Frontend);
 
     if (PdoIsPaused(Pdo)) {
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Mon Jan 04 15:34:30 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 04 Jan 2016 15:34:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aG79R-0004bz-Nt; Mon, 04 Jan 2016 15:34:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aG79Q-0004bq-GS
	for win-pv-devel@lists.xenproject.org; Mon, 04 Jan 2016 15:34:28 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	D1/F0-21571-3019A865; Mon, 04 Jan 2016 15:34:27 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1451921666!8325939!1
X-Originating-IP: [209.85.192.41]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25557 invoked from network); 4 Jan 2016 15:34:27 -0000
Received: from mail-qg0-f41.google.com (HELO mail-qg0-f41.google.com)
	(209.85.192.41)
	by server-6.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 4 Jan 2016 15:34:27 -0000
Received: by mail-qg0-f41.google.com with SMTP id 6so178101317qgy.1
	for <win-pv-devel@lists.xenproject.org>;
	Mon, 04 Jan 2016 07:34:26 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=1KAfcNPACgEW9S3JjW+iMjjmbPdKTfPbiSbEKU91Tgo=;
	b=W3o4jzZjEbgoFjg1gaRqDH1O0N3xreat5L4LhYnvYdofTMlfZnce5yCBO2lQIxm8TR
	L2sqkl9s1HSCYorOW5AE3JybhWf3zFvnzqgKEvlBo6ta5WkXXT5MGHPNTJJCZevaG4lF
	UnaPq9Fc97FFB1kYwDJUH8ADeEqpwRXoy+eort2rNkhEr7nFtMXS4h3LYrKb/tvGEMJS
	fTiwiGEDGr2R+XJAeHDV8EXD78/yLixbxPRJIH5CqvoiEozTJKy0dzYIwEUbFlCuSNRC
	1CFXkMteak7hxZtbwPGRnoIbVvkGy0NLPnxDzKMwmYVynRLyeEWUF8hD32T5bLGOo2xD
	gBwA==
X-Received: by 10.140.140.80 with SMTP id 77mr50949504qhm.61.1451921665960;
	Mon, 04 Jan 2016 07:34:25 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	z2sm39894201qhz.38.2016.01.04.07.34.24
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Mon, 04 Jan 2016 07:34:25 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Mon,  4 Jan 2016 15:34:45 +0000
Message-Id: <1451921685-18764-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Turn off ASSERTions in free builds
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xenvbd/assert.h   | 57 +++++++++++++++++++++++++++++++++++++++++++--------
 src/xenvbd/notifier.c |  4 ++--
 2 files changed, 50 insertions(+), 11 deletions(-)

diff --git a/src/xenvbd/assert.h b/src/xenvbd/assert.h
index 9c43560..a0ffcf0 100644
--- a/src/xenvbd/assert.h
+++ b/src/xenvbd/assert.h
@@ -91,6 +91,8 @@ __BugCheck(
 #define BUG_ON_MSG(_EXP, _TEXT)                \
         if (_EXP) BUG_MSG(#_EXP, _TEXT)
 
+#undef  ASSERT
+
 #if DBG
 
 #define __NT_ASSERT(_EXP)                                       \
@@ -110,15 +112,6 @@ __BugCheck(
 #define __ASSERT(_EXP)              __NT_ASSERT(_EXP)
 #define __ASSERT_MSG(_EXP, _TEXT)   __NT_ASSERT_MSG(_EXP, _TEXT)
 
-#else   // DBG
-
-#define __ASSERT(_EXP)              BUG_ON(!(_EXP))
-#define __ASSERT_MSG(_EXP, _TEXT)   BUG_ON_MSG(!(_EXP), _TEXT)
-
-#endif  // DBG
-
-#undef  ASSERT
-
 #define ASSERT(_EXP)                    \
         do {                            \
             __ASSERT(_EXP);             \
@@ -175,6 +168,52 @@ __BugCheck(
             }                                       \
         } while (FALSE)
 
+#else   // DBG
+
+static FORCEINLINE VOID
+_IgnoreAssertion(
+    IN  BOOLEAN Value
+    )
+{
+    UNREFERENCED_PARAMETER(Value);
+}
+
+#define ASSERT(_EXP)                    \
+        do {                            \
+            _IgnoreAssertion(_EXP);     \
+            __analysis_assume(_EXP);    \
+        } while (FALSE)
+
+static FORCEINLINE VOID
+_IgnoreAssertionMessage(
+    IN  BOOLEAN Value,
+    IN  const CHAR *Text
+    )
+{
+    UNREFERENCED_PARAMETER(Value);
+    UNREFERENCED_PARAMETER(Text);
+}
+
+#define ASSERT_MSG(_EXP, _TEXT)                     \
+        do {                                        \
+            _IgnoreAssertionMessage(_EXP, _TEXT);   \
+            __analysis_assume(_EXP);                \
+        } while (FALSE)
+
+#define ASSERT3U(_X, _OP, _Y)           \
+        ASSERT((_X) _OP (_Y))
+
+#define ASSERT3S(_X, _OP, _Y)           \
+        ASSERT((_X) _OP (_Y))
+
+#define ASSERT3P(_X, _OP, _Y)           \
+        ASSERT((_X) _OP (_Y))
+
+#define ASSERTREFCOUNT(_X, _OP, _Y, _Z) \
+        ASSERT_MSG((_X) _OP (_Y), (_Z))
+
+#endif  // DBG
+
 #ifndef TEST_MEMORY
 #define TEST_MEMORY DBG
 #endif
diff --git a/src/xenvbd/notifier.c b/src/xenvbd/notifier.c
index e9943fa..0b2664f 100644
--- a/src/xenvbd/notifier.c
+++ b/src/xenvbd/notifier.c
@@ -86,7 +86,7 @@ NotifierInterrupt(
     
     UNREFERENCED_PARAMETER(Interrupt);
 
-    ASSERT(Notifier);
+    ASSERT(Notifier != NULL);
 
 	++Notifier->NumInts;
 	if (Notifier->Connected) {
@@ -115,7 +115,7 @@ NotifierDpc(
     UNREFERENCED_PARAMETER(Arg1);
     UNREFERENCED_PARAMETER(Arg2);
 
-    ASSERT(Notifier);
+    ASSERT(Notifier != NULL);
     Pdo = FrontendGetPdo(Notifier->Frontend);
 
     if (PdoIsPaused(Pdo)) {
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Fri Jan 08 11:50:38 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 08 Jan 2016 11:50:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aHVYy-0001vS-HT; Fri, 08 Jan 2016 11:50:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=8083dbd62=Mark.Syms@citrix.com>)
	id 1aHVYx-0001vN-0Y
	for win-pv-devel@lists.xenproject.org; Fri, 08 Jan 2016 11:50:35 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	80/F1-31122-A82AF865; Fri, 08 Jan 2016 11:50:34 +0000
X-Env-Sender: prvs=8083dbd62=Mark.Syms@citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1452253832!9162741!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n,
	received_headers: No Received headers
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32813 invoked from network); 8 Jan 2016 11:50:33 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Jan 2016 11:50:33 -0000
X-IronPort-AV: E=Sophos;i="5.20,538,1444694400"; d="scan'208";a="323670044"
From: Mark Syms <mark.syms@citrix.com>
To: <win-pv-devel@lists.xenproject.org>
Date: Fri, 8 Jan 2016 11:50:22 +0000
Message-ID: <1452253822-9744-1-git-send-email-mark.syms@citrix.com>
X-Mailer: git-send-email 1.9.5.msysgit.1
MIME-Version: 1.0
X-DLP: MIA2
Cc: Mark Syms <mark.syms@citrix.com>
Subject: [win-pv-devel] [PATCH] Use correct FdoD0ToD3 function.
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Signed-off-by: Mark Syms <mark.syms@citrix.com>
---
 src/xenvbd/fdo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/xenvbd/fdo.c b/src/xenvbd/fdo.c
index aa92fe4..cf05483 100644
--- a/src/xenvbd/fdo.c
+++ b/src/xenvbd/fdo.c
@@ -1982,7 +1982,7 @@ FdoDispatchPnp(
     switch (Stack->MinorFunction) {
     case IRP_MN_REMOVE_DEVICE:
         Verbose("FDO:IRP_MN_REMOVE_DEVICE\n");
-        __FdoD0ToD3(Fdo);
+        FdoD0ToD3(Fdo);
         FdoUnplugRequest(Fdo, FALSE);
         // drop ref-count acquired in DriverGetFdo *before* destroying Fdo
         FdoDereference(Fdo);
-- 
1.9.5.msysgit.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Fri Jan 08 11:50:38 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 08 Jan 2016 11:50:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aHVYy-0001vS-HT; Fri, 08 Jan 2016 11:50:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=8083dbd62=Mark.Syms@citrix.com>)
	id 1aHVYx-0001vN-0Y
	for win-pv-devel@lists.xenproject.org; Fri, 08 Jan 2016 11:50:35 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	80/F1-31122-A82AF865; Fri, 08 Jan 2016 11:50:34 +0000
X-Env-Sender: prvs=8083dbd62=Mark.Syms@citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1452253832!9162741!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n,
	received_headers: No Received headers
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32813 invoked from network); 8 Jan 2016 11:50:33 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Jan 2016 11:50:33 -0000
X-IronPort-AV: E=Sophos;i="5.20,538,1444694400"; d="scan'208";a="323670044"
From: Mark Syms <mark.syms@citrix.com>
To: <win-pv-devel@lists.xenproject.org>
Date: Fri, 8 Jan 2016 11:50:22 +0000
Message-ID: <1452253822-9744-1-git-send-email-mark.syms@citrix.com>
X-Mailer: git-send-email 1.9.5.msysgit.1
MIME-Version: 1.0
X-DLP: MIA2
Cc: Mark Syms <mark.syms@citrix.com>
Subject: [win-pv-devel] [PATCH] Use correct FdoD0ToD3 function.
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Signed-off-by: Mark Syms <mark.syms@citrix.com>
---
 src/xenvbd/fdo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/xenvbd/fdo.c b/src/xenvbd/fdo.c
index aa92fe4..cf05483 100644
--- a/src/xenvbd/fdo.c
+++ b/src/xenvbd/fdo.c
@@ -1982,7 +1982,7 @@ FdoDispatchPnp(
     switch (Stack->MinorFunction) {
     case IRP_MN_REMOVE_DEVICE:
         Verbose("FDO:IRP_MN_REMOVE_DEVICE\n");
-        __FdoD0ToD3(Fdo);
+        FdoD0ToD3(Fdo);
         FdoUnplugRequest(Fdo, FALSE);
         // drop ref-count acquired in DriverGetFdo *before* destroying Fdo
         FdoDereference(Fdo);
-- 
1.9.5.msysgit.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Fri Jan 08 11:57:10 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 08 Jan 2016 11:57:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aHVfJ-0002GS-IY; Fri, 08 Jan 2016 11:57:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=808647837=Paul.Durrant@citrix.com>)
	id 1aHVfI-0002GN-Q4
	for win-pv-devel@lists.xenproject.org; Fri, 08 Jan 2016 11:57:08 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	2C/AE-07651-314AF865; Fri, 08 Jan 2016 11:57:07 +0000
X-Env-Sender: prvs=808647837=Paul.Durrant@citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1452254227!5070347!1
X-Originating-IP: [185.25.65.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=received_headers: No 
	Received headers
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 770 invoked from network); 8 Jan 2016 11:57:07 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (185.25.65.24)
	by server-4.tower-31.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Jan 2016 11:57:07 -0000
X-IronPort-AV: E=Sophos;i="5.20,538,1444694400"; d="scan'208";a="11765447"
From: Paul Durrant <Paul.Durrant@citrix.com>
To: Mark Syms <Mark.Syms@citrix.com>, "win-pv-devel@lists.xenproject.org"
	<win-pv-devel@lists.xenproject.org>
Thread-Topic: [win-pv-devel] [PATCH] Use correct FdoD0ToD3 function.
Thread-Index: AQHRSgtzGK6TWQEYp0OXseCqrLAK8J7xgxlA
Date: Fri, 8 Jan 2016 11:57:03 +0000
Message-ID: <73ec0c74905943beaca9167e1fd45dd5@AMSPEX02CL03.citrite.net>
References: <1452253822-9744-1-git-send-email-mark.syms@citrix.com>
In-Reply-To: <1452253822-9744-1-git-send-email-mark.syms@citrix.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ms-exchange-transport-fromentityheader: Hosted
MIME-Version: 1.0
X-DLP: AMS1
Cc: Mark Syms <Mark.Syms@citrix.com>
Subject: Re: [win-pv-devel] [PATCH] Use correct FdoD0ToD3 function.
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

> -----Original Message-----
> From: win-pv-devel-bounces@lists.xenproject.org [mailto:win-pv-devel-
> bounces@lists.xenproject.org] On Behalf Of Mark Syms
> Sent: 08 January 2016 11:50
> To: win-pv-devel@lists.xenproject.org
> Cc: Mark Syms
> Subject: [win-pv-devel] [PATCH] Use correct FdoD0ToD3 function.
> 
> Signed-off-by: Mark Syms <mark.syms@citrix.com>

Oops, I wonder how long this has been broken.

Acked-by: Paul Durrant <paul.durrant@citrix.com>

I'll back-port to staging-8.1 and re-tag too.

> ---
>  src/xenvbd/fdo.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/xenvbd/fdo.c b/src/xenvbd/fdo.c
> index aa92fe4..cf05483 100644
> --- a/src/xenvbd/fdo.c
> +++ b/src/xenvbd/fdo.c
> @@ -1982,7 +1982,7 @@ FdoDispatchPnp(
>      switch (Stack->MinorFunction) {
>      case IRP_MN_REMOVE_DEVICE:
>          Verbose("FDO:IRP_MN_REMOVE_DEVICE\n");
> -        __FdoD0ToD3(Fdo);
> +        FdoD0ToD3(Fdo);
>          FdoUnplugRequest(Fdo, FALSE);
>          // drop ref-count acquired in DriverGetFdo *before* destroying Fdo
>          FdoDereference(Fdo);
> --
> 1.9.5.msysgit.1
> 
> 
> _______________________________________________
> win-pv-devel mailing list
> win-pv-devel@lists.xenproject.org
> http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Fri Jan 08 11:57:10 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 08 Jan 2016 11:57:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aHVfJ-0002GS-IY; Fri, 08 Jan 2016 11:57:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=808647837=Paul.Durrant@citrix.com>)
	id 1aHVfI-0002GN-Q4
	for win-pv-devel@lists.xenproject.org; Fri, 08 Jan 2016 11:57:08 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	2C/AE-07651-314AF865; Fri, 08 Jan 2016 11:57:07 +0000
X-Env-Sender: prvs=808647837=Paul.Durrant@citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1452254227!5070347!1
X-Originating-IP: [185.25.65.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=received_headers: No 
	Received headers
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 770 invoked from network); 8 Jan 2016 11:57:07 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (185.25.65.24)
	by server-4.tower-31.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Jan 2016 11:57:07 -0000
X-IronPort-AV: E=Sophos;i="5.20,538,1444694400"; d="scan'208";a="11765447"
From: Paul Durrant <Paul.Durrant@citrix.com>
To: Mark Syms <Mark.Syms@citrix.com>, "win-pv-devel@lists.xenproject.org"
	<win-pv-devel@lists.xenproject.org>
Thread-Topic: [win-pv-devel] [PATCH] Use correct FdoD0ToD3 function.
Thread-Index: AQHRSgtzGK6TWQEYp0OXseCqrLAK8J7xgxlA
Date: Fri, 8 Jan 2016 11:57:03 +0000
Message-ID: <73ec0c74905943beaca9167e1fd45dd5@AMSPEX02CL03.citrite.net>
References: <1452253822-9744-1-git-send-email-mark.syms@citrix.com>
In-Reply-To: <1452253822-9744-1-git-send-email-mark.syms@citrix.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ms-exchange-transport-fromentityheader: Hosted
MIME-Version: 1.0
X-DLP: AMS1
Cc: Mark Syms <Mark.Syms@citrix.com>
Subject: Re: [win-pv-devel] [PATCH] Use correct FdoD0ToD3 function.
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

> -----Original Message-----
> From: win-pv-devel-bounces@lists.xenproject.org [mailto:win-pv-devel-
> bounces@lists.xenproject.org] On Behalf Of Mark Syms
> Sent: 08 January 2016 11:50
> To: win-pv-devel@lists.xenproject.org
> Cc: Mark Syms
> Subject: [win-pv-devel] [PATCH] Use correct FdoD0ToD3 function.
> 
> Signed-off-by: Mark Syms <mark.syms@citrix.com>

Oops, I wonder how long this has been broken.

Acked-by: Paul Durrant <paul.durrant@citrix.com>

I'll back-port to staging-8.1 and re-tag too.

> ---
>  src/xenvbd/fdo.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/xenvbd/fdo.c b/src/xenvbd/fdo.c
> index aa92fe4..cf05483 100644
> --- a/src/xenvbd/fdo.c
> +++ b/src/xenvbd/fdo.c
> @@ -1982,7 +1982,7 @@ FdoDispatchPnp(
>      switch (Stack->MinorFunction) {
>      case IRP_MN_REMOVE_DEVICE:
>          Verbose("FDO:IRP_MN_REMOVE_DEVICE\n");
> -        __FdoD0ToD3(Fdo);
> +        FdoD0ToD3(Fdo);
>          FdoUnplugRequest(Fdo, FALSE);
>          // drop ref-count acquired in DriverGetFdo *before* destroying Fdo
>          FdoDereference(Fdo);
> --
> 1.9.5.msysgit.1
> 
> 
> _______________________________________________
> win-pv-devel mailing list
> win-pv-devel@lists.xenproject.org
> http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Wed Jan 13 16:40:16 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 13 Jan 2016 16:40:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aJOT1-00085T-2k; Wed, 13 Jan 2016 16:40:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lars.kurth.xen@gmail.com>) id 1aJOSz-00084o-Fx
	for Win-pv-devel@lists.xenproject.org; Wed, 13 Jan 2016 16:40:13 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	BB/81-08977-CED76965; Wed, 13 Jan 2016 16:40:12 +0000
X-Env-Sender: lars.kurth.xen@gmail.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1452703211!9907385!1
X-Originating-IP: [74.125.82.50]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 37229 invoked from network); 13 Jan 2016 16:40:12 -0000
Received: from mail-wm0-f50.google.com (HELO mail-wm0-f50.google.com)
	(74.125.82.50)
	by server-14.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 13 Jan 2016 16:40:12 -0000
Received: by mail-wm0-f50.google.com with SMTP id b14so381178547wmb.1
	for <Win-pv-devel@lists.xenproject.org>;
	Wed, 13 Jan 2016 08:40:12 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:content-type:content-transfer-encoding:subject:message-id:date
	:to:mime-version;
	bh=OstWMIMhjQey68o4trMobyShHM56YZOwMYv8nzdZh+g=;
	b=RVM1IjmUeUpMoSxgSqq0MFltFlF3HWDt+RdviUSayLeRFXAngeWs940xxQ5qOVEBvM
	8I95REmKpzdHBTdi1LU/QkNxYC4GlCJZM2N7Me24yu6FyIFE7N0hoAbqAsQNjxkWwPkr
	HwaXuVf63w3qNbgK35d6iODI4mAxLRZNE+ScOWxLpOkQ/FezGGQ9+KlYyrlfEQKj2FhZ
	8eIQnW59wiyFK/R6/qEKzph+E/P5ihIkRmO6mqqwjJIt099nquMXF0D6qadr2bLAHKIF
	TxPtL2Emq1CeyqyWCODyRnaa7nlR1QBHM1lQWDxfHQjzjHq9Rbon94JDlHA/NHPms4bV
	FOkw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:content-type:content-transfer-encoding
	:subject:message-id:date:to:mime-version;
	bh=OstWMIMhjQey68o4trMobyShHM56YZOwMYv8nzdZh+g=;
	b=U2ha2D2gKj9rprsQsbK1lpyIQxZ7vYaqrStOQBn4n6jnt7D0sN6VOSyr+jY5VTcvxl
	MfJk4srHvZs7h+Q4fcQYNzqJKhfghqKJUL4+Ox69Zmk9h1tnzH7UNcJEUug3NQBGu5rM
	y8fGABj9134Z7b0qEvL1yEmDb2r+Mz18/BFr2BoXcwzGN4gN60/WkNSNtcW518tuVmUy
	AdiVXcT+XhdFxamNqGQNn1XMHWmg9dGvYCJHwkptJPJmK3KL1/MkQY+yd8Hly1kc0VjY
	2jO2fr1dHHIazgA1pL/dfcBlz0gennbUfGagcO3DeBy5lKianrCahMJ4TUTyQhHrzKa2
	NAlA==
X-Gm-Message-State: ALoCoQkTBSDDvwLTstsa2Vo/48y4ZZbEmXFv7hw9keuVdkSiB/t9WUCQwVBNTanp7jmIovoOA/Yqu6WO66cuksJT9PdCZdaB/g==
X-Received: by 10.28.195.138 with SMTP id t132mr25982874wmf.61.1452703211826; 
	Wed, 13 Jan 2016 08:40:11 -0800 (PST)
Received: from [192.168.0.12] (5ec0a0ad.skybroadband.com. [94.192.160.173])
	by smtp.gmail.com with ESMTPSA id
	w80sm23066571wme.17.2016.01.13.08.40.10
	for <Win-pv-devel@lists.xenproject.org>
	(version=TLSv1/SSLv3 cipher=OTHER);
	Wed, 13 Jan 2016 08:40:11 -0800 (PST)
From: Lars Kurth <lars.kurth.xen@gmail.com>
Message-Id: <2D4E6CDC-923E-47C7-81E6-6069932CB064@gmail.com>
Date: Wed, 13 Jan 2016 16:40:09 +0000
To: Win-pv-devel@lists.xenproject.org
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\))
X-Mailer: Apple Mail (2.2104)
Subject: [win-pv-devel] Xen Project Hackathon, Cambridge UK,
	Apr 18-19 - registration, hotels and other information
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Hi all,
I just put together the booking page for the next Hackathon. See http://wiki.xenproject.org/wiki/Hackathon/April2016 for more information.

* If you are a maintainer or otherwise a core member of the community, just add yourself to the Confirmed Attendees section stating your name and organisation. You can also use the {{Invite|Name|Org|IRC handle|arrival date|leave date|lodging}} template to provide more information with the aim to co-ordinate travel and find people staying in the same hotel as you.

* If you are not a maintainer or known member of the community, please add yourself the Request invitation section. If your email address is not known in the Xen Community, please also add the name of your employer and send your e-mail address to community dot manager at xenproject dot org using "Request for Hackathon 2016 Invite" as subject line. This is important, such that we can e-mail more information to you. We will monitor this page and confirm whether we have space for you to attend.

Best Regards
Lars
_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Wed Jan 13 16:40:16 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 13 Jan 2016 16:40:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aJOT1-00085T-2k; Wed, 13 Jan 2016 16:40:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lars.kurth.xen@gmail.com>) id 1aJOSz-00084o-Fx
	for Win-pv-devel@lists.xenproject.org; Wed, 13 Jan 2016 16:40:13 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	BB/81-08977-CED76965; Wed, 13 Jan 2016 16:40:12 +0000
X-Env-Sender: lars.kurth.xen@gmail.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1452703211!9907385!1
X-Originating-IP: [74.125.82.50]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 37229 invoked from network); 13 Jan 2016 16:40:12 -0000
Received: from mail-wm0-f50.google.com (HELO mail-wm0-f50.google.com)
	(74.125.82.50)
	by server-14.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 13 Jan 2016 16:40:12 -0000
Received: by mail-wm0-f50.google.com with SMTP id b14so381178547wmb.1
	for <Win-pv-devel@lists.xenproject.org>;
	Wed, 13 Jan 2016 08:40:12 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:content-type:content-transfer-encoding:subject:message-id:date
	:to:mime-version;
	bh=OstWMIMhjQey68o4trMobyShHM56YZOwMYv8nzdZh+g=;
	b=RVM1IjmUeUpMoSxgSqq0MFltFlF3HWDt+RdviUSayLeRFXAngeWs940xxQ5qOVEBvM
	8I95REmKpzdHBTdi1LU/QkNxYC4GlCJZM2N7Me24yu6FyIFE7N0hoAbqAsQNjxkWwPkr
	HwaXuVf63w3qNbgK35d6iODI4mAxLRZNE+ScOWxLpOkQ/FezGGQ9+KlYyrlfEQKj2FhZ
	8eIQnW59wiyFK/R6/qEKzph+E/P5ihIkRmO6mqqwjJIt099nquMXF0D6qadr2bLAHKIF
	TxPtL2Emq1CeyqyWCODyRnaa7nlR1QBHM1lQWDxfHQjzjHq9Rbon94JDlHA/NHPms4bV
	FOkw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:content-type:content-transfer-encoding
	:subject:message-id:date:to:mime-version;
	bh=OstWMIMhjQey68o4trMobyShHM56YZOwMYv8nzdZh+g=;
	b=U2ha2D2gKj9rprsQsbK1lpyIQxZ7vYaqrStOQBn4n6jnt7D0sN6VOSyr+jY5VTcvxl
	MfJk4srHvZs7h+Q4fcQYNzqJKhfghqKJUL4+Ox69Zmk9h1tnzH7UNcJEUug3NQBGu5rM
	y8fGABj9134Z7b0qEvL1yEmDb2r+Mz18/BFr2BoXcwzGN4gN60/WkNSNtcW518tuVmUy
	AdiVXcT+XhdFxamNqGQNn1XMHWmg9dGvYCJHwkptJPJmK3KL1/MkQY+yd8Hly1kc0VjY
	2jO2fr1dHHIazgA1pL/dfcBlz0gennbUfGagcO3DeBy5lKianrCahMJ4TUTyQhHrzKa2
	NAlA==
X-Gm-Message-State: ALoCoQkTBSDDvwLTstsa2Vo/48y4ZZbEmXFv7hw9keuVdkSiB/t9WUCQwVBNTanp7jmIovoOA/Yqu6WO66cuksJT9PdCZdaB/g==
X-Received: by 10.28.195.138 with SMTP id t132mr25982874wmf.61.1452703211826; 
	Wed, 13 Jan 2016 08:40:11 -0800 (PST)
Received: from [192.168.0.12] (5ec0a0ad.skybroadband.com. [94.192.160.173])
	by smtp.gmail.com with ESMTPSA id
	w80sm23066571wme.17.2016.01.13.08.40.10
	for <Win-pv-devel@lists.xenproject.org>
	(version=TLSv1/SSLv3 cipher=OTHER);
	Wed, 13 Jan 2016 08:40:11 -0800 (PST)
From: Lars Kurth <lars.kurth.xen@gmail.com>
Message-Id: <2D4E6CDC-923E-47C7-81E6-6069932CB064@gmail.com>
Date: Wed, 13 Jan 2016 16:40:09 +0000
To: Win-pv-devel@lists.xenproject.org
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\))
X-Mailer: Apple Mail (2.2104)
Subject: [win-pv-devel] Xen Project Hackathon, Cambridge UK,
	Apr 18-19 - registration, hotels and other information
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Hi all,
I just put together the booking page for the next Hackathon. See http://wiki.xenproject.org/wiki/Hackathon/April2016 for more information.

* If you are a maintainer or otherwise a core member of the community, just add yourself to the Confirmed Attendees section stating your name and organisation. You can also use the {{Invite|Name|Org|IRC handle|arrival date|leave date|lodging}} template to provide more information with the aim to co-ordinate travel and find people staying in the same hotel as you.

* If you are not a maintainer or known member of the community, please add yourself the Request invitation section. If your email address is not known in the Xen Community, please also add the name of your employer and send your e-mail address to community dot manager at xenproject dot org using "Request for Hackathon 2016 Invite" as subject line. This is important, such that we can e-mail more information to you. We will monitor this page and confirm whether we have space for you to attend.

Best Regards
Lars
_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Fri Jan 15 15:16:38 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 15 Jan 2016 15:16:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aK67B-0002wL-2c; Fri, 15 Jan 2016 15:16:37 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aK679-0002wF-95
	for win-pv-devel@lists.xenproject.org; Fri, 15 Jan 2016 15:16:35 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	7A/2D-10715-25D09965; Fri, 15 Jan 2016 15:16:34 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1452870993!17156561!1
X-Originating-IP: [74.125.82.41]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 56251 invoked from network); 15 Jan 2016 15:16:33 -0000
Received: from mail-wm0-f41.google.com (HELO mail-wm0-f41.google.com)
	(74.125.82.41)
	by server-13.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 15 Jan 2016 15:16:33 -0000
Received: by mail-wm0-f41.google.com with SMTP id u188so27115949wmu.1
	for <win-pv-devel@lists.xenproject.org>;
	Fri, 15 Jan 2016 07:16:33 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=cKmMoldtbxBKZRRvZoFql3KM31DGDInB9u9s65yu4nk=;
	b=sVslpM/SUfxdnjqjoVl2gyVJ8pVdrtXxhGS2CvK+P0z1ptgS+7wwjXo+aXujpTJhMa
	Qz61yLSo92+5mcscFfdUcyFpLETHHQAf4FRnGk9v7UA8+TyLOzuu8fcc6zh8W6fOJwMn
	nlpGRrg41ZU1bRm+9z42O9hkahwFn3fXnhjiugfVoQ9kYEh7m+IexfBaSKLb9IszwyRv
	6/skXmxev0JJZOG+Oyb5jjLwLRCo/Szpld3VlgS2+gmd05zTiahHP278rmDtzqa+9Xbq
	/2yJqIJ5nau1lryoN8eugiKdxsu6EMO1yP6MdYQBuGpNC79bgixkEuQCZshDuW67WF1A
	5iuQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id;
	bh=cKmMoldtbxBKZRRvZoFql3KM31DGDInB9u9s65yu4nk=;
	b=CzJBKvB2kEdXIr7+45KW3l9QLMOOtW7B1+3mDl0bNAme6+FrTDAZzk3uAr2c0DCufS
	1uthok+45mGZoyXzSMO4OHiVmxoTqf5Ayc6KrVJ7B/1CXFOm9lG5X1VwbhTSt2joTSL8
	/0llLRzSCNTdSUwMGPGsb4Kt9tVkg8pL21kG2HZYZXAhrsY3BwOgDgfxQ0VTTmGBh/O0
	z9iRgByakFXlyT2RKdHfafBlqiz6yGhEkjNV0ZqInq8atqhX1LBaQUKEQUZjBeeLz3Lf
	Bb6vJwtEUK5MN3wTxW0A4YIQhOZggmY/4o0scGUdtvCaIoMmFg7hKCelbaCjcNr3rOL9
	VQnQ==
X-Gm-Message-State: ALoCoQlpWCoEfSD2GMQpTZx1J6GlSazXSjyyd9TZOFRstqvyt/f+k24eKrA7KQlYeHbT7uJljS89AOEs+nwDnZ3/PN7KgJWAjw==
X-Received: by 10.195.13.129 with SMTP id ey1mr10324119wjd.132.1452870992787; 
	Fri, 15 Jan 2016 07:16:32 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	i2sm10965397wjx.42.2016.01.15.07.16.31
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Fri, 15 Jan 2016 07:16:32 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Fri, 15 Jan 2016 15:16:18 +0000
Message-Id: <1452870978-10408-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Centralize compatibility code
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

This patch moves the code that maintains compatibility with older
VIF interface versions into the vif.c module, rather than having it
distributed amongst vif.c, transmitter.c and receiver.c.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xenvif/receiver.c    | 130 ++------------------
 src/xenvif/receiver.h    |   6 -
 src/xenvif/transmitter.c | 183 +---------------------------
 src/xenvif/transmitter.h |  14 ---
 src/xenvif/vif.c         | 310 ++++++++++++++++++++++++++++++++++++++++-------
 src/xenvif/vif.h         |   5 -
 6 files changed, 277 insertions(+), 371 deletions(-)

diff --git a/src/xenvif/receiver.c b/src/xenvif/receiver.c
index d3073e1..bfc5ff9 100644
--- a/src/xenvif/receiver.c
+++ b/src/xenvif/receiver.c
@@ -1373,79 +1373,6 @@ __ReceiverRingAcquireLock(
     KeAcquireSpinLockAtDpcLevel(&Ring->Lock);
 }
 
-static FORCEINLINE VOID
-__ReceiverQueuePacketVersion1(
-    IN  PXENVIF_RECEIVER                Receiver,
-    IN  PMDL                            Mdl,
-    IN  ULONG                           Offset,
-    IN  ULONG                           Length,
-    IN  XENVIF_PACKET_CHECKSUM_FLAGS    Flags,
-    IN  USHORT                          MaximumSegmentSize,
-    IN  USHORT                          TagControlInformation,
-    IN  PXENVIF_PACKET_INFO             Info,
-    IN  PVOID                           Cookie
-    )
-{
-    struct _XENVIF_PACKET_INFO_V1       *InfoVersion1;
-    struct _XENVIF_RECEIVER_PACKET_V1   *PacketVersion1;
-    PXENVIF_FRONTEND                    Frontend;
-    PXENVIF_VIF_CONTEXT                 Context;
-    LIST_ENTRY                          List;
-    NTSTATUS                            status;
-
-    InfoVersion1 = __ReceiverAllocate(sizeof (struct _XENVIF_PACKET_INFO_V1));
-
-    status = STATUS_NO_MEMORY;
-    if (InfoVersion1 == NULL)
-        goto fail1;
-
-    InfoVersion1->Length = Info->Length;
-    InfoVersion1->TagControlInformation = TagControlInformation;
-    InfoVersion1->IsAFragment = Info->IsAFragment;
-    InfoVersion1->EthernetHeader = Info->EthernetHeader;
-    InfoVersion1->LLCSnapHeader = Info->LLCSnapHeader;
-    InfoVersion1->IpHeader = Info->IpHeader;
-    InfoVersion1->IpOptions = Info->IpOptions;
-    InfoVersion1->TcpHeader = Info->TcpHeader;
-    InfoVersion1->TcpOptions = Info->TcpOptions;
-    InfoVersion1->UdpHeader = Info->UdpHeader;
-
-    PacketVersion1 = __ReceiverAllocate(sizeof (struct _XENVIF_RECEIVER_PACKET_V1));
-
-    status = STATUS_NO_MEMORY;
-    if (PacketVersion1 == NULL)
-        goto fail2;
-
-    PacketVersion1->Info = InfoVersion1;
-    PacketVersion1->Offset = Offset;
-    PacketVersion1->Length = Length;
-    PacketVersion1->Flags = Flags;
-    PacketVersion1->MaximumSegmentSize = MaximumSegmentSize;
-    PacketVersion1->Cookie = Cookie;
-    PacketVersion1->Mdl = *Mdl;
-    PacketVersion1->__Pfn = MmGetMdlPfnArray(Mdl)[0];
-
-    Frontend = Receiver->Frontend;
-    Context = PdoGetVifContext(FrontendGetPdo(Frontend));
-
-    InitializeListHead(&List);
-
-    InsertTailList(&List, &PacketVersion1->ListEntry);
-
-    VifReceiverQueuePacketsVersion1(Context, &List);
-    ASSERT(IsListEmpty(&List));
-
-    return;
-
-fail2:
-    Error("fail2\n");
-
-fail1:
-    Error("fail1 (%08x)\n", status);
-
-    ReceiverReturnPacket(Receiver, Cookie);
-}
-
 static DECLSPEC_NOINLINE VOID
 ReceiverRingAcquireLock(
     IN  PXENVIF_RECEIVER_RING   Ring
@@ -1463,7 +1390,6 @@ __ReceiverRingReleaseLock(
     PXENVIF_RECEIVER            Receiver;
     PXENVIF_FRONTEND            Frontend;
     PXENVIF_VIF_CONTEXT         Context;
-    ULONG                       Version;
     LIST_ENTRY                  List;
     ULONG                       Count;
 
@@ -1472,7 +1398,6 @@ __ReceiverRingReleaseLock(
     Receiver = Ring->Receiver;
     Frontend = Receiver->Frontend;
     Context = PdoGetVifContext(FrontendGetPdo(Frontend));
-    Version = VifGetVersion(Context);
 
     InitializeListHead(&List);
     Count = 0;
@@ -1502,26 +1427,15 @@ __ReceiverRingReleaseLock(
                                    XENVIF_RECEIVER_PACKET,
                                    ListEntry);
 
-        if (Version < 4)
-            __ReceiverQueuePacketVersion1(Receiver,
-                                          &Packet->Mdl,
-                                          Packet->Offset,
-                                          Packet->Length,
-                                          Packet->Flags,
-                                          Packet->MaximumSegmentSize,
-                                          Packet->TagControlInformation,
-                                          &Packet->Info,
-                                          Packet);
-        else
-            VifReceiverQueuePacket(Context,
-                                   &Packet->Mdl,
-                                   Packet->Offset,
-                                   Packet->Length,
-                                   Packet->Flags,
-                                   Packet->MaximumSegmentSize,
-                                   Packet->TagControlInformation,
-                                   &Packet->Info,
-                                   Packet);
+        VifReceiverQueuePacket(Context,
+                               &Packet->Mdl,
+                               Packet->Offset,
+                               Packet->Length,
+                               Packet->Flags,
+                               Packet->MaximumSegmentSize,
+                               Packet->TagControlInformation,
+                               &Packet->Info,
+                               Packet);
     }
 
     ASSERT(IsListEmpty(&List));
@@ -3471,32 +3385,6 @@ ReceiverReturnPacket(
 }
 
 VOID
-ReceiverReturnPacketsVersion1(
-    IN  PXENVIF_RECEIVER    Receiver,
-    IN  PLIST_ENTRY         List
-    )
-{
-    while (!IsListEmpty(List)) {
-        PLIST_ENTRY                         ListEntry;
-        struct _XENVIF_RECEIVER_PACKET_V1   *PacketVersion1;
-
-        ListEntry = RemoveHeadList(List);
-        ASSERT3P(ListEntry, !=, List);
-
-        RtlZeroMemory(ListEntry, sizeof (LIST_ENTRY));
-
-        PacketVersion1 = CONTAINING_RECORD(ListEntry,
-                                           struct _XENVIF_RECEIVER_PACKET_V1,
-                                           ListEntry);
-
-        ReceiverReturnPacket(Receiver, PacketVersion1->Cookie);
-
-        __ReceiverFree(PacketVersion1->Info);
-        __ReceiverFree(PacketVersion1);
-    }
-}
-
-VOID
 ReceiverWaitForPackets(
     IN  PXENVIF_RECEIVER    Receiver
     )
diff --git a/src/xenvif/receiver.h b/src/xenvif/receiver.h
index 042e1da..7188dfa 100644
--- a/src/xenvif/receiver.h
+++ b/src/xenvif/receiver.h
@@ -101,12 +101,6 @@ ReceiverSetBackfillSize(
     );
 
 extern VOID
-ReceiverReturnPacketsVersion1(
-    IN  PXENVIF_RECEIVER    Receiver,
-    IN  PLIST_ENTRY         List
-    );
-
-extern VOID
 ReceiverReturnPacket(
     IN  PXENVIF_RECEIVER    Receiver,
     IN  PVOID               Cookie
diff --git a/src/xenvif/transmitter.c b/src/xenvif/transmitter.c
index a8b0162..a5bcf82 100644
--- a/src/xenvif/transmitter.c
+++ b/src/xenvif/transmitter.c
@@ -2736,33 +2736,6 @@ TransmitterRingSchedule(
 }
 
 static FORCEINLINE VOID
-__TransmitterReturnPacketVersion2(
-    IN  PXENVIF_TRANSMITTER                         Transmitter,
-    IN  PVOID                                       Cookie,
-    IN  PXENVIF_TRANSMITTER_PACKET_COMPLETION_INFO  Completion
-    )
-{
-    struct _XENVIF_TRANSMITTER_PACKET_V2            *PacketVersion2;
-    PXENVIF_FRONTEND                                Frontend;
-    PXENVIF_VIF_CONTEXT                             Context;
-    LIST_ENTRY                                      List;
-
-    PacketVersion2 = Cookie;
-    PacketVersion2->Completion = *Completion;
-
-    Frontend = Transmitter->Frontend;
-    Context = PdoGetVifContext(FrontendGetPdo(Frontend));
-
-    InitializeListHead(&List);
-
-    ASSERT(IsZeroMemory(&PacketVersion2->ListEntry, sizeof (LIST_ENTRY)));
-    InsertTailList(&List, &PacketVersion2->ListEntry);
-
-    VifTransmitterReturnPacketsVersion2(Context, &List);
-    ASSERT(IsListEmpty(&List));
-}
-
-static FORCEINLINE VOID
 __TransmitterReturnPackets(
     IN  PXENVIF_TRANSMITTER Transmitter,
     IN  PLIST_ENTRY         List
@@ -2770,11 +2743,9 @@ __TransmitterReturnPackets(
 {
     PXENVIF_FRONTEND        Frontend;
     PXENVIF_VIF_CONTEXT     Context;
-    ULONG                   Version;
 
     Frontend = Transmitter->Frontend;
     Context = PdoGetVifContext(FrontendGetPdo(Frontend));
-    Version = VifGetVersion(Context);
 
     while (!IsListEmpty(List)) {
         PLIST_ENTRY                 ListEntry;
@@ -2789,14 +2760,9 @@ __TransmitterReturnPackets(
                                    XENVIF_TRANSMITTER_PACKET,
                                    ListEntry);
 
-        if  (Version < 4)
-            __TransmitterReturnPacketVersion2(Transmitter,
-                                              Packet->Cookie,
-                                              &Packet->Completion);
-        else
-            VifTransmitterReturnPacket(Context,
-                                       Packet->Cookie,
-                                       &Packet->Completion);
+        VifTransmitterReturnPacket(Context,
+                                   Packet->Cookie,
+                                   &Packet->Completion);
 
         __TransmitterPutPacket(Transmitter, Packet);
     }
@@ -4560,96 +4526,6 @@ TransmitterTeardown(
     __TransmitterFree(Transmitter);
 }
 
-static BOOLEAN
-TransmitterGetPacketHeadersVersion2Pullup(
-    IN      PVOID                   Argument,
-    IN      PUCHAR                  DestinationVa,
-    IN OUT  PXENVIF_PACKET_PAYLOAD  Payload,
-    IN      ULONG                   Length
-    )
-{
-    PMDL                            Mdl;
-    ULONG                           Offset;
-
-    UNREFERENCED_PARAMETER(Argument);
-
-    Mdl = Payload->Mdl;
-    Offset = Payload->Offset;
-
-    if (Payload->Length < Length)
-        goto fail1;
-
-    Payload->Length -= Length;
-
-    while (Length != 0) {
-        PUCHAR  MdlMappedSystemVa;
-        ULONG   MdlByteCount;
-        ULONG   CopyLength;
-
-        ASSERT(Mdl != NULL);
-
-        MdlMappedSystemVa = MmGetSystemAddressForMdlSafe(Mdl, NormalPagePriority);
-        ASSERT(MdlMappedSystemVa != NULL);
-
-        MdlMappedSystemVa += Offset;
-
-        MdlByteCount = Mdl->ByteCount - Offset;
-
-        CopyLength = __min(MdlByteCount, Length);
-
-        RtlCopyMemory(DestinationVa, MdlMappedSystemVa, CopyLength);
-        DestinationVa += CopyLength;
-
-        Offset += CopyLength;
-        Length -= CopyLength;
-
-        MdlByteCount -= CopyLength;
-        if (MdlByteCount == 0) {
-            Mdl = Mdl->Next;
-            Offset = 0;
-        }
-    }
-
-    Payload->Mdl = Mdl;
-    Payload->Offset = Offset;
-
-    return TRUE;
-
-fail1:
-    Error("fail1\n");
-
-    return FALSE;
-}
-
-NTSTATUS
-TransmitterGetPacketHeadersVersion2(
-    IN  PXENVIF_TRANSMITTER                     Transmitter,
-    IN  struct _XENVIF_TRANSMITTER_PACKET_V2    *PacketVersion2,
-    OUT PVOID                                   Headers,
-    OUT PXENVIF_PACKET_INFO                     Info
-    )
-{
-    XENVIF_PACKET_PAYLOAD                       Payload;
-    NTSTATUS                                    status;
-
-    Payload.Mdl = PacketVersion2->Mdl;
-    Payload.Offset = PacketVersion2->Offset;
-    Payload.Length = PacketVersion2->Length;
-
-    status = ParsePacket(Headers,
-                         TransmitterGetPacketHeadersVersion2Pullup,
-                         Transmitter,
-                         &Payload,
-                         Info);
-    if (!NT_SUCCESS(status))
-        goto fail1;
-
-    return STATUS_SUCCESS;
-
-fail1:
-    return status;
-}
-
 static FORCEINLINE VOID
 __TransmitterHashAccumulate(
     IN OUT  PULONG  Accumulator,
@@ -4834,59 +4710,6 @@ fail1:
     return status;
 }
 
-NTSTATUS
-TransmitterQueuePacketsVersion2(
-    IN  PXENVIF_TRANSMITTER     Transmitter,
-    IN  PLIST_ENTRY             List
-    )
-{
-    LIST_ENTRY                  Reject;
-
-    InitializeListHead(&Reject);
-
-    while (!IsListEmpty(List)) {
-        PLIST_ENTRY                             ListEntry;
-        struct _XENVIF_TRANSMITTER_PACKET_V2    *PacketVersion2;
-        XENVIF_PACKET_HASH                      Hash;
-        NTSTATUS                                status;
-
-        ListEntry = RemoveHeadList(List);
-        ASSERT3P(ListEntry, !=, List);
-
-        RtlZeroMemory(ListEntry, sizeof (LIST_ENTRY));
-
-        PacketVersion2 = CONTAINING_RECORD(ListEntry,
-                                           struct _XENVIF_TRANSMITTER_PACKET_V2,
-                                           ListEntry);
-
-        Hash.Algorithm = XENVIF_PACKET_HASH_ALGORITHM_UNSPECIFIED;
-        Hash.Value = PacketVersion2->Value;
-
-        status = TransmitterQueuePacket(Transmitter,
-                                        PacketVersion2->Mdl,
-                                        PacketVersion2->Offset,
-                                        PacketVersion2->Length,
-                                        PacketVersion2->Send.OffloadOptions,
-                                        PacketVersion2->Send.MaximumSegmentSize,
-                                        PacketVersion2->Send.TagControlInformation,
-                                        &Hash,
-                                        PacketVersion2);
-        if (!NT_SUCCESS(status))
-            InsertTailList(&Reject, &PacketVersion2->ListEntry);
-    }
-
-    ASSERT(IsListEmpty(List));
-
-    if (!IsListEmpty(&Reject)) {
-        PLIST_ENTRY ListEntry = Reject.Flink;
-
-        RemoveEntryList(&Reject);
-        AppendTailList(List, ListEntry);
-    }
-
-    return (IsListEmpty(List)) ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL;
-}
-
 VOID
 TransmitterAbortPackets(
     IN  PXENVIF_TRANSMITTER Transmitter
diff --git a/src/xenvif/transmitter.h b/src/xenvif/transmitter.h
index 0b7f654..31198fb 100644
--- a/src/xenvif/transmitter.h
+++ b/src/xenvif/transmitter.h
@@ -128,12 +128,6 @@ TransmitterQueuePacket(
     IN  PVOID                       Cookie
     );
 
-extern NTSTATUS
-TransmitterQueuePacketsVersion2(
-    IN  PXENVIF_TRANSMITTER Transmitter,
-    IN  PLIST_ENTRY         List
-    );
-
 extern VOID
 TransmitterQueryOffloadOptions(
     IN  PXENVIF_TRANSMITTER         Transmitter,
@@ -147,12 +141,4 @@ TransmitterQueryLargePacketSize(
     OUT PULONG                  Size
     );
 
-extern NTSTATUS
-TransmitterGetPacketHeadersVersion2(
-    IN  PXENVIF_TRANSMITTER                     Transmitter,
-    IN  struct _XENVIF_TRANSMITTER_PACKET_V2    *Packet,
-    OUT PVOID                                   Headers,
-    OUT PXENVIF_PACKET_INFO                     Info
-    );
-
 #endif  // _XENVIF_TRANSMITTER_H
diff --git a/src/xenvif/vif.c b/src/xenvif/vif.c
index 3d40ad0..2288561 100644
--- a/src/xenvif/vif.c
+++ b/src/xenvif/vif.c
@@ -32,9 +32,11 @@
 #include <ntddk.h>
 #include <ntstrsafe.h>
 #include <stdarg.h>
+#include <stdlib.h>
 #include <xen.h>
 
 #include "pdo.h"
+#include "parse.h"
 #include "vif.h"
 #include "mrsw.h"
 #include "thread.h"
@@ -326,8 +328,25 @@ VifReceiverReturnPacketsVersion1(
 
     AcquireMrswLockShared(&Context->Lock);
 
-    ReceiverReturnPacketsVersion1(FrontendGetReceiver(Context->Frontend),
-                                  List);
+    while (!IsListEmpty(List)) {
+        PLIST_ENTRY                         ListEntry;
+        struct _XENVIF_RECEIVER_PACKET_V1   *PacketVersion1;
+
+        ListEntry = RemoveHeadList(List);
+        ASSERT3P(ListEntry, !=, List);
+
+        RtlZeroMemory(ListEntry, sizeof (LIST_ENTRY));
+
+        PacketVersion1 = CONTAINING_RECORD(ListEntry,
+                                           struct _XENVIF_RECEIVER_PACKET_V1,
+                                           ListEntry);
+
+        ReceiverReturnPacket(FrontendGetReceiver(Context->Frontend),
+                             PacketVersion1->Cookie);
+
+        __VifFree(PacketVersion1->Info);
+        __VifFree(PacketVersion1);
+    }
 
     ReleaseMrswLockShared(&Context->Lock);
 }
@@ -348,6 +367,67 @@ VifReceiverReturnPacket(
     ReleaseMrswLockShared(&Context->Lock);
 }
 
+static BOOLEAN
+VifTransmitterGetPacketHeadersVersion2Pullup(
+    IN      PVOID                   Argument,
+    IN      PUCHAR                  DestinationVa,
+    IN OUT  PXENVIF_PACKET_PAYLOAD  Payload,
+    IN      ULONG                   Length
+    )
+{
+    PMDL                            Mdl;
+    ULONG                           Offset;
+
+    UNREFERENCED_PARAMETER(Argument);
+
+    Mdl = Payload->Mdl;
+    Offset = Payload->Offset;
+
+    if (Payload->Length < Length)
+        goto fail1;
+
+    Payload->Length -= Length;
+
+    while (Length != 0) {
+        PUCHAR  MdlMappedSystemVa;
+        ULONG   MdlByteCount;
+        ULONG   CopyLength;
+
+        ASSERT(Mdl != NULL);
+
+        MdlMappedSystemVa = MmGetSystemAddressForMdlSafe(Mdl, NormalPagePriority);
+        ASSERT(MdlMappedSystemVa != NULL);
+
+        MdlMappedSystemVa += Offset;
+
+        MdlByteCount = Mdl->ByteCount - Offset;
+
+        CopyLength = __min(MdlByteCount, Length);
+
+        RtlCopyMemory(DestinationVa, MdlMappedSystemVa, CopyLength);
+        DestinationVa += CopyLength;
+
+        Offset += CopyLength;
+        Length -= CopyLength;
+
+        MdlByteCount -= CopyLength;
+        if (MdlByteCount == 0) {
+            Mdl = Mdl->Next;
+            Offset = 0;
+        }
+    }
+
+    Payload->Mdl = Mdl;
+    Payload->Offset = Offset;
+
+    return TRUE;
+
+fail1:
+    Error("fail1\n");
+
+    return FALSE;
+}
+
 static NTSTATUS
 VifTransmitterGetPacketHeadersVersion2(
     IN  PINTERFACE                              Interface,
@@ -357,14 +437,20 @@ VifTransmitterGetPacketHeadersVersion2(
     )
 {
     PXENVIF_VIF_CONTEXT                         Context = Interface->Context;
+    XENVIF_PACKET_PAYLOAD                       Payload;
     NTSTATUS                                    status;
 
     AcquireMrswLockShared(&Context->Lock);
 
-    status = TransmitterGetPacketHeadersVersion2(FrontendGetTransmitter(Context->Frontend),
-                                                 Packet,
-                                                 Headers,
-                                                 Info);
+    Payload.Mdl = Packet->Mdl;
+    Payload.Offset = Packet->Offset;
+    Payload.Length = Packet->Length;
+
+    status = ParsePacket(Headers,
+                         VifTransmitterGetPacketHeadersVersion2Pullup,
+                         Context,
+                         &Payload,
+                         Info);
 
     ReleaseMrswLockShared(&Context->Lock);
 
@@ -378,21 +464,59 @@ VifTransmitterQueuePacketsVersion2(
     )
 {
     PXENVIF_VIF_CONTEXT Context = Interface->Context;
-    NTSTATUS            status;
+    LIST_ENTRY          Reject;
 
     AcquireMrswLockShared(&Context->Lock);
 
-    status = STATUS_UNSUCCESSFUL;
     if (Context->Enabled == FALSE)
         goto done;
 
-    status = TransmitterQueuePacketsVersion2(FrontendGetTransmitter(Context->Frontend),
-                                             List);
+    InitializeListHead(&Reject);
+
+    while (!IsListEmpty(List)) {
+        PLIST_ENTRY                             ListEntry;
+        struct _XENVIF_TRANSMITTER_PACKET_V2    *PacketVersion2;
+        XENVIF_PACKET_HASH                      Hash;
+        NTSTATUS                                status;
+
+        ListEntry = RemoveHeadList(List);
+        ASSERT3P(ListEntry, !=, List);
+
+        RtlZeroMemory(ListEntry, sizeof (LIST_ENTRY));
+
+        PacketVersion2 = CONTAINING_RECORD(ListEntry,
+                                           struct _XENVIF_TRANSMITTER_PACKET_V2,
+                                           ListEntry);
+
+        Hash.Algorithm = XENVIF_PACKET_HASH_ALGORITHM_UNSPECIFIED;
+        Hash.Value = PacketVersion2->Value;
+
+        status = TransmitterQueuePacket(FrontendGetTransmitter(Context->Frontend),
+                                        PacketVersion2->Mdl,
+                                        PacketVersion2->Offset,
+                                        PacketVersion2->Length,
+                                        PacketVersion2->Send.OffloadOptions,
+                                        PacketVersion2->Send.MaximumSegmentSize,
+                                        PacketVersion2->Send.TagControlInformation,
+                                        &Hash,
+                                        PacketVersion2);
+        if (!NT_SUCCESS(status))
+            InsertTailList(&Reject, &PacketVersion2->ListEntry);
+    }
+
+    ASSERT(IsListEmpty(List));
+
+    if (!IsListEmpty(&Reject)) {
+        PLIST_ENTRY ListEntry = Reject.Flink;
+
+        RemoveEntryList(&Reject);
+        AppendTailList(List, ListEntry);
+    }
 
 done:
     ReleaseMrswLockShared(&Context->Lock);
 
-    return status;
+    return (IsListEmpty(List)) ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL;
 }
 
 static VOID
@@ -417,7 +541,6 @@ VifTransmitterQueuePacketVersion4(
     if (Context->Enabled == FALSE)
         goto done;
 
-    ASSERT3U(VifGetVersion(Context), >=, 4);
     status = TransmitterQueuePacket(FrontendGetTransmitter(Context->Frontend),
                                     Mdl,
                                     Offset,
@@ -466,7 +589,6 @@ VifTransmitterQueuePacket(
     if (Context->Enabled == FALSE)
         goto done;
 
-    ASSERT3U(VifGetVersion(Context), >=, 5);
     status = TransmitterQueuePacket(FrontendGetTransmitter(Context->Frontend),
                                     Mdl,
                                     Offset,
@@ -1054,15 +1176,75 @@ VifTeardown(
     Trace("<====\n");
 }
 
-VOID
-VifReceiverQueuePacketsVersion1(
-    IN  PXENVIF_VIF_CONTEXT Context,
-    IN  PLIST_ENTRY         List
+static FORCEINLINE VOID
+__VifReceiverQueuePacketVersion1(
+    IN  PXENVIF_VIF_CONTEXT             Context,
+    IN  PMDL                            Mdl,
+    IN  ULONG                           Offset,
+    IN  ULONG                           Length,
+    IN  XENVIF_PACKET_CHECKSUM_FLAGS    Flags,
+    IN  USHORT                          MaximumSegmentSize,
+    IN  USHORT                          TagControlInformation,
+    IN  PXENVIF_PACKET_INFO             Info,
+    IN  PVOID                           Cookie
     )
 {
+    struct _XENVIF_PACKET_INFO_V1       *InfoVersion1;
+    struct _XENVIF_RECEIVER_PACKET_V1   *PacketVersion1;
+    LIST_ENTRY                          List;
+    NTSTATUS                            status;
+
+    InfoVersion1 = __VifAllocate(sizeof (struct _XENVIF_PACKET_INFO_V1));
+
+    status = STATUS_NO_MEMORY;
+    if (InfoVersion1 == NULL)
+        goto fail1;
+
+    InfoVersion1->Length = Info->Length;
+    InfoVersion1->TagControlInformation = TagControlInformation;
+    InfoVersion1->IsAFragment = Info->IsAFragment;
+    InfoVersion1->EthernetHeader = Info->EthernetHeader;
+    InfoVersion1->LLCSnapHeader = Info->LLCSnapHeader;
+    InfoVersion1->IpHeader = Info->IpHeader;
+    InfoVersion1->IpOptions = Info->IpOptions;
+    InfoVersion1->TcpHeader = Info->TcpHeader;
+    InfoVersion1->TcpOptions = Info->TcpOptions;
+    InfoVersion1->UdpHeader = Info->UdpHeader;
+
+    PacketVersion1 = __VifAllocate(sizeof (struct _XENVIF_RECEIVER_PACKET_V1));
+
+    status = STATUS_NO_MEMORY;
+    if (PacketVersion1 == NULL)
+        goto fail2;
+
+    PacketVersion1->Info = InfoVersion1;
+    PacketVersion1->Offset = Offset;
+    PacketVersion1->Length = Length;
+    PacketVersion1->Flags = Flags;
+    PacketVersion1->MaximumSegmentSize = MaximumSegmentSize;
+    PacketVersion1->Cookie = Cookie;
+    PacketVersion1->Mdl = *Mdl;
+    PacketVersion1->__Pfn = MmGetMdlPfnArray(Mdl)[0];
+
+    InitializeListHead(&List);
+    InsertTailList(&List, &PacketVersion1->ListEntry);
+
     Context->Callback(Context->Argument,
                       XENVIF_RECEIVER_QUEUE_PACKET,
                       List);
+
+    ASSERT(IsListEmpty(&List));
+
+    return;
+
+fail2:
+    Error("fail2\n");
+
+fail1:
+    Error("fail1 (%08x)\n", status);
+
+    ReceiverReturnPacket(FrontendGetReceiver(Context->Frontend),
+                         Cookie);
 }
 
 VOID
@@ -1078,29 +1260,61 @@ VifReceiverQueuePacket(
     IN  PVOID                           Cookie
     )
 {
-    Context->Callback(Context->Argument,
-                      XENVIF_RECEIVER_QUEUE_PACKET,
-                      Mdl,
-                      Offset,
-                      Length,
-                      Flags,
-                      MaximumSegmentSize,
-                      TagControlInformation,
-                      Info,
-                      Cookie);
+    switch (Context->Version) {
+    case 2:
+    case 3:
+        __VifReceiverQueuePacketVersion1(Context,
+                                         Mdl,
+                                         Offset,
+                                         Length,
+                                         Flags,
+                                         MaximumSegmentSize,
+                                         TagControlInformation,
+                                         Info,
+                                         Cookie);
+        break;
+
+    case 4:
+    case 5:
+        Context->Callback(Context->Argument,
+                          XENVIF_RECEIVER_QUEUE_PACKET,
+                          Mdl,
+                          Offset,
+                          Length,
+                          Flags,
+                          MaximumSegmentSize,
+                          TagControlInformation,
+                          Info,
+                          Cookie);
+        break;
+
+    default:
+        ASSERT(FALSE);
+        break;
+    }
 }
 
-VOID
-VifTransmitterReturnPacketsVersion2(
-    IN  PXENVIF_VIF_CONTEXT Context,
-    IN  PLIST_ENTRY         List
+static FORCEINLINE VOID
+__VifTransmitterReturnPacketVersion2(
+    IN  PXENVIF_VIF_CONTEXT                         Context,
+    IN  PVOID                                       Cookie,
+    IN  PXENVIF_TRANSMITTER_PACKET_COMPLETION_INFO  Completion
     )
 {
-    ASSERT3U(VifGetVersion(Context), >=, 2);
+    struct _XENVIF_TRANSMITTER_PACKET_V2            *PacketVersion2;
+    LIST_ENTRY                                      List;
+
+    PacketVersion2 = Cookie;
+    PacketVersion2->Completion = *Completion;
+
+    InitializeListHead(&List);
+    InsertTailList(&List, &PacketVersion2->ListEntry);
 
     Context->Callback(Context->Argument,
                       XENVIF_TRANSMITTER_RETURN_PACKET,
                       List);
+
+    ASSERT(IsListEmpty(&List));
 }
 
 VOID
@@ -1110,12 +1324,26 @@ VifTransmitterReturnPacket(
     IN  PXENVIF_TRANSMITTER_PACKET_COMPLETION_INFO  Completion
     )
 {
-    ASSERT3U(VifGetVersion(Context), >=, 4);
+    switch (Context->Version) {
+    case 2:
+    case 3:
+        __VifTransmitterReturnPacketVersion2(Context,
+                                             Cookie,
+                                             Completion);
+        break;
 
-    Context->Callback(Context->Argument,
-                      XENVIF_TRANSMITTER_RETURN_PACKET,
-                      Cookie,
-                      Completion);
+    case 4:
+    case 5:
+        Context->Callback(Context->Argument,
+                          XENVIF_TRANSMITTER_RETURN_PACKET,
+                          Cookie,
+                          Completion);
+        break;
+
+    default:
+        ASSERT(FALSE);
+        break;
+    }
 }
 
 PXENVIF_THREAD
@@ -1125,11 +1353,3 @@ VifGetMacThread(
 {
     return Context->MacThread;
 }
-
-ULONG
-VifGetVersion(
-    IN  PXENVIF_VIF_CONTEXT Context
-    )
-{
-    return Context->Version;
-}
diff --git a/src/xenvif/vif.h b/src/xenvif/vif.h
index ebb4337..6cda4b7 100644
--- a/src/xenvif/vif.h
+++ b/src/xenvif/vif.h
@@ -99,10 +99,5 @@ VifGetMacThread(
     IN  PXENVIF_VIF_CONTEXT Context
     );
 
-extern ULONG
-VifGetVersion(
-    IN  PXENVIF_VIF_CONTEXT Context
-    );
-
 #endif  // _XENVIF_VIF_H
 
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Fri Jan 15 15:16:38 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 15 Jan 2016 15:16:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aK67B-0002wL-2c; Fri, 15 Jan 2016 15:16:37 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aK679-0002wF-95
	for win-pv-devel@lists.xenproject.org; Fri, 15 Jan 2016 15:16:35 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	7A/2D-10715-25D09965; Fri, 15 Jan 2016 15:16:34 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1452870993!17156561!1
X-Originating-IP: [74.125.82.41]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 56251 invoked from network); 15 Jan 2016 15:16:33 -0000
Received: from mail-wm0-f41.google.com (HELO mail-wm0-f41.google.com)
	(74.125.82.41)
	by server-13.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 15 Jan 2016 15:16:33 -0000
Received: by mail-wm0-f41.google.com with SMTP id u188so27115949wmu.1
	for <win-pv-devel@lists.xenproject.org>;
	Fri, 15 Jan 2016 07:16:33 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=cKmMoldtbxBKZRRvZoFql3KM31DGDInB9u9s65yu4nk=;
	b=sVslpM/SUfxdnjqjoVl2gyVJ8pVdrtXxhGS2CvK+P0z1ptgS+7wwjXo+aXujpTJhMa
	Qz61yLSo92+5mcscFfdUcyFpLETHHQAf4FRnGk9v7UA8+TyLOzuu8fcc6zh8W6fOJwMn
	nlpGRrg41ZU1bRm+9z42O9hkahwFn3fXnhjiugfVoQ9kYEh7m+IexfBaSKLb9IszwyRv
	6/skXmxev0JJZOG+Oyb5jjLwLRCo/Szpld3VlgS2+gmd05zTiahHP278rmDtzqa+9Xbq
	/2yJqIJ5nau1lryoN8eugiKdxsu6EMO1yP6MdYQBuGpNC79bgixkEuQCZshDuW67WF1A
	5iuQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id;
	bh=cKmMoldtbxBKZRRvZoFql3KM31DGDInB9u9s65yu4nk=;
	b=CzJBKvB2kEdXIr7+45KW3l9QLMOOtW7B1+3mDl0bNAme6+FrTDAZzk3uAr2c0DCufS
	1uthok+45mGZoyXzSMO4OHiVmxoTqf5Ayc6KrVJ7B/1CXFOm9lG5X1VwbhTSt2joTSL8
	/0llLRzSCNTdSUwMGPGsb4Kt9tVkg8pL21kG2HZYZXAhrsY3BwOgDgfxQ0VTTmGBh/O0
	z9iRgByakFXlyT2RKdHfafBlqiz6yGhEkjNV0ZqInq8atqhX1LBaQUKEQUZjBeeLz3Lf
	Bb6vJwtEUK5MN3wTxW0A4YIQhOZggmY/4o0scGUdtvCaIoMmFg7hKCelbaCjcNr3rOL9
	VQnQ==
X-Gm-Message-State: ALoCoQlpWCoEfSD2GMQpTZx1J6GlSazXSjyyd9TZOFRstqvyt/f+k24eKrA7KQlYeHbT7uJljS89AOEs+nwDnZ3/PN7KgJWAjw==
X-Received: by 10.195.13.129 with SMTP id ey1mr10324119wjd.132.1452870992787; 
	Fri, 15 Jan 2016 07:16:32 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	i2sm10965397wjx.42.2016.01.15.07.16.31
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Fri, 15 Jan 2016 07:16:32 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Fri, 15 Jan 2016 15:16:18 +0000
Message-Id: <1452870978-10408-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Centralize compatibility code
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

This patch moves the code that maintains compatibility with older
VIF interface versions into the vif.c module, rather than having it
distributed amongst vif.c, transmitter.c and receiver.c.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xenvif/receiver.c    | 130 ++------------------
 src/xenvif/receiver.h    |   6 -
 src/xenvif/transmitter.c | 183 +---------------------------
 src/xenvif/transmitter.h |  14 ---
 src/xenvif/vif.c         | 310 ++++++++++++++++++++++++++++++++++++++++-------
 src/xenvif/vif.h         |   5 -
 6 files changed, 277 insertions(+), 371 deletions(-)

diff --git a/src/xenvif/receiver.c b/src/xenvif/receiver.c
index d3073e1..bfc5ff9 100644
--- a/src/xenvif/receiver.c
+++ b/src/xenvif/receiver.c
@@ -1373,79 +1373,6 @@ __ReceiverRingAcquireLock(
     KeAcquireSpinLockAtDpcLevel(&Ring->Lock);
 }
 
-static FORCEINLINE VOID
-__ReceiverQueuePacketVersion1(
-    IN  PXENVIF_RECEIVER                Receiver,
-    IN  PMDL                            Mdl,
-    IN  ULONG                           Offset,
-    IN  ULONG                           Length,
-    IN  XENVIF_PACKET_CHECKSUM_FLAGS    Flags,
-    IN  USHORT                          MaximumSegmentSize,
-    IN  USHORT                          TagControlInformation,
-    IN  PXENVIF_PACKET_INFO             Info,
-    IN  PVOID                           Cookie
-    )
-{
-    struct _XENVIF_PACKET_INFO_V1       *InfoVersion1;
-    struct _XENVIF_RECEIVER_PACKET_V1   *PacketVersion1;
-    PXENVIF_FRONTEND                    Frontend;
-    PXENVIF_VIF_CONTEXT                 Context;
-    LIST_ENTRY                          List;
-    NTSTATUS                            status;
-
-    InfoVersion1 = __ReceiverAllocate(sizeof (struct _XENVIF_PACKET_INFO_V1));
-
-    status = STATUS_NO_MEMORY;
-    if (InfoVersion1 == NULL)
-        goto fail1;
-
-    InfoVersion1->Length = Info->Length;
-    InfoVersion1->TagControlInformation = TagControlInformation;
-    InfoVersion1->IsAFragment = Info->IsAFragment;
-    InfoVersion1->EthernetHeader = Info->EthernetHeader;
-    InfoVersion1->LLCSnapHeader = Info->LLCSnapHeader;
-    InfoVersion1->IpHeader = Info->IpHeader;
-    InfoVersion1->IpOptions = Info->IpOptions;
-    InfoVersion1->TcpHeader = Info->TcpHeader;
-    InfoVersion1->TcpOptions = Info->TcpOptions;
-    InfoVersion1->UdpHeader = Info->UdpHeader;
-
-    PacketVersion1 = __ReceiverAllocate(sizeof (struct _XENVIF_RECEIVER_PACKET_V1));
-
-    status = STATUS_NO_MEMORY;
-    if (PacketVersion1 == NULL)
-        goto fail2;
-
-    PacketVersion1->Info = InfoVersion1;
-    PacketVersion1->Offset = Offset;
-    PacketVersion1->Length = Length;
-    PacketVersion1->Flags = Flags;
-    PacketVersion1->MaximumSegmentSize = MaximumSegmentSize;
-    PacketVersion1->Cookie = Cookie;
-    PacketVersion1->Mdl = *Mdl;
-    PacketVersion1->__Pfn = MmGetMdlPfnArray(Mdl)[0];
-
-    Frontend = Receiver->Frontend;
-    Context = PdoGetVifContext(FrontendGetPdo(Frontend));
-
-    InitializeListHead(&List);
-
-    InsertTailList(&List, &PacketVersion1->ListEntry);
-
-    VifReceiverQueuePacketsVersion1(Context, &List);
-    ASSERT(IsListEmpty(&List));
-
-    return;
-
-fail2:
-    Error("fail2\n");
-
-fail1:
-    Error("fail1 (%08x)\n", status);
-
-    ReceiverReturnPacket(Receiver, Cookie);
-}
-
 static DECLSPEC_NOINLINE VOID
 ReceiverRingAcquireLock(
     IN  PXENVIF_RECEIVER_RING   Ring
@@ -1463,7 +1390,6 @@ __ReceiverRingReleaseLock(
     PXENVIF_RECEIVER            Receiver;
     PXENVIF_FRONTEND            Frontend;
     PXENVIF_VIF_CONTEXT         Context;
-    ULONG                       Version;
     LIST_ENTRY                  List;
     ULONG                       Count;
 
@@ -1472,7 +1398,6 @@ __ReceiverRingReleaseLock(
     Receiver = Ring->Receiver;
     Frontend = Receiver->Frontend;
     Context = PdoGetVifContext(FrontendGetPdo(Frontend));
-    Version = VifGetVersion(Context);
 
     InitializeListHead(&List);
     Count = 0;
@@ -1502,26 +1427,15 @@ __ReceiverRingReleaseLock(
                                    XENVIF_RECEIVER_PACKET,
                                    ListEntry);
 
-        if (Version < 4)
-            __ReceiverQueuePacketVersion1(Receiver,
-                                          &Packet->Mdl,
-                                          Packet->Offset,
-                                          Packet->Length,
-                                          Packet->Flags,
-                                          Packet->MaximumSegmentSize,
-                                          Packet->TagControlInformation,
-                                          &Packet->Info,
-                                          Packet);
-        else
-            VifReceiverQueuePacket(Context,
-                                   &Packet->Mdl,
-                                   Packet->Offset,
-                                   Packet->Length,
-                                   Packet->Flags,
-                                   Packet->MaximumSegmentSize,
-                                   Packet->TagControlInformation,
-                                   &Packet->Info,
-                                   Packet);
+        VifReceiverQueuePacket(Context,
+                               &Packet->Mdl,
+                               Packet->Offset,
+                               Packet->Length,
+                               Packet->Flags,
+                               Packet->MaximumSegmentSize,
+                               Packet->TagControlInformation,
+                               &Packet->Info,
+                               Packet);
     }
 
     ASSERT(IsListEmpty(&List));
@@ -3471,32 +3385,6 @@ ReceiverReturnPacket(
 }
 
 VOID
-ReceiverReturnPacketsVersion1(
-    IN  PXENVIF_RECEIVER    Receiver,
-    IN  PLIST_ENTRY         List
-    )
-{
-    while (!IsListEmpty(List)) {
-        PLIST_ENTRY                         ListEntry;
-        struct _XENVIF_RECEIVER_PACKET_V1   *PacketVersion1;
-
-        ListEntry = RemoveHeadList(List);
-        ASSERT3P(ListEntry, !=, List);
-
-        RtlZeroMemory(ListEntry, sizeof (LIST_ENTRY));
-
-        PacketVersion1 = CONTAINING_RECORD(ListEntry,
-                                           struct _XENVIF_RECEIVER_PACKET_V1,
-                                           ListEntry);
-
-        ReceiverReturnPacket(Receiver, PacketVersion1->Cookie);
-
-        __ReceiverFree(PacketVersion1->Info);
-        __ReceiverFree(PacketVersion1);
-    }
-}
-
-VOID
 ReceiverWaitForPackets(
     IN  PXENVIF_RECEIVER    Receiver
     )
diff --git a/src/xenvif/receiver.h b/src/xenvif/receiver.h
index 042e1da..7188dfa 100644
--- a/src/xenvif/receiver.h
+++ b/src/xenvif/receiver.h
@@ -101,12 +101,6 @@ ReceiverSetBackfillSize(
     );
 
 extern VOID
-ReceiverReturnPacketsVersion1(
-    IN  PXENVIF_RECEIVER    Receiver,
-    IN  PLIST_ENTRY         List
-    );
-
-extern VOID
 ReceiverReturnPacket(
     IN  PXENVIF_RECEIVER    Receiver,
     IN  PVOID               Cookie
diff --git a/src/xenvif/transmitter.c b/src/xenvif/transmitter.c
index a8b0162..a5bcf82 100644
--- a/src/xenvif/transmitter.c
+++ b/src/xenvif/transmitter.c
@@ -2736,33 +2736,6 @@ TransmitterRingSchedule(
 }
 
 static FORCEINLINE VOID
-__TransmitterReturnPacketVersion2(
-    IN  PXENVIF_TRANSMITTER                         Transmitter,
-    IN  PVOID                                       Cookie,
-    IN  PXENVIF_TRANSMITTER_PACKET_COMPLETION_INFO  Completion
-    )
-{
-    struct _XENVIF_TRANSMITTER_PACKET_V2            *PacketVersion2;
-    PXENVIF_FRONTEND                                Frontend;
-    PXENVIF_VIF_CONTEXT                             Context;
-    LIST_ENTRY                                      List;
-
-    PacketVersion2 = Cookie;
-    PacketVersion2->Completion = *Completion;
-
-    Frontend = Transmitter->Frontend;
-    Context = PdoGetVifContext(FrontendGetPdo(Frontend));
-
-    InitializeListHead(&List);
-
-    ASSERT(IsZeroMemory(&PacketVersion2->ListEntry, sizeof (LIST_ENTRY)));
-    InsertTailList(&List, &PacketVersion2->ListEntry);
-
-    VifTransmitterReturnPacketsVersion2(Context, &List);
-    ASSERT(IsListEmpty(&List));
-}
-
-static FORCEINLINE VOID
 __TransmitterReturnPackets(
     IN  PXENVIF_TRANSMITTER Transmitter,
     IN  PLIST_ENTRY         List
@@ -2770,11 +2743,9 @@ __TransmitterReturnPackets(
 {
     PXENVIF_FRONTEND        Frontend;
     PXENVIF_VIF_CONTEXT     Context;
-    ULONG                   Version;
 
     Frontend = Transmitter->Frontend;
     Context = PdoGetVifContext(FrontendGetPdo(Frontend));
-    Version = VifGetVersion(Context);
 
     while (!IsListEmpty(List)) {
         PLIST_ENTRY                 ListEntry;
@@ -2789,14 +2760,9 @@ __TransmitterReturnPackets(
                                    XENVIF_TRANSMITTER_PACKET,
                                    ListEntry);
 
-        if  (Version < 4)
-            __TransmitterReturnPacketVersion2(Transmitter,
-                                              Packet->Cookie,
-                                              &Packet->Completion);
-        else
-            VifTransmitterReturnPacket(Context,
-                                       Packet->Cookie,
-                                       &Packet->Completion);
+        VifTransmitterReturnPacket(Context,
+                                   Packet->Cookie,
+                                   &Packet->Completion);
 
         __TransmitterPutPacket(Transmitter, Packet);
     }
@@ -4560,96 +4526,6 @@ TransmitterTeardown(
     __TransmitterFree(Transmitter);
 }
 
-static BOOLEAN
-TransmitterGetPacketHeadersVersion2Pullup(
-    IN      PVOID                   Argument,
-    IN      PUCHAR                  DestinationVa,
-    IN OUT  PXENVIF_PACKET_PAYLOAD  Payload,
-    IN      ULONG                   Length
-    )
-{
-    PMDL                            Mdl;
-    ULONG                           Offset;
-
-    UNREFERENCED_PARAMETER(Argument);
-
-    Mdl = Payload->Mdl;
-    Offset = Payload->Offset;
-
-    if (Payload->Length < Length)
-        goto fail1;
-
-    Payload->Length -= Length;
-
-    while (Length != 0) {
-        PUCHAR  MdlMappedSystemVa;
-        ULONG   MdlByteCount;
-        ULONG   CopyLength;
-
-        ASSERT(Mdl != NULL);
-
-        MdlMappedSystemVa = MmGetSystemAddressForMdlSafe(Mdl, NormalPagePriority);
-        ASSERT(MdlMappedSystemVa != NULL);
-
-        MdlMappedSystemVa += Offset;
-
-        MdlByteCount = Mdl->ByteCount - Offset;
-
-        CopyLength = __min(MdlByteCount, Length);
-
-        RtlCopyMemory(DestinationVa, MdlMappedSystemVa, CopyLength);
-        DestinationVa += CopyLength;
-
-        Offset += CopyLength;
-        Length -= CopyLength;
-
-        MdlByteCount -= CopyLength;
-        if (MdlByteCount == 0) {
-            Mdl = Mdl->Next;
-            Offset = 0;
-        }
-    }
-
-    Payload->Mdl = Mdl;
-    Payload->Offset = Offset;
-
-    return TRUE;
-
-fail1:
-    Error("fail1\n");
-
-    return FALSE;
-}
-
-NTSTATUS
-TransmitterGetPacketHeadersVersion2(
-    IN  PXENVIF_TRANSMITTER                     Transmitter,
-    IN  struct _XENVIF_TRANSMITTER_PACKET_V2    *PacketVersion2,
-    OUT PVOID                                   Headers,
-    OUT PXENVIF_PACKET_INFO                     Info
-    )
-{
-    XENVIF_PACKET_PAYLOAD                       Payload;
-    NTSTATUS                                    status;
-
-    Payload.Mdl = PacketVersion2->Mdl;
-    Payload.Offset = PacketVersion2->Offset;
-    Payload.Length = PacketVersion2->Length;
-
-    status = ParsePacket(Headers,
-                         TransmitterGetPacketHeadersVersion2Pullup,
-                         Transmitter,
-                         &Payload,
-                         Info);
-    if (!NT_SUCCESS(status))
-        goto fail1;
-
-    return STATUS_SUCCESS;
-
-fail1:
-    return status;
-}
-
 static FORCEINLINE VOID
 __TransmitterHashAccumulate(
     IN OUT  PULONG  Accumulator,
@@ -4834,59 +4710,6 @@ fail1:
     return status;
 }
 
-NTSTATUS
-TransmitterQueuePacketsVersion2(
-    IN  PXENVIF_TRANSMITTER     Transmitter,
-    IN  PLIST_ENTRY             List
-    )
-{
-    LIST_ENTRY                  Reject;
-
-    InitializeListHead(&Reject);
-
-    while (!IsListEmpty(List)) {
-        PLIST_ENTRY                             ListEntry;
-        struct _XENVIF_TRANSMITTER_PACKET_V2    *PacketVersion2;
-        XENVIF_PACKET_HASH                      Hash;
-        NTSTATUS                                status;
-
-        ListEntry = RemoveHeadList(List);
-        ASSERT3P(ListEntry, !=, List);
-
-        RtlZeroMemory(ListEntry, sizeof (LIST_ENTRY));
-
-        PacketVersion2 = CONTAINING_RECORD(ListEntry,
-                                           struct _XENVIF_TRANSMITTER_PACKET_V2,
-                                           ListEntry);
-
-        Hash.Algorithm = XENVIF_PACKET_HASH_ALGORITHM_UNSPECIFIED;
-        Hash.Value = PacketVersion2->Value;
-
-        status = TransmitterQueuePacket(Transmitter,
-                                        PacketVersion2->Mdl,
-                                        PacketVersion2->Offset,
-                                        PacketVersion2->Length,
-                                        PacketVersion2->Send.OffloadOptions,
-                                        PacketVersion2->Send.MaximumSegmentSize,
-                                        PacketVersion2->Send.TagControlInformation,
-                                        &Hash,
-                                        PacketVersion2);
-        if (!NT_SUCCESS(status))
-            InsertTailList(&Reject, &PacketVersion2->ListEntry);
-    }
-
-    ASSERT(IsListEmpty(List));
-
-    if (!IsListEmpty(&Reject)) {
-        PLIST_ENTRY ListEntry = Reject.Flink;
-
-        RemoveEntryList(&Reject);
-        AppendTailList(List, ListEntry);
-    }
-
-    return (IsListEmpty(List)) ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL;
-}
-
 VOID
 TransmitterAbortPackets(
     IN  PXENVIF_TRANSMITTER Transmitter
diff --git a/src/xenvif/transmitter.h b/src/xenvif/transmitter.h
index 0b7f654..31198fb 100644
--- a/src/xenvif/transmitter.h
+++ b/src/xenvif/transmitter.h
@@ -128,12 +128,6 @@ TransmitterQueuePacket(
     IN  PVOID                       Cookie
     );
 
-extern NTSTATUS
-TransmitterQueuePacketsVersion2(
-    IN  PXENVIF_TRANSMITTER Transmitter,
-    IN  PLIST_ENTRY         List
-    );
-
 extern VOID
 TransmitterQueryOffloadOptions(
     IN  PXENVIF_TRANSMITTER         Transmitter,
@@ -147,12 +141,4 @@ TransmitterQueryLargePacketSize(
     OUT PULONG                  Size
     );
 
-extern NTSTATUS
-TransmitterGetPacketHeadersVersion2(
-    IN  PXENVIF_TRANSMITTER                     Transmitter,
-    IN  struct _XENVIF_TRANSMITTER_PACKET_V2    *Packet,
-    OUT PVOID                                   Headers,
-    OUT PXENVIF_PACKET_INFO                     Info
-    );
-
 #endif  // _XENVIF_TRANSMITTER_H
diff --git a/src/xenvif/vif.c b/src/xenvif/vif.c
index 3d40ad0..2288561 100644
--- a/src/xenvif/vif.c
+++ b/src/xenvif/vif.c
@@ -32,9 +32,11 @@
 #include <ntddk.h>
 #include <ntstrsafe.h>
 #include <stdarg.h>
+#include <stdlib.h>
 #include <xen.h>
 
 #include "pdo.h"
+#include "parse.h"
 #include "vif.h"
 #include "mrsw.h"
 #include "thread.h"
@@ -326,8 +328,25 @@ VifReceiverReturnPacketsVersion1(
 
     AcquireMrswLockShared(&Context->Lock);
 
-    ReceiverReturnPacketsVersion1(FrontendGetReceiver(Context->Frontend),
-                                  List);
+    while (!IsListEmpty(List)) {
+        PLIST_ENTRY                         ListEntry;
+        struct _XENVIF_RECEIVER_PACKET_V1   *PacketVersion1;
+
+        ListEntry = RemoveHeadList(List);
+        ASSERT3P(ListEntry, !=, List);
+
+        RtlZeroMemory(ListEntry, sizeof (LIST_ENTRY));
+
+        PacketVersion1 = CONTAINING_RECORD(ListEntry,
+                                           struct _XENVIF_RECEIVER_PACKET_V1,
+                                           ListEntry);
+
+        ReceiverReturnPacket(FrontendGetReceiver(Context->Frontend),
+                             PacketVersion1->Cookie);
+
+        __VifFree(PacketVersion1->Info);
+        __VifFree(PacketVersion1);
+    }
 
     ReleaseMrswLockShared(&Context->Lock);
 }
@@ -348,6 +367,67 @@ VifReceiverReturnPacket(
     ReleaseMrswLockShared(&Context->Lock);
 }
 
+static BOOLEAN
+VifTransmitterGetPacketHeadersVersion2Pullup(
+    IN      PVOID                   Argument,
+    IN      PUCHAR                  DestinationVa,
+    IN OUT  PXENVIF_PACKET_PAYLOAD  Payload,
+    IN      ULONG                   Length
+    )
+{
+    PMDL                            Mdl;
+    ULONG                           Offset;
+
+    UNREFERENCED_PARAMETER(Argument);
+
+    Mdl = Payload->Mdl;
+    Offset = Payload->Offset;
+
+    if (Payload->Length < Length)
+        goto fail1;
+
+    Payload->Length -= Length;
+
+    while (Length != 0) {
+        PUCHAR  MdlMappedSystemVa;
+        ULONG   MdlByteCount;
+        ULONG   CopyLength;
+
+        ASSERT(Mdl != NULL);
+
+        MdlMappedSystemVa = MmGetSystemAddressForMdlSafe(Mdl, NormalPagePriority);
+        ASSERT(MdlMappedSystemVa != NULL);
+
+        MdlMappedSystemVa += Offset;
+
+        MdlByteCount = Mdl->ByteCount - Offset;
+
+        CopyLength = __min(MdlByteCount, Length);
+
+        RtlCopyMemory(DestinationVa, MdlMappedSystemVa, CopyLength);
+        DestinationVa += CopyLength;
+
+        Offset += CopyLength;
+        Length -= CopyLength;
+
+        MdlByteCount -= CopyLength;
+        if (MdlByteCount == 0) {
+            Mdl = Mdl->Next;
+            Offset = 0;
+        }
+    }
+
+    Payload->Mdl = Mdl;
+    Payload->Offset = Offset;
+
+    return TRUE;
+
+fail1:
+    Error("fail1\n");
+
+    return FALSE;
+}
+
 static NTSTATUS
 VifTransmitterGetPacketHeadersVersion2(
     IN  PINTERFACE                              Interface,
@@ -357,14 +437,20 @@ VifTransmitterGetPacketHeadersVersion2(
     )
 {
     PXENVIF_VIF_CONTEXT                         Context = Interface->Context;
+    XENVIF_PACKET_PAYLOAD                       Payload;
     NTSTATUS                                    status;
 
     AcquireMrswLockShared(&Context->Lock);
 
-    status = TransmitterGetPacketHeadersVersion2(FrontendGetTransmitter(Context->Frontend),
-                                                 Packet,
-                                                 Headers,
-                                                 Info);
+    Payload.Mdl = Packet->Mdl;
+    Payload.Offset = Packet->Offset;
+    Payload.Length = Packet->Length;
+
+    status = ParsePacket(Headers,
+                         VifTransmitterGetPacketHeadersVersion2Pullup,
+                         Context,
+                         &Payload,
+                         Info);
 
     ReleaseMrswLockShared(&Context->Lock);
 
@@ -378,21 +464,59 @@ VifTransmitterQueuePacketsVersion2(
     )
 {
     PXENVIF_VIF_CONTEXT Context = Interface->Context;
-    NTSTATUS            status;
+    LIST_ENTRY          Reject;
 
     AcquireMrswLockShared(&Context->Lock);
 
-    status = STATUS_UNSUCCESSFUL;
     if (Context->Enabled == FALSE)
         goto done;
 
-    status = TransmitterQueuePacketsVersion2(FrontendGetTransmitter(Context->Frontend),
-                                             List);
+    InitializeListHead(&Reject);
+
+    while (!IsListEmpty(List)) {
+        PLIST_ENTRY                             ListEntry;
+        struct _XENVIF_TRANSMITTER_PACKET_V2    *PacketVersion2;
+        XENVIF_PACKET_HASH                      Hash;
+        NTSTATUS                                status;
+
+        ListEntry = RemoveHeadList(List);
+        ASSERT3P(ListEntry, !=, List);
+
+        RtlZeroMemory(ListEntry, sizeof (LIST_ENTRY));
+
+        PacketVersion2 = CONTAINING_RECORD(ListEntry,
+                                           struct _XENVIF_TRANSMITTER_PACKET_V2,
+                                           ListEntry);
+
+        Hash.Algorithm = XENVIF_PACKET_HASH_ALGORITHM_UNSPECIFIED;
+        Hash.Value = PacketVersion2->Value;
+
+        status = TransmitterQueuePacket(FrontendGetTransmitter(Context->Frontend),
+                                        PacketVersion2->Mdl,
+                                        PacketVersion2->Offset,
+                                        PacketVersion2->Length,
+                                        PacketVersion2->Send.OffloadOptions,
+                                        PacketVersion2->Send.MaximumSegmentSize,
+                                        PacketVersion2->Send.TagControlInformation,
+                                        &Hash,
+                                        PacketVersion2);
+        if (!NT_SUCCESS(status))
+            InsertTailList(&Reject, &PacketVersion2->ListEntry);
+    }
+
+    ASSERT(IsListEmpty(List));
+
+    if (!IsListEmpty(&Reject)) {
+        PLIST_ENTRY ListEntry = Reject.Flink;
+
+        RemoveEntryList(&Reject);
+        AppendTailList(List, ListEntry);
+    }
 
 done:
     ReleaseMrswLockShared(&Context->Lock);
 
-    return status;
+    return (IsListEmpty(List)) ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL;
 }
 
 static VOID
@@ -417,7 +541,6 @@ VifTransmitterQueuePacketVersion4(
     if (Context->Enabled == FALSE)
         goto done;
 
-    ASSERT3U(VifGetVersion(Context), >=, 4);
     status = TransmitterQueuePacket(FrontendGetTransmitter(Context->Frontend),
                                     Mdl,
                                     Offset,
@@ -466,7 +589,6 @@ VifTransmitterQueuePacket(
     if (Context->Enabled == FALSE)
         goto done;
 
-    ASSERT3U(VifGetVersion(Context), >=, 5);
     status = TransmitterQueuePacket(FrontendGetTransmitter(Context->Frontend),
                                     Mdl,
                                     Offset,
@@ -1054,15 +1176,75 @@ VifTeardown(
     Trace("<====\n");
 }
 
-VOID
-VifReceiverQueuePacketsVersion1(
-    IN  PXENVIF_VIF_CONTEXT Context,
-    IN  PLIST_ENTRY         List
+static FORCEINLINE VOID
+__VifReceiverQueuePacketVersion1(
+    IN  PXENVIF_VIF_CONTEXT             Context,
+    IN  PMDL                            Mdl,
+    IN  ULONG                           Offset,
+    IN  ULONG                           Length,
+    IN  XENVIF_PACKET_CHECKSUM_FLAGS    Flags,
+    IN  USHORT                          MaximumSegmentSize,
+    IN  USHORT                          TagControlInformation,
+    IN  PXENVIF_PACKET_INFO             Info,
+    IN  PVOID                           Cookie
     )
 {
+    struct _XENVIF_PACKET_INFO_V1       *InfoVersion1;
+    struct _XENVIF_RECEIVER_PACKET_V1   *PacketVersion1;
+    LIST_ENTRY                          List;
+    NTSTATUS                            status;
+
+    InfoVersion1 = __VifAllocate(sizeof (struct _XENVIF_PACKET_INFO_V1));
+
+    status = STATUS_NO_MEMORY;
+    if (InfoVersion1 == NULL)
+        goto fail1;
+
+    InfoVersion1->Length = Info->Length;
+    InfoVersion1->TagControlInformation = TagControlInformation;
+    InfoVersion1->IsAFragment = Info->IsAFragment;
+    InfoVersion1->EthernetHeader = Info->EthernetHeader;
+    InfoVersion1->LLCSnapHeader = Info->LLCSnapHeader;
+    InfoVersion1->IpHeader = Info->IpHeader;
+    InfoVersion1->IpOptions = Info->IpOptions;
+    InfoVersion1->TcpHeader = Info->TcpHeader;
+    InfoVersion1->TcpOptions = Info->TcpOptions;
+    InfoVersion1->UdpHeader = Info->UdpHeader;
+
+    PacketVersion1 = __VifAllocate(sizeof (struct _XENVIF_RECEIVER_PACKET_V1));
+
+    status = STATUS_NO_MEMORY;
+    if (PacketVersion1 == NULL)
+        goto fail2;
+
+    PacketVersion1->Info = InfoVersion1;
+    PacketVersion1->Offset = Offset;
+    PacketVersion1->Length = Length;
+    PacketVersion1->Flags = Flags;
+    PacketVersion1->MaximumSegmentSize = MaximumSegmentSize;
+    PacketVersion1->Cookie = Cookie;
+    PacketVersion1->Mdl = *Mdl;
+    PacketVersion1->__Pfn = MmGetMdlPfnArray(Mdl)[0];
+
+    InitializeListHead(&List);
+    InsertTailList(&List, &PacketVersion1->ListEntry);
+
     Context->Callback(Context->Argument,
                       XENVIF_RECEIVER_QUEUE_PACKET,
                       List);
+
+    ASSERT(IsListEmpty(&List));
+
+    return;
+
+fail2:
+    Error("fail2\n");
+
+fail1:
+    Error("fail1 (%08x)\n", status);
+
+    ReceiverReturnPacket(FrontendGetReceiver(Context->Frontend),
+                         Cookie);
 }
 
 VOID
@@ -1078,29 +1260,61 @@ VifReceiverQueuePacket(
     IN  PVOID                           Cookie
     )
 {
-    Context->Callback(Context->Argument,
-                      XENVIF_RECEIVER_QUEUE_PACKET,
-                      Mdl,
-                      Offset,
-                      Length,
-                      Flags,
-                      MaximumSegmentSize,
-                      TagControlInformation,
-                      Info,
-                      Cookie);
+    switch (Context->Version) {
+    case 2:
+    case 3:
+        __VifReceiverQueuePacketVersion1(Context,
+                                         Mdl,
+                                         Offset,
+                                         Length,
+                                         Flags,
+                                         MaximumSegmentSize,
+                                         TagControlInformation,
+                                         Info,
+                                         Cookie);
+        break;
+
+    case 4:
+    case 5:
+        Context->Callback(Context->Argument,
+                          XENVIF_RECEIVER_QUEUE_PACKET,
+                          Mdl,
+                          Offset,
+                          Length,
+                          Flags,
+                          MaximumSegmentSize,
+                          TagControlInformation,
+                          Info,
+                          Cookie);
+        break;
+
+    default:
+        ASSERT(FALSE);
+        break;
+    }
 }
 
-VOID
-VifTransmitterReturnPacketsVersion2(
-    IN  PXENVIF_VIF_CONTEXT Context,
-    IN  PLIST_ENTRY         List
+static FORCEINLINE VOID
+__VifTransmitterReturnPacketVersion2(
+    IN  PXENVIF_VIF_CONTEXT                         Context,
+    IN  PVOID                                       Cookie,
+    IN  PXENVIF_TRANSMITTER_PACKET_COMPLETION_INFO  Completion
     )
 {
-    ASSERT3U(VifGetVersion(Context), >=, 2);
+    struct _XENVIF_TRANSMITTER_PACKET_V2            *PacketVersion2;
+    LIST_ENTRY                                      List;
+
+    PacketVersion2 = Cookie;
+    PacketVersion2->Completion = *Completion;
+
+    InitializeListHead(&List);
+    InsertTailList(&List, &PacketVersion2->ListEntry);
 
     Context->Callback(Context->Argument,
                       XENVIF_TRANSMITTER_RETURN_PACKET,
                       List);
+
+    ASSERT(IsListEmpty(&List));
 }
 
 VOID
@@ -1110,12 +1324,26 @@ VifTransmitterReturnPacket(
     IN  PXENVIF_TRANSMITTER_PACKET_COMPLETION_INFO  Completion
     )
 {
-    ASSERT3U(VifGetVersion(Context), >=, 4);
+    switch (Context->Version) {
+    case 2:
+    case 3:
+        __VifTransmitterReturnPacketVersion2(Context,
+                                             Cookie,
+                                             Completion);
+        break;
 
-    Context->Callback(Context->Argument,
-                      XENVIF_TRANSMITTER_RETURN_PACKET,
-                      Cookie,
-                      Completion);
+    case 4:
+    case 5:
+        Context->Callback(Context->Argument,
+                          XENVIF_TRANSMITTER_RETURN_PACKET,
+                          Cookie,
+                          Completion);
+        break;
+
+    default:
+        ASSERT(FALSE);
+        break;
+    }
 }
 
 PXENVIF_THREAD
@@ -1125,11 +1353,3 @@ VifGetMacThread(
 {
     return Context->MacThread;
 }
-
-ULONG
-VifGetVersion(
-    IN  PXENVIF_VIF_CONTEXT Context
-    )
-{
-    return Context->Version;
-}
diff --git a/src/xenvif/vif.h b/src/xenvif/vif.h
index ebb4337..6cda4b7 100644
--- a/src/xenvif/vif.h
+++ b/src/xenvif/vif.h
@@ -99,10 +99,5 @@ VifGetMacThread(
     IN  PXENVIF_VIF_CONTEXT Context
     );
 
-extern ULONG
-VifGetVersion(
-    IN  PXENVIF_VIF_CONTEXT Context
-    );
-
 #endif  // _XENVIF_VIF_H
 
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Fri Jan 15 15:17:15 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 15 Jan 2016 15:17:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aK67n-0002ys-8k; Fri, 15 Jan 2016 15:17:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aK67l-0002yX-Vk
	for win-pv-devel@lists.xenproject.org; Fri, 15 Jan 2016 15:17:14 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	12/AA-08347-57D09965; Fri, 15 Jan 2016 15:17:09 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1452871027!17178109!1
X-Originating-IP: [209.85.160.181]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5691 invoked from network); 15 Jan 2016 15:17:08 -0000
Received: from mail-yk0-f181.google.com (HELO mail-yk0-f181.google.com)
	(209.85.160.181)
	by server-10.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 15 Jan 2016 15:17:08 -0000
Received: by mail-yk0-f181.google.com with SMTP id x67so547366356ykd.2
	for <win-pv-devel@lists.xenproject.org>;
	Fri, 15 Jan 2016 07:17:08 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=wW+Hs4iyeUmWEtzgxQzePEKWqi7RmWNtAIvrRgr9M/0=;
	b=NF1+GuyPLYZ8cPil66FB0SxeXaAP+7ofBy4Tqn4GrLMs+40lNpqKc6ZvkTh80ayXE7
	npQxRLIyvcbqiJVTHwsYmg7UyOmbWIwX1tDReRJSHC6+zEAY6R40zEm7P7R4N98HqzMb
	YMN4Br1JpkLJFD+yVLQ4dWTRZxFnzkpllR0Y8afXoOEWkNuDMmVoI1Lzkt0xShcByvNE
	UQcMGKRjL5U1/iJ5TW43sPPMYNFFJkUGGUdNYozTs+qCKKJ2bBW1/i9JVDEEpoPC060S
	wK44KyRwuUuDDZYYNoXqU7dYZ12v2j8g604kfOpknG1R+2uZGsH+5UrfMACCp4N0Ewz4
	0ZKw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id;
	bh=wW+Hs4iyeUmWEtzgxQzePEKWqi7RmWNtAIvrRgr9M/0=;
	b=ggdAbuPp97wlx1T63k0QZQcNWnAs5kn3gLV6ZoPcwNBCr8RpVzdxbqhNEVwt1dAa6K
	rPUhcbdRD1qxyJUtCcNidniEqdA2hkbjOxDE7sQAyTRGyIJP1BA6u+jI6wOvlxu1XpiV
	rBZmpuyZWp1m8QYDY2DSUzHJe+3Q/GZ65pNIp04QddSMjTp2sUdw8BRUaKhoU0MnLA5S
	KiFQKKZqjHSHwiKMYa5rnn12hxtqbnAuiBNYeiFzmMaZ21pzcH7rDuvtybVKo5QOrK/1
	omhEyiFJow9mRFUYRRn7NXqTnIE1JNpxJMejtOyY1vndIsecX7/pOclIWWPS7ofGrtpZ
	zlqA==
X-Gm-Message-State: ALoCoQnuqaMlvYaizJgJcgAxSn0suidoiSz6S63tolhtqxFsXXFNxVcyhqvIq1JGrUQoiUajHzQmUviX5l80ELVYQXmtTX3hZw==
X-Received: by 10.37.8.3 with SMTP id 3mr1015609ybi.167.1452871027204;
	Fri, 15 Jan 2016 07:17:07 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	193sm8303994ywe.22.2016.01.15.07.17.06
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Fri, 15 Jan 2016 07:17:06 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Fri, 15 Jan 2016 15:16:54 +0000
Message-Id: <1452871014-8232-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Stop using prefix GSO
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Since acknowledging that the netif response id is meaningless in the code,
we no longer need to use the prefix flavour of GSO.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xenvif/receiver.c | 117 ++++++++++++++++++++++++++++++--------------------
 1 file changed, 71 insertions(+), 46 deletions(-)

diff --git a/src/xenvif/receiver.c b/src/xenvif/receiver.c
index bfc5ff9..78f922c 100644
--- a/src/xenvif/receiver.c
+++ b/src/xenvif/receiver.c
@@ -43,10 +43,6 @@
 #include <gnttab_interface.h>
 #include <evtchn_interface.h>
 
-// This should be in public/io/netif.h
-#define _NETRXF_gso_prefix     (4)
-#define  NETRXF_gso_prefix     (1U<<_NETRXF_gso_prefix)
-
 #include "pdo.h"
 #include "registry.h"
 #include "frontend.h"
@@ -1704,7 +1700,6 @@ __ReceiverRingEmpty(
     Frontend = Receiver->Frontend;
 
     for (id = 0; id <= XENVIF_RECEIVER_MAXIMUM_FRAGMENT_ID; id++) {
-        netif_rx_request_t          *req;
         PXENVIF_RECEIVER_FRAGMENT   Fragment;
         PMDL                        Mdl;
 
@@ -1717,11 +1712,6 @@ __ReceiverRingEmpty(
         --Ring->RequestsPosted;
         --Ring->RequestsPushed;
 
-        req = RING_GET_REQUEST(&Ring->Front, id);
-        ASSERT3U(req->id, ==, id);
-
-        RtlZeroMemory(req, sizeof (netif_rx_request_t));
-
         Mdl = Fragment->Context;
         Fragment->Context = NULL;
 
@@ -1735,8 +1725,6 @@ __ReceiverRingEmpty(
         __ReceiverRingPutFragment(Ring, Fragment);
 
         __ReceiverRingPutMdl(Ring, Mdl, TRUE);
-
-        RtlZeroMemory(req, sizeof (netif_rx_request_t));
     }
 }
 
@@ -1815,18 +1803,24 @@ ReceiverRingPoll(
 
     for (;;) {
         BOOLEAN                 Error;
+        BOOLEAN                 Extra;
+        ULONG                   Info;
+        USHORT                  MaximumSegmentSize;
         PXENVIF_RECEIVER_PACKET Packet;
         uint16_t                flags;
-        USHORT                  MaximumSegmentSize;
         PMDL                    TailMdl;
+        BOOLEAN                 EOP;
         RING_IDX                rsp_prod;
         RING_IDX                rsp_cons;
 
         Error = FALSE;
+        Extra = FALSE;
+        Info = 0;
+        MaximumSegmentSize = 0;
         Packet = NULL;
         flags = 0;
-        MaximumSegmentSize = 0;
         TailMdl = NULL;
+        EOP = TRUE;
 
         KeMemoryBarrier();
 
@@ -1846,15 +1840,15 @@ ReceiverRingPoll(
             RING_IDX                    req_prod;
 
             rsp = RING_GET_RESPONSE(&Ring->Front, rsp_cons);
+
+            // netback is required to complete requests in order and place
+            // the response in the same fragment as the request. This is
+            // the only way to figure out the id of an 'extra' fragment.
             id = (uint16_t)(rsp_cons & (RING_SIZE(&Ring->Front) - 1));
 
             rsp_cons++;
             Ring->ResponsesProcessed++;
 
-            // netback is required to complete requests in order and place
-            // the response in the same fragment as the request.
-            ASSERT3U(rsp->id, ==, id);
-
             ASSERT3U(id, <=, XENVIF_RECEIVER_MAXIMUM_FRAGMENT_ID);
             Fragment = Ring->Pending[id];
             Ring->Pending[id] = NULL;
@@ -1875,46 +1869,59 @@ ReceiverRingPoll(
 
             ASSERT(Mdl != NULL);
 
-            if (rsp->status < 0)
-                Error = TRUE;
+            if (Extra) {
+                struct netif_extra_info *extra;
 
-            if (rsp->flags & NETRXF_gso_prefix) {
                 __ReceiverRingPutMdl(Ring, Mdl, TRUE);
 
-                flags = NETRXF_gso_prefix;
-                MaximumSegmentSize = rsp->offset;
+                extra = (struct netif_extra_info *)rsp;
+                Info |= (1 << extra->type);
 
-                ASSERT(rsp->flags & NETRXF_more_data);
-                continue;
+                switch (extra->type) {
+                case XEN_NETIF_EXTRA_TYPE_GSO:
+                    MaximumSegmentSize = extra->u.gso.size;
+                    break;
+
+                default:
+                    ASSERT(FALSE);
+                    break;
+                }
+
+                Extra = (extra->flags & XEN_NETIF_EXTRA_FLAG_MORE) ? TRUE : FALSE;
             } else {
+                ASSERT3U(rsp->id, ==, id);
+
                 Mdl->ByteOffset = rsp->offset;
                 Mdl->MappedSystemVa = (PUCHAR)Mdl->StartVa + rsp->offset;
                 Mdl->ByteCount = rsp->status;
-            }
 
-            if (Packet == NULL) {   // SOP
-                Packet = CONTAINING_RECORD(Mdl, XENVIF_RECEIVER_PACKET, Mdl);
+                if (rsp->status < 0)
+                    Error = TRUE;
 
-                ASSERT3P(TailMdl, ==, NULL);
-                TailMdl = Mdl;
+                if (Packet == NULL) {   // SOP
+                    Packet = CONTAINING_RECORD(Mdl, XENVIF_RECEIVER_PACKET, Mdl);
 
-                ASSERT3U((flags & ~NETRXF_gso_prefix), ==, 0);
-                flags |= rsp->flags;
+                    ASSERT3P(TailMdl, ==, NULL);
+                    TailMdl = Mdl;
 
-                Packet->Length = Mdl->ByteCount;
-            } else {
-                ASSERT3P(Mdl->Next, ==, NULL);
+                    flags = rsp->flags;
+                    Packet->Length = Mdl->ByteCount;
+                } else {
+                    ASSERT3P(Mdl->Next, ==, NULL);
 
-                ASSERT(TailMdl != NULL);
-                TailMdl->Next = Mdl;
-                TailMdl = Mdl;
+                    ASSERT(TailMdl != NULL);
+                    TailMdl->Next = Mdl;
+                    TailMdl = Mdl;
 
-                flags |= rsp->flags;
+                    flags |= rsp->flags;
+                    Packet->Length += Mdl->ByteCount;
+                }
 
-                Packet->Length += Mdl->ByteCount;
+                EOP = (~rsp->flags & NETRXF_more_data) ? TRUE : FALSE;
+                Extra = (rsp->flags & NETRXF_extra_info) ? TRUE : FALSE;
             }
 
-            if (~rsp->flags & NETRXF_more_data) {  // EOP
+            if (EOP && !Extra) {
                 ASSERT(Packet != NULL);
 
                 if (Error) {
@@ -1924,21 +1931,24 @@ ReceiverRingPoll(
 
                     __ReceiverRingReturnPacket(Ring, Packet, TRUE);
                 } else {
-                    if (flags & NETRXF_gso_prefix) {
+                    if (Info & (1 << XEN_NETIF_EXTRA_TYPE_GSO)) {
                         ASSERT(MaximumSegmentSize != 0);
+                        ASSERT(flags & NETRXF_csum_blank);
+                        ASSERT(flags & NETRXF_data_validated);
                         Packet->MaximumSegmentSize = MaximumSegmentSize;
                     }
 
-                    Packet->Flags.Value = flags & (NETRXF_csum_blank | NETRXF_data_validated);
+                    Packet->Flags.Value = flags;
 
                     ASSERT(IsZeroMemory(&Packet->ListEntry, sizeof (LIST_ENTRY)));
                     InsertTailList(&Ring->PacketList, &Packet->ListEntry);
                 }
 
                 Error = FALSE;
+                Info = 0;
+                MaximumSegmentSize = 0;
                 Packet = NULL;
                 flags = 0;
-                MaximumSegmentSize = 0;
                 TailMdl = NULL;
             }
 
@@ -1953,10 +1963,13 @@ ReceiverRingPoll(
             }
         }
         ASSERT(!Error);
+        ASSERT(!Extra);
+        ASSERT3U(Info, ==, 0);
         ASSERT3P(Packet, ==, NULL);
         ASSERT3U(flags, ==, 0);
         ASSERT3U(MaximumSegmentSize, ==, 0);
         ASSERT3P(TailMdl, ==, NULL);
+        ASSERT(EOP);
 
         KeMemoryBarrier();
 
@@ -2973,21 +2986,33 @@ __ReceiverSetGsoFeatureFlag(
 
     Frontend = Receiver->Frontend;
 
+    (VOID) XENBUS_STORE(Remove,
+                        &Receiver->StoreInterface,
+                        Transaction,
+                        FrontendGetPath(Frontend),
+                        "feature-gso-tcpv4-prefix");
+
     status = XENBUS_STORE(Printf,
                           &Receiver->StoreInterface,
                           Transaction,
                           FrontendGetPath(Frontend),
-                          "feature-gso-tcpv4-prefix",
+                          "feature-gso-tcpv4",
                           "%u",
                           (Receiver->DisableIpVersion4Gso == 0) ? TRUE : FALSE);
     if (!NT_SUCCESS(status))
         goto fail1;
 
+    (VOID) XENBUS_STORE(Remove,
+                        &Receiver->StoreInterface,
+                        Transaction,
+                        FrontendGetPath(Frontend),
+                        "feature-gso-tcpv6-prefix");
+
     status = XENBUS_STORE(Printf,
                           &Receiver->StoreInterface,
                           Transaction,
                           FrontendGetPath(Frontend),
-                          "feature-gso-tcpv6-prefix",
+                          "feature-gso-tcpv6",
                           "%u",
                           (Receiver->DisableIpVersion6Gso == 0) ? TRUE : FALSE);
     if (!NT_SUCCESS(status))
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Fri Jan 15 15:17:15 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 15 Jan 2016 15:17:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aK67n-0002ys-8k; Fri, 15 Jan 2016 15:17:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aK67l-0002yX-Vk
	for win-pv-devel@lists.xenproject.org; Fri, 15 Jan 2016 15:17:14 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	12/AA-08347-57D09965; Fri, 15 Jan 2016 15:17:09 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1452871027!17178109!1
X-Originating-IP: [209.85.160.181]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5691 invoked from network); 15 Jan 2016 15:17:08 -0000
Received: from mail-yk0-f181.google.com (HELO mail-yk0-f181.google.com)
	(209.85.160.181)
	by server-10.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 15 Jan 2016 15:17:08 -0000
Received: by mail-yk0-f181.google.com with SMTP id x67so547366356ykd.2
	for <win-pv-devel@lists.xenproject.org>;
	Fri, 15 Jan 2016 07:17:08 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=wW+Hs4iyeUmWEtzgxQzePEKWqi7RmWNtAIvrRgr9M/0=;
	b=NF1+GuyPLYZ8cPil66FB0SxeXaAP+7ofBy4Tqn4GrLMs+40lNpqKc6ZvkTh80ayXE7
	npQxRLIyvcbqiJVTHwsYmg7UyOmbWIwX1tDReRJSHC6+zEAY6R40zEm7P7R4N98HqzMb
	YMN4Br1JpkLJFD+yVLQ4dWTRZxFnzkpllR0Y8afXoOEWkNuDMmVoI1Lzkt0xShcByvNE
	UQcMGKRjL5U1/iJ5TW43sPPMYNFFJkUGGUdNYozTs+qCKKJ2bBW1/i9JVDEEpoPC060S
	wK44KyRwuUuDDZYYNoXqU7dYZ12v2j8g604kfOpknG1R+2uZGsH+5UrfMACCp4N0Ewz4
	0ZKw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id;
	bh=wW+Hs4iyeUmWEtzgxQzePEKWqi7RmWNtAIvrRgr9M/0=;
	b=ggdAbuPp97wlx1T63k0QZQcNWnAs5kn3gLV6ZoPcwNBCr8RpVzdxbqhNEVwt1dAa6K
	rPUhcbdRD1qxyJUtCcNidniEqdA2hkbjOxDE7sQAyTRGyIJP1BA6u+jI6wOvlxu1XpiV
	rBZmpuyZWp1m8QYDY2DSUzHJe+3Q/GZ65pNIp04QddSMjTp2sUdw8BRUaKhoU0MnLA5S
	KiFQKKZqjHSHwiKMYa5rnn12hxtqbnAuiBNYeiFzmMaZ21pzcH7rDuvtybVKo5QOrK/1
	omhEyiFJow9mRFUYRRn7NXqTnIE1JNpxJMejtOyY1vndIsecX7/pOclIWWPS7ofGrtpZ
	zlqA==
X-Gm-Message-State: ALoCoQnuqaMlvYaizJgJcgAxSn0suidoiSz6S63tolhtqxFsXXFNxVcyhqvIq1JGrUQoiUajHzQmUviX5l80ELVYQXmtTX3hZw==
X-Received: by 10.37.8.3 with SMTP id 3mr1015609ybi.167.1452871027204;
	Fri, 15 Jan 2016 07:17:07 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	193sm8303994ywe.22.2016.01.15.07.17.06
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Fri, 15 Jan 2016 07:17:06 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Fri, 15 Jan 2016 15:16:54 +0000
Message-Id: <1452871014-8232-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Stop using prefix GSO
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Since acknowledging that the netif response id is meaningless in the code,
we no longer need to use the prefix flavour of GSO.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xenvif/receiver.c | 117 ++++++++++++++++++++++++++++++--------------------
 1 file changed, 71 insertions(+), 46 deletions(-)

diff --git a/src/xenvif/receiver.c b/src/xenvif/receiver.c
index bfc5ff9..78f922c 100644
--- a/src/xenvif/receiver.c
+++ b/src/xenvif/receiver.c
@@ -43,10 +43,6 @@
 #include <gnttab_interface.h>
 #include <evtchn_interface.h>
 
-// This should be in public/io/netif.h
-#define _NETRXF_gso_prefix     (4)
-#define  NETRXF_gso_prefix     (1U<<_NETRXF_gso_prefix)
-
 #include "pdo.h"
 #include "registry.h"
 #include "frontend.h"
@@ -1704,7 +1700,6 @@ __ReceiverRingEmpty(
     Frontend = Receiver->Frontend;
 
     for (id = 0; id <= XENVIF_RECEIVER_MAXIMUM_FRAGMENT_ID; id++) {
-        netif_rx_request_t          *req;
         PXENVIF_RECEIVER_FRAGMENT   Fragment;
         PMDL                        Mdl;
 
@@ -1717,11 +1712,6 @@ __ReceiverRingEmpty(
         --Ring->RequestsPosted;
         --Ring->RequestsPushed;
 
-        req = RING_GET_REQUEST(&Ring->Front, id);
-        ASSERT3U(req->id, ==, id);
-
-        RtlZeroMemory(req, sizeof (netif_rx_request_t));
-
         Mdl = Fragment->Context;
         Fragment->Context = NULL;
 
@@ -1735,8 +1725,6 @@ __ReceiverRingEmpty(
         __ReceiverRingPutFragment(Ring, Fragment);
 
         __ReceiverRingPutMdl(Ring, Mdl, TRUE);
-
-        RtlZeroMemory(req, sizeof (netif_rx_request_t));
     }
 }
 
@@ -1815,18 +1803,24 @@ ReceiverRingPoll(
 
     for (;;) {
         BOOLEAN                 Error;
+        BOOLEAN                 Extra;
+        ULONG                   Info;
+        USHORT                  MaximumSegmentSize;
         PXENVIF_RECEIVER_PACKET Packet;
         uint16_t                flags;
-        USHORT                  MaximumSegmentSize;
         PMDL                    TailMdl;
+        BOOLEAN                 EOP;
         RING_IDX                rsp_prod;
         RING_IDX                rsp_cons;
 
         Error = FALSE;
+        Extra = FALSE;
+        Info = 0;
+        MaximumSegmentSize = 0;
         Packet = NULL;
         flags = 0;
-        MaximumSegmentSize = 0;
         TailMdl = NULL;
+        EOP = TRUE;
 
         KeMemoryBarrier();
 
@@ -1846,15 +1840,15 @@ ReceiverRingPoll(
             RING_IDX                    req_prod;
 
             rsp = RING_GET_RESPONSE(&Ring->Front, rsp_cons);
+
+            // netback is required to complete requests in order and place
+            // the response in the same fragment as the request. This is
+            // the only way to figure out the id of an 'extra' fragment.
             id = (uint16_t)(rsp_cons & (RING_SIZE(&Ring->Front) - 1));
 
             rsp_cons++;
             Ring->ResponsesProcessed++;
 
-            // netback is required to complete requests in order and place
-            // the response in the same fragment as the request.
-            ASSERT3U(rsp->id, ==, id);
-
             ASSERT3U(id, <=, XENVIF_RECEIVER_MAXIMUM_FRAGMENT_ID);
             Fragment = Ring->Pending[id];
             Ring->Pending[id] = NULL;
@@ -1875,46 +1869,59 @@ ReceiverRingPoll(
 
             ASSERT(Mdl != NULL);
 
-            if (rsp->status < 0)
-                Error = TRUE;
+            if (Extra) {
+                struct netif_extra_info *extra;
 
-            if (rsp->flags & NETRXF_gso_prefix) {
                 __ReceiverRingPutMdl(Ring, Mdl, TRUE);
 
-                flags = NETRXF_gso_prefix;
-                MaximumSegmentSize = rsp->offset;
+                extra = (struct netif_extra_info *)rsp;
+                Info |= (1 << extra->type);
 
-                ASSERT(rsp->flags & NETRXF_more_data);
-                continue;
+                switch (extra->type) {
+                case XEN_NETIF_EXTRA_TYPE_GSO:
+                    MaximumSegmentSize = extra->u.gso.size;
+                    break;
+
+                default:
+                    ASSERT(FALSE);
+                    break;
+                }
+
+                Extra = (extra->flags & XEN_NETIF_EXTRA_FLAG_MORE) ? TRUE : FALSE;
             } else {
+                ASSERT3U(rsp->id, ==, id);
+
                 Mdl->ByteOffset = rsp->offset;
                 Mdl->MappedSystemVa = (PUCHAR)Mdl->StartVa + rsp->offset;
                 Mdl->ByteCount = rsp->status;
-            }
 
-            if (Packet == NULL) {   // SOP
-                Packet = CONTAINING_RECORD(Mdl, XENVIF_RECEIVER_PACKET, Mdl);
+                if (rsp->status < 0)
+                    Error = TRUE;
 
-                ASSERT3P(TailMdl, ==, NULL);
-                TailMdl = Mdl;
+                if (Packet == NULL) {   // SOP
+                    Packet = CONTAINING_RECORD(Mdl, XENVIF_RECEIVER_PACKET, Mdl);
 
-                ASSERT3U((flags & ~NETRXF_gso_prefix), ==, 0);
-                flags |= rsp->flags;
+                    ASSERT3P(TailMdl, ==, NULL);
+                    TailMdl = Mdl;
 
-                Packet->Length = Mdl->ByteCount;
-            } else {
-                ASSERT3P(Mdl->Next, ==, NULL);
+                    flags = rsp->flags;
+                    Packet->Length = Mdl->ByteCount;
+                } else {
+                    ASSERT3P(Mdl->Next, ==, NULL);
 
-                ASSERT(TailMdl != NULL);
-                TailMdl->Next = Mdl;
-                TailMdl = Mdl;
+                    ASSERT(TailMdl != NULL);
+                    TailMdl->Next = Mdl;
+                    TailMdl = Mdl;
 
-                flags |= rsp->flags;
+                    flags |= rsp->flags;
+                    Packet->Length += Mdl->ByteCount;
+                }
 
-                Packet->Length += Mdl->ByteCount;
+                EOP = (~rsp->flags & NETRXF_more_data) ? TRUE : FALSE;
+                Extra = (rsp->flags & NETRXF_extra_info) ? TRUE : FALSE;
             }
 
-            if (~rsp->flags & NETRXF_more_data) {  // EOP
+            if (EOP && !Extra) {
                 ASSERT(Packet != NULL);
 
                 if (Error) {
@@ -1924,21 +1931,24 @@ ReceiverRingPoll(
 
                     __ReceiverRingReturnPacket(Ring, Packet, TRUE);
                 } else {
-                    if (flags & NETRXF_gso_prefix) {
+                    if (Info & (1 << XEN_NETIF_EXTRA_TYPE_GSO)) {
                         ASSERT(MaximumSegmentSize != 0);
+                        ASSERT(flags & NETRXF_csum_blank);
+                        ASSERT(flags & NETRXF_data_validated);
                         Packet->MaximumSegmentSize = MaximumSegmentSize;
                     }
 
-                    Packet->Flags.Value = flags & (NETRXF_csum_blank | NETRXF_data_validated);
+                    Packet->Flags.Value = flags;
 
                     ASSERT(IsZeroMemory(&Packet->ListEntry, sizeof (LIST_ENTRY)));
                     InsertTailList(&Ring->PacketList, &Packet->ListEntry);
                 }
 
                 Error = FALSE;
+                Info = 0;
+                MaximumSegmentSize = 0;
                 Packet = NULL;
                 flags = 0;
-                MaximumSegmentSize = 0;
                 TailMdl = NULL;
             }
 
@@ -1953,10 +1963,13 @@ ReceiverRingPoll(
             }
         }
         ASSERT(!Error);
+        ASSERT(!Extra);
+        ASSERT3U(Info, ==, 0);
         ASSERT3P(Packet, ==, NULL);
         ASSERT3U(flags, ==, 0);
         ASSERT3U(MaximumSegmentSize, ==, 0);
         ASSERT3P(TailMdl, ==, NULL);
+        ASSERT(EOP);
 
         KeMemoryBarrier();
 
@@ -2973,21 +2986,33 @@ __ReceiverSetGsoFeatureFlag(
 
     Frontend = Receiver->Frontend;
 
+    (VOID) XENBUS_STORE(Remove,
+                        &Receiver->StoreInterface,
+                        Transaction,
+                        FrontendGetPath(Frontend),
+                        "feature-gso-tcpv4-prefix");
+
     status = XENBUS_STORE(Printf,
                           &Receiver->StoreInterface,
                           Transaction,
                           FrontendGetPath(Frontend),
-                          "feature-gso-tcpv4-prefix",
+                          "feature-gso-tcpv4",
                           "%u",
                           (Receiver->DisableIpVersion4Gso == 0) ? TRUE : FALSE);
     if (!NT_SUCCESS(status))
         goto fail1;
 
+    (VOID) XENBUS_STORE(Remove,
+                        &Receiver->StoreInterface,
+                        Transaction,
+                        FrontendGetPath(Frontend),
+                        "feature-gso-tcpv6-prefix");
+
     status = XENBUS_STORE(Printf,
                           &Receiver->StoreInterface,
                           Transaction,
                           FrontendGetPath(Frontend),
-                          "feature-gso-tcpv6-prefix",
+                          "feature-gso-tcpv6",
                           "%u",
                           (Receiver->DisableIpVersion6Gso == 0) ? TRUE : FALSE);
     if (!NT_SUCCESS(status))
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Tue Jan 19 11:24:32 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 19 Jan 2016 11:24:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aLUOl-0005nB-3f; Tue, 19 Jan 2016 11:24:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aLUOk-0005my-9e
	for win-pv-devel@lists.xenproject.org; Tue, 19 Jan 2016 11:24:30 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	CB/3B-03225-DEC1E965; Tue, 19 Jan 2016 11:24:29 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1453202668!16701430!1
X-Originating-IP: [74.125.82.66]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16022 invoked from network); 19 Jan 2016 11:24:28 -0000
Received: from mail-wm0-f66.google.com (HELO mail-wm0-f66.google.com)
	(74.125.82.66)
	by server-10.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 19 Jan 2016 11:24:28 -0000
Received: by mail-wm0-f66.google.com with SMTP id u188so22544998wmu.0
	for <win-pv-devel@lists.xenproject.org>;
	Tue, 19 Jan 2016 03:24:28 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:in-reply-to:references;
	bh=ceUAmlaId5lj72/l4p5SxWI4Tivl4sRwQkevYb2aGF4=;
	b=Kxw6/POHBVMsaL/35+BmxD0C7VXauAJhEh1afNmkHOHj1k90g0qEv2CO+qVeqd0QJI
	70Ro7w1KiZrrN4BZtZ5CQH9tHrQqRwDpy0u3hD48DiXZUnVh0pDXzlAU8tBKOx/0DOVe
	JaKOhIX4uIfrkEL5Vg890UFLuvExAoPV3LynaBRz9q5Y6PkxJvqhs9YhRZTBNdij2d40
	12lmjzHOPCS4uyvp+efdK3b0NS/+byW6wMBd3rbViXtjzIHFQytlMX1JGdiBPWoqTB7i
	dJWvb6cdg4ymQ204uR+B+lCTN31/BM0wN7LlNWI88UxLZD/cnHTtT7dH8aRnDVatuCkb
	kWFQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
	:references;
	bh=ceUAmlaId5lj72/l4p5SxWI4Tivl4sRwQkevYb2aGF4=;
	b=QAe2zSc1YF9bDYiOWtJi+5WrZWCcZhh06GcaJ1N1S8+XMzkIah5BcQEOnQGIqGsLJW
	bdX9GunUWW+2GrzuwlujY971weDGAFPvzzmcI1vTeMrMq3CFZlZk3JupGC7ECFmEgy0v
	5ti8PzxTSJ7i6CokmqO8kicfDx8GuHB04CDzsaZB3zkrfdvaJtck0PqrW0ssk0y2qzZF
	3mi4rglLAqrIGUw1wQFggBaAL7jc8FJmsvhK2dsyCERr0PI/m81ofUvI2G4YGPU8S5Qb
	aLH5E37qrqcbOgYGbpetsPWmZx6qGVgY2FkXwFq3xFu6ZM+Z+Ct7CT/V4GozyI5+N6dP
	ii7A==
X-Gm-Message-State: AG10YOTBGzlCN/qIBQMyiAnTuC/5mA5RZWmt8TveuYM84BIUgPFi5GaEGLZqHrs+EgjZ0g==
X-Received: by 10.28.127.85 with SMTP id a82mr19820943wmd.48.1453202668741;
	Tue, 19 Jan 2016 03:24:28 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	a126sm19977424wmh.0.2016.01.19.03.24.28
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Tue, 19 Jan 2016 03:24:28 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Tue, 19 Jan 2016 11:24:17 +0000
Message-Id: <1453202658-9508-2-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
In-Reply-To: <1453202658-9508-1-git-send-email-paul.durrant@citrix.com>
References: <1453202658-9508-1-git-send-email-paul.durrant@citrix.com>
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH 2/3] Remove header/data split support
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

During logo testing it became apparent that:

a) This is predicated on support VLAN ID, which is not something we really
   want in a PV driver (since the backend network may actually be a VLAN).
b) Turning on Viridian flags causes NDIS to stop enabling header/data split.
   (There's a call to NdisGetHypervisorInfo() in NdisMSetHDSplitAttributes()).

Issue a) makes it undesirable to implement and b) makes it pretty much
pointless having the code around. Hence this patch removes it.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xennet.inf        |  7 ----
 src/xennet/adapter.c  | 88 +--------------------------------------------------
 src/xennet/receiver.c | 56 +-------------------------------
 src/xennet/receiver.h |  6 ----
 4 files changed, 2 insertions(+), 155 deletions(-)

diff --git a/src/xennet.inf b/src/xennet.inf
index 31b2f64..ae194b7 100644
--- a/src/xennet.inf
+++ b/src/xennet.inf
@@ -159,13 +159,6 @@ HKR, Ndi\params\LROIPv6,                          Optional,   0, "0"
 HKR, Ndi\params\LROIPv6\enum,                     "0",        0, %Disabled%
 HKR, Ndi\params\LROIPv6\enum,                     "1",        0, %Enabled%
 
-HKR, Ndi\params\*HeaderDataSplit,                 ParamDesc,  0, %HeaderDataSplit%
-HKR, Ndi\params\*HeaderDataSplit,                 Type,       0, "enum"
-HKR, Ndi\params\*HeaderDataSplit,                 Default,    0, "0"
-HKR, Ndi\params\*HeaderDataSplit,                 Optional,   0, "0"
-HKR, Ndi\params\*HeaderDataSplit\enum,            "0",        0, %Disabled%
-HKR, Ndi\params\*HeaderDataSplit\enum,            "1",        0, %Enabled%
-
 [XenNet_Inst.Services] 
 AddService=xennet,0x02,XenNet_Service,XenNet_EventLog
 
diff --git a/src/xennet/adapter.c b/src/xennet/adapter.c
index 806b1e3..dca9b7b 100644
--- a/src/xennet/adapter.c
+++ b/src/xennet/adapter.c
@@ -60,7 +60,6 @@ typedef struct _PROPERTIES {
     int lsov6;
     int lrov4;
     int lrov6;
-    ULONG HeaderDataSplit;
 } PROPERTIES, *PPROPERTIES;
 
 struct _XENNET_ADAPTER {
@@ -139,7 +138,6 @@ static NDIS_OID XennetSupportedOids[] =
     OID_PNP_CAPABILITIES,
     OID_PNP_QUERY_POWER,
     OID_PNP_SET_POWER,
-    OID_GEN_HD_SPLIT_PARAMETERS,
 };
 
 #define ADAPTER_POOL_TAG    'AteN'
@@ -561,6 +559,7 @@ AdapterGetOffloadEncapsulation(
         TxOptions->OffloadIpVersion6UdpChecksum = 1;
 
     RxOptions = ReceiverOffloadOptions(Adapter->Receiver);
+
     RxOptions->Value = 0;
     RxOptions->OffloadTagManipulation = 1;
 
@@ -672,18 +671,6 @@ invalid_parameter:
 #undef CHANGE
 
 static NDIS_STATUS
-AdapterGetHeaderDataSplitParameters(
-    IN  PXENNET_ADAPTER             Adapter,
-    IN  PNDIS_HD_SPLIT_PARAMETERS   Split
-    )
-{
-    if (Split->HDSplitCombineFlags == NDIS_HD_SPLIT_COMBINE_ALL_HEADERS)
-        ReceiverSplitHeaderData(Adapter->Receiver, 0);
-
-    return NDIS_STATUS_SUCCESS;
-}
-
-static NDIS_STATUS
 AdapterQueryGeneralStatistics(
     IN  PXENNET_ADAPTER     Adapter,
     IN  PNDIS_STATISTICS_INFO   Info,
@@ -1693,16 +1680,6 @@ AdapterSetInformation(
         }
         break;
 
-    case OID_GEN_HD_SPLIT_PARAMETERS:
-        BytesNeeded = sizeof(NDIS_HD_SPLIT_PARAMETERS);
-        if (BufferLength >= BytesNeeded) {
-            ndisStatus = AdapterGetHeaderDataSplitParameters(Adapter,
-                                                             (PNDIS_HD_SPLIT_PARAMETERS)Buffer);
-            if (ndisStatus == NDIS_STATUS_SUCCESS)
-                BytesRead = sizeof(NDIS_HD_SPLIT_PARAMETERS);
-        }
-        break;
-
     case OID_GEN_INTERRUPT_MODERATION:
     case OID_GEN_MACHINE_NAME:
         Warn = FALSE;
@@ -2393,7 +2370,6 @@ AdapterGetAdvancedSettings(
     READ_PROPERTY(Adapter->Properties.lrov4, L"LROIPv4", 1, Handle);
     READ_PROPERTY(Adapter->Properties.lrov6, L"LROIPv6", 1, Handle);
     READ_PROPERTY(Adapter->Properties.need_csum_value, L"NeedChecksumValue", 1, Handle);
-    READ_PROPERTY(Adapter->Properties.HeaderDataSplit, L"*HeaderDataSplit", 1, Handle);
 
     NdisCloseConfiguration(Handle);
 
@@ -2678,63 +2654,6 @@ AdapterSetOffloadAttributes(
     return ndisStatus;
 }
 
-static NDIS_STATUS
-AdapterSetHeaderDataSplitAttributes(
-    IN  PXENNET_ADAPTER                                 Adapter
-    )
-{
-    NDIS_MINIPORT_ADAPTER_HARDWARE_ASSIST_ATTRIBUTES    Attribs;
-    NDIS_HD_SPLIT_ATTRIBUTES                            Split;
-    NDIS_STATUS                                         NdisStatus;
-
-    RtlZeroMemory(&Attribs, sizeof(Attribs));
-
-    Attribs.Header.Type = NDIS_OBJECT_TYPE_MINIPORT_ADAPTER_HARDWARE_ASSIST_ATTRIBUTES;
-    Attribs.Header.Revision = NDIS_MINIPORT_ADAPTER_HARDWARE_ASSIST_ATTRIBUTES_REVISION_1;
-    Attribs.Header.Size = NDIS_SIZEOF_MINIPORT_ADAPTER_HARDWARE_ASSIST_ATTRIBUTES_REVISION_1;
-
-    RtlZeroMemory(&Split, sizeof(Split));
-
-    Split.Header.Type = NDIS_OBJECT_TYPE_HD_SPLIT_ATTRIBUTES;
-    Split.Header.Revision = NDIS_HD_SPLIT_ATTRIBUTES_REVISION_1;
-    Split.Header.Size = NDIS_SIZEOF_HD_SPLIT_ATTRIBUTES_REVISION_1;
-    Split.HardwareCapabilities =
-        NDIS_HD_SPLIT_CAPS_SUPPORTS_HEADER_DATA_SPLIT |
-        NDIS_HD_SPLIT_CAPS_SUPPORTS_IPV4_OPTIONS |
-        NDIS_HD_SPLIT_CAPS_SUPPORTS_IPV6_EXTENSION_HEADERS |
-        NDIS_HD_SPLIT_CAPS_SUPPORTS_TCP_OPTIONS;
-
-    if (Adapter->Properties.HeaderDataSplit != 0)
-        Split.CurrentCapabilities = Split.HardwareCapabilities;
-
-    Attribs.HDSplitAttributes = &Split;
-
-    NdisStatus = NdisMSetMiniportAttributes(Adapter->NdisAdapterHandle,
-                                            (PNDIS_MINIPORT_ADAPTER_ATTRIBUTES)&Attribs);
-    if (NdisStatus != NDIS_STATUS_SUCCESS)
-        goto fail1;
-
-    if (Split.HDSplitFlags == NDIS_HD_SPLIT_ENABLE_HEADER_DATA_SPLIT) {
-        ASSERT(Split.CurrentCapabilities & NDIS_HD_SPLIT_CAPS_SUPPORTS_HEADER_DATA_SPLIT);
-
-        Info("BackfillSize = %u\n", Split.BackfillSize);
-        Info("MaxHeaderSize = %u\n", Split.MaxHeaderSize);
-
-        XENVIF_VIF(ReceiverSetBackfillSize,
-                   &Adapter->VifInterface,
-                   Split.BackfillSize);
-
-        ReceiverSplitHeaderData(Adapter->Receiver, Split.MaxHeaderSize);
-    }
-
-    return NDIS_STATUS_SUCCESS;
-
-fail1:
-    Error("fail1 (%08x)\n", NdisStatus);
-
-    return NdisStatus;
-}
-
 NDIS_STATUS
 AdapterInitialize(
     IN  NDIS_HANDLE         Handle,
@@ -2821,10 +2740,6 @@ AdapterInitialize(
     if (ndisStatus != NDIS_STATUS_SUCCESS)
         goto fail11;
 
-    ndisStatus = AdapterSetHeaderDataSplitAttributes(*Adapter);
-    if (ndisStatus != NDIS_STATUS_SUCCESS)
-        goto fail12;
-
     RtlZeroMemory(&Dma, sizeof(NDIS_SG_DMA_DESCRIPTION));
     Dma.Header.Type = NDIS_OBJECT_TYPE_SG_DMA_DESCRIPTION;
     Dma.Header.Revision = NDIS_SG_DMA_DESCRIPTION_REVISION_1;
@@ -2842,7 +2757,6 @@ AdapterInitialize(
 
     return NDIS_STATUS_SUCCESS;
 
-fail12:
 fail11:
 fail10:
 fail9:
diff --git a/src/xennet/receiver.c b/src/xennet/receiver.c
index 9f5ac60..08c6413 100644
--- a/src/xennet/receiver.c
+++ b/src/xennet/receiver.c
@@ -47,7 +47,6 @@ struct _XENNET_RECEIVER {
     LONG                        InNDIS;
     LONG                        InNDISMax;
     XENVIF_VIF_OFFLOAD_OPTIONS  OffloadOptions;
-    ULONG                       MaxHeaderSize;
 };
 
 #define RECEIVER_POOL_TAG       'RteN'
@@ -177,10 +176,10 @@ __ReceiverReceivePacket(
     )
 {
     PNET_BUFFER_LIST                            NetBufferList;
-    PNET_BUFFER                                 NetBuffer;
     NDIS_TCP_IP_CHECKSUM_NET_BUFFER_LIST_INFO   csumInfo;
 
     UNREFERENCED_PARAMETER(MaximumSegmentSize);
+    UNREFERENCED_PARAMETER(Info);
 
     NetBufferList = __ReceiverAllocateNetBufferList(Receiver,
                                                     Mdl,
@@ -190,8 +189,6 @@ __ReceiverReceivePacket(
     if (NetBufferList == NULL)
         goto fail1;
 
-    NetBuffer = NET_BUFFER_LIST_FIRST_NB(NetBufferList);
-
     NetBufferList->SourceHandle = AdapterGetHandle(Receiver->Adapter);
 
     csumInfo.Value = 0;
@@ -221,48 +218,6 @@ __ReceiverReceivePacket(
         NET_BUFFER_LIST_INFO(NetBufferList, Ieee8021QNetBufferListInfo) = Ieee8021QInfo.Value;
     }
 
-    if (Info->IpHeader.Offset != 0) {
-        ULONG                   NblFlags;
-        PUCHAR                  InfoVa;
-        PIP_HEADER              IpHeader;
-        NDIS_PHYSICAL_ADDRESS   DataPhysicalAddress;
-
-        NblFlags = NET_BUFFER_LIST_NBL_FLAGS(NetBufferList);
-
-        InfoVa = MmGetSystemAddressForMdlSafe(Mdl, NormalPagePriority);
-        ASSERT(InfoVa != NULL);
-        InfoVa += Offset;
-
-        IpHeader = (PIP_HEADER)(InfoVa + Info->IpHeader.Offset);
-
-        if (IpHeader->Version == 4) {
-            NblFlags |= NDIS_NBL_FLAGS_IS_IPV4;
-        } else {
-            ASSERT3U(IpHeader->Version, ==, 6);
-            NblFlags |= NDIS_NBL_FLAGS_IS_IPV6;
-        }
-
-        if (Info->TcpHeader.Offset != 0)
-            NblFlags |= NDIS_NBL_FLAGS_IS_TCP;
-        else if (Info->UdpHeader.Offset != 0)
-            NblFlags |= NDIS_NBL_FLAGS_IS_UDP;
-
-        if (Mdl->Next != NULL && Info->Length < Receiver->MaxHeaderSize) {
-            NblFlags |= NDIS_NBL_FLAGS_HD_SPLIT;
-            if (NblFlags & (NDIS_NBL_FLAGS_IS_TCP | NDIS_NBL_FLAGS_IS_UDP))
-                NblFlags |= NDIS_NBL_FLAGS_SPLIT_AT_UPPER_LAYER_PROTOCOL_PAYLOAD;
-            else
-                NblFlags |= NDIS_NBL_FLAGS_SPLIT_AT_UPPER_LAYER_PROTOCOL_HEADER;
-
-            DataPhysicalAddress.QuadPart = (ULONGLONG)MmGetMdlPfnArray(Mdl->Next)[0] << PAGE_SHIFT;
-            DataPhysicalAddress.QuadPart += Mdl->Next->ByteOffset;
-
-            NET_BUFFER_DATA_PHYSICAL_ADDRESS(NetBuffer) = DataPhysicalAddress;
-        }
-
-        NET_BUFFER_LIST_NBL_FLAGS(NetBufferList) = NblFlags;
-    }
-
     return NetBufferList;
 
 fail2:
@@ -461,12 +416,3 @@ ReceiverOffloadOptions(
 {
     return &Receiver->OffloadOptions;
 }
-
-VOID
-ReceiverSplitHeaderData(
-    IN  PXENNET_RECEIVER    Receiver,
-    IN  ULONG               MaxHeaderSize
-    )
-{
-    Receiver->MaxHeaderSize = MaxHeaderSize;
-}
diff --git a/src/xennet/receiver.h b/src/xennet/receiver.h
index fbc0151..e6b2af1 100644
--- a/src/xennet/receiver.h
+++ b/src/xennet/receiver.h
@@ -73,10 +73,4 @@ ReceiverOffloadOptions(
     IN  PXENNET_RECEIVER    Receiver
     );
 
-extern VOID
-ReceiverSplitHeaderData(
-    IN  PXENNET_RECEIVER    Receiver,
-    IN  ULONG               MaxHeaderSize
-    );
-
 #endif // _XENNET_RECEIVER_H_
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Tue Jan 19 11:24:32 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 19 Jan 2016 11:24:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aLUOl-0005n7-1W; Tue, 19 Jan 2016 11:24:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aLUOj-0005mx-RQ
	for win-pv-devel@lists.xenproject.org; Tue, 19 Jan 2016 11:24:30 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	CE/15-13487-DEC1E965; Tue, 19 Jan 2016 11:24:29 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1453202668!16428433!1
X-Originating-IP: [74.125.82.67]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20072 invoked from network); 19 Jan 2016 11:24:28 -0000
Received: from mail-wm0-f67.google.com (HELO mail-wm0-f67.google.com)
	(74.125.82.67)
	by server-6.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 19 Jan 2016 11:24:28 -0000
Received: by mail-wm0-f67.google.com with SMTP id u188so22544946wmu.0
	for <win-pv-devel@lists.xenproject.org>;
	Tue, 19 Jan 2016 03:24:28 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=6t4/l6K4rK61/0iW2DrgjHR7V5W7ncSjkabJ/pc2b30=;
	b=UhmbipRS2S2ZsKJVbVQHm+OMa/YAtfOL+tr11eAnawKBwe9BpffWFwyqNAu8lvOTvm
	w6Dniqh90Ww3vO/hsNeeC5uShB5UeJaQYQx9uD7jFOuDlGcxZdzP2oKvqNqxDChRl4Nf
	kgHch4gYyA+gFZuryB5SVKL+FdTdlRN6whKk1R6JeKgDOrCO+tfEDyEKf4VnOebazIvp
	Ez3oc6UujByTWYmjwG0WS7boEdmfHf1wBgYvnqrmPSZeFkbTAnzqqsswQc3mU8t7V/Zj
	OeN6ucdi6LzT9dcQps+aibOj4oltLkfdHkEzhD/znJbV9p0gMd7+klEKJTfUXllzjxdh
	v+wQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id;
	bh=6t4/l6K4rK61/0iW2DrgjHR7V5W7ncSjkabJ/pc2b30=;
	b=g61YJxq9SqKIbF6ccQTUtLpsedBLvqUCpgDacc7kVP+SZHmhyAlNoZq4eBgHsQtAiN
	kKQ9/Rq33pl+DG35z59QM3QQCEz0zVw6hz5ret8JcPMhym3xe+6bO3+9pcWYtLPVwKXC
	zvD1b4hi+QVKQsx7NjVp9SnUVqm17Y0P3nVNWceV864h55UiG7ndSAbaECuaCKsIfQKm
	A/vQGIwd5BkEFOdae+hW5ZVa08Z5aVq+pibd6BHQKnX98HRYEFkV8VPw99U6f0pRLXOI
	OyvgTK8umH3O61XlTqerDc/+7bP/Pz5l2gY79lguk3ME6Qfk06H2eTyiAABlL45SPDWi
	QaIQ==
X-Gm-Message-State: AG10YOQU3FKtW4EBXP2R1x82f01ScwusTciwMgFODFbkGY8AmzRfNqGlT29uTiTV++voow==
X-Received: by 10.28.22.201 with SMTP id 192mr19867362wmw.1.1453202667984;
	Tue, 19 Jan 2016 03:24:27 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	a126sm19977424wmh.0.2016.01.19.03.24.26
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Tue, 19 Jan 2016 03:24:27 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Tue, 19 Jan 2016 11:24:16 +0000
Message-Id: <1453202658-9508-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH 1/3] Fix various structure sizes
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

NDIS defines 'sizeof' values for various attribute/parameter structures
which are documented for use with different versions of NDIS. This patch
makes sure we are using these defined values in appropriate places.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xennet/adapter.c | 65 +++++++++++++++++++++++++++-------------------------
 1 file changed, 34 insertions(+), 31 deletions(-)

diff --git a/src/xennet/adapter.c b/src/xennet/adapter.c
index b58960e..806b1e3 100644
--- a/src/xennet/adapter.c
+++ b/src/xennet/adapter.c
@@ -246,6 +246,7 @@ AdapterVifCallback(
 
 #define DISPLAY_OFFLOAD(_Offload)                                   \
         do {                                                        \
+            Info("%s\n", #_Offload);                                \
             if ((_Offload).Checksum.IPv4Receive.IpChecksum)         \
                 Info("Checksum.IPv4Receive.IpChecksum ON\n");       \
             else                                                    \
@@ -322,10 +323,10 @@ AdapterIndicateOffloadChanged(
     RxOptions = ReceiverOffloadOptions(Adapter->Receiver);
     TxOptions = TransmitterOffloadOptions(Adapter->Transmitter);
 
-    RtlZeroMemory(&Offload, sizeof(NDIS_OFFLOAD));
+    RtlZeroMemory(&Offload, sizeof(Offload));
     Offload.Header.Type = NDIS_OBJECT_TYPE_OFFLOAD;
-    Offload.Header.Revision = NDIS_OFFLOAD_REVISION_1;
-    Offload.Header.Size = sizeof(NDIS_OFFLOAD);
+    Offload.Header.Revision = NDIS_OFFLOAD_REVISION_2;
+    Offload.Header.Size = NDIS_SIZEOF_NDIS_OFFLOAD_REVISION_2;
 
     Offload.Checksum.IPv4Receive.Encapsulation = NDIS_ENCAPSULATION_IEEE_802_3;
 
@@ -401,18 +402,17 @@ AdapterIndicateOffloadChanged(
         Offload.LsoV2.IPv6.TcpOptionsSupported = 1;
     }
 
-    if (!RtlEqualMemory(&Adapter->Offload, &Offload, sizeof(NDIS_OFFLOAD))) {
-        Adapter->Offload = Offload;
-        DISPLAY_OFFLOAD(Offload);
-    }
+    DISPLAY_OFFLOAD(Offload);
+
+    Adapter->Offload = Offload;
 
-    RtlZeroMemory(&Status, sizeof(NDIS_STATUS_INDICATION));
+    RtlZeroMemory(&Status, sizeof(Status));
     Status.Header.Type = NDIS_OBJECT_TYPE_STATUS_INDICATION;
     Status.Header.Revision = NDIS_STATUS_INDICATION_REVISION_1;
-    Status.Header.Size = sizeof(NDIS_STATUS_INDICATION);
+    Status.Header.Size = NDIS_SIZEOF_STATUS_INDICATION_REVISION_1;
     Status.StatusCode = NDIS_STATUS_TASK_OFFLOAD_CURRENT_CONFIG;
     Status.StatusBuffer = &Offload;
-    Status.StatusBufferSize = sizeof(Offload);
+    Status.StatusBufferSize = NDIS_SIZEOF_NDIS_OFFLOAD_REVISION_2;
 
     NdisMIndicateStatusEx(Adapter->NdisAdapterHandle, &Status);
 }
@@ -1045,7 +1045,7 @@ AdapterInterruptModeration(
 
     Params->Header.Type = NDIS_OBJECT_TYPE_DEFAULT;
     Params->Header.Revision = NDIS_INTERRUPT_MODERATION_PARAMETERS_REVISION_1;
-    Params->Header.Size = sizeof(NDIS_INTERRUPT_MODERATION_PARAMETERS);
+    Params->Header.Size = NDIS_SIZEOF_INTERRUPT_MODERATION_PARAMETERS_REVISION_1;
 
     Params->Flags = 0;
     Params->InterruptModeration = NdisInterruptModerationNotSupported;
@@ -1554,10 +1554,10 @@ AdapterMediaStateChange(
     NDIS_LINK_STATE         LinkState;
     NDIS_STATUS_INDICATION  StatusIndication;
 
-    RtlZeroMemory(&LinkState, sizeof (NDIS_LINK_STATE));
+    RtlZeroMemory(&LinkState, sizeof(LinkState));
     LinkState.Header.Revision = NDIS_LINK_STATE_REVISION_1;
     LinkState.Header.Type = NDIS_OBJECT_TYPE_DEFAULT;
-    LinkState.Header.Size = sizeof(NDIS_LINK_STATE);
+    LinkState.Header.Size = NDIS_SIZEOF_LINK_STATE_REVISION_1;
 
     XENVIF_VIF(MacQueryState,
                &Adapter->VifInterface,
@@ -1582,10 +1582,10 @@ AdapterMediaStateChange(
 
     LinkState.XmitLinkSpeed = LinkState.RcvLinkSpeed;
 
-    RtlZeroMemory(&StatusIndication, sizeof (NDIS_STATUS_INDICATION));
+    RtlZeroMemory(&StatusIndication, sizeof(StatusIndication));
     StatusIndication.Header.Type = NDIS_OBJECT_TYPE_STATUS_INDICATION;
     StatusIndication.Header.Revision = NDIS_STATUS_INDICATION_REVISION_1;
-    StatusIndication.Header.Size = sizeof (NDIS_STATUS_INDICATION);
+    StatusIndication.Header.Size = NDIS_SIZEOF_STATUS_INDICATION_REVISION_1;
 
     StatusIndication.SourceHandle = Adapter->NdisAdapterHandle;
     StatusIndication.StatusCode = NDIS_STATUS_LINK_STATE;
@@ -2291,7 +2291,7 @@ __QueryInterface(
     ASSERT3U(KeGetCurrentIrql(), ==, PASSIVE_LEVEL);
 
     KeInitializeEvent(&Event, NotificationEvent, FALSE);
-    RtlZeroMemory(&StatusBlock, sizeof(IO_STATUS_BLOCK));
+    RtlZeroMemory(&StatusBlock, sizeof(StatusBlock));
 
     Irp = IoBuildSynchronousFsdRequest(IRP_MJ_PNP,
                                        DeviceObject,
@@ -2359,6 +2359,8 @@ fail1:
             field = _Data->ParameterData.IntegerData;   \
         else                                            \
             field = defaultval;                         \
+                                                        \
+        Info("%ws = %d\n", name, field);                \
     } while (FALSE);
 
 static NDIS_STATUS
@@ -2370,10 +2372,10 @@ AdapterGetAdvancedSettings(
     NDIS_HANDLE                 Handle;
     NDIS_STATUS                 ndisStatus;
 
-    RtlZeroMemory(&Config, sizeof(NDIS_CONFIGURATION_OBJECT));
+    RtlZeroMemory(&Config, sizeof(Config));
     Config.Header.Type = NDIS_OBJECT_TYPE_CONFIGURATION_OBJECT;
     Config.Header.Revision = NDIS_CONFIGURATION_OBJECT_REVISION_1;
-    Config.Header.Size = sizeof(NDIS_CONFIGURATION_OBJECT);
+    Config.Header.Size = NDIS_SIZEOF_CONFIGURATION_OBJECT_REVISION_1;
     Config.NdisHandle = Adapter->NdisAdapterHandle;
     Config.Flags = 0;
 
@@ -2413,10 +2415,10 @@ AdapterSetRegistrationAttributes(
     NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES   Attribs;
     NDIS_STATUS                                     ndisStatus;
 
-    RtlZeroMemory(&Attribs, sizeof(NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES));
+    RtlZeroMemory(&Attribs, sizeof(Attribs));
     Attribs.Header.Type = NDIS_OBJECT_TYPE_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES;
     Attribs.Header.Revision = NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES_REVISION_1;
-    Attribs.Header.Size = sizeof(NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES);
+    Attribs.Header.Size = NDIS_SIZEOF_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES_REVISION_1;
     Attribs.MiniportAdapterContext = (NDIS_HANDLE)Adapter;
     Attribs.AttributeFlags = NDIS_MINIPORT_ATTRIBUTES_BUS_MASTER |
                              NDIS_MINIPORT_ATTRIBUTES_NO_HALT_ON_SUSPEND;
@@ -2437,7 +2439,7 @@ AdapterSetGeneralAttributes(
     NDIS_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES    Attribs;
     NDIS_STATUS                                 ndisStatus;
 
-    RtlZeroMemory(&Attribs, sizeof(NDIS_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES));
+    RtlZeroMemory(&Attribs, sizeof(Attribs));
     Attribs.Header.Type = NDIS_OBJECT_TYPE_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES;
     Attribs.Header.Revision = NDIS_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES_REVISION_1;
     Attribs.Header.Size = sizeof(NDIS_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES);
@@ -2545,10 +2547,10 @@ AdapterSetOffloadAttributes(
                &Adapter->VifInterface,
                &Options);
 
-    RtlZeroMemory(&Supported, sizeof(NDIS_OFFLOAD));
+    RtlZeroMemory(&Supported, sizeof(Supported));
     Supported.Header.Type = NDIS_OBJECT_TYPE_OFFLOAD;
-    Supported.Header.Revision = NDIS_OFFLOAD_REVISION_1;
-    Supported.Header.Size = sizeof(NDIS_OFFLOAD);
+    Supported.Header.Revision = NDIS_OFFLOAD_REVISION_2;
+    Supported.Header.Size = NDIS_SIZEOF_NDIS_OFFLOAD_REVISION_2;
 
     Supported.Checksum.IPv4Receive.Encapsulation = NDIS_ENCAPSULATION_IEEE_802_3;
 
@@ -2616,6 +2618,8 @@ AdapterSetOffloadAttributes(
         Supported.LsoV2.IPv6.TcpOptionsSupported = 1;
     }
 
+    DISPLAY_OFFLOAD(Supported);
+
     Default = Supported;
 
     if (!(Adapter->Properties.ipv4_csum & 2))
@@ -2658,15 +2662,14 @@ AdapterSetOffloadAttributes(
         Default.LsoV2.IPv6.MinSegmentCount = 0;
     }
 
-    if (!RtlEqualMemory(&Adapter->Offload, &Default, sizeof (NDIS_OFFLOAD))) {
-        Adapter->Offload = Default;
-        DISPLAY_OFFLOAD(Default);
-    }
+    DISPLAY_OFFLOAD(Default);
 
-    RtlZeroMemory(&Attribs, sizeof(NDIS_MINIPORT_ADAPTER_OFFLOAD_ATTRIBUTES));
+    Adapter->Offload = Default;
+
+    RtlZeroMemory(&Attribs, sizeof(Attribs));
     Attribs.Header.Type = NDIS_OBJECT_TYPE_MINIPORT_ADAPTER_OFFLOAD_ATTRIBUTES;
     Attribs.Header.Revision = NDIS_MINIPORT_ADAPTER_OFFLOAD_ATTRIBUTES_REVISION_1;
-    Attribs.Header.Size = sizeof(Attribs);
+    Attribs.Header.Size = NDIS_SIZEOF_MINIPORT_ADAPTER_OFFLOAD_ATTRIBUTES_REVISION_1;
     Attribs.DefaultOffloadConfiguration = &Default;
     Attribs.HardwareOffloadCapabilities = &Supported;
 
@@ -2825,7 +2828,7 @@ AdapterInitialize(
     RtlZeroMemory(&Dma, sizeof(NDIS_SG_DMA_DESCRIPTION));
     Dma.Header.Type = NDIS_OBJECT_TYPE_SG_DMA_DESCRIPTION;
     Dma.Header.Revision = NDIS_SG_DMA_DESCRIPTION_REVISION_1;
-    Dma.Header.Size = sizeof(NDIS_SG_DMA_DESCRIPTION);
+    Dma.Header.Size = NDIS_SIZEOF_SG_DMA_DESCRIPTION_REVISION_1;
     Dma.Flags = NDIS_SG_DMA_64_BIT_ADDRESS;
     Dma.MaximumPhysicalMapping = 65536;
     Dma.ProcessSGListHandler = AdapterProcessSGList;
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Tue Jan 19 11:24:32 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 19 Jan 2016 11:24:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aLUOl-0005n7-1W; Tue, 19 Jan 2016 11:24:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aLUOj-0005mx-RQ
	for win-pv-devel@lists.xenproject.org; Tue, 19 Jan 2016 11:24:30 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	CE/15-13487-DEC1E965; Tue, 19 Jan 2016 11:24:29 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1453202668!16428433!1
X-Originating-IP: [74.125.82.67]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20072 invoked from network); 19 Jan 2016 11:24:28 -0000
Received: from mail-wm0-f67.google.com (HELO mail-wm0-f67.google.com)
	(74.125.82.67)
	by server-6.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 19 Jan 2016 11:24:28 -0000
Received: by mail-wm0-f67.google.com with SMTP id u188so22544946wmu.0
	for <win-pv-devel@lists.xenproject.org>;
	Tue, 19 Jan 2016 03:24:28 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=6t4/l6K4rK61/0iW2DrgjHR7V5W7ncSjkabJ/pc2b30=;
	b=UhmbipRS2S2ZsKJVbVQHm+OMa/YAtfOL+tr11eAnawKBwe9BpffWFwyqNAu8lvOTvm
	w6Dniqh90Ww3vO/hsNeeC5uShB5UeJaQYQx9uD7jFOuDlGcxZdzP2oKvqNqxDChRl4Nf
	kgHch4gYyA+gFZuryB5SVKL+FdTdlRN6whKk1R6JeKgDOrCO+tfEDyEKf4VnOebazIvp
	Ez3oc6UujByTWYmjwG0WS7boEdmfHf1wBgYvnqrmPSZeFkbTAnzqqsswQc3mU8t7V/Zj
	OeN6ucdi6LzT9dcQps+aibOj4oltLkfdHkEzhD/znJbV9p0gMd7+klEKJTfUXllzjxdh
	v+wQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id;
	bh=6t4/l6K4rK61/0iW2DrgjHR7V5W7ncSjkabJ/pc2b30=;
	b=g61YJxq9SqKIbF6ccQTUtLpsedBLvqUCpgDacc7kVP+SZHmhyAlNoZq4eBgHsQtAiN
	kKQ9/Rq33pl+DG35z59QM3QQCEz0zVw6hz5ret8JcPMhym3xe+6bO3+9pcWYtLPVwKXC
	zvD1b4hi+QVKQsx7NjVp9SnUVqm17Y0P3nVNWceV864h55UiG7ndSAbaECuaCKsIfQKm
	A/vQGIwd5BkEFOdae+hW5ZVa08Z5aVq+pibd6BHQKnX98HRYEFkV8VPw99U6f0pRLXOI
	OyvgTK8umH3O61XlTqerDc/+7bP/Pz5l2gY79lguk3ME6Qfk06H2eTyiAABlL45SPDWi
	QaIQ==
X-Gm-Message-State: AG10YOQU3FKtW4EBXP2R1x82f01ScwusTciwMgFODFbkGY8AmzRfNqGlT29uTiTV++voow==
X-Received: by 10.28.22.201 with SMTP id 192mr19867362wmw.1.1453202667984;
	Tue, 19 Jan 2016 03:24:27 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	a126sm19977424wmh.0.2016.01.19.03.24.26
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Tue, 19 Jan 2016 03:24:27 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Tue, 19 Jan 2016 11:24:16 +0000
Message-Id: <1453202658-9508-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH 1/3] Fix various structure sizes
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

NDIS defines 'sizeof' values for various attribute/parameter structures
which are documented for use with different versions of NDIS. This patch
makes sure we are using these defined values in appropriate places.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xennet/adapter.c | 65 +++++++++++++++++++++++++++-------------------------
 1 file changed, 34 insertions(+), 31 deletions(-)

diff --git a/src/xennet/adapter.c b/src/xennet/adapter.c
index b58960e..806b1e3 100644
--- a/src/xennet/adapter.c
+++ b/src/xennet/adapter.c
@@ -246,6 +246,7 @@ AdapterVifCallback(
 
 #define DISPLAY_OFFLOAD(_Offload)                                   \
         do {                                                        \
+            Info("%s\n", #_Offload);                                \
             if ((_Offload).Checksum.IPv4Receive.IpChecksum)         \
                 Info("Checksum.IPv4Receive.IpChecksum ON\n");       \
             else                                                    \
@@ -322,10 +323,10 @@ AdapterIndicateOffloadChanged(
     RxOptions = ReceiverOffloadOptions(Adapter->Receiver);
     TxOptions = TransmitterOffloadOptions(Adapter->Transmitter);
 
-    RtlZeroMemory(&Offload, sizeof(NDIS_OFFLOAD));
+    RtlZeroMemory(&Offload, sizeof(Offload));
     Offload.Header.Type = NDIS_OBJECT_TYPE_OFFLOAD;
-    Offload.Header.Revision = NDIS_OFFLOAD_REVISION_1;
-    Offload.Header.Size = sizeof(NDIS_OFFLOAD);
+    Offload.Header.Revision = NDIS_OFFLOAD_REVISION_2;
+    Offload.Header.Size = NDIS_SIZEOF_NDIS_OFFLOAD_REVISION_2;
 
     Offload.Checksum.IPv4Receive.Encapsulation = NDIS_ENCAPSULATION_IEEE_802_3;
 
@@ -401,18 +402,17 @@ AdapterIndicateOffloadChanged(
         Offload.LsoV2.IPv6.TcpOptionsSupported = 1;
     }
 
-    if (!RtlEqualMemory(&Adapter->Offload, &Offload, sizeof(NDIS_OFFLOAD))) {
-        Adapter->Offload = Offload;
-        DISPLAY_OFFLOAD(Offload);
-    }
+    DISPLAY_OFFLOAD(Offload);
+
+    Adapter->Offload = Offload;
 
-    RtlZeroMemory(&Status, sizeof(NDIS_STATUS_INDICATION));
+    RtlZeroMemory(&Status, sizeof(Status));
     Status.Header.Type = NDIS_OBJECT_TYPE_STATUS_INDICATION;
     Status.Header.Revision = NDIS_STATUS_INDICATION_REVISION_1;
-    Status.Header.Size = sizeof(NDIS_STATUS_INDICATION);
+    Status.Header.Size = NDIS_SIZEOF_STATUS_INDICATION_REVISION_1;
     Status.StatusCode = NDIS_STATUS_TASK_OFFLOAD_CURRENT_CONFIG;
     Status.StatusBuffer = &Offload;
-    Status.StatusBufferSize = sizeof(Offload);
+    Status.StatusBufferSize = NDIS_SIZEOF_NDIS_OFFLOAD_REVISION_2;
 
     NdisMIndicateStatusEx(Adapter->NdisAdapterHandle, &Status);
 }
@@ -1045,7 +1045,7 @@ AdapterInterruptModeration(
 
     Params->Header.Type = NDIS_OBJECT_TYPE_DEFAULT;
     Params->Header.Revision = NDIS_INTERRUPT_MODERATION_PARAMETERS_REVISION_1;
-    Params->Header.Size = sizeof(NDIS_INTERRUPT_MODERATION_PARAMETERS);
+    Params->Header.Size = NDIS_SIZEOF_INTERRUPT_MODERATION_PARAMETERS_REVISION_1;
 
     Params->Flags = 0;
     Params->InterruptModeration = NdisInterruptModerationNotSupported;
@@ -1554,10 +1554,10 @@ AdapterMediaStateChange(
     NDIS_LINK_STATE         LinkState;
     NDIS_STATUS_INDICATION  StatusIndication;
 
-    RtlZeroMemory(&LinkState, sizeof (NDIS_LINK_STATE));
+    RtlZeroMemory(&LinkState, sizeof(LinkState));
     LinkState.Header.Revision = NDIS_LINK_STATE_REVISION_1;
     LinkState.Header.Type = NDIS_OBJECT_TYPE_DEFAULT;
-    LinkState.Header.Size = sizeof(NDIS_LINK_STATE);
+    LinkState.Header.Size = NDIS_SIZEOF_LINK_STATE_REVISION_1;
 
     XENVIF_VIF(MacQueryState,
                &Adapter->VifInterface,
@@ -1582,10 +1582,10 @@ AdapterMediaStateChange(
 
     LinkState.XmitLinkSpeed = LinkState.RcvLinkSpeed;
 
-    RtlZeroMemory(&StatusIndication, sizeof (NDIS_STATUS_INDICATION));
+    RtlZeroMemory(&StatusIndication, sizeof(StatusIndication));
     StatusIndication.Header.Type = NDIS_OBJECT_TYPE_STATUS_INDICATION;
     StatusIndication.Header.Revision = NDIS_STATUS_INDICATION_REVISION_1;
-    StatusIndication.Header.Size = sizeof (NDIS_STATUS_INDICATION);
+    StatusIndication.Header.Size = NDIS_SIZEOF_STATUS_INDICATION_REVISION_1;
 
     StatusIndication.SourceHandle = Adapter->NdisAdapterHandle;
     StatusIndication.StatusCode = NDIS_STATUS_LINK_STATE;
@@ -2291,7 +2291,7 @@ __QueryInterface(
     ASSERT3U(KeGetCurrentIrql(), ==, PASSIVE_LEVEL);
 
     KeInitializeEvent(&Event, NotificationEvent, FALSE);
-    RtlZeroMemory(&StatusBlock, sizeof(IO_STATUS_BLOCK));
+    RtlZeroMemory(&StatusBlock, sizeof(StatusBlock));
 
     Irp = IoBuildSynchronousFsdRequest(IRP_MJ_PNP,
                                        DeviceObject,
@@ -2359,6 +2359,8 @@ fail1:
             field = _Data->ParameterData.IntegerData;   \
         else                                            \
             field = defaultval;                         \
+                                                        \
+        Info("%ws = %d\n", name, field);                \
     } while (FALSE);
 
 static NDIS_STATUS
@@ -2370,10 +2372,10 @@ AdapterGetAdvancedSettings(
     NDIS_HANDLE                 Handle;
     NDIS_STATUS                 ndisStatus;
 
-    RtlZeroMemory(&Config, sizeof(NDIS_CONFIGURATION_OBJECT));
+    RtlZeroMemory(&Config, sizeof(Config));
     Config.Header.Type = NDIS_OBJECT_TYPE_CONFIGURATION_OBJECT;
     Config.Header.Revision = NDIS_CONFIGURATION_OBJECT_REVISION_1;
-    Config.Header.Size = sizeof(NDIS_CONFIGURATION_OBJECT);
+    Config.Header.Size = NDIS_SIZEOF_CONFIGURATION_OBJECT_REVISION_1;
     Config.NdisHandle = Adapter->NdisAdapterHandle;
     Config.Flags = 0;
 
@@ -2413,10 +2415,10 @@ AdapterSetRegistrationAttributes(
     NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES   Attribs;
     NDIS_STATUS                                     ndisStatus;
 
-    RtlZeroMemory(&Attribs, sizeof(NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES));
+    RtlZeroMemory(&Attribs, sizeof(Attribs));
     Attribs.Header.Type = NDIS_OBJECT_TYPE_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES;
     Attribs.Header.Revision = NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES_REVISION_1;
-    Attribs.Header.Size = sizeof(NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES);
+    Attribs.Header.Size = NDIS_SIZEOF_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES_REVISION_1;
     Attribs.MiniportAdapterContext = (NDIS_HANDLE)Adapter;
     Attribs.AttributeFlags = NDIS_MINIPORT_ATTRIBUTES_BUS_MASTER |
                              NDIS_MINIPORT_ATTRIBUTES_NO_HALT_ON_SUSPEND;
@@ -2437,7 +2439,7 @@ AdapterSetGeneralAttributes(
     NDIS_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES    Attribs;
     NDIS_STATUS                                 ndisStatus;
 
-    RtlZeroMemory(&Attribs, sizeof(NDIS_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES));
+    RtlZeroMemory(&Attribs, sizeof(Attribs));
     Attribs.Header.Type = NDIS_OBJECT_TYPE_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES;
     Attribs.Header.Revision = NDIS_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES_REVISION_1;
     Attribs.Header.Size = sizeof(NDIS_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES);
@@ -2545,10 +2547,10 @@ AdapterSetOffloadAttributes(
                &Adapter->VifInterface,
                &Options);
 
-    RtlZeroMemory(&Supported, sizeof(NDIS_OFFLOAD));
+    RtlZeroMemory(&Supported, sizeof(Supported));
     Supported.Header.Type = NDIS_OBJECT_TYPE_OFFLOAD;
-    Supported.Header.Revision = NDIS_OFFLOAD_REVISION_1;
-    Supported.Header.Size = sizeof(NDIS_OFFLOAD);
+    Supported.Header.Revision = NDIS_OFFLOAD_REVISION_2;
+    Supported.Header.Size = NDIS_SIZEOF_NDIS_OFFLOAD_REVISION_2;
 
     Supported.Checksum.IPv4Receive.Encapsulation = NDIS_ENCAPSULATION_IEEE_802_3;
 
@@ -2616,6 +2618,8 @@ AdapterSetOffloadAttributes(
         Supported.LsoV2.IPv6.TcpOptionsSupported = 1;
     }
 
+    DISPLAY_OFFLOAD(Supported);
+
     Default = Supported;
 
     if (!(Adapter->Properties.ipv4_csum & 2))
@@ -2658,15 +2662,14 @@ AdapterSetOffloadAttributes(
         Default.LsoV2.IPv6.MinSegmentCount = 0;
     }
 
-    if (!RtlEqualMemory(&Adapter->Offload, &Default, sizeof (NDIS_OFFLOAD))) {
-        Adapter->Offload = Default;
-        DISPLAY_OFFLOAD(Default);
-    }
+    DISPLAY_OFFLOAD(Default);
 
-    RtlZeroMemory(&Attribs, sizeof(NDIS_MINIPORT_ADAPTER_OFFLOAD_ATTRIBUTES));
+    Adapter->Offload = Default;
+
+    RtlZeroMemory(&Attribs, sizeof(Attribs));
     Attribs.Header.Type = NDIS_OBJECT_TYPE_MINIPORT_ADAPTER_OFFLOAD_ATTRIBUTES;
     Attribs.Header.Revision = NDIS_MINIPORT_ADAPTER_OFFLOAD_ATTRIBUTES_REVISION_1;
-    Attribs.Header.Size = sizeof(Attribs);
+    Attribs.Header.Size = NDIS_SIZEOF_MINIPORT_ADAPTER_OFFLOAD_ATTRIBUTES_REVISION_1;
     Attribs.DefaultOffloadConfiguration = &Default;
     Attribs.HardwareOffloadCapabilities = &Supported;
 
@@ -2825,7 +2828,7 @@ AdapterInitialize(
     RtlZeroMemory(&Dma, sizeof(NDIS_SG_DMA_DESCRIPTION));
     Dma.Header.Type = NDIS_OBJECT_TYPE_SG_DMA_DESCRIPTION;
     Dma.Header.Revision = NDIS_SG_DMA_DESCRIPTION_REVISION_1;
-    Dma.Header.Size = sizeof(NDIS_SG_DMA_DESCRIPTION);
+    Dma.Header.Size = NDIS_SIZEOF_SG_DMA_DESCRIPTION_REVISION_1;
     Dma.Flags = NDIS_SG_DMA_64_BIT_ADDRESS;
     Dma.MaximumPhysicalMapping = 65536;
     Dma.ProcessSGListHandler = AdapterProcessSGList;
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Tue Jan 19 11:24:32 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 19 Jan 2016 11:24:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aLUOl-0005nB-3f; Tue, 19 Jan 2016 11:24:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aLUOk-0005my-9e
	for win-pv-devel@lists.xenproject.org; Tue, 19 Jan 2016 11:24:30 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	CB/3B-03225-DEC1E965; Tue, 19 Jan 2016 11:24:29 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1453202668!16701430!1
X-Originating-IP: [74.125.82.66]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16022 invoked from network); 19 Jan 2016 11:24:28 -0000
Received: from mail-wm0-f66.google.com (HELO mail-wm0-f66.google.com)
	(74.125.82.66)
	by server-10.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 19 Jan 2016 11:24:28 -0000
Received: by mail-wm0-f66.google.com with SMTP id u188so22544998wmu.0
	for <win-pv-devel@lists.xenproject.org>;
	Tue, 19 Jan 2016 03:24:28 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:in-reply-to:references;
	bh=ceUAmlaId5lj72/l4p5SxWI4Tivl4sRwQkevYb2aGF4=;
	b=Kxw6/POHBVMsaL/35+BmxD0C7VXauAJhEh1afNmkHOHj1k90g0qEv2CO+qVeqd0QJI
	70Ro7w1KiZrrN4BZtZ5CQH9tHrQqRwDpy0u3hD48DiXZUnVh0pDXzlAU8tBKOx/0DOVe
	JaKOhIX4uIfrkEL5Vg890UFLuvExAoPV3LynaBRz9q5Y6PkxJvqhs9YhRZTBNdij2d40
	12lmjzHOPCS4uyvp+efdK3b0NS/+byW6wMBd3rbViXtjzIHFQytlMX1JGdiBPWoqTB7i
	dJWvb6cdg4ymQ204uR+B+lCTN31/BM0wN7LlNWI88UxLZD/cnHTtT7dH8aRnDVatuCkb
	kWFQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
	:references;
	bh=ceUAmlaId5lj72/l4p5SxWI4Tivl4sRwQkevYb2aGF4=;
	b=QAe2zSc1YF9bDYiOWtJi+5WrZWCcZhh06GcaJ1N1S8+XMzkIah5BcQEOnQGIqGsLJW
	bdX9GunUWW+2GrzuwlujY971weDGAFPvzzmcI1vTeMrMq3CFZlZk3JupGC7ECFmEgy0v
	5ti8PzxTSJ7i6CokmqO8kicfDx8GuHB04CDzsaZB3zkrfdvaJtck0PqrW0ssk0y2qzZF
	3mi4rglLAqrIGUw1wQFggBaAL7jc8FJmsvhK2dsyCERr0PI/m81ofUvI2G4YGPU8S5Qb
	aLH5E37qrqcbOgYGbpetsPWmZx6qGVgY2FkXwFq3xFu6ZM+Z+Ct7CT/V4GozyI5+N6dP
	ii7A==
X-Gm-Message-State: AG10YOTBGzlCN/qIBQMyiAnTuC/5mA5RZWmt8TveuYM84BIUgPFi5GaEGLZqHrs+EgjZ0g==
X-Received: by 10.28.127.85 with SMTP id a82mr19820943wmd.48.1453202668741;
	Tue, 19 Jan 2016 03:24:28 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	a126sm19977424wmh.0.2016.01.19.03.24.28
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Tue, 19 Jan 2016 03:24:28 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Tue, 19 Jan 2016 11:24:17 +0000
Message-Id: <1453202658-9508-2-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
In-Reply-To: <1453202658-9508-1-git-send-email-paul.durrant@citrix.com>
References: <1453202658-9508-1-git-send-email-paul.durrant@citrix.com>
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH 2/3] Remove header/data split support
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

During logo testing it became apparent that:

a) This is predicated on support VLAN ID, which is not something we really
   want in a PV driver (since the backend network may actually be a VLAN).
b) Turning on Viridian flags causes NDIS to stop enabling header/data split.
   (There's a call to NdisGetHypervisorInfo() in NdisMSetHDSplitAttributes()).

Issue a) makes it undesirable to implement and b) makes it pretty much
pointless having the code around. Hence this patch removes it.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xennet.inf        |  7 ----
 src/xennet/adapter.c  | 88 +--------------------------------------------------
 src/xennet/receiver.c | 56 +-------------------------------
 src/xennet/receiver.h |  6 ----
 4 files changed, 2 insertions(+), 155 deletions(-)

diff --git a/src/xennet.inf b/src/xennet.inf
index 31b2f64..ae194b7 100644
--- a/src/xennet.inf
+++ b/src/xennet.inf
@@ -159,13 +159,6 @@ HKR, Ndi\params\LROIPv6,                          Optional,   0, "0"
 HKR, Ndi\params\LROIPv6\enum,                     "0",        0, %Disabled%
 HKR, Ndi\params\LROIPv6\enum,                     "1",        0, %Enabled%
 
-HKR, Ndi\params\*HeaderDataSplit,                 ParamDesc,  0, %HeaderDataSplit%
-HKR, Ndi\params\*HeaderDataSplit,                 Type,       0, "enum"
-HKR, Ndi\params\*HeaderDataSplit,                 Default,    0, "0"
-HKR, Ndi\params\*HeaderDataSplit,                 Optional,   0, "0"
-HKR, Ndi\params\*HeaderDataSplit\enum,            "0",        0, %Disabled%
-HKR, Ndi\params\*HeaderDataSplit\enum,            "1",        0, %Enabled%
-
 [XenNet_Inst.Services] 
 AddService=xennet,0x02,XenNet_Service,XenNet_EventLog
 
diff --git a/src/xennet/adapter.c b/src/xennet/adapter.c
index 806b1e3..dca9b7b 100644
--- a/src/xennet/adapter.c
+++ b/src/xennet/adapter.c
@@ -60,7 +60,6 @@ typedef struct _PROPERTIES {
     int lsov6;
     int lrov4;
     int lrov6;
-    ULONG HeaderDataSplit;
 } PROPERTIES, *PPROPERTIES;
 
 struct _XENNET_ADAPTER {
@@ -139,7 +138,6 @@ static NDIS_OID XennetSupportedOids[] =
     OID_PNP_CAPABILITIES,
     OID_PNP_QUERY_POWER,
     OID_PNP_SET_POWER,
-    OID_GEN_HD_SPLIT_PARAMETERS,
 };
 
 #define ADAPTER_POOL_TAG    'AteN'
@@ -561,6 +559,7 @@ AdapterGetOffloadEncapsulation(
         TxOptions->OffloadIpVersion6UdpChecksum = 1;
 
     RxOptions = ReceiverOffloadOptions(Adapter->Receiver);
+
     RxOptions->Value = 0;
     RxOptions->OffloadTagManipulation = 1;
 
@@ -672,18 +671,6 @@ invalid_parameter:
 #undef CHANGE
 
 static NDIS_STATUS
-AdapterGetHeaderDataSplitParameters(
-    IN  PXENNET_ADAPTER             Adapter,
-    IN  PNDIS_HD_SPLIT_PARAMETERS   Split
-    )
-{
-    if (Split->HDSplitCombineFlags == NDIS_HD_SPLIT_COMBINE_ALL_HEADERS)
-        ReceiverSplitHeaderData(Adapter->Receiver, 0);
-
-    return NDIS_STATUS_SUCCESS;
-}
-
-static NDIS_STATUS
 AdapterQueryGeneralStatistics(
     IN  PXENNET_ADAPTER     Adapter,
     IN  PNDIS_STATISTICS_INFO   Info,
@@ -1693,16 +1680,6 @@ AdapterSetInformation(
         }
         break;
 
-    case OID_GEN_HD_SPLIT_PARAMETERS:
-        BytesNeeded = sizeof(NDIS_HD_SPLIT_PARAMETERS);
-        if (BufferLength >= BytesNeeded) {
-            ndisStatus = AdapterGetHeaderDataSplitParameters(Adapter,
-                                                             (PNDIS_HD_SPLIT_PARAMETERS)Buffer);
-            if (ndisStatus == NDIS_STATUS_SUCCESS)
-                BytesRead = sizeof(NDIS_HD_SPLIT_PARAMETERS);
-        }
-        break;
-
     case OID_GEN_INTERRUPT_MODERATION:
     case OID_GEN_MACHINE_NAME:
         Warn = FALSE;
@@ -2393,7 +2370,6 @@ AdapterGetAdvancedSettings(
     READ_PROPERTY(Adapter->Properties.lrov4, L"LROIPv4", 1, Handle);
     READ_PROPERTY(Adapter->Properties.lrov6, L"LROIPv6", 1, Handle);
     READ_PROPERTY(Adapter->Properties.need_csum_value, L"NeedChecksumValue", 1, Handle);
-    READ_PROPERTY(Adapter->Properties.HeaderDataSplit, L"*HeaderDataSplit", 1, Handle);
 
     NdisCloseConfiguration(Handle);
 
@@ -2678,63 +2654,6 @@ AdapterSetOffloadAttributes(
     return ndisStatus;
 }
 
-static NDIS_STATUS
-AdapterSetHeaderDataSplitAttributes(
-    IN  PXENNET_ADAPTER                                 Adapter
-    )
-{
-    NDIS_MINIPORT_ADAPTER_HARDWARE_ASSIST_ATTRIBUTES    Attribs;
-    NDIS_HD_SPLIT_ATTRIBUTES                            Split;
-    NDIS_STATUS                                         NdisStatus;
-
-    RtlZeroMemory(&Attribs, sizeof(Attribs));
-
-    Attribs.Header.Type = NDIS_OBJECT_TYPE_MINIPORT_ADAPTER_HARDWARE_ASSIST_ATTRIBUTES;
-    Attribs.Header.Revision = NDIS_MINIPORT_ADAPTER_HARDWARE_ASSIST_ATTRIBUTES_REVISION_1;
-    Attribs.Header.Size = NDIS_SIZEOF_MINIPORT_ADAPTER_HARDWARE_ASSIST_ATTRIBUTES_REVISION_1;
-
-    RtlZeroMemory(&Split, sizeof(Split));
-
-    Split.Header.Type = NDIS_OBJECT_TYPE_HD_SPLIT_ATTRIBUTES;
-    Split.Header.Revision = NDIS_HD_SPLIT_ATTRIBUTES_REVISION_1;
-    Split.Header.Size = NDIS_SIZEOF_HD_SPLIT_ATTRIBUTES_REVISION_1;
-    Split.HardwareCapabilities =
-        NDIS_HD_SPLIT_CAPS_SUPPORTS_HEADER_DATA_SPLIT |
-        NDIS_HD_SPLIT_CAPS_SUPPORTS_IPV4_OPTIONS |
-        NDIS_HD_SPLIT_CAPS_SUPPORTS_IPV6_EXTENSION_HEADERS |
-        NDIS_HD_SPLIT_CAPS_SUPPORTS_TCP_OPTIONS;
-
-    if (Adapter->Properties.HeaderDataSplit != 0)
-        Split.CurrentCapabilities = Split.HardwareCapabilities;
-
-    Attribs.HDSplitAttributes = &Split;
-
-    NdisStatus = NdisMSetMiniportAttributes(Adapter->NdisAdapterHandle,
-                                            (PNDIS_MINIPORT_ADAPTER_ATTRIBUTES)&Attribs);
-    if (NdisStatus != NDIS_STATUS_SUCCESS)
-        goto fail1;
-
-    if (Split.HDSplitFlags == NDIS_HD_SPLIT_ENABLE_HEADER_DATA_SPLIT) {
-        ASSERT(Split.CurrentCapabilities & NDIS_HD_SPLIT_CAPS_SUPPORTS_HEADER_DATA_SPLIT);
-
-        Info("BackfillSize = %u\n", Split.BackfillSize);
-        Info("MaxHeaderSize = %u\n", Split.MaxHeaderSize);
-
-        XENVIF_VIF(ReceiverSetBackfillSize,
-                   &Adapter->VifInterface,
-                   Split.BackfillSize);
-
-        ReceiverSplitHeaderData(Adapter->Receiver, Split.MaxHeaderSize);
-    }
-
-    return NDIS_STATUS_SUCCESS;
-
-fail1:
-    Error("fail1 (%08x)\n", NdisStatus);
-
-    return NdisStatus;
-}
-
 NDIS_STATUS
 AdapterInitialize(
     IN  NDIS_HANDLE         Handle,
@@ -2821,10 +2740,6 @@ AdapterInitialize(
     if (ndisStatus != NDIS_STATUS_SUCCESS)
         goto fail11;
 
-    ndisStatus = AdapterSetHeaderDataSplitAttributes(*Adapter);
-    if (ndisStatus != NDIS_STATUS_SUCCESS)
-        goto fail12;
-
     RtlZeroMemory(&Dma, sizeof(NDIS_SG_DMA_DESCRIPTION));
     Dma.Header.Type = NDIS_OBJECT_TYPE_SG_DMA_DESCRIPTION;
     Dma.Header.Revision = NDIS_SG_DMA_DESCRIPTION_REVISION_1;
@@ -2842,7 +2757,6 @@ AdapterInitialize(
 
     return NDIS_STATUS_SUCCESS;
 
-fail12:
 fail11:
 fail10:
 fail9:
diff --git a/src/xennet/receiver.c b/src/xennet/receiver.c
index 9f5ac60..08c6413 100644
--- a/src/xennet/receiver.c
+++ b/src/xennet/receiver.c
@@ -47,7 +47,6 @@ struct _XENNET_RECEIVER {
     LONG                        InNDIS;
     LONG                        InNDISMax;
     XENVIF_VIF_OFFLOAD_OPTIONS  OffloadOptions;
-    ULONG                       MaxHeaderSize;
 };
 
 #define RECEIVER_POOL_TAG       'RteN'
@@ -177,10 +176,10 @@ __ReceiverReceivePacket(
     )
 {
     PNET_BUFFER_LIST                            NetBufferList;
-    PNET_BUFFER                                 NetBuffer;
     NDIS_TCP_IP_CHECKSUM_NET_BUFFER_LIST_INFO   csumInfo;
 
     UNREFERENCED_PARAMETER(MaximumSegmentSize);
+    UNREFERENCED_PARAMETER(Info);
 
     NetBufferList = __ReceiverAllocateNetBufferList(Receiver,
                                                     Mdl,
@@ -190,8 +189,6 @@ __ReceiverReceivePacket(
     if (NetBufferList == NULL)
         goto fail1;
 
-    NetBuffer = NET_BUFFER_LIST_FIRST_NB(NetBufferList);
-
     NetBufferList->SourceHandle = AdapterGetHandle(Receiver->Adapter);
 
     csumInfo.Value = 0;
@@ -221,48 +218,6 @@ __ReceiverReceivePacket(
         NET_BUFFER_LIST_INFO(NetBufferList, Ieee8021QNetBufferListInfo) = Ieee8021QInfo.Value;
     }
 
-    if (Info->IpHeader.Offset != 0) {
-        ULONG                   NblFlags;
-        PUCHAR                  InfoVa;
-        PIP_HEADER              IpHeader;
-        NDIS_PHYSICAL_ADDRESS   DataPhysicalAddress;
-
-        NblFlags = NET_BUFFER_LIST_NBL_FLAGS(NetBufferList);
-
-        InfoVa = MmGetSystemAddressForMdlSafe(Mdl, NormalPagePriority);
-        ASSERT(InfoVa != NULL);
-        InfoVa += Offset;
-
-        IpHeader = (PIP_HEADER)(InfoVa + Info->IpHeader.Offset);
-
-        if (IpHeader->Version == 4) {
-            NblFlags |= NDIS_NBL_FLAGS_IS_IPV4;
-        } else {
-            ASSERT3U(IpHeader->Version, ==, 6);
-            NblFlags |= NDIS_NBL_FLAGS_IS_IPV6;
-        }
-
-        if (Info->TcpHeader.Offset != 0)
-            NblFlags |= NDIS_NBL_FLAGS_IS_TCP;
-        else if (Info->UdpHeader.Offset != 0)
-            NblFlags |= NDIS_NBL_FLAGS_IS_UDP;
-
-        if (Mdl->Next != NULL && Info->Length < Receiver->MaxHeaderSize) {
-            NblFlags |= NDIS_NBL_FLAGS_HD_SPLIT;
-            if (NblFlags & (NDIS_NBL_FLAGS_IS_TCP | NDIS_NBL_FLAGS_IS_UDP))
-                NblFlags |= NDIS_NBL_FLAGS_SPLIT_AT_UPPER_LAYER_PROTOCOL_PAYLOAD;
-            else
-                NblFlags |= NDIS_NBL_FLAGS_SPLIT_AT_UPPER_LAYER_PROTOCOL_HEADER;
-
-            DataPhysicalAddress.QuadPart = (ULONGLONG)MmGetMdlPfnArray(Mdl->Next)[0] << PAGE_SHIFT;
-            DataPhysicalAddress.QuadPart += Mdl->Next->ByteOffset;
-
-            NET_BUFFER_DATA_PHYSICAL_ADDRESS(NetBuffer) = DataPhysicalAddress;
-        }
-
-        NET_BUFFER_LIST_NBL_FLAGS(NetBufferList) = NblFlags;
-    }
-
     return NetBufferList;
 
 fail2:
@@ -461,12 +416,3 @@ ReceiverOffloadOptions(
 {
     return &Receiver->OffloadOptions;
 }
-
-VOID
-ReceiverSplitHeaderData(
-    IN  PXENNET_RECEIVER    Receiver,
-    IN  ULONG               MaxHeaderSize
-    )
-{
-    Receiver->MaxHeaderSize = MaxHeaderSize;
-}
diff --git a/src/xennet/receiver.h b/src/xennet/receiver.h
index fbc0151..e6b2af1 100644
--- a/src/xennet/receiver.h
+++ b/src/xennet/receiver.h
@@ -73,10 +73,4 @@ ReceiverOffloadOptions(
     IN  PXENNET_RECEIVER    Receiver
     );
 
-extern VOID
-ReceiverSplitHeaderData(
-    IN  PXENNET_RECEIVER    Receiver,
-    IN  ULONG               MaxHeaderSize
-    );
-
 #endif // _XENNET_RECEIVER_H_
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Tue Jan 19 11:24:33 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 19 Jan 2016 11:24:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aLUOn-0005nl-5w; Tue, 19 Jan 2016 11:24:33 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aLUOl-0005nD-JK
	for win-pv-devel@lists.xenproject.org; Tue, 19 Jan 2016 11:24:31 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	EC/CF-08347-EEC1E965; Tue, 19 Jan 2016 11:24:30 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1453202669!17878841!1
X-Originating-IP: [74.125.82.67]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 49781 invoked from network); 19 Jan 2016 11:24:29 -0000
Received: from mail-wm0-f67.google.com (HELO mail-wm0-f67.google.com)
	(74.125.82.67)
	by server-6.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 19 Jan 2016 11:24:29 -0000
Received: by mail-wm0-f67.google.com with SMTP id 123so15378197wmz.2
	for <win-pv-devel@lists.xenproject.org>;
	Tue, 19 Jan 2016 03:24:29 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:in-reply-to:references;
	bh=krNnA7aIg6K2cLrJpQhW9MEL2mjP0TjWF9Kz9dJ5JFs=;
	b=fr1K9pd4Tf2ByeLeF2jZk7WDPKKAxJsK7AjA5q1NYB3Va0wsmuriRBT/7acZXnuKrk
	ozLNlkHulCHbi6yN5cNFou2dbDJpcpwsedjqRQkqXJ73+1t0txmjJDBiC33SzrXQMKla
	PAZIu1qnJfx4bgmsLFh2CZN8eCyEhPYEYyOs1sx0SGMJ93O9VXvfy+Z04FYJaHp7Zm6w
	vbNJ9P2gRhdUCxj+2aLDLHs/yQbMkYG+EX75GQ4qkmhjgZQmrdu9tTt4jKL/FiA5oGHh
	k8bGAiSSKM3wvVn5FPTkNnS5Pn0Z2+WPiy++7YrM87EmaPYfOzacqAVok+yu5iQMpf8Q
	3s7g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
	:references;
	bh=krNnA7aIg6K2cLrJpQhW9MEL2mjP0TjWF9Kz9dJ5JFs=;
	b=lkzEEoFbJjcMBKYemo51xM5Mtvt9Mtu8enrGeF3Ii4hHd+Fyxo2HAxWKF/ndriSZjV
	sxqpDppvgbd7f1GCbNgrZcpn7+bGRGZakTMtA+qtEHuybKXCmANs2IltTeAWGg1Q5Awq
	RUzSBf8CiCJYDhx8cFBefwqfPkxvr7g06xVVlISY2yRX68LqzxcKwFXSbkguP9m5XpVf
	goJkPIu3GMWQRRrAnNlhwZmfrzgirN0xukgRr7TDbuamUYG2A4QFemDTxKyNPcaOsnca
	l0FPrNaGN8+/sFOon4OAK+nRKGlDYQeqh9fMAwBLCgPlqoHJaBK8w5VZgM+ldp6142NG
	W/fA==
X-Gm-Message-State: AG10YOT96u9SKrp+JpPVWl+tCcKBBEInJMXNwe4Hwkzi47+ry6syezrFo12dC+oTq2fDyg==
X-Received: by 10.28.153.148 with SMTP id b142mr19705284wme.5.1453202669592;
	Tue, 19 Jan 2016 03:24:29 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	a126sm19977424wmh.0.2016.01.19.03.24.28
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Tue, 19 Jan 2016 03:24:29 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Tue, 19 Jan 2016 11:24:18 +0000
Message-Id: <1453202658-9508-3-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
In-Reply-To: <1453202658-9508-1-git-send-email-paul.durrant@citrix.com>
References: <1453202658-9508-1-git-send-email-paul.durrant@citrix.com>
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH 3/3] Make transmitter robust against a
	possible completion race
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

It's possible that a transmission invoked on one CPU may complete on another
before the transmission invocation as finished. Therefore, once we have queued
a NET_BUFFER for transmission we should not use it's metadata again (including
the 'next' pointer).

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xennet/receiver.c    | 2 ++
 src/xennet/transmitter.c | 5 +++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/xennet/receiver.c b/src/xennet/receiver.c
index 08c6413..863dbd7 100644
--- a/src/xennet/receiver.c
+++ b/src/xennet/receiver.c
@@ -89,6 +89,8 @@ __ReceiverAllocateNetBufferList(
         NET_BUFFER_DATA_OFFSET(NetBuffer) = Offset;
         NET_BUFFER_DATA_LENGTH(NetBuffer) = Length;
         NET_BUFFER_CURRENT_MDL_OFFSET(NetBuffer) = Offset;
+
+        ASSERT3P(NET_BUFFER_NEXT_NB(NetBuffer), ==, NULL);
     } else {
         NetBufferList = NdisAllocateNetBufferAndNetBufferList(Receiver->NetBufferListPool,
                                                               0,
diff --git a/src/xennet/transmitter.c b/src/xennet/transmitter.c
index b5e110a..91ed5f2 100644
--- a/src/xennet/transmitter.c
+++ b/src/xennet/transmitter.c
@@ -250,11 +250,12 @@ TransmitterSendNetBufferLists(
 
         NetBuffer = NET_BUFFER_LIST_FIRST_NB(NetBufferList);
         while (NetBuffer != NULL) {
+            PNET_BUFFER         NetBufferListNext = NET_BUFFER_NEXT_NB(NetBuffer);
             PVOID               Cookie = NetBufferList;
             XENVIF_PACKET_HASH  Hash;
             NTSTATUS            status;
 
-            ListReserved->Reference++;
+            InterlockedIncrement(&ListReserved->Reference);
 
             Hash.Algorithm = XENVIF_PACKET_HASH_ALGORITHM_NONE;
 
@@ -274,7 +275,7 @@ TransmitterSendNetBufferLists(
                 break;
             }
 
-            NetBuffer = NET_BUFFER_NEXT_NB(NetBuffer);
+            NetBuffer = NetBufferListNext;
         }
 
         NetBufferList = ListNext;
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Tue Jan 19 11:24:33 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 19 Jan 2016 11:24:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aLUOn-0005nl-5w; Tue, 19 Jan 2016 11:24:33 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aLUOl-0005nD-JK
	for win-pv-devel@lists.xenproject.org; Tue, 19 Jan 2016 11:24:31 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	EC/CF-08347-EEC1E965; Tue, 19 Jan 2016 11:24:30 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1453202669!17878841!1
X-Originating-IP: [74.125.82.67]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 49781 invoked from network); 19 Jan 2016 11:24:29 -0000
Received: from mail-wm0-f67.google.com (HELO mail-wm0-f67.google.com)
	(74.125.82.67)
	by server-6.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 19 Jan 2016 11:24:29 -0000
Received: by mail-wm0-f67.google.com with SMTP id 123so15378197wmz.2
	for <win-pv-devel@lists.xenproject.org>;
	Tue, 19 Jan 2016 03:24:29 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:in-reply-to:references;
	bh=krNnA7aIg6K2cLrJpQhW9MEL2mjP0TjWF9Kz9dJ5JFs=;
	b=fr1K9pd4Tf2ByeLeF2jZk7WDPKKAxJsK7AjA5q1NYB3Va0wsmuriRBT/7acZXnuKrk
	ozLNlkHulCHbi6yN5cNFou2dbDJpcpwsedjqRQkqXJ73+1t0txmjJDBiC33SzrXQMKla
	PAZIu1qnJfx4bgmsLFh2CZN8eCyEhPYEYyOs1sx0SGMJ93O9VXvfy+Z04FYJaHp7Zm6w
	vbNJ9P2gRhdUCxj+2aLDLHs/yQbMkYG+EX75GQ4qkmhjgZQmrdu9tTt4jKL/FiA5oGHh
	k8bGAiSSKM3wvVn5FPTkNnS5Pn0Z2+WPiy++7YrM87EmaPYfOzacqAVok+yu5iQMpf8Q
	3s7g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
	:references;
	bh=krNnA7aIg6K2cLrJpQhW9MEL2mjP0TjWF9Kz9dJ5JFs=;
	b=lkzEEoFbJjcMBKYemo51xM5Mtvt9Mtu8enrGeF3Ii4hHd+Fyxo2HAxWKF/ndriSZjV
	sxqpDppvgbd7f1GCbNgrZcpn7+bGRGZakTMtA+qtEHuybKXCmANs2IltTeAWGg1Q5Awq
	RUzSBf8CiCJYDhx8cFBefwqfPkxvr7g06xVVlISY2yRX68LqzxcKwFXSbkguP9m5XpVf
	goJkPIu3GMWQRRrAnNlhwZmfrzgirN0xukgRr7TDbuamUYG2A4QFemDTxKyNPcaOsnca
	l0FPrNaGN8+/sFOon4OAK+nRKGlDYQeqh9fMAwBLCgPlqoHJaBK8w5VZgM+ldp6142NG
	W/fA==
X-Gm-Message-State: AG10YOT96u9SKrp+JpPVWl+tCcKBBEInJMXNwe4Hwkzi47+ry6syezrFo12dC+oTq2fDyg==
X-Received: by 10.28.153.148 with SMTP id b142mr19705284wme.5.1453202669592;
	Tue, 19 Jan 2016 03:24:29 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	a126sm19977424wmh.0.2016.01.19.03.24.28
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Tue, 19 Jan 2016 03:24:29 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Tue, 19 Jan 2016 11:24:18 +0000
Message-Id: <1453202658-9508-3-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
In-Reply-To: <1453202658-9508-1-git-send-email-paul.durrant@citrix.com>
References: <1453202658-9508-1-git-send-email-paul.durrant@citrix.com>
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH 3/3] Make transmitter robust against a
	possible completion race
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

It's possible that a transmission invoked on one CPU may complete on another
before the transmission invocation as finished. Therefore, once we have queued
a NET_BUFFER for transmission we should not use it's metadata again (including
the 'next' pointer).

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xennet/receiver.c    | 2 ++
 src/xennet/transmitter.c | 5 +++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/xennet/receiver.c b/src/xennet/receiver.c
index 08c6413..863dbd7 100644
--- a/src/xennet/receiver.c
+++ b/src/xennet/receiver.c
@@ -89,6 +89,8 @@ __ReceiverAllocateNetBufferList(
         NET_BUFFER_DATA_OFFSET(NetBuffer) = Offset;
         NET_BUFFER_DATA_LENGTH(NetBuffer) = Length;
         NET_BUFFER_CURRENT_MDL_OFFSET(NetBuffer) = Offset;
+
+        ASSERT3P(NET_BUFFER_NEXT_NB(NetBuffer), ==, NULL);
     } else {
         NetBufferList = NdisAllocateNetBufferAndNetBufferList(Receiver->NetBufferListPool,
                                                               0,
diff --git a/src/xennet/transmitter.c b/src/xennet/transmitter.c
index b5e110a..91ed5f2 100644
--- a/src/xennet/transmitter.c
+++ b/src/xennet/transmitter.c
@@ -250,11 +250,12 @@ TransmitterSendNetBufferLists(
 
         NetBuffer = NET_BUFFER_LIST_FIRST_NB(NetBufferList);
         while (NetBuffer != NULL) {
+            PNET_BUFFER         NetBufferListNext = NET_BUFFER_NEXT_NB(NetBuffer);
             PVOID               Cookie = NetBufferList;
             XENVIF_PACKET_HASH  Hash;
             NTSTATUS            status;
 
-            ListReserved->Reference++;
+            InterlockedIncrement(&ListReserved->Reference);
 
             Hash.Algorithm = XENVIF_PACKET_HASH_ALGORITHM_NONE;
 
@@ -274,7 +275,7 @@ TransmitterSendNetBufferLists(
                 break;
             }
 
-            NetBuffer = NET_BUFFER_NEXT_NB(NetBuffer);
+            NetBuffer = NetBufferListNext;
         }
 
         NetBufferList = ListNext;
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Thu Jan 21 10:07:37 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 21 Jan 2016 10:07:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aMC9Q-0007pZ-1l; Thu, 21 Jan 2016 10:07:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <fabio.fantoni@m2r.biz>) id 1aMC9O-0007pP-MP
	for win-pv-devel@lists.xenproject.org; Thu, 21 Jan 2016 10:07:35 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	93/6D-03225-5EDA0A65; Thu, 21 Jan 2016 10:07:33 +0000
X-Env-Sender: fabio.fantoni@m2r.biz
X-Msg-Ref: server-7.tower-206.messagelabs.com!1453370853!16967893!1
X-Originating-IP: [74.125.82.52]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 42043 invoked from network); 21 Jan 2016 10:07:33 -0000
Received: from mail-wm0-f52.google.com (HELO mail-wm0-f52.google.com)
	(74.125.82.52)
	by server-7.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 21 Jan 2016 10:07:33 -0000
Received: by mail-wm0-f52.google.com with SMTP id u188so219312987wmu.1
	for <win-pv-devel@lists.xenproject.org>;
	Thu, 21 Jan 2016 02:07:33 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=m2r-biz.20150623.gappssmtp.com; s=20150623;
	h=subject:to:references:cc:from:message-id:date:user-agent
	:mime-version:in-reply-to:content-type:content-transfer-encoding;
	bh=tSqRpcg/PBYSwHfp65YYadrxIaq7Uv5iab7KUscDyvU=;
	b=NJ4ECK7WIjF823PlOlCALlPbZWMh7YJnnrzLhDwoLN57egZ7WpXvkTDcjZc7f3pe0p
	U8oKO0k7dtJcqMsnBgJTtvClq224wjOU4LUSfuWsf7Q4zacDcTNonnX8s1WIGmTAAeht
	OsR/kABDTdPFgmSnuR95JKSs7/fuXiM0FvnMadMdwwq1hLr+wXCaP7l17fF81ZL+7oiS
	uee5vYEbe0lo2JYzx1s2OGbXCMaeHMh7v0lg9SvZa65/cp6zy7J3C7aunwEeVzQQdC7c
	GhwgAOQ1W7GtBpnk2v2rNF6VHDHq4ybBlD+j1BhojLrLom62Wa11Ky6SnVmzTmw0HCVG
	F03g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:subject:to:references:cc:from:message-id:date
	:user-agent:mime-version:in-reply-to:content-type
	:content-transfer-encoding;
	bh=tSqRpcg/PBYSwHfp65YYadrxIaq7Uv5iab7KUscDyvU=;
	b=aWVCmDE2kocw/AMZW7zfgi36gHJAW4iLfFC37ZUxLEd7rEV9ckGMYT7HMf5JRn8KD1
	ZpQWTvJ31kvJwdP5B/h5jKBrrDuxc7oOxDLpS49LD1GSImn0Fv8WLvUd+XnTnx9k1QGJ
	YKpxbVou0/OcuQFtB/hKdPWxQZdjcPSs72yn0Aq/d8ioB7xe75UuQ3UHi2HFY5ssTRth
	9Dtyj4vvXgv8O2jRb+T/iCB8oRGbp/Io14UPZwkrPtpnEFVPBebg/xQ5bhw60wsTPI3e
	vyP9CAe7JfD4PsAP5qpqDm0GRPM2ovGAhJuYS/uzajBT5rTNEBg+sbUEot2FkqWHPAd3
	0ExQ==
X-Gm-Message-State: AG10YOSvq0ra9tb7CMiC3sQHCzXEyZBiynVW6Yh73E3fNB8+Unr/CQNyaLUQ77YMvcgB6A==
X-Received: by 10.194.61.111 with SMTP id o15mr20696640wjr.104.1453370832053; 
	Thu, 21 Jan 2016 02:07:12 -0800 (PST)
Received: from [192.168.1.25] (ip-73-126.sn2.clouditalia.com. [83.211.73.126])
	by smtp.googlemail.com with ESMTPSA id
	df10sm652203wjb.44.2016.01.21.02.07.10
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 21 Jan 2016 02:07:11 -0800 (PST)
To: Paul Durrant <Paul.Durrant@citrix.com>, =?UTF-8?B?w4lsacOhcyBUYW3DoXM=?=
	<et@etit.hu>, "xen-users@lists.xen.org" <xen-users@lists.xen.org>,
	"win-pv-devel@lists.xenproject.org" <win-pv-devel@lists.xenproject.org>
References: <565C293A.5030705@etit.hu>
	<9AAE0902D5BC7E449B7C8E4E778ABCD02F69F9FD@AMSPEX01CL01.citrite.net>
	<56701DDF.4000008@m2r.biz>
	<9AAE0902D5BC7E449B7C8E4E778ABCD02F6E9CE3@AMSPEX01CL01.citrite.net>
From: Fabio Fantoni <fabio.fantoni@m2r.biz>
Message-ID: <56A0AE00.8080501@m2r.biz>
Date: Thu, 21 Jan 2016 11:08:00 +0100
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101
	Thunderbird/38.5.1
MIME-Version: 1.0
In-Reply-To: <9AAE0902D5BC7E449B7C8E4E778ABCD02F6E9CE3@AMSPEX01CL01.citrite.net>
Content-Length: 2268
Cc: "Lars Kurth \(lars.kurth@xen.org\)" <lars.kurth@xen.org>
Subject: Re: [win-pv-devel] Windows 10 upgrade to new build with testsigning
 on -> FAIL
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="iso-8859-2"; Format="flowed"
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Il 15/12/2015 15:49, Paul Durrant ha scritto:
>> -----Original Message-----
> [snip]
>>> I believe Lars is working on this. We intend to get an EV cert for Xen =
Project
>> and release-sign (not logo-sign) drivers through the new Windows 10 port=
al. I
>> have updated the staging-8.1 branches recently and re-tagged them with
>> new rc numbers... I'll adjust the Jenkins projects today to deliver new =
builds
>> of these branches to xenbits. My hope is that these are likely to be the=
 final
>> rcs.
>>>     Paul
>> Sorry for bother you, is there any news about the signed builds please?
>>
> Fabio,
>
>    I believe Lars now has Advisory Board approval to purchase the EV cert=
 and I hope this means we should be able to acquire it immediately after th=
e holiday season.
>    As for the code, I have just re-tagged the staging-8.1 branches after =
some more fixes for issues found in testing (new builds are available on xe=
nbits) and I'm not anticipating any more tags now. Once we have the EV cert=
, I will sign the builds via the Microsoft portal and formally release vers=
ion 8.1.0 of all drivers.
>
>    Cheers,
>
>      Paul

Sorry for bother you, is there any news please?



>
>> Thanks for any reply and sorry for my bad english.
>>
>>>> --
>>>>
>>>>
>>>> =C9li=E1s Tam=E1s
>>>> Thomas Elias
>>>>
>>>> ETIT[nwpro] KFT, =DCgyvezet=F5-H=E1l=F3zatbiztons=E1gi specialista
>>>> ETIT[nwpro] Ltd, General Manager-Network security specialist
>>>>
>>>> Tel. HU: +36/30-497-1626
>>>> Tel. DE: +49/160-651-8723
>>>> OpenPGP pubkey: http://etit.hu/doc/et-pub.asc
>>>>
>>>> Okleveles m=E9rn=F6k-informatikus (MSC)
>>>> Master of Science in Information Technology (MSC)
>>>>
>>>> Kapcsolat: http://etit.hu/index.php/hu/kapcsolat
>>>> Jogi nyilatkozat: http://etit.hu/disclaimer-email-hu.txt
>>>> Contact: http://etit.hu/index.php/en/contact
>>>> Disclaimer: http://etit.hu/disclaimer-email-en.txt
>>> _______________________________________________
>>> win-pv-devel mailing list
>>> win-pv-devel@lists.xenproject.org
>>> http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Thu Jan 21 10:07:37 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 21 Jan 2016 10:07:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aMC9Q-0007pZ-1l; Thu, 21 Jan 2016 10:07:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <fabio.fantoni@m2r.biz>) id 1aMC9O-0007pP-MP
	for win-pv-devel@lists.xenproject.org; Thu, 21 Jan 2016 10:07:35 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	93/6D-03225-5EDA0A65; Thu, 21 Jan 2016 10:07:33 +0000
X-Env-Sender: fabio.fantoni@m2r.biz
X-Msg-Ref: server-7.tower-206.messagelabs.com!1453370853!16967893!1
X-Originating-IP: [74.125.82.52]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 42043 invoked from network); 21 Jan 2016 10:07:33 -0000
Received: from mail-wm0-f52.google.com (HELO mail-wm0-f52.google.com)
	(74.125.82.52)
	by server-7.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 21 Jan 2016 10:07:33 -0000
Received: by mail-wm0-f52.google.com with SMTP id u188so219312987wmu.1
	for <win-pv-devel@lists.xenproject.org>;
	Thu, 21 Jan 2016 02:07:33 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=m2r-biz.20150623.gappssmtp.com; s=20150623;
	h=subject:to:references:cc:from:message-id:date:user-agent
	:mime-version:in-reply-to:content-type:content-transfer-encoding;
	bh=tSqRpcg/PBYSwHfp65YYadrxIaq7Uv5iab7KUscDyvU=;
	b=NJ4ECK7WIjF823PlOlCALlPbZWMh7YJnnrzLhDwoLN57egZ7WpXvkTDcjZc7f3pe0p
	U8oKO0k7dtJcqMsnBgJTtvClq224wjOU4LUSfuWsf7Q4zacDcTNonnX8s1WIGmTAAeht
	OsR/kABDTdPFgmSnuR95JKSs7/fuXiM0FvnMadMdwwq1hLr+wXCaP7l17fF81ZL+7oiS
	uee5vYEbe0lo2JYzx1s2OGbXCMaeHMh7v0lg9SvZa65/cp6zy7J3C7aunwEeVzQQdC7c
	GhwgAOQ1W7GtBpnk2v2rNF6VHDHq4ybBlD+j1BhojLrLom62Wa11Ky6SnVmzTmw0HCVG
	F03g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:subject:to:references:cc:from:message-id:date
	:user-agent:mime-version:in-reply-to:content-type
	:content-transfer-encoding;
	bh=tSqRpcg/PBYSwHfp65YYadrxIaq7Uv5iab7KUscDyvU=;
	b=aWVCmDE2kocw/AMZW7zfgi36gHJAW4iLfFC37ZUxLEd7rEV9ckGMYT7HMf5JRn8KD1
	ZpQWTvJ31kvJwdP5B/h5jKBrrDuxc7oOxDLpS49LD1GSImn0Fv8WLvUd+XnTnx9k1QGJ
	YKpxbVou0/OcuQFtB/hKdPWxQZdjcPSs72yn0Aq/d8ioB7xe75UuQ3UHi2HFY5ssTRth
	9Dtyj4vvXgv8O2jRb+T/iCB8oRGbp/Io14UPZwkrPtpnEFVPBebg/xQ5bhw60wsTPI3e
	vyP9CAe7JfD4PsAP5qpqDm0GRPM2ovGAhJuYS/uzajBT5rTNEBg+sbUEot2FkqWHPAd3
	0ExQ==
X-Gm-Message-State: AG10YOSvq0ra9tb7CMiC3sQHCzXEyZBiynVW6Yh73E3fNB8+Unr/CQNyaLUQ77YMvcgB6A==
X-Received: by 10.194.61.111 with SMTP id o15mr20696640wjr.104.1453370832053; 
	Thu, 21 Jan 2016 02:07:12 -0800 (PST)
Received: from [192.168.1.25] (ip-73-126.sn2.clouditalia.com. [83.211.73.126])
	by smtp.googlemail.com with ESMTPSA id
	df10sm652203wjb.44.2016.01.21.02.07.10
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 21 Jan 2016 02:07:11 -0800 (PST)
To: Paul Durrant <Paul.Durrant@citrix.com>, =?UTF-8?B?w4lsacOhcyBUYW3DoXM=?=
	<et@etit.hu>, "xen-users@lists.xen.org" <xen-users@lists.xen.org>,
	"win-pv-devel@lists.xenproject.org" <win-pv-devel@lists.xenproject.org>
References: <565C293A.5030705@etit.hu>
	<9AAE0902D5BC7E449B7C8E4E778ABCD02F69F9FD@AMSPEX01CL01.citrite.net>
	<56701DDF.4000008@m2r.biz>
	<9AAE0902D5BC7E449B7C8E4E778ABCD02F6E9CE3@AMSPEX01CL01.citrite.net>
From: Fabio Fantoni <fabio.fantoni@m2r.biz>
Message-ID: <56A0AE00.8080501@m2r.biz>
Date: Thu, 21 Jan 2016 11:08:00 +0100
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101
	Thunderbird/38.5.1
MIME-Version: 1.0
In-Reply-To: <9AAE0902D5BC7E449B7C8E4E778ABCD02F6E9CE3@AMSPEX01CL01.citrite.net>
Content-Length: 2268
Cc: "Lars Kurth \(lars.kurth@xen.org\)" <lars.kurth@xen.org>
Subject: Re: [win-pv-devel] Windows 10 upgrade to new build with testsigning
 on -> FAIL
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="iso-8859-2"; Format="flowed"
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Il 15/12/2015 15:49, Paul Durrant ha scritto:
>> -----Original Message-----
> [snip]
>>> I believe Lars is working on this. We intend to get an EV cert for Xen =
Project
>> and release-sign (not logo-sign) drivers through the new Windows 10 port=
al. I
>> have updated the staging-8.1 branches recently and re-tagged them with
>> new rc numbers... I'll adjust the Jenkins projects today to deliver new =
builds
>> of these branches to xenbits. My hope is that these are likely to be the=
 final
>> rcs.
>>>     Paul
>> Sorry for bother you, is there any news about the signed builds please?
>>
> Fabio,
>
>    I believe Lars now has Advisory Board approval to purchase the EV cert=
 and I hope this means we should be able to acquire it immediately after th=
e holiday season.
>    As for the code, I have just re-tagged the staging-8.1 branches after =
some more fixes for issues found in testing (new builds are available on xe=
nbits) and I'm not anticipating any more tags now. Once we have the EV cert=
, I will sign the builds via the Microsoft portal and formally release vers=
ion 8.1.0 of all drivers.
>
>    Cheers,
>
>      Paul

Sorry for bother you, is there any news please?



>
>> Thanks for any reply and sorry for my bad english.
>>
>>>> --
>>>>
>>>>
>>>> =C9li=E1s Tam=E1s
>>>> Thomas Elias
>>>>
>>>> ETIT[nwpro] KFT, =DCgyvezet=F5-H=E1l=F3zatbiztons=E1gi specialista
>>>> ETIT[nwpro] Ltd, General Manager-Network security specialist
>>>>
>>>> Tel. HU: +36/30-497-1626
>>>> Tel. DE: +49/160-651-8723
>>>> OpenPGP pubkey: http://etit.hu/doc/et-pub.asc
>>>>
>>>> Okleveles m=E9rn=F6k-informatikus (MSC)
>>>> Master of Science in Information Technology (MSC)
>>>>
>>>> Kapcsolat: http://etit.hu/index.php/hu/kapcsolat
>>>> Jogi nyilatkozat: http://etit.hu/disclaimer-email-hu.txt
>>>> Contact: http://etit.hu/index.php/en/contact
>>>> Disclaimer: http://etit.hu/disclaimer-email-en.txt
>>> _______________________________________________
>>> win-pv-devel mailing list
>>> win-pv-devel@lists.xenproject.org
>>> http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Thu Jan 21 11:42:31 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 21 Jan 2016 11:42:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aMDdH-0007V0-Q9; Thu, 21 Jan 2016 11:42:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=821dd03bf=Paul.Durrant@citrix.com>)
	id 1aMDdF-0007Uk-Hk
	for win-pv-devel@lists.xenproject.org; Thu, 21 Jan 2016 11:42:29 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	CC/BC-08977-424C0A65; Thu, 21 Jan 2016 11:42:28 +0000
X-Env-Sender: prvs=821dd03bf=Paul.Durrant@citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1453376542!11447770!1
X-Originating-IP: [185.25.65.24]
X-SpamReason: No, hits=1.7 required=7.0 tests=BIZ_TLD,received_headers: 
	No Received headers
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 40738 invoked from network); 21 Jan 2016 11:42:27 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (185.25.65.24)
	by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Jan 2016 11:42:27 -0000
X-IronPort-AV: E=Sophos;i="5.22,325,1449532800"; d="scan'208";a="12993952"
From: Paul Durrant <Paul.Durrant@citrix.com>
To: Fabio Fantoni <fabio.fantoni@m2r.biz>, =?iso-8859-2?Q?=C9li=E1s_Tam=E1s?=
	<et@etit.hu>, "xen-users@lists.xen.org" <xen-users@lists.xen.org>,
	"win-pv-devel@lists.xenproject.org" <win-pv-devel@lists.xenproject.org>
Thread-Topic: [win-pv-devel] Windows 10 upgrade to new build with testsigning
	on -> FAIL
Thread-Index: AQHRN0GdA7LRrQqBE0yh1/tD1ldGRZ7MFQ3QgDnS4wCAACrSwA==
Date: Thu, 21 Jan 2016 11:42:20 +0000
Message-ID: <a856fceb0ecb4aa2ae583dcb1a83862d@AMSPEX02CL03.citrite.net>
References: <565C293A.5030705@etit.hu>
	<9AAE0902D5BC7E449B7C8E4E778ABCD02F69F9FD@AMSPEX01CL01.citrite.net>
	<56701DDF.4000008@m2r.biz>
	<9AAE0902D5BC7E449B7C8E4E778ABCD02F6E9CE3@AMSPEX01CL01.citrite.net>
	<56A0AE00.8080501@m2r.biz>
In-Reply-To: <56A0AE00.8080501@m2r.biz>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ms-exchange-transport-fromentityheader: Hosted
MIME-Version: 1.0
X-DLP: AMS1
Cc: "Lars Kurth \(lars.kurth@xen.org\)" <lars.kurth@xen.org>
Subject: Re: [win-pv-devel] Windows 10 upgrade to new build with testsigning
 on -> FAIL
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

> -----Original Message-----
> From: Fabio Fantoni [mailto:fabio.fantoni@m2r.biz]
> Sent: 21 January 2016 10:08
> To: Paul Durrant; =C9li=E1s Tam=E1s; xen-users@lists.xen.org; win-pv-
> devel@lists.xenproject.org
> Cc: Lars Kurth (lars.kurth@xen.org)
> Subject: Re: [win-pv-devel] Windows 10 upgrade to new build with
> testsigning on -> FAIL
> =

> Il 15/12/2015 15:49, Paul Durrant ha scritto:
> >> -----Original Message-----
> > [snip]
> >>> I believe Lars is working on this. We intend to get an EV cert for Xen
> Project
> >> and release-sign (not logo-sign) drivers through the new Windows 10
> portal. I
> >> have updated the staging-8.1 branches recently and re-tagged them with
> >> new rc numbers... I'll adjust the Jenkins projects today to deliver new
> builds
> >> of these branches to xenbits. My hope is that these are likely to be t=
he
> final
> >> rcs.
> >>>     Paul
> >> Sorry for bother you, is there any news about the signed builds please?
> >>
> > Fabio,
> >
> >    I believe Lars now has Advisory Board approval to purchase the EV ce=
rt
> and I hope this means we should be able to acquire it immediately after t=
he
> holiday season.
> >    As for the code, I have just re-tagged the staging-8.1 branches afte=
r some
> more fixes for issues found in testing (new builds are available on xenbi=
ts)
> and I'm not anticipating any more tags now. Once we have the EV cert, I w=
ill
> sign the builds via the Microsoft portal and formally release version 8.1=
.0 of
> all drivers.
> >
> >    Cheers,
> >
> >      Paul
> =

> Sorry for bother you, is there any news please?
> =


Actually there is! I received the EV signing token purchased by the Xen Pro=
ject yesterday and will be looking to sign and release version 8.1 of all d=
rivers in the very near future.

  Paul

> =

> =

> >
> >> Thanks for any reply and sorry for my bad english.
> >>
> >>>> --
> >>>>
> >>>>
> >>>> =C9li=E1s Tam=E1s
> >>>> Thomas Elias
> >>>>
> >>>> ETIT[nwpro] KFT, =DCgyvezet=F5-H=E1l=F3zatbiztons=E1gi specialista
> >>>> ETIT[nwpro] Ltd, General Manager-Network security specialist
> >>>>
> >>>> Tel. HU: +36/30-497-1626
> >>>> Tel. DE: +49/160-651-8723
> >>>> OpenPGP pubkey: http://etit.hu/doc/et-pub.asc
> >>>>
> >>>> Okleveles m=E9rn=F6k-informatikus (MSC)
> >>>> Master of Science in Information Technology (MSC)
> >>>>
> >>>> Kapcsolat: http://etit.hu/index.php/hu/kapcsolat
> >>>> Jogi nyilatkozat: http://etit.hu/disclaimer-email-hu.txt
> >>>> Contact: http://etit.hu/index.php/en/contact
> >>>> Disclaimer: http://etit.hu/disclaimer-email-en.txt
> >>> _______________________________________________
> >>> win-pv-devel mailing list
> >>> win-pv-devel@lists.xenproject.org
> >>> http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Thu Jan 21 11:42:31 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 21 Jan 2016 11:42:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aMDdH-0007V0-Q9; Thu, 21 Jan 2016 11:42:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=821dd03bf=Paul.Durrant@citrix.com>)
	id 1aMDdF-0007Uk-Hk
	for win-pv-devel@lists.xenproject.org; Thu, 21 Jan 2016 11:42:29 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	CC/BC-08977-424C0A65; Thu, 21 Jan 2016 11:42:28 +0000
X-Env-Sender: prvs=821dd03bf=Paul.Durrant@citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1453376542!11447770!1
X-Originating-IP: [185.25.65.24]
X-SpamReason: No, hits=1.7 required=7.0 tests=BIZ_TLD,received_headers: 
	No Received headers
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 40738 invoked from network); 21 Jan 2016 11:42:27 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (185.25.65.24)
	by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Jan 2016 11:42:27 -0000
X-IronPort-AV: E=Sophos;i="5.22,325,1449532800"; d="scan'208";a="12993952"
From: Paul Durrant <Paul.Durrant@citrix.com>
To: Fabio Fantoni <fabio.fantoni@m2r.biz>, =?iso-8859-2?Q?=C9li=E1s_Tam=E1s?=
	<et@etit.hu>, "xen-users@lists.xen.org" <xen-users@lists.xen.org>,
	"win-pv-devel@lists.xenproject.org" <win-pv-devel@lists.xenproject.org>
Thread-Topic: [win-pv-devel] Windows 10 upgrade to new build with testsigning
	on -> FAIL
Thread-Index: AQHRN0GdA7LRrQqBE0yh1/tD1ldGRZ7MFQ3QgDnS4wCAACrSwA==
Date: Thu, 21 Jan 2016 11:42:20 +0000
Message-ID: <a856fceb0ecb4aa2ae583dcb1a83862d@AMSPEX02CL03.citrite.net>
References: <565C293A.5030705@etit.hu>
	<9AAE0902D5BC7E449B7C8E4E778ABCD02F69F9FD@AMSPEX01CL01.citrite.net>
	<56701DDF.4000008@m2r.biz>
	<9AAE0902D5BC7E449B7C8E4E778ABCD02F6E9CE3@AMSPEX01CL01.citrite.net>
	<56A0AE00.8080501@m2r.biz>
In-Reply-To: <56A0AE00.8080501@m2r.biz>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ms-exchange-transport-fromentityheader: Hosted
MIME-Version: 1.0
X-DLP: AMS1
Cc: "Lars Kurth \(lars.kurth@xen.org\)" <lars.kurth@xen.org>
Subject: Re: [win-pv-devel] Windows 10 upgrade to new build with testsigning
 on -> FAIL
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

> -----Original Message-----
> From: Fabio Fantoni [mailto:fabio.fantoni@m2r.biz]
> Sent: 21 January 2016 10:08
> To: Paul Durrant; =C9li=E1s Tam=E1s; xen-users@lists.xen.org; win-pv-
> devel@lists.xenproject.org
> Cc: Lars Kurth (lars.kurth@xen.org)
> Subject: Re: [win-pv-devel] Windows 10 upgrade to new build with
> testsigning on -> FAIL
> =

> Il 15/12/2015 15:49, Paul Durrant ha scritto:
> >> -----Original Message-----
> > [snip]
> >>> I believe Lars is working on this. We intend to get an EV cert for Xen
> Project
> >> and release-sign (not logo-sign) drivers through the new Windows 10
> portal. I
> >> have updated the staging-8.1 branches recently and re-tagged them with
> >> new rc numbers... I'll adjust the Jenkins projects today to deliver new
> builds
> >> of these branches to xenbits. My hope is that these are likely to be t=
he
> final
> >> rcs.
> >>>     Paul
> >> Sorry for bother you, is there any news about the signed builds please?
> >>
> > Fabio,
> >
> >    I believe Lars now has Advisory Board approval to purchase the EV ce=
rt
> and I hope this means we should be able to acquire it immediately after t=
he
> holiday season.
> >    As for the code, I have just re-tagged the staging-8.1 branches afte=
r some
> more fixes for issues found in testing (new builds are available on xenbi=
ts)
> and I'm not anticipating any more tags now. Once we have the EV cert, I w=
ill
> sign the builds via the Microsoft portal and formally release version 8.1=
.0 of
> all drivers.
> >
> >    Cheers,
> >
> >      Paul
> =

> Sorry for bother you, is there any news please?
> =


Actually there is! I received the EV signing token purchased by the Xen Pro=
ject yesterday and will be looking to sign and release version 8.1 of all d=
rivers in the very near future.

  Paul

> =

> =

> >
> >> Thanks for any reply and sorry for my bad english.
> >>
> >>>> --
> >>>>
> >>>>
> >>>> =C9li=E1s Tam=E1s
> >>>> Thomas Elias
> >>>>
> >>>> ETIT[nwpro] KFT, =DCgyvezet=F5-H=E1l=F3zatbiztons=E1gi specialista
> >>>> ETIT[nwpro] Ltd, General Manager-Network security specialist
> >>>>
> >>>> Tel. HU: +36/30-497-1626
> >>>> Tel. DE: +49/160-651-8723
> >>>> OpenPGP pubkey: http://etit.hu/doc/et-pub.asc
> >>>>
> >>>> Okleveles m=E9rn=F6k-informatikus (MSC)
> >>>> Master of Science in Information Technology (MSC)
> >>>>
> >>>> Kapcsolat: http://etit.hu/index.php/hu/kapcsolat
> >>>> Jogi nyilatkozat: http://etit.hu/disclaimer-email-hu.txt
> >>>> Contact: http://etit.hu/index.php/en/contact
> >>>> Disclaimer: http://etit.hu/disclaimer-email-en.txt
> >>> _______________________________________________
> >>> win-pv-devel mailing list
> >>> win-pv-devel@lists.xenproject.org
> >>> http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Thu Jan 21 11:52:02 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 21 Jan 2016 11:52:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aMDmU-00005Z-0Y; Thu, 21 Jan 2016 11:52:02 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aMDmS-00005H-CB
	for win-pv-devel@lists.xenproject.org; Thu, 21 Jan 2016 11:52:00 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	A6/A9-08977-F56C0A65; Thu, 21 Jan 2016 11:51:59 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1453377110!11450498!1
X-Originating-IP: [74.125.82.49]
X-SpamReason: No, hits=0.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6635 invoked from network); 21 Jan 2016 11:51:55 -0000
Received: from mail-wm0-f49.google.com (HELO mail-wm0-f49.google.com)
	(74.125.82.49)
	by server-7.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 21 Jan 2016 11:51:55 -0000
Received: by mail-wm0-f49.google.com with SMTP id b14so76483504wmb.1
	for <win-pv-devel@lists.xenproject.org>;
	Thu, 21 Jan 2016 03:51:55 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=OTfRVipDw4eSlHPpPP5ryCKgGGlW1HO+dqtRcg0VPLY=;
	b=xY4MJbqnhxs5yXDl5IkBD/wXLvrLvxHBKY9E7K4xFCKug+R+lj2ToKtM1gOn2MzDSA
	CEVL0d4fWdpCA16i/XXvxBJ1N/5jkGugZRv4LOefCQEgF5f7wdD81ZF/jmVMDwKrq74w
	cqBJ6+FanvCP+xDl4qBo/nfTPeX+GUhygHp3tTZswS2dvDlvbPM7Qk8cWIbHV22hDdD4
	m0xMhJTHcEZNhc8FtdBrf8doHKaf+xsgX8R/GetzjSNJQnn+N+x6xs42ZhVmwIHxAyez
	qbad+ZCcj0TVHguPecF2+1DMBz4NcotioI0ETOEc7mIHXebbofXmi45w4j88lIq2u+Bd
	8p9w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id;
	bh=OTfRVipDw4eSlHPpPP5ryCKgGGlW1HO+dqtRcg0VPLY=;
	b=aEK8to61aAMdUFwH4lLe78DD3enTKhNDx44kngk0hyFGQYRPfuXpz1ggMT6kGCi+Mk
	0XH2bve8wvMimProHnLxdF0v6wO35fwWVoBpUctdm6SfT6pesH/aiX6Tbcuk5mMeOO8w
	K2B7OzcbyV7mKtFcyk8zX6eYD7k/TC5w8fZBaC4ypY/nrb0URAKdAaBwouCTKu1whDYA
	YR7XV9lQCJurqCnhalWOllHM3uOS6N9qPUw9OfFGcO8Vc/VK8Pn14aJcbIP9o80c+mpY
	ruAy+gcvKTGI6yv3lAw7rW14njLs74yb8eCM6FQjFJ6Uipv8AfOiNOKSkLHY7qC69zgy
	eqVQ==
X-Gm-Message-State: ALoCoQnwrqSuaAIXnyR/IigBhnypxc/Ft5F5tY1fEmZUNwepQ6qft5OtUnDjHVrxkWbaJfo+9+gHcauj2+xf2MglMX2KNqpbLQ==
X-Received: by 10.194.109.2 with SMTP id ho2mr48721302wjb.66.1453377110193;
	Thu, 21 Jan 2016 03:51:50 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194])
	by smtp.gmail.com with ESMTPSA id b1sm1157784wjy.0.2016.01.21.03.51.49
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Thu, 21 Jan 2016 03:51:49 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Thu, 21 Jan 2016 11:51:46 +0000
Message-Id: <1453377106-2388-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Fix WHQL InvalidPackets test
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Because the transmit code now parses packets before queueing (for the
purposes of maybe needing to hash) the operation can fail of the headers
are invalid. The WHQL test does not expect this to happen.

This patch ignores the parse failure but instead fails the packet when it
is de-queued but only if absolutely no header (i.e. even the ethernet
header) could be parsed. This seems to be enough to keep the test happy.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xenvif/receiver.c    |  2 --
 src/xenvif/transmitter.c | 47 ++++++++++++++++++++++-------------------------
 2 files changed, 22 insertions(+), 27 deletions(-)

diff --git a/src/xenvif/receiver.c b/src/xenvif/receiver.c
index 78f922c..62ca1c8 100644
--- a/src/xenvif/receiver.c
+++ b/src/xenvif/receiver.c
@@ -678,8 +678,6 @@ ReceiverRingPullup(
     return TRUE;
 
 fail1:
-    Error("fail1\n");
-
     return FALSE;
 }
 
diff --git a/src/xenvif/transmitter.c b/src/xenvif/transmitter.c
index a5bcf82..f6766ce 100644
--- a/src/xenvif/transmitter.c
+++ b/src/xenvif/transmitter.c
@@ -834,8 +834,6 @@ TransmitterPullup(
     return TRUE;
 
 fail1:
-    Error("fail1\n");
-
     return FALSE;
 }
 
@@ -1179,13 +1177,17 @@ __TransmitterRingPrepareHeader(
     Payload = &Packet->Payload;
     Info = &Packet->Info;
 
+    status = STATUS_UNSUCCESSFUL;
+    if (Info->Length == 0)
+        goto fail1;
+
     ASSERT3U(Packet->Reference, ==, 0);
 
     Buffer = __TransmitterGetBuffer(Ring);
 
     status = STATUS_NO_MEMORY;
     if (Buffer == NULL)
-        goto fail1;
+        goto fail2;
 
     Buffer->Context = Packet;
     Packet->Reference++;
@@ -1203,7 +1205,7 @@ __TransmitterRingPrepareHeader(
 
     status = STATUS_NO_MEMORY;
     if (Fragment == NULL)
-        goto fail2;
+        goto fail3;
 
     Fragment->Type = XENVIF_TRANSMITTER_FRAGMENT_TYPE_BUFFER;
     Fragment->Context = Buffer;
@@ -1221,7 +1223,7 @@ __TransmitterRingPrepareHeader(
                            TRUE,
                            &Fragment->Entry);
     if (!NT_SUCCESS(status))
-        goto fail3;
+        goto fail4;
 
     Fragment->Offset = 0;
     Fragment->Length = Mdl->ByteCount + Payload->Length;
@@ -1356,7 +1358,7 @@ __TransmitterRingPrepareHeader(
         
         if (Fragment->Length > MaximumFrameSize) {
             status = STATUS_INVALID_PARAMETER;
-            goto fail4;
+            goto fail5;
         }
     }
 
@@ -1372,8 +1374,8 @@ __TransmitterRingPrepareHeader(
 
     return STATUS_SUCCESS;
 
-fail4:
-    Error("fail4\n");
+fail5:
+    Error("fail5\n");
 
     ASSERT(State->Count != 0);
     --State->Count;
@@ -1391,8 +1393,8 @@ fail4:
                          Fragment->Entry);
     Fragment->Entry = NULL;
 
-fail3:
-    Error("fail3\n");
+fail4:
+    Error("fail4\n");
 
     Fragment->Context = NULL;
     Fragment->Type = XENVIF_TRANSMITTER_FRAGMENT_TYPE_INVALID;
@@ -1402,19 +1404,22 @@ fail3:
 
     __TransmitterPutFragment(Ring, Fragment);
 
-fail2:
-    Error("fail2\n");
+fail3:
+    Error("fail3\n");
 
     --Packet->Reference;
     Buffer->Context = NULL;
 
     __TransmitterPutBuffer(Ring, Buffer);
 
-fail1:
-    Error("fail1 (%08x)\n", status);
+fail2:
+    Error("fail2\n");
 
     ASSERT3U(Packet->Reference, ==, 0);
 
+fail1:
+    Error("fail1 (%08x)\n", status);
+
     return status;
 }
 
@@ -4568,10 +4573,9 @@ __TransmitterHashPacket(
     StartVa = Packet->Header;
     Info = &Packet->Info;
 
-    if (Info->TcpHeader.Length == 0 && Info->UdpHeader.Length == 0)
+    if (Info->IpHeader.Length == 0)
         goto done;
 
-    ASSERT(Info->IpHeader.Length != 0);
     IpHeader = (PIP_HEADER)(StartVa + Info->IpHeader.Offset);
 
     if (IpHeader->Version == 4) {
@@ -4607,7 +4611,7 @@ __TransmitterHashPacket(
         __TransmitterHashAccumulate(&Value,
                                     (PUCHAR)&TcpHeader->DestinationPort,
                                     sizeof (USHORT));
-    } else {
+    } else if (Info->UdpHeader.Length != 0) {
         PUDP_HEADER UdpHeader;
 
         ASSERT(Info->UdpHeader.Length != 0);
@@ -4673,9 +4677,7 @@ TransmitterQueuePacket(
 
     Info = &Packet->Info;
 
-    status = ParsePacket(StartVa, TransmitterPullup, Transmitter, Payload, Info);
-    if (!NT_SUCCESS(status))
-        goto fail2;
+    (VOID) ParsePacket(StartVa, TransmitterPullup, Transmitter, Payload, Info);
 
     switch (Hash->Algorithm) {
     case XENVIF_PACKET_HASH_ALGORITHM_NONE:
@@ -4699,11 +4701,6 @@ TransmitterQueuePacket(
 
     return STATUS_SUCCESS;
 
-fail2:
-    Error("fail2\n");
-
-    __TransmitterPutPacket(Transmitter, Packet);
-
 fail1:
     Error("fail1 (%08x)\n", status);
 
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Thu Jan 21 11:52:02 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 21 Jan 2016 11:52:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aMDmU-00005Z-0Y; Thu, 21 Jan 2016 11:52:02 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aMDmS-00005H-CB
	for win-pv-devel@lists.xenproject.org; Thu, 21 Jan 2016 11:52:00 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	A6/A9-08977-F56C0A65; Thu, 21 Jan 2016 11:51:59 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1453377110!11450498!1
X-Originating-IP: [74.125.82.49]
X-SpamReason: No, hits=0.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6635 invoked from network); 21 Jan 2016 11:51:55 -0000
Received: from mail-wm0-f49.google.com (HELO mail-wm0-f49.google.com)
	(74.125.82.49)
	by server-7.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 21 Jan 2016 11:51:55 -0000
Received: by mail-wm0-f49.google.com with SMTP id b14so76483504wmb.1
	for <win-pv-devel@lists.xenproject.org>;
	Thu, 21 Jan 2016 03:51:55 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=OTfRVipDw4eSlHPpPP5ryCKgGGlW1HO+dqtRcg0VPLY=;
	b=xY4MJbqnhxs5yXDl5IkBD/wXLvrLvxHBKY9E7K4xFCKug+R+lj2ToKtM1gOn2MzDSA
	CEVL0d4fWdpCA16i/XXvxBJ1N/5jkGugZRv4LOefCQEgF5f7wdD81ZF/jmVMDwKrq74w
	cqBJ6+FanvCP+xDl4qBo/nfTPeX+GUhygHp3tTZswS2dvDlvbPM7Qk8cWIbHV22hDdD4
	m0xMhJTHcEZNhc8FtdBrf8doHKaf+xsgX8R/GetzjSNJQnn+N+x6xs42ZhVmwIHxAyez
	qbad+ZCcj0TVHguPecF2+1DMBz4NcotioI0ETOEc7mIHXebbofXmi45w4j88lIq2u+Bd
	8p9w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id;
	bh=OTfRVipDw4eSlHPpPP5ryCKgGGlW1HO+dqtRcg0VPLY=;
	b=aEK8to61aAMdUFwH4lLe78DD3enTKhNDx44kngk0hyFGQYRPfuXpz1ggMT6kGCi+Mk
	0XH2bve8wvMimProHnLxdF0v6wO35fwWVoBpUctdm6SfT6pesH/aiX6Tbcuk5mMeOO8w
	K2B7OzcbyV7mKtFcyk8zX6eYD7k/TC5w8fZBaC4ypY/nrb0URAKdAaBwouCTKu1whDYA
	YR7XV9lQCJurqCnhalWOllHM3uOS6N9qPUw9OfFGcO8Vc/VK8Pn14aJcbIP9o80c+mpY
	ruAy+gcvKTGI6yv3lAw7rW14njLs74yb8eCM6FQjFJ6Uipv8AfOiNOKSkLHY7qC69zgy
	eqVQ==
X-Gm-Message-State: ALoCoQnwrqSuaAIXnyR/IigBhnypxc/Ft5F5tY1fEmZUNwepQ6qft5OtUnDjHVrxkWbaJfo+9+gHcauj2+xf2MglMX2KNqpbLQ==
X-Received: by 10.194.109.2 with SMTP id ho2mr48721302wjb.66.1453377110193;
	Thu, 21 Jan 2016 03:51:50 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194])
	by smtp.gmail.com with ESMTPSA id b1sm1157784wjy.0.2016.01.21.03.51.49
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Thu, 21 Jan 2016 03:51:49 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Thu, 21 Jan 2016 11:51:46 +0000
Message-Id: <1453377106-2388-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Fix WHQL InvalidPackets test
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Because the transmit code now parses packets before queueing (for the
purposes of maybe needing to hash) the operation can fail of the headers
are invalid. The WHQL test does not expect this to happen.

This patch ignores the parse failure but instead fails the packet when it
is de-queued but only if absolutely no header (i.e. even the ethernet
header) could be parsed. This seems to be enough to keep the test happy.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xenvif/receiver.c    |  2 --
 src/xenvif/transmitter.c | 47 ++++++++++++++++++++++-------------------------
 2 files changed, 22 insertions(+), 27 deletions(-)

diff --git a/src/xenvif/receiver.c b/src/xenvif/receiver.c
index 78f922c..62ca1c8 100644
--- a/src/xenvif/receiver.c
+++ b/src/xenvif/receiver.c
@@ -678,8 +678,6 @@ ReceiverRingPullup(
     return TRUE;
 
 fail1:
-    Error("fail1\n");
-
     return FALSE;
 }
 
diff --git a/src/xenvif/transmitter.c b/src/xenvif/transmitter.c
index a5bcf82..f6766ce 100644
--- a/src/xenvif/transmitter.c
+++ b/src/xenvif/transmitter.c
@@ -834,8 +834,6 @@ TransmitterPullup(
     return TRUE;
 
 fail1:
-    Error("fail1\n");
-
     return FALSE;
 }
 
@@ -1179,13 +1177,17 @@ __TransmitterRingPrepareHeader(
     Payload = &Packet->Payload;
     Info = &Packet->Info;
 
+    status = STATUS_UNSUCCESSFUL;
+    if (Info->Length == 0)
+        goto fail1;
+
     ASSERT3U(Packet->Reference, ==, 0);
 
     Buffer = __TransmitterGetBuffer(Ring);
 
     status = STATUS_NO_MEMORY;
     if (Buffer == NULL)
-        goto fail1;
+        goto fail2;
 
     Buffer->Context = Packet;
     Packet->Reference++;
@@ -1203,7 +1205,7 @@ __TransmitterRingPrepareHeader(
 
     status = STATUS_NO_MEMORY;
     if (Fragment == NULL)
-        goto fail2;
+        goto fail3;
 
     Fragment->Type = XENVIF_TRANSMITTER_FRAGMENT_TYPE_BUFFER;
     Fragment->Context = Buffer;
@@ -1221,7 +1223,7 @@ __TransmitterRingPrepareHeader(
                            TRUE,
                            &Fragment->Entry);
     if (!NT_SUCCESS(status))
-        goto fail3;
+        goto fail4;
 
     Fragment->Offset = 0;
     Fragment->Length = Mdl->ByteCount + Payload->Length;
@@ -1356,7 +1358,7 @@ __TransmitterRingPrepareHeader(
         
         if (Fragment->Length > MaximumFrameSize) {
             status = STATUS_INVALID_PARAMETER;
-            goto fail4;
+            goto fail5;
         }
     }
 
@@ -1372,8 +1374,8 @@ __TransmitterRingPrepareHeader(
 
     return STATUS_SUCCESS;
 
-fail4:
-    Error("fail4\n");
+fail5:
+    Error("fail5\n");
 
     ASSERT(State->Count != 0);
     --State->Count;
@@ -1391,8 +1393,8 @@ fail4:
                          Fragment->Entry);
     Fragment->Entry = NULL;
 
-fail3:
-    Error("fail3\n");
+fail4:
+    Error("fail4\n");
 
     Fragment->Context = NULL;
     Fragment->Type = XENVIF_TRANSMITTER_FRAGMENT_TYPE_INVALID;
@@ -1402,19 +1404,22 @@ fail3:
 
     __TransmitterPutFragment(Ring, Fragment);
 
-fail2:
-    Error("fail2\n");
+fail3:
+    Error("fail3\n");
 
     --Packet->Reference;
     Buffer->Context = NULL;
 
     __TransmitterPutBuffer(Ring, Buffer);
 
-fail1:
-    Error("fail1 (%08x)\n", status);
+fail2:
+    Error("fail2\n");
 
     ASSERT3U(Packet->Reference, ==, 0);
 
+fail1:
+    Error("fail1 (%08x)\n", status);
+
     return status;
 }
 
@@ -4568,10 +4573,9 @@ __TransmitterHashPacket(
     StartVa = Packet->Header;
     Info = &Packet->Info;
 
-    if (Info->TcpHeader.Length == 0 && Info->UdpHeader.Length == 0)
+    if (Info->IpHeader.Length == 0)
         goto done;
 
-    ASSERT(Info->IpHeader.Length != 0);
     IpHeader = (PIP_HEADER)(StartVa + Info->IpHeader.Offset);
 
     if (IpHeader->Version == 4) {
@@ -4607,7 +4611,7 @@ __TransmitterHashPacket(
         __TransmitterHashAccumulate(&Value,
                                     (PUCHAR)&TcpHeader->DestinationPort,
                                     sizeof (USHORT));
-    } else {
+    } else if (Info->UdpHeader.Length != 0) {
         PUDP_HEADER UdpHeader;
 
         ASSERT(Info->UdpHeader.Length != 0);
@@ -4673,9 +4677,7 @@ TransmitterQueuePacket(
 
     Info = &Packet->Info;
 
-    status = ParsePacket(StartVa, TransmitterPullup, Transmitter, Payload, Info);
-    if (!NT_SUCCESS(status))
-        goto fail2;
+    (VOID) ParsePacket(StartVa, TransmitterPullup, Transmitter, Payload, Info);
 
     switch (Hash->Algorithm) {
     case XENVIF_PACKET_HASH_ALGORITHM_NONE:
@@ -4699,11 +4701,6 @@ TransmitterQueuePacket(
 
     return STATUS_SUCCESS;
 
-fail2:
-    Error("fail2\n");
-
-    __TransmitterPutPacket(Transmitter, Packet);
-
 fail1:
     Error("fail1 (%08x)\n", status);
 
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Fri Jan 22 04:30:34 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 22 Jan 2016 04:30:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aMTMm-0005kq-1R; Fri, 22 Jan 2016 04:30:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=822615ef0=davebuch@amazon.com>)
	id 1aMTMl-0005kl-9h
	for win-pv-devel@lists.xenproject.org; Fri, 22 Jan 2016 04:30:31 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	AB/BD-06010-660B1A65; Fri, 22 Jan 2016 04:30:30 +0000
X-Env-Sender: prvs=822615ef0=davebuch@amazon.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1453437028!9922481!1
X-Originating-IP: [72.21.196.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNzIuMjEuMTk2LjI1ID0+IDE4NjQwNA==\n
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 49163 invoked from network); 22 Jan 2016 04:30:29 -0000
Received: from smtp-fw-2101.amazon.com (HELO smtp-fw-2101.amazon.com)
	(72.21.196.25)
	by server-7.tower-31.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Jan 2016 04:30:29 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209;
	t=1453437029; x=1484973029;
	h=from:to:cc:subject:date:message-id:mime-version;
	bh=wc9NykT3r0b6upff2vmLkHjW3POakdaZ0oE1dooSl6Y=;
	b=EYUbILai6O6b+eO8lLT79kv/+0URYKCJAfF5Iwqwrjz+iAb81m3wp15C
	Qrd4+pjImeN+DIwgOMxasPBreNIx7ZeTjMX9m6b72U2eA9+QblpfOuTX4
	+ZecHTLkqA56J2/d0SKO2z47cYrFPRgTx8TT6EYhsDPCS2Vtg9C7VxlJf I=;
X-IronPort-AV: E=Sophos;i="5.22,328,1449532800"; d="scan'208";a="418297136"
Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO
	email-inbound-relay-60003.pdx1.amazon.com) ([10.43.8.6])
	by smtp-border-fw-out-2101.iad2.amazon.com with
	ESMTP/TLS/DHE-RSA-AES256-SHA; 22 Jan 2016 04:30:27 +0000
Received: from ex10-hub-7002.ant.amazon.com (pdx1-ws-svc-lb16-vlan2.amazon.com
	[10.239.138.210])
	by email-inbound-relay-60003.pdx1.amazon.com (8.14.7/8.14.7) with ESMTP
	id u0M4UKfu023078
	(version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL);
	Fri, 22 Jan 2016 04:30:26 GMT
Received: from EX13D06UWC001.ant.amazon.com (10.43.162.91) by
	ex10-hub-7002.ant.amazon.com (10.43.110.153) with Microsoft SMTP Server
	(TLS) id 14.3.181.6; Thu, 21 Jan 2016 20:30:17 -0800
Received: from SEA-1850006493.ant.amazon.com (10.43.162.125) by
	EX13D06UWC001.ant.amazon.com (10.43.162.91) with Microsoft SMTP Server
	(TLS) id 15.0.1044.25; Fri, 22 Jan 2016 04:30:16 +0000
From: Dave Buches <davebuch@amazon.com>
To: <win-pv-devel@lists.xenproject.org>
Date: Thu, 21 Jan 2016 20:30:03 -0800
Message-ID: <1453437003-17120-1-git-send-email-davebuch@amazon.com>
X-Mailer: git-send-email 2.5.3.windows.1
MIME-Version: 1.0
X-Originating-IP: [10.43.162.125]
X-ClientProxiedBy: EX13D08UWB002.ant.amazon.com (10.43.161.168) To
	EX13D06UWC001.ant.amazon.com (10.43.162.91)
Precedence: Bulk
Cc: David Buches <davebuch@amazon.com>, Paul.Durrant@citrix.com
Subject: [win-pv-devel] [PATCH] Fixed improper SCSI UNMAP request
	implementation
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

From: David Buches <davebuch@amazon.com>

The XenDisk disk class filter driver was generating requests
that did not adhere to the t10 SBC-3 SCSI specification for UNMAP
operations.  Specifically, the data length and block descriptor data
length fields were not populated properly per the spec.

Although the XenVBD miniport driver handled these malformed
requests correctly, it failed to handle *properly* formed requests,
which would result in unpredictable behavior.

Additionally, the XenDisk filter wasn't properly responding to
StorageDeviceTrimProperty queries per the MSDN spec. Specifically,
the DEVICE_TRIM_DESCRIPTOR::Version structure member needs to be set
to sizeof(DEVICE_TRIM_DESCRIPTOR).

Signed-off-by: David Buches <davebuch@amazon.com>
---
 src/xendisk/pdo.c | 6 +++---
 src/xenvbd/pdo.c  | 3 +--
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/xendisk/pdo.c b/src/xendisk/pdo.c
index 07f4cfd..eaa3e2d 100644
--- a/src/xendisk/pdo.c
+++ b/src/xendisk/pdo.c
@@ -401,7 +401,7 @@ PdoQueryProperty(
 
             Trim = Irp->AssociatedIrp.SystemBuffer;
 
-            Trim->Version = 0;
+            Trim->Version = sizeof(DEVICE_TRIM_DESCRIPTOR);
             Trim->Size = sizeof(DEVICE_TRIM_DESCRIPTOR);
             Trim->TrimEnabled = TRUE;
 
@@ -557,8 +557,8 @@ PdoSendTrimSynchronous(
     Cdb->UNMAP.OperationCode = SCSIOP_UNMAP;
     *(PUSHORT)Cdb->UNMAP.AllocationLength = _byteswap_ushort((USHORT)Length);
 
-    *(PUSHORT)Unmap->DataLength = _byteswap_ushort((USHORT)Length);
-    *(PUSHORT)Unmap->BlockDescrDataLength = _byteswap_ushort((USHORT)sizeof(UNMAP_BLOCK_DESCRIPTOR));
+	*(PUSHORT)Unmap->DataLength = _byteswap_ushort((USHORT)(Length - FIELD_OFFSET(UNMAP_LIST_HEADER, BlockDescrDataLength)));
+	*(PUSHORT)Unmap->BlockDescrDataLength = _byteswap_ushort((USHORT)(Length - FIELD_OFFSET(UNMAP_LIST_HEADER, Descriptors[0])));
 
     for (Index = 0; Index < Count; ++Index) {
         PUNMAP_BLOCK_DESCRIPTOR Block = &Unmap->Descriptors[Index];
diff --git a/src/xenvbd/pdo.c b/src/xenvbd/pdo.c
index 488a74b..67800e4 100644
--- a/src/xenvbd/pdo.c
+++ b/src/xenvbd/pdo.c
@@ -1264,8 +1264,7 @@ PrepareUnmap(
 {
     PXENVBD_SRBEXT      SrbExt = GetSrbExt(Srb);
     PUNMAP_LIST_HEADER  Unmap = Srb->DataBuffer;
-    ULONG               Count = _byteswap_ushort(*(PUSHORT)Unmap->DataLength) /
-                                _byteswap_ushort(*(PUSHORT)Unmap->BlockDescrDataLength);
+	ULONG               Count = _byteswap_ushort(*(PUSHORT)Unmap->BlockDescrDataLength) / sizeof(UNMAP_BLOCK_DESCRIPTOR);
     ULONG               Index;
     LIST_ENTRY          List;
 
-- 
2.5.3.windows.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Fri Jan 22 04:30:34 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 22 Jan 2016 04:30:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aMTMm-0005kq-1R; Fri, 22 Jan 2016 04:30:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=822615ef0=davebuch@amazon.com>)
	id 1aMTMl-0005kl-9h
	for win-pv-devel@lists.xenproject.org; Fri, 22 Jan 2016 04:30:31 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	AB/BD-06010-660B1A65; Fri, 22 Jan 2016 04:30:30 +0000
X-Env-Sender: prvs=822615ef0=davebuch@amazon.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1453437028!9922481!1
X-Originating-IP: [72.21.196.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNzIuMjEuMTk2LjI1ID0+IDE4NjQwNA==\n
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 49163 invoked from network); 22 Jan 2016 04:30:29 -0000
Received: from smtp-fw-2101.amazon.com (HELO smtp-fw-2101.amazon.com)
	(72.21.196.25)
	by server-7.tower-31.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Jan 2016 04:30:29 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209;
	t=1453437029; x=1484973029;
	h=from:to:cc:subject:date:message-id:mime-version;
	bh=wc9NykT3r0b6upff2vmLkHjW3POakdaZ0oE1dooSl6Y=;
	b=EYUbILai6O6b+eO8lLT79kv/+0URYKCJAfF5Iwqwrjz+iAb81m3wp15C
	Qrd4+pjImeN+DIwgOMxasPBreNIx7ZeTjMX9m6b72U2eA9+QblpfOuTX4
	+ZecHTLkqA56J2/d0SKO2z47cYrFPRgTx8TT6EYhsDPCS2Vtg9C7VxlJf I=;
X-IronPort-AV: E=Sophos;i="5.22,328,1449532800"; d="scan'208";a="418297136"
Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO
	email-inbound-relay-60003.pdx1.amazon.com) ([10.43.8.6])
	by smtp-border-fw-out-2101.iad2.amazon.com with
	ESMTP/TLS/DHE-RSA-AES256-SHA; 22 Jan 2016 04:30:27 +0000
Received: from ex10-hub-7002.ant.amazon.com (pdx1-ws-svc-lb16-vlan2.amazon.com
	[10.239.138.210])
	by email-inbound-relay-60003.pdx1.amazon.com (8.14.7/8.14.7) with ESMTP
	id u0M4UKfu023078
	(version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL);
	Fri, 22 Jan 2016 04:30:26 GMT
Received: from EX13D06UWC001.ant.amazon.com (10.43.162.91) by
	ex10-hub-7002.ant.amazon.com (10.43.110.153) with Microsoft SMTP Server
	(TLS) id 14.3.181.6; Thu, 21 Jan 2016 20:30:17 -0800
Received: from SEA-1850006493.ant.amazon.com (10.43.162.125) by
	EX13D06UWC001.ant.amazon.com (10.43.162.91) with Microsoft SMTP Server
	(TLS) id 15.0.1044.25; Fri, 22 Jan 2016 04:30:16 +0000
From: Dave Buches <davebuch@amazon.com>
To: <win-pv-devel@lists.xenproject.org>
Date: Thu, 21 Jan 2016 20:30:03 -0800
Message-ID: <1453437003-17120-1-git-send-email-davebuch@amazon.com>
X-Mailer: git-send-email 2.5.3.windows.1
MIME-Version: 1.0
X-Originating-IP: [10.43.162.125]
X-ClientProxiedBy: EX13D08UWB002.ant.amazon.com (10.43.161.168) To
	EX13D06UWC001.ant.amazon.com (10.43.162.91)
Precedence: Bulk
Cc: David Buches <davebuch@amazon.com>, Paul.Durrant@citrix.com
Subject: [win-pv-devel] [PATCH] Fixed improper SCSI UNMAP request
	implementation
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

From: David Buches <davebuch@amazon.com>

The XenDisk disk class filter driver was generating requests
that did not adhere to the t10 SBC-3 SCSI specification for UNMAP
operations.  Specifically, the data length and block descriptor data
length fields were not populated properly per the spec.

Although the XenVBD miniport driver handled these malformed
requests correctly, it failed to handle *properly* formed requests,
which would result in unpredictable behavior.

Additionally, the XenDisk filter wasn't properly responding to
StorageDeviceTrimProperty queries per the MSDN spec. Specifically,
the DEVICE_TRIM_DESCRIPTOR::Version structure member needs to be set
to sizeof(DEVICE_TRIM_DESCRIPTOR).

Signed-off-by: David Buches <davebuch@amazon.com>
---
 src/xendisk/pdo.c | 6 +++---
 src/xenvbd/pdo.c  | 3 +--
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/xendisk/pdo.c b/src/xendisk/pdo.c
index 07f4cfd..eaa3e2d 100644
--- a/src/xendisk/pdo.c
+++ b/src/xendisk/pdo.c
@@ -401,7 +401,7 @@ PdoQueryProperty(
 
             Trim = Irp->AssociatedIrp.SystemBuffer;
 
-            Trim->Version = 0;
+            Trim->Version = sizeof(DEVICE_TRIM_DESCRIPTOR);
             Trim->Size = sizeof(DEVICE_TRIM_DESCRIPTOR);
             Trim->TrimEnabled = TRUE;
 
@@ -557,8 +557,8 @@ PdoSendTrimSynchronous(
     Cdb->UNMAP.OperationCode = SCSIOP_UNMAP;
     *(PUSHORT)Cdb->UNMAP.AllocationLength = _byteswap_ushort((USHORT)Length);
 
-    *(PUSHORT)Unmap->DataLength = _byteswap_ushort((USHORT)Length);
-    *(PUSHORT)Unmap->BlockDescrDataLength = _byteswap_ushort((USHORT)sizeof(UNMAP_BLOCK_DESCRIPTOR));
+	*(PUSHORT)Unmap->DataLength = _byteswap_ushort((USHORT)(Length - FIELD_OFFSET(UNMAP_LIST_HEADER, BlockDescrDataLength)));
+	*(PUSHORT)Unmap->BlockDescrDataLength = _byteswap_ushort((USHORT)(Length - FIELD_OFFSET(UNMAP_LIST_HEADER, Descriptors[0])));
 
     for (Index = 0; Index < Count; ++Index) {
         PUNMAP_BLOCK_DESCRIPTOR Block = &Unmap->Descriptors[Index];
diff --git a/src/xenvbd/pdo.c b/src/xenvbd/pdo.c
index 488a74b..67800e4 100644
--- a/src/xenvbd/pdo.c
+++ b/src/xenvbd/pdo.c
@@ -1264,8 +1264,7 @@ PrepareUnmap(
 {
     PXENVBD_SRBEXT      SrbExt = GetSrbExt(Srb);
     PUNMAP_LIST_HEADER  Unmap = Srb->DataBuffer;
-    ULONG               Count = _byteswap_ushort(*(PUSHORT)Unmap->DataLength) /
-                                _byteswap_ushort(*(PUSHORT)Unmap->BlockDescrDataLength);
+	ULONG               Count = _byteswap_ushort(*(PUSHORT)Unmap->BlockDescrDataLength) / sizeof(UNMAP_BLOCK_DESCRIPTOR);
     ULONG               Index;
     LIST_ENTRY          List;
 
-- 
2.5.3.windows.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Fri Jan 22 08:54:26 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 22 Jan 2016 08:54:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aMXU8-0006Vy-LO; Fri, 22 Jan 2016 08:54:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=822a4145e=Paul.Durrant@citrix.com>)
	id 1aMXU7-0006Vt-4X
	for win-pv-devel@lists.xenproject.org; Fri, 22 Jan 2016 08:54:23 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	8D/7A-15353-E3EE1A65; Fri, 22 Jan 2016 08:54:22 +0000
X-Env-Sender: prvs=822a4145e=Paul.Durrant@citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1453452861!17466642!1
X-Originating-IP: [185.25.65.24]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	UPPERCASE_25_50,received_headers: No Received headers
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 46113 invoked from network); 22 Jan 2016 08:54:21 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (185.25.65.24)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Jan 2016 08:54:21 -0000
X-IronPort-AV: E=Sophos;i="5.22,330,1449532800"; d="scan'208";a="13143924"
From: Paul Durrant <Paul.Durrant@citrix.com>
To: Dave Buches <davebuch@amazon.com>, "win-pv-devel@lists.xenproject.org"
	<win-pv-devel@lists.xenproject.org>
Thread-Topic: [PATCH] Fixed improper SCSI UNMAP request implementation
Thread-Index: AQHRVM2hGeVULIUErki3NxFCeAykRp8HOlTg
Date: Fri, 22 Jan 2016 08:54:03 +0000
Message-ID: <7e79e95e98bc4a8ab9cfdf115681bd71@AMSPEX02CL03.citrite.net>
References: <1453437003-17120-1-git-send-email-davebuch@amazon.com>
In-Reply-To: <1453437003-17120-1-git-send-email-davebuch@amazon.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ms-exchange-transport-fromentityheader: Hosted
MIME-Version: 1.0
X-DLP: AMS1
Subject: Re: [win-pv-devel] [PATCH] Fixed improper SCSI UNMAP request
	implementation
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

> -----Original Message-----
> From: Dave Buches [mailto:davebuch@amazon.com]
> Sent: 22 January 2016 04:30
> To: win-pv-devel@lists.xenproject.org
> Cc: Paul Durrant; David Buches
> Subject: [PATCH] Fixed improper SCSI UNMAP request implementation
> 
> From: David Buches <davebuch@amazon.com>
> 
> The XenDisk disk class filter driver was generating requests
> that did not adhere to the t10 SBC-3 SCSI specification for UNMAP
> operations.  Specifically, the data length and block descriptor data
> length fields were not populated properly per the spec.
> 
> Although the XenVBD miniport driver handled these malformed
> requests correctly, it failed to handle *properly* formed requests,
> which would result in unpredictable behavior.
> 
> Additionally, the XenDisk filter wasn't properly responding to
> StorageDeviceTrimProperty queries per the MSDN spec. Specifically,
> the DEVICE_TRIM_DESCRIPTOR::Version structure member needs to be set
> to sizeof(DEVICE_TRIM_DESCRIPTOR).
> 
> Signed-off-by: David Buches <davebuch@amazon.com>

Thanks.

Acked-by: Paul Durrant <paul.durrant@citrix.com>

...and applied.

> ---
>  src/xendisk/pdo.c | 6 +++---
>  src/xenvbd/pdo.c  | 3 +--
>  2 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/src/xendisk/pdo.c b/src/xendisk/pdo.c
> index 07f4cfd..eaa3e2d 100644
> --- a/src/xendisk/pdo.c
> +++ b/src/xendisk/pdo.c
> @@ -401,7 +401,7 @@ PdoQueryProperty(
> 
>              Trim = Irp->AssociatedIrp.SystemBuffer;
> 
> -            Trim->Version = 0;
> +            Trim->Version = sizeof(DEVICE_TRIM_DESCRIPTOR);
>              Trim->Size = sizeof(DEVICE_TRIM_DESCRIPTOR);
>              Trim->TrimEnabled = TRUE;
> 
> @@ -557,8 +557,8 @@ PdoSendTrimSynchronous(
>      Cdb->UNMAP.OperationCode = SCSIOP_UNMAP;
>      *(PUSHORT)Cdb->UNMAP.AllocationLength =
> _byteswap_ushort((USHORT)Length);
> 
> -    *(PUSHORT)Unmap->DataLength = _byteswap_ushort((USHORT)Length);
> -    *(PUSHORT)Unmap->BlockDescrDataLength =
> _byteswap_ushort((USHORT)sizeof(UNMAP_BLOCK_DESCRIPTOR));
> +	*(PUSHORT)Unmap->DataLength =
> _byteswap_ushort((USHORT)(Length -
> FIELD_OFFSET(UNMAP_LIST_HEADER, BlockDescrDataLength)));
> +	*(PUSHORT)Unmap->BlockDescrDataLength =
> _byteswap_ushort((USHORT)(Length -
> FIELD_OFFSET(UNMAP_LIST_HEADER, Descriptors[0])));
> 
>      for (Index = 0; Index < Count; ++Index) {
>          PUNMAP_BLOCK_DESCRIPTOR Block = &Unmap->Descriptors[Index];
> diff --git a/src/xenvbd/pdo.c b/src/xenvbd/pdo.c
> index 488a74b..67800e4 100644
> --- a/src/xenvbd/pdo.c
> +++ b/src/xenvbd/pdo.c
> @@ -1264,8 +1264,7 @@ PrepareUnmap(
>  {
>      PXENVBD_SRBEXT      SrbExt = GetSrbExt(Srb);
>      PUNMAP_LIST_HEADER  Unmap = Srb->DataBuffer;
> -    ULONG               Count = _byteswap_ushort(*(PUSHORT)Unmap-
> >DataLength) /
> -                                _byteswap_ushort(*(PUSHORT)Unmap-
> >BlockDescrDataLength);
> +	ULONG               Count = _byteswap_ushort(*(PUSHORT)Unmap-
> >BlockDescrDataLength) / sizeof(UNMAP_BLOCK_DESCRIPTOR);
>      ULONG               Index;
>      LIST_ENTRY          List;
> 
> --
> 2.5.3.windows.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Fri Jan 22 08:54:26 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 22 Jan 2016 08:54:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aMXU8-0006Vy-LO; Fri, 22 Jan 2016 08:54:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=822a4145e=Paul.Durrant@citrix.com>)
	id 1aMXU7-0006Vt-4X
	for win-pv-devel@lists.xenproject.org; Fri, 22 Jan 2016 08:54:23 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	8D/7A-15353-E3EE1A65; Fri, 22 Jan 2016 08:54:22 +0000
X-Env-Sender: prvs=822a4145e=Paul.Durrant@citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1453452861!17466642!1
X-Originating-IP: [185.25.65.24]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	UPPERCASE_25_50,received_headers: No Received headers
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 46113 invoked from network); 22 Jan 2016 08:54:21 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (185.25.65.24)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Jan 2016 08:54:21 -0000
X-IronPort-AV: E=Sophos;i="5.22,330,1449532800"; d="scan'208";a="13143924"
From: Paul Durrant <Paul.Durrant@citrix.com>
To: Dave Buches <davebuch@amazon.com>, "win-pv-devel@lists.xenproject.org"
	<win-pv-devel@lists.xenproject.org>
Thread-Topic: [PATCH] Fixed improper SCSI UNMAP request implementation
Thread-Index: AQHRVM2hGeVULIUErki3NxFCeAykRp8HOlTg
Date: Fri, 22 Jan 2016 08:54:03 +0000
Message-ID: <7e79e95e98bc4a8ab9cfdf115681bd71@AMSPEX02CL03.citrite.net>
References: <1453437003-17120-1-git-send-email-davebuch@amazon.com>
In-Reply-To: <1453437003-17120-1-git-send-email-davebuch@amazon.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ms-exchange-transport-fromentityheader: Hosted
MIME-Version: 1.0
X-DLP: AMS1
Subject: Re: [win-pv-devel] [PATCH] Fixed improper SCSI UNMAP request
	implementation
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

> -----Original Message-----
> From: Dave Buches [mailto:davebuch@amazon.com]
> Sent: 22 January 2016 04:30
> To: win-pv-devel@lists.xenproject.org
> Cc: Paul Durrant; David Buches
> Subject: [PATCH] Fixed improper SCSI UNMAP request implementation
> 
> From: David Buches <davebuch@amazon.com>
> 
> The XenDisk disk class filter driver was generating requests
> that did not adhere to the t10 SBC-3 SCSI specification for UNMAP
> operations.  Specifically, the data length and block descriptor data
> length fields were not populated properly per the spec.
> 
> Although the XenVBD miniport driver handled these malformed
> requests correctly, it failed to handle *properly* formed requests,
> which would result in unpredictable behavior.
> 
> Additionally, the XenDisk filter wasn't properly responding to
> StorageDeviceTrimProperty queries per the MSDN spec. Specifically,
> the DEVICE_TRIM_DESCRIPTOR::Version structure member needs to be set
> to sizeof(DEVICE_TRIM_DESCRIPTOR).
> 
> Signed-off-by: David Buches <davebuch@amazon.com>

Thanks.

Acked-by: Paul Durrant <paul.durrant@citrix.com>

...and applied.

> ---
>  src/xendisk/pdo.c | 6 +++---
>  src/xenvbd/pdo.c  | 3 +--
>  2 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/src/xendisk/pdo.c b/src/xendisk/pdo.c
> index 07f4cfd..eaa3e2d 100644
> --- a/src/xendisk/pdo.c
> +++ b/src/xendisk/pdo.c
> @@ -401,7 +401,7 @@ PdoQueryProperty(
> 
>              Trim = Irp->AssociatedIrp.SystemBuffer;
> 
> -            Trim->Version = 0;
> +            Trim->Version = sizeof(DEVICE_TRIM_DESCRIPTOR);
>              Trim->Size = sizeof(DEVICE_TRIM_DESCRIPTOR);
>              Trim->TrimEnabled = TRUE;
> 
> @@ -557,8 +557,8 @@ PdoSendTrimSynchronous(
>      Cdb->UNMAP.OperationCode = SCSIOP_UNMAP;
>      *(PUSHORT)Cdb->UNMAP.AllocationLength =
> _byteswap_ushort((USHORT)Length);
> 
> -    *(PUSHORT)Unmap->DataLength = _byteswap_ushort((USHORT)Length);
> -    *(PUSHORT)Unmap->BlockDescrDataLength =
> _byteswap_ushort((USHORT)sizeof(UNMAP_BLOCK_DESCRIPTOR));
> +	*(PUSHORT)Unmap->DataLength =
> _byteswap_ushort((USHORT)(Length -
> FIELD_OFFSET(UNMAP_LIST_HEADER, BlockDescrDataLength)));
> +	*(PUSHORT)Unmap->BlockDescrDataLength =
> _byteswap_ushort((USHORT)(Length -
> FIELD_OFFSET(UNMAP_LIST_HEADER, Descriptors[0])));
> 
>      for (Index = 0; Index < Count; ++Index) {
>          PUNMAP_BLOCK_DESCRIPTOR Block = &Unmap->Descriptors[Index];
> diff --git a/src/xenvbd/pdo.c b/src/xenvbd/pdo.c
> index 488a74b..67800e4 100644
> --- a/src/xenvbd/pdo.c
> +++ b/src/xenvbd/pdo.c
> @@ -1264,8 +1264,7 @@ PrepareUnmap(
>  {
>      PXENVBD_SRBEXT      SrbExt = GetSrbExt(Srb);
>      PUNMAP_LIST_HEADER  Unmap = Srb->DataBuffer;
> -    ULONG               Count = _byteswap_ushort(*(PUSHORT)Unmap-
> >DataLength) /
> -                                _byteswap_ushort(*(PUSHORT)Unmap-
> >BlockDescrDataLength);
> +	ULONG               Count = _byteswap_ushort(*(PUSHORT)Unmap-
> >BlockDescrDataLength) / sizeof(UNMAP_BLOCK_DESCRIPTOR);
>      ULONG               Index;
>      LIST_ENTRY          List;
> 
> --
> 2.5.3.windows.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Fri Jan 22 16:05:06 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 22 Jan 2016 16:05:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aMeCv-0004bF-PM; Fri, 22 Jan 2016 16:05:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aMeCu-0004aq-1j
	for win-pv-devel@lists.xenproject.org; Fri, 22 Jan 2016 16:05:04 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	22/2C-07651-F2352A65; Fri, 22 Jan 2016 16:05:03 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1453478702!7973825!1
X-Originating-IP: [74.125.82.68]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 35977 invoked from network); 22 Jan 2016 16:05:02 -0000
Received: from mail-wm0-f68.google.com (HELO mail-wm0-f68.google.com)
	(74.125.82.68)
	by server-4.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 22 Jan 2016 16:05:02 -0000
Received: by mail-wm0-f68.google.com with SMTP id b14so18131343wmb.1
	for <win-pv-devel@lists.xenproject.org>;
	Fri, 22 Jan 2016 08:05:02 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:in-reply-to:references;
	bh=C5gS2g5VHSrvYZyKgP7pb41YaVnNISef3bLn9AntgxQ=;
	b=qdZPQJJHHAE9DVbHNVfXHjknIhuiGJ/DuU64KuQAVcXzvBcXgMyV2AXoZQi6MLySMT
	fgh/X25CqpBpnpKtVd7dfFmyvhg+H9BzGfDmg5tx/q5cSL7In3n6nP5aGhuwD12Pdv9w
	8dpFieLapYY3jX3QBAFfIKoFxeFZ6Z1Oqsg3NUpebBIsvVrP7nSms9NqCwvr0XZEd5m8
	xrrvpmpc65x+Q6WdwSig0dQvwh/RQdQN2Tlm+dkZBbh+fDMJVitFqF08DbxE44ORthrI
	bGyU5yjuJcrraeNSBKnVY2WWpHERbQikoVXt4EDzXONyC+rM/gM+jdNyLVErro3pRYvN
	Nvqw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
	:references;
	bh=C5gS2g5VHSrvYZyKgP7pb41YaVnNISef3bLn9AntgxQ=;
	b=Z+gH7OFZPtio1y9GEzfViDiTrBRPiyA3vgAKYaexNlHpQDHdTARJaOMWrGPOmldLk9
	H6PGFVhXgfvZvrbfraU0FWytLSzTXtEeRIfkOUlxRQFLv0VaVhqbO001X5JPFSxQNg6z
	YKEpvfY9kt6fY7byc+gX3OlSuINt4igdllA3LMFiCHgdUJL2C/flyVGxraybqKHaa8Cz
	nTkuimRUumjMU4UQEO4JVRUJydYSdGMumH+FEePwzSmHjlORcIwLOrEJzjEAkAw50KMz
	nceHgCjYd2FYw9vjOGJZGKWdooUWBNkWhev5f0T89aZaX+2tdcP5p60pX5sBjm0JoIMo
	dypA==
X-Gm-Message-State: AG10YOTDr8LVdKEX4APavahZnQh4kpAlAKLJJejw2AsmXJBZMIMlrFD08vvNIPw/IaDS+g==
X-Received: by 10.28.14.138 with SMTP id 132mr4102793wmo.25.1453478702787;
	Fri, 22 Jan 2016 08:05:02 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	w80sm3526627wme.17.2016.01.22.08.05.01
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Fri, 22 Jan 2016 08:05:02 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Fri, 22 Jan 2016 16:04:56 +0000
Message-Id: <1453478697-10104-2-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
In-Reply-To: <1453478697-10104-1-git-send-email-paul.durrant@citrix.com>
References: <1453478697-10104-1-git-send-email-paul.durrant@citrix.com>
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH 2/3] Avoid falling foul of stupid registry
	values
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Without this patch mistakenly setting 'FrontendMaxQueues' to 0 in the
registry will cause an unobvious BSOD.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xenvif/frontend.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/xenvif/frontend.c b/src/xenvif/frontend.c
index 9500a58..8f5a492 100644
--- a/src/xenvif/frontend.c
+++ b/src/xenvif/frontend.c
@@ -236,6 +236,9 @@ FrontendSetMaxQueues(
     if (NT_SUCCESS(status) && FrontendMaxQueues < Frontend->MaxQueues)
         Frontend->MaxQueues = FrontendMaxQueues;
 
+    if (Frontend->MaxQueues == 0)
+        Frontend->MaxQueues = 1;
+
     Info("%s: %u\n", __FrontendGetPath(Frontend), Frontend->MaxQueues);
 }
 
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Fri Jan 22 16:05:06 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 22 Jan 2016 16:05:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aMeCv-0004bB-NI; Fri, 22 Jan 2016 16:05:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aMeCt-0004ao-SS
	for win-pv-devel@lists.xenproject.org; Fri, 22 Jan 2016 16:05:04 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	7C/B2-12072-F2352A65; Fri, 22 Jan 2016 16:05:03 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1453478702!17281311!1
X-Originating-IP: [74.125.82.67]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 55902 invoked from network); 22 Jan 2016 16:05:02 -0000
Received: from mail-wm0-f67.google.com (HELO mail-wm0-f67.google.com)
	(74.125.82.67)
	by server-15.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 22 Jan 2016 16:05:02 -0000
Received: by mail-wm0-f67.google.com with SMTP id l65so18285996wmf.3
	for <win-pv-devel@lists.xenproject.org>;
	Fri, 22 Jan 2016 08:05:02 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=Fa4qu4hA0wrWD5DauahxHhu46jko4PmLlMm+8UC1h7A=;
	b=sDPULV/iUM2c0RvRr2x++vavCDq4WnquG7+ViXF5hkuaWdgjyh8q3VuHS3J4tGhjfB
	uX+6JHHPB01z43HTzbYKamBeVcQI6g1Y2oWxxv5i4I4BvICNyw8BITBNl8J6UnUQcs8f
	5tSU6B216YQxjDAIdFxDYoIk+3jfodMguy5oEi/p+4h0c93SpgHaca6A7BrtD61kUwPs
	4bLwi1iUOGIzZfNDEtNqEjC/s1daeCEiCWU+iRzEZMj+oZu2ssptBTpuet7SL+uFzcgA
	cii8tavqDcMh0YU+FUUEK+tAus4DiDUAQ3bwPtqbr3xDulYSK1Bp0FfpFnHh3h5h4i2S
	5NmA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id;
	bh=Fa4qu4hA0wrWD5DauahxHhu46jko4PmLlMm+8UC1h7A=;
	b=Qkf6QBwjL4H/89Fo5zIGzbS48uMRCDoEco6JPXkXXkZTzGhHIpwskGqlGA7nbU7Srz
	07i6MTUMQlNsi/9UxpJ1dO/UGV5bpKgqRyVnHY8gK7/D1dkP20CM0l2DiMaIr+nWJZGM
	uzADyGK2Cm/u8IpTosq3OCztRrrU4qVcwK4Qfs2W41/4DgTG1UyCYB5VsHfCbIgv7Nj9
	eMJEeA+6t1SUR+iNM/CvkV/MtlXeqmZv+4REXigR9FJ9irYWwJAGEPV1GkEpqomZINNW
	6Qyai9UcmEyQ3UzhAmzWDfUyn+XICjZe1ahTEegZ8hkzU0WkmHH55QXP9sXe/4q0z/tu
	sfkA==
X-Gm-Message-State: AG10YOSaHXZd8QUnBhO4Fxtf/tM6Rqzi/IGzW6w7guQSzdLLPHEwP2uiNr+bjBE8zMZPVw==
X-Received: by 10.28.53.193 with SMTP id c184mr4303498wma.4.1453478701878;
	Fri, 22 Jan 2016 08:05:01 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	w80sm3526627wme.17.2016.01.22.08.05.00
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Fri, 22 Jan 2016 08:05:01 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Fri, 22 Jan 2016 16:04:55 +0000
Message-Id: <1453478697-10104-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH 1/3] Fix DPC accounting
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

The DPC count is not zeroed when the event count is zeroed leading to some
odd looking stats. Also the DPC count should really be incremented by the
DPC itself to ensure serialization.

While in the neighbourhood, the ring notify functions in transmitter and
receiver look a little superfluous; they can easily be folded directly
into the DPC if the receiver code triggers the transmmitter DPC in the case
of a combined event channel.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xenvif/receiver.c    | 43 ++++++++++++++++++-------------------------
 src/xenvif/transmitter.c | 48 +++++++++++++++++++++++++-----------------------
 2 files changed, 43 insertions(+), 48 deletions(-)

diff --git a/src/xenvif/receiver.c b/src/xenvif/receiver.c
index 62ca1c8..29877f2 100644
--- a/src/xenvif/receiver.c
+++ b/src/xenvif/receiver.c
@@ -1982,16 +1982,6 @@ ReceiverRingPoll(
 }
 
 static FORCEINLINE VOID
-__ReceiverRingNotify(
-    IN  PXENVIF_RECEIVER_RING   Ring
-    )
-{
-    __ReceiverRingAcquireLock(Ring);
-    ReceiverRingPoll(Ring);
-    __ReceiverRingReleaseLock(Ring);
-}
-
-static FORCEINLINE VOID
 __ReceiverRingUnmask(
     IN  PXENVIF_RECEIVER_RING   Ring
     )
@@ -2023,8 +2013,6 @@ ReceiverRingDpc(
     )
 {
     PXENVIF_RECEIVER_RING   Ring = Context;
-    PXENVIF_RECEIVER        Receiver;
-    PXENVIF_FRONTEND        Frontend;
 
     UNREFERENCED_PARAMETER(Dpc);
     UNREFERENCED_PARAMETER(Argument1);
@@ -2032,16 +2020,14 @@ ReceiverRingDpc(
 
     ASSERT(Ring != NULL);
 
-    Receiver = Ring->Receiver;
-    Frontend = Receiver->Frontend;
+    Ring->Dpcs++;
 
-    if (Ring->Enabled) {
-        __ReceiverRingNotify(Ring);
-        if (!FrontendIsSplit(Frontend))
-            TransmitterNotify(FrontendGetTransmitter(Frontend),
-                              Ring->Index);
-    }
+    __ReceiverRingAcquireLock(Ring);
+
+    if (Ring->Enabled)
+        ReceiverRingPoll(Ring);
 
+    __ReceiverRingReleaseLock(Ring);
     __ReceiverRingUnmask(Ring);
 }
 
@@ -2054,6 +2040,8 @@ ReceiverRingEvtchnCallback(
     )
 {
     PXENVIF_RECEIVER_RING       Ring = Argument;
+    PXENVIF_RECEIVER            Receiver;
+    PXENVIF_FRONTEND            Frontend;
 
     UNREFERENCED_PARAMETER(InterruptObject);
 
@@ -2061,8 +2049,14 @@ ReceiverRingEvtchnCallback(
 
     Ring->Events++;
 
-    if (KeInsertQueueDpc(&Ring->Dpc, NULL, NULL))
-        Ring->Dpcs++;
+    (VOID) KeInsertQueueDpc(&Ring->Dpc, NULL, NULL);
+
+    Receiver = Ring->Receiver;
+    Frontend = Receiver->Frontend;
+
+    if (!FrontendIsSplit(Frontend))
+        TransmitterNotify(FrontendGetTransmitter(Frontend),
+                          Ring->Index);
 
     return TRUE;
 }
@@ -2529,8 +2523,7 @@ __ReceiverRingEnable(
 
     Ring->Enabled = TRUE;
 
-    if (KeInsertQueueDpc(&Ring->Dpc, NULL, NULL))
-        Ring->Dpcs++;
+    (VOID) KeInsertQueueDpc(&Ring->Dpc, NULL, NULL);
 
     __ReceiverRingReleaseLock(Ring);
 
@@ -2581,6 +2574,7 @@ __ReceiverRingDisconnect(
     Ring->Channel = NULL;
 
     Ring->Events = 0;
+    Ring->Dpcs = 0;
 
     ASSERT3U(Ring->ResponsesProcessed, ==, Ring->RequestsPushed);
     ASSERT3U(Ring->RequestsPushed, ==, Ring->RequestsPosted);
@@ -2635,7 +2629,6 @@ __ReceiverRingTeardown(
     Receiver = Ring->Receiver;
     Frontend = Receiver->Frontend;
 
-    Ring->Dpcs = 0;
     RtlZeroMemory(&Ring->Dpc, sizeof (KDPC));
 
     Ring->BackfillSize = 0;
diff --git a/src/xenvif/transmitter.c b/src/xenvif/transmitter.c
index f6766ce..fdb1334 100644
--- a/src/xenvif/transmitter.c
+++ b/src/xenvif/transmitter.c
@@ -2913,16 +2913,6 @@ TransmitterRingReleaseLock(
 }
 
 static FORCEINLINE VOID
-__TransmitterRingNotify(
-    IN  PXENVIF_TRANSMITTER_RING    Ring
-    )
-{
-    __TransmitterRingAcquireLock(Ring);
-    TransmitterRingPoll(Ring);
-    __TransmitterRingReleaseLock(Ring);
-}
-
-static FORCEINLINE VOID
 __TransmitterRingUnmask(
     IN  PXENVIF_TRANSMITTER_RING    Ring
     )
@@ -2954,7 +2944,6 @@ TransmitterRingDpc(
     )
 {
     PXENVIF_TRANSMITTER_RING    Ring = Context;
-    PXENVIF_TRANSMITTER         Transmitter;
 
     UNREFERENCED_PARAMETER(Dpc);
     UNREFERENCED_PARAMETER(Argument1);
@@ -2962,11 +2951,14 @@ TransmitterRingDpc(
 
     ASSERT(Ring != NULL);
 
-    Transmitter = Ring->Transmitter;
+    Ring->Dpcs++;
+
+    __TransmitterRingAcquireLock(Ring);
 
     if (Ring->Enabled)
-        __TransmitterRingNotify(Ring);
+        TransmitterRingPoll(Ring);
 
+    __TransmitterRingReleaseLock(Ring);
     __TransmitterRingUnmask(Ring);
 }
 
@@ -2980,17 +2972,20 @@ TransmitterRingEvtchnCallback(
 {
     PXENVIF_TRANSMITTER_RING    Ring = Argument;
     PXENVIF_TRANSMITTER         Transmitter;
+    PXENVIF_FRONTEND            Frontend;
 
     UNREFERENCED_PARAMETER(InterruptObject);
 
     ASSERT(Ring != NULL);
 
     Transmitter = Ring->Transmitter;
+    Frontend = Transmitter->Frontend;
+
+    ASSERT(FrontendIsSplit(Frontend));
 
     Ring->Events++;
 
-    if (KeInsertQueueDpc(&Ring->Dpc, NULL, NULL))
-        Ring->Dpcs++;
+    (VOID) KeInsertQueueDpc(&Ring->Dpc, NULL, NULL);
 
     return TRUE;
 }
@@ -3565,9 +3560,8 @@ __TransmitterRingEnable(
     ASSERT(!Ring->Enabled);
     Ring->Enabled = TRUE;
 
-    if (FrontendIsSplit(Frontend) &&
-        KeInsertQueueDpc(&Ring->Dpc, NULL, NULL))
-        Ring->Dpcs++;
+    if (FrontendIsSplit(Frontend))
+        KeInsertQueueDpc(&Ring->Dpc, NULL, NULL);
 
     __TransmitterRingReleaseLock(Ring);
 
@@ -3681,6 +3675,8 @@ __TransmitterRingDisconnect(
         Ring->Events = 0;
     }
 
+    Ring->Dpcs = 0;
+
     ASSERT3U(Ring->ResponsesProcessed, ==, Ring->RequestsPushed);
     ASSERT3U(Ring->RequestsPushed, ==, Ring->RequestsPosted);
 
@@ -3755,7 +3751,6 @@ __TransmitterRingTeardown(
     Transmitter = Ring->Transmitter;
     Frontend = Transmitter->Frontend;
 
-    Ring->Dpcs = 0;
     RtlZeroMemory(&Ring->Dpc, sizeof (KDPC));
 
     ASSERT3U(Ring->PacketsCompleted, ==, Ring->PacketsSent);
@@ -4568,16 +4563,18 @@ __TransmitterHashPacket(
     PIP_HEADER                      IpHeader;
     ULONG                           Value;
 
-    Value = 0;
-
     StartVa = Packet->Header;
     Info = &Packet->Info;
 
-    if (Info->IpHeader.Length == 0)
+    if (Info->IpHeader.Length == 0) {
+        Value = KeGetCurrentProcessorNumberEx(NULL);
         goto done;
+    }
 
     IpHeader = (PIP_HEADER)(StartVa + Info->IpHeader.Offset);
 
+    Value = 0;
+
     if (IpHeader->Version == 4) {
         PIPV4_HEADER    Version4 = &IpHeader->Version4;
 
@@ -4781,11 +4778,16 @@ TransmitterNotify(
     IN  ULONG                   Index
     )
 {
+    PXENVIF_FRONTEND            Frontend;
     PXENVIF_TRANSMITTER_RING    Ring;
 
+    Frontend = Transmitter->Frontend;
+
+    ASSERT(!FrontendIsSplit(Frontend));
+
     Ring = Transmitter->Ring[Index];
 
-    __TransmitterRingNotify(Ring);
+    (VOID) KeInsertQueueDpc(&Ring->Dpc, NULL, NULL);
 }
 
 VOID
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Fri Jan 22 16:05:06 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 22 Jan 2016 16:05:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aMeCv-0004bF-PM; Fri, 22 Jan 2016 16:05:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aMeCu-0004aq-1j
	for win-pv-devel@lists.xenproject.org; Fri, 22 Jan 2016 16:05:04 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	22/2C-07651-F2352A65; Fri, 22 Jan 2016 16:05:03 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1453478702!7973825!1
X-Originating-IP: [74.125.82.68]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 35977 invoked from network); 22 Jan 2016 16:05:02 -0000
Received: from mail-wm0-f68.google.com (HELO mail-wm0-f68.google.com)
	(74.125.82.68)
	by server-4.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 22 Jan 2016 16:05:02 -0000
Received: by mail-wm0-f68.google.com with SMTP id b14so18131343wmb.1
	for <win-pv-devel@lists.xenproject.org>;
	Fri, 22 Jan 2016 08:05:02 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:in-reply-to:references;
	bh=C5gS2g5VHSrvYZyKgP7pb41YaVnNISef3bLn9AntgxQ=;
	b=qdZPQJJHHAE9DVbHNVfXHjknIhuiGJ/DuU64KuQAVcXzvBcXgMyV2AXoZQi6MLySMT
	fgh/X25CqpBpnpKtVd7dfFmyvhg+H9BzGfDmg5tx/q5cSL7In3n6nP5aGhuwD12Pdv9w
	8dpFieLapYY3jX3QBAFfIKoFxeFZ6Z1Oqsg3NUpebBIsvVrP7nSms9NqCwvr0XZEd5m8
	xrrvpmpc65x+Q6WdwSig0dQvwh/RQdQN2Tlm+dkZBbh+fDMJVitFqF08DbxE44ORthrI
	bGyU5yjuJcrraeNSBKnVY2WWpHERbQikoVXt4EDzXONyC+rM/gM+jdNyLVErro3pRYvN
	Nvqw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
	:references;
	bh=C5gS2g5VHSrvYZyKgP7pb41YaVnNISef3bLn9AntgxQ=;
	b=Z+gH7OFZPtio1y9GEzfViDiTrBRPiyA3vgAKYaexNlHpQDHdTARJaOMWrGPOmldLk9
	H6PGFVhXgfvZvrbfraU0FWytLSzTXtEeRIfkOUlxRQFLv0VaVhqbO001X5JPFSxQNg6z
	YKEpvfY9kt6fY7byc+gX3OlSuINt4igdllA3LMFiCHgdUJL2C/flyVGxraybqKHaa8Cz
	nTkuimRUumjMU4UQEO4JVRUJydYSdGMumH+FEePwzSmHjlORcIwLOrEJzjEAkAw50KMz
	nceHgCjYd2FYw9vjOGJZGKWdooUWBNkWhev5f0T89aZaX+2tdcP5p60pX5sBjm0JoIMo
	dypA==
X-Gm-Message-State: AG10YOTDr8LVdKEX4APavahZnQh4kpAlAKLJJejw2AsmXJBZMIMlrFD08vvNIPw/IaDS+g==
X-Received: by 10.28.14.138 with SMTP id 132mr4102793wmo.25.1453478702787;
	Fri, 22 Jan 2016 08:05:02 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	w80sm3526627wme.17.2016.01.22.08.05.01
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Fri, 22 Jan 2016 08:05:02 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Fri, 22 Jan 2016 16:04:56 +0000
Message-Id: <1453478697-10104-2-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
In-Reply-To: <1453478697-10104-1-git-send-email-paul.durrant@citrix.com>
References: <1453478697-10104-1-git-send-email-paul.durrant@citrix.com>
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH 2/3] Avoid falling foul of stupid registry
	values
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Without this patch mistakenly setting 'FrontendMaxQueues' to 0 in the
registry will cause an unobvious BSOD.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xenvif/frontend.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/xenvif/frontend.c b/src/xenvif/frontend.c
index 9500a58..8f5a492 100644
--- a/src/xenvif/frontend.c
+++ b/src/xenvif/frontend.c
@@ -236,6 +236,9 @@ FrontendSetMaxQueues(
     if (NT_SUCCESS(status) && FrontendMaxQueues < Frontend->MaxQueues)
         Frontend->MaxQueues = FrontendMaxQueues;
 
+    if (Frontend->MaxQueues == 0)
+        Frontend->MaxQueues = 1;
+
     Info("%s: %u\n", __FrontendGetPath(Frontend), Frontend->MaxQueues);
 }
 
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Fri Jan 22 16:05:06 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 22 Jan 2016 16:05:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aMeCv-0004bB-NI; Fri, 22 Jan 2016 16:05:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aMeCt-0004ao-SS
	for win-pv-devel@lists.xenproject.org; Fri, 22 Jan 2016 16:05:04 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	7C/B2-12072-F2352A65; Fri, 22 Jan 2016 16:05:03 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1453478702!17281311!1
X-Originating-IP: [74.125.82.67]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 55902 invoked from network); 22 Jan 2016 16:05:02 -0000
Received: from mail-wm0-f67.google.com (HELO mail-wm0-f67.google.com)
	(74.125.82.67)
	by server-15.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 22 Jan 2016 16:05:02 -0000
Received: by mail-wm0-f67.google.com with SMTP id l65so18285996wmf.3
	for <win-pv-devel@lists.xenproject.org>;
	Fri, 22 Jan 2016 08:05:02 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=Fa4qu4hA0wrWD5DauahxHhu46jko4PmLlMm+8UC1h7A=;
	b=sDPULV/iUM2c0RvRr2x++vavCDq4WnquG7+ViXF5hkuaWdgjyh8q3VuHS3J4tGhjfB
	uX+6JHHPB01z43HTzbYKamBeVcQI6g1Y2oWxxv5i4I4BvICNyw8BITBNl8J6UnUQcs8f
	5tSU6B216YQxjDAIdFxDYoIk+3jfodMguy5oEi/p+4h0c93SpgHaca6A7BrtD61kUwPs
	4bLwi1iUOGIzZfNDEtNqEjC/s1daeCEiCWU+iRzEZMj+oZu2ssptBTpuet7SL+uFzcgA
	cii8tavqDcMh0YU+FUUEK+tAus4DiDUAQ3bwPtqbr3xDulYSK1Bp0FfpFnHh3h5h4i2S
	5NmA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id;
	bh=Fa4qu4hA0wrWD5DauahxHhu46jko4PmLlMm+8UC1h7A=;
	b=Qkf6QBwjL4H/89Fo5zIGzbS48uMRCDoEco6JPXkXXkZTzGhHIpwskGqlGA7nbU7Srz
	07i6MTUMQlNsi/9UxpJ1dO/UGV5bpKgqRyVnHY8gK7/D1dkP20CM0l2DiMaIr+nWJZGM
	uzADyGK2Cm/u8IpTosq3OCztRrrU4qVcwK4Qfs2W41/4DgTG1UyCYB5VsHfCbIgv7Nj9
	eMJEeA+6t1SUR+iNM/CvkV/MtlXeqmZv+4REXigR9FJ9irYWwJAGEPV1GkEpqomZINNW
	6Qyai9UcmEyQ3UzhAmzWDfUyn+XICjZe1ahTEegZ8hkzU0WkmHH55QXP9sXe/4q0z/tu
	sfkA==
X-Gm-Message-State: AG10YOSaHXZd8QUnBhO4Fxtf/tM6Rqzi/IGzW6w7guQSzdLLPHEwP2uiNr+bjBE8zMZPVw==
X-Received: by 10.28.53.193 with SMTP id c184mr4303498wma.4.1453478701878;
	Fri, 22 Jan 2016 08:05:01 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	w80sm3526627wme.17.2016.01.22.08.05.00
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Fri, 22 Jan 2016 08:05:01 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Fri, 22 Jan 2016 16:04:55 +0000
Message-Id: <1453478697-10104-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH 1/3] Fix DPC accounting
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

The DPC count is not zeroed when the event count is zeroed leading to some
odd looking stats. Also the DPC count should really be incremented by the
DPC itself to ensure serialization.

While in the neighbourhood, the ring notify functions in transmitter and
receiver look a little superfluous; they can easily be folded directly
into the DPC if the receiver code triggers the transmmitter DPC in the case
of a combined event channel.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xenvif/receiver.c    | 43 ++++++++++++++++++-------------------------
 src/xenvif/transmitter.c | 48 +++++++++++++++++++++++++-----------------------
 2 files changed, 43 insertions(+), 48 deletions(-)

diff --git a/src/xenvif/receiver.c b/src/xenvif/receiver.c
index 62ca1c8..29877f2 100644
--- a/src/xenvif/receiver.c
+++ b/src/xenvif/receiver.c
@@ -1982,16 +1982,6 @@ ReceiverRingPoll(
 }
 
 static FORCEINLINE VOID
-__ReceiverRingNotify(
-    IN  PXENVIF_RECEIVER_RING   Ring
-    )
-{
-    __ReceiverRingAcquireLock(Ring);
-    ReceiverRingPoll(Ring);
-    __ReceiverRingReleaseLock(Ring);
-}
-
-static FORCEINLINE VOID
 __ReceiverRingUnmask(
     IN  PXENVIF_RECEIVER_RING   Ring
     )
@@ -2023,8 +2013,6 @@ ReceiverRingDpc(
     )
 {
     PXENVIF_RECEIVER_RING   Ring = Context;
-    PXENVIF_RECEIVER        Receiver;
-    PXENVIF_FRONTEND        Frontend;
 
     UNREFERENCED_PARAMETER(Dpc);
     UNREFERENCED_PARAMETER(Argument1);
@@ -2032,16 +2020,14 @@ ReceiverRingDpc(
 
     ASSERT(Ring != NULL);
 
-    Receiver = Ring->Receiver;
-    Frontend = Receiver->Frontend;
+    Ring->Dpcs++;
 
-    if (Ring->Enabled) {
-        __ReceiverRingNotify(Ring);
-        if (!FrontendIsSplit(Frontend))
-            TransmitterNotify(FrontendGetTransmitter(Frontend),
-                              Ring->Index);
-    }
+    __ReceiverRingAcquireLock(Ring);
+
+    if (Ring->Enabled)
+        ReceiverRingPoll(Ring);
 
+    __ReceiverRingReleaseLock(Ring);
     __ReceiverRingUnmask(Ring);
 }
 
@@ -2054,6 +2040,8 @@ ReceiverRingEvtchnCallback(
     )
 {
     PXENVIF_RECEIVER_RING       Ring = Argument;
+    PXENVIF_RECEIVER            Receiver;
+    PXENVIF_FRONTEND            Frontend;
 
     UNREFERENCED_PARAMETER(InterruptObject);
 
@@ -2061,8 +2049,14 @@ ReceiverRingEvtchnCallback(
 
     Ring->Events++;
 
-    if (KeInsertQueueDpc(&Ring->Dpc, NULL, NULL))
-        Ring->Dpcs++;
+    (VOID) KeInsertQueueDpc(&Ring->Dpc, NULL, NULL);
+
+    Receiver = Ring->Receiver;
+    Frontend = Receiver->Frontend;
+
+    if (!FrontendIsSplit(Frontend))
+        TransmitterNotify(FrontendGetTransmitter(Frontend),
+                          Ring->Index);
 
     return TRUE;
 }
@@ -2529,8 +2523,7 @@ __ReceiverRingEnable(
 
     Ring->Enabled = TRUE;
 
-    if (KeInsertQueueDpc(&Ring->Dpc, NULL, NULL))
-        Ring->Dpcs++;
+    (VOID) KeInsertQueueDpc(&Ring->Dpc, NULL, NULL);
 
     __ReceiverRingReleaseLock(Ring);
 
@@ -2581,6 +2574,7 @@ __ReceiverRingDisconnect(
     Ring->Channel = NULL;
 
     Ring->Events = 0;
+    Ring->Dpcs = 0;
 
     ASSERT3U(Ring->ResponsesProcessed, ==, Ring->RequestsPushed);
     ASSERT3U(Ring->RequestsPushed, ==, Ring->RequestsPosted);
@@ -2635,7 +2629,6 @@ __ReceiverRingTeardown(
     Receiver = Ring->Receiver;
     Frontend = Receiver->Frontend;
 
-    Ring->Dpcs = 0;
     RtlZeroMemory(&Ring->Dpc, sizeof (KDPC));
 
     Ring->BackfillSize = 0;
diff --git a/src/xenvif/transmitter.c b/src/xenvif/transmitter.c
index f6766ce..fdb1334 100644
--- a/src/xenvif/transmitter.c
+++ b/src/xenvif/transmitter.c
@@ -2913,16 +2913,6 @@ TransmitterRingReleaseLock(
 }
 
 static FORCEINLINE VOID
-__TransmitterRingNotify(
-    IN  PXENVIF_TRANSMITTER_RING    Ring
-    )
-{
-    __TransmitterRingAcquireLock(Ring);
-    TransmitterRingPoll(Ring);
-    __TransmitterRingReleaseLock(Ring);
-}
-
-static FORCEINLINE VOID
 __TransmitterRingUnmask(
     IN  PXENVIF_TRANSMITTER_RING    Ring
     )
@@ -2954,7 +2944,6 @@ TransmitterRingDpc(
     )
 {
     PXENVIF_TRANSMITTER_RING    Ring = Context;
-    PXENVIF_TRANSMITTER         Transmitter;
 
     UNREFERENCED_PARAMETER(Dpc);
     UNREFERENCED_PARAMETER(Argument1);
@@ -2962,11 +2951,14 @@ TransmitterRingDpc(
 
     ASSERT(Ring != NULL);
 
-    Transmitter = Ring->Transmitter;
+    Ring->Dpcs++;
+
+    __TransmitterRingAcquireLock(Ring);
 
     if (Ring->Enabled)
-        __TransmitterRingNotify(Ring);
+        TransmitterRingPoll(Ring);
 
+    __TransmitterRingReleaseLock(Ring);
     __TransmitterRingUnmask(Ring);
 }
 
@@ -2980,17 +2972,20 @@ TransmitterRingEvtchnCallback(
 {
     PXENVIF_TRANSMITTER_RING    Ring = Argument;
     PXENVIF_TRANSMITTER         Transmitter;
+    PXENVIF_FRONTEND            Frontend;
 
     UNREFERENCED_PARAMETER(InterruptObject);
 
     ASSERT(Ring != NULL);
 
     Transmitter = Ring->Transmitter;
+    Frontend = Transmitter->Frontend;
+
+    ASSERT(FrontendIsSplit(Frontend));
 
     Ring->Events++;
 
-    if (KeInsertQueueDpc(&Ring->Dpc, NULL, NULL))
-        Ring->Dpcs++;
+    (VOID) KeInsertQueueDpc(&Ring->Dpc, NULL, NULL);
 
     return TRUE;
 }
@@ -3565,9 +3560,8 @@ __TransmitterRingEnable(
     ASSERT(!Ring->Enabled);
     Ring->Enabled = TRUE;
 
-    if (FrontendIsSplit(Frontend) &&
-        KeInsertQueueDpc(&Ring->Dpc, NULL, NULL))
-        Ring->Dpcs++;
+    if (FrontendIsSplit(Frontend))
+        KeInsertQueueDpc(&Ring->Dpc, NULL, NULL);
 
     __TransmitterRingReleaseLock(Ring);
 
@@ -3681,6 +3675,8 @@ __TransmitterRingDisconnect(
         Ring->Events = 0;
     }
 
+    Ring->Dpcs = 0;
+
     ASSERT3U(Ring->ResponsesProcessed, ==, Ring->RequestsPushed);
     ASSERT3U(Ring->RequestsPushed, ==, Ring->RequestsPosted);
 
@@ -3755,7 +3751,6 @@ __TransmitterRingTeardown(
     Transmitter = Ring->Transmitter;
     Frontend = Transmitter->Frontend;
 
-    Ring->Dpcs = 0;
     RtlZeroMemory(&Ring->Dpc, sizeof (KDPC));
 
     ASSERT3U(Ring->PacketsCompleted, ==, Ring->PacketsSent);
@@ -4568,16 +4563,18 @@ __TransmitterHashPacket(
     PIP_HEADER                      IpHeader;
     ULONG                           Value;
 
-    Value = 0;
-
     StartVa = Packet->Header;
     Info = &Packet->Info;
 
-    if (Info->IpHeader.Length == 0)
+    if (Info->IpHeader.Length == 0) {
+        Value = KeGetCurrentProcessorNumberEx(NULL);
         goto done;
+    }
 
     IpHeader = (PIP_HEADER)(StartVa + Info->IpHeader.Offset);
 
+    Value = 0;
+
     if (IpHeader->Version == 4) {
         PIPV4_HEADER    Version4 = &IpHeader->Version4;
 
@@ -4781,11 +4778,16 @@ TransmitterNotify(
     IN  ULONG                   Index
     )
 {
+    PXENVIF_FRONTEND            Frontend;
     PXENVIF_TRANSMITTER_RING    Ring;
 
+    Frontend = Transmitter->Frontend;
+
+    ASSERT(!FrontendIsSplit(Frontend));
+
     Ring = Transmitter->Ring[Index];
 
-    __TransmitterRingNotify(Ring);
+    (VOID) KeInsertQueueDpc(&Ring->Dpc, NULL, NULL);
 }
 
 VOID
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Fri Jan 22 16:05:06 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 22 Jan 2016 16:05:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aMeCw-0004bp-RP; Fri, 22 Jan 2016 16:05:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aMeCu-0004b1-V4
	for win-pv-devel@lists.xenproject.org; Fri, 22 Jan 2016 16:05:05 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	04/72-17089-03352A65; Fri, 22 Jan 2016 16:05:04 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1453478703!17570308!1
X-Originating-IP: [74.125.82.65]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 60612 invoked from network); 22 Jan 2016 16:05:03 -0000
Received: from mail-wm0-f65.google.com (HELO mail-wm0-f65.google.com)
	(74.125.82.65)
	by server-3.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 22 Jan 2016 16:05:03 -0000
Received: by mail-wm0-f65.google.com with SMTP id b14so18131407wmb.1
	for <win-pv-devel@lists.xenproject.org>;
	Fri, 22 Jan 2016 08:05:03 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:in-reply-to:references;
	bh=9e6NgWQpqnDOAUn9BWtURMb4STwijluZ6ua+iVrbGRg=;
	b=C3bUKkN3c7ODzoV3eIj5YBI0zokOSFP2s/wPcDIStHbhVEpm67fqYs1eMvpLlFpR3y
	+zJhQeezh5bEM62tF3tl8E4V71tW3RDE5qKFq8+slvSn88t+u2Weqm5GkfN5HZ3QfSkU
	sstW1GY6TAtnXqwjFFhoFYcZ1KBtjQU06I4jIbitNQDEjwWWQ6CmuLyoJEYcV9YTH3Ln
	dDyfOyb8P8ouRSdT0qMKaQaqw+QJUavy3XJ0gsKzqTn2Uti9FQu53D4+7bniQD9em+am
	sc/XhscTdZZ856xjl7v2cFjZ0+uDD9L4YE6otbc2OSf7SWrk6QgkM0oM9Up402dGcshg
	aMlQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
	:references;
	bh=9e6NgWQpqnDOAUn9BWtURMb4STwijluZ6ua+iVrbGRg=;
	b=J9fyV+PHhFKSdNRMfsnacT0rr+PP99pPeeuMkdwziOJWKZT1LAkob3wtdM8/TWm7+J
	9XKz/9di7rkUWLXeFMJtppOix0QgtbolKydMg1t5xJmYo8Wd/G44E/tLww7IHIlazEJJ
	6fG8A9Yo7j+sIOyAcXpxpcH9NNLabrB/sOxl4dDhdtsumAXCS6AUd67BW0cMUgqAYsMB
	5krpDhrg2veQ+qFIB/Y+3w8yUPAcvzVIR0pyGn9185HqrhRc+gdURKanYgXaC8OUAaMF
	NjC0u5t3tvcLAaqfR1rlY0+4sAtD+KZUkHbyoexNy+O7bAQ3mVm3gu50kkXGmmNd+RdC
	LB3Q==
X-Gm-Message-State: AG10YOQSOl5pldFUU/0oSJ4uklZR4yvn5XXXUtWuuEGeFbA1MakxliVVDaaHgc4CQt27zg==
X-Received: by 10.194.87.201 with SMTP id ba9mr3621693wjb.128.1453478703466;
	Fri, 22 Jan 2016 08:05:03 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	w80sm3526627wme.17.2016.01.22.08.05.02
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Fri, 22 Jan 2016 08:05:03 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Fri, 22 Jan 2016 16:04:57 +0000
Message-Id: <1453478697-10104-3-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
In-Reply-To: <1453478697-10104-1-git-send-email-paul.durrant@citrix.com>
References: <1453478697-10104-1-git-send-email-paul.durrant@citrix.com>
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH 3/3] Avoid evaluating assertion expressions
	in free builds
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

The evaluations are pointless and the warnings generated by not evaluating
can be squashed with a couple of #pragmas.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xenvif/assert.h | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/src/xenvif/assert.h b/src/xenvif/assert.h
index 9d6c3d3..110f4ef 100644
--- a/src/xenvif/assert.h
+++ b/src/xenvif/assert.h
@@ -126,18 +126,12 @@ __Bug(
 
 #else   // DBG
 
-static FORCEINLINE VOID
-_IgnoreAssertion(
-    IN  BOOLEAN Value
-    )
-{
-    UNREFERENCED_PARAMETER(Value);
-}
+#pragma warning(disable:4100)
+#pragma warning(disable:4189)
 
-#define ASSERT(_EXP)                        \
-        do {                                \
-            _IgnoreAssertion(_EXP);         \
-            __analysis_assume(_EXP);        \
+#define ASSERT(_EXP)                    \
+        do {                            \
+            __analysis_assume(_EXP);    \
         } while (FALSE)
 
 #define ASSERT3U(_X, _OP, _Y)           \
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Fri Jan 22 16:05:06 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 22 Jan 2016 16:05:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aMeCw-0004bp-RP; Fri, 22 Jan 2016 16:05:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aMeCu-0004b1-V4
	for win-pv-devel@lists.xenproject.org; Fri, 22 Jan 2016 16:05:05 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	04/72-17089-03352A65; Fri, 22 Jan 2016 16:05:04 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1453478703!17570308!1
X-Originating-IP: [74.125.82.65]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 60612 invoked from network); 22 Jan 2016 16:05:03 -0000
Received: from mail-wm0-f65.google.com (HELO mail-wm0-f65.google.com)
	(74.125.82.65)
	by server-3.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 22 Jan 2016 16:05:03 -0000
Received: by mail-wm0-f65.google.com with SMTP id b14so18131407wmb.1
	for <win-pv-devel@lists.xenproject.org>;
	Fri, 22 Jan 2016 08:05:03 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:in-reply-to:references;
	bh=9e6NgWQpqnDOAUn9BWtURMb4STwijluZ6ua+iVrbGRg=;
	b=C3bUKkN3c7ODzoV3eIj5YBI0zokOSFP2s/wPcDIStHbhVEpm67fqYs1eMvpLlFpR3y
	+zJhQeezh5bEM62tF3tl8E4V71tW3RDE5qKFq8+slvSn88t+u2Weqm5GkfN5HZ3QfSkU
	sstW1GY6TAtnXqwjFFhoFYcZ1KBtjQU06I4jIbitNQDEjwWWQ6CmuLyoJEYcV9YTH3Ln
	dDyfOyb8P8ouRSdT0qMKaQaqw+QJUavy3XJ0gsKzqTn2Uti9FQu53D4+7bniQD9em+am
	sc/XhscTdZZ856xjl7v2cFjZ0+uDD9L4YE6otbc2OSf7SWrk6QgkM0oM9Up402dGcshg
	aMlQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
	:references;
	bh=9e6NgWQpqnDOAUn9BWtURMb4STwijluZ6ua+iVrbGRg=;
	b=J9fyV+PHhFKSdNRMfsnacT0rr+PP99pPeeuMkdwziOJWKZT1LAkob3wtdM8/TWm7+J
	9XKz/9di7rkUWLXeFMJtppOix0QgtbolKydMg1t5xJmYo8Wd/G44E/tLww7IHIlazEJJ
	6fG8A9Yo7j+sIOyAcXpxpcH9NNLabrB/sOxl4dDhdtsumAXCS6AUd67BW0cMUgqAYsMB
	5krpDhrg2veQ+qFIB/Y+3w8yUPAcvzVIR0pyGn9185HqrhRc+gdURKanYgXaC8OUAaMF
	NjC0u5t3tvcLAaqfR1rlY0+4sAtD+KZUkHbyoexNy+O7bAQ3mVm3gu50kkXGmmNd+RdC
	LB3Q==
X-Gm-Message-State: AG10YOQSOl5pldFUU/0oSJ4uklZR4yvn5XXXUtWuuEGeFbA1MakxliVVDaaHgc4CQt27zg==
X-Received: by 10.194.87.201 with SMTP id ba9mr3621693wjb.128.1453478703466;
	Fri, 22 Jan 2016 08:05:03 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	w80sm3526627wme.17.2016.01.22.08.05.02
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Fri, 22 Jan 2016 08:05:03 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Fri, 22 Jan 2016 16:04:57 +0000
Message-Id: <1453478697-10104-3-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
In-Reply-To: <1453478697-10104-1-git-send-email-paul.durrant@citrix.com>
References: <1453478697-10104-1-git-send-email-paul.durrant@citrix.com>
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH 3/3] Avoid evaluating assertion expressions
	in free builds
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

The evaluations are pointless and the warnings generated by not evaluating
can be squashed with a couple of #pragmas.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xenvif/assert.h | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/src/xenvif/assert.h b/src/xenvif/assert.h
index 9d6c3d3..110f4ef 100644
--- a/src/xenvif/assert.h
+++ b/src/xenvif/assert.h
@@ -126,18 +126,12 @@ __Bug(
 
 #else   // DBG
 
-static FORCEINLINE VOID
-_IgnoreAssertion(
-    IN  BOOLEAN Value
-    )
-{
-    UNREFERENCED_PARAMETER(Value);
-}
+#pragma warning(disable:4100)
+#pragma warning(disable:4189)
 
-#define ASSERT(_EXP)                        \
-        do {                                \
-            _IgnoreAssertion(_EXP);         \
-            __analysis_assume(_EXP);        \
+#define ASSERT(_EXP)                    \
+        do {                            \
+            __analysis_assume(_EXP);    \
         } while (FALSE)
 
 #define ASSERT3U(_X, _OP, _Y)           \
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Fri Jan 22 16:06:24 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 22 Jan 2016 16:06:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aMeEC-0004ml-Ib; Fri, 22 Jan 2016 16:06:24 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aMeEB-0004mY-Ls
	for win-pv-devel@lists.xenproject.org; Fri, 22 Jan 2016 16:06:23 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	86/5D-12889-E7352A65; Fri, 22 Jan 2016 16:06:22 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1453478782!18736934!1
X-Originating-IP: [74.125.82.42]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 38424 invoked from network); 22 Jan 2016 16:06:22 -0000
Received: from mail-wm0-f42.google.com (HELO mail-wm0-f42.google.com)
	(74.125.82.42)
	by server-14.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 22 Jan 2016 16:06:22 -0000
Received: by mail-wm0-f42.google.com with SMTP id r129so219178263wmr.0
	for <win-pv-devel@lists.xenproject.org>;
	Fri, 22 Jan 2016 08:06:22 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=gYWzevktIewTA5oIGu61+HeGshusm3At3L085Vi4Q5U=;
	b=PRp0XLflmqQ3zBoL6owIb/HPYo8DTeB4yLOb4G4ZDv5pOGHI5zaXZyTs5XHCrkPELL
	R5rkzC4mxHuC0C8RNyKJ37hYfHnsOJevnhTeVXBBuGaU3Hmhc8svuWj5cL/uTRphWkpI
	jqJJaVwrQICtAbzwhRH2H1OVsbMdWOpCyMOrhI1FzDc49oXlwqEdQqIhFqRI7jETSBnF
	c7iZQl0GfTDwUOoEPLCdIHOJlrDf8sNgIENimOmIV3IFVcaHoCjlsdYfUCSpOC6Basry
	pYeN4cZSLPZb+x8fjYvOkXJS8xhM5XJb/aXm2HQCI9/5ny64mLavjd6RKMDgGaHZrsw4
	jecg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id;
	bh=gYWzevktIewTA5oIGu61+HeGshusm3At3L085Vi4Q5U=;
	b=ZizePiP7aD7XCrSQYDlu+C/KeiiwbwPF9xjKhX3HppoFZi4DQ3smOLN3L6YOHFgmaP
	fqMdDu1us2S8UA/2C/bq82h9D1+22ZPY/ivqBKiaT5ZADpSCbwsBCBDHWdR/o+f15jY1
	uEMqUKr0N49YxJCDWa3Be9eGxsonYP7ggMN1Yy+BArNZd5Z3z9LNYFhbYqVH6Rv7pC4N
	Kz/OomzuRT7Rb4Gd3I6DH7pJPEDOx7BzGs17rUEPOmJrFz8PuhJaR4lP5jmg3fjt5msU
	eUE5oFpkVcmPWnxGKLZqqVtIZkSy7Kc2rnAn7fMoTWhvQoS5Pv4K4frs6W5AiCLmkoRG
	OM2Q==
X-Gm-Message-State: AG10YOTvzJzgv7napSTAvp35CGDB7Q5fXX0cXHCmfe0dNyM/Bjf7I52AmWItM/nb9ezeIA==
X-Received: by 10.28.216.211 with SMTP id p202mr4573449wmg.84.1453478782101;
	Fri, 22 Jan 2016 08:06:22 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	e198sm3586378wmd.0.2016.01.22.08.06.21
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Fri, 22 Jan 2016 08:06:21 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Fri, 22 Jan 2016 16:06:20 +0000
Message-Id: <1453478780-5732-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Avoid evaluating assertion expressions in
	free builds
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

The evaluations are pointless and the warnings generated by not evaluating
can be squashed with a couple of #pragmas.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xennet/assert.h | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/src/xennet/assert.h b/src/xennet/assert.h
index 93334ea..f090461 100644
--- a/src/xennet/assert.h
+++ b/src/xennet/assert.h
@@ -126,18 +126,12 @@ __Bug(
 
 #else   // DBG
 
-static FORCEINLINE VOID
-_IgnoreAssertion(
-    IN  BOOLEAN Value
-    )
-{
-    UNREFERENCED_PARAMETER(Value);
-}
+#pragma warning(disable:4100)
+#pragma warning(disable:4189)
 
-#define ASSERT(_EXP)                        \
-        do {                                \
-            _IgnoreAssertion(_EXP);         \
-            __analysis_assume(_EXP);        \
+#define ASSERT(_EXP)                    \
+        do {                            \
+            __analysis_assume(_EXP);    \
         } while (FALSE)
 
 #define ASSERT3U(_X, _OP, _Y)           \
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Fri Jan 22 16:06:24 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 22 Jan 2016 16:06:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aMeEC-0004ml-Ib; Fri, 22 Jan 2016 16:06:24 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aMeEB-0004mY-Ls
	for win-pv-devel@lists.xenproject.org; Fri, 22 Jan 2016 16:06:23 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	86/5D-12889-E7352A65; Fri, 22 Jan 2016 16:06:22 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1453478782!18736934!1
X-Originating-IP: [74.125.82.42]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 38424 invoked from network); 22 Jan 2016 16:06:22 -0000
Received: from mail-wm0-f42.google.com (HELO mail-wm0-f42.google.com)
	(74.125.82.42)
	by server-14.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 22 Jan 2016 16:06:22 -0000
Received: by mail-wm0-f42.google.com with SMTP id r129so219178263wmr.0
	for <win-pv-devel@lists.xenproject.org>;
	Fri, 22 Jan 2016 08:06:22 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=gYWzevktIewTA5oIGu61+HeGshusm3At3L085Vi4Q5U=;
	b=PRp0XLflmqQ3zBoL6owIb/HPYo8DTeB4yLOb4G4ZDv5pOGHI5zaXZyTs5XHCrkPELL
	R5rkzC4mxHuC0C8RNyKJ37hYfHnsOJevnhTeVXBBuGaU3Hmhc8svuWj5cL/uTRphWkpI
	jqJJaVwrQICtAbzwhRH2H1OVsbMdWOpCyMOrhI1FzDc49oXlwqEdQqIhFqRI7jETSBnF
	c7iZQl0GfTDwUOoEPLCdIHOJlrDf8sNgIENimOmIV3IFVcaHoCjlsdYfUCSpOC6Basry
	pYeN4cZSLPZb+x8fjYvOkXJS8xhM5XJb/aXm2HQCI9/5ny64mLavjd6RKMDgGaHZrsw4
	jecg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id;
	bh=gYWzevktIewTA5oIGu61+HeGshusm3At3L085Vi4Q5U=;
	b=ZizePiP7aD7XCrSQYDlu+C/KeiiwbwPF9xjKhX3HppoFZi4DQ3smOLN3L6YOHFgmaP
	fqMdDu1us2S8UA/2C/bq82h9D1+22ZPY/ivqBKiaT5ZADpSCbwsBCBDHWdR/o+f15jY1
	uEMqUKr0N49YxJCDWa3Be9eGxsonYP7ggMN1Yy+BArNZd5Z3z9LNYFhbYqVH6Rv7pC4N
	Kz/OomzuRT7Rb4Gd3I6DH7pJPEDOx7BzGs17rUEPOmJrFz8PuhJaR4lP5jmg3fjt5msU
	eUE5oFpkVcmPWnxGKLZqqVtIZkSy7Kc2rnAn7fMoTWhvQoS5Pv4K4frs6W5AiCLmkoRG
	OM2Q==
X-Gm-Message-State: AG10YOTvzJzgv7napSTAvp35CGDB7Q5fXX0cXHCmfe0dNyM/Bjf7I52AmWItM/nb9ezeIA==
X-Received: by 10.28.216.211 with SMTP id p202mr4573449wmg.84.1453478782101;
	Fri, 22 Jan 2016 08:06:22 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	e198sm3586378wmd.0.2016.01.22.08.06.21
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Fri, 22 Jan 2016 08:06:21 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Fri, 22 Jan 2016 16:06:20 +0000
Message-Id: <1453478780-5732-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Avoid evaluating assertion expressions in
	free builds
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

The evaluations are pointless and the warnings generated by not evaluating
can be squashed with a couple of #pragmas.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xennet/assert.h | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/src/xennet/assert.h b/src/xennet/assert.h
index 93334ea..f090461 100644
--- a/src/xennet/assert.h
+++ b/src/xennet/assert.h
@@ -126,18 +126,12 @@ __Bug(
 
 #else   // DBG
 
-static FORCEINLINE VOID
-_IgnoreAssertion(
-    IN  BOOLEAN Value
-    )
-{
-    UNREFERENCED_PARAMETER(Value);
-}
+#pragma warning(disable:4100)
+#pragma warning(disable:4189)
 
-#define ASSERT(_EXP)                        \
-        do {                                \
-            _IgnoreAssertion(_EXP);         \
-            __analysis_assume(_EXP);        \
+#define ASSERT(_EXP)                    \
+        do {                            \
+            __analysis_assume(_EXP);    \
         } while (FALSE)
 
 #define ASSERT3U(_X, _OP, _Y)           \
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Fri Jan 22 16:08:02 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 22 Jan 2016 16:08:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aMeFl-0004ur-PL; Fri, 22 Jan 2016 16:08:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aMeFl-0004ue-0D
	for win-pv-devel@lists.xenproject.org; Fri, 22 Jan 2016 16:08:01 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	6A/1B-12072-0E352A65; Fri, 22 Jan 2016 16:08:00 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1453478879!17282025!1
X-Originating-IP: [74.125.82.47]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 33828 invoked from network); 22 Jan 2016 16:07:59 -0000
Received: from mail-wm0-f47.google.com (HELO mail-wm0-f47.google.com)
	(74.125.82.47)
	by server-15.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 22 Jan 2016 16:07:59 -0000
Received: by mail-wm0-f47.google.com with SMTP id 123so20378435wmz.0
	for <win-pv-devel@lists.xenproject.org>;
	Fri, 22 Jan 2016 08:07:59 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=e8aRLAxvBQnBOT3tvZI7qxNd+C+nPSvoL1tmz6BVhvA=;
	b=0YupkP+YJkfgWnLeHpTWpiOQefCWXqj3GoaDKGwRc/ClrmnCTOand4S6MYtiZD7AQq
	v+RgT6+XYasc/Kla4MVFi1KQN3GEmCaXmhsATMOHmTAbD9omhpQ3mT8vufY8NRUNCJvP
	wh+D5mqnbExo2gg+HcqUqZfhIBlD5Zfg5TRg8BDHZ8UcgxDk5UKBdxtq1buTrcHbvy1K
	PjP1cjstKxPiYJCVLozshsU001bmCxwQ/UrvT2Aye0jwYsIWNw4h1t009soDNVMNECTY
	c42xH3L5GzK4H1Bv10qTsURLZXdhJ3qjnvOqo4CVqTo2c8iuJ7xmbUvcbo7s8/KUzjwH
	mSeg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id;
	bh=e8aRLAxvBQnBOT3tvZI7qxNd+C+nPSvoL1tmz6BVhvA=;
	b=P0pIhVCjZoJdfdY/hyHsY+DYBAnhtaqbrOM+IM2VJ/6H9a2bymc6jyY1J3zuobTHwg
	Y6/OGp0evgsGm/GziRWbUTzdc6xQRtHHhpSpm9pIP3ZkKxKMo3sGkkHwwurF46Jh8XvS
	4D6hp3IweOxJ7zEEKx4MJGuCFTlohrcYRedERcVsTCMez4Lg+UvaWTtmb7LoLlXxTwAy
	onuNt4na5DcqBf0gdDQpZeZWbdctZ1ItQqSQiE9AKgy9zxOH922v+VeZ2J4V5tTvLENd
	ru1P7Iu4Ct1Tl4G51oif59gMNxVIxuWyAoRMoo12DZeF4ImXokrcPtnVV1Z5v991WsTd
	9fpg==
X-Gm-Message-State: AG10YOQIHTqI26k/Cee5FOxps6am6qShVvVrY2W30Q9PoeXj8pDXSk3f74T+JZNw/m3oPA==
X-Received: by 10.194.5.193 with SMTP id u1mr3909449wju.166.1453478879687;
	Fri, 22 Jan 2016 08:07:59 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	g187sm3537907wmf.8.2016.01.22.08.07.59
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Fri, 22 Jan 2016 08:07:59 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Fri, 22 Jan 2016 16:07:54 +0000
Message-Id: <1453478874-7592-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Avoid evaluating assertion expressions in
	free builds
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

The evaluations are pointless and the warnings generated by not evaluating
can be squashed with a couple of #pragmas.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/common/assert.h | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/src/common/assert.h b/src/common/assert.h
index 1ecf7a6..ad186df 100644
--- a/src/common/assert.h
+++ b/src/common/assert.h
@@ -126,18 +126,12 @@ __Bug(
 
 #else   // DBG
 
-static FORCEINLINE VOID
-_IgnoreAssertion(
-    IN  BOOLEAN Value
-    )
-{
-    UNREFERENCED_PARAMETER(Value);
-}
+#pragma warning(disable:4100)
+#pragma warning(disable:4189)
 
-#define ASSERT(_EXP)                        \
-        do {                                \
-            _IgnoreAssertion(_EXP);         \
-            __analysis_assume(_EXP);        \
+#define ASSERT(_EXP)                    \
+        do {                            \
+            __analysis_assume(_EXP);    \
         } while (FALSE)
 
 #define ASSERT3U(_X, _OP, _Y)           \
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Fri Jan 22 16:08:02 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 22 Jan 2016 16:08:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aMeFl-0004ur-PL; Fri, 22 Jan 2016 16:08:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aMeFl-0004ue-0D
	for win-pv-devel@lists.xenproject.org; Fri, 22 Jan 2016 16:08:01 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	6A/1B-12072-0E352A65; Fri, 22 Jan 2016 16:08:00 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1453478879!17282025!1
X-Originating-IP: [74.125.82.47]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 33828 invoked from network); 22 Jan 2016 16:07:59 -0000
Received: from mail-wm0-f47.google.com (HELO mail-wm0-f47.google.com)
	(74.125.82.47)
	by server-15.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 22 Jan 2016 16:07:59 -0000
Received: by mail-wm0-f47.google.com with SMTP id 123so20378435wmz.0
	for <win-pv-devel@lists.xenproject.org>;
	Fri, 22 Jan 2016 08:07:59 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=e8aRLAxvBQnBOT3tvZI7qxNd+C+nPSvoL1tmz6BVhvA=;
	b=0YupkP+YJkfgWnLeHpTWpiOQefCWXqj3GoaDKGwRc/ClrmnCTOand4S6MYtiZD7AQq
	v+RgT6+XYasc/Kla4MVFi1KQN3GEmCaXmhsATMOHmTAbD9omhpQ3mT8vufY8NRUNCJvP
	wh+D5mqnbExo2gg+HcqUqZfhIBlD5Zfg5TRg8BDHZ8UcgxDk5UKBdxtq1buTrcHbvy1K
	PjP1cjstKxPiYJCVLozshsU001bmCxwQ/UrvT2Aye0jwYsIWNw4h1t009soDNVMNECTY
	c42xH3L5GzK4H1Bv10qTsURLZXdhJ3qjnvOqo4CVqTo2c8iuJ7xmbUvcbo7s8/KUzjwH
	mSeg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id;
	bh=e8aRLAxvBQnBOT3tvZI7qxNd+C+nPSvoL1tmz6BVhvA=;
	b=P0pIhVCjZoJdfdY/hyHsY+DYBAnhtaqbrOM+IM2VJ/6H9a2bymc6jyY1J3zuobTHwg
	Y6/OGp0evgsGm/GziRWbUTzdc6xQRtHHhpSpm9pIP3ZkKxKMo3sGkkHwwurF46Jh8XvS
	4D6hp3IweOxJ7zEEKx4MJGuCFTlohrcYRedERcVsTCMez4Lg+UvaWTtmb7LoLlXxTwAy
	onuNt4na5DcqBf0gdDQpZeZWbdctZ1ItQqSQiE9AKgy9zxOH922v+VeZ2J4V5tTvLENd
	ru1P7Iu4Ct1Tl4G51oif59gMNxVIxuWyAoRMoo12DZeF4ImXokrcPtnVV1Z5v991WsTd
	9fpg==
X-Gm-Message-State: AG10YOQIHTqI26k/Cee5FOxps6am6qShVvVrY2W30Q9PoeXj8pDXSk3f74T+JZNw/m3oPA==
X-Received: by 10.194.5.193 with SMTP id u1mr3909449wju.166.1453478879687;
	Fri, 22 Jan 2016 08:07:59 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	g187sm3537907wmf.8.2016.01.22.08.07.59
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Fri, 22 Jan 2016 08:07:59 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Fri, 22 Jan 2016 16:07:54 +0000
Message-Id: <1453478874-7592-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Avoid evaluating assertion expressions in
	free builds
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

The evaluations are pointless and the warnings generated by not evaluating
can be squashed with a couple of #pragmas.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/common/assert.h | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/src/common/assert.h b/src/common/assert.h
index 1ecf7a6..ad186df 100644
--- a/src/common/assert.h
+++ b/src/common/assert.h
@@ -126,18 +126,12 @@ __Bug(
 
 #else   // DBG
 
-static FORCEINLINE VOID
-_IgnoreAssertion(
-    IN  BOOLEAN Value
-    )
-{
-    UNREFERENCED_PARAMETER(Value);
-}
+#pragma warning(disable:4100)
+#pragma warning(disable:4189)
 
-#define ASSERT(_EXP)                        \
-        do {                                \
-            _IgnoreAssertion(_EXP);         \
-            __analysis_assume(_EXP);        \
+#define ASSERT(_EXP)                    \
+        do {                            \
+            __analysis_assume(_EXP);    \
         } while (FALSE)
 
 #define ASSERT3U(_X, _OP, _Y)           \
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Mon Jan 25 23:04:51 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 25 Jan 2016 23:04:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aNqBm-0008Bp-I4; Mon, 25 Jan 2016 23:04:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <et@etit.hu>)
	id 1aNqBd-0008Bc-Vp
	for win-pv-devel@lists.xenproject.org; Mon, 25 Jan 2016 23:04:49 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	14/56-21901-90AA6A65; Mon, 25 Jan 2016 23:04:41 +0000
X-Env-Sender: et@etit.hu
X-Msg-Ref: server-13.tower-206.messagelabs.com!1453763079!17791034!1
X-Originating-IP: [95.140.34.219]
X-SpamReason: No, hits=1.7 required=7.0 tests=BIZ_TLD
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19013 invoked from network); 25 Jan 2016 23:04:39 -0000
Received: from mail.etit.hu (HELO mail.etit.hu) (95.140.34.219)
	by server-13.tower-206.messagelabs.com with SMTP;
	25 Jan 2016 23:04:39 -0000
Received: from localhost (localhost [127.0.0.1])
	by mail.etit.hu (Postfix) with ESMTP id CD188292
	for <win-pv-devel@lists.xenproject.org>;
	Tue, 26 Jan 2016 00:04:38 +0100 (CET)
Received: from [10.10.10.20] (catv-89-132-233-182.catv.broadband.hu
	[89.132.233.182]) by mail.etit.hu (Postfix) with ESMTPSA id 4A56F147
	for <win-pv-devel@lists.xenproject.org>;
	Tue, 26 Jan 2016 00:04:30 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=etit.hu; s=mail;
	t=1453763070; bh=iCvoRzy6T7rvQouU+WvZFWxHHmC/gPlhmQRIIqrcq/k=;
	h=Subject:To:From:Message-ID:Date:MIME-Version:Content-Type:From;
	b=Zf5gIqdvdacEB1zQRBqM0UA9ay3hMqU1sdAL+gA2gW+ybOCwBJQdkcY3xVthZtaew
	HnNMyHm8jmzf3QBytkW0xqjNndD+3KVvBSFurQESywQhxRNLJgYVuzkVyRxZqitvPo
	TxMmusBPvwcmWPIEUGGbojJwFJtJUfXIkZ/0XVso=
To: win-pv-devel@lists.xenproject.org
References: <565C293A.5030705@etit.hu>
	<9AAE0902D5BC7E449B7C8E4E778ABCD02F69F9FD@AMSPEX01CL01.citrite.net>
	<56701DDF.4000008@m2r.biz>
	<9AAE0902D5BC7E449B7C8E4E778ABCD02F6E9CE3@AMSPEX01CL01.citrite.net>
	<56A0AE00.8080501@m2r.biz>
	<a856fceb0ecb4aa2ae583dcb1a83862d@AMSPEX02CL03.citrite.net>
From: =?UTF-8?B?w4lsacOhcyBUYW3DoXM=?= <et@etit.hu>
X-Enigmail-Draft-Status: N1110
Organization: ETIT[nwpro] KFT
Message-ID: <56A6A9F7.3090509@etit.hu>
Date: Tue, 26 Jan 2016 00:04:23 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.5.1
MIME-Version: 1.0
In-Reply-To: <a856fceb0ecb4aa2ae583dcb1a83862d@AMSPEX02CL03.citrite.net>
Subject: Re: [win-pv-devel] Windows 10 upgrade to new build with testsigning
 on -> FAIL
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6831427963424686546=="
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--===============6831427963424686546==
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature";
 boundary="sf3u34MNdpbFp6JnOUKX0PQnQgsd4H09c"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--sf3u34MNdpbFp6JnOUKX0PQnQgsd4H09c
Content-Type: text/plain; charset=iso-8859-2
Content-Transfer-Encoding: quoted-printable

Hi.

Actually I'm using the 8.2 series. I experienced frequent "freezes" with
8.1 (after certain inactivity, the windows 10 guests frozen. With VNC I
have a mouse pointer working and the startup screen of the login
page.... After this nothing else helped but xl destroy). These hangups
dissapeared when I started using 8.2.

Is there a chance to get the same for 8.2 series in the near future?

2016-01-21 12:42 keltez=E9ssel, Paul Durrant =EDrta:
>> -----Original Message-----
>> From: Fabio Fantoni [mailto:fabio.fantoni@m2r.biz]
>> Sent: 21 January 2016 10:08
>> To: Paul Durrant; =C9li=E1s Tam=E1s; xen-users@lists.xen.org; win-pv-
>> devel@lists.xenproject.org
>> Cc: Lars Kurth (lars.kurth@xen.org)
>> Subject: Re: [win-pv-devel] Windows 10 upgrade to new build with
>> testsigning on -> FAIL
>>
>> Il 15/12/2015 15:49, Paul Durrant ha scritto:
>>>> -----Original Message-----
>>> [snip]
>>>>> I believe Lars is working on this. We intend to get an EV cert for =
Xen
>> Project
>>>> and release-sign (not logo-sign) drivers through the new Windows 10
>> portal. I
>>>> have updated the staging-8.1 branches recently and re-tagged them wi=
th
>>>> new rc numbers... I'll adjust the Jenkins projects today to deliver =
new
>> builds
>>>> of these branches to xenbits. My hope is that these are likely to be=
 the
>> final
>>>> rcs.
>>>>>     Paul
>>>> Sorry for bother you, is there any news about the signed builds plea=
se?
>>>>
>>> Fabio,
>>>
>>>    I believe Lars now has Advisory Board approval to purchase the EV =
cert
>> and I hope this means we should be able to acquire it immediately afte=
r the
>> holiday season.
>>>    As for the code, I have just re-tagged the staging-8.1 branches af=
ter some
>> more fixes for issues found in testing (new builds are available on xe=
nbits)
>> and I'm not anticipating any more tags now. Once we have the EV cert, =
I will
>> sign the builds via the Microsoft portal and formally release version =
8.1.0 of
>> all drivers.
>>>
>>>    Cheers,
>>>
>>>      Paul
>>
>> Sorry for bother you, is there any news please?
>>
>=20
> Actually there is! I received the EV signing token purchased by the Xen=
 Project yesterday and will be looking to sign and release version 8.1 of=
 all drivers in the very near future.
>=20
>   Paul
>=20
>>
>>
>>>
>>>> Thanks for any reply and sorry for my bad english.
>>>>
>>>>>> --
>>>>>>
>>>>>>
>>>>>> =C9li=E1s Tam=E1s
>>>>>> Thomas Elias
>>>>>>
>>>>>> ETIT[nwpro] KFT, =DCgyvezet=F5-H=E1l=F3zatbiztons=E1gi specialista=

>>>>>> ETIT[nwpro] Ltd, General Manager-Network security specialist
>>>>>>
>>>>>> Tel. HU: +36/30-497-1626
>>>>>> Tel. DE: +49/160-651-8723
>>>>>> OpenPGP pubkey: http://etit.hu/doc/et-pub.asc
>>>>>>
>>>>>> Okleveles m=E9rn=F6k-informatikus (MSC)
>>>>>> Master of Science in Information Technology (MSC)
>>>>>>
>>>>>> Kapcsolat: http://etit.hu/index.php/hu/kapcsolat
>>>>>> Jogi nyilatkozat: http://etit.hu/disclaimer-email-hu.txt
>>>>>> Contact: http://etit.hu/index.php/en/contact
>>>>>> Disclaimer: http://etit.hu/disclaimer-email-en.txt
>>>>> _______________________________________________
>>>>> win-pv-devel mailing list
>>>>> win-pv-devel@lists.xenproject.org
>>>>> http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel
>=20
>=20
> _______________________________________________
> win-pv-devel mailing list
> win-pv-devel@lists.xenproject.org
> http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel
>=20

--=20


=C9li=E1s Tam=E1s
Thomas Elias

ETIT[nwpro] KFT, =DCgyvezet=F5-H=E1l=F3zatbiztons=E1gi specialista
ETIT[nwpro] Ltd, General Manager-Network security specialist

Tel. HU: +36/30-497-1626
Tel. DE: +49/160-651-8723
OpenPGP pubkey: http://etit.hu/doc/et-pub.asc

Okleveles m=E9rn=F6k-informatikus (MSC)
Master of Science in Information Technology (MSC)

Kapcsolat: http://etit.hu/index.php/hu/kapcsolat
Jogi nyilatkozat: http://etit.hu/disclaimer-email-hu.txt
Contact: http://etit.hu/index.php/en/contact
Disclaimer: http://etit.hu/disclaimer-email-en.txt


--sf3u34MNdpbFp6JnOUKX0PQnQgsd4H09c
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQIcBAEBAgAGBQJWpqn9AAoJENWYes1C3s/CVG4P/j+yNctyBORmdfmbOjGOGtyA
ctwvkyqUmF38/VMa3QLRnqchN2KjyJt+knYU9tHZjhi74cJ97rAirg/377uMm70A
bB6TiR0uB5SmnfulQzuX5YQCWZtlGzm9Me7ZsmGmyumsRJcBd1uLmZqBQhTCF8ZA
ZuIPaKzkfwLvgtjuXSNP8gbdHskuPCYQocItFip8eMrYSytHiGrRg2Y+S/s7cfmL
5ugELnYdfMjZ5QWp22gumMsAwV6Rd9zr7czHTqIJQoM9NzsSdi00c9yN45ozgvAR
1qz38vem64QSmHpL55D7s6dEeTpGdWA31m9T4suKlFSZA0AOu3Fd/EV8gJg2hcDz
RzToV0aCleLzuwSBtjZmSEm3xwtG3pGC99i1rMhFnXlp6iWRk8JEK9LTR0vZezdY
Q7/EgloZeD+2Ny5+BoeHDlyedQCcNdB+SvOdxZn//gmABvswpZcbHXoPlLvdfwxc
NynGISLjRGTb39kFPJ4X2qu0+kq5IrZ6mA2kzUGtg+LzDHq4xiofVhDgPxgTiH7J
IrTUQwNeP0j6k/LqdNOvP8KL5n769pSZOHkDgympWIXPCkdKJ4VHv0k8QyiUcVT9
dJmjzz1tOEDDszblO9aL5yuZzr/GnuCX/3oywpb/FoirkftpJEDgzjz6HtEUJvrX
Ma3pvAgB+/OH9bjkJv0Z
=tWx7
-----END PGP SIGNATURE-----

--sf3u34MNdpbFp6JnOUKX0PQnQgsd4H09c--


--===============6831427963424686546==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel
--===============6831427963424686546==--


From win-pv-devel-bounces@lists.xenproject.org Mon Jan 25 23:04:51 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 25 Jan 2016 23:04:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aNqBm-0008Bp-I4; Mon, 25 Jan 2016 23:04:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <et@etit.hu>)
	id 1aNqBd-0008Bc-Vp
	for win-pv-devel@lists.xenproject.org; Mon, 25 Jan 2016 23:04:49 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	14/56-21901-90AA6A65; Mon, 25 Jan 2016 23:04:41 +0000
X-Env-Sender: et@etit.hu
X-Msg-Ref: server-13.tower-206.messagelabs.com!1453763079!17791034!1
X-Originating-IP: [95.140.34.219]
X-SpamReason: No, hits=1.7 required=7.0 tests=BIZ_TLD
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19013 invoked from network); 25 Jan 2016 23:04:39 -0000
Received: from mail.etit.hu (HELO mail.etit.hu) (95.140.34.219)
	by server-13.tower-206.messagelabs.com with SMTP;
	25 Jan 2016 23:04:39 -0000
Received: from localhost (localhost [127.0.0.1])
	by mail.etit.hu (Postfix) with ESMTP id CD188292
	for <win-pv-devel@lists.xenproject.org>;
	Tue, 26 Jan 2016 00:04:38 +0100 (CET)
Received: from [10.10.10.20] (catv-89-132-233-182.catv.broadband.hu
	[89.132.233.182]) by mail.etit.hu (Postfix) with ESMTPSA id 4A56F147
	for <win-pv-devel@lists.xenproject.org>;
	Tue, 26 Jan 2016 00:04:30 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=etit.hu; s=mail;
	t=1453763070; bh=iCvoRzy6T7rvQouU+WvZFWxHHmC/gPlhmQRIIqrcq/k=;
	h=Subject:To:From:Message-ID:Date:MIME-Version:Content-Type:From;
	b=Zf5gIqdvdacEB1zQRBqM0UA9ay3hMqU1sdAL+gA2gW+ybOCwBJQdkcY3xVthZtaew
	HnNMyHm8jmzf3QBytkW0xqjNndD+3KVvBSFurQESywQhxRNLJgYVuzkVyRxZqitvPo
	TxMmusBPvwcmWPIEUGGbojJwFJtJUfXIkZ/0XVso=
To: win-pv-devel@lists.xenproject.org
References: <565C293A.5030705@etit.hu>
	<9AAE0902D5BC7E449B7C8E4E778ABCD02F69F9FD@AMSPEX01CL01.citrite.net>
	<56701DDF.4000008@m2r.biz>
	<9AAE0902D5BC7E449B7C8E4E778ABCD02F6E9CE3@AMSPEX01CL01.citrite.net>
	<56A0AE00.8080501@m2r.biz>
	<a856fceb0ecb4aa2ae583dcb1a83862d@AMSPEX02CL03.citrite.net>
From: =?UTF-8?B?w4lsacOhcyBUYW3DoXM=?= <et@etit.hu>
X-Enigmail-Draft-Status: N1110
Organization: ETIT[nwpro] KFT
Message-ID: <56A6A9F7.3090509@etit.hu>
Date: Tue, 26 Jan 2016 00:04:23 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.5.1
MIME-Version: 1.0
In-Reply-To: <a856fceb0ecb4aa2ae583dcb1a83862d@AMSPEX02CL03.citrite.net>
Subject: Re: [win-pv-devel] Windows 10 upgrade to new build with testsigning
 on -> FAIL
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6831427963424686546=="
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--===============6831427963424686546==
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature";
 boundary="sf3u34MNdpbFp6JnOUKX0PQnQgsd4H09c"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--sf3u34MNdpbFp6JnOUKX0PQnQgsd4H09c
Content-Type: text/plain; charset=iso-8859-2
Content-Transfer-Encoding: quoted-printable

Hi.

Actually I'm using the 8.2 series. I experienced frequent "freezes" with
8.1 (after certain inactivity, the windows 10 guests frozen. With VNC I
have a mouse pointer working and the startup screen of the login
page.... After this nothing else helped but xl destroy). These hangups
dissapeared when I started using 8.2.

Is there a chance to get the same for 8.2 series in the near future?

2016-01-21 12:42 keltez=E9ssel, Paul Durrant =EDrta:
>> -----Original Message-----
>> From: Fabio Fantoni [mailto:fabio.fantoni@m2r.biz]
>> Sent: 21 January 2016 10:08
>> To: Paul Durrant; =C9li=E1s Tam=E1s; xen-users@lists.xen.org; win-pv-
>> devel@lists.xenproject.org
>> Cc: Lars Kurth (lars.kurth@xen.org)
>> Subject: Re: [win-pv-devel] Windows 10 upgrade to new build with
>> testsigning on -> FAIL
>>
>> Il 15/12/2015 15:49, Paul Durrant ha scritto:
>>>> -----Original Message-----
>>> [snip]
>>>>> I believe Lars is working on this. We intend to get an EV cert for =
Xen
>> Project
>>>> and release-sign (not logo-sign) drivers through the new Windows 10
>> portal. I
>>>> have updated the staging-8.1 branches recently and re-tagged them wi=
th
>>>> new rc numbers... I'll adjust the Jenkins projects today to deliver =
new
>> builds
>>>> of these branches to xenbits. My hope is that these are likely to be=
 the
>> final
>>>> rcs.
>>>>>     Paul
>>>> Sorry for bother you, is there any news about the signed builds plea=
se?
>>>>
>>> Fabio,
>>>
>>>    I believe Lars now has Advisory Board approval to purchase the EV =
cert
>> and I hope this means we should be able to acquire it immediately afte=
r the
>> holiday season.
>>>    As for the code, I have just re-tagged the staging-8.1 branches af=
ter some
>> more fixes for issues found in testing (new builds are available on xe=
nbits)
>> and I'm not anticipating any more tags now. Once we have the EV cert, =
I will
>> sign the builds via the Microsoft portal and formally release version =
8.1.0 of
>> all drivers.
>>>
>>>    Cheers,
>>>
>>>      Paul
>>
>> Sorry for bother you, is there any news please?
>>
>=20
> Actually there is! I received the EV signing token purchased by the Xen=
 Project yesterday and will be looking to sign and release version 8.1 of=
 all drivers in the very near future.
>=20
>   Paul
>=20
>>
>>
>>>
>>>> Thanks for any reply and sorry for my bad english.
>>>>
>>>>>> --
>>>>>>
>>>>>>
>>>>>> =C9li=E1s Tam=E1s
>>>>>> Thomas Elias
>>>>>>
>>>>>> ETIT[nwpro] KFT, =DCgyvezet=F5-H=E1l=F3zatbiztons=E1gi specialista=

>>>>>> ETIT[nwpro] Ltd, General Manager-Network security specialist
>>>>>>
>>>>>> Tel. HU: +36/30-497-1626
>>>>>> Tel. DE: +49/160-651-8723
>>>>>> OpenPGP pubkey: http://etit.hu/doc/et-pub.asc
>>>>>>
>>>>>> Okleveles m=E9rn=F6k-informatikus (MSC)
>>>>>> Master of Science in Information Technology (MSC)
>>>>>>
>>>>>> Kapcsolat: http://etit.hu/index.php/hu/kapcsolat
>>>>>> Jogi nyilatkozat: http://etit.hu/disclaimer-email-hu.txt
>>>>>> Contact: http://etit.hu/index.php/en/contact
>>>>>> Disclaimer: http://etit.hu/disclaimer-email-en.txt
>>>>> _______________________________________________
>>>>> win-pv-devel mailing list
>>>>> win-pv-devel@lists.xenproject.org
>>>>> http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel
>=20
>=20
> _______________________________________________
> win-pv-devel mailing list
> win-pv-devel@lists.xenproject.org
> http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel
>=20

--=20


=C9li=E1s Tam=E1s
Thomas Elias

ETIT[nwpro] KFT, =DCgyvezet=F5-H=E1l=F3zatbiztons=E1gi specialista
ETIT[nwpro] Ltd, General Manager-Network security specialist

Tel. HU: +36/30-497-1626
Tel. DE: +49/160-651-8723
OpenPGP pubkey: http://etit.hu/doc/et-pub.asc

Okleveles m=E9rn=F6k-informatikus (MSC)
Master of Science in Information Technology (MSC)

Kapcsolat: http://etit.hu/index.php/hu/kapcsolat
Jogi nyilatkozat: http://etit.hu/disclaimer-email-hu.txt
Contact: http://etit.hu/index.php/en/contact
Disclaimer: http://etit.hu/disclaimer-email-en.txt


--sf3u34MNdpbFp6JnOUKX0PQnQgsd4H09c
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQIcBAEBAgAGBQJWpqn9AAoJENWYes1C3s/CVG4P/j+yNctyBORmdfmbOjGOGtyA
ctwvkyqUmF38/VMa3QLRnqchN2KjyJt+knYU9tHZjhi74cJ97rAirg/377uMm70A
bB6TiR0uB5SmnfulQzuX5YQCWZtlGzm9Me7ZsmGmyumsRJcBd1uLmZqBQhTCF8ZA
ZuIPaKzkfwLvgtjuXSNP8gbdHskuPCYQocItFip8eMrYSytHiGrRg2Y+S/s7cfmL
5ugELnYdfMjZ5QWp22gumMsAwV6Rd9zr7czHTqIJQoM9NzsSdi00c9yN45ozgvAR
1qz38vem64QSmHpL55D7s6dEeTpGdWA31m9T4suKlFSZA0AOu3Fd/EV8gJg2hcDz
RzToV0aCleLzuwSBtjZmSEm3xwtG3pGC99i1rMhFnXlp6iWRk8JEK9LTR0vZezdY
Q7/EgloZeD+2Ny5+BoeHDlyedQCcNdB+SvOdxZn//gmABvswpZcbHXoPlLvdfwxc
NynGISLjRGTb39kFPJ4X2qu0+kq5IrZ6mA2kzUGtg+LzDHq4xiofVhDgPxgTiH7J
IrTUQwNeP0j6k/LqdNOvP8KL5n769pSZOHkDgympWIXPCkdKJ4VHv0k8QyiUcVT9
dJmjzz1tOEDDszblO9aL5yuZzr/GnuCX/3oywpb/FoirkftpJEDgzjz6HtEUJvrX
Ma3pvAgB+/OH9bjkJv0Z
=tWx7
-----END PGP SIGNATURE-----

--sf3u34MNdpbFp6JnOUKX0PQnQgsd4H09c--


--===============6831427963424686546==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel
--===============6831427963424686546==--


From win-pv-devel-bounces@lists.xenproject.org Tue Jan 26 10:41:51 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 26 Jan 2016 10:41:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aO14I-00074f-P8; Tue, 26 Jan 2016 10:41:50 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=826355805=Paul.Durrant@citrix.com>)
	id 1aO14G-00074a-HV
	for win-pv-devel@lists.xenproject.org; Tue, 26 Jan 2016 10:41:48 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	89/CA-02499-B6D47A65; Tue, 26 Jan 2016 10:41:47 +0000
X-Env-Sender: prvs=826355805=Paul.Durrant@citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1453804906!8531825!1
X-Originating-IP: [185.25.65.24]
X-SpamReason: No, hits=1.7 required=7.0 tests=BIZ_TLD,received_headers: 
	No Received headers
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 40972 invoked from network); 26 Jan 2016 10:41:46 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (185.25.65.24)
	by server-4.tower-31.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Jan 2016 10:41:46 -0000
X-IronPort-AV: E=Sophos;i="5.22,349,1449532800"; d="scan'208";a="13374987"
From: Paul Durrant <Paul.Durrant@citrix.com>
To: =?iso-8859-2?Q?=C9li=E1s_Tam=E1s?= <et@etit.hu>,
	"win-pv-devel@lists.xenproject.org" <win-pv-devel@lists.xenproject.org>
Thread-Topic: [win-pv-devel] Windows 10 upgrade to new build with testsigning
	on -> FAIL
Thread-Index: AQHRN0GdA7LRrQqBE0yh1/tD1ldGRZ7MFQ3QgDnS4wCAACrSwIAG92yAgADSjEA=
Date: Tue, 26 Jan 2016 10:41:43 +0000
Message-ID: <c1bbf45906084d5dae4839e297ab1635@AMSPEX02CL03.citrite.net>
References: <565C293A.5030705@etit.hu>
	<9AAE0902D5BC7E449B7C8E4E778ABCD02F69F9FD@AMSPEX01CL01.citrite.net>
	<56701DDF.4000008@m2r.biz>
	<9AAE0902D5BC7E449B7C8E4E778ABCD02F6E9CE3@AMSPEX01CL01.citrite.net>
	<56A0AE00.8080501@m2r.biz>
	<a856fceb0ecb4aa2ae583dcb1a83862d@AMSPEX02CL03.citrite.net>
	<56A6A9F7.3090509@etit.hu>
In-Reply-To: <56A6A9F7.3090509@etit.hu>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ms-exchange-transport-fromentityheader: Hosted
MIME-Version: 1.0
X-DLP: AMS1
Subject: Re: [win-pv-devel] Windows 10 upgrade to new build with testsigning
 on -> FAIL
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

> -----Original Message-----
> From: win-pv-devel-bounces@lists.xenproject.org [mailto:win-pv-devel-
> bounces@lists.xenproject.org] On Behalf Of =C9li=E1s Tam=E1s
> Sent: 25 January 2016 23:04
> To: win-pv-devel@lists.xenproject.org
> Subject: Re: [win-pv-devel] Windows 10 upgrade to new build with
> testsigning on -> FAIL
> =

> Hi.
> =

> Actually I'm using the 8.2 series. I experienced frequent "freezes" with
> 8.1 (after certain inactivity, the windows 10 guests frozen. With VNC I
> have a mouse pointer working and the startup screen of the login
> page.... After this nothing else helped but xl destroy). These hangups
> dissapeared when I started using 8.2.
> =

> Is there a chance to get the same for 8.2 series in the near future?

8.2 is master and I wouldn't expect a release for a while. Specifically I'm=
 hoping that we can have all the libvchan work being done by Rafal at Invis=
ible Things done by then.
I have, however, been working hard on stabilising 8.1 under HCK testing and=
 have actually run into some issues for which I'll be sending and backporti=
ng patches. Once I have confidence in an HCK run on all drivers I'll re-tag=
 and update the 8.1 builds.

  Paul

> =

> 2016-01-21 12:42 keltez=E9ssel, Paul Durrant =EDrta:
> >> -----Original Message-----
> >> From: Fabio Fantoni [mailto:fabio.fantoni@m2r.biz]
> >> Sent: 21 January 2016 10:08
> >> To: Paul Durrant; =C9li=E1s Tam=E1s; xen-users@lists.xen.org; win-pv-
> >> devel@lists.xenproject.org
> >> Cc: Lars Kurth (lars.kurth@xen.org)
> >> Subject: Re: [win-pv-devel] Windows 10 upgrade to new build with
> >> testsigning on -> FAIL
> >>
> >> Il 15/12/2015 15:49, Paul Durrant ha scritto:
> >>>> -----Original Message-----
> >>> [snip]
> >>>>> I believe Lars is working on this. We intend to get an EV cert for =
Xen
> >> Project
> >>>> and release-sign (not logo-sign) drivers through the new Windows 10
> >> portal. I
> >>>> have updated the staging-8.1 branches recently and re-tagged them
> with
> >>>> new rc numbers... I'll adjust the Jenkins projects today to deliver =
new
> >> builds
> >>>> of these branches to xenbits. My hope is that these are likely to be=
 the
> >> final
> >>>> rcs.
> >>>>>     Paul
> >>>> Sorry for bother you, is there any news about the signed builds plea=
se?
> >>>>
> >>> Fabio,
> >>>
> >>>    I believe Lars now has Advisory Board approval to purchase the EV =
cert
> >> and I hope this means we should be able to acquire it immediately after
> the
> >> holiday season.
> >>>    As for the code, I have just re-tagged the staging-8.1 branches af=
ter
> some
> >> more fixes for issues found in testing (new builds are available on xe=
nbits)
> >> and I'm not anticipating any more tags now. Once we have the EV cert, I
> will
> >> sign the builds via the Microsoft portal and formally release version =
8.1.0
> of
> >> all drivers.
> >>>
> >>>    Cheers,
> >>>
> >>>      Paul
> >>
> >> Sorry for bother you, is there any news please?
> >>
> >
> > Actually there is! I received the EV signing token purchased by the Xen
> Project yesterday and will be looking to sign and release version 8.1 of =
all
> drivers in the very near future.
> >
> >   Paul
> >
> >>
> >>
> >>>
> >>>> Thanks for any reply and sorry for my bad english.
> >>>>
> >>>>>> --
> >>>>>>
> >>>>>>
> >>>>>> =C9li=E1s Tam=E1s
> >>>>>> Thomas Elias
> >>>>>>
> >>>>>> ETIT[nwpro] KFT, =DCgyvezet=F5-H=E1l=F3zatbiztons=E1gi specialista
> >>>>>> ETIT[nwpro] Ltd, General Manager-Network security specialist
> >>>>>>
> >>>>>> Tel. HU: +36/30-497-1626
> >>>>>> Tel. DE: +49/160-651-8723
> >>>>>> OpenPGP pubkey: http://etit.hu/doc/et-pub.asc
> >>>>>>
> >>>>>> Okleveles m=E9rn=F6k-informatikus (MSC)
> >>>>>> Master of Science in Information Technology (MSC)
> >>>>>>
> >>>>>> Kapcsolat: http://etit.hu/index.php/hu/kapcsolat
> >>>>>> Jogi nyilatkozat: http://etit.hu/disclaimer-email-hu.txt
> >>>>>> Contact: http://etit.hu/index.php/en/contact
> >>>>>> Disclaimer: http://etit.hu/disclaimer-email-en.txt
> >>>>> _______________________________________________
> >>>>> win-pv-devel mailing list
> >>>>> win-pv-devel@lists.xenproject.org
> >>>>> http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel
> >
> >
> > _______________________________________________
> > win-pv-devel mailing list
> > win-pv-devel@lists.xenproject.org
> > http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel
> >
> =

> --
> =

> =

> =C9li=E1s Tam=E1s
> Thomas Elias
> =

> ETIT[nwpro] KFT, =DCgyvezet=F5-H=E1l=F3zatbiztons=E1gi specialista
> ETIT[nwpro] Ltd, General Manager-Network security specialist
> =

> Tel. HU: +36/30-497-1626
> Tel. DE: +49/160-651-8723
> OpenPGP pubkey: http://etit.hu/doc/et-pub.asc
> =

> Okleveles m=E9rn=F6k-informatikus (MSC)
> Master of Science in Information Technology (MSC)
> =

> Kapcsolat: http://etit.hu/index.php/hu/kapcsolat
> Jogi nyilatkozat: http://etit.hu/disclaimer-email-hu.txt
> Contact: http://etit.hu/index.php/en/contact
> Disclaimer: http://etit.hu/disclaimer-email-en.txt


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Tue Jan 26 10:41:51 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 26 Jan 2016 10:41:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aO14I-00074f-P8; Tue, 26 Jan 2016 10:41:50 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=826355805=Paul.Durrant@citrix.com>)
	id 1aO14G-00074a-HV
	for win-pv-devel@lists.xenproject.org; Tue, 26 Jan 2016 10:41:48 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	89/CA-02499-B6D47A65; Tue, 26 Jan 2016 10:41:47 +0000
X-Env-Sender: prvs=826355805=Paul.Durrant@citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1453804906!8531825!1
X-Originating-IP: [185.25.65.24]
X-SpamReason: No, hits=1.7 required=7.0 tests=BIZ_TLD,received_headers: 
	No Received headers
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 40972 invoked from network); 26 Jan 2016 10:41:46 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (185.25.65.24)
	by server-4.tower-31.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Jan 2016 10:41:46 -0000
X-IronPort-AV: E=Sophos;i="5.22,349,1449532800"; d="scan'208";a="13374987"
From: Paul Durrant <Paul.Durrant@citrix.com>
To: =?iso-8859-2?Q?=C9li=E1s_Tam=E1s?= <et@etit.hu>,
	"win-pv-devel@lists.xenproject.org" <win-pv-devel@lists.xenproject.org>
Thread-Topic: [win-pv-devel] Windows 10 upgrade to new build with testsigning
	on -> FAIL
Thread-Index: AQHRN0GdA7LRrQqBE0yh1/tD1ldGRZ7MFQ3QgDnS4wCAACrSwIAG92yAgADSjEA=
Date: Tue, 26 Jan 2016 10:41:43 +0000
Message-ID: <c1bbf45906084d5dae4839e297ab1635@AMSPEX02CL03.citrite.net>
References: <565C293A.5030705@etit.hu>
	<9AAE0902D5BC7E449B7C8E4E778ABCD02F69F9FD@AMSPEX01CL01.citrite.net>
	<56701DDF.4000008@m2r.biz>
	<9AAE0902D5BC7E449B7C8E4E778ABCD02F6E9CE3@AMSPEX01CL01.citrite.net>
	<56A0AE00.8080501@m2r.biz>
	<a856fceb0ecb4aa2ae583dcb1a83862d@AMSPEX02CL03.citrite.net>
	<56A6A9F7.3090509@etit.hu>
In-Reply-To: <56A6A9F7.3090509@etit.hu>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ms-exchange-transport-fromentityheader: Hosted
MIME-Version: 1.0
X-DLP: AMS1
Subject: Re: [win-pv-devel] Windows 10 upgrade to new build with testsigning
 on -> FAIL
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

> -----Original Message-----
> From: win-pv-devel-bounces@lists.xenproject.org [mailto:win-pv-devel-
> bounces@lists.xenproject.org] On Behalf Of =C9li=E1s Tam=E1s
> Sent: 25 January 2016 23:04
> To: win-pv-devel@lists.xenproject.org
> Subject: Re: [win-pv-devel] Windows 10 upgrade to new build with
> testsigning on -> FAIL
> =

> Hi.
> =

> Actually I'm using the 8.2 series. I experienced frequent "freezes" with
> 8.1 (after certain inactivity, the windows 10 guests frozen. With VNC I
> have a mouse pointer working and the startup screen of the login
> page.... After this nothing else helped but xl destroy). These hangups
> dissapeared when I started using 8.2.
> =

> Is there a chance to get the same for 8.2 series in the near future?

8.2 is master and I wouldn't expect a release for a while. Specifically I'm=
 hoping that we can have all the libvchan work being done by Rafal at Invis=
ible Things done by then.
I have, however, been working hard on stabilising 8.1 under HCK testing and=
 have actually run into some issues for which I'll be sending and backporti=
ng patches. Once I have confidence in an HCK run on all drivers I'll re-tag=
 and update the 8.1 builds.

  Paul

> =

> 2016-01-21 12:42 keltez=E9ssel, Paul Durrant =EDrta:
> >> -----Original Message-----
> >> From: Fabio Fantoni [mailto:fabio.fantoni@m2r.biz]
> >> Sent: 21 January 2016 10:08
> >> To: Paul Durrant; =C9li=E1s Tam=E1s; xen-users@lists.xen.org; win-pv-
> >> devel@lists.xenproject.org
> >> Cc: Lars Kurth (lars.kurth@xen.org)
> >> Subject: Re: [win-pv-devel] Windows 10 upgrade to new build with
> >> testsigning on -> FAIL
> >>
> >> Il 15/12/2015 15:49, Paul Durrant ha scritto:
> >>>> -----Original Message-----
> >>> [snip]
> >>>>> I believe Lars is working on this. We intend to get an EV cert for =
Xen
> >> Project
> >>>> and release-sign (not logo-sign) drivers through the new Windows 10
> >> portal. I
> >>>> have updated the staging-8.1 branches recently and re-tagged them
> with
> >>>> new rc numbers... I'll adjust the Jenkins projects today to deliver =
new
> >> builds
> >>>> of these branches to xenbits. My hope is that these are likely to be=
 the
> >> final
> >>>> rcs.
> >>>>>     Paul
> >>>> Sorry for bother you, is there any news about the signed builds plea=
se?
> >>>>
> >>> Fabio,
> >>>
> >>>    I believe Lars now has Advisory Board approval to purchase the EV =
cert
> >> and I hope this means we should be able to acquire it immediately after
> the
> >> holiday season.
> >>>    As for the code, I have just re-tagged the staging-8.1 branches af=
ter
> some
> >> more fixes for issues found in testing (new builds are available on xe=
nbits)
> >> and I'm not anticipating any more tags now. Once we have the EV cert, I
> will
> >> sign the builds via the Microsoft portal and formally release version =
8.1.0
> of
> >> all drivers.
> >>>
> >>>    Cheers,
> >>>
> >>>      Paul
> >>
> >> Sorry for bother you, is there any news please?
> >>
> >
> > Actually there is! I received the EV signing token purchased by the Xen
> Project yesterday and will be looking to sign and release version 8.1 of =
all
> drivers in the very near future.
> >
> >   Paul
> >
> >>
> >>
> >>>
> >>>> Thanks for any reply and sorry for my bad english.
> >>>>
> >>>>>> --
> >>>>>>
> >>>>>>
> >>>>>> =C9li=E1s Tam=E1s
> >>>>>> Thomas Elias
> >>>>>>
> >>>>>> ETIT[nwpro] KFT, =DCgyvezet=F5-H=E1l=F3zatbiztons=E1gi specialista
> >>>>>> ETIT[nwpro] Ltd, General Manager-Network security specialist
> >>>>>>
> >>>>>> Tel. HU: +36/30-497-1626
> >>>>>> Tel. DE: +49/160-651-8723
> >>>>>> OpenPGP pubkey: http://etit.hu/doc/et-pub.asc
> >>>>>>
> >>>>>> Okleveles m=E9rn=F6k-informatikus (MSC)
> >>>>>> Master of Science in Information Technology (MSC)
> >>>>>>
> >>>>>> Kapcsolat: http://etit.hu/index.php/hu/kapcsolat
> >>>>>> Jogi nyilatkozat: http://etit.hu/disclaimer-email-hu.txt
> >>>>>> Contact: http://etit.hu/index.php/en/contact
> >>>>>> Disclaimer: http://etit.hu/disclaimer-email-en.txt
> >>>>> _______________________________________________
> >>>>> win-pv-devel mailing list
> >>>>> win-pv-devel@lists.xenproject.org
> >>>>> http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel
> >
> >
> > _______________________________________________
> > win-pv-devel mailing list
> > win-pv-devel@lists.xenproject.org
> > http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel
> >
> =

> --
> =

> =

> =C9li=E1s Tam=E1s
> Thomas Elias
> =

> ETIT[nwpro] KFT, =DCgyvezet=F5-H=E1l=F3zatbiztons=E1gi specialista
> ETIT[nwpro] Ltd, General Manager-Network security specialist
> =

> Tel. HU: +36/30-497-1626
> Tel. DE: +49/160-651-8723
> OpenPGP pubkey: http://etit.hu/doc/et-pub.asc
> =

> Okleveles m=E9rn=F6k-informatikus (MSC)
> Master of Science in Information Technology (MSC)
> =

> Kapcsolat: http://etit.hu/index.php/hu/kapcsolat
> Jogi nyilatkozat: http://etit.hu/disclaimer-email-hu.txt
> Contact: http://etit.hu/index.php/en/contact
> Disclaimer: http://etit.hu/disclaimer-email-en.txt


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Tue Jan 26 11:31:15 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 26 Jan 2016 11:31:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aO1q7-0000oz-24; Tue, 26 Jan 2016 11:31:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aO1q6-0000ou-2L
	for win-pv-devel@lists.xenproject.org; Tue, 26 Jan 2016 11:31:14 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	62/3B-02745-10957A65; Tue, 26 Jan 2016 11:31:13 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1453807871!8546938!1
X-Originating-IP: [209.85.160.177]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 46021 invoked from network); 26 Jan 2016 11:31:12 -0000
Received: from mail-yk0-f177.google.com (HELO mail-yk0-f177.google.com)
	(209.85.160.177)
	by server-4.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 26 Jan 2016 11:31:12 -0000
Received: by mail-yk0-f177.google.com with SMTP id u68so66662597ykd.2
	for <win-pv-devel@lists.xenproject.org>;
	Tue, 26 Jan 2016 03:31:12 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=Eptbn2It5Vl1SCvBHAr/o+FkLoujXO4Fs1a4suNhI/c=;
	b=gLk2G6aUTlm6ko7TaYdVRq4pw5ZfWPgmPgklg+OGKNgFJZRC7FRUngVgMpJYQ1vwCI
	RF5/Q2pGshEC7b9Txzq3giqEyNAqkf2IpF9c6+LlooEb6fk6kho/3nJpgkeW4eP2FrwA
	HRi41kxHFwTsoVhe2w/uGoIFYAlRtCS65kBW+Y+j5RxWxnQLOVn61HxiAJedr08O2CAh
	qc5N5gyyW79Ilkb8W+ubTTELpeD1gCw2+FbcJ+g8NrpfAq7oJ1WzFnXl3/GlXIURmpkX
	gmFS5P6sFtzHaOFHaL8YHUofYZuF6ZPq7OuOTjJEYFVIYruQGu/ZlRDbY01D+25qCsQF
	2GgA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id;
	bh=Eptbn2It5Vl1SCvBHAr/o+FkLoujXO4Fs1a4suNhI/c=;
	b=bsZUv2zBX0wocaAJgDp3IBZeOSzvC84BVIZdQPGR9rA4e0O07wy2BNIfIw9ln2IL3E
	dV8wtBVDaS6I6Lseyee0bSN+oFFESPhuC9GmoGXOQ4JaSfcgUevRcls639Rv+irn7FDD
	9cjqUJ05JfQ5gbP16T4A0jGGqaKC3BtcoBlqjDkbqxmgStMobnE3vCJkP/7+YmpKun5y
	2APAWFTRmrKn5+Q4WWYFDt/ot/JMx0MfsmWSqglxsB1Qe6ojzhoxayazaBRVywDfYDeF
	wDjCcXw3g39JFAxMvngid5TQuV5/HZZWgxDwNGvkKpLeiz68WJUcJLoJn6fWXVL6e5we
	CkTA==
X-Gm-Message-State: AG10YOQchjXQOx0W19oE55UbQfmhzucfg5RH2iMcYznFPLX3iYBWHuRnwYeK/FlywUDWHw==
X-Received: by 10.13.224.132 with SMTP id j126mr10765310ywe.117.1453807871171; 
	Tue, 26 Jan 2016 03:31:11 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	g192sm508098ywb.18.2016.01.26.03.31.10
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Tue, 26 Jan 2016 03:31:10 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Tue, 26 Jan 2016 11:30:27 +0000
Message-Id: <1453807827-2516-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Add DPC watchdog avoidance to receiver and
	transmitter poll
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Under HCK MPE testing it's possible for both receiver and transmitter
polling loops to run long enough to hit the DPC watchdog. This patch
avoids the problem by terminating the polling loops after a 'batch'
(currently 1/4 of the ring) and then checking the remaining time before the
watchdog fires. If the remaining time is still more than half the total
time then another poll is done, otherwise a timer is scheduled to complete
the work.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xenvif/receiver.c    | 103 ++++++++++++++++++++++++++++++------------
 src/xenvif/transmitter.c | 115 ++++++++++++++++++++++++++++++++++-------------
 2 files changed, 158 insertions(+), 60 deletions(-)

diff --git a/src/xenvif/receiver.c b/src/xenvif/receiver.c
index 29877f2..538971e 100644
--- a/src/xenvif/receiver.c
+++ b/src/xenvif/receiver.c
@@ -86,6 +86,8 @@ typedef struct _XENVIF_RECEIVER_RING {
     PXENBUS_EVTCHN_CHANNEL      Channel;
     KDPC                        Dpc;
     ULONG                       Dpcs;
+    KTIMER                      Timer;
+    KDPC                        TimerDpc;
     ULONG                       Events;
     PXENVIF_RECEIVER_FRAGMENT   Pending[XENVIF_RECEIVER_MAXIMUM_FRAGMENT_ID + 1];
     ULONG                       RequestsPosted;
@@ -1783,7 +1785,7 @@ ReceiverRingDebugCallback(
                  Ring->Dpcs);
 }
 
-static DECLSPEC_NOINLINE VOID
+static DECLSPEC_NOINLINE BOOLEAN
 ReceiverRingPoll(
     IN  PXENVIF_RECEIVER_RING   Ring
     )
@@ -1792,12 +1794,14 @@ ReceiverRingPoll(
 
     PXENVIF_RECEIVER            Receiver;
     PXENVIF_FRONTEND            Frontend;
-
-    if (!(Ring->Enabled))
-        return;
+    BOOLEAN                     Retry;
 
     Receiver = Ring->Receiver;
     Frontend = Receiver->Frontend;
+    Retry = FALSE;
+
+    if (!Ring->Enabled)
+        goto done;
 
     for (;;) {
         BOOLEAN                 Error;
@@ -1827,15 +1831,14 @@ ReceiverRingPoll(
 
         KeMemoryBarrier();
 
-        if (rsp_cons == rsp_prod)
+        if (rsp_cons == rsp_prod || Retry)
             break;
 
-        while (rsp_cons != rsp_prod) {
+        while (rsp_cons != rsp_prod && !Retry) {
             netif_rx_response_t         *rsp;
             uint16_t                    id;
             PXENVIF_RECEIVER_FRAGMENT   Fragment;
             PMDL                        Mdl;
-            RING_IDX                    req_prod;
 
             rsp = RING_GET_RESPONSE(&Ring->Front, rsp_cons);
 
@@ -1942,6 +1945,9 @@ ReceiverRingPoll(
                     InsertTailList(&Ring->PacketList, &Packet->ListEntry);
                 }
 
+                if (rsp_cons - Ring->Front.rsp_cons > XENVIF_RECEIVER_BATCH(Ring))
+                    Retry = TRUE;
+
                 Error = FALSE;
                 Info = 0;
                 MaximumSegmentSize = 0;
@@ -1949,16 +1955,6 @@ ReceiverRingPoll(
                 flags = 0;
                 TailMdl = NULL;
             }
-
-            KeMemoryBarrier();
-
-            req_prod = Ring->Front.req_prod_pvt;
-
-            if (req_prod - rsp_cons < XENVIF_RECEIVER_BATCH(Ring) &&
-                !__ReceiverRingIsStopped(Ring)) {
-                Ring->Front.rsp_cons = rsp_cons;
-                ReceiverRingFill(Ring);
-            }
         }
         ASSERT(!Error);
         ASSERT(!Extra);
@@ -1978,6 +1974,9 @@ ReceiverRingPoll(
     if (!__ReceiverRingIsStopped(Ring))
         ReceiverRingFill(Ring);
 
+done:
+    return Retry;
+
 #undef  XENVIF_RECEIVER_BATCH
 }
 
@@ -1999,6 +1998,37 @@ __ReceiverRingUnmask(
                   FALSE);
 }
 
+static FORCEINLINE BOOLEAN
+__ReceiverRingDpcTimeout(
+    IN  PXENVIF_RECEIVER_RING   Ring
+    )
+{
+    KDPC_WATCHDOG_INFORMATION   Watchdog;
+    NTSTATUS                    status;
+
+    UNREFERENCED_PARAMETER(Ring);
+
+    RtlZeroMemory(&Watchdog, sizeof (Watchdog));
+
+    status = KeQueryDpcWatchdogInformation(&Watchdog);
+    ASSERT(NT_SUCCESS(status));
+
+    if (Watchdog.DpcTimeLimit == 0 ||
+        Watchdog.DpcWatchdogLimit == 0)
+        return FALSE;
+
+    if (Watchdog.DpcTimeCount > (Watchdog.DpcTimeLimit / 2) &&
+        Watchdog.DpcWatchdogCount > (Watchdog.DpcWatchdogLimit / 2))
+        return FALSE;
+
+    return TRUE;
+}
+
+#define TIME_US(_us)        ((_us) * 10)
+#define TIME_MS(_ms)        (TIME_US((_ms) * 1000))
+#define TIME_S(_s)          (TIME_MS((_s) * 1000))
+#define TIME_RELATIVE(_t)   (-(_t))
+
 __drv_functionClass(KDEFERRED_ROUTINE)
 __drv_maxIRQL(DISPATCH_LEVEL)
 __drv_minIRQL(DISPATCH_LEVEL)
@@ -2020,15 +2050,27 @@ ReceiverRingDpc(
 
     ASSERT(Ring != NULL);
 
-    Ring->Dpcs++;
+    for (;;) {
+        BOOLEAN Retry;
 
-    __ReceiverRingAcquireLock(Ring);
+        __ReceiverRingAcquireLock(Ring);
+        Retry = ReceiverRingPoll(Ring);
+        __ReceiverRingReleaseLock(Ring);
+
+        if (!Retry) {
+            __ReceiverRingUnmask(Ring);
+            break;
+        }
 
-    if (Ring->Enabled)
-        ReceiverRingPoll(Ring);
+        if (__ReceiverRingDpcTimeout(Ring)) {
+            LARGE_INTEGER   Delay;
 
-    __ReceiverRingReleaseLock(Ring);
-    __ReceiverRingUnmask(Ring);
+            Delay.QuadPart = TIME_RELATIVE(TIME_US(100));
+
+            KeSetTimer(&Ring->Timer, Delay, &Ring->TimerDpc);
+            break;
+        }
+    }
 }
 
 KSERVICE_ROUTINE    ReceiverRingEvtchnCallback;
@@ -2049,7 +2091,8 @@ ReceiverRingEvtchnCallback(
 
     Ring->Events++;
 
-    (VOID) KeInsertQueueDpc(&Ring->Dpc, NULL, NULL);
+    if (KeInsertQueueDpc(&Ring->Dpc, NULL, NULL))
+        Ring->Dpcs++;
 
     Receiver = Ring->Receiver;
     Frontend = Receiver->Frontend;
@@ -2061,11 +2104,6 @@ ReceiverRingEvtchnCallback(
     return TRUE;
 }
 
-#define TIME_US(_us)        ((_us) * 10)
-#define TIME_MS(_ms)        (TIME_US((_ms) * 1000))
-#define TIME_S(_s)          (TIME_MS((_s) * 1000))
-#define TIME_RELATIVE(_t)   (-(_t))
-
 #define XENVIF_RECEIVER_WATCHDOG_PERIOD 30
 
 static NTSTATUS
@@ -2168,6 +2206,8 @@ __ReceiverRingInitialize(
     InitializeListHead(&(*Ring)->PacketList);
 
     KeInitializeDpc(&(*Ring)->Dpc, ReceiverRingDpc, *Ring);
+    KeInitializeTimer(&(*Ring)->Timer);
+    KeInitializeDpc(&(*Ring)->TimerDpc, ReceiverRingDpc, *Ring);
 
     status = ThreadCreate(ReceiverRingWatchdog,
                           *Ring,
@@ -2180,6 +2220,8 @@ __ReceiverRingInitialize(
 fail3:
     Error("fail3\n");
 
+    RtlZeroMemory(&(*Ring)->TimerDpc, sizeof (KDPC));
+    RtlZeroMemory(&(*Ring)->Timer, sizeof (KTIMER));
     RtlZeroMemory(&(*Ring)->Dpc, sizeof (KDPC));
 
     RtlZeroMemory(&(*Ring)->PacketList, sizeof (LIST_ENTRY));
@@ -2344,6 +2386,7 @@ __ReceiverRingConnect(
     ASSERT(NT_SUCCESS(status));
 
     KeSetTargetProcessorDpcEx(&Ring->Dpc, &ProcNumber);
+    KeSetTargetProcessorDpcEx(&Ring->TimerDpc, &ProcNumber);
 
     (VOID) XENBUS_EVTCHN(Bind,
                          &Receiver->EvtchnInterface,
@@ -2629,6 +2672,8 @@ __ReceiverRingTeardown(
     Receiver = Ring->Receiver;
     Frontend = Receiver->Frontend;
 
+    RtlZeroMemory(&Ring->TimerDpc, sizeof (KDPC));
+    RtlZeroMemory(&Ring->Timer, sizeof (KTIMER));
     RtlZeroMemory(&Ring->Dpc, sizeof (KDPC));
 
     Ring->BackfillSize = 0;
diff --git a/src/xenvif/transmitter.c b/src/xenvif/transmitter.c
index fdb1334..3aa6366 100644
--- a/src/xenvif/transmitter.c
+++ b/src/xenvif/transmitter.c
@@ -180,6 +180,8 @@ typedef struct _XENVIF_TRANSMITTER_RING {
     PXENBUS_EVTCHN_CHANNEL          Channel;
     KDPC                            Dpc;
     ULONG                           Dpcs;
+    KTIMER                          Timer;
+    KDPC                            TimerDpc;
     ULONG                           Events;
     BOOLEAN                         Connected;
     BOOLEAN                         Enabled;
@@ -2351,7 +2353,7 @@ __TransmitterRingCompletePacket(
     Ring->PacketsCompleted++;
 }
 
-static DECLSPEC_NOINLINE VOID
+static DECLSPEC_NOINLINE BOOLEAN
 TransmitterRingPoll(
     IN  PXENVIF_TRANSMITTER_RING    Ring
     )
@@ -2360,14 +2362,18 @@ TransmitterRingPoll(
 
     PXENVIF_TRANSMITTER             Transmitter;
     PXENVIF_FRONTEND                Frontend;
+    BOOLEAN                         Retry;
 
     Transmitter = Ring->Transmitter;
     Frontend = Transmitter->Frontend;
+    Retry = FALSE;
+
+    if (!Ring->Enabled)
+        goto done;
 
     for (;;) {
         RING_IDX    rsp_prod;
         RING_IDX    rsp_cons;
-        ULONG       Delta;
 
         KeMemoryBarrier();
 
@@ -2376,10 +2382,10 @@ TransmitterRingPoll(
 
         KeMemoryBarrier();
 
-        if (rsp_cons == rsp_prod)
+        if (rsp_cons == rsp_prod || Retry)
             break;
 
-        while (rsp_cons != rsp_prod) {
+        while (rsp_cons != rsp_prod && !Retry) {
             netif_tx_response_t             *rsp;
             uint16_t                        id;
             PXENVIF_TRANSMITTER_FRAGMENT    Fragment;
@@ -2471,10 +2477,8 @@ TransmitterRingPoll(
             Fragment->Extra = FALSE;
             __TransmitterPutFragment(Ring, Fragment);
 
-            if (Packet == NULL) {
-                RtlZeroMemory(rsp, sizeof (netif_tx_response_t));
+            if (Packet == NULL)
                 continue;
-            }
 
             --Packet->Reference;
 
@@ -2495,8 +2499,6 @@ TransmitterRingPoll(
                 }
             }
 
-            RtlZeroMemory(rsp, sizeof (netif_tx_response_t));
-
             if (Packet->Reference != 0)
                 continue;
 
@@ -2504,19 +2506,20 @@ TransmitterRingPoll(
                 Packet->Completion.Status = XENVIF_TRANSMITTER_PACKET_OK;
 
             __TransmitterRingCompletePacket(Ring, Packet);
+
+            if (rsp_cons - Ring->Front.rsp_cons > XENVIF_TRANSMITTER_BATCH(Ring))
+                Retry = TRUE;
         }
 
         KeMemoryBarrier();
 
         Ring->Front.rsp_cons = rsp_cons;
-
-        Delta = Ring->Front.req_prod_pvt - rsp_cons;
-        Delta = __min(Delta, XENVIF_TRANSMITTER_BATCH(Ring));
-        Delta = __max(Delta, 1);
-
-        Ring->Shared->rsp_event = rsp_cons + Delta;
+        Ring->Shared->rsp_event = rsp_cons + 1;
     }
 
+done:
+    return Retry;
+
 #undef XENVIF_TRANSMITTER_BATCH
 }
 
@@ -2930,6 +2933,37 @@ __TransmitterRingUnmask(
                   FALSE);
 }
 
+static FORCEINLINE BOOLEAN
+__TransmitterRingDpcTimeout(
+    IN  PXENVIF_TRANSMITTER_RING    Ring
+    )
+{
+    KDPC_WATCHDOG_INFORMATION       Watchdog;
+    NTSTATUS                        status;
+
+    UNREFERENCED_PARAMETER(Ring);
+
+    RtlZeroMemory(&Watchdog, sizeof (Watchdog));
+
+    status = KeQueryDpcWatchdogInformation(&Watchdog);
+    ASSERT(NT_SUCCESS(status));
+
+    if (Watchdog.DpcTimeLimit == 0 ||
+        Watchdog.DpcWatchdogLimit == 0)
+        return FALSE;
+
+    if (Watchdog.DpcTimeCount > (Watchdog.DpcTimeLimit / 2) &&
+        Watchdog.DpcWatchdogCount > (Watchdog.DpcWatchdogLimit / 2))
+        return FALSE;
+
+    return TRUE;
+}
+
+#define TIME_US(_us)        ((_us) * 10)
+#define TIME_MS(_ms)        (TIME_US((_ms) * 1000))
+#define TIME_S(_s)          (TIME_MS((_s) * 1000))
+#define TIME_RELATIVE(_t)   (-(_t))
+
 __drv_functionClass(KDEFERRED_ROUTINE)
 __drv_maxIRQL(DISPATCH_LEVEL)
 __drv_minIRQL(DISPATCH_LEVEL)
@@ -2951,15 +2985,27 @@ TransmitterRingDpc(
 
     ASSERT(Ring != NULL);
 
-    Ring->Dpcs++;
+    for (;;) {
+        BOOLEAN Retry;
 
-    __TransmitterRingAcquireLock(Ring);
+        __TransmitterRingAcquireLock(Ring);
+        Retry = TransmitterRingPoll(Ring);
+        __TransmitterRingReleaseLock(Ring);
 
-    if (Ring->Enabled)
-        TransmitterRingPoll(Ring);
+        if (!Retry) {
+            __TransmitterRingUnmask(Ring);
+           break;
+        }
 
-    __TransmitterRingReleaseLock(Ring);
-    __TransmitterRingUnmask(Ring);
+        if (__TransmitterRingDpcTimeout(Ring)) {
+            LARGE_INTEGER   Delay;
+
+            Delay.QuadPart = TIME_RELATIVE(TIME_US(100));
+
+            KeSetTimer(&Ring->Timer, Delay, &Ring->TimerDpc);
+            break;
+        }
+    }
 }
 
 KSERVICE_ROUTINE    TransmitterRingEvtchnCallback;
@@ -2985,16 +3031,12 @@ TransmitterRingEvtchnCallback(
 
     Ring->Events++;
 
-    (VOID) KeInsertQueueDpc(&Ring->Dpc, NULL, NULL);
+    if (KeInsertQueueDpc(&Ring->Dpc, NULL, NULL))
+        Ring->Dpcs++;
 
     return TRUE;
 }
 
-#define TIME_US(_us)        ((_us) * 10)
-#define TIME_MS(_ms)        (TIME_US((_ms) * 1000))
-#define TIME_S(_s)          (TIME_MS((_s) * 1000))
-#define TIME_RELATIVE(_t)   (-(_t))
-
 #define XENVIF_TRANSMITTER_WATCHDOG_PERIOD  30
 
 static NTSTATUS
@@ -3044,7 +3086,7 @@ TransmitterRingWatchdog(
 
                 // Try to move things along
                 __TransmitterRingSend(Ring);
-                TransmitterRingPoll(Ring);
+                (VOID) TransmitterRingPoll(Ring);
             }
 
             PacketsQueued = Ring->PacketsQueued;
@@ -3089,6 +3131,8 @@ __TransmitterRingInitialize(
     InitializeListHead(&(*Ring)->PacketComplete);
 
     KeInitializeDpc(&(*Ring)->Dpc, TransmitterRingDpc, *Ring);
+    KeInitializeTimer(&(*Ring)->Timer);
+    KeInitializeDpc(&(*Ring)->TimerDpc, TransmitterRingDpc, *Ring);
 
     status = ThreadCreate(TransmitterRingWatchdog,
                           *Ring,
@@ -3101,6 +3145,8 @@ __TransmitterRingInitialize(
 fail3:
     Error("fail3\n");
 
+    RtlZeroMemory(&(*Ring)->TimerDpc, sizeof (KDPC));
+    RtlZeroMemory(&(*Ring)->Timer, sizeof (KTIMER));
     RtlZeroMemory(&(*Ring)->Dpc, sizeof (KDPC));
 
     RtlZeroMemory(&(*Ring)->PacketComplete, sizeof (LIST_ENTRY));
@@ -3344,6 +3390,7 @@ __TransmitterRingConnect(
         ASSERT(NT_SUCCESS(status));
 
         KeSetTargetProcessorDpcEx(&Ring->Dpc, &ProcNumber);
+        KeSetTargetProcessorDpcEx(&Ring->TimerDpc, &ProcNumber);
 
         (VOID) XENBUS_EVTCHN(Bind,
                              &Transmitter->EvtchnInterface,
@@ -3587,7 +3634,6 @@ __TransmitterRingDisable(
     __TransmitterRingAcquireLock(Ring);
 
     ASSERT(Ring->Enabled);
-    Ring->Enabled = FALSE;
 
     // Release any fragments associated with a pending packet
     Packet = __TransmitterRingUnprepareFragments(Ring);
@@ -3636,7 +3682,7 @@ __TransmitterRingDisable(
 
         // Try to move things along
         __TransmitterRingSend(Ring);
-        TransmitterRingPoll(Ring);
+        (VOID) TransmitterRingPoll(Ring);
 
         if (State != XenbusStateConnected)
             __TransmitterRingFakeResponses(Ring);
@@ -3649,6 +3695,8 @@ __TransmitterRingDisable(
         KeStallExecutionProcessor(1000);    // 1ms
     }
 
+    Ring->Enabled = FALSE;
+
     __TransmitterRingReleaseLock(Ring);
 }
 
@@ -3751,6 +3799,10 @@ __TransmitterRingTeardown(
     Transmitter = Ring->Transmitter;
     Frontend = Transmitter->Frontend;
 
+    Ring->Dpcs = 0;
+
+    RtlZeroMemory(&Ring->TimerDpc, sizeof (KDPC));
+    RtlZeroMemory(&Ring->Timer, sizeof (KTIMER));
     RtlZeroMemory(&Ring->Dpc, sizeof (KDPC));
 
     ASSERT3U(Ring->PacketsCompleted, ==, Ring->PacketsSent);
@@ -4787,7 +4839,8 @@ TransmitterNotify(
 
     Ring = Transmitter->Ring[Index];
 
-    (VOID) KeInsertQueueDpc(&Ring->Dpc, NULL, NULL);
+    if (KeInsertQueueDpc(&Ring->Dpc, NULL, NULL))
+        Ring->Dpcs++;
 }
 
 VOID
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Tue Jan 26 11:31:15 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 26 Jan 2016 11:31:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aO1q7-0000oz-24; Tue, 26 Jan 2016 11:31:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aO1q6-0000ou-2L
	for win-pv-devel@lists.xenproject.org; Tue, 26 Jan 2016 11:31:14 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	62/3B-02745-10957A65; Tue, 26 Jan 2016 11:31:13 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1453807871!8546938!1
X-Originating-IP: [209.85.160.177]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 46021 invoked from network); 26 Jan 2016 11:31:12 -0000
Received: from mail-yk0-f177.google.com (HELO mail-yk0-f177.google.com)
	(209.85.160.177)
	by server-4.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 26 Jan 2016 11:31:12 -0000
Received: by mail-yk0-f177.google.com with SMTP id u68so66662597ykd.2
	for <win-pv-devel@lists.xenproject.org>;
	Tue, 26 Jan 2016 03:31:12 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=Eptbn2It5Vl1SCvBHAr/o+FkLoujXO4Fs1a4suNhI/c=;
	b=gLk2G6aUTlm6ko7TaYdVRq4pw5ZfWPgmPgklg+OGKNgFJZRC7FRUngVgMpJYQ1vwCI
	RF5/Q2pGshEC7b9Txzq3giqEyNAqkf2IpF9c6+LlooEb6fk6kho/3nJpgkeW4eP2FrwA
	HRi41kxHFwTsoVhe2w/uGoIFYAlRtCS65kBW+Y+j5RxWxnQLOVn61HxiAJedr08O2CAh
	qc5N5gyyW79Ilkb8W+ubTTELpeD1gCw2+FbcJ+g8NrpfAq7oJ1WzFnXl3/GlXIURmpkX
	gmFS5P6sFtzHaOFHaL8YHUofYZuF6ZPq7OuOTjJEYFVIYruQGu/ZlRDbY01D+25qCsQF
	2GgA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id;
	bh=Eptbn2It5Vl1SCvBHAr/o+FkLoujXO4Fs1a4suNhI/c=;
	b=bsZUv2zBX0wocaAJgDp3IBZeOSzvC84BVIZdQPGR9rA4e0O07wy2BNIfIw9ln2IL3E
	dV8wtBVDaS6I6Lseyee0bSN+oFFESPhuC9GmoGXOQ4JaSfcgUevRcls639Rv+irn7FDD
	9cjqUJ05JfQ5gbP16T4A0jGGqaKC3BtcoBlqjDkbqxmgStMobnE3vCJkP/7+YmpKun5y
	2APAWFTRmrKn5+Q4WWYFDt/ot/JMx0MfsmWSqglxsB1Qe6ojzhoxayazaBRVywDfYDeF
	wDjCcXw3g39JFAxMvngid5TQuV5/HZZWgxDwNGvkKpLeiz68WJUcJLoJn6fWXVL6e5we
	CkTA==
X-Gm-Message-State: AG10YOQchjXQOx0W19oE55UbQfmhzucfg5RH2iMcYznFPLX3iYBWHuRnwYeK/FlywUDWHw==
X-Received: by 10.13.224.132 with SMTP id j126mr10765310ywe.117.1453807871171; 
	Tue, 26 Jan 2016 03:31:11 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	g192sm508098ywb.18.2016.01.26.03.31.10
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Tue, 26 Jan 2016 03:31:10 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Tue, 26 Jan 2016 11:30:27 +0000
Message-Id: <1453807827-2516-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Add DPC watchdog avoidance to receiver and
	transmitter poll
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Under HCK MPE testing it's possible for both receiver and transmitter
polling loops to run long enough to hit the DPC watchdog. This patch
avoids the problem by terminating the polling loops after a 'batch'
(currently 1/4 of the ring) and then checking the remaining time before the
watchdog fires. If the remaining time is still more than half the total
time then another poll is done, otherwise a timer is scheduled to complete
the work.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xenvif/receiver.c    | 103 ++++++++++++++++++++++++++++++------------
 src/xenvif/transmitter.c | 115 ++++++++++++++++++++++++++++++++++-------------
 2 files changed, 158 insertions(+), 60 deletions(-)

diff --git a/src/xenvif/receiver.c b/src/xenvif/receiver.c
index 29877f2..538971e 100644
--- a/src/xenvif/receiver.c
+++ b/src/xenvif/receiver.c
@@ -86,6 +86,8 @@ typedef struct _XENVIF_RECEIVER_RING {
     PXENBUS_EVTCHN_CHANNEL      Channel;
     KDPC                        Dpc;
     ULONG                       Dpcs;
+    KTIMER                      Timer;
+    KDPC                        TimerDpc;
     ULONG                       Events;
     PXENVIF_RECEIVER_FRAGMENT   Pending[XENVIF_RECEIVER_MAXIMUM_FRAGMENT_ID + 1];
     ULONG                       RequestsPosted;
@@ -1783,7 +1785,7 @@ ReceiverRingDebugCallback(
                  Ring->Dpcs);
 }
 
-static DECLSPEC_NOINLINE VOID
+static DECLSPEC_NOINLINE BOOLEAN
 ReceiverRingPoll(
     IN  PXENVIF_RECEIVER_RING   Ring
     )
@@ -1792,12 +1794,14 @@ ReceiverRingPoll(
 
     PXENVIF_RECEIVER            Receiver;
     PXENVIF_FRONTEND            Frontend;
-
-    if (!(Ring->Enabled))
-        return;
+    BOOLEAN                     Retry;
 
     Receiver = Ring->Receiver;
     Frontend = Receiver->Frontend;
+    Retry = FALSE;
+
+    if (!Ring->Enabled)
+        goto done;
 
     for (;;) {
         BOOLEAN                 Error;
@@ -1827,15 +1831,14 @@ ReceiverRingPoll(
 
         KeMemoryBarrier();
 
-        if (rsp_cons == rsp_prod)
+        if (rsp_cons == rsp_prod || Retry)
             break;
 
-        while (rsp_cons != rsp_prod) {
+        while (rsp_cons != rsp_prod && !Retry) {
             netif_rx_response_t         *rsp;
             uint16_t                    id;
             PXENVIF_RECEIVER_FRAGMENT   Fragment;
             PMDL                        Mdl;
-            RING_IDX                    req_prod;
 
             rsp = RING_GET_RESPONSE(&Ring->Front, rsp_cons);
 
@@ -1942,6 +1945,9 @@ ReceiverRingPoll(
                     InsertTailList(&Ring->PacketList, &Packet->ListEntry);
                 }
 
+                if (rsp_cons - Ring->Front.rsp_cons > XENVIF_RECEIVER_BATCH(Ring))
+                    Retry = TRUE;
+
                 Error = FALSE;
                 Info = 0;
                 MaximumSegmentSize = 0;
@@ -1949,16 +1955,6 @@ ReceiverRingPoll(
                 flags = 0;
                 TailMdl = NULL;
             }
-
-            KeMemoryBarrier();
-
-            req_prod = Ring->Front.req_prod_pvt;
-
-            if (req_prod - rsp_cons < XENVIF_RECEIVER_BATCH(Ring) &&
-                !__ReceiverRingIsStopped(Ring)) {
-                Ring->Front.rsp_cons = rsp_cons;
-                ReceiverRingFill(Ring);
-            }
         }
         ASSERT(!Error);
         ASSERT(!Extra);
@@ -1978,6 +1974,9 @@ ReceiverRingPoll(
     if (!__ReceiverRingIsStopped(Ring))
         ReceiverRingFill(Ring);
 
+done:
+    return Retry;
+
 #undef  XENVIF_RECEIVER_BATCH
 }
 
@@ -1999,6 +1998,37 @@ __ReceiverRingUnmask(
                   FALSE);
 }
 
+static FORCEINLINE BOOLEAN
+__ReceiverRingDpcTimeout(
+    IN  PXENVIF_RECEIVER_RING   Ring
+    )
+{
+    KDPC_WATCHDOG_INFORMATION   Watchdog;
+    NTSTATUS                    status;
+
+    UNREFERENCED_PARAMETER(Ring);
+
+    RtlZeroMemory(&Watchdog, sizeof (Watchdog));
+
+    status = KeQueryDpcWatchdogInformation(&Watchdog);
+    ASSERT(NT_SUCCESS(status));
+
+    if (Watchdog.DpcTimeLimit == 0 ||
+        Watchdog.DpcWatchdogLimit == 0)
+        return FALSE;
+
+    if (Watchdog.DpcTimeCount > (Watchdog.DpcTimeLimit / 2) &&
+        Watchdog.DpcWatchdogCount > (Watchdog.DpcWatchdogLimit / 2))
+        return FALSE;
+
+    return TRUE;
+}
+
+#define TIME_US(_us)        ((_us) * 10)
+#define TIME_MS(_ms)        (TIME_US((_ms) * 1000))
+#define TIME_S(_s)          (TIME_MS((_s) * 1000))
+#define TIME_RELATIVE(_t)   (-(_t))
+
 __drv_functionClass(KDEFERRED_ROUTINE)
 __drv_maxIRQL(DISPATCH_LEVEL)
 __drv_minIRQL(DISPATCH_LEVEL)
@@ -2020,15 +2050,27 @@ ReceiverRingDpc(
 
     ASSERT(Ring != NULL);
 
-    Ring->Dpcs++;
+    for (;;) {
+        BOOLEAN Retry;
 
-    __ReceiverRingAcquireLock(Ring);
+        __ReceiverRingAcquireLock(Ring);
+        Retry = ReceiverRingPoll(Ring);
+        __ReceiverRingReleaseLock(Ring);
+
+        if (!Retry) {
+            __ReceiverRingUnmask(Ring);
+            break;
+        }
 
-    if (Ring->Enabled)
-        ReceiverRingPoll(Ring);
+        if (__ReceiverRingDpcTimeout(Ring)) {
+            LARGE_INTEGER   Delay;
 
-    __ReceiverRingReleaseLock(Ring);
-    __ReceiverRingUnmask(Ring);
+            Delay.QuadPart = TIME_RELATIVE(TIME_US(100));
+
+            KeSetTimer(&Ring->Timer, Delay, &Ring->TimerDpc);
+            break;
+        }
+    }
 }
 
 KSERVICE_ROUTINE    ReceiverRingEvtchnCallback;
@@ -2049,7 +2091,8 @@ ReceiverRingEvtchnCallback(
 
     Ring->Events++;
 
-    (VOID) KeInsertQueueDpc(&Ring->Dpc, NULL, NULL);
+    if (KeInsertQueueDpc(&Ring->Dpc, NULL, NULL))
+        Ring->Dpcs++;
 
     Receiver = Ring->Receiver;
     Frontend = Receiver->Frontend;
@@ -2061,11 +2104,6 @@ ReceiverRingEvtchnCallback(
     return TRUE;
 }
 
-#define TIME_US(_us)        ((_us) * 10)
-#define TIME_MS(_ms)        (TIME_US((_ms) * 1000))
-#define TIME_S(_s)          (TIME_MS((_s) * 1000))
-#define TIME_RELATIVE(_t)   (-(_t))
-
 #define XENVIF_RECEIVER_WATCHDOG_PERIOD 30
 
 static NTSTATUS
@@ -2168,6 +2206,8 @@ __ReceiverRingInitialize(
     InitializeListHead(&(*Ring)->PacketList);
 
     KeInitializeDpc(&(*Ring)->Dpc, ReceiverRingDpc, *Ring);
+    KeInitializeTimer(&(*Ring)->Timer);
+    KeInitializeDpc(&(*Ring)->TimerDpc, ReceiverRingDpc, *Ring);
 
     status = ThreadCreate(ReceiverRingWatchdog,
                           *Ring,
@@ -2180,6 +2220,8 @@ __ReceiverRingInitialize(
 fail3:
     Error("fail3\n");
 
+    RtlZeroMemory(&(*Ring)->TimerDpc, sizeof (KDPC));
+    RtlZeroMemory(&(*Ring)->Timer, sizeof (KTIMER));
     RtlZeroMemory(&(*Ring)->Dpc, sizeof (KDPC));
 
     RtlZeroMemory(&(*Ring)->PacketList, sizeof (LIST_ENTRY));
@@ -2344,6 +2386,7 @@ __ReceiverRingConnect(
     ASSERT(NT_SUCCESS(status));
 
     KeSetTargetProcessorDpcEx(&Ring->Dpc, &ProcNumber);
+    KeSetTargetProcessorDpcEx(&Ring->TimerDpc, &ProcNumber);
 
     (VOID) XENBUS_EVTCHN(Bind,
                          &Receiver->EvtchnInterface,
@@ -2629,6 +2672,8 @@ __ReceiverRingTeardown(
     Receiver = Ring->Receiver;
     Frontend = Receiver->Frontend;
 
+    RtlZeroMemory(&Ring->TimerDpc, sizeof (KDPC));
+    RtlZeroMemory(&Ring->Timer, sizeof (KTIMER));
     RtlZeroMemory(&Ring->Dpc, sizeof (KDPC));
 
     Ring->BackfillSize = 0;
diff --git a/src/xenvif/transmitter.c b/src/xenvif/transmitter.c
index fdb1334..3aa6366 100644
--- a/src/xenvif/transmitter.c
+++ b/src/xenvif/transmitter.c
@@ -180,6 +180,8 @@ typedef struct _XENVIF_TRANSMITTER_RING {
     PXENBUS_EVTCHN_CHANNEL          Channel;
     KDPC                            Dpc;
     ULONG                           Dpcs;
+    KTIMER                          Timer;
+    KDPC                            TimerDpc;
     ULONG                           Events;
     BOOLEAN                         Connected;
     BOOLEAN                         Enabled;
@@ -2351,7 +2353,7 @@ __TransmitterRingCompletePacket(
     Ring->PacketsCompleted++;
 }
 
-static DECLSPEC_NOINLINE VOID
+static DECLSPEC_NOINLINE BOOLEAN
 TransmitterRingPoll(
     IN  PXENVIF_TRANSMITTER_RING    Ring
     )
@@ -2360,14 +2362,18 @@ TransmitterRingPoll(
 
     PXENVIF_TRANSMITTER             Transmitter;
     PXENVIF_FRONTEND                Frontend;
+    BOOLEAN                         Retry;
 
     Transmitter = Ring->Transmitter;
     Frontend = Transmitter->Frontend;
+    Retry = FALSE;
+
+    if (!Ring->Enabled)
+        goto done;
 
     for (;;) {
         RING_IDX    rsp_prod;
         RING_IDX    rsp_cons;
-        ULONG       Delta;
 
         KeMemoryBarrier();
 
@@ -2376,10 +2382,10 @@ TransmitterRingPoll(
 
         KeMemoryBarrier();
 
-        if (rsp_cons == rsp_prod)
+        if (rsp_cons == rsp_prod || Retry)
             break;
 
-        while (rsp_cons != rsp_prod) {
+        while (rsp_cons != rsp_prod && !Retry) {
             netif_tx_response_t             *rsp;
             uint16_t                        id;
             PXENVIF_TRANSMITTER_FRAGMENT    Fragment;
@@ -2471,10 +2477,8 @@ TransmitterRingPoll(
             Fragment->Extra = FALSE;
             __TransmitterPutFragment(Ring, Fragment);
 
-            if (Packet == NULL) {
-                RtlZeroMemory(rsp, sizeof (netif_tx_response_t));
+            if (Packet == NULL)
                 continue;
-            }
 
             --Packet->Reference;
 
@@ -2495,8 +2499,6 @@ TransmitterRingPoll(
                 }
             }
 
-            RtlZeroMemory(rsp, sizeof (netif_tx_response_t));
-
             if (Packet->Reference != 0)
                 continue;
 
@@ -2504,19 +2506,20 @@ TransmitterRingPoll(
                 Packet->Completion.Status = XENVIF_TRANSMITTER_PACKET_OK;
 
             __TransmitterRingCompletePacket(Ring, Packet);
+
+            if (rsp_cons - Ring->Front.rsp_cons > XENVIF_TRANSMITTER_BATCH(Ring))
+                Retry = TRUE;
         }
 
         KeMemoryBarrier();
 
         Ring->Front.rsp_cons = rsp_cons;
-
-        Delta = Ring->Front.req_prod_pvt - rsp_cons;
-        Delta = __min(Delta, XENVIF_TRANSMITTER_BATCH(Ring));
-        Delta = __max(Delta, 1);
-
-        Ring->Shared->rsp_event = rsp_cons + Delta;
+        Ring->Shared->rsp_event = rsp_cons + 1;
     }
 
+done:
+    return Retry;
+
 #undef XENVIF_TRANSMITTER_BATCH
 }
 
@@ -2930,6 +2933,37 @@ __TransmitterRingUnmask(
                   FALSE);
 }
 
+static FORCEINLINE BOOLEAN
+__TransmitterRingDpcTimeout(
+    IN  PXENVIF_TRANSMITTER_RING    Ring
+    )
+{
+    KDPC_WATCHDOG_INFORMATION       Watchdog;
+    NTSTATUS                        status;
+
+    UNREFERENCED_PARAMETER(Ring);
+
+    RtlZeroMemory(&Watchdog, sizeof (Watchdog));
+
+    status = KeQueryDpcWatchdogInformation(&Watchdog);
+    ASSERT(NT_SUCCESS(status));
+
+    if (Watchdog.DpcTimeLimit == 0 ||
+        Watchdog.DpcWatchdogLimit == 0)
+        return FALSE;
+
+    if (Watchdog.DpcTimeCount > (Watchdog.DpcTimeLimit / 2) &&
+        Watchdog.DpcWatchdogCount > (Watchdog.DpcWatchdogLimit / 2))
+        return FALSE;
+
+    return TRUE;
+}
+
+#define TIME_US(_us)        ((_us) * 10)
+#define TIME_MS(_ms)        (TIME_US((_ms) * 1000))
+#define TIME_S(_s)          (TIME_MS((_s) * 1000))
+#define TIME_RELATIVE(_t)   (-(_t))
+
 __drv_functionClass(KDEFERRED_ROUTINE)
 __drv_maxIRQL(DISPATCH_LEVEL)
 __drv_minIRQL(DISPATCH_LEVEL)
@@ -2951,15 +2985,27 @@ TransmitterRingDpc(
 
     ASSERT(Ring != NULL);
 
-    Ring->Dpcs++;
+    for (;;) {
+        BOOLEAN Retry;
 
-    __TransmitterRingAcquireLock(Ring);
+        __TransmitterRingAcquireLock(Ring);
+        Retry = TransmitterRingPoll(Ring);
+        __TransmitterRingReleaseLock(Ring);
 
-    if (Ring->Enabled)
-        TransmitterRingPoll(Ring);
+        if (!Retry) {
+            __TransmitterRingUnmask(Ring);
+           break;
+        }
 
-    __TransmitterRingReleaseLock(Ring);
-    __TransmitterRingUnmask(Ring);
+        if (__TransmitterRingDpcTimeout(Ring)) {
+            LARGE_INTEGER   Delay;
+
+            Delay.QuadPart = TIME_RELATIVE(TIME_US(100));
+
+            KeSetTimer(&Ring->Timer, Delay, &Ring->TimerDpc);
+            break;
+        }
+    }
 }
 
 KSERVICE_ROUTINE    TransmitterRingEvtchnCallback;
@@ -2985,16 +3031,12 @@ TransmitterRingEvtchnCallback(
 
     Ring->Events++;
 
-    (VOID) KeInsertQueueDpc(&Ring->Dpc, NULL, NULL);
+    if (KeInsertQueueDpc(&Ring->Dpc, NULL, NULL))
+        Ring->Dpcs++;
 
     return TRUE;
 }
 
-#define TIME_US(_us)        ((_us) * 10)
-#define TIME_MS(_ms)        (TIME_US((_ms) * 1000))
-#define TIME_S(_s)          (TIME_MS((_s) * 1000))
-#define TIME_RELATIVE(_t)   (-(_t))
-
 #define XENVIF_TRANSMITTER_WATCHDOG_PERIOD  30
 
 static NTSTATUS
@@ -3044,7 +3086,7 @@ TransmitterRingWatchdog(
 
                 // Try to move things along
                 __TransmitterRingSend(Ring);
-                TransmitterRingPoll(Ring);
+                (VOID) TransmitterRingPoll(Ring);
             }
 
             PacketsQueued = Ring->PacketsQueued;
@@ -3089,6 +3131,8 @@ __TransmitterRingInitialize(
     InitializeListHead(&(*Ring)->PacketComplete);
 
     KeInitializeDpc(&(*Ring)->Dpc, TransmitterRingDpc, *Ring);
+    KeInitializeTimer(&(*Ring)->Timer);
+    KeInitializeDpc(&(*Ring)->TimerDpc, TransmitterRingDpc, *Ring);
 
     status = ThreadCreate(TransmitterRingWatchdog,
                           *Ring,
@@ -3101,6 +3145,8 @@ __TransmitterRingInitialize(
 fail3:
     Error("fail3\n");
 
+    RtlZeroMemory(&(*Ring)->TimerDpc, sizeof (KDPC));
+    RtlZeroMemory(&(*Ring)->Timer, sizeof (KTIMER));
     RtlZeroMemory(&(*Ring)->Dpc, sizeof (KDPC));
 
     RtlZeroMemory(&(*Ring)->PacketComplete, sizeof (LIST_ENTRY));
@@ -3344,6 +3390,7 @@ __TransmitterRingConnect(
         ASSERT(NT_SUCCESS(status));
 
         KeSetTargetProcessorDpcEx(&Ring->Dpc, &ProcNumber);
+        KeSetTargetProcessorDpcEx(&Ring->TimerDpc, &ProcNumber);
 
         (VOID) XENBUS_EVTCHN(Bind,
                              &Transmitter->EvtchnInterface,
@@ -3587,7 +3634,6 @@ __TransmitterRingDisable(
     __TransmitterRingAcquireLock(Ring);
 
     ASSERT(Ring->Enabled);
-    Ring->Enabled = FALSE;
 
     // Release any fragments associated with a pending packet
     Packet = __TransmitterRingUnprepareFragments(Ring);
@@ -3636,7 +3682,7 @@ __TransmitterRingDisable(
 
         // Try to move things along
         __TransmitterRingSend(Ring);
-        TransmitterRingPoll(Ring);
+        (VOID) TransmitterRingPoll(Ring);
 
         if (State != XenbusStateConnected)
             __TransmitterRingFakeResponses(Ring);
@@ -3649,6 +3695,8 @@ __TransmitterRingDisable(
         KeStallExecutionProcessor(1000);    // 1ms
     }
 
+    Ring->Enabled = FALSE;
+
     __TransmitterRingReleaseLock(Ring);
 }
 
@@ -3751,6 +3799,10 @@ __TransmitterRingTeardown(
     Transmitter = Ring->Transmitter;
     Frontend = Transmitter->Frontend;
 
+    Ring->Dpcs = 0;
+
+    RtlZeroMemory(&Ring->TimerDpc, sizeof (KDPC));
+    RtlZeroMemory(&Ring->Timer, sizeof (KTIMER));
     RtlZeroMemory(&Ring->Dpc, sizeof (KDPC));
 
     ASSERT3U(Ring->PacketsCompleted, ==, Ring->PacketsSent);
@@ -4787,7 +4839,8 @@ TransmitterNotify(
 
     Ring = Transmitter->Ring[Index];
 
-    (VOID) KeInsertQueueDpc(&Ring->Dpc, NULL, NULL);
+    if (KeInsertQueueDpc(&Ring->Dpc, NULL, NULL))
+        Ring->Dpcs++;
 }
 
 VOID
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Tue Jan 26 11:49:08 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 26 Jan 2016 11:49:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aO27P-0002Fb-GY; Tue, 26 Jan 2016 11:49:07 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aO27N-0002FR-Mz
	for win-pv-devel@lists.xenproject.org; Tue, 26 Jan 2016 11:49:05 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	77/48-23747-13D57A65; Tue, 26 Jan 2016 11:49:05 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1453808944!18146730!1
X-Originating-IP: [74.125.82.52]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 47681 invoked from network); 26 Jan 2016 11:49:04 -0000
Received: from mail-wm0-f52.google.com (HELO mail-wm0-f52.google.com)
	(74.125.82.52)
	by server-10.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 26 Jan 2016 11:49:04 -0000
Received: by mail-wm0-f52.google.com with SMTP id 123so102406254wmz.0
	for <win-pv-devel@lists.xenproject.org>;
	Tue, 26 Jan 2016 03:49:04 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=MFQlR98OAMM1KjOP0nwVtegzyL41AMevlpMqIAW6xZE=;
	b=OiCYJ1wVKRRnYhSnbrK20BqwMEIpqq3eWZQa2Hf7FVgOHRALZykBOlI3kQYqHvNkgd
	cNbhzUEWCcDcKX3Z8w7B7yvqc9qipUpPyduYINIcoP/U+/izM8gtd6DwnF9OAtVhWOFB
	Mmjjod3WmbQ6f8Qo2TynY5+KmHB6TsQpLwth3tpJu0IpahMtKIQUZNSWxZA4JfegknxF
	tUAfIOT7Ap5ucsFr0U2OBL7s8S77v+p4e9kJUXDJuTMIP+uqPil56kkW10FM35BpSY/m
	XyLfF6tGqwdJOstRv7PsOuEpL0w2UDnFGj0EKQf8Gc1GVYtNVtQuvtlzEaUZkShU3Cb/
	enVA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id;
	bh=MFQlR98OAMM1KjOP0nwVtegzyL41AMevlpMqIAW6xZE=;
	b=Pu0mmmJfTT0gjU8cz7MLW7KLWhYIWlurmpOCnQFn3xHdF5HyTCdMkW5hRDKz3kul20
	xivPnzKwAcSupXN3CEQjE7PeSys/PVxyOgTJU2N6EL+aYlv4jzPlV9Y5mD1tsUxclpRs
	meufL/ikZDbxPIn1BDwTW8CSWabKpVrX9BjJ0MWYewuQqNLISMdu71wnYcpiyOnAUM+A
	Q4WP4/zGQK1mIrGCGfsE8PYjTz6DfpK9lkwgY7P9xDOuIg0t5ujTBiqIXhZCfEwSwd5n
	/5vKyNN/5aYQ5p1z0Mh+UanlQZNG8xoHgWhjUH0dwAYkxxJGbmOUIjHeHf9POasvmiv5
	KK0Q==
X-Gm-Message-State: AG10YOTAGSRsA08HTOcUKHpNb9uIoiif0qjaO+zW0yeWrV7WKOKlWvlNwE6fqQppn0iZ1Q==
X-Received: by 10.194.22.167 with SMTP id e7mr26684951wjf.29.1453808944168;
	Tue, 26 Jan 2016 03:49:04 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194])
	by smtp.gmail.com with ESMTPSA id 67sm3165523wmp.20.2016.01.26.03.49.03
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Tue, 26 Jan 2016 03:49:03 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Tue, 26 Jan 2016 11:48:53 +0000
Message-Id: <1453808933-8912-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Fix multiple completion vulnerability in
	transmit code
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

My previous patch 7c3365d5 "Make transmitter robust against a possible
completion race" did not fix the problem. There is still the possibility
that a NET_BUFFER_LIST containing multiple NET_BUFFERs could lead to
multiple completions if the underlying transmit completes quickly (or indeed
synchrnously). This is because a reference is taken before sending each
NET_BUFFER but, if that transmission completes immediately the reference is
dropped back to zero (leading to the NET_BUFFER_LIST being completed) before
the reference is taken for the next NET_BUFFER.

This patch therefore takes an extra reference before sending any NET_BUFFERs
and then drops it when there are no more NET_BUFFERs to send. This ensures
that the reference count on the NET_BUFFER_LIST can only fall to zero once
the whole thing has been processed.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xennet/transmitter.c | 45 +++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 41 insertions(+), 4 deletions(-)

diff --git a/src/xennet/transmitter.c b/src/xennet/transmitter.c
index 91ed5f2..eaf5267 100644
--- a/src/xennet/transmitter.c
+++ b/src/xennet/transmitter.c
@@ -90,6 +90,7 @@ TransmitterTeardown(
 
 typedef struct _NET_BUFFER_LIST_RESERVED {
     LONG    Reference;
+    LONG    Status;
 } NET_BUFFER_LIST_RESERVED, *PNET_BUFFER_LIST_RESERVED;
 
 C_ASSERT(sizeof (NET_BUFFER_LIST_RESERVED) <= RTL_FIELD_SIZE(NET_BUFFER_LIST, MiniportReserved));
@@ -120,6 +121,39 @@ __TransmitterCompleteNetBufferList(
                                     NDIS_SEND_COMPLETE_FLAGS_DISPATCH_LEVEL);
 }
 
+__TransmitterGetNetBufferList(
+    IN  PXENNET_TRANSMITTER     Transmitter,
+    IN  PNET_BUFFER_LIST        NetBufferList
+    )
+{
+    PNET_BUFFER_LIST_RESERVED   ListReserved;
+
+    UNREFERENCED_PARAMETER(Transmitter);
+
+    ListReserved = (PNET_BUFFER_LIST_RESERVED)NET_BUFFER_LIST_MINIPORT_RESERVED(NetBufferList);
+
+    if (InterlockedIncrement(&ListReserved->Reference) == 1)
+        ListReserved->Status = NDIS_STATUS_PENDING;
+}
+
+__TransmitterPutNetBufferList(
+    IN  PXENNET_TRANSMITTER     Transmitter,
+    IN  PNET_BUFFER_LIST        NetBufferList
+    )
+{
+    PNET_BUFFER_LIST_RESERVED   ListReserved;
+
+    UNREFERENCED_PARAMETER(Transmitter);
+
+    ListReserved = (PNET_BUFFER_LIST_RESERVED)NET_BUFFER_LIST_MINIPORT_RESERVED(NetBufferList);
+
+    ASSERT(ListReserved->Reference != 0);
+    if (InterlockedDecrement(&ListReserved->Reference) == 0)
+        __TransmitterCompleteNetBufferList(Transmitter,
+                                           NetBufferList,
+                                           ListReserved->Status);
+}
+
 static VOID
 __TransmitterReturnPacket(
     IN  PXENNET_TRANSMITTER     Transmitter,
@@ -134,9 +168,8 @@ __TransmitterReturnPacket(
 
     ListReserved = (PNET_BUFFER_LIST_RESERVED)NET_BUFFER_LIST_MINIPORT_RESERVED(NetBufferList);
 
-    ASSERT(ListReserved->Reference != 0);
-    if (InterlockedDecrement(&ListReserved->Reference) == 0)
-        __TransmitterCompleteNetBufferList(Transmitter, NetBufferList, Status);
+    (VOID) InterlockedExchange(&ListReserved->Status, Status);
+    __TransmitterPutNetBufferList(Transmitter, NetBufferList);
 }
 
 static VOID
@@ -248,6 +281,8 @@ TransmitterSendNetBufferLists(
         ListReserved = (PNET_BUFFER_LIST_RESERVED)NET_BUFFER_LIST_MINIPORT_RESERVED(NetBufferList);
         RtlZeroMemory(ListReserved, sizeof (NET_BUFFER_LIST_RESERVED));
 
+        __TransmitterGetNetBufferList(Transmitter, NetBufferList);
+
         NetBuffer = NET_BUFFER_LIST_FIRST_NB(NetBufferList);
         while (NetBuffer != NULL) {
             PNET_BUFFER         NetBufferListNext = NET_BUFFER_NEXT_NB(NetBuffer);
@@ -255,7 +290,7 @@ TransmitterSendNetBufferLists(
             XENVIF_PACKET_HASH  Hash;
             NTSTATUS            status;
 
-            InterlockedIncrement(&ListReserved->Reference);
+            __TransmitterGetNetBufferList(Transmitter, NetBufferList);
 
             Hash.Algorithm = XENVIF_PACKET_HASH_ALGORITHM_NONE;
 
@@ -278,6 +313,8 @@ TransmitterSendNetBufferLists(
             NetBuffer = NetBufferListNext;
         }
 
+        __TransmitterPutNetBufferList(Transmitter, NetBufferList);
+
         NetBufferList = ListNext;
     }
 
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Tue Jan 26 11:49:08 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 26 Jan 2016 11:49:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aO27P-0002Fb-GY; Tue, 26 Jan 2016 11:49:07 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aO27N-0002FR-Mz
	for win-pv-devel@lists.xenproject.org; Tue, 26 Jan 2016 11:49:05 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	77/48-23747-13D57A65; Tue, 26 Jan 2016 11:49:05 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1453808944!18146730!1
X-Originating-IP: [74.125.82.52]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 47681 invoked from network); 26 Jan 2016 11:49:04 -0000
Received: from mail-wm0-f52.google.com (HELO mail-wm0-f52.google.com)
	(74.125.82.52)
	by server-10.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 26 Jan 2016 11:49:04 -0000
Received: by mail-wm0-f52.google.com with SMTP id 123so102406254wmz.0
	for <win-pv-devel@lists.xenproject.org>;
	Tue, 26 Jan 2016 03:49:04 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=MFQlR98OAMM1KjOP0nwVtegzyL41AMevlpMqIAW6xZE=;
	b=OiCYJ1wVKRRnYhSnbrK20BqwMEIpqq3eWZQa2Hf7FVgOHRALZykBOlI3kQYqHvNkgd
	cNbhzUEWCcDcKX3Z8w7B7yvqc9qipUpPyduYINIcoP/U+/izM8gtd6DwnF9OAtVhWOFB
	Mmjjod3WmbQ6f8Qo2TynY5+KmHB6TsQpLwth3tpJu0IpahMtKIQUZNSWxZA4JfegknxF
	tUAfIOT7Ap5ucsFr0U2OBL7s8S77v+p4e9kJUXDJuTMIP+uqPil56kkW10FM35BpSY/m
	XyLfF6tGqwdJOstRv7PsOuEpL0w2UDnFGj0EKQf8Gc1GVYtNVtQuvtlzEaUZkShU3Cb/
	enVA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id;
	bh=MFQlR98OAMM1KjOP0nwVtegzyL41AMevlpMqIAW6xZE=;
	b=Pu0mmmJfTT0gjU8cz7MLW7KLWhYIWlurmpOCnQFn3xHdF5HyTCdMkW5hRDKz3kul20
	xivPnzKwAcSupXN3CEQjE7PeSys/PVxyOgTJU2N6EL+aYlv4jzPlV9Y5mD1tsUxclpRs
	meufL/ikZDbxPIn1BDwTW8CSWabKpVrX9BjJ0MWYewuQqNLISMdu71wnYcpiyOnAUM+A
	Q4WP4/zGQK1mIrGCGfsE8PYjTz6DfpK9lkwgY7P9xDOuIg0t5ujTBiqIXhZCfEwSwd5n
	/5vKyNN/5aYQ5p1z0Mh+UanlQZNG8xoHgWhjUH0dwAYkxxJGbmOUIjHeHf9POasvmiv5
	KK0Q==
X-Gm-Message-State: AG10YOTAGSRsA08HTOcUKHpNb9uIoiif0qjaO+zW0yeWrV7WKOKlWvlNwE6fqQppn0iZ1Q==
X-Received: by 10.194.22.167 with SMTP id e7mr26684951wjf.29.1453808944168;
	Tue, 26 Jan 2016 03:49:04 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194])
	by smtp.gmail.com with ESMTPSA id 67sm3165523wmp.20.2016.01.26.03.49.03
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Tue, 26 Jan 2016 03:49:03 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Tue, 26 Jan 2016 11:48:53 +0000
Message-Id: <1453808933-8912-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Fix multiple completion vulnerability in
	transmit code
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

My previous patch 7c3365d5 "Make transmitter robust against a possible
completion race" did not fix the problem. There is still the possibility
that a NET_BUFFER_LIST containing multiple NET_BUFFERs could lead to
multiple completions if the underlying transmit completes quickly (or indeed
synchrnously). This is because a reference is taken before sending each
NET_BUFFER but, if that transmission completes immediately the reference is
dropped back to zero (leading to the NET_BUFFER_LIST being completed) before
the reference is taken for the next NET_BUFFER.

This patch therefore takes an extra reference before sending any NET_BUFFERs
and then drops it when there are no more NET_BUFFERs to send. This ensures
that the reference count on the NET_BUFFER_LIST can only fall to zero once
the whole thing has been processed.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xennet/transmitter.c | 45 +++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 41 insertions(+), 4 deletions(-)

diff --git a/src/xennet/transmitter.c b/src/xennet/transmitter.c
index 91ed5f2..eaf5267 100644
--- a/src/xennet/transmitter.c
+++ b/src/xennet/transmitter.c
@@ -90,6 +90,7 @@ TransmitterTeardown(
 
 typedef struct _NET_BUFFER_LIST_RESERVED {
     LONG    Reference;
+    LONG    Status;
 } NET_BUFFER_LIST_RESERVED, *PNET_BUFFER_LIST_RESERVED;
 
 C_ASSERT(sizeof (NET_BUFFER_LIST_RESERVED) <= RTL_FIELD_SIZE(NET_BUFFER_LIST, MiniportReserved));
@@ -120,6 +121,39 @@ __TransmitterCompleteNetBufferList(
                                     NDIS_SEND_COMPLETE_FLAGS_DISPATCH_LEVEL);
 }
 
+__TransmitterGetNetBufferList(
+    IN  PXENNET_TRANSMITTER     Transmitter,
+    IN  PNET_BUFFER_LIST        NetBufferList
+    )
+{
+    PNET_BUFFER_LIST_RESERVED   ListReserved;
+
+    UNREFERENCED_PARAMETER(Transmitter);
+
+    ListReserved = (PNET_BUFFER_LIST_RESERVED)NET_BUFFER_LIST_MINIPORT_RESERVED(NetBufferList);
+
+    if (InterlockedIncrement(&ListReserved->Reference) == 1)
+        ListReserved->Status = NDIS_STATUS_PENDING;
+}
+
+__TransmitterPutNetBufferList(
+    IN  PXENNET_TRANSMITTER     Transmitter,
+    IN  PNET_BUFFER_LIST        NetBufferList
+    )
+{
+    PNET_BUFFER_LIST_RESERVED   ListReserved;
+
+    UNREFERENCED_PARAMETER(Transmitter);
+
+    ListReserved = (PNET_BUFFER_LIST_RESERVED)NET_BUFFER_LIST_MINIPORT_RESERVED(NetBufferList);
+
+    ASSERT(ListReserved->Reference != 0);
+    if (InterlockedDecrement(&ListReserved->Reference) == 0)
+        __TransmitterCompleteNetBufferList(Transmitter,
+                                           NetBufferList,
+                                           ListReserved->Status);
+}
+
 static VOID
 __TransmitterReturnPacket(
     IN  PXENNET_TRANSMITTER     Transmitter,
@@ -134,9 +168,8 @@ __TransmitterReturnPacket(
 
     ListReserved = (PNET_BUFFER_LIST_RESERVED)NET_BUFFER_LIST_MINIPORT_RESERVED(NetBufferList);
 
-    ASSERT(ListReserved->Reference != 0);
-    if (InterlockedDecrement(&ListReserved->Reference) == 0)
-        __TransmitterCompleteNetBufferList(Transmitter, NetBufferList, Status);
+    (VOID) InterlockedExchange(&ListReserved->Status, Status);
+    __TransmitterPutNetBufferList(Transmitter, NetBufferList);
 }
 
 static VOID
@@ -248,6 +281,8 @@ TransmitterSendNetBufferLists(
         ListReserved = (PNET_BUFFER_LIST_RESERVED)NET_BUFFER_LIST_MINIPORT_RESERVED(NetBufferList);
         RtlZeroMemory(ListReserved, sizeof (NET_BUFFER_LIST_RESERVED));
 
+        __TransmitterGetNetBufferList(Transmitter, NetBufferList);
+
         NetBuffer = NET_BUFFER_LIST_FIRST_NB(NetBufferList);
         while (NetBuffer != NULL) {
             PNET_BUFFER         NetBufferListNext = NET_BUFFER_NEXT_NB(NetBuffer);
@@ -255,7 +290,7 @@ TransmitterSendNetBufferLists(
             XENVIF_PACKET_HASH  Hash;
             NTSTATUS            status;
 
-            InterlockedIncrement(&ListReserved->Reference);
+            __TransmitterGetNetBufferList(Transmitter, NetBufferList);
 
             Hash.Algorithm = XENVIF_PACKET_HASH_ALGORITHM_NONE;
 
@@ -278,6 +313,8 @@ TransmitterSendNetBufferLists(
             NetBuffer = NetBufferListNext;
         }
 
+        __TransmitterPutNetBufferList(Transmitter, NetBufferList);
+
         NetBufferList = ListNext;
     }
 
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Tue Jan 26 16:48:38 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 26 Jan 2016 16:48:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aO6nE-00068T-TU; Tue, 26 Jan 2016 16:48:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <fabio.fantoni@m2r.biz>) id 1aO6nD-00068H-Qe
	for win-pv-devel@lists.xenproject.org; Tue, 26 Jan 2016 16:48:35 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	1C/2C-06010-263A7A65; Tue, 26 Jan 2016 16:48:34 +0000
X-Env-Sender: fabio.fantoni@m2r.biz
X-Msg-Ref: server-9.tower-31.messagelabs.com!1453826913!1039190!1
X-Originating-IP: [74.125.82.50]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16653 invoked from network); 26 Jan 2016 16:48:33 -0000
Received: from mail-wm0-f50.google.com (HELO mail-wm0-f50.google.com)
	(74.125.82.50)
	by server-9.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 26 Jan 2016 16:48:33 -0000
Received: by mail-wm0-f50.google.com with SMTP id n5so140568648wmn.0
	for <win-pv-devel@lists.xenproject.org>;
	Tue, 26 Jan 2016 08:48:33 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=m2r-biz.20150623.gappssmtp.com; s=20150623;
	h=to:from:cc:subject:message-id:date:user-agent:mime-version
	:content-type:content-transfer-encoding;
	bh=R0tsN7rrd1G9KQTWIVf9ZJQ+Uu2nIIq5knsMJdOlZV4=;
	b=KnkolgUyvBwqV6eGLadwhbvs0f7a3rIz5xSehXWEVgtZx0++JFWNL43H6LhP1foeF6
	dWkXR/VAjUHXJ1v+SrcG/dMEK/AIBQVCuU92V+0KZS4/AjOlbq4WeQlltjgXNZJmZn4K
	V//uivpfth6AeEgVsWIEFjF4wajSYKkXm0SMZCr7iTbu/c7YN7Tc73Oh5Wb6k/x4Yu2I
	QdF1MmOUiLBhHlBfyoCcaYUFGoqFDx2PMW5jXpHtKYryDpaQ27V6FCSB9GzqnKlVw91p
	3fs+zNUQg+UriI1SgxMIFCeRxfwUgOM/W3opuf/o0tqY+ZhP6ENSSagI1fJ7PMWxHSMl
	UI8w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:to:from:cc:subject:message-id:date:user-agent
	:mime-version:content-type:content-transfer-encoding;
	bh=R0tsN7rrd1G9KQTWIVf9ZJQ+Uu2nIIq5knsMJdOlZV4=;
	b=kTL+e72us1C2QlIpQqTxsgmVbxl2QzopAStAEbsm9706V0NOIJ3PpJMG86GxTgt2Ok
	u4qJIe/moRUF5pE8RMkhf2N6TNvksnXRWNGfBxSrUaEEof/inV7LL0603MchTmd3ejYU
	k7JJawvQS9GoYAQXzwUC2Sd7fmvfq0EBcP7BUpAZ8ZwrECugnTWFzxrzj4GUBluc7r5R
	A2WQ+fyrGg2Z846Cqb514sD8zmETqDYIus463FMHjNqZFC3AtZHgoP2njxdy9eN0QWB6
	WPKTvDHkKjcHiHFqNuf9YbbXNxERUl0Cf13p5DdouPoDTWeaBVyN5olTLIJ0gn9n9FSl
	9pwQ==
X-Gm-Message-State: AG10YOQ7tb/2tRjgMyNbdEybw6nkleGcRITVa7J3BGOGwGUo/tPbwWO4U95akYTi8mHe8Q==
X-Received: by 10.28.88.8 with SMTP id m8mr26702751wmb.73.1453826913184;
	Tue, 26 Jan 2016 08:48:33 -0800 (PST)
Received: from [192.168.1.25] (ip-73-126.sn2.clouditalia.com. [83.211.73.126])
	by smtp.googlemail.com with ESMTPSA id
	c203sm3680676wmd.5.2016.01.26.08.48.31
	(version=TLSv1/SSLv3 cipher=OTHER);
	Tue, 26 Jan 2016 08:48:32 -0800 (PST)
To: win-pv-devel@lists.xenproject.org, xen-devel@lists.xensource.com,
	spice-devel@lists.freedesktop.org
From: Fabio Fantoni <fabio.fantoni@m2r.biz>
Message-ID: <56A7A362.30309@m2r.biz>
Date: Tue, 26 Jan 2016 17:48:34 +0100
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101
	Thunderbird/38.5.1
MIME-Version: 1.0
Cc: Paul Durrant <paul.durrant@citrix.com>, pasik@iki.fi
Subject: [win-pv-devel] Developers for virgl 3d windows guest support
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

I take a fast look to virgl 3d project even if I not tested it for now. 
It seems interesting for adding 2d and 3d hw acceleration support to 
virtual machines with a large hw (gpu) choice.
I take a look also to intel gvt-g but it has a very limited cpu support 
choice.
I saw that windows guest support with direct3d drivers in virgl is 
planned but I nothing was done for now.
I'm approaching a new project (based on xen) and I'm in planning phase now.
My goal would be to have virgl 3d windows guest support (drivers with 
opengl and direct3d) and support of remote rendering with spice (we are 
already using with qxl for now)
Are there any developers expert about these things that can advice me if 
developing windows drivers (WDDM kernel driver + GL and D3D userspace 
pieces) and any other needed pieces of code in virglrender, mesa, and 
/or qemu is a good choice?
If yes, what we would like to know is approx time/effort to have the 
above support upstream. Approximately how many persons and how many time 
would require to complete the tasks? (my project is going to be financed 
so we eventually have resource to schedule working time in the community)

Thanks for any reply and sorry for my bad english.

_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Tue Jan 26 16:48:38 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 26 Jan 2016 16:48:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aO6nE-00068T-TU; Tue, 26 Jan 2016 16:48:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <fabio.fantoni@m2r.biz>) id 1aO6nD-00068H-Qe
	for win-pv-devel@lists.xenproject.org; Tue, 26 Jan 2016 16:48:35 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	1C/2C-06010-263A7A65; Tue, 26 Jan 2016 16:48:34 +0000
X-Env-Sender: fabio.fantoni@m2r.biz
X-Msg-Ref: server-9.tower-31.messagelabs.com!1453826913!1039190!1
X-Originating-IP: [74.125.82.50]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16653 invoked from network); 26 Jan 2016 16:48:33 -0000
Received: from mail-wm0-f50.google.com (HELO mail-wm0-f50.google.com)
	(74.125.82.50)
	by server-9.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 26 Jan 2016 16:48:33 -0000
Received: by mail-wm0-f50.google.com with SMTP id n5so140568648wmn.0
	for <win-pv-devel@lists.xenproject.org>;
	Tue, 26 Jan 2016 08:48:33 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=m2r-biz.20150623.gappssmtp.com; s=20150623;
	h=to:from:cc:subject:message-id:date:user-agent:mime-version
	:content-type:content-transfer-encoding;
	bh=R0tsN7rrd1G9KQTWIVf9ZJQ+Uu2nIIq5knsMJdOlZV4=;
	b=KnkolgUyvBwqV6eGLadwhbvs0f7a3rIz5xSehXWEVgtZx0++JFWNL43H6LhP1foeF6
	dWkXR/VAjUHXJ1v+SrcG/dMEK/AIBQVCuU92V+0KZS4/AjOlbq4WeQlltjgXNZJmZn4K
	V//uivpfth6AeEgVsWIEFjF4wajSYKkXm0SMZCr7iTbu/c7YN7Tc73Oh5Wb6k/x4Yu2I
	QdF1MmOUiLBhHlBfyoCcaYUFGoqFDx2PMW5jXpHtKYryDpaQ27V6FCSB9GzqnKlVw91p
	3fs+zNUQg+UriI1SgxMIFCeRxfwUgOM/W3opuf/o0tqY+ZhP6ENSSagI1fJ7PMWxHSMl
	UI8w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:to:from:cc:subject:message-id:date:user-agent
	:mime-version:content-type:content-transfer-encoding;
	bh=R0tsN7rrd1G9KQTWIVf9ZJQ+Uu2nIIq5knsMJdOlZV4=;
	b=kTL+e72us1C2QlIpQqTxsgmVbxl2QzopAStAEbsm9706V0NOIJ3PpJMG86GxTgt2Ok
	u4qJIe/moRUF5pE8RMkhf2N6TNvksnXRWNGfBxSrUaEEof/inV7LL0603MchTmd3ejYU
	k7JJawvQS9GoYAQXzwUC2Sd7fmvfq0EBcP7BUpAZ8ZwrECugnTWFzxrzj4GUBluc7r5R
	A2WQ+fyrGg2Z846Cqb514sD8zmETqDYIus463FMHjNqZFC3AtZHgoP2njxdy9eN0QWB6
	WPKTvDHkKjcHiHFqNuf9YbbXNxERUl0Cf13p5DdouPoDTWeaBVyN5olTLIJ0gn9n9FSl
	9pwQ==
X-Gm-Message-State: AG10YOQ7tb/2tRjgMyNbdEybw6nkleGcRITVa7J3BGOGwGUo/tPbwWO4U95akYTi8mHe8Q==
X-Received: by 10.28.88.8 with SMTP id m8mr26702751wmb.73.1453826913184;
	Tue, 26 Jan 2016 08:48:33 -0800 (PST)
Received: from [192.168.1.25] (ip-73-126.sn2.clouditalia.com. [83.211.73.126])
	by smtp.googlemail.com with ESMTPSA id
	c203sm3680676wmd.5.2016.01.26.08.48.31
	(version=TLSv1/SSLv3 cipher=OTHER);
	Tue, 26 Jan 2016 08:48:32 -0800 (PST)
To: win-pv-devel@lists.xenproject.org, xen-devel@lists.xensource.com,
	spice-devel@lists.freedesktop.org
From: Fabio Fantoni <fabio.fantoni@m2r.biz>
Message-ID: <56A7A362.30309@m2r.biz>
Date: Tue, 26 Jan 2016 17:48:34 +0100
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101
	Thunderbird/38.5.1
MIME-Version: 1.0
Cc: Paul Durrant <paul.durrant@citrix.com>, pasik@iki.fi
Subject: [win-pv-devel] Developers for virgl 3d windows guest support
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

I take a fast look to virgl 3d project even if I not tested it for now. 
It seems interesting for adding 2d and 3d hw acceleration support to 
virtual machines with a large hw (gpu) choice.
I take a look also to intel gvt-g but it has a very limited cpu support 
choice.
I saw that windows guest support with direct3d drivers in virgl is 
planned but I nothing was done for now.
I'm approaching a new project (based on xen) and I'm in planning phase now.
My goal would be to have virgl 3d windows guest support (drivers with 
opengl and direct3d) and support of remote rendering with spice (we are 
already using with qxl for now)
Are there any developers expert about these things that can advice me if 
developing windows drivers (WDDM kernel driver + GL and D3D userspace 
pieces) and any other needed pieces of code in virglrender, mesa, and 
/or qemu is a good choice?
If yes, what we would like to know is approx time/effort to have the 
above support upstream. Approximately how many persons and how many time 
would require to complete the tasks? (my project is going to be financed 
so we eventually have resource to schedule working time in the community)

Thanks for any reply and sorry for my bad english.

_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Wed Jan 27 15:04:35 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 27 Jan 2016 15:04:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aORe5-0003d4-UA; Wed, 27 Jan 2016 15:04:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aORe4-0003cw-BT
	for win-pv-devel@lists.xenproject.org; Wed, 27 Jan 2016 15:04:32 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	58/37-12072-F7CD8A65; Wed, 27 Jan 2016 15:04:31 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1453907069!11065025!1
X-Originating-IP: [74.125.82.45]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 40261 invoked from network); 27 Jan 2016 15:04:29 -0000
Received: from mail-wm0-f45.google.com (HELO mail-wm0-f45.google.com)
	(74.125.82.45)
	by server-16.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 27 Jan 2016 15:04:29 -0000
Received: by mail-wm0-f45.google.com with SMTP id n5so30803402wmn.0
	for <win-pv-devel@lists.xenproject.org>;
	Wed, 27 Jan 2016 07:04:29 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=jOLK6K7Doh0JVp0YLxt77KXMi77Ap4BkD+Nbz2mSd5Q=;
	b=XO7H8Mx8uoVxO0VaR101F2NFNcxIWjsPRuC0DA6CY6Otj/DGxJ1UDk3cV+cQLE4jHi
	B+X1PK1hSUUjm8aR0xkwfEKWIMsci3MTAjxvrAu/kiNwBIPhOlXQIcntEO/0Zd+XBXCW
	LinC0VsBqDtxB79Qvptpc8R+gotpRcDzGaiu8UFFjfjquFoxM7BDphTnrrf6AbYZonNx
	V7tdJBLijvzToWDceoPP9NrJaZ2gYLh7LC7FvCcU4A6PXiMYugjbU2cMbSbAGP+muZqB
	LdlizhuX185Ndfgq0wHWQWSdzbrT1vNYHZye7fhViAFPskqRfrwxVvkgrrJ5Enz3NHQ0
	oA1Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id;
	bh=jOLK6K7Doh0JVp0YLxt77KXMi77Ap4BkD+Nbz2mSd5Q=;
	b=Un9w9t2IAd3Um7iCSEQ0HGDlhbyRxJIFb0eSD/zfUkpDk+QO3DM7jcVRmlh0hiT0Sm
	xH9Cy30ptaBr4L7zkrEXw6e7vwQcNEiOcNd3H712Z95TQkyYH5xuUCoQAgUtzLohJAn2
	5LDZVTUDaXSdOA5t8jVd1bGapAKg++6KhDNOmPGQmhz9viIVLa7nITTVzvoTdH1ilt5K
	/l3Vj5GH3KJkBCwu07wzjfvr+F+aLVW94PCUZF5U7PoXt/9DHEbHq2k2luV0QZRB0yod
	6oWHjkEfWnzxajjVlPDJBMHRZq/VJZm6kF2HOppl6KXIWizTso29PTRVLg31krqaJyh+
	YClQ==
X-Gm-Message-State: AG10YOSzP0BB9h4AWTZgbcspkLUZ5vMB4dwYetTGC3LHPXFpv+5Viz2YZFfJTdDPKcuRKA==
X-Received: by 10.194.249.69 with SMTP id ys5mr28281587wjc.97.1453907068965;
	Wed, 27 Jan 2016 07:04:28 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194])
	by smtp.gmail.com with ESMTPSA id u4sm6660204wjz.4.2016.01.27.07.04.27
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Wed, 27 Jan 2016 07:04:28 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Wed, 27 Jan 2016 15:04:10 +0000
Message-Id: <1453907050-9396-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Stop using RtlStringCbPrintfA()
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

It appears that linking an NDIS driver with any ntstrsafe function (when
building with VS2012 and the 8.0 WDK at least) has the side effect of
requiring use of DbgPrint(). Whilst this may not sound like a problem, it
is. This is because the NDISTest 6.0 1c_KernelCalls test insists that any
use of DbgPrint is illegal and so it's impossible to logo an NDIS driver
using ntstrsafe functions.

This patch works around the issue by dynamically linking (at run-time) to
the ntdll _snprintf_s function as a replacement for calls to
RtlStringCbPrintfA(). This entails importing the dynamic linking code from
XENVIF since MmGetSystemRoutineAddress() doesn't seem to work for that
symbol.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xennet/adapter.c         |  40 ++++---
 src/xennet/link.c            | 250 +++++++++++++++++++++++++++++++++++++++++++
 src/xennet/link.h            |  42 ++++++++
 vs2012/xennet/xennet.vcxproj |   3 +-
 vs2013/xennet/xennet.vcxproj |   3 +-
 5 files changed, 323 insertions(+), 15 deletions(-)
 create mode 100644 src/xennet/link.c
 create mode 100644 src/xennet/link.h

diff --git a/src/xennet/adapter.c b/src/xennet/adapter.c
index dca9b7b..d85f4d1 100644
--- a/src/xennet/adapter.c
+++ b/src/xennet/adapter.c
@@ -32,7 +32,6 @@
 #define INITGUID 1
 
 #include <ndis.h>
-#include <ntstrsafe.h>
 #include <stdlib.h>
 #include <version.h>
 
@@ -46,6 +45,7 @@
 #include "util.h"
 #include "dbg_print.h"
 #include "assert.h"
+#include "link.h"
 
 #define MAXNAMELEN  128
 
@@ -1300,6 +1300,11 @@ __AdapterSetDistribution(
     )
 {
     ULONG               Index;
+    NTSTATUS            (*___snprintf_s)(char *,
+                                         size_t,
+                                         size_t,
+                                         const char *,
+                                         ...);
     CHAR                Distribution[MAXNAMELEN];
     CHAR                Vendor[MAXNAMELEN];
     const CHAR          *Product;
@@ -1307,15 +1312,21 @@ __AdapterSetDistribution(
 
     Trace("====>\n");
 
+    status = LinkGetRoutineAddress("ntdll.dll",
+                                   "_snprintf_s",
+                                   (PVOID *)&___snprintf_s);
+    if (!NT_SUCCESS(status))
+        goto fail1;
+
     Index = 0;
     while (Index <= MAXIMUM_INDEX) {
         PCHAR   Buffer;
 
-        status = RtlStringCbPrintfA(Distribution,
-                                    MAXNAMELEN,
-                                    "%u",
-                                    Index);
-        ASSERT(NT_SUCCESS(status));
+        (VOID) ___snprintf_s(Distribution,
+                             MAXNAMELEN,
+                             _TRUNCATE,
+                             "%u",
+                             Index);
 
         status = XENBUS_STORE(Read,
                               &Adapter->StoreInterface,
@@ -1327,7 +1338,7 @@ __AdapterSetDistribution(
             if (status == STATUS_OBJECT_NAME_NOT_FOUND)
                 goto update;
 
-            goto fail1;
+            goto fail2;
         }
 
         XENBUS_STORE(Free,
@@ -1338,14 +1349,14 @@ __AdapterSetDistribution(
     }
 
     status = STATUS_UNSUCCESSFUL;
-    goto fail2;
+    goto fail3;
 
 update:
-    status = RtlStringCbPrintfA(Vendor,
-                                MAXNAMELEN,
-                                "%s",
-                                VENDOR_NAME_STR);
-    ASSERT(NT_SUCCESS(status));
+    (VOID) ___snprintf_s(Vendor,
+                         MAXNAMELEN,
+                         _TRUNCATE,
+                         "%s",
+                         VENDOR_NAME_STR);
 
     for (Index  = 0; Vendor[Index] != '\0'; Index++)
         if (!isalnum((UCHAR)Vendor[Index]))
@@ -1378,6 +1389,9 @@ update:
     Trace("<====\n");
     return STATUS_SUCCESS;
 
+fail3:
+    Error("fail3\n");
+
 fail2:
     Error("fail2\n");
 
diff --git a/src/xennet/link.c b/src/xennet/link.c
new file mode 100644
index 0000000..e2a41bc
--- /dev/null
+++ b/src/xennet/link.c
@@ -0,0 +1,250 @@
+/* Copyright (c) Citrix Systems Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms,
+ * with or without modification, are permitted provided
+ * that the following conditions are met:
+ *
+ * *   Redistributions of source code must retain the above
+ *     copyright notice, this list of conditions and the
+ *     following disclaimer.
+ * *   Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the
+ *     following disclaimer in the documentation and/or other
+ *     materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <ntddk.h>
+#include <aux_klib.h>
+
+#include "link.h"
+#include "dbg_print.h"
+#include "assert.h"
+#include "util.h"
+
+#define LINK_TAG    'KNIL'
+
+static FORCEINLINE PVOID
+__LinkAllocate(
+    IN  ULONG   Length
+    )
+{
+    return __AllocatePoolWithTag(NonPagedPool, Length, LINK_TAG);
+}
+
+static FORCEINLINE VOID
+__LinkFree(
+    IN  PVOID   Buffer
+    )
+{
+    __FreePoolWithTag(Buffer, LINK_TAG);
+}
+
+static FORCEINLINE NTSTATUS
+__LinkGetImageBase(
+    IN  const CHAR              *ModuleName,
+    OUT PVOID                   *ImageBase
+    )
+{
+    ULONG                       BufferSize;
+    ULONG                       Count;
+    PAUX_MODULE_EXTENDED_INFO   QueryInfo;
+    ULONG                       Index;
+    NTSTATUS                    status;
+
+    Trace("====>\n");
+
+    status = AuxKlibInitialize();
+    if (!NT_SUCCESS(status))
+        goto fail1;
+
+    status = AuxKlibQueryModuleInformation(&BufferSize,
+                                           sizeof (AUX_MODULE_EXTENDED_INFO),
+                                           NULL);
+    if (!NT_SUCCESS(status))
+        goto fail2;
+
+    status = STATUS_UNSUCCESSFUL;
+    if (BufferSize == 0)
+        goto fail3;
+
+again:
+    Count = BufferSize / sizeof (AUX_MODULE_EXTENDED_INFO);
+    QueryInfo = __LinkAllocate(sizeof (AUX_MODULE_EXTENDED_INFO) * Count);
+
+    status = STATUS_NO_MEMORY;
+    if (QueryInfo == NULL)
+        goto fail4;
+
+    status = AuxKlibQueryModuleInformation(&BufferSize,
+                                           sizeof (AUX_MODULE_EXTENDED_INFO),
+                                           QueryInfo);
+    if (!NT_SUCCESS(status)) {
+        if (status != STATUS_BUFFER_TOO_SMALL)
+            goto fail5;
+
+        __LinkFree(QueryInfo);
+        goto again;
+    }
+
+    for (Index = 0; Index < Count; Index++) {
+        PCHAR   Name;
+
+        Name = strrchr((const CHAR *)QueryInfo[Index].FullPathName, '\\');
+        Name = (Name == NULL) ? (PCHAR)QueryInfo[Index].FullPathName : (Name + 1);
+
+        if (_stricmp(Name, ModuleName) == 0)
+            goto found;
+    }
+
+    status = STATUS_UNSUCCESSFUL;
+    goto fail6;
+
+found:
+    *ImageBase = QueryInfo[Index].BasicInfo.ImageBase;
+
+    __LinkFree(QueryInfo);
+
+    Trace("<====\n");
+
+    return STATUS_SUCCESS;
+
+fail6:
+    Error("fail6\n");
+
+fail5:
+    Error("fail5\n");
+
+    __LinkFree(QueryInfo);
+
+fail4:
+    Error("fail4\n");
+
+fail3:
+    Error("fail3\n");
+
+fail2:
+    Error("fail2\n");
+
+fail1:
+    Error("fail1 (%08x)\n", status);
+
+    return status;
+}
+
+NTSTATUS
+LinkGetRoutineAddress(
+    IN  const CHAR  *ModuleName,
+    IN  const CHAR  *FunctionName,
+    OUT PVOID       *Address
+    )
+{
+#define MK_PTR(_ImageBase, _Type, _RVA) \
+    (_Type)((ULONG_PTR)(_ImageBase) + (_RVA))
+
+    PVOID                       ImageBase;
+    PIMAGE_DOS_HEADER           DosHeader;
+    PIMAGE_NT_HEADERS           NtHeaders;
+    PIMAGE_OPTIONAL_HEADER      OptionalHeader;
+    PIMAGE_DATA_DIRECTORY       Entry;
+    PIMAGE_EXPORT_DIRECTORY     Exports;
+    PULONG                      AddressOfFunctions;
+    PULONG                      AddressOfNames;
+    PUSHORT                     AddressOfNameOrdinals;
+    ULONG                       Index;
+    USHORT                      Ordinal;
+    PVOID                       Function;
+    NTSTATUS                    status;
+
+    Trace("====>\n");
+
+    status = __LinkGetImageBase(ModuleName, &ImageBase);
+    if (!NT_SUCCESS(status))
+        goto fail1;
+
+    DosHeader = MK_PTR(ImageBase, PIMAGE_DOS_HEADER, 0);
+    ASSERT3U(DosHeader->e_magic, ==, IMAGE_DOS_SIGNATURE);
+
+    NtHeaders = MK_PTR(ImageBase, PIMAGE_NT_HEADERS, DosHeader->e_lfanew);
+    ASSERT3U(NtHeaders->Signature, ==, IMAGE_NT_SIGNATURE);
+
+    OptionalHeader = &NtHeaders->OptionalHeader;
+    ASSERT3U(OptionalHeader->Magic, ==, IMAGE_NT_OPTIONAL_HDR_MAGIC);
+
+    Entry = &OptionalHeader->DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT];
+
+    status = STATUS_UNSUCCESSFUL;
+    if (Entry->Size == 0)
+        goto fail2;
+
+    Exports = MK_PTR(ImageBase, PIMAGE_EXPORT_DIRECTORY,
+                     Entry->VirtualAddress);
+
+    status = STATUS_UNSUCCESSFUL;
+    if (Exports->NumberOfNames == 0)
+        goto fail3;
+
+    AddressOfFunctions = MK_PTR(ImageBase, PULONG,
+                                Exports->AddressOfFunctions);
+    AddressOfNames = MK_PTR(ImageBase, PULONG,
+                            Exports->AddressOfNames);
+    AddressOfNameOrdinals = MK_PTR(ImageBase, PUSHORT,
+                                   Exports->AddressOfNameOrdinals);
+
+    for (Index = 0; Index < Exports->NumberOfNames; Index++) {
+        PCHAR   Name = MK_PTR(ImageBase, PCHAR, AddressOfNames[Index]);
+
+        Ordinal = AddressOfNameOrdinals[Index];
+        Function = MK_PTR(ImageBase, PVOID, AddressOfFunctions[Ordinal]);
+
+        if (strcmp(Name, FunctionName) == 0)
+            goto found;
+    }
+
+    status = STATUS_UNSUCCESSFUL;
+    goto fail4;
+
+found:
+    *Address = Function;
+
+    Trace("%s:%s (%04X) @ %p\n",
+          ModuleName,
+          FunctionName,
+          Ordinal,
+          Function);
+
+    Trace("<====\n");
+
+    return STATUS_SUCCESS;
+
+fail4:
+    Error("fail4\n");
+
+fail3:
+    Error("fail3\n");
+
+fail2:
+    Error("fail2\n");
+
+fail1:
+    Error("fail1 (%08x)\n", status);
+
+    return status;
+
+#undef  MK_PTR
+}
diff --git a/src/xennet/link.h b/src/xennet/link.h
new file mode 100644
index 0000000..9e4b564
--- /dev/null
+++ b/src/xennet/link.h
@@ -0,0 +1,42 @@
+/* Copyright (c) Citrix Systems Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms,
+ * with or without modification, are permitted provided
+ * that the following conditions are met:
+ *
+ * *   Redistributions of source code must retain the above
+ *     copyright notice, this list of conditions and the
+ *     following disclaimer.
+ * *   Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the
+ *     following disclaimer in the documentation and/or other
+ *     materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _XENNET_LINK_H
+#define _XENNET_LINK_H
+
+extern NTSTATUS
+LinkGetRoutineAddress(
+    IN  const CHAR  *ModuleName,
+    IN  const CHAR  *FunctionName,
+    OUT PVOID       *Address
+     );
+
+#endif  // _XENVIF_LINK_H
diff --git a/vs2012/xennet/xennet.vcxproj b/vs2012/xennet/xennet.vcxproj
index 3ca7407..e80bcb1 100644
--- a/vs2012/xennet/xennet.vcxproj
+++ b/vs2012/xennet/xennet.vcxproj
@@ -40,7 +40,7 @@
 		</ClCompile>
 		<Link>
 			<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
-			<AdditionalDependencies>$(DDK_LIB_PATH)\ndis.lib;$(DDK_LIB_PATH)/libcntpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
+			<AdditionalDependencies>$(DDK_LIB_PATH)\ndis.lib;$(DDK_LIB_PATH)/libcntpr.lib;$(DDK_LIB_PATH)/aux_klib.lib;%(AdditionalDependencies)</AdditionalDependencies>
 			<EnableCOMDATFolding>false</EnableCOMDATFolding>
 		</Link>
 		<Inf>
@@ -75,6 +75,7 @@
 	<ItemGroup>
 		<ClCompile Include="../../src/xennet/adapter.c" />
 		<ClCompile Include="../../src/xennet/driver.c" />
+		<ClCompile Include="../../src/xennet/link.c" />
 		<ClCompile Include="../../src/xennet/miniport.c" />
 		<ClCompile Include="../../src/xennet/receiver.c" />
 		<ClCompile Include="../../src/xennet/transmitter.c" />
diff --git a/vs2013/xennet/xennet.vcxproj b/vs2013/xennet/xennet.vcxproj
index 0064a92..bcc6025 100644
--- a/vs2013/xennet/xennet.vcxproj
+++ b/vs2013/xennet/xennet.vcxproj
@@ -36,7 +36,7 @@
     </ClCompile>
     <Link>
       <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
-      <AdditionalDependencies>$(DDK_LIB_PATH)/libcntpr.lib;$(DDK_LIB_PATH)\ndis.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>$(DDK_LIB_PATH)\ndis.lib;$(DDK_LIB_PATH)/libcntpr.lib;$(DDK_LIB_PATH)/aux_klib.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <EnableCOMDATFolding>false</EnableCOMDATFolding>
     </Link>
     <Inf>
@@ -70,6 +70,7 @@
   <ItemGroup>
     <ClCompile Include="../../src/xennet/adapter.c" />
     <ClCompile Include="../../src/xennet/driver.c" />
+    <ClCompile Include="../../src/xennet/link.c" />
     <ClCompile Include="../../src/xennet/miniport.c" />
     <ClCompile Include="../../src/xennet/receiver.c" />
     <ClCompile Include="../../src/xennet/transmitter.c" />
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Wed Jan 27 15:04:35 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 27 Jan 2016 15:04:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aORe5-0003d4-UA; Wed, 27 Jan 2016 15:04:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aORe4-0003cw-BT
	for win-pv-devel@lists.xenproject.org; Wed, 27 Jan 2016 15:04:32 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	58/37-12072-F7CD8A65; Wed, 27 Jan 2016 15:04:31 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1453907069!11065025!1
X-Originating-IP: [74.125.82.45]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 40261 invoked from network); 27 Jan 2016 15:04:29 -0000
Received: from mail-wm0-f45.google.com (HELO mail-wm0-f45.google.com)
	(74.125.82.45)
	by server-16.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 27 Jan 2016 15:04:29 -0000
Received: by mail-wm0-f45.google.com with SMTP id n5so30803402wmn.0
	for <win-pv-devel@lists.xenproject.org>;
	Wed, 27 Jan 2016 07:04:29 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=jOLK6K7Doh0JVp0YLxt77KXMi77Ap4BkD+Nbz2mSd5Q=;
	b=XO7H8Mx8uoVxO0VaR101F2NFNcxIWjsPRuC0DA6CY6Otj/DGxJ1UDk3cV+cQLE4jHi
	B+X1PK1hSUUjm8aR0xkwfEKWIMsci3MTAjxvrAu/kiNwBIPhOlXQIcntEO/0Zd+XBXCW
	LinC0VsBqDtxB79Qvptpc8R+gotpRcDzGaiu8UFFjfjquFoxM7BDphTnrrf6AbYZonNx
	V7tdJBLijvzToWDceoPP9NrJaZ2gYLh7LC7FvCcU4A6PXiMYugjbU2cMbSbAGP+muZqB
	LdlizhuX185Ndfgq0wHWQWSdzbrT1vNYHZye7fhViAFPskqRfrwxVvkgrrJ5Enz3NHQ0
	oA1Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id;
	bh=jOLK6K7Doh0JVp0YLxt77KXMi77Ap4BkD+Nbz2mSd5Q=;
	b=Un9w9t2IAd3Um7iCSEQ0HGDlhbyRxJIFb0eSD/zfUkpDk+QO3DM7jcVRmlh0hiT0Sm
	xH9Cy30ptaBr4L7zkrEXw6e7vwQcNEiOcNd3H712Z95TQkyYH5xuUCoQAgUtzLohJAn2
	5LDZVTUDaXSdOA5t8jVd1bGapAKg++6KhDNOmPGQmhz9viIVLa7nITTVzvoTdH1ilt5K
	/l3Vj5GH3KJkBCwu07wzjfvr+F+aLVW94PCUZF5U7PoXt/9DHEbHq2k2luV0QZRB0yod
	6oWHjkEfWnzxajjVlPDJBMHRZq/VJZm6kF2HOppl6KXIWizTso29PTRVLg31krqaJyh+
	YClQ==
X-Gm-Message-State: AG10YOSzP0BB9h4AWTZgbcspkLUZ5vMB4dwYetTGC3LHPXFpv+5Viz2YZFfJTdDPKcuRKA==
X-Received: by 10.194.249.69 with SMTP id ys5mr28281587wjc.97.1453907068965;
	Wed, 27 Jan 2016 07:04:28 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194])
	by smtp.gmail.com with ESMTPSA id u4sm6660204wjz.4.2016.01.27.07.04.27
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Wed, 27 Jan 2016 07:04:28 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Wed, 27 Jan 2016 15:04:10 +0000
Message-Id: <1453907050-9396-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Stop using RtlStringCbPrintfA()
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

It appears that linking an NDIS driver with any ntstrsafe function (when
building with VS2012 and the 8.0 WDK at least) has the side effect of
requiring use of DbgPrint(). Whilst this may not sound like a problem, it
is. This is because the NDISTest 6.0 1c_KernelCalls test insists that any
use of DbgPrint is illegal and so it's impossible to logo an NDIS driver
using ntstrsafe functions.

This patch works around the issue by dynamically linking (at run-time) to
the ntdll _snprintf_s function as a replacement for calls to
RtlStringCbPrintfA(). This entails importing the dynamic linking code from
XENVIF since MmGetSystemRoutineAddress() doesn't seem to work for that
symbol.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xennet/adapter.c         |  40 ++++---
 src/xennet/link.c            | 250 +++++++++++++++++++++++++++++++++++++++++++
 src/xennet/link.h            |  42 ++++++++
 vs2012/xennet/xennet.vcxproj |   3 +-
 vs2013/xennet/xennet.vcxproj |   3 +-
 5 files changed, 323 insertions(+), 15 deletions(-)
 create mode 100644 src/xennet/link.c
 create mode 100644 src/xennet/link.h

diff --git a/src/xennet/adapter.c b/src/xennet/adapter.c
index dca9b7b..d85f4d1 100644
--- a/src/xennet/adapter.c
+++ b/src/xennet/adapter.c
@@ -32,7 +32,6 @@
 #define INITGUID 1
 
 #include <ndis.h>
-#include <ntstrsafe.h>
 #include <stdlib.h>
 #include <version.h>
 
@@ -46,6 +45,7 @@
 #include "util.h"
 #include "dbg_print.h"
 #include "assert.h"
+#include "link.h"
 
 #define MAXNAMELEN  128
 
@@ -1300,6 +1300,11 @@ __AdapterSetDistribution(
     )
 {
     ULONG               Index;
+    NTSTATUS            (*___snprintf_s)(char *,
+                                         size_t,
+                                         size_t,
+                                         const char *,
+                                         ...);
     CHAR                Distribution[MAXNAMELEN];
     CHAR                Vendor[MAXNAMELEN];
     const CHAR          *Product;
@@ -1307,15 +1312,21 @@ __AdapterSetDistribution(
 
     Trace("====>\n");
 
+    status = LinkGetRoutineAddress("ntdll.dll",
+                                   "_snprintf_s",
+                                   (PVOID *)&___snprintf_s);
+    if (!NT_SUCCESS(status))
+        goto fail1;
+
     Index = 0;
     while (Index <= MAXIMUM_INDEX) {
         PCHAR   Buffer;
 
-        status = RtlStringCbPrintfA(Distribution,
-                                    MAXNAMELEN,
-                                    "%u",
-                                    Index);
-        ASSERT(NT_SUCCESS(status));
+        (VOID) ___snprintf_s(Distribution,
+                             MAXNAMELEN,
+                             _TRUNCATE,
+                             "%u",
+                             Index);
 
         status = XENBUS_STORE(Read,
                               &Adapter->StoreInterface,
@@ -1327,7 +1338,7 @@ __AdapterSetDistribution(
             if (status == STATUS_OBJECT_NAME_NOT_FOUND)
                 goto update;
 
-            goto fail1;
+            goto fail2;
         }
 
         XENBUS_STORE(Free,
@@ -1338,14 +1349,14 @@ __AdapterSetDistribution(
     }
 
     status = STATUS_UNSUCCESSFUL;
-    goto fail2;
+    goto fail3;
 
 update:
-    status = RtlStringCbPrintfA(Vendor,
-                                MAXNAMELEN,
-                                "%s",
-                                VENDOR_NAME_STR);
-    ASSERT(NT_SUCCESS(status));
+    (VOID) ___snprintf_s(Vendor,
+                         MAXNAMELEN,
+                         _TRUNCATE,
+                         "%s",
+                         VENDOR_NAME_STR);
 
     for (Index  = 0; Vendor[Index] != '\0'; Index++)
         if (!isalnum((UCHAR)Vendor[Index]))
@@ -1378,6 +1389,9 @@ update:
     Trace("<====\n");
     return STATUS_SUCCESS;
 
+fail3:
+    Error("fail3\n");
+
 fail2:
     Error("fail2\n");
 
diff --git a/src/xennet/link.c b/src/xennet/link.c
new file mode 100644
index 0000000..e2a41bc
--- /dev/null
+++ b/src/xennet/link.c
@@ -0,0 +1,250 @@
+/* Copyright (c) Citrix Systems Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms,
+ * with or without modification, are permitted provided
+ * that the following conditions are met:
+ *
+ * *   Redistributions of source code must retain the above
+ *     copyright notice, this list of conditions and the
+ *     following disclaimer.
+ * *   Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the
+ *     following disclaimer in the documentation and/or other
+ *     materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <ntddk.h>
+#include <aux_klib.h>
+
+#include "link.h"
+#include "dbg_print.h"
+#include "assert.h"
+#include "util.h"
+
+#define LINK_TAG    'KNIL'
+
+static FORCEINLINE PVOID
+__LinkAllocate(
+    IN  ULONG   Length
+    )
+{
+    return __AllocatePoolWithTag(NonPagedPool, Length, LINK_TAG);
+}
+
+static FORCEINLINE VOID
+__LinkFree(
+    IN  PVOID   Buffer
+    )
+{
+    __FreePoolWithTag(Buffer, LINK_TAG);
+}
+
+static FORCEINLINE NTSTATUS
+__LinkGetImageBase(
+    IN  const CHAR              *ModuleName,
+    OUT PVOID                   *ImageBase
+    )
+{
+    ULONG                       BufferSize;
+    ULONG                       Count;
+    PAUX_MODULE_EXTENDED_INFO   QueryInfo;
+    ULONG                       Index;
+    NTSTATUS                    status;
+
+    Trace("====>\n");
+
+    status = AuxKlibInitialize();
+    if (!NT_SUCCESS(status))
+        goto fail1;
+
+    status = AuxKlibQueryModuleInformation(&BufferSize,
+                                           sizeof (AUX_MODULE_EXTENDED_INFO),
+                                           NULL);
+    if (!NT_SUCCESS(status))
+        goto fail2;
+
+    status = STATUS_UNSUCCESSFUL;
+    if (BufferSize == 0)
+        goto fail3;
+
+again:
+    Count = BufferSize / sizeof (AUX_MODULE_EXTENDED_INFO);
+    QueryInfo = __LinkAllocate(sizeof (AUX_MODULE_EXTENDED_INFO) * Count);
+
+    status = STATUS_NO_MEMORY;
+    if (QueryInfo == NULL)
+        goto fail4;
+
+    status = AuxKlibQueryModuleInformation(&BufferSize,
+                                           sizeof (AUX_MODULE_EXTENDED_INFO),
+                                           QueryInfo);
+    if (!NT_SUCCESS(status)) {
+        if (status != STATUS_BUFFER_TOO_SMALL)
+            goto fail5;
+
+        __LinkFree(QueryInfo);
+        goto again;
+    }
+
+    for (Index = 0; Index < Count; Index++) {
+        PCHAR   Name;
+
+        Name = strrchr((const CHAR *)QueryInfo[Index].FullPathName, '\\');
+        Name = (Name == NULL) ? (PCHAR)QueryInfo[Index].FullPathName : (Name + 1);
+
+        if (_stricmp(Name, ModuleName) == 0)
+            goto found;
+    }
+
+    status = STATUS_UNSUCCESSFUL;
+    goto fail6;
+
+found:
+    *ImageBase = QueryInfo[Index].BasicInfo.ImageBase;
+
+    __LinkFree(QueryInfo);
+
+    Trace("<====\n");
+
+    return STATUS_SUCCESS;
+
+fail6:
+    Error("fail6\n");
+
+fail5:
+    Error("fail5\n");
+
+    __LinkFree(QueryInfo);
+
+fail4:
+    Error("fail4\n");
+
+fail3:
+    Error("fail3\n");
+
+fail2:
+    Error("fail2\n");
+
+fail1:
+    Error("fail1 (%08x)\n", status);
+
+    return status;
+}
+
+NTSTATUS
+LinkGetRoutineAddress(
+    IN  const CHAR  *ModuleName,
+    IN  const CHAR  *FunctionName,
+    OUT PVOID       *Address
+    )
+{
+#define MK_PTR(_ImageBase, _Type, _RVA) \
+    (_Type)((ULONG_PTR)(_ImageBase) + (_RVA))
+
+    PVOID                       ImageBase;
+    PIMAGE_DOS_HEADER           DosHeader;
+    PIMAGE_NT_HEADERS           NtHeaders;
+    PIMAGE_OPTIONAL_HEADER      OptionalHeader;
+    PIMAGE_DATA_DIRECTORY       Entry;
+    PIMAGE_EXPORT_DIRECTORY     Exports;
+    PULONG                      AddressOfFunctions;
+    PULONG                      AddressOfNames;
+    PUSHORT                     AddressOfNameOrdinals;
+    ULONG                       Index;
+    USHORT                      Ordinal;
+    PVOID                       Function;
+    NTSTATUS                    status;
+
+    Trace("====>\n");
+
+    status = __LinkGetImageBase(ModuleName, &ImageBase);
+    if (!NT_SUCCESS(status))
+        goto fail1;
+
+    DosHeader = MK_PTR(ImageBase, PIMAGE_DOS_HEADER, 0);
+    ASSERT3U(DosHeader->e_magic, ==, IMAGE_DOS_SIGNATURE);
+
+    NtHeaders = MK_PTR(ImageBase, PIMAGE_NT_HEADERS, DosHeader->e_lfanew);
+    ASSERT3U(NtHeaders->Signature, ==, IMAGE_NT_SIGNATURE);
+
+    OptionalHeader = &NtHeaders->OptionalHeader;
+    ASSERT3U(OptionalHeader->Magic, ==, IMAGE_NT_OPTIONAL_HDR_MAGIC);
+
+    Entry = &OptionalHeader->DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT];
+
+    status = STATUS_UNSUCCESSFUL;
+    if (Entry->Size == 0)
+        goto fail2;
+
+    Exports = MK_PTR(ImageBase, PIMAGE_EXPORT_DIRECTORY,
+                     Entry->VirtualAddress);
+
+    status = STATUS_UNSUCCESSFUL;
+    if (Exports->NumberOfNames == 0)
+        goto fail3;
+
+    AddressOfFunctions = MK_PTR(ImageBase, PULONG,
+                                Exports->AddressOfFunctions);
+    AddressOfNames = MK_PTR(ImageBase, PULONG,
+                            Exports->AddressOfNames);
+    AddressOfNameOrdinals = MK_PTR(ImageBase, PUSHORT,
+                                   Exports->AddressOfNameOrdinals);
+
+    for (Index = 0; Index < Exports->NumberOfNames; Index++) {
+        PCHAR   Name = MK_PTR(ImageBase, PCHAR, AddressOfNames[Index]);
+
+        Ordinal = AddressOfNameOrdinals[Index];
+        Function = MK_PTR(ImageBase, PVOID, AddressOfFunctions[Ordinal]);
+
+        if (strcmp(Name, FunctionName) == 0)
+            goto found;
+    }
+
+    status = STATUS_UNSUCCESSFUL;
+    goto fail4;
+
+found:
+    *Address = Function;
+
+    Trace("%s:%s (%04X) @ %p\n",
+          ModuleName,
+          FunctionName,
+          Ordinal,
+          Function);
+
+    Trace("<====\n");
+
+    return STATUS_SUCCESS;
+
+fail4:
+    Error("fail4\n");
+
+fail3:
+    Error("fail3\n");
+
+fail2:
+    Error("fail2\n");
+
+fail1:
+    Error("fail1 (%08x)\n", status);
+
+    return status;
+
+#undef  MK_PTR
+}
diff --git a/src/xennet/link.h b/src/xennet/link.h
new file mode 100644
index 0000000..9e4b564
--- /dev/null
+++ b/src/xennet/link.h
@@ -0,0 +1,42 @@
+/* Copyright (c) Citrix Systems Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms,
+ * with or without modification, are permitted provided
+ * that the following conditions are met:
+ *
+ * *   Redistributions of source code must retain the above
+ *     copyright notice, this list of conditions and the
+ *     following disclaimer.
+ * *   Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the
+ *     following disclaimer in the documentation and/or other
+ *     materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _XENNET_LINK_H
+#define _XENNET_LINK_H
+
+extern NTSTATUS
+LinkGetRoutineAddress(
+    IN  const CHAR  *ModuleName,
+    IN  const CHAR  *FunctionName,
+    OUT PVOID       *Address
+     );
+
+#endif  // _XENVIF_LINK_H
diff --git a/vs2012/xennet/xennet.vcxproj b/vs2012/xennet/xennet.vcxproj
index 3ca7407..e80bcb1 100644
--- a/vs2012/xennet/xennet.vcxproj
+++ b/vs2012/xennet/xennet.vcxproj
@@ -40,7 +40,7 @@
 		</ClCompile>
 		<Link>
 			<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
-			<AdditionalDependencies>$(DDK_LIB_PATH)\ndis.lib;$(DDK_LIB_PATH)/libcntpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
+			<AdditionalDependencies>$(DDK_LIB_PATH)\ndis.lib;$(DDK_LIB_PATH)/libcntpr.lib;$(DDK_LIB_PATH)/aux_klib.lib;%(AdditionalDependencies)</AdditionalDependencies>
 			<EnableCOMDATFolding>false</EnableCOMDATFolding>
 		</Link>
 		<Inf>
@@ -75,6 +75,7 @@
 	<ItemGroup>
 		<ClCompile Include="../../src/xennet/adapter.c" />
 		<ClCompile Include="../../src/xennet/driver.c" />
+		<ClCompile Include="../../src/xennet/link.c" />
 		<ClCompile Include="../../src/xennet/miniport.c" />
 		<ClCompile Include="../../src/xennet/receiver.c" />
 		<ClCompile Include="../../src/xennet/transmitter.c" />
diff --git a/vs2013/xennet/xennet.vcxproj b/vs2013/xennet/xennet.vcxproj
index 0064a92..bcc6025 100644
--- a/vs2013/xennet/xennet.vcxproj
+++ b/vs2013/xennet/xennet.vcxproj
@@ -36,7 +36,7 @@
     </ClCompile>
     <Link>
       <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
-      <AdditionalDependencies>$(DDK_LIB_PATH)/libcntpr.lib;$(DDK_LIB_PATH)\ndis.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>$(DDK_LIB_PATH)\ndis.lib;$(DDK_LIB_PATH)/libcntpr.lib;$(DDK_LIB_PATH)/aux_klib.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <EnableCOMDATFolding>false</EnableCOMDATFolding>
     </Link>
     <Inf>
@@ -70,6 +70,7 @@
   <ItemGroup>
     <ClCompile Include="../../src/xennet/adapter.c" />
     <ClCompile Include="../../src/xennet/driver.c" />
+    <ClCompile Include="../../src/xennet/link.c" />
     <ClCompile Include="../../src/xennet/miniport.c" />
     <ClCompile Include="../../src/xennet/receiver.c" />
     <ClCompile Include="../../src/xennet/transmitter.c" />
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Wed Jan 27 16:48:46 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 27 Jan 2016 16:48:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aOTGu-0007X7-LF; Wed, 27 Jan 2016 16:48:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lars.kurth.xen@gmail.com>)
	id 1aOTGt-0007Wp-HK; Wed, 27 Jan 2016 16:48:43 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	0C/F5-12635-AE4F8A65; Wed, 27 Jan 2016 16:48:42 +0000
X-Env-Sender: lars.kurth.xen@gmail.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1453913321!18597984!1
X-Originating-IP: [74.125.82.46]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 49719 invoked from network); 27 Jan 2016 16:48:41 -0000
Received: from mail-wm0-f46.google.com (HELO mail-wm0-f46.google.com)
	(74.125.82.46)
	by server-4.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 27 Jan 2016 16:48:41 -0000
Received: by mail-wm0-f46.google.com with SMTP id n5so35709031wmn.0;
	Wed, 27 Jan 2016 08:48:41 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:content-type:content-transfer-encoding:subject:date:message-id
	:cc:to:mime-version;
	bh=ey9vlWWIwPaOlZj36Spl9r5ZptikZdir6XKmWKJA9Mc=;
	b=IMFqG43oTqUZp0+AeisMxqgB1FhD7zn47ADpddDYoQv1kIUJDIxiYDvnKtnGR1InCw
	VZ4p6ohVl/UPaFkX1YywDbVrI9Di+rv7KrLBrI3QH+RBFCX8dEOLnM40OBxSIG89zFp9
	UbqZv0BQ6ndz+m+usQc5vj7Sobp401zQiT4BJXMEqpynbenRR+8tUHNjAUXY/VwAGK4Q
	JIi+8EQAggZ8YDROVBnmjit0nrdu7UNOvTjW0r8/sA2MhTopCZ04mAW/mWwIknJuiU2N
	TvTQbfXeQvSgbLhL0GyAsNBf9fr5wgmZ7t7istVU2NkDGnSCvVNg4tYRVuZ7A6ZXg15s
	n49A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:content-type:content-transfer-encoding
	:subject:date:message-id:cc:to:mime-version;
	bh=ey9vlWWIwPaOlZj36Spl9r5ZptikZdir6XKmWKJA9Mc=;
	b=GdNPz6zu5Ee1MAQOU5kllLe9OsnqJwr/kbP4zzc+tdaPxgQnoNVmleQQ26l7xQWd9u
	OqzoqDIUOVqS5bqbX0QZQJ4M8IEbahBucCaiihS5vsaAXyReAR0s1xCwfgi0T4KU4QlT
	LlpPnW5zoa+Fm9AwUlF0RhqpANRKsh/Pfhs9EAYvvS7jwWZt5Dy9bxsTMgSQJllcwRbM
	Pikxi8i3A0E5BlG0AZKqqkFtknLXe/Ra6brrNORdpmMN1RjKa14jstaNQ4HLOkbTV501
	oOOhI7vqoFqUzqH0TCTATDCZtNW69CsVCmKpDxOPamCE4+wG2kgNTjKuX6YUFPjZM4HC
	BODw==
X-Gm-Message-State: AG10YOSki4a0iIrzW9HGx30iK7AGjj7CIq+FAnnpyIdP/kAscUJoOmbFPDxLCChlNPjaUw==
X-Received: by 10.194.52.72 with SMTP id r8mr29853878wjo.148.1453913321165;
	Wed, 27 Jan 2016 08:48:41 -0800 (PST)
Received: from [192.168.0.9] (5ec0a1a0.skybroadband.com. [94.192.161.160])
	by smtp.gmail.com with ESMTPSA id
	k130sm8505998wmg.6.2016.01.27.08.48.39
	(version=TLSv1/SSLv3 cipher=OTHER);
	Wed, 27 Jan 2016 08:48:39 -0800 (PST)
From: Lars Kurth <lars.kurth.xen@gmail.com>
Date: Wed, 27 Jan 2016 16:48:37 +0000
Message-Id: <C49F5723-E3BE-456D-87C8-A2F4CDE8D43C@gmail.com>
To: xen-devel <xen-devel@lists.xenproject.org>,
	mirageos-devel <mirageos-devel@lists.xenproject.org>,
	Win-pv-devel@lists.xenproject.org, embedded-pv-devel@lists.xenproject.org
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\))
X-Mailer: Apple Mail (2.2104)
Cc: xen-users@lists.xenproject.org
Subject: [win-pv-devel] Xen Project Infrastructure Maintenance: xenbits (Jan
	28), qemu-bitslave & mail & downloads.xenproject.org (Feb 1),
	lists & etherpad (Feb 4th)
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Hi everyone,

we are rebooting a number of Xen Project services in the next few days to upgrade operating systems. This means that a few services may be temporarily unavailable. The following websites are affected and will be done during the times below. If you notice any issues after the reboot, please reply to this mail or check on the #xeninfra IRC channel.

= Jan 28, 7am - 9am UTC : affecting xenbits =
Affected services: Xen Project source code repositories, automatically generated xenproject docs, list of security vulnerabilities
If you need to clone or commit to any affected repositories please do so before or after

= Feb 1, 7am - 9am UTC : affecting qemu-bitslave and xenproject.org mail aliases and downloads.xenproject.org =
Affected services: qemu-bitslave, mail server, DNS and downloads.xenproject.org
Note that mails to e-mails using foo-bar@xenproject.org may be delayed during the maintenance window. 

= Feb 4, 7am - 9am UTC : affecting xen project mailing lists & ether pad =
Affected services: all foo@lists.xenproject.org mailing lists and ether pads
Note that mails to all mailing lists will be delayed during the maintenance window

Best Regards
Lars
_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Wed Jan 27 16:48:46 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 27 Jan 2016 16:48:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aOTGu-0007X7-LF; Wed, 27 Jan 2016 16:48:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lars.kurth.xen@gmail.com>)
	id 1aOTGt-0007Wp-HK; Wed, 27 Jan 2016 16:48:43 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	0C/F5-12635-AE4F8A65; Wed, 27 Jan 2016 16:48:42 +0000
X-Env-Sender: lars.kurth.xen@gmail.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1453913321!18597984!1
X-Originating-IP: [74.125.82.46]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 49719 invoked from network); 27 Jan 2016 16:48:41 -0000
Received: from mail-wm0-f46.google.com (HELO mail-wm0-f46.google.com)
	(74.125.82.46)
	by server-4.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 27 Jan 2016 16:48:41 -0000
Received: by mail-wm0-f46.google.com with SMTP id n5so35709031wmn.0;
	Wed, 27 Jan 2016 08:48:41 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:content-type:content-transfer-encoding:subject:date:message-id
	:cc:to:mime-version;
	bh=ey9vlWWIwPaOlZj36Spl9r5ZptikZdir6XKmWKJA9Mc=;
	b=IMFqG43oTqUZp0+AeisMxqgB1FhD7zn47ADpddDYoQv1kIUJDIxiYDvnKtnGR1InCw
	VZ4p6ohVl/UPaFkX1YywDbVrI9Di+rv7KrLBrI3QH+RBFCX8dEOLnM40OBxSIG89zFp9
	UbqZv0BQ6ndz+m+usQc5vj7Sobp401zQiT4BJXMEqpynbenRR+8tUHNjAUXY/VwAGK4Q
	JIi+8EQAggZ8YDROVBnmjit0nrdu7UNOvTjW0r8/sA2MhTopCZ04mAW/mWwIknJuiU2N
	TvTQbfXeQvSgbLhL0GyAsNBf9fr5wgmZ7t7istVU2NkDGnSCvVNg4tYRVuZ7A6ZXg15s
	n49A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:content-type:content-transfer-encoding
	:subject:date:message-id:cc:to:mime-version;
	bh=ey9vlWWIwPaOlZj36Spl9r5ZptikZdir6XKmWKJA9Mc=;
	b=GdNPz6zu5Ee1MAQOU5kllLe9OsnqJwr/kbP4zzc+tdaPxgQnoNVmleQQ26l7xQWd9u
	OqzoqDIUOVqS5bqbX0QZQJ4M8IEbahBucCaiihS5vsaAXyReAR0s1xCwfgi0T4KU4QlT
	LlpPnW5zoa+Fm9AwUlF0RhqpANRKsh/Pfhs9EAYvvS7jwWZt5Dy9bxsTMgSQJllcwRbM
	Pikxi8i3A0E5BlG0AZKqqkFtknLXe/Ra6brrNORdpmMN1RjKa14jstaNQ4HLOkbTV501
	oOOhI7vqoFqUzqH0TCTATDCZtNW69CsVCmKpDxOPamCE4+wG2kgNTjKuX6YUFPjZM4HC
	BODw==
X-Gm-Message-State: AG10YOSki4a0iIrzW9HGx30iK7AGjj7CIq+FAnnpyIdP/kAscUJoOmbFPDxLCChlNPjaUw==
X-Received: by 10.194.52.72 with SMTP id r8mr29853878wjo.148.1453913321165;
	Wed, 27 Jan 2016 08:48:41 -0800 (PST)
Received: from [192.168.0.9] (5ec0a1a0.skybroadband.com. [94.192.161.160])
	by smtp.gmail.com with ESMTPSA id
	k130sm8505998wmg.6.2016.01.27.08.48.39
	(version=TLSv1/SSLv3 cipher=OTHER);
	Wed, 27 Jan 2016 08:48:39 -0800 (PST)
From: Lars Kurth <lars.kurth.xen@gmail.com>
Date: Wed, 27 Jan 2016 16:48:37 +0000
Message-Id: <C49F5723-E3BE-456D-87C8-A2F4CDE8D43C@gmail.com>
To: xen-devel <xen-devel@lists.xenproject.org>,
	mirageos-devel <mirageos-devel@lists.xenproject.org>,
	Win-pv-devel@lists.xenproject.org, embedded-pv-devel@lists.xenproject.org
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\))
X-Mailer: Apple Mail (2.2104)
Cc: xen-users@lists.xenproject.org
Subject: [win-pv-devel] Xen Project Infrastructure Maintenance: xenbits (Jan
	28), qemu-bitslave & mail & downloads.xenproject.org (Feb 1),
	lists & etherpad (Feb 4th)
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Hi everyone,

we are rebooting a number of Xen Project services in the next few days to upgrade operating systems. This means that a few services may be temporarily unavailable. The following websites are affected and will be done during the times below. If you notice any issues after the reboot, please reply to this mail or check on the #xeninfra IRC channel.

= Jan 28, 7am - 9am UTC : affecting xenbits =
Affected services: Xen Project source code repositories, automatically generated xenproject docs, list of security vulnerabilities
If you need to clone or commit to any affected repositories please do so before or after

= Feb 1, 7am - 9am UTC : affecting qemu-bitslave and xenproject.org mail aliases and downloads.xenproject.org =
Affected services: qemu-bitslave, mail server, DNS and downloads.xenproject.org
Note that mails to e-mails using foo-bar@xenproject.org may be delayed during the maintenance window. 

= Feb 4, 7am - 9am UTC : affecting xen project mailing lists & ether pad =
Affected services: all foo@lists.xenproject.org mailing lists and ether pads
Note that mails to all mailing lists will be delayed during the maintenance window

Best Regards
Lars
_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Wed Jan 27 18:37:54 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 27 Jan 2016 18:37:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aOUyX-0000yv-L9; Wed, 27 Jan 2016 18:37:53 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad@char.us.oracle.com>) id 1aOUyW-0000yF-5i
	for win-pv-devel@lists.xenproject.org; Wed, 27 Jan 2016 18:37:52 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	EF/96-23366-F7E09A65; Wed, 27 Jan 2016 18:37:51 +0000
X-Env-Sender: konrad@char.us.oracle.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1453919869!10990870!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAyODgzMzk=\n
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 532 invoked from network); 27 Jan 2016 18:37:50 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-11.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384
	encrypted SMTP; 27 Jan 2016 18:37:50 -0000
Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234])
	by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with
	ESMTP id u0RIbfRe029827
	(version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 27 Jan 2016 18:37:41 GMT
Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72])
	by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u0RIbe8f027339
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL);
	Wed, 27 Jan 2016 18:37:40 GMT
Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12])
	by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u0RIbd8V026847;
	Wed, 27 Jan 2016 18:37:39 GMT
Received: from char.us.oracle.com (/10.137.176.158)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 27 Jan 2016 10:37:39 -0800
Received: by char.us.oracle.com (Postfix, from userid 1000)
	id 4C0246A3C6B; Wed, 27 Jan 2016 13:37:38 -0500 (EST)
Date: Wed, 27 Jan 2016 13:37:38 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Fabio Fantoni <fabio.fantoni@m2r.biz>
Message-ID: <20160127183738.GD3134@char.us.oracle.com>
References: <56A7A362.30309@m2r.biz>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <56A7A362.30309@m2r.biz>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Source-IP: aserv0022.oracle.com [141.146.126.234]
Cc: spice-devel@lists.freedesktop.org, win-pv-devel@lists.xenproject.org,
	xen-devel@lists.xensource.com, Paul Durrant <paul.durrant@citrix.com>
Subject: Re: [win-pv-devel] [Xen-devel] Developers for virgl 3d windows
	guest support
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

On Tue, Jan 26, 2016 at 05:48:34PM +0100, Fabio Fantoni wrote:
> I take a fast look to virgl 3d project even if I not tested it for now. It
> seems interesting for adding 2d and 3d hw acceleration support to virtual
> machines with a large hw (gpu) choice.
> I take a look also to intel gvt-g but it has a very limited cpu support
> choice.
> I saw that windows guest support with direct3d drivers in virgl is planned
> but I nothing was done for now.
> I'm approaching a new project (based on xen) and I'm in planning phase now.
> My goal would be to have virgl 3d windows guest support (drivers with opengl
> and direct3d) and support of remote rendering with spice (we are already
> using with qxl for now)

Did you look at the VirtIO drivers and their roadmap?


> Are there any developers expert about these things that can advice me if
> developing windows drivers (WDDM kernel driver + GL and D3D userspace
> pieces) and any other needed pieces of code in virglrender, mesa, and /or
> qemu is a good choice?

I have no clue about Windows. But when I started working on Linux it took
me good three months to get comfortable. I would presume the same thing
is for Windows. Albeit you would need also to have understanding of
OpenGL.

> If yes, what we would like to know is approx time/effort to have the above
> support upstream. Approximately how many persons and how many time would
> require to complete the tasks? (my project is going to be financed so we
> eventually have resource to schedule working time in the community)

Um, .. Are you saying you need the person/month values so that you can
get the money? Or that you have the money and just need to figure out
if it can be done with the amount you have?

> 
> Thanks for any reply and sorry for my bad english.
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Wed Jan 27 18:37:54 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 27 Jan 2016 18:37:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aOUyX-0000yv-L9; Wed, 27 Jan 2016 18:37:53 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad@char.us.oracle.com>) id 1aOUyW-0000yF-5i
	for win-pv-devel@lists.xenproject.org; Wed, 27 Jan 2016 18:37:52 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	EF/96-23366-F7E09A65; Wed, 27 Jan 2016 18:37:51 +0000
X-Env-Sender: konrad@char.us.oracle.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1453919869!10990870!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAyODgzMzk=\n
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 532 invoked from network); 27 Jan 2016 18:37:50 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-11.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384
	encrypted SMTP; 27 Jan 2016 18:37:50 -0000
Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234])
	by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with
	ESMTP id u0RIbfRe029827
	(version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 27 Jan 2016 18:37:41 GMT
Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72])
	by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u0RIbe8f027339
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL);
	Wed, 27 Jan 2016 18:37:40 GMT
Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12])
	by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u0RIbd8V026847;
	Wed, 27 Jan 2016 18:37:39 GMT
Received: from char.us.oracle.com (/10.137.176.158)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 27 Jan 2016 10:37:39 -0800
Received: by char.us.oracle.com (Postfix, from userid 1000)
	id 4C0246A3C6B; Wed, 27 Jan 2016 13:37:38 -0500 (EST)
Date: Wed, 27 Jan 2016 13:37:38 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Fabio Fantoni <fabio.fantoni@m2r.biz>
Message-ID: <20160127183738.GD3134@char.us.oracle.com>
References: <56A7A362.30309@m2r.biz>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <56A7A362.30309@m2r.biz>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Source-IP: aserv0022.oracle.com [141.146.126.234]
Cc: spice-devel@lists.freedesktop.org, win-pv-devel@lists.xenproject.org,
	xen-devel@lists.xensource.com, Paul Durrant <paul.durrant@citrix.com>
Subject: Re: [win-pv-devel] [Xen-devel] Developers for virgl 3d windows
	guest support
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

On Tue, Jan 26, 2016 at 05:48:34PM +0100, Fabio Fantoni wrote:
> I take a fast look to virgl 3d project even if I not tested it for now. It
> seems interesting for adding 2d and 3d hw acceleration support to virtual
> machines with a large hw (gpu) choice.
> I take a look also to intel gvt-g but it has a very limited cpu support
> choice.
> I saw that windows guest support with direct3d drivers in virgl is planned
> but I nothing was done for now.
> I'm approaching a new project (based on xen) and I'm in planning phase now.
> My goal would be to have virgl 3d windows guest support (drivers with opengl
> and direct3d) and support of remote rendering with spice (we are already
> using with qxl for now)

Did you look at the VirtIO drivers and their roadmap?


> Are there any developers expert about these things that can advice me if
> developing windows drivers (WDDM kernel driver + GL and D3D userspace
> pieces) and any other needed pieces of code in virglrender, mesa, and /or
> qemu is a good choice?

I have no clue about Windows. But when I started working on Linux it took
me good three months to get comfortable. I would presume the same thing
is for Windows. Albeit you would need also to have understanding of
OpenGL.

> If yes, what we would like to know is approx time/effort to have the above
> support upstream. Approximately how many persons and how many time would
> require to complete the tasks? (my project is going to be financed so we
> eventually have resource to schedule working time in the community)

Um, .. Are you saying you need the person/month values so that you can
get the money? Or that you have the money and just need to figure out
if it can be done with the amount you have?

> 
> Thanks for any reply and sorry for my bad english.
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Thu Jan 28 09:48:29 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 28 Jan 2016 09:48:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aOjBj-00005k-SX; Thu, 28 Jan 2016 09:48:27 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lars.kurth.xen@gmail.com>)
	id 1aOjBi-00005R-UW; Thu, 28 Jan 2016 09:48:27 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	6C/65-08977-9E3E9A65; Thu, 28 Jan 2016 09:48:25 +0000
X-Env-Sender: lars.kurth.xen@gmail.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1453974504!12585941!1
X-Originating-IP: [74.125.82.44]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 59929 invoked from network); 28 Jan 2016 09:48:25 -0000
Received: from mail-wm0-f44.google.com (HELO mail-wm0-f44.google.com)
	(74.125.82.44)
	by server-8.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 28 Jan 2016 09:48:25 -0000
Received: by mail-wm0-f44.google.com with SMTP id r129so16414322wmr.0;
	Thu, 28 Jan 2016 01:48:24 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=content-type:mime-version:subject:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to;
	bh=Guca8PqER+GEAeTEm183RwQq/3DbexI0OXcDfmPPeGc=;
	b=ggoUifNHjEsQ9GqYGjDa4gsPChKQKOnNqarcIOSpoYtvryGeHU+T40eFXJBMTvPeCp
	g9XXYUq1LWqtS0fkR8IbilPiNAydVoNsHoBfXMZWT1KN67RFgfONI5JxdZa71uei2x5S
	YFNe3VGIC2106arJOSnLaLCdPQJk/kuHbufPpE/LMMWHaK5i50k4Ifm99+uDddT21NjF
	QGarsNFoJuBHZtoD0+xU6mOPYRjyFnUZt/4KuA7fPSLIGXMj3GaaKDqHOp5LoXiQ5NGt
	LEIMvyc06etKqqw/cpnfPVqF1Ox8K1/EEBuBglg1mkP/JEXxZ9b0OiCA4rJJRtkImYSV
	G3BA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:content-type:mime-version:subject:from
	:in-reply-to:date:cc:content-transfer-encoding:message-id:references
	:to; bh=Guca8PqER+GEAeTEm183RwQq/3DbexI0OXcDfmPPeGc=;
	b=GaPJ/Br2ZtykU5syRuttK7YC60BxJ4Zzz7+GCTQAtbbK0WuxY/G4mkI5nwc68uDmlD
	S0gZAZp8RwGdpEMjhCC2ccr3JW4+TvyTdTJVw1BBLGWsfY7krPL6AcNHjj4BMY5RDDFR
	CUaDDMdlABe69qzOCzaAu3XIo08cEPdWg2t5NjsTQz/eRgvE2xqhv/AYofnt3s64z8MI
	Ii3VvzRMeag/gQn0bgtzsL2tZcnRvT3lkNfy1uhguXirU7rocpQ5xosZCklDVk+8wqMT
	yEcPYsJ3aEkwM3Y5fL1Vvt74qtfTzYE1rFOgAVbHCZMxSpBbp5Z0IdA9Yi1eg2euuXNb
	f/Yw==
X-Gm-Message-State: AG10YORH/u02Vi3eBQxXp0C2NP+0dJaKIXJY58XlcStE6zcNF9L+jQbIlMrC4egGfdUNyA==
X-Received: by 10.194.192.170 with SMTP id hh10mr2268873wjc.69.1453974503781; 
	Thu, 28 Jan 2016 01:48:23 -0800 (PST)
Received: from [192.168.0.12] (5ec0a1a0.skybroadband.com. [94.192.161.160])
	by smtp.gmail.com with ESMTPSA id
	l194sm2016555wmb.14.2016.01.28.01.48.22
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 28 Jan 2016 01:48:23 -0800 (PST)
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\))
From: Lars Kurth <lars.kurth.xen@gmail.com>
In-Reply-To: <C49F5723-E3BE-456D-87C8-A2F4CDE8D43C@gmail.com>
Date: Thu, 28 Jan 2016 09:48:21 +0000
Message-Id: <F298D48D-5BEE-4535-83F2-D2F59AB7178A@gmail.com>
References: <C49F5723-E3BE-456D-87C8-A2F4CDE8D43C@gmail.com>
To: xen-devel <xen-devel@lists.xenproject.org>,
	mirageos-devel <mirageos-devel@lists.xenproject.org>,
	Win-pv-devel@lists.xenproject.org, embedded-pv-devel@lists.xenproject.org
X-Mailer: Apple Mail (2.2104)
Cc: xen-users@lists.xenproject.org
Subject: Re: [win-pv-devel] Xen Project Infrastructure Maintenance: xenbits
	(Jan 28), qemu-bitslave & mail & downloads.xenproject.org (Feb 1),
	lists & etherpad (Feb 4th)
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Hi everyone,

due to a problem during an upgrade from Debian Wheezy to Debian Jessie, xenbits will be unavailable for an unknown period. The server is not responding and we have to wait for the support of the service provider to rectify the issue.

I will let you know, once the issue is resolved.

Regards
Lars

> On 27 Jan 2016, at 16:48, Lars Kurth <lars.kurth.xen@gmail.com> wrote:

> = Jan 28, 7am - 9am UTC : affecting xenbits =
> Affected services: Xen Project source code repositories, automatically generated xenproject docs, list of security vulnerabilities
> If you need to clone or commit to any affected repositories please do so before or after


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Thu Jan 28 09:48:29 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 28 Jan 2016 09:48:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aOjBj-00005k-SX; Thu, 28 Jan 2016 09:48:27 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lars.kurth.xen@gmail.com>)
	id 1aOjBi-00005R-UW; Thu, 28 Jan 2016 09:48:27 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	6C/65-08977-9E3E9A65; Thu, 28 Jan 2016 09:48:25 +0000
X-Env-Sender: lars.kurth.xen@gmail.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1453974504!12585941!1
X-Originating-IP: [74.125.82.44]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 59929 invoked from network); 28 Jan 2016 09:48:25 -0000
Received: from mail-wm0-f44.google.com (HELO mail-wm0-f44.google.com)
	(74.125.82.44)
	by server-8.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 28 Jan 2016 09:48:25 -0000
Received: by mail-wm0-f44.google.com with SMTP id r129so16414322wmr.0;
	Thu, 28 Jan 2016 01:48:24 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=content-type:mime-version:subject:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to;
	bh=Guca8PqER+GEAeTEm183RwQq/3DbexI0OXcDfmPPeGc=;
	b=ggoUifNHjEsQ9GqYGjDa4gsPChKQKOnNqarcIOSpoYtvryGeHU+T40eFXJBMTvPeCp
	g9XXYUq1LWqtS0fkR8IbilPiNAydVoNsHoBfXMZWT1KN67RFgfONI5JxdZa71uei2x5S
	YFNe3VGIC2106arJOSnLaLCdPQJk/kuHbufPpE/LMMWHaK5i50k4Ifm99+uDddT21NjF
	QGarsNFoJuBHZtoD0+xU6mOPYRjyFnUZt/4KuA7fPSLIGXMj3GaaKDqHOp5LoXiQ5NGt
	LEIMvyc06etKqqw/cpnfPVqF1Ox8K1/EEBuBglg1mkP/JEXxZ9b0OiCA4rJJRtkImYSV
	G3BA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:content-type:mime-version:subject:from
	:in-reply-to:date:cc:content-transfer-encoding:message-id:references
	:to; bh=Guca8PqER+GEAeTEm183RwQq/3DbexI0OXcDfmPPeGc=;
	b=GaPJ/Br2ZtykU5syRuttK7YC60BxJ4Zzz7+GCTQAtbbK0WuxY/G4mkI5nwc68uDmlD
	S0gZAZp8RwGdpEMjhCC2ccr3JW4+TvyTdTJVw1BBLGWsfY7krPL6AcNHjj4BMY5RDDFR
	CUaDDMdlABe69qzOCzaAu3XIo08cEPdWg2t5NjsTQz/eRgvE2xqhv/AYofnt3s64z8MI
	Ii3VvzRMeag/gQn0bgtzsL2tZcnRvT3lkNfy1uhguXirU7rocpQ5xosZCklDVk+8wqMT
	yEcPYsJ3aEkwM3Y5fL1Vvt74qtfTzYE1rFOgAVbHCZMxSpBbp5Z0IdA9Yi1eg2euuXNb
	f/Yw==
X-Gm-Message-State: AG10YORH/u02Vi3eBQxXp0C2NP+0dJaKIXJY58XlcStE6zcNF9L+jQbIlMrC4egGfdUNyA==
X-Received: by 10.194.192.170 with SMTP id hh10mr2268873wjc.69.1453974503781; 
	Thu, 28 Jan 2016 01:48:23 -0800 (PST)
Received: from [192.168.0.12] (5ec0a1a0.skybroadband.com. [94.192.161.160])
	by smtp.gmail.com with ESMTPSA id
	l194sm2016555wmb.14.2016.01.28.01.48.22
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 28 Jan 2016 01:48:23 -0800 (PST)
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\))
From: Lars Kurth <lars.kurth.xen@gmail.com>
In-Reply-To: <C49F5723-E3BE-456D-87C8-A2F4CDE8D43C@gmail.com>
Date: Thu, 28 Jan 2016 09:48:21 +0000
Message-Id: <F298D48D-5BEE-4535-83F2-D2F59AB7178A@gmail.com>
References: <C49F5723-E3BE-456D-87C8-A2F4CDE8D43C@gmail.com>
To: xen-devel <xen-devel@lists.xenproject.org>,
	mirageos-devel <mirageos-devel@lists.xenproject.org>,
	Win-pv-devel@lists.xenproject.org, embedded-pv-devel@lists.xenproject.org
X-Mailer: Apple Mail (2.2104)
Cc: xen-users@lists.xenproject.org
Subject: Re: [win-pv-devel] Xen Project Infrastructure Maintenance: xenbits
	(Jan 28), qemu-bitslave & mail & downloads.xenproject.org (Feb 1),
	lists & etherpad (Feb 4th)
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Hi everyone,

due to a problem during an upgrade from Debian Wheezy to Debian Jessie, xenbits will be unavailable for an unknown period. The server is not responding and we have to wait for the support of the service provider to rectify the issue.

I will let you know, once the issue is resolved.

Regards
Lars

> On 27 Jan 2016, at 16:48, Lars Kurth <lars.kurth.xen@gmail.com> wrote:

> = Jan 28, 7am - 9am UTC : affecting xenbits =
> Affected services: Xen Project source code repositories, automatically generated xenproject docs, list of security vulnerabilities
> If you need to clone or commit to any affected repositories please do so before or after


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Thu Jan 28 10:01:01 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 28 Jan 2016 10:01:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aOjNs-0000u1-FT; Thu, 28 Jan 2016 10:01:00 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aOjNr-0000tw-7t
	for win-pv-devel@lists.xenproject.org; Thu, 28 Jan 2016 10:00:59 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	3F/95-07451-AD6E9A65; Thu, 28 Jan 2016 10:00:58 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1453975256!18710521!1
X-Originating-IP: [209.85.160.172]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 42065 invoked from network); 28 Jan 2016 10:00:57 -0000
Received: from mail-yk0-f172.google.com (HELO mail-yk0-f172.google.com)
	(209.85.160.172)
	by server-10.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 28 Jan 2016 10:00:57 -0000
Received: by mail-yk0-f172.google.com with SMTP id v14so24518554ykd.3
	for <win-pv-devel@lists.xenproject.org>;
	Thu, 28 Jan 2016 02:00:57 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=p4CMdV74zse9stQBQP/FFRYYd6rRDB9/vfRnspRH1qw=;
	b=Op5keXYfwBLEL8Ce5cUKlzdaENkhmB8xjBwoBWVondMm8wWozCMO6JYOviPjstMU2A
	RsSsNf0SpEbYrndAXMVeEu7BLFc6GbbCJlUlRPFFHDsIA/d3DiorllSt8t3OEDZ4O7po
	q2/MtI9E8APn/wkIXjIqiWuKG0q/JbLA3mt1j5UO7Io6wUBFElDWRMXWoeJNr5NCfkat
	iy5Ehr8BtjGPV2zw1SpWQv2ReAuG+/M/EqqcZIIbTFOFJyWooSmOQ8MdI/90vPHHD28c
	FJqAjRhSufdVwAp2zM1y4VPVjaKNh+QFW/Rf6DsGeoyxGxy5iOhY4xthvp2CrAWVXWnG
	Nh8g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id;
	bh=p4CMdV74zse9stQBQP/FFRYYd6rRDB9/vfRnspRH1qw=;
	b=bDBKwvHHjtXGBq1A9u6fywbgoaX6xIDlbRh9G6znn+sahkdg8AEkV58St7eqZ9aMG1
	avWvOpRg6pG1SenKwItuhKRgEEPVO9Sbh/ULYL9W+fo3UE2SSRlLQU+wYLlA1oXkQQGx
	dkYT6PSABxOswp8qwEE6ajJS3C2lEY9J55MH0defSzxyCrwv4jLBBv/QIwNDNsiAHJ2B
	nchjTJLeLe5LiyV99dzo7/haAyh3I6+KsdXWnb1nlwaay8mc4bF/rFfCGwFRXtDMHq7u
	5+C+XOYQpR14D1tqyF/OhmNUgEC5bbQqEDjNM735CpXploPpOHH72/vD5j205Cmx2YNl
	QDHQ==
X-Gm-Message-State: AG10YOQNvxO913IWsDti8IX9Zssyp4pQ7ChXBregNqEKEoRxFzTKq71VGfKrLbqXiaRZ3A==
X-Received: by 10.129.111.11 with SMTP id k11mr954705ywc.312.1453975256572;
	Thu, 28 Jan 2016 02:00:56 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	u190sm7982585ywd.17.2016.01.28.02.00.55
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Thu, 28 Jan 2016 02:00:56 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Thu, 28 Jan 2016 10:00:42 +0000
Message-Id: <1453975242-13492-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Stash a pointer to _snprintf_s in the
	ADAPTER structure
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

It is problematic if we don't, as on resume from suspend we need to
re-acquire the function pointer and this seems to lead to a BSOD, despite
there being no documentation to suggest that use of the aux_klib functions
at DISPATCH_LEVEL is disallowed.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xennet/adapter.c | 61 +++++++++++++++++++++++++++-------------------------
 1 file changed, 32 insertions(+), 29 deletions(-)

diff --git a/src/xennet/adapter.c b/src/xennet/adapter.c
index d85f4d1..dc69a7f 100644
--- a/src/xennet/adapter.c
+++ b/src/xennet/adapter.c
@@ -81,6 +81,12 @@ struct _XENNET_ADAPTER {
     PXENNET_RECEIVER            Receiver;
     PXENNET_TRANSMITTER         Transmitter;
     BOOLEAN                     Enabled;
+
+    NTSTATUS                    (*_snprintf_s)(char *,
+                                               size_t,
+                                               size_t,
+                                               const char *,
+                                               ...);
 };
 
 static LONG AdapterCount;
@@ -1300,11 +1306,6 @@ __AdapterSetDistribution(
     )
 {
     ULONG               Index;
-    NTSTATUS            (*___snprintf_s)(char *,
-                                         size_t,
-                                         size_t,
-                                         const char *,
-                                         ...);
     CHAR                Distribution[MAXNAMELEN];
     CHAR                Vendor[MAXNAMELEN];
     const CHAR          *Product;
@@ -1312,21 +1313,15 @@ __AdapterSetDistribution(
 
     Trace("====>\n");
 
-    status = LinkGetRoutineAddress("ntdll.dll",
-                                   "_snprintf_s",
-                                   (PVOID *)&___snprintf_s);
-    if (!NT_SUCCESS(status))
-        goto fail1;
-
     Index = 0;
     while (Index <= MAXIMUM_INDEX) {
         PCHAR   Buffer;
 
-        (VOID) ___snprintf_s(Distribution,
-                             MAXNAMELEN,
-                             _TRUNCATE,
-                             "%u",
-                             Index);
+        (VOID) Adapter->_snprintf_s(Distribution,
+                                    MAXNAMELEN,
+                                    _TRUNCATE,
+                                    "%u",
+                                    Index);
 
         status = XENBUS_STORE(Read,
                               &Adapter->StoreInterface,
@@ -1338,7 +1333,7 @@ __AdapterSetDistribution(
             if (status == STATUS_OBJECT_NAME_NOT_FOUND)
                 goto update;
 
-            goto fail2;
+            goto fail1;
         }
 
         XENBUS_STORE(Free,
@@ -1349,14 +1344,14 @@ __AdapterSetDistribution(
     }
 
     status = STATUS_UNSUCCESSFUL;
-    goto fail3;
+    goto fail2;
 
 update:
-    (VOID) ___snprintf_s(Vendor,
-                         MAXNAMELEN,
-                         _TRUNCATE,
-                         "%s",
-                         VENDOR_NAME_STR);
+    (VOID) Adapter->_snprintf_s(Vendor,
+                                MAXNAMELEN,
+                                _TRUNCATE,
+                                "%s",
+                                VENDOR_NAME_STR);
 
     for (Index  = 0; Vendor[Index] != '\0'; Index++)
         if (!isalnum((UCHAR)Vendor[Index]))
@@ -1389,9 +1384,6 @@ update:
     Trace("<====\n");
     return STATUS_SUCCESS;
 
-fail3:
-    Error("fail3\n");
-
 fail2:
     Error("fail2\n");
 
@@ -1498,16 +1490,22 @@ AdapterEnable(
     if (!NT_SUCCESS(status))
         goto fail2;
 
-    status = AdapterSetDistribution(Adapter);
+    status = LinkGetRoutineAddress("ntdll.dll",
+                                   "_snprintf_s",
+                                   (PVOID *)&Adapter->_snprintf_s);
     if (!NT_SUCCESS(status))
         goto fail3;
 
+    status = AdapterSetDistribution(Adapter);
+    if (!NT_SUCCESS(status))
+        goto fail4;
+
     status = XENVIF_VIF(Enable,
                         &Adapter->VifInterface,
                         AdapterVifCallback,
                         Adapter);
     if (!NT_SUCCESS(status))
-        goto fail4;
+        goto fail5;
 
     AdapterMediaStateChange(Adapter);
 
@@ -1515,9 +1513,12 @@ AdapterEnable(
 
     return NDIS_STATUS_SUCCESS;
 
-fail4:
+fail5:
     AdapterClearDistribution(Adapter);
 
+fail4:
+    Adapter->_snprintf_s = NULL;
+
 fail3:
     XENBUS_SUSPEND(Release, &Adapter->SuspendInterface);
 
@@ -1543,6 +1544,8 @@ AdapterDisable(
 
     AdapterClearDistribution(Adapter);
 
+    Adapter->_snprintf_s = NULL;
+
     XENBUS_SUSPEND(Release, &Adapter->SuspendInterface);
     XENBUS_STORE(Release, &Adapter->StoreInterface);
 }
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Thu Jan 28 10:01:01 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 28 Jan 2016 10:01:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aOjNs-0000u1-FT; Thu, 28 Jan 2016 10:01:00 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aOjNr-0000tw-7t
	for win-pv-devel@lists.xenproject.org; Thu, 28 Jan 2016 10:00:59 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	3F/95-07451-AD6E9A65; Thu, 28 Jan 2016 10:00:58 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1453975256!18710521!1
X-Originating-IP: [209.85.160.172]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 42065 invoked from network); 28 Jan 2016 10:00:57 -0000
Received: from mail-yk0-f172.google.com (HELO mail-yk0-f172.google.com)
	(209.85.160.172)
	by server-10.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 28 Jan 2016 10:00:57 -0000
Received: by mail-yk0-f172.google.com with SMTP id v14so24518554ykd.3
	for <win-pv-devel@lists.xenproject.org>;
	Thu, 28 Jan 2016 02:00:57 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=p4CMdV74zse9stQBQP/FFRYYd6rRDB9/vfRnspRH1qw=;
	b=Op5keXYfwBLEL8Ce5cUKlzdaENkhmB8xjBwoBWVondMm8wWozCMO6JYOviPjstMU2A
	RsSsNf0SpEbYrndAXMVeEu7BLFc6GbbCJlUlRPFFHDsIA/d3DiorllSt8t3OEDZ4O7po
	q2/MtI9E8APn/wkIXjIqiWuKG0q/JbLA3mt1j5UO7Io6wUBFElDWRMXWoeJNr5NCfkat
	iy5Ehr8BtjGPV2zw1SpWQv2ReAuG+/M/EqqcZIIbTFOFJyWooSmOQ8MdI/90vPHHD28c
	FJqAjRhSufdVwAp2zM1y4VPVjaKNh+QFW/Rf6DsGeoyxGxy5iOhY4xthvp2CrAWVXWnG
	Nh8g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id;
	bh=p4CMdV74zse9stQBQP/FFRYYd6rRDB9/vfRnspRH1qw=;
	b=bDBKwvHHjtXGBq1A9u6fywbgoaX6xIDlbRh9G6znn+sahkdg8AEkV58St7eqZ9aMG1
	avWvOpRg6pG1SenKwItuhKRgEEPVO9Sbh/ULYL9W+fo3UE2SSRlLQU+wYLlA1oXkQQGx
	dkYT6PSABxOswp8qwEE6ajJS3C2lEY9J55MH0defSzxyCrwv4jLBBv/QIwNDNsiAHJ2B
	nchjTJLeLe5LiyV99dzo7/haAyh3I6+KsdXWnb1nlwaay8mc4bF/rFfCGwFRXtDMHq7u
	5+C+XOYQpR14D1tqyF/OhmNUgEC5bbQqEDjNM735CpXploPpOHH72/vD5j205Cmx2YNl
	QDHQ==
X-Gm-Message-State: AG10YOQNvxO913IWsDti8IX9Zssyp4pQ7ChXBregNqEKEoRxFzTKq71VGfKrLbqXiaRZ3A==
X-Received: by 10.129.111.11 with SMTP id k11mr954705ywc.312.1453975256572;
	Thu, 28 Jan 2016 02:00:56 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	u190sm7982585ywd.17.2016.01.28.02.00.55
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Thu, 28 Jan 2016 02:00:56 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Thu, 28 Jan 2016 10:00:42 +0000
Message-Id: <1453975242-13492-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Stash a pointer to _snprintf_s in the
	ADAPTER structure
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

It is problematic if we don't, as on resume from suspend we need to
re-acquire the function pointer and this seems to lead to a BSOD, despite
there being no documentation to suggest that use of the aux_klib functions
at DISPATCH_LEVEL is disallowed.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xennet/adapter.c | 61 +++++++++++++++++++++++++++-------------------------
 1 file changed, 32 insertions(+), 29 deletions(-)

diff --git a/src/xennet/adapter.c b/src/xennet/adapter.c
index d85f4d1..dc69a7f 100644
--- a/src/xennet/adapter.c
+++ b/src/xennet/adapter.c
@@ -81,6 +81,12 @@ struct _XENNET_ADAPTER {
     PXENNET_RECEIVER            Receiver;
     PXENNET_TRANSMITTER         Transmitter;
     BOOLEAN                     Enabled;
+
+    NTSTATUS                    (*_snprintf_s)(char *,
+                                               size_t,
+                                               size_t,
+                                               const char *,
+                                               ...);
 };
 
 static LONG AdapterCount;
@@ -1300,11 +1306,6 @@ __AdapterSetDistribution(
     )
 {
     ULONG               Index;
-    NTSTATUS            (*___snprintf_s)(char *,
-                                         size_t,
-                                         size_t,
-                                         const char *,
-                                         ...);
     CHAR                Distribution[MAXNAMELEN];
     CHAR                Vendor[MAXNAMELEN];
     const CHAR          *Product;
@@ -1312,21 +1313,15 @@ __AdapterSetDistribution(
 
     Trace("====>\n");
 
-    status = LinkGetRoutineAddress("ntdll.dll",
-                                   "_snprintf_s",
-                                   (PVOID *)&___snprintf_s);
-    if (!NT_SUCCESS(status))
-        goto fail1;
-
     Index = 0;
     while (Index <= MAXIMUM_INDEX) {
         PCHAR   Buffer;
 
-        (VOID) ___snprintf_s(Distribution,
-                             MAXNAMELEN,
-                             _TRUNCATE,
-                             "%u",
-                             Index);
+        (VOID) Adapter->_snprintf_s(Distribution,
+                                    MAXNAMELEN,
+                                    _TRUNCATE,
+                                    "%u",
+                                    Index);
 
         status = XENBUS_STORE(Read,
                               &Adapter->StoreInterface,
@@ -1338,7 +1333,7 @@ __AdapterSetDistribution(
             if (status == STATUS_OBJECT_NAME_NOT_FOUND)
                 goto update;
 
-            goto fail2;
+            goto fail1;
         }
 
         XENBUS_STORE(Free,
@@ -1349,14 +1344,14 @@ __AdapterSetDistribution(
     }
 
     status = STATUS_UNSUCCESSFUL;
-    goto fail3;
+    goto fail2;
 
 update:
-    (VOID) ___snprintf_s(Vendor,
-                         MAXNAMELEN,
-                         _TRUNCATE,
-                         "%s",
-                         VENDOR_NAME_STR);
+    (VOID) Adapter->_snprintf_s(Vendor,
+                                MAXNAMELEN,
+                                _TRUNCATE,
+                                "%s",
+                                VENDOR_NAME_STR);
 
     for (Index  = 0; Vendor[Index] != '\0'; Index++)
         if (!isalnum((UCHAR)Vendor[Index]))
@@ -1389,9 +1384,6 @@ update:
     Trace("<====\n");
     return STATUS_SUCCESS;
 
-fail3:
-    Error("fail3\n");
-
 fail2:
     Error("fail2\n");
 
@@ -1498,16 +1490,22 @@ AdapterEnable(
     if (!NT_SUCCESS(status))
         goto fail2;
 
-    status = AdapterSetDistribution(Adapter);
+    status = LinkGetRoutineAddress("ntdll.dll",
+                                   "_snprintf_s",
+                                   (PVOID *)&Adapter->_snprintf_s);
     if (!NT_SUCCESS(status))
         goto fail3;
 
+    status = AdapterSetDistribution(Adapter);
+    if (!NT_SUCCESS(status))
+        goto fail4;
+
     status = XENVIF_VIF(Enable,
                         &Adapter->VifInterface,
                         AdapterVifCallback,
                         Adapter);
     if (!NT_SUCCESS(status))
-        goto fail4;
+        goto fail5;
 
     AdapterMediaStateChange(Adapter);
 
@@ -1515,9 +1513,12 @@ AdapterEnable(
 
     return NDIS_STATUS_SUCCESS;
 
-fail4:
+fail5:
     AdapterClearDistribution(Adapter);
 
+fail4:
+    Adapter->_snprintf_s = NULL;
+
 fail3:
     XENBUS_SUSPEND(Release, &Adapter->SuspendInterface);
 
@@ -1543,6 +1544,8 @@ AdapterDisable(
 
     AdapterClearDistribution(Adapter);
 
+    Adapter->_snprintf_s = NULL;
+
     XENBUS_SUSPEND(Release, &Adapter->SuspendInterface);
     XENBUS_STORE(Release, &Adapter->StoreInterface);
 }
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Thu Jan 28 10:16:14 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 28 Jan 2016 10:16:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aOjcb-0002cJ-Ph; Thu, 28 Jan 2016 10:16:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <fabio.fantoni@m2r.biz>) id 1aOjcZ-0002bd-Rs
	for win-pv-devel@lists.xenproject.org; Thu, 28 Jan 2016 10:16:12 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	4F/94-12635-B6AE9A65; Thu, 28 Jan 2016 10:16:11 +0000
X-Env-Sender: fabio.fantoni@m2r.biz
X-Msg-Ref: server-9.tower-206.messagelabs.com!1453976170!18746229!1
X-Originating-IP: [74.125.82.46]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 40784 invoked from network); 28 Jan 2016 10:16:10 -0000
Received: from mail-wm0-f46.google.com (HELO mail-wm0-f46.google.com)
	(74.125.82.46)
	by server-9.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 28 Jan 2016 10:16:10 -0000
Received: by mail-wm0-f46.google.com with SMTP id l66so3735820wml.0
	for <win-pv-devel@lists.xenproject.org>;
	Thu, 28 Jan 2016 02:16:10 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=m2r-biz.20150623.gappssmtp.com; s=20150623;
	h=subject:to:references:cc:from:message-id:date:user-agent
	:mime-version:in-reply-to:content-type:content-transfer-encoding;
	bh=yUQGqqc4UIlooElSL7YUHFXn0VDRNPgVr3FJXVuG+Jw=;
	b=JKlBzNl9fH53iIfzbmkhwUbKnbFqPWOzTpg28zOtjxe1Kxwl45103khDgC//dY42Y9
	pIjeOQ09v0OgjaiLmTIdBYmVEtgsEtpChWpPQwxBLaHYcpO2htK7lFBCB0FpeHRxCxKd
	ZH6mBYtIzWNfSUBfHYR/KPeV+FDRwuMnPZgHe1Izdph39S0AYRow5VaaLax0xrzAWIrt
	Stpb+rM7MgI6xT2uNRDcKaWZQ8youqPAfh1vPNrpA8y+Ik9fhbS/oFc5w1e2lyiyRrNX
	VGfCEFoU4jcKxVuCHa65lLmDvPchgjtzHLpIggVqIrE2R3YRWRqxrjtd95CmjtMNeqSg
	z8bw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:subject:to:references:cc:from:message-id:date
	:user-agent:mime-version:in-reply-to:content-type
	:content-transfer-encoding;
	bh=yUQGqqc4UIlooElSL7YUHFXn0VDRNPgVr3FJXVuG+Jw=;
	b=KeyR3VZqPDktcoE7xUdDSTmnFKJ//acCGQuyAsq+6Yl8TSGVZMpJ6nn+7S3NOwWcW5
	PVP9saKZsJCFgLswfS2bvv8hfzottHqzsuRW3J6RSSIFtN0erP4rJqJZohfkMWEYlyHD
	UDW0JMoJ7tR3mBqgBtOdUrNcbMv3yjQaqEJ6cu+UiIglQMNhmO8B9a9Or/hZ4QZmb+9y
	0DPZJ0fFS6frXSe/Zc+DhyHCp7Nad7H8IchIoA8DfpZO8O2r2PKNcCvwaXmZ63qKo9mU
	dicHDPp4mb4gATrwzlvzNYig6AimAJAoWZYKYu543tJS2pAzwDl/dUHV9OmKBo3+huPc
	F6rg==
X-Gm-Message-State: AG10YOQD9jnTS51n045ad5LfNKYD0ZWZRjHUNFRN0A71aE+MhATApyJNt9nrucLqUBB8UQ==
X-Received: by 10.28.111.217 with SMTP id c86mr2019411wmi.31.1453976170299;
	Thu, 28 Jan 2016 02:16:10 -0800 (PST)
Received: from [192.168.1.24] (ip-73-126.sn2.clouditalia.com. [83.211.73.126])
	by smtp.googlemail.com with ESMTPSA id
	e77sm2098863wma.18.2016.01.28.02.16.08
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 28 Jan 2016 02:16:09 -0800 (PST)
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
References: <56A7A362.30309@m2r.biz> <20160127183738.GD3134@char.us.oracle.com>
From: Fabio Fantoni <fabio.fantoni@m2r.biz>
Message-ID: <56A9EA71.9050002@m2r.biz>
Date: Thu, 28 Jan 2016 11:16:17 +0100
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101
	Thunderbird/38.5.1
MIME-Version: 1.0
In-Reply-To: <20160127183738.GD3134@char.us.oracle.com>
Cc: spice-devel@lists.freedesktop.org, win-pv-devel@lists.xenproject.org,
	xen-devel@lists.xensource.com, Paul Durrant <paul.durrant@citrix.com>
Subject: Re: [win-pv-devel] [Xen-devel] Developers for virgl 3d windows
	guest support
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Il 27/01/2016 19:37, Konrad Rzeszutek Wilk ha scritto:
> On Tue, Jan 26, 2016 at 05:48:34PM +0100, Fabio Fantoni wrote:
>> I take a fast look to virgl 3d project even if I not tested it for now. It
>> seems interesting for adding 2d and 3d hw acceleration support to virtual
>> machines with a large hw (gpu) choice.
>> I take a look also to intel gvt-g but it has a very limited cpu support
>> choice.
>> I saw that windows guest support with direct3d drivers in virgl is planned
>> but I nothing was done for now.
>> I'm approaching a new project (based on xen) and I'm in planning phase now.
>> My goal would be to have virgl 3d windows guest support (drivers with opengl
>> and direct3d) and support of remote rendering with spice (we are already
>> using with qxl for now)
> Did you look at the VirtIO drivers and their roadmap?

About virtio-gpu using virgl3d project for 3d hw acceleration support 
and is what I mainly watching for its large gpu choice/support, seems 
any gpu that have a drm driver in host kernel is supported by virgl, or 
I'm wrong?
I saw that they don't have short term plan about windows support: 
https://github.com/YanVugenfirer/kvm-guest-drivers-windows/issues/50

If you mean instead intel igvt-g and seems also nvidia with recent posts 
I saw, seems a good project but has very limited hardware choice.
Intel cpus with integrated gpu that support igvt-g don't seems powerful 
enough for major of servers I need to build (about xeon only workstation 
series seems support it).
About nvidia only grid card seems support it (high cost useful only for 
a minimal user target with intensive 3d usage FWIK)

I'm in evaulating/exploring which project/technology is more suitable 
for my goal. My goal is to run at least 10 windows Desktop vms (office 
and schools use target) on a xen host with 2d/3d hw acceleration support.

I'm wondering what solution is more long-term reliable and approceable 
to have such 2d/3d support and FWIK ity seems virgl is the way to go but 
i really need some advice from some expert out there in order to make 
the right choice.

>
>
>> Are there any developers expert about these things that can advice me if
>> developing windows drivers (WDDM kernel driver + GL and D3D userspace
>> pieces) and any other needed pieces of code in virglrender, mesa, and /or
>> qemu is a good choice?
> I have no clue about Windows. But when I started working on Linux it took
> me good three months to get comfortable. I would presume the same thing
> is for Windows. Albeit you would need also to have understanding of
> OpenGL.
>
>> If yes, what we would like to know is approx time/effort to have the above
>> support upstream. Approximately how many persons and how many time would
>> require to complete the tasks? (my project is going to be financed so we
>> eventually have resource to schedule working time in the community)
> Um, .. Are you saying you need the person/month values so that you can
> get the money? Or that you have the money and just need to figure out
> if it can be done with the amount you have?

I'm trying to understand if there are some persons able to start and 
close a payed project in order to have such 2d/3d support developed on 
both windows drivers side and whatever virtualGPU solution actually 
available (virgl or other that I'm not aware of).



Thanks for any reply and sorry for my bad english.

_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Thu Jan 28 10:16:14 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 28 Jan 2016 10:16:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aOjcb-0002cJ-Ph; Thu, 28 Jan 2016 10:16:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <fabio.fantoni@m2r.biz>) id 1aOjcZ-0002bd-Rs
	for win-pv-devel@lists.xenproject.org; Thu, 28 Jan 2016 10:16:12 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	4F/94-12635-B6AE9A65; Thu, 28 Jan 2016 10:16:11 +0000
X-Env-Sender: fabio.fantoni@m2r.biz
X-Msg-Ref: server-9.tower-206.messagelabs.com!1453976170!18746229!1
X-Originating-IP: [74.125.82.46]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 40784 invoked from network); 28 Jan 2016 10:16:10 -0000
Received: from mail-wm0-f46.google.com (HELO mail-wm0-f46.google.com)
	(74.125.82.46)
	by server-9.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 28 Jan 2016 10:16:10 -0000
Received: by mail-wm0-f46.google.com with SMTP id l66so3735820wml.0
	for <win-pv-devel@lists.xenproject.org>;
	Thu, 28 Jan 2016 02:16:10 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=m2r-biz.20150623.gappssmtp.com; s=20150623;
	h=subject:to:references:cc:from:message-id:date:user-agent
	:mime-version:in-reply-to:content-type:content-transfer-encoding;
	bh=yUQGqqc4UIlooElSL7YUHFXn0VDRNPgVr3FJXVuG+Jw=;
	b=JKlBzNl9fH53iIfzbmkhwUbKnbFqPWOzTpg28zOtjxe1Kxwl45103khDgC//dY42Y9
	pIjeOQ09v0OgjaiLmTIdBYmVEtgsEtpChWpPQwxBLaHYcpO2htK7lFBCB0FpeHRxCxKd
	ZH6mBYtIzWNfSUBfHYR/KPeV+FDRwuMnPZgHe1Izdph39S0AYRow5VaaLax0xrzAWIrt
	Stpb+rM7MgI6xT2uNRDcKaWZQ8youqPAfh1vPNrpA8y+Ik9fhbS/oFc5w1e2lyiyRrNX
	VGfCEFoU4jcKxVuCHa65lLmDvPchgjtzHLpIggVqIrE2R3YRWRqxrjtd95CmjtMNeqSg
	z8bw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:subject:to:references:cc:from:message-id:date
	:user-agent:mime-version:in-reply-to:content-type
	:content-transfer-encoding;
	bh=yUQGqqc4UIlooElSL7YUHFXn0VDRNPgVr3FJXVuG+Jw=;
	b=KeyR3VZqPDktcoE7xUdDSTmnFKJ//acCGQuyAsq+6Yl8TSGVZMpJ6nn+7S3NOwWcW5
	PVP9saKZsJCFgLswfS2bvv8hfzottHqzsuRW3J6RSSIFtN0erP4rJqJZohfkMWEYlyHD
	UDW0JMoJ7tR3mBqgBtOdUrNcbMv3yjQaqEJ6cu+UiIglQMNhmO8B9a9Or/hZ4QZmb+9y
	0DPZJ0fFS6frXSe/Zc+DhyHCp7Nad7H8IchIoA8DfpZO8O2r2PKNcCvwaXmZ63qKo9mU
	dicHDPp4mb4gATrwzlvzNYig6AimAJAoWZYKYu543tJS2pAzwDl/dUHV9OmKBo3+huPc
	F6rg==
X-Gm-Message-State: AG10YOQD9jnTS51n045ad5LfNKYD0ZWZRjHUNFRN0A71aE+MhATApyJNt9nrucLqUBB8UQ==
X-Received: by 10.28.111.217 with SMTP id c86mr2019411wmi.31.1453976170299;
	Thu, 28 Jan 2016 02:16:10 -0800 (PST)
Received: from [192.168.1.24] (ip-73-126.sn2.clouditalia.com. [83.211.73.126])
	by smtp.googlemail.com with ESMTPSA id
	e77sm2098863wma.18.2016.01.28.02.16.08
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 28 Jan 2016 02:16:09 -0800 (PST)
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
References: <56A7A362.30309@m2r.biz> <20160127183738.GD3134@char.us.oracle.com>
From: Fabio Fantoni <fabio.fantoni@m2r.biz>
Message-ID: <56A9EA71.9050002@m2r.biz>
Date: Thu, 28 Jan 2016 11:16:17 +0100
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101
	Thunderbird/38.5.1
MIME-Version: 1.0
In-Reply-To: <20160127183738.GD3134@char.us.oracle.com>
Cc: spice-devel@lists.freedesktop.org, win-pv-devel@lists.xenproject.org,
	xen-devel@lists.xensource.com, Paul Durrant <paul.durrant@citrix.com>
Subject: Re: [win-pv-devel] [Xen-devel] Developers for virgl 3d windows
	guest support
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Il 27/01/2016 19:37, Konrad Rzeszutek Wilk ha scritto:
> On Tue, Jan 26, 2016 at 05:48:34PM +0100, Fabio Fantoni wrote:
>> I take a fast look to virgl 3d project even if I not tested it for now. It
>> seems interesting for adding 2d and 3d hw acceleration support to virtual
>> machines with a large hw (gpu) choice.
>> I take a look also to intel gvt-g but it has a very limited cpu support
>> choice.
>> I saw that windows guest support with direct3d drivers in virgl is planned
>> but I nothing was done for now.
>> I'm approaching a new project (based on xen) and I'm in planning phase now.
>> My goal would be to have virgl 3d windows guest support (drivers with opengl
>> and direct3d) and support of remote rendering with spice (we are already
>> using with qxl for now)
> Did you look at the VirtIO drivers and their roadmap?

About virtio-gpu using virgl3d project for 3d hw acceleration support 
and is what I mainly watching for its large gpu choice/support, seems 
any gpu that have a drm driver in host kernel is supported by virgl, or 
I'm wrong?
I saw that they don't have short term plan about windows support: 
https://github.com/YanVugenfirer/kvm-guest-drivers-windows/issues/50

If you mean instead intel igvt-g and seems also nvidia with recent posts 
I saw, seems a good project but has very limited hardware choice.
Intel cpus with integrated gpu that support igvt-g don't seems powerful 
enough for major of servers I need to build (about xeon only workstation 
series seems support it).
About nvidia only grid card seems support it (high cost useful only for 
a minimal user target with intensive 3d usage FWIK)

I'm in evaulating/exploring which project/technology is more suitable 
for my goal. My goal is to run at least 10 windows Desktop vms (office 
and schools use target) on a xen host with 2d/3d hw acceleration support.

I'm wondering what solution is more long-term reliable and approceable 
to have such 2d/3d support and FWIK ity seems virgl is the way to go but 
i really need some advice from some expert out there in order to make 
the right choice.

>
>
>> Are there any developers expert about these things that can advice me if
>> developing windows drivers (WDDM kernel driver + GL and D3D userspace
>> pieces) and any other needed pieces of code in virglrender, mesa, and /or
>> qemu is a good choice?
> I have no clue about Windows. But when I started working on Linux it took
> me good three months to get comfortable. I would presume the same thing
> is for Windows. Albeit you would need also to have understanding of
> OpenGL.
>
>> If yes, what we would like to know is approx time/effort to have the above
>> support upstream. Approximately how many persons and how many time would
>> require to complete the tasks? (my project is going to be financed so we
>> eventually have resource to schedule working time in the community)
> Um, .. Are you saying you need the person/month values so that you can
> get the money? Or that you have the money and just need to figure out
> if it can be done with the amount you have?

I'm trying to understand if there are some persons able to start and 
close a payed project in order to have such 2d/3d support developed on 
both windows drivers side and whatever virtualGPU solution actually 
available (virgl or other that I'm not aware of).



Thanks for any reply and sorry for my bad english.

_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Thu Jan 28 11:37:08 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 28 Jan 2016 11:37:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aOkst-0002Q6-Cg; Thu, 28 Jan 2016 11:37:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lars.kurth.xen@gmail.com>)
	id 1aOksr-0002Po-HK; Thu, 28 Jan 2016 11:37:05 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	15/DA-09708-06DF9A65; Thu, 28 Jan 2016 11:37:04 +0000
X-Env-Sender: lars.kurth.xen@gmail.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1453981015!12595011!1
X-Originating-IP: [74.125.82.54]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 38672 invoked from network); 28 Jan 2016 11:37:03 -0000
Received: from mail-wm0-f54.google.com (HELO mail-wm0-f54.google.com)
	(74.125.82.54)
	by server-4.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 28 Jan 2016 11:37:03 -0000
Received: by mail-wm0-f54.google.com with SMTP id p63so20376454wmp.1;
	Thu, 28 Jan 2016 03:37:02 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=content-type:mime-version:subject:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to;
	bh=3iZRWVJFg/dbVock04X0wXbPcIK1vFz7BUwgS7C5m+8=;
	b=qRup5xBFQrZjjqd4SaH/lHw8sHq6Zux7AwWc3cRgxqvzglkCminWbiDVFiuCpcrmVK
	RU+PzEjsPc/x3nwuSrNe9JaQmbuC5wXo6W2Fd339jHaPL3MzWUnkoNliP4iCppk9mV9x
	saJkMayV3wnPcL3J/XMV0sJYOQ+F0wNreS6puUPdDOtv2iqazIVj3bPbXl8J2QqCyzlf
	N+3cyKmnSQBPW/+2BykOuaRspZCJkiSyPntY62ssQFTJPlX+svghk/SkG6sARNAh+9Qi
	Eil8PnkIth9QXcLT8eVoPjpz4mAkOUgXIwDLh4oh4MydfqW7NfBmH5uspwkoJrEPYPE1
	3JTA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:content-type:mime-version:subject:from
	:in-reply-to:date:cc:content-transfer-encoding:message-id:references
	:to; bh=3iZRWVJFg/dbVock04X0wXbPcIK1vFz7BUwgS7C5m+8=;
	b=g0zpqu4UNQPGeC+NLKoT4rwW1LYs/QugdmK9ZRX5+TxSvOyHjM6u79kuVRYnjL7wOe
	DXxRWS6k90ZY34Imd2/UEknCZwiqzWQ/0MkJ3yFJ6hbabYHV29X409XKMO2xGXXRgZ3A
	lVAQUPDKPZMsnE825CCCotKnnfmKNUEg5/DsIraq62INX3wNR+sVs/e5o2NCXZs+nTp8
	Ntvaf87Kifuve6NfH2f9KTLYwHWtK3CGUp0FXo1iGH/AfPOyTAWEwoJuIzUeKnpaq54N
	GIR2TXA2obelqedXDrJ+LM3Ri/GSZKEI+HPgblMG8TQVO4LfE9dSVBF36FShzeFalI2J
	yDsQ==
X-Gm-Message-State: AG10YORHuBFWPjW/I9OeysR9Dnm5Qt+WfT/Ro0fR4QzzXFPuYt5QRIb9GYDp1GJiHBY7mA==
X-Received: by 10.194.52.8 with SMTP id p8mr2537660wjo.62.1453981014654;
	Thu, 28 Jan 2016 03:36:54 -0800 (PST)
Received: from [192.168.0.12] (5ec0a1a0.skybroadband.com. [94.192.161.160])
	by smtp.gmail.com with ESMTPSA id
	r10sm10612055wjz.24.2016.01.28.03.36.53
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 28 Jan 2016 03:36:53 -0800 (PST)
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\))
From: Lars Kurth <lars.kurth.xen@gmail.com>
In-Reply-To: <F298D48D-5BEE-4535-83F2-D2F59AB7178A@gmail.com>
Date: Thu, 28 Jan 2016 11:36:52 +0000
Message-Id: <ADA95C36-8DD3-4E36-8690-34382D20C9B9@gmail.com>
References: <C49F5723-E3BE-456D-87C8-A2F4CDE8D43C@gmail.com>
	<F298D48D-5BEE-4535-83F2-D2F59AB7178A@gmail.com>
To: xen-devel <xen-devel@lists.xenproject.org>,
	mirageos-devel <mirageos-devel@lists.xenproject.org>,
	Win-pv-devel@lists.xenproject.org, embedded-pv-devel@lists.xenproject.org
X-Mailer: Apple Mail (2.2104)
Cc: xen-users@lists.xenproject.org
Subject: Re: [win-pv-devel] Xen Project Infrastructure Maintenance: xenbits
	(Jan 28), qemu-bitslave & mail & downloads.xenproject.org (Feb 1),
	lists & etherpad (Feb 4th)
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Hi everyone,
http://xenbits.xen.org/ is live again. This means that access to git repositories, on-line documentation and information to XSA's has been restored. Apologies for any inconvenience that was caused.
Best Regards
Lars


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Thu Jan 28 11:37:08 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 28 Jan 2016 11:37:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aOkst-0002Q6-Cg; Thu, 28 Jan 2016 11:37:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lars.kurth.xen@gmail.com>)
	id 1aOksr-0002Po-HK; Thu, 28 Jan 2016 11:37:05 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	15/DA-09708-06DF9A65; Thu, 28 Jan 2016 11:37:04 +0000
X-Env-Sender: lars.kurth.xen@gmail.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1453981015!12595011!1
X-Originating-IP: [74.125.82.54]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 38672 invoked from network); 28 Jan 2016 11:37:03 -0000
Received: from mail-wm0-f54.google.com (HELO mail-wm0-f54.google.com)
	(74.125.82.54)
	by server-4.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 28 Jan 2016 11:37:03 -0000
Received: by mail-wm0-f54.google.com with SMTP id p63so20376454wmp.1;
	Thu, 28 Jan 2016 03:37:02 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=content-type:mime-version:subject:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to;
	bh=3iZRWVJFg/dbVock04X0wXbPcIK1vFz7BUwgS7C5m+8=;
	b=qRup5xBFQrZjjqd4SaH/lHw8sHq6Zux7AwWc3cRgxqvzglkCminWbiDVFiuCpcrmVK
	RU+PzEjsPc/x3nwuSrNe9JaQmbuC5wXo6W2Fd339jHaPL3MzWUnkoNliP4iCppk9mV9x
	saJkMayV3wnPcL3J/XMV0sJYOQ+F0wNreS6puUPdDOtv2iqazIVj3bPbXl8J2QqCyzlf
	N+3cyKmnSQBPW/+2BykOuaRspZCJkiSyPntY62ssQFTJPlX+svghk/SkG6sARNAh+9Qi
	Eil8PnkIth9QXcLT8eVoPjpz4mAkOUgXIwDLh4oh4MydfqW7NfBmH5uspwkoJrEPYPE1
	3JTA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:content-type:mime-version:subject:from
	:in-reply-to:date:cc:content-transfer-encoding:message-id:references
	:to; bh=3iZRWVJFg/dbVock04X0wXbPcIK1vFz7BUwgS7C5m+8=;
	b=g0zpqu4UNQPGeC+NLKoT4rwW1LYs/QugdmK9ZRX5+TxSvOyHjM6u79kuVRYnjL7wOe
	DXxRWS6k90ZY34Imd2/UEknCZwiqzWQ/0MkJ3yFJ6hbabYHV29X409XKMO2xGXXRgZ3A
	lVAQUPDKPZMsnE825CCCotKnnfmKNUEg5/DsIraq62INX3wNR+sVs/e5o2NCXZs+nTp8
	Ntvaf87Kifuve6NfH2f9KTLYwHWtK3CGUp0FXo1iGH/AfPOyTAWEwoJuIzUeKnpaq54N
	GIR2TXA2obelqedXDrJ+LM3Ri/GSZKEI+HPgblMG8TQVO4LfE9dSVBF36FShzeFalI2J
	yDsQ==
X-Gm-Message-State: AG10YORHuBFWPjW/I9OeysR9Dnm5Qt+WfT/Ro0fR4QzzXFPuYt5QRIb9GYDp1GJiHBY7mA==
X-Received: by 10.194.52.8 with SMTP id p8mr2537660wjo.62.1453981014654;
	Thu, 28 Jan 2016 03:36:54 -0800 (PST)
Received: from [192.168.0.12] (5ec0a1a0.skybroadband.com. [94.192.161.160])
	by smtp.gmail.com with ESMTPSA id
	r10sm10612055wjz.24.2016.01.28.03.36.53
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 28 Jan 2016 03:36:53 -0800 (PST)
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\))
From: Lars Kurth <lars.kurth.xen@gmail.com>
In-Reply-To: <F298D48D-5BEE-4535-83F2-D2F59AB7178A@gmail.com>
Date: Thu, 28 Jan 2016 11:36:52 +0000
Message-Id: <ADA95C36-8DD3-4E36-8690-34382D20C9B9@gmail.com>
References: <C49F5723-E3BE-456D-87C8-A2F4CDE8D43C@gmail.com>
	<F298D48D-5BEE-4535-83F2-D2F59AB7178A@gmail.com>
To: xen-devel <xen-devel@lists.xenproject.org>,
	mirageos-devel <mirageos-devel@lists.xenproject.org>,
	Win-pv-devel@lists.xenproject.org, embedded-pv-devel@lists.xenproject.org
X-Mailer: Apple Mail (2.2104)
Cc: xen-users@lists.xenproject.org
Subject: Re: [win-pv-devel] Xen Project Infrastructure Maintenance: xenbits
	(Jan 28), qemu-bitslave & mail & downloads.xenproject.org (Feb 1),
	lists & etherpad (Feb 4th)
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Hi everyone,
http://xenbits.xen.org/ is live again. This means that access to git repositories, on-line documentation and information to XSA's has been restored. Apologies for any inconvenience that was caused.
Best Regards
Lars


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Thu Jan 28 11:40:03 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 28 Jan 2016 11:40:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aOkvj-0002iK-A9; Thu, 28 Jan 2016 11:40:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kraxel@redhat.com>) id 1aOkop-0002Dg-AY
	for win-pv-devel@lists.xenproject.org; Thu, 28 Jan 2016 11:32:55 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	9B/E3-12072-66CF9A65; Thu, 28 Jan 2016 11:32:54 +0000
X-Env-Sender: kraxel@redhat.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1453980772!18777159!1
X-Originating-IP: [209.132.183.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjA5LjEzMi4xODMuMjggPT4gNTQwNjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19560 invoked from network); 28 Jan 2016 11:32:54 -0000
Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28)
	by server-5.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384
	encrypted SMTP; 28 Jan 2016 11:32:54 -0000
Received: from int-mx14.intmail.prod.int.phx2.redhat.com
	(int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27])
	by mx1.redhat.com (Postfix) with ESMTPS id EA947A3B4D;
	Thu, 28 Jan 2016 11:32:51 +0000 (UTC)
Received: from nilsson.home.kraxel.org (ovpn-116-42.ams2.redhat.com
	[10.36.116.42])
	by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id u0SBWohA018455; Thu, 28 Jan 2016 06:32:51 -0500
Received: by nilsson.home.kraxel.org (Postfix, from userid 500)
	id 54A9181D16; Thu, 28 Jan 2016 12:32:50 +0100 (CET)
Message-ID: <1453980770.30975.74.camel@redhat.com>
From: Gerd Hoffmann <kraxel@redhat.com>
To: Fabio Fantoni <fabio.fantoni@m2r.biz>
Date: Thu, 28 Jan 2016 12:32:50 +0100
In-Reply-To: <56A9EA71.9050002@m2r.biz>
References: <56A7A362.30309@m2r.biz>
	<20160127183738.GD3134@char.us.oracle.com> <56A9EA71.9050002@m2r.biz>
Mime-Version: 1.0
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27
X-Mailman-Approved-At: Thu, 28 Jan 2016 11:40:03 +0000
Cc: spice-devel@lists.freedesktop.org, win-pv-devel@lists.xenproject.org,
	xen-devel@lists.xensource.com, Paul Durrant <paul.durrant@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [win-pv-devel] [Spice-devel] [Xen-devel] Developers for virgl
 3d windows guest support
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

  Hi,

> About virtio-gpu using virgl3d project for 3d hw acceleration support 
> and is what I mainly watching for its large gpu choice/support, seems 
> any gpu that have a drm driver in host kernel is supported by virgl, or 
> I'm wrong?

You need a mesa driver too.  But, yes, pretty much any modern hardware
with opengl supported by open source drivers should do.

> Intel cpus with integrated gpu that support igvt-g don't seems powerful 
> enough for major of servers I need to build (about xeon only workstation 
> series seems support it).

FYI:  Any broadwell + newer should do for intel-vgpu, long-term.
current experimental code releases include haswell too, but intel
doesn't plan to upstream that.

> I'm wondering what solution is more long-term reliable and approceable 
> to have such 2d/3d support and FWIK ity seems virgl is the way to go but 
> i really need some advice from some expert out there in order to make 
> the right choice.

I expect intel-vgpu and virgl both will be upstreamed at some point and
should work fine without too much hassle.

Intel has the advantage that windows drivers exist already, for virgl
they need to be written.

Intel has the disadvantage that it only works on newer intel hardware,
virgl works pretty much anywhere.  If you havn't yet ordered the
hardware this might not be much of a problem though.

But also note that being hardware-independent doesn't come for free,
there is some translation overhead involved.  When comparing intel-vgpu
and virgl on the same hardware intel will most likely deliver higher
performance.

> available (virgl or other that I'm not aware of).

Well, there is https://github.com/espes/xqemu/blob/xbox/hw/xbox/nv2a.c

Didn't have the time yet to look at this in detail, it's on my TODO list
though.

It is opengl-accelerated geforce nv2a emulation.  For an older qemu
version.  Plumbing that into opengl infrastructure qemu got recently for
virgl shouldn't be too hard.  Advantage of emulating something existing
is that the guest driver problem goes away.  Disavdantage of course is
that you are limited to what the emulated hardware is able to do (not
sure what level of opengl the nv2a is able to support).  Could be useful
for desktop workloads nevertheless.

Bottom line: lots of tradeoffs here, and also alot of work-in-progress
stuff ...

cheers,
  Gerd


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Thu Jan 28 11:40:03 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 28 Jan 2016 11:40:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aOkvj-0002iK-A9; Thu, 28 Jan 2016 11:40:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kraxel@redhat.com>) id 1aOkop-0002Dg-AY
	for win-pv-devel@lists.xenproject.org; Thu, 28 Jan 2016 11:32:55 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	9B/E3-12072-66CF9A65; Thu, 28 Jan 2016 11:32:54 +0000
X-Env-Sender: kraxel@redhat.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1453980772!18777159!1
X-Originating-IP: [209.132.183.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjA5LjEzMi4xODMuMjggPT4gNTQwNjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19560 invoked from network); 28 Jan 2016 11:32:54 -0000
Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28)
	by server-5.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384
	encrypted SMTP; 28 Jan 2016 11:32:54 -0000
Received: from int-mx14.intmail.prod.int.phx2.redhat.com
	(int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27])
	by mx1.redhat.com (Postfix) with ESMTPS id EA947A3B4D;
	Thu, 28 Jan 2016 11:32:51 +0000 (UTC)
Received: from nilsson.home.kraxel.org (ovpn-116-42.ams2.redhat.com
	[10.36.116.42])
	by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id u0SBWohA018455; Thu, 28 Jan 2016 06:32:51 -0500
Received: by nilsson.home.kraxel.org (Postfix, from userid 500)
	id 54A9181D16; Thu, 28 Jan 2016 12:32:50 +0100 (CET)
Message-ID: <1453980770.30975.74.camel@redhat.com>
From: Gerd Hoffmann <kraxel@redhat.com>
To: Fabio Fantoni <fabio.fantoni@m2r.biz>
Date: Thu, 28 Jan 2016 12:32:50 +0100
In-Reply-To: <56A9EA71.9050002@m2r.biz>
References: <56A7A362.30309@m2r.biz>
	<20160127183738.GD3134@char.us.oracle.com> <56A9EA71.9050002@m2r.biz>
Mime-Version: 1.0
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27
X-Mailman-Approved-At: Thu, 28 Jan 2016 11:40:03 +0000
Cc: spice-devel@lists.freedesktop.org, win-pv-devel@lists.xenproject.org,
	xen-devel@lists.xensource.com, Paul Durrant <paul.durrant@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [win-pv-devel] [Spice-devel] [Xen-devel] Developers for virgl
 3d windows guest support
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

  Hi,

> About virtio-gpu using virgl3d project for 3d hw acceleration support 
> and is what I mainly watching for its large gpu choice/support, seems 
> any gpu that have a drm driver in host kernel is supported by virgl, or 
> I'm wrong?

You need a mesa driver too.  But, yes, pretty much any modern hardware
with opengl supported by open source drivers should do.

> Intel cpus with integrated gpu that support igvt-g don't seems powerful 
> enough for major of servers I need to build (about xeon only workstation 
> series seems support it).

FYI:  Any broadwell + newer should do for intel-vgpu, long-term.
current experimental code releases include haswell too, but intel
doesn't plan to upstream that.

> I'm wondering what solution is more long-term reliable and approceable 
> to have such 2d/3d support and FWIK ity seems virgl is the way to go but 
> i really need some advice from some expert out there in order to make 
> the right choice.

I expect intel-vgpu and virgl both will be upstreamed at some point and
should work fine without too much hassle.

Intel has the advantage that windows drivers exist already, for virgl
they need to be written.

Intel has the disadvantage that it only works on newer intel hardware,
virgl works pretty much anywhere.  If you havn't yet ordered the
hardware this might not be much of a problem though.

But also note that being hardware-independent doesn't come for free,
there is some translation overhead involved.  When comparing intel-vgpu
and virgl on the same hardware intel will most likely deliver higher
performance.

> available (virgl or other that I'm not aware of).

Well, there is https://github.com/espes/xqemu/blob/xbox/hw/xbox/nv2a.c

Didn't have the time yet to look at this in detail, it's on my TODO list
though.

It is opengl-accelerated geforce nv2a emulation.  For an older qemu
version.  Plumbing that into opengl infrastructure qemu got recently for
virgl shouldn't be too hard.  Advantage of emulating something existing
is that the guest driver problem goes away.  Disavdantage of course is
that you are limited to what the emulated hardware is able to do (not
sure what level of opengl the nv2a is able to support).  Could be useful
for desktop workloads nevertheless.

Bottom line: lots of tradeoffs here, and also alot of work-in-progress
stuff ...

cheers,
  Gerd


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Thu Jan 28 14:42:50 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 28 Jan 2016 14:42:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aOnmb-0003Js-O6; Thu, 28 Jan 2016 14:42:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aOnmW-0003JH-No
	for win-pv-devel@lists.xenproject.org; Thu, 28 Jan 2016 14:42:49 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	1D/FD-15353-4E82AA65; Thu, 28 Jan 2016 14:42:44 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1453992162!18800213!1
X-Originating-IP: [209.85.160.175]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23284 invoked from network); 28 Jan 2016 14:42:43 -0000
Received: from mail-yk0-f175.google.com (HELO mail-yk0-f175.google.com)
	(209.85.160.175)
	by server-3.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 28 Jan 2016 14:42:43 -0000
Received: by mail-yk0-f175.google.com with SMTP id v14so32545183ykd.3
	for <win-pv-devel@lists.xenproject.org>;
	Thu, 28 Jan 2016 06:42:43 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=sC03hb1N9lv/kusqXicjPCTvvfWeCnUkU8nM3bRkCcs=;
	b=yGfX9+TV5ULE5+iTJEuap0Mf5UN5Rk9Eu1ZjfIqPLVqvbbxcXNxzHAdlojcLx6y20U
	KtlQY+t2muQdCS31tW7KcwWDAFFkP5HC0x1M+JrMTwGkE5TiytFYJH38vdQfZFO03U92
	28w9obvETzOrnvcv2Jn1iEmsnScQJflNcdmIkVM9Bonov/S8ueWvlUJ9f5tx2APNOrxA
	wpr6jT1SAFCWi2uJtfvCN+uqer9eidnsfIdSRnbYpJZDlq9ssaK0kRHRvKyHb29QPHTO
	2henxJKEqAFLP/iR0m8c9SeVtgqd83/MXX2eL1i32kMADGlKsYF21cQSI7nrW57iX5cg
	7zHQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id;
	bh=sC03hb1N9lv/kusqXicjPCTvvfWeCnUkU8nM3bRkCcs=;
	b=ZueqOqB14c6NbaYJuY5OQbt0TjNQpxBXVa1jAPIOrdpShsoGGvqwkvoC/Tw1WFZ4Fa
	vashpDr5edKI1qYpB5zKO0MtJuDTvRZEeAv0jURo+2UNayHb8W13XbR5dbuYEnDsOokj
	iq7UrbC9qLzwSYNXEjIm+zMlQKsmNkXD+mp26TFvRzIIQgViFtHI/BaHzH4JF2hTWdG8
	11MFRYY3uvbs63q1dH+YgOaLaG+sc0BE+SlG6n+8SiTuPx7L/KwR5aF/TOAOjs/5pNu3
	Hz2qgROLF96SUxIWD/QurvglshbckLLJ8Z3uqhxckJcLyamsnMgKKqZI9pzPqQCRJjOs
	xOpQ==
X-Gm-Message-State: AG10YOSZvBOenS7V4f0l/PFarpwcZw4gDn2jUELMyZ6NpbAbonGypOhoUx4bn86aLJXZOg==
X-Received: by 10.13.254.67 with SMTP id o64mr1647020ywf.77.1453992162599;
	Thu, 28 Jan 2016 06:42:42 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	z129sm8671575ywb.26.2016.01.28.06.42.41
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Thu, 28 Jan 2016 06:42:42 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Thu, 28 Jan 2016 14:42:29 +0000
Message-Id: <1453992149-13088-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Cancel pending timers when rings are disabled
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

No new timers can be scheduled once rings are disabled but if the rings are
both disconnected and destroyed within the next 100us then it's possible
that the DPC might hit some unitialized data so make sure pending timers
are cancelled.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xenvif/receiver.c    | 6 ++++++
 src/xenvif/transmitter.c | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/src/xenvif/receiver.c b/src/xenvif/receiver.c
index 538971e..3390473 100644
--- a/src/xenvif/receiver.c
+++ b/src/xenvif/receiver.c
@@ -2593,6 +2593,12 @@ __ReceiverRingDisable(
     Ring->Stopped = FALSE;
 
     __ReceiverRingReleaseLock(Ring);
+
+    //
+    // No new timers can be scheduled once Enabled goes to FALSE.
+    // Cancel any existing ones.
+    //
+    (VOID) KeCancelTimer(&Ring->Timer);
 }
 
 static FORCEINLINE VOID
diff --git a/src/xenvif/transmitter.c b/src/xenvif/transmitter.c
index 3aa6366..5a70bea 100644
--- a/src/xenvif/transmitter.c
+++ b/src/xenvif/transmitter.c
@@ -3698,6 +3698,12 @@ __TransmitterRingDisable(
     Ring->Enabled = FALSE;
 
     __TransmitterRingReleaseLock(Ring);
+
+    //
+    // No new timers can be scheduled once Enabled goes to FALSE.
+    // Cancel any existing ones.
+    //
+    (VOID) KeCancelTimer(&Ring->Timer);
 }
 
 static FORCEINLINE VOID
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Thu Jan 28 14:42:50 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 28 Jan 2016 14:42:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aOnmb-0003Js-O6; Thu, 28 Jan 2016 14:42:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aOnmW-0003JH-No
	for win-pv-devel@lists.xenproject.org; Thu, 28 Jan 2016 14:42:49 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	1D/FD-15353-4E82AA65; Thu, 28 Jan 2016 14:42:44 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1453992162!18800213!1
X-Originating-IP: [209.85.160.175]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23284 invoked from network); 28 Jan 2016 14:42:43 -0000
Received: from mail-yk0-f175.google.com (HELO mail-yk0-f175.google.com)
	(209.85.160.175)
	by server-3.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 28 Jan 2016 14:42:43 -0000
Received: by mail-yk0-f175.google.com with SMTP id v14so32545183ykd.3
	for <win-pv-devel@lists.xenproject.org>;
	Thu, 28 Jan 2016 06:42:43 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=sC03hb1N9lv/kusqXicjPCTvvfWeCnUkU8nM3bRkCcs=;
	b=yGfX9+TV5ULE5+iTJEuap0Mf5UN5Rk9Eu1ZjfIqPLVqvbbxcXNxzHAdlojcLx6y20U
	KtlQY+t2muQdCS31tW7KcwWDAFFkP5HC0x1M+JrMTwGkE5TiytFYJH38vdQfZFO03U92
	28w9obvETzOrnvcv2Jn1iEmsnScQJflNcdmIkVM9Bonov/S8ueWvlUJ9f5tx2APNOrxA
	wpr6jT1SAFCWi2uJtfvCN+uqer9eidnsfIdSRnbYpJZDlq9ssaK0kRHRvKyHb29QPHTO
	2henxJKEqAFLP/iR0m8c9SeVtgqd83/MXX2eL1i32kMADGlKsYF21cQSI7nrW57iX5cg
	7zHQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id;
	bh=sC03hb1N9lv/kusqXicjPCTvvfWeCnUkU8nM3bRkCcs=;
	b=ZueqOqB14c6NbaYJuY5OQbt0TjNQpxBXVa1jAPIOrdpShsoGGvqwkvoC/Tw1WFZ4Fa
	vashpDr5edKI1qYpB5zKO0MtJuDTvRZEeAv0jURo+2UNayHb8W13XbR5dbuYEnDsOokj
	iq7UrbC9qLzwSYNXEjIm+zMlQKsmNkXD+mp26TFvRzIIQgViFtHI/BaHzH4JF2hTWdG8
	11MFRYY3uvbs63q1dH+YgOaLaG+sc0BE+SlG6n+8SiTuPx7L/KwR5aF/TOAOjs/5pNu3
	Hz2qgROLF96SUxIWD/QurvglshbckLLJ8Z3uqhxckJcLyamsnMgKKqZI9pzPqQCRJjOs
	xOpQ==
X-Gm-Message-State: AG10YOSZvBOenS7V4f0l/PFarpwcZw4gDn2jUELMyZ6NpbAbonGypOhoUx4bn86aLJXZOg==
X-Received: by 10.13.254.67 with SMTP id o64mr1647020ywf.77.1453992162599;
	Thu, 28 Jan 2016 06:42:42 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	z129sm8671575ywb.26.2016.01.28.06.42.41
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Thu, 28 Jan 2016 06:42:42 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Thu, 28 Jan 2016 14:42:29 +0000
Message-Id: <1453992149-13088-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Cancel pending timers when rings are disabled
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

No new timers can be scheduled once rings are disabled but if the rings are
both disconnected and destroyed within the next 100us then it's possible
that the DPC might hit some unitialized data so make sure pending timers
are cancelled.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xenvif/receiver.c    | 6 ++++++
 src/xenvif/transmitter.c | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/src/xenvif/receiver.c b/src/xenvif/receiver.c
index 538971e..3390473 100644
--- a/src/xenvif/receiver.c
+++ b/src/xenvif/receiver.c
@@ -2593,6 +2593,12 @@ __ReceiverRingDisable(
     Ring->Stopped = FALSE;
 
     __ReceiverRingReleaseLock(Ring);
+
+    //
+    // No new timers can be scheduled once Enabled goes to FALSE.
+    // Cancel any existing ones.
+    //
+    (VOID) KeCancelTimer(&Ring->Timer);
 }
 
 static FORCEINLINE VOID
diff --git a/src/xenvif/transmitter.c b/src/xenvif/transmitter.c
index 3aa6366..5a70bea 100644
--- a/src/xenvif/transmitter.c
+++ b/src/xenvif/transmitter.c
@@ -3698,6 +3698,12 @@ __TransmitterRingDisable(
     Ring->Enabled = FALSE;
 
     __TransmitterRingReleaseLock(Ring);
+
+    //
+    // No new timers can be scheduled once Enabled goes to FALSE.
+    // Cancel any existing ones.
+    //
+    (VOID) KeCancelTimer(&Ring->Timer);
 }
 
 static FORCEINLINE VOID
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Thu Jan 28 18:02:43 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 28 Jan 2016 18:02:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aOqu0-0002hS-V0; Thu, 28 Jan 2016 18:02:40 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aOqtz-0002hN-B4
	for win-pv-devel@lists.xenproject.org; Thu, 28 Jan 2016 18:02:39 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	D5/E7-09708-EB75AA65; Thu, 28 Jan 2016 18:02:38 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1454004157!12680674!1
X-Originating-IP: [74.125.82.52]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2699 invoked from network); 28 Jan 2016 18:02:37 -0000
Received: from mail-wm0-f52.google.com (HELO mail-wm0-f52.google.com)
	(74.125.82.52)
	by server-4.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 28 Jan 2016 18:02:37 -0000
Received: by mail-wm0-f52.google.com with SMTP id l66so22400717wml.0
	for <win-pv-devel@lists.xenproject.org>;
	Thu, 28 Jan 2016 10:02:37 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=kEJNGtP2QIRqa6TuBBFj9zTD5XVhqi9z7LPclvX3LZ0=;
	b=e8ltotQ/Gn+VWL2Wg+MEZXwRneSfboSYJ2/LGpA2Ps/YtZ1FBRqNhSP7blhuF3wErT
	We/PMErnespwO5pzDjX7j6gk58dVR7XojV0qzypsa+SV7vkRJhmW0/3oOgfXm6YQ8d+P
	YdUDsfsSDmcd44svFYwaO8+WbG1huxtBl62lZL/jukWo57EIAJ8saIHgKZq16slKkj2H
	/nIlHTc0/oE9QFAJxeLC0NLv6tAzKzjl00Xnn4I62VaVGO6r586rnXjHSyYA24PkZuOm
	PwnPB98V5b4xIDa/bVJnFTBc3h0w5uhN6JBs22U2HcnruY2lMMCm/DGMlM4HES66ewWT
	N/Dg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id;
	bh=kEJNGtP2QIRqa6TuBBFj9zTD5XVhqi9z7LPclvX3LZ0=;
	b=emIVevq+CrVJX6cKvRSO5FL7J2b24AvFwHeq06Vs5VW9ZavbhwUdi5ycwhG8PGHGYD
	skNxUDBGlF3r/rRw0ZptinlnbCS+nxkUp4ykSUXT2nymeDENkC7oPeAHnokPTLacOZsh
	vO8fPEhH27tDessrR7fhS7mnBlaALQFyW2rdrylndU5ZDlMM9M1m6dhmQB6TX2j/H1uf
	JcYAdg//Rk7j9+5Kd5spW5KPIUF6o3hXANJ9g7OTssRO5eQRulzK7h6/wZ5Pi1/Ur8FW
	xO4tV78nB+5/i72VmS+1ryf4kF3pDSBTjX3dgsl6NKEYGe44l8mc4ETf6V7Bp3AlIJbu
	lTpA==
X-Gm-Message-State: AG10YOQ4U2y3fxvKrngNFCQBZWLw/iD+kyTMJdWYgFvbu6MmcsgDDFtMl81xDzW9RDZcSw==
X-Received: by 10.28.133.141 with SMTP id h135mr4403057wmd.70.1454004156922;
	Thu, 28 Jan 2016 10:02:36 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	i196sm3912700wmf.23.2016.01.28.10.02.36
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Thu, 28 Jan 2016 10:02:36 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Thu, 28 Jan 2016 18:02:26 +0000
Message-Id: <1454004146-11088-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Use a locally defined StringPrintf
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Use of the _snprintf_s symbol fails on Windows 10, where it appears not to
be exported from ntdll. So, for portability's sake it is more robust to
implement a StringPrintf function locally.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xennet/adapter.c         |  52 ++---
 src/xennet/link.c            | 250 -----------------------
 src/xennet/link.h            |  42 ----
 src/xennet/string.c          | 464 +++++++++++++++++++++++++++++++++++++++++++
 src/xennet/string.h          |  51 +++++
 vs2012/xennet/xennet.vcxproj |   2 +-
 vs2013/xennet/xennet.vcxproj |   2 +-
 7 files changed, 538 insertions(+), 325 deletions(-)
 delete mode 100644 src/xennet/link.c
 delete mode 100644 src/xennet/link.h
 create mode 100644 src/xennet/string.c
 create mode 100644 src/xennet/string.h

diff --git a/src/xennet/adapter.c b/src/xennet/adapter.c
index dc69a7f..ea54871 100644
--- a/src/xennet/adapter.c
+++ b/src/xennet/adapter.c
@@ -45,7 +45,7 @@
 #include "util.h"
 #include "dbg_print.h"
 #include "assert.h"
-#include "link.h"
+#include "string.h"
 
 #define MAXNAMELEN  128
 
@@ -81,12 +81,6 @@ struct _XENNET_ADAPTER {
     PXENNET_RECEIVER            Receiver;
     PXENNET_TRANSMITTER         Transmitter;
     BOOLEAN                     Enabled;
-
-    NTSTATUS                    (*_snprintf_s)(char *,
-                                               size_t,
-                                               size_t,
-                                               const char *,
-                                               ...);
 };
 
 static LONG AdapterCount;
@@ -1308,6 +1302,7 @@ __AdapterSetDistribution(
     ULONG               Index;
     CHAR                Distribution[MAXNAMELEN];
     CHAR                Vendor[MAXNAMELEN];
+    STRING              String;
     const CHAR          *Product;
     NTSTATUS            status;
 
@@ -1317,11 +1312,14 @@ __AdapterSetDistribution(
     while (Index <= MAXIMUM_INDEX) {
         PCHAR   Buffer;
 
-        (VOID) Adapter->_snprintf_s(Distribution,
-                                    MAXNAMELEN,
-                                    _TRUNCATE,
-                                    "%u",
-                                    Index);
+        String.Buffer = Distribution;
+        String.MaximumLength = sizeof (Distribution);
+        String.Length = 0;
+
+        status = StringPrintf(&String,
+                              "%u",
+                              Index);
+        ASSERT(NT_SUCCESS(status));
 
         status = XENBUS_STORE(Read,
                               &Adapter->StoreInterface,
@@ -1347,11 +1345,14 @@ __AdapterSetDistribution(
     goto fail2;
 
 update:
-    (VOID) Adapter->_snprintf_s(Vendor,
-                                MAXNAMELEN,
-                                _TRUNCATE,
-                                "%s",
-                                VENDOR_NAME_STR);
+    String.Buffer = Vendor;
+    String.MaximumLength = sizeof (Vendor);
+    String.Length = 0;
+
+    status = StringPrintf(&String,
+                          "%s",
+                          VENDOR_NAME_STR);
+    ASSERT(NT_SUCCESS(status));
 
     for (Index  = 0; Vendor[Index] != '\0'; Index++)
         if (!isalnum((UCHAR)Vendor[Index]))
@@ -1490,22 +1491,16 @@ AdapterEnable(
     if (!NT_SUCCESS(status))
         goto fail2;
 
-    status = LinkGetRoutineAddress("ntdll.dll",
-                                   "_snprintf_s",
-                                   (PVOID *)&Adapter->_snprintf_s);
-    if (!NT_SUCCESS(status))
-        goto fail3;
-
     status = AdapterSetDistribution(Adapter);
     if (!NT_SUCCESS(status))
-        goto fail4;
+        goto fail3;
 
     status = XENVIF_VIF(Enable,
                         &Adapter->VifInterface,
                         AdapterVifCallback,
                         Adapter);
     if (!NT_SUCCESS(status))
-        goto fail5;
+        goto fail4;
 
     AdapterMediaStateChange(Adapter);
 
@@ -1513,11 +1508,8 @@ AdapterEnable(
 
     return NDIS_STATUS_SUCCESS;
 
-fail5:
-    AdapterClearDistribution(Adapter);
-
 fail4:
-    Adapter->_snprintf_s = NULL;
+    AdapterClearDistribution(Adapter);
 
 fail3:
     XENBUS_SUSPEND(Release, &Adapter->SuspendInterface);
@@ -1544,8 +1536,6 @@ AdapterDisable(
 
     AdapterClearDistribution(Adapter);
 
-    Adapter->_snprintf_s = NULL;
-
     XENBUS_SUSPEND(Release, &Adapter->SuspendInterface);
     XENBUS_STORE(Release, &Adapter->StoreInterface);
 }
diff --git a/src/xennet/link.c b/src/xennet/link.c
deleted file mode 100644
index e2a41bc..0000000
--- a/src/xennet/link.c
+++ /dev/null
@@ -1,250 +0,0 @@
-/* Copyright (c) Citrix Systems Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms,
- * with or without modification, are permitted provided
- * that the following conditions are met:
- *
- * *   Redistributions of source code must retain the above
- *     copyright notice, this list of conditions and the
- *     following disclaimer.
- * *   Redistributions in binary form must reproduce the above
- *     copyright notice, this list of conditions and the
- *     following disclaimer in the documentation and/or other
- *     materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <ntddk.h>
-#include <aux_klib.h>
-
-#include "link.h"
-#include "dbg_print.h"
-#include "assert.h"
-#include "util.h"
-
-#define LINK_TAG    'KNIL'
-
-static FORCEINLINE PVOID
-__LinkAllocate(
-    IN  ULONG   Length
-    )
-{
-    return __AllocatePoolWithTag(NonPagedPool, Length, LINK_TAG);
-}
-
-static FORCEINLINE VOID
-__LinkFree(
-    IN  PVOID   Buffer
-    )
-{
-    __FreePoolWithTag(Buffer, LINK_TAG);
-}
-
-static FORCEINLINE NTSTATUS
-__LinkGetImageBase(
-    IN  const CHAR              *ModuleName,
-    OUT PVOID                   *ImageBase
-    )
-{
-    ULONG                       BufferSize;
-    ULONG                       Count;
-    PAUX_MODULE_EXTENDED_INFO   QueryInfo;
-    ULONG                       Index;
-    NTSTATUS                    status;
-
-    Trace("====>\n");
-
-    status = AuxKlibInitialize();
-    if (!NT_SUCCESS(status))
-        goto fail1;
-
-    status = AuxKlibQueryModuleInformation(&BufferSize,
-                                           sizeof (AUX_MODULE_EXTENDED_INFO),
-                                           NULL);
-    if (!NT_SUCCESS(status))
-        goto fail2;
-
-    status = STATUS_UNSUCCESSFUL;
-    if (BufferSize == 0)
-        goto fail3;
-
-again:
-    Count = BufferSize / sizeof (AUX_MODULE_EXTENDED_INFO);
-    QueryInfo = __LinkAllocate(sizeof (AUX_MODULE_EXTENDED_INFO) * Count);
-
-    status = STATUS_NO_MEMORY;
-    if (QueryInfo == NULL)
-        goto fail4;
-
-    status = AuxKlibQueryModuleInformation(&BufferSize,
-                                           sizeof (AUX_MODULE_EXTENDED_INFO),
-                                           QueryInfo);
-    if (!NT_SUCCESS(status)) {
-        if (status != STATUS_BUFFER_TOO_SMALL)
-            goto fail5;
-
-        __LinkFree(QueryInfo);
-        goto again;
-    }
-
-    for (Index = 0; Index < Count; Index++) {
-        PCHAR   Name;
-
-        Name = strrchr((const CHAR *)QueryInfo[Index].FullPathName, '\\');
-        Name = (Name == NULL) ? (PCHAR)QueryInfo[Index].FullPathName : (Name + 1);
-
-        if (_stricmp(Name, ModuleName) == 0)
-            goto found;
-    }
-
-    status = STATUS_UNSUCCESSFUL;
-    goto fail6;
-
-found:
-    *ImageBase = QueryInfo[Index].BasicInfo.ImageBase;
-
-    __LinkFree(QueryInfo);
-
-    Trace("<====\n");
-
-    return STATUS_SUCCESS;
-
-fail6:
-    Error("fail6\n");
-
-fail5:
-    Error("fail5\n");
-
-    __LinkFree(QueryInfo);
-
-fail4:
-    Error("fail4\n");
-
-fail3:
-    Error("fail3\n");
-
-fail2:
-    Error("fail2\n");
-
-fail1:
-    Error("fail1 (%08x)\n", status);
-
-    return status;
-}
-
-NTSTATUS
-LinkGetRoutineAddress(
-    IN  const CHAR  *ModuleName,
-    IN  const CHAR  *FunctionName,
-    OUT PVOID       *Address
-    )
-{
-#define MK_PTR(_ImageBase, _Type, _RVA) \
-    (_Type)((ULONG_PTR)(_ImageBase) + (_RVA))
-
-    PVOID                       ImageBase;
-    PIMAGE_DOS_HEADER           DosHeader;
-    PIMAGE_NT_HEADERS           NtHeaders;
-    PIMAGE_OPTIONAL_HEADER      OptionalHeader;
-    PIMAGE_DATA_DIRECTORY       Entry;
-    PIMAGE_EXPORT_DIRECTORY     Exports;
-    PULONG                      AddressOfFunctions;
-    PULONG                      AddressOfNames;
-    PUSHORT                     AddressOfNameOrdinals;
-    ULONG                       Index;
-    USHORT                      Ordinal;
-    PVOID                       Function;
-    NTSTATUS                    status;
-
-    Trace("====>\n");
-
-    status = __LinkGetImageBase(ModuleName, &ImageBase);
-    if (!NT_SUCCESS(status))
-        goto fail1;
-
-    DosHeader = MK_PTR(ImageBase, PIMAGE_DOS_HEADER, 0);
-    ASSERT3U(DosHeader->e_magic, ==, IMAGE_DOS_SIGNATURE);
-
-    NtHeaders = MK_PTR(ImageBase, PIMAGE_NT_HEADERS, DosHeader->e_lfanew);
-    ASSERT3U(NtHeaders->Signature, ==, IMAGE_NT_SIGNATURE);
-
-    OptionalHeader = &NtHeaders->OptionalHeader;
-    ASSERT3U(OptionalHeader->Magic, ==, IMAGE_NT_OPTIONAL_HDR_MAGIC);
-
-    Entry = &OptionalHeader->DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT];
-
-    status = STATUS_UNSUCCESSFUL;
-    if (Entry->Size == 0)
-        goto fail2;
-
-    Exports = MK_PTR(ImageBase, PIMAGE_EXPORT_DIRECTORY,
-                     Entry->VirtualAddress);
-
-    status = STATUS_UNSUCCESSFUL;
-    if (Exports->NumberOfNames == 0)
-        goto fail3;
-
-    AddressOfFunctions = MK_PTR(ImageBase, PULONG,
-                                Exports->AddressOfFunctions);
-    AddressOfNames = MK_PTR(ImageBase, PULONG,
-                            Exports->AddressOfNames);
-    AddressOfNameOrdinals = MK_PTR(ImageBase, PUSHORT,
-                                   Exports->AddressOfNameOrdinals);
-
-    for (Index = 0; Index < Exports->NumberOfNames; Index++) {
-        PCHAR   Name = MK_PTR(ImageBase, PCHAR, AddressOfNames[Index]);
-
-        Ordinal = AddressOfNameOrdinals[Index];
-        Function = MK_PTR(ImageBase, PVOID, AddressOfFunctions[Ordinal]);
-
-        if (strcmp(Name, FunctionName) == 0)
-            goto found;
-    }
-
-    status = STATUS_UNSUCCESSFUL;
-    goto fail4;
-
-found:
-    *Address = Function;
-
-    Trace("%s:%s (%04X) @ %p\n",
-          ModuleName,
-          FunctionName,
-          Ordinal,
-          Function);
-
-    Trace("<====\n");
-
-    return STATUS_SUCCESS;
-
-fail4:
-    Error("fail4\n");
-
-fail3:
-    Error("fail3\n");
-
-fail2:
-    Error("fail2\n");
-
-fail1:
-    Error("fail1 (%08x)\n", status);
-
-    return status;
-
-#undef  MK_PTR
-}
diff --git a/src/xennet/link.h b/src/xennet/link.h
deleted file mode 100644
index 9e4b564..0000000
--- a/src/xennet/link.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Copyright (c) Citrix Systems Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms,
- * with or without modification, are permitted provided
- * that the following conditions are met:
- *
- * *   Redistributions of source code must retain the above
- *     copyright notice, this list of conditions and the
- *     following disclaimer.
- * *   Redistributions in binary form must reproduce the above
- *     copyright notice, this list of conditions and the
- *     following disclaimer in the documentation and/or other
- *     materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef _XENNET_LINK_H
-#define _XENNET_LINK_H
-
-extern NTSTATUS
-LinkGetRoutineAddress(
-    IN  const CHAR  *ModuleName,
-    IN  const CHAR  *FunctionName,
-    OUT PVOID       *Address
-     );
-
-#endif  // _XENVIF_LINK_H
diff --git a/src/xennet/string.c b/src/xennet/string.c
new file mode 100644
index 0000000..ff0d003
--- /dev/null
+++ b/src/xennet/string.c
@@ -0,0 +1,464 @@
+/* Copyright (c) Citrix Systems Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms,
+ * with or without modification, are permitted provided
+ * that the following conditions are met:
+ *
+ * *   Redistributions of source code must retain the above
+ *     copyright notice, this list of conditions and the
+ *     following disclaimer.
+ * *   Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the
+ *     following disclaimer in the documentation and/or other
+ *     materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#pragma warning(disable:4152)   // nonstandard extension, function/data pointer conversion in expression
+
+#include <ntddk.h>
+
+#include "string.h"
+#include "dbg_print.h"
+#include "assert.h"
+
+static FORCEINLINE NTSTATUS
+__StringPut(
+    IN  PSTRING String,
+    IN  CHAR    Character
+    )
+{
+    if (String->Length >= String->MaximumLength - 1)
+        return STATUS_BUFFER_OVERFLOW;
+
+    String->Buffer[String->Length++] = Character;
+    return STATUS_SUCCESS;
+}
+
+static PCHAR
+FormatNumber(
+    IN  PCHAR       Buffer,
+    IN  ULONGLONG   Value,
+    IN  UCHAR       Base,
+    IN  BOOLEAN     UpperCase
+    )
+{
+    ULONGLONG       Next = Value / Base;
+
+    if (Next != 0)
+        Buffer = FormatNumber(Buffer, Next, Base, UpperCase);
+
+    Value %= Base;
+
+    if (Value < 10)
+        *Buffer++ = '0' + (CHAR)Value;
+    else
+        *Buffer++ = ((UpperCase) ? 'A' : 'a') + (CHAR)(Value - 10);
+
+    *Buffer = '\0';
+
+    return Buffer;
+}
+
+#define FORMAT_NUMBER(_Arguments, _Type, _Character, _Buffer)                               \
+        do {                                                                                \
+            U ## _Type  _Value = va_arg((_Arguments), U ## _Type);                          \
+            BOOLEAN     _UpperCase = FALSE;                                                 \
+            UCHAR       _Base = 0;                                                          \
+            ULONG       _Index = 0;                                                         \
+                                                                                            \
+            if ((_Character) == 'd' && (_Type)_Value < 0) {                                 \
+                _Value = -((_Type)_Value);                                                  \
+                (_Buffer)[_Index++] = '-';                                                  \
+            }                                                                               \
+                                                                                            \
+            switch (_Character) {                                                           \
+            case 'o':                                                                       \
+                _Base = 8;                                                                  \
+                break;                                                                      \
+                                                                                            \
+            case 'd':                                                                       \
+            case 'u':                                                                       \
+                _Base = 10;                                                                 \
+                break;                                                                      \
+                                                                                            \
+            case 'p':                                                                       \
+            case 'X':                                                                       \
+                _UpperCase = TRUE;                                                          \
+                /* FALLTHRU */                                                              \
+                                                                                            \
+            case 'x':                                                                       \
+                _Base = 16;                                                                 \
+                break;                                                                      \
+            }                                                                               \
+                                                                                            \
+            (VOID) FormatNumber(&(_Buffer)[_Index], (ULONGLONG)_Value, _Base, _UpperCase);  \
+        } while (FALSE)
+
+static NTSTATUS
+StringWriteBuffer(
+    IN  PSTRING         String,
+    IN  const CHAR      *Format,
+    IN  va_list         Arguments
+    )
+{
+    CHAR                Character;
+    NTSTATUS            status;
+
+    status = STATUS_SUCCESS;
+
+    while ((Character = *Format++) != '\0') {
+        UCHAR   Pad = 0;
+        UCHAR   Long = 0;
+        BOOLEAN Wide = FALSE;
+        BOOLEAN ZeroPrefix = FALSE;
+        BOOLEAN OppositeJustification = FALSE;
+
+        if (Character != '%') {
+            status = __StringPut(String, Character);
+            if (!NT_SUCCESS(status))
+                goto done;
+
+            continue;
+        }
+
+        Character = *Format++;
+        ASSERT(Character != '\0');
+
+        if (Character == '-') {
+            OppositeJustification = TRUE;
+            Character = *Format++;
+            ASSERT(Character != '\0');
+        }
+
+        if (isdigit((unsigned char)Character)) {
+            ZeroPrefix = (Character == '0') ? TRUE : FALSE;
+
+            while (isdigit((unsigned char)Character)) {
+                Pad = (Pad * 10) + (Character - '0');
+                Character = *Format++;
+                ASSERT(Character != '\0');
+            }
+        }
+
+        while (Character == 'l') {
+            Long++;
+            Character = *Format++;
+            ASSERT(Character == 'd' ||
+                   Character == 'u' ||
+                   Character == 'o' ||
+                   Character == 'x' ||
+                   Character == 'X' ||
+                   Character == 'l');
+        }
+        ASSERT3U(Long, <=, 2);
+
+        while (Character == 'w') {
+            Wide = TRUE;
+            Character = *Format++;
+            ASSERT(Character == 'c' ||
+                   Character == 's' ||
+                   Character == 'Z');
+        }
+
+        switch (Character) {
+        case 'c': {
+            if (Wide) {
+                WCHAR   Value;
+                Value = va_arg(Arguments, WCHAR);
+
+                status = __StringPut(String, (CHAR)Value);
+                if (!NT_SUCCESS(status))
+                    goto done;
+            } else {
+                CHAR    Value;
+
+                Value = va_arg(Arguments, CHAR);
+
+                status = __StringPut(String, Value);
+                if (!NT_SUCCESS(status))
+                    goto done;
+            }
+            break;
+        }
+        case 'p':
+            ZeroPrefix = TRUE;
+            Pad = sizeof (ULONG_PTR) * 2;
+            Long = sizeof (ULONG_PTR) / sizeof (ULONG);
+            /* FALLTHRU */
+
+        case 'd':
+        case 'u':
+        case 'o':
+        case 'x':
+        case 'X': {
+            CHAR    Buffer[23]; // Enough for 8 bytes in octal plus the NUL terminator
+            ULONG   Length;
+            ULONG   Index;
+
+            if (Long == 2)
+                FORMAT_NUMBER(Arguments, LONGLONG, Character, Buffer);
+            else
+                FORMAT_NUMBER(Arguments, LONG, Character, Buffer);
+
+            Length = (ULONG)strlen(Buffer);
+            if (!OppositeJustification) {
+                while (Pad > Length) {
+                    status = __StringPut(String, (ZeroPrefix) ? '0' : ' ');
+                    if (!NT_SUCCESS(status))
+                        goto done;
+
+                    --Pad;
+                }
+            }
+
+            for (Index = 0; Index < Length; Index++) {
+                status = __StringPut(String, Buffer[Index]);
+                if (!NT_SUCCESS(status))
+                    goto done;
+            }
+
+            if (OppositeJustification) {
+                while (Pad > Length) {
+                    status = __StringPut(String, ' ');
+                    if (!NT_SUCCESS(status))
+                        goto done;
+
+                    --Pad;
+                }
+            }
+
+            break;
+        }
+        case 's': {
+            if (Wide) {
+                PWCHAR  Value = va_arg(Arguments, PWCHAR);
+                ULONG   Length;
+                ULONG   Index;
+
+                if (Value == NULL)
+                    Value = L"(null)";
+
+                Length = (ULONG)wcslen(Value);
+
+                if (OppositeJustification) {
+                    while (Pad > Length) {
+                        status = __StringPut(String, ' ');
+                        if (!NT_SUCCESS(status))
+                            goto done;
+
+                        --Pad;
+                    }
+                }
+
+                for (Index = 0; Index < Length; Index++) {
+                    status = __StringPut(String, (CHAR)Value[Index]);
+                    if (!NT_SUCCESS(status))
+                        goto done;
+                }
+
+                if (!OppositeJustification) {
+                    while (Pad > Length) {
+                        status = __StringPut(String, ' ');
+                        if (!NT_SUCCESS(status))
+                            goto done;
+
+                        --Pad;
+                    }
+                }
+            } else {
+                PCHAR   Value = va_arg(Arguments, PCHAR);
+                ULONG   Length;
+                ULONG   Index;
+
+                if (Value == NULL)
+                    Value = "(null)";
+
+                Length = (ULONG)strlen(Value);
+
+                if (OppositeJustification) {
+                    while (Pad > Length) {
+                        status = __StringPut(String, ' ');
+                        if (!NT_SUCCESS(status))
+                            goto done;
+
+                        --Pad;
+                    }
+                }
+
+                for (Index = 0; Index < Length; Index++) {
+                    status = __StringPut(String, Value[Index]);
+                    if (!NT_SUCCESS(status))
+                        goto done;
+                }
+
+                if (!OppositeJustification) {
+                    while (Pad > Length) {
+                        status = __StringPut(String, ' ');
+                        if (!NT_SUCCESS(status))
+                            goto done;
+
+                        --Pad;
+                    }
+                }
+            }
+
+            break;
+        }
+        case 'Z': {
+            if (Wide) {
+                PUNICODE_STRING Value = va_arg(Arguments, PUNICODE_STRING);
+                PWCHAR          Buffer;
+                ULONG           Length;
+                ULONG           Index;
+
+                if (Value == NULL) {
+                    Buffer = L"(null)";
+                    Length = sizeof ("(null)") - 1;
+                } else {
+                    Buffer = Value->Buffer;
+                    Length = Value->Length / sizeof (WCHAR);
+                }
+
+                if (OppositeJustification) {
+                    while (Pad > Length) {
+                        status = __StringPut(String, ' ');
+                        if (!NT_SUCCESS(status))
+                            goto done;
+
+                        --Pad;
+                    }
+                }
+
+                for (Index = 0; Index < Length; Index++) {
+                    status = __StringPut(String, (CHAR)Buffer[Index]);
+                    if (!NT_SUCCESS(status))
+                        goto done;
+                }
+
+                if (!OppositeJustification) {
+                    while (Pad > Length) {
+                        status = __StringPut(String, ' ');
+                        if (!NT_SUCCESS(status))
+                            goto done;
+
+                        --Pad;
+                    }
+                }
+            } else {
+                PANSI_STRING Value = va_arg(Arguments, PANSI_STRING);
+                PCHAR        Buffer;
+                ULONG        Length;
+                ULONG        Index;
+
+                if (Value == NULL) {
+                    Buffer = "(null)";
+                    Length = sizeof ("(null)") - 1;
+                } else {
+                    Buffer = Value->Buffer;
+                    Length = Value->Length / sizeof (CHAR);
+                }
+
+                if (OppositeJustification) {
+                    while (Pad > Length) {
+                        status = __StringPut(String, ' ');
+                        if (!NT_SUCCESS(status))
+                            goto done;
+
+                        --Pad;
+                    }
+                }
+
+                for (Index = 0; Index < Length; Index++) {
+                    status = __StringPut(String, Buffer[Index]);
+                    if (!NT_SUCCESS(status))
+                        goto done;
+                }
+
+                if (!OppositeJustification) {
+                    while (Pad > Length) {
+                        status = __StringPut(String, ' ');
+                        if (!NT_SUCCESS(status))
+                            goto done;
+
+                        --Pad;
+                    }
+                }
+            }
+
+            break;
+        }
+        default:
+            status = __StringPut(String, Character);
+            if (!NT_SUCCESS(status))
+                goto done;
+
+            break;
+        }
+    }
+
+done:
+    return status;
+}
+
+NTSTATUS
+StringVPrintf(
+    IN  PSTRING     String,
+    IN  const CHAR  *Format,
+    IN  va_list     Arguments
+    )
+{
+    NTSTATUS        status;
+
+    status = StringWriteBuffer(String,
+                               Format,
+                               Arguments);
+    if (!NT_SUCCESS(status))
+        goto fail1;
+
+    status = __StringPut(String, '\0');
+    if (!NT_SUCCESS(status))
+        goto fail2;
+
+    return STATUS_SUCCESS;
+
+fail2:
+    Error("fail2\n");
+
+fail1:
+    Error("fail1 (%08x)\n", status);
+
+    return status;
+}
+
+NTSTATUS
+StringPrintf(
+    IN  PSTRING     String,
+    IN  const CHAR  *Format,
+    ...
+    )
+{
+    va_list         Arguments;
+    NTSTATUS        status;
+
+    va_start(Arguments, Format);
+    status = StringVPrintf(String, Format, Arguments);
+    va_end(Arguments);
+
+    return status;
+}
diff --git a/src/xennet/string.h b/src/xennet/string.h
new file mode 100644
index 0000000..cc3b8d5
--- /dev/null
+++ b/src/xennet/string.h
@@ -0,0 +1,51 @@
+/* Copyright (c) Citrix Systems Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms,
+ * with or without modification, are permitted provided
+ * that the following conditions are met:
+ *
+ * *   Redistributions of source code must retain the above
+ *     copyright notice, this list of conditions and the
+ *     following disclaimer.
+ * *   Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the
+ *     following disclaimer in the documentation and/or other
+ *     materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _XENNET_STRING_H
+#define _XENNET_STRING_H
+
+#include <ntddk.h>
+
+extern NTSTATUS
+StringVPrintf(
+    IN  PSTRING     String,
+    IN  const CHAR  *Format,
+    IN  va_list     Arguments
+    );
+
+extern NTSTATUS
+StringPrintf(
+    IN  PSTRING     String,
+    IN  const CHAR  *Format,
+    ...
+    );
+
+#endif  // _XENNET_STRING_H
diff --git a/vs2012/xennet/xennet.vcxproj b/vs2012/xennet/xennet.vcxproj
index e80bcb1..054b4a6 100644
--- a/vs2012/xennet/xennet.vcxproj
+++ b/vs2012/xennet/xennet.vcxproj
@@ -75,9 +75,9 @@
 	<ItemGroup>
 		<ClCompile Include="../../src/xennet/adapter.c" />
 		<ClCompile Include="../../src/xennet/driver.c" />
-		<ClCompile Include="../../src/xennet/link.c" />
 		<ClCompile Include="../../src/xennet/miniport.c" />
 		<ClCompile Include="../../src/xennet/receiver.c" />
+		<ClCompile Include="../../src/xennet/string.c" />
 		<ClCompile Include="../../src/xennet/transmitter.c" />
 	</ItemGroup>
 	<ItemGroup>
diff --git a/vs2013/xennet/xennet.vcxproj b/vs2013/xennet/xennet.vcxproj
index bcc6025..58f4032 100644
--- a/vs2013/xennet/xennet.vcxproj
+++ b/vs2013/xennet/xennet.vcxproj
@@ -70,9 +70,9 @@
   <ItemGroup>
     <ClCompile Include="../../src/xennet/adapter.c" />
     <ClCompile Include="../../src/xennet/driver.c" />
-    <ClCompile Include="../../src/xennet/link.c" />
     <ClCompile Include="../../src/xennet/miniport.c" />
     <ClCompile Include="../../src/xennet/receiver.c" />
+    <ClCompile Include="../../src/xennet/string.c" />
     <ClCompile Include="../../src/xennet/transmitter.c" />
   </ItemGroup>
   <ItemGroup>
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Thu Jan 28 18:02:43 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 28 Jan 2016 18:02:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aOqu0-0002hS-V0; Thu, 28 Jan 2016 18:02:40 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aOqtz-0002hN-B4
	for win-pv-devel@lists.xenproject.org; Thu, 28 Jan 2016 18:02:39 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	D5/E7-09708-EB75AA65; Thu, 28 Jan 2016 18:02:38 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1454004157!12680674!1
X-Originating-IP: [74.125.82.52]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2699 invoked from network); 28 Jan 2016 18:02:37 -0000
Received: from mail-wm0-f52.google.com (HELO mail-wm0-f52.google.com)
	(74.125.82.52)
	by server-4.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 28 Jan 2016 18:02:37 -0000
Received: by mail-wm0-f52.google.com with SMTP id l66so22400717wml.0
	for <win-pv-devel@lists.xenproject.org>;
	Thu, 28 Jan 2016 10:02:37 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=kEJNGtP2QIRqa6TuBBFj9zTD5XVhqi9z7LPclvX3LZ0=;
	b=e8ltotQ/Gn+VWL2Wg+MEZXwRneSfboSYJ2/LGpA2Ps/YtZ1FBRqNhSP7blhuF3wErT
	We/PMErnespwO5pzDjX7j6gk58dVR7XojV0qzypsa+SV7vkRJhmW0/3oOgfXm6YQ8d+P
	YdUDsfsSDmcd44svFYwaO8+WbG1huxtBl62lZL/jukWo57EIAJ8saIHgKZq16slKkj2H
	/nIlHTc0/oE9QFAJxeLC0NLv6tAzKzjl00Xnn4I62VaVGO6r586rnXjHSyYA24PkZuOm
	PwnPB98V5b4xIDa/bVJnFTBc3h0w5uhN6JBs22U2HcnruY2lMMCm/DGMlM4HES66ewWT
	N/Dg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id;
	bh=kEJNGtP2QIRqa6TuBBFj9zTD5XVhqi9z7LPclvX3LZ0=;
	b=emIVevq+CrVJX6cKvRSO5FL7J2b24AvFwHeq06Vs5VW9ZavbhwUdi5ycwhG8PGHGYD
	skNxUDBGlF3r/rRw0ZptinlnbCS+nxkUp4ykSUXT2nymeDENkC7oPeAHnokPTLacOZsh
	vO8fPEhH27tDessrR7fhS7mnBlaALQFyW2rdrylndU5ZDlMM9M1m6dhmQB6TX2j/H1uf
	JcYAdg//Rk7j9+5Kd5spW5KPIUF6o3hXANJ9g7OTssRO5eQRulzK7h6/wZ5Pi1/Ur8FW
	xO4tV78nB+5/i72VmS+1ryf4kF3pDSBTjX3dgsl6NKEYGe44l8mc4ETf6V7Bp3AlIJbu
	lTpA==
X-Gm-Message-State: AG10YOQ4U2y3fxvKrngNFCQBZWLw/iD+kyTMJdWYgFvbu6MmcsgDDFtMl81xDzW9RDZcSw==
X-Received: by 10.28.133.141 with SMTP id h135mr4403057wmd.70.1454004156922;
	Thu, 28 Jan 2016 10:02:36 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	i196sm3912700wmf.23.2016.01.28.10.02.36
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Thu, 28 Jan 2016 10:02:36 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Thu, 28 Jan 2016 18:02:26 +0000
Message-Id: <1454004146-11088-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH] Use a locally defined StringPrintf
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Use of the _snprintf_s symbol fails on Windows 10, where it appears not to
be exported from ntdll. So, for portability's sake it is more robust to
implement a StringPrintf function locally.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xennet/adapter.c         |  52 ++---
 src/xennet/link.c            | 250 -----------------------
 src/xennet/link.h            |  42 ----
 src/xennet/string.c          | 464 +++++++++++++++++++++++++++++++++++++++++++
 src/xennet/string.h          |  51 +++++
 vs2012/xennet/xennet.vcxproj |   2 +-
 vs2013/xennet/xennet.vcxproj |   2 +-
 7 files changed, 538 insertions(+), 325 deletions(-)
 delete mode 100644 src/xennet/link.c
 delete mode 100644 src/xennet/link.h
 create mode 100644 src/xennet/string.c
 create mode 100644 src/xennet/string.h

diff --git a/src/xennet/adapter.c b/src/xennet/adapter.c
index dc69a7f..ea54871 100644
--- a/src/xennet/adapter.c
+++ b/src/xennet/adapter.c
@@ -45,7 +45,7 @@
 #include "util.h"
 #include "dbg_print.h"
 #include "assert.h"
-#include "link.h"
+#include "string.h"
 
 #define MAXNAMELEN  128
 
@@ -81,12 +81,6 @@ struct _XENNET_ADAPTER {
     PXENNET_RECEIVER            Receiver;
     PXENNET_TRANSMITTER         Transmitter;
     BOOLEAN                     Enabled;
-
-    NTSTATUS                    (*_snprintf_s)(char *,
-                                               size_t,
-                                               size_t,
-                                               const char *,
-                                               ...);
 };
 
 static LONG AdapterCount;
@@ -1308,6 +1302,7 @@ __AdapterSetDistribution(
     ULONG               Index;
     CHAR                Distribution[MAXNAMELEN];
     CHAR                Vendor[MAXNAMELEN];
+    STRING              String;
     const CHAR          *Product;
     NTSTATUS            status;
 
@@ -1317,11 +1312,14 @@ __AdapterSetDistribution(
     while (Index <= MAXIMUM_INDEX) {
         PCHAR   Buffer;
 
-        (VOID) Adapter->_snprintf_s(Distribution,
-                                    MAXNAMELEN,
-                                    _TRUNCATE,
-                                    "%u",
-                                    Index);
+        String.Buffer = Distribution;
+        String.MaximumLength = sizeof (Distribution);
+        String.Length = 0;
+
+        status = StringPrintf(&String,
+                              "%u",
+                              Index);
+        ASSERT(NT_SUCCESS(status));
 
         status = XENBUS_STORE(Read,
                               &Adapter->StoreInterface,
@@ -1347,11 +1345,14 @@ __AdapterSetDistribution(
     goto fail2;
 
 update:
-    (VOID) Adapter->_snprintf_s(Vendor,
-                                MAXNAMELEN,
-                                _TRUNCATE,
-                                "%s",
-                                VENDOR_NAME_STR);
+    String.Buffer = Vendor;
+    String.MaximumLength = sizeof (Vendor);
+    String.Length = 0;
+
+    status = StringPrintf(&String,
+                          "%s",
+                          VENDOR_NAME_STR);
+    ASSERT(NT_SUCCESS(status));
 
     for (Index  = 0; Vendor[Index] != '\0'; Index++)
         if (!isalnum((UCHAR)Vendor[Index]))
@@ -1490,22 +1491,16 @@ AdapterEnable(
     if (!NT_SUCCESS(status))
         goto fail2;
 
-    status = LinkGetRoutineAddress("ntdll.dll",
-                                   "_snprintf_s",
-                                   (PVOID *)&Adapter->_snprintf_s);
-    if (!NT_SUCCESS(status))
-        goto fail3;
-
     status = AdapterSetDistribution(Adapter);
     if (!NT_SUCCESS(status))
-        goto fail4;
+        goto fail3;
 
     status = XENVIF_VIF(Enable,
                         &Adapter->VifInterface,
                         AdapterVifCallback,
                         Adapter);
     if (!NT_SUCCESS(status))
-        goto fail5;
+        goto fail4;
 
     AdapterMediaStateChange(Adapter);
 
@@ -1513,11 +1508,8 @@ AdapterEnable(
 
     return NDIS_STATUS_SUCCESS;
 
-fail5:
-    AdapterClearDistribution(Adapter);
-
 fail4:
-    Adapter->_snprintf_s = NULL;
+    AdapterClearDistribution(Adapter);
 
 fail3:
     XENBUS_SUSPEND(Release, &Adapter->SuspendInterface);
@@ -1544,8 +1536,6 @@ AdapterDisable(
 
     AdapterClearDistribution(Adapter);
 
-    Adapter->_snprintf_s = NULL;
-
     XENBUS_SUSPEND(Release, &Adapter->SuspendInterface);
     XENBUS_STORE(Release, &Adapter->StoreInterface);
 }
diff --git a/src/xennet/link.c b/src/xennet/link.c
deleted file mode 100644
index e2a41bc..0000000
--- a/src/xennet/link.c
+++ /dev/null
@@ -1,250 +0,0 @@
-/* Copyright (c) Citrix Systems Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms,
- * with or without modification, are permitted provided
- * that the following conditions are met:
- *
- * *   Redistributions of source code must retain the above
- *     copyright notice, this list of conditions and the
- *     following disclaimer.
- * *   Redistributions in binary form must reproduce the above
- *     copyright notice, this list of conditions and the
- *     following disclaimer in the documentation and/or other
- *     materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <ntddk.h>
-#include <aux_klib.h>
-
-#include "link.h"
-#include "dbg_print.h"
-#include "assert.h"
-#include "util.h"
-
-#define LINK_TAG    'KNIL'
-
-static FORCEINLINE PVOID
-__LinkAllocate(
-    IN  ULONG   Length
-    )
-{
-    return __AllocatePoolWithTag(NonPagedPool, Length, LINK_TAG);
-}
-
-static FORCEINLINE VOID
-__LinkFree(
-    IN  PVOID   Buffer
-    )
-{
-    __FreePoolWithTag(Buffer, LINK_TAG);
-}
-
-static FORCEINLINE NTSTATUS
-__LinkGetImageBase(
-    IN  const CHAR              *ModuleName,
-    OUT PVOID                   *ImageBase
-    )
-{
-    ULONG                       BufferSize;
-    ULONG                       Count;
-    PAUX_MODULE_EXTENDED_INFO   QueryInfo;
-    ULONG                       Index;
-    NTSTATUS                    status;
-
-    Trace("====>\n");
-
-    status = AuxKlibInitialize();
-    if (!NT_SUCCESS(status))
-        goto fail1;
-
-    status = AuxKlibQueryModuleInformation(&BufferSize,
-                                           sizeof (AUX_MODULE_EXTENDED_INFO),
-                                           NULL);
-    if (!NT_SUCCESS(status))
-        goto fail2;
-
-    status = STATUS_UNSUCCESSFUL;
-    if (BufferSize == 0)
-        goto fail3;
-
-again:
-    Count = BufferSize / sizeof (AUX_MODULE_EXTENDED_INFO);
-    QueryInfo = __LinkAllocate(sizeof (AUX_MODULE_EXTENDED_INFO) * Count);
-
-    status = STATUS_NO_MEMORY;
-    if (QueryInfo == NULL)
-        goto fail4;
-
-    status = AuxKlibQueryModuleInformation(&BufferSize,
-                                           sizeof (AUX_MODULE_EXTENDED_INFO),
-                                           QueryInfo);
-    if (!NT_SUCCESS(status)) {
-        if (status != STATUS_BUFFER_TOO_SMALL)
-            goto fail5;
-
-        __LinkFree(QueryInfo);
-        goto again;
-    }
-
-    for (Index = 0; Index < Count; Index++) {
-        PCHAR   Name;
-
-        Name = strrchr((const CHAR *)QueryInfo[Index].FullPathName, '\\');
-        Name = (Name == NULL) ? (PCHAR)QueryInfo[Index].FullPathName : (Name + 1);
-
-        if (_stricmp(Name, ModuleName) == 0)
-            goto found;
-    }
-
-    status = STATUS_UNSUCCESSFUL;
-    goto fail6;
-
-found:
-    *ImageBase = QueryInfo[Index].BasicInfo.ImageBase;
-
-    __LinkFree(QueryInfo);
-
-    Trace("<====\n");
-
-    return STATUS_SUCCESS;
-
-fail6:
-    Error("fail6\n");
-
-fail5:
-    Error("fail5\n");
-
-    __LinkFree(QueryInfo);
-
-fail4:
-    Error("fail4\n");
-
-fail3:
-    Error("fail3\n");
-
-fail2:
-    Error("fail2\n");
-
-fail1:
-    Error("fail1 (%08x)\n", status);
-
-    return status;
-}
-
-NTSTATUS
-LinkGetRoutineAddress(
-    IN  const CHAR  *ModuleName,
-    IN  const CHAR  *FunctionName,
-    OUT PVOID       *Address
-    )
-{
-#define MK_PTR(_ImageBase, _Type, _RVA) \
-    (_Type)((ULONG_PTR)(_ImageBase) + (_RVA))
-
-    PVOID                       ImageBase;
-    PIMAGE_DOS_HEADER           DosHeader;
-    PIMAGE_NT_HEADERS           NtHeaders;
-    PIMAGE_OPTIONAL_HEADER      OptionalHeader;
-    PIMAGE_DATA_DIRECTORY       Entry;
-    PIMAGE_EXPORT_DIRECTORY     Exports;
-    PULONG                      AddressOfFunctions;
-    PULONG                      AddressOfNames;
-    PUSHORT                     AddressOfNameOrdinals;
-    ULONG                       Index;
-    USHORT                      Ordinal;
-    PVOID                       Function;
-    NTSTATUS                    status;
-
-    Trace("====>\n");
-
-    status = __LinkGetImageBase(ModuleName, &ImageBase);
-    if (!NT_SUCCESS(status))
-        goto fail1;
-
-    DosHeader = MK_PTR(ImageBase, PIMAGE_DOS_HEADER, 0);
-    ASSERT3U(DosHeader->e_magic, ==, IMAGE_DOS_SIGNATURE);
-
-    NtHeaders = MK_PTR(ImageBase, PIMAGE_NT_HEADERS, DosHeader->e_lfanew);
-    ASSERT3U(NtHeaders->Signature, ==, IMAGE_NT_SIGNATURE);
-
-    OptionalHeader = &NtHeaders->OptionalHeader;
-    ASSERT3U(OptionalHeader->Magic, ==, IMAGE_NT_OPTIONAL_HDR_MAGIC);
-
-    Entry = &OptionalHeader->DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT];
-
-    status = STATUS_UNSUCCESSFUL;
-    if (Entry->Size == 0)
-        goto fail2;
-
-    Exports = MK_PTR(ImageBase, PIMAGE_EXPORT_DIRECTORY,
-                     Entry->VirtualAddress);
-
-    status = STATUS_UNSUCCESSFUL;
-    if (Exports->NumberOfNames == 0)
-        goto fail3;
-
-    AddressOfFunctions = MK_PTR(ImageBase, PULONG,
-                                Exports->AddressOfFunctions);
-    AddressOfNames = MK_PTR(ImageBase, PULONG,
-                            Exports->AddressOfNames);
-    AddressOfNameOrdinals = MK_PTR(ImageBase, PUSHORT,
-                                   Exports->AddressOfNameOrdinals);
-
-    for (Index = 0; Index < Exports->NumberOfNames; Index++) {
-        PCHAR   Name = MK_PTR(ImageBase, PCHAR, AddressOfNames[Index]);
-
-        Ordinal = AddressOfNameOrdinals[Index];
-        Function = MK_PTR(ImageBase, PVOID, AddressOfFunctions[Ordinal]);
-
-        if (strcmp(Name, FunctionName) == 0)
-            goto found;
-    }
-
-    status = STATUS_UNSUCCESSFUL;
-    goto fail4;
-
-found:
-    *Address = Function;
-
-    Trace("%s:%s (%04X) @ %p\n",
-          ModuleName,
-          FunctionName,
-          Ordinal,
-          Function);
-
-    Trace("<====\n");
-
-    return STATUS_SUCCESS;
-
-fail4:
-    Error("fail4\n");
-
-fail3:
-    Error("fail3\n");
-
-fail2:
-    Error("fail2\n");
-
-fail1:
-    Error("fail1 (%08x)\n", status);
-
-    return status;
-
-#undef  MK_PTR
-}
diff --git a/src/xennet/link.h b/src/xennet/link.h
deleted file mode 100644
index 9e4b564..0000000
--- a/src/xennet/link.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Copyright (c) Citrix Systems Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms,
- * with or without modification, are permitted provided
- * that the following conditions are met:
- *
- * *   Redistributions of source code must retain the above
- *     copyright notice, this list of conditions and the
- *     following disclaimer.
- * *   Redistributions in binary form must reproduce the above
- *     copyright notice, this list of conditions and the
- *     following disclaimer in the documentation and/or other
- *     materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef _XENNET_LINK_H
-#define _XENNET_LINK_H
-
-extern NTSTATUS
-LinkGetRoutineAddress(
-    IN  const CHAR  *ModuleName,
-    IN  const CHAR  *FunctionName,
-    OUT PVOID       *Address
-     );
-
-#endif  // _XENVIF_LINK_H
diff --git a/src/xennet/string.c b/src/xennet/string.c
new file mode 100644
index 0000000..ff0d003
--- /dev/null
+++ b/src/xennet/string.c
@@ -0,0 +1,464 @@
+/* Copyright (c) Citrix Systems Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms,
+ * with or without modification, are permitted provided
+ * that the following conditions are met:
+ *
+ * *   Redistributions of source code must retain the above
+ *     copyright notice, this list of conditions and the
+ *     following disclaimer.
+ * *   Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the
+ *     following disclaimer in the documentation and/or other
+ *     materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#pragma warning(disable:4152)   // nonstandard extension, function/data pointer conversion in expression
+
+#include <ntddk.h>
+
+#include "string.h"
+#include "dbg_print.h"
+#include "assert.h"
+
+static FORCEINLINE NTSTATUS
+__StringPut(
+    IN  PSTRING String,
+    IN  CHAR    Character
+    )
+{
+    if (String->Length >= String->MaximumLength - 1)
+        return STATUS_BUFFER_OVERFLOW;
+
+    String->Buffer[String->Length++] = Character;
+    return STATUS_SUCCESS;
+}
+
+static PCHAR
+FormatNumber(
+    IN  PCHAR       Buffer,
+    IN  ULONGLONG   Value,
+    IN  UCHAR       Base,
+    IN  BOOLEAN     UpperCase
+    )
+{
+    ULONGLONG       Next = Value / Base;
+
+    if (Next != 0)
+        Buffer = FormatNumber(Buffer, Next, Base, UpperCase);
+
+    Value %= Base;
+
+    if (Value < 10)
+        *Buffer++ = '0' + (CHAR)Value;
+    else
+        *Buffer++ = ((UpperCase) ? 'A' : 'a') + (CHAR)(Value - 10);
+
+    *Buffer = '\0';
+
+    return Buffer;
+}
+
+#define FORMAT_NUMBER(_Arguments, _Type, _Character, _Buffer)                               \
+        do {                                                                                \
+            U ## _Type  _Value = va_arg((_Arguments), U ## _Type);                          \
+            BOOLEAN     _UpperCase = FALSE;                                                 \
+            UCHAR       _Base = 0;                                                          \
+            ULONG       _Index = 0;                                                         \
+                                                                                            \
+            if ((_Character) == 'd' && (_Type)_Value < 0) {                                 \
+                _Value = -((_Type)_Value);                                                  \
+                (_Buffer)[_Index++] = '-';                                                  \
+            }                                                                               \
+                                                                                            \
+            switch (_Character) {                                                           \
+            case 'o':                                                                       \
+                _Base = 8;                                                                  \
+                break;                                                                      \
+                                                                                            \
+            case 'd':                                                                       \
+            case 'u':                                                                       \
+                _Base = 10;                                                                 \
+                break;                                                                      \
+                                                                                            \
+            case 'p':                                                                       \
+            case 'X':                                                                       \
+                _UpperCase = TRUE;                                                          \
+                /* FALLTHRU */                                                              \
+                                                                                            \
+            case 'x':                                                                       \
+                _Base = 16;                                                                 \
+                break;                                                                      \
+            }                                                                               \
+                                                                                            \
+            (VOID) FormatNumber(&(_Buffer)[_Index], (ULONGLONG)_Value, _Base, _UpperCase);  \
+        } while (FALSE)
+
+static NTSTATUS
+StringWriteBuffer(
+    IN  PSTRING         String,
+    IN  const CHAR      *Format,
+    IN  va_list         Arguments
+    )
+{
+    CHAR                Character;
+    NTSTATUS            status;
+
+    status = STATUS_SUCCESS;
+
+    while ((Character = *Format++) != '\0') {
+        UCHAR   Pad = 0;
+        UCHAR   Long = 0;
+        BOOLEAN Wide = FALSE;
+        BOOLEAN ZeroPrefix = FALSE;
+        BOOLEAN OppositeJustification = FALSE;
+
+        if (Character != '%') {
+            status = __StringPut(String, Character);
+            if (!NT_SUCCESS(status))
+                goto done;
+
+            continue;
+        }
+
+        Character = *Format++;
+        ASSERT(Character != '\0');
+
+        if (Character == '-') {
+            OppositeJustification = TRUE;
+            Character = *Format++;
+            ASSERT(Character != '\0');
+        }
+
+        if (isdigit((unsigned char)Character)) {
+            ZeroPrefix = (Character == '0') ? TRUE : FALSE;
+
+            while (isdigit((unsigned char)Character)) {
+                Pad = (Pad * 10) + (Character - '0');
+                Character = *Format++;
+                ASSERT(Character != '\0');
+            }
+        }
+
+        while (Character == 'l') {
+            Long++;
+            Character = *Format++;
+            ASSERT(Character == 'd' ||
+                   Character == 'u' ||
+                   Character == 'o' ||
+                   Character == 'x' ||
+                   Character == 'X' ||
+                   Character == 'l');
+        }
+        ASSERT3U(Long, <=, 2);
+
+        while (Character == 'w') {
+            Wide = TRUE;
+            Character = *Format++;
+            ASSERT(Character == 'c' ||
+                   Character == 's' ||
+                   Character == 'Z');
+        }
+
+        switch (Character) {
+        case 'c': {
+            if (Wide) {
+                WCHAR   Value;
+                Value = va_arg(Arguments, WCHAR);
+
+                status = __StringPut(String, (CHAR)Value);
+                if (!NT_SUCCESS(status))
+                    goto done;
+            } else {
+                CHAR    Value;
+
+                Value = va_arg(Arguments, CHAR);
+
+                status = __StringPut(String, Value);
+                if (!NT_SUCCESS(status))
+                    goto done;
+            }
+            break;
+        }
+        case 'p':
+            ZeroPrefix = TRUE;
+            Pad = sizeof (ULONG_PTR) * 2;
+            Long = sizeof (ULONG_PTR) / sizeof (ULONG);
+            /* FALLTHRU */
+
+        case 'd':
+        case 'u':
+        case 'o':
+        case 'x':
+        case 'X': {
+            CHAR    Buffer[23]; // Enough for 8 bytes in octal plus the NUL terminator
+            ULONG   Length;
+            ULONG   Index;
+
+            if (Long == 2)
+                FORMAT_NUMBER(Arguments, LONGLONG, Character, Buffer);
+            else
+                FORMAT_NUMBER(Arguments, LONG, Character, Buffer);
+
+            Length = (ULONG)strlen(Buffer);
+            if (!OppositeJustification) {
+                while (Pad > Length) {
+                    status = __StringPut(String, (ZeroPrefix) ? '0' : ' ');
+                    if (!NT_SUCCESS(status))
+                        goto done;
+
+                    --Pad;
+                }
+            }
+
+            for (Index = 0; Index < Length; Index++) {
+                status = __StringPut(String, Buffer[Index]);
+                if (!NT_SUCCESS(status))
+                    goto done;
+            }
+
+            if (OppositeJustification) {
+                while (Pad > Length) {
+                    status = __StringPut(String, ' ');
+                    if (!NT_SUCCESS(status))
+                        goto done;
+
+                    --Pad;
+                }
+            }
+
+            break;
+        }
+        case 's': {
+            if (Wide) {
+                PWCHAR  Value = va_arg(Arguments, PWCHAR);
+                ULONG   Length;
+                ULONG   Index;
+
+                if (Value == NULL)
+                    Value = L"(null)";
+
+                Length = (ULONG)wcslen(Value);
+
+                if (OppositeJustification) {
+                    while (Pad > Length) {
+                        status = __StringPut(String, ' ');
+                        if (!NT_SUCCESS(status))
+                            goto done;
+
+                        --Pad;
+                    }
+                }
+
+                for (Index = 0; Index < Length; Index++) {
+                    status = __StringPut(String, (CHAR)Value[Index]);
+                    if (!NT_SUCCESS(status))
+                        goto done;
+                }
+
+                if (!OppositeJustification) {
+                    while (Pad > Length) {
+                        status = __StringPut(String, ' ');
+                        if (!NT_SUCCESS(status))
+                            goto done;
+
+                        --Pad;
+                    }
+                }
+            } else {
+                PCHAR   Value = va_arg(Arguments, PCHAR);
+                ULONG   Length;
+                ULONG   Index;
+
+                if (Value == NULL)
+                    Value = "(null)";
+
+                Length = (ULONG)strlen(Value);
+
+                if (OppositeJustification) {
+                    while (Pad > Length) {
+                        status = __StringPut(String, ' ');
+                        if (!NT_SUCCESS(status))
+                            goto done;
+
+                        --Pad;
+                    }
+                }
+
+                for (Index = 0; Index < Length; Index++) {
+                    status = __StringPut(String, Value[Index]);
+                    if (!NT_SUCCESS(status))
+                        goto done;
+                }
+
+                if (!OppositeJustification) {
+                    while (Pad > Length) {
+                        status = __StringPut(String, ' ');
+                        if (!NT_SUCCESS(status))
+                            goto done;
+
+                        --Pad;
+                    }
+                }
+            }
+
+            break;
+        }
+        case 'Z': {
+            if (Wide) {
+                PUNICODE_STRING Value = va_arg(Arguments, PUNICODE_STRING);
+                PWCHAR          Buffer;
+                ULONG           Length;
+                ULONG           Index;
+
+                if (Value == NULL) {
+                    Buffer = L"(null)";
+                    Length = sizeof ("(null)") - 1;
+                } else {
+                    Buffer = Value->Buffer;
+                    Length = Value->Length / sizeof (WCHAR);
+                }
+
+                if (OppositeJustification) {
+                    while (Pad > Length) {
+                        status = __StringPut(String, ' ');
+                        if (!NT_SUCCESS(status))
+                            goto done;
+
+                        --Pad;
+                    }
+                }
+
+                for (Index = 0; Index < Length; Index++) {
+                    status = __StringPut(String, (CHAR)Buffer[Index]);
+                    if (!NT_SUCCESS(status))
+                        goto done;
+                }
+
+                if (!OppositeJustification) {
+                    while (Pad > Length) {
+                        status = __StringPut(String, ' ');
+                        if (!NT_SUCCESS(status))
+                            goto done;
+
+                        --Pad;
+                    }
+                }
+            } else {
+                PANSI_STRING Value = va_arg(Arguments, PANSI_STRING);
+                PCHAR        Buffer;
+                ULONG        Length;
+                ULONG        Index;
+
+                if (Value == NULL) {
+                    Buffer = "(null)";
+                    Length = sizeof ("(null)") - 1;
+                } else {
+                    Buffer = Value->Buffer;
+                    Length = Value->Length / sizeof (CHAR);
+                }
+
+                if (OppositeJustification) {
+                    while (Pad > Length) {
+                        status = __StringPut(String, ' ');
+                        if (!NT_SUCCESS(status))
+                            goto done;
+
+                        --Pad;
+                    }
+                }
+
+                for (Index = 0; Index < Length; Index++) {
+                    status = __StringPut(String, Buffer[Index]);
+                    if (!NT_SUCCESS(status))
+                        goto done;
+                }
+
+                if (!OppositeJustification) {
+                    while (Pad > Length) {
+                        status = __StringPut(String, ' ');
+                        if (!NT_SUCCESS(status))
+                            goto done;
+
+                        --Pad;
+                    }
+                }
+            }
+
+            break;
+        }
+        default:
+            status = __StringPut(String, Character);
+            if (!NT_SUCCESS(status))
+                goto done;
+
+            break;
+        }
+    }
+
+done:
+    return status;
+}
+
+NTSTATUS
+StringVPrintf(
+    IN  PSTRING     String,
+    IN  const CHAR  *Format,
+    IN  va_list     Arguments
+    )
+{
+    NTSTATUS        status;
+
+    status = StringWriteBuffer(String,
+                               Format,
+                               Arguments);
+    if (!NT_SUCCESS(status))
+        goto fail1;
+
+    status = __StringPut(String, '\0');
+    if (!NT_SUCCESS(status))
+        goto fail2;
+
+    return STATUS_SUCCESS;
+
+fail2:
+    Error("fail2\n");
+
+fail1:
+    Error("fail1 (%08x)\n", status);
+
+    return status;
+}
+
+NTSTATUS
+StringPrintf(
+    IN  PSTRING     String,
+    IN  const CHAR  *Format,
+    ...
+    )
+{
+    va_list         Arguments;
+    NTSTATUS        status;
+
+    va_start(Arguments, Format);
+    status = StringVPrintf(String, Format, Arguments);
+    va_end(Arguments);
+
+    return status;
+}
diff --git a/src/xennet/string.h b/src/xennet/string.h
new file mode 100644
index 0000000..cc3b8d5
--- /dev/null
+++ b/src/xennet/string.h
@@ -0,0 +1,51 @@
+/* Copyright (c) Citrix Systems Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms,
+ * with or without modification, are permitted provided
+ * that the following conditions are met:
+ *
+ * *   Redistributions of source code must retain the above
+ *     copyright notice, this list of conditions and the
+ *     following disclaimer.
+ * *   Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the
+ *     following disclaimer in the documentation and/or other
+ *     materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _XENNET_STRING_H
+#define _XENNET_STRING_H
+
+#include <ntddk.h>
+
+extern NTSTATUS
+StringVPrintf(
+    IN  PSTRING     String,
+    IN  const CHAR  *Format,
+    IN  va_list     Arguments
+    );
+
+extern NTSTATUS
+StringPrintf(
+    IN  PSTRING     String,
+    IN  const CHAR  *Format,
+    ...
+    );
+
+#endif  // _XENNET_STRING_H
diff --git a/vs2012/xennet/xennet.vcxproj b/vs2012/xennet/xennet.vcxproj
index e80bcb1..054b4a6 100644
--- a/vs2012/xennet/xennet.vcxproj
+++ b/vs2012/xennet/xennet.vcxproj
@@ -75,9 +75,9 @@
 	<ItemGroup>
 		<ClCompile Include="../../src/xennet/adapter.c" />
 		<ClCompile Include="../../src/xennet/driver.c" />
-		<ClCompile Include="../../src/xennet/link.c" />
 		<ClCompile Include="../../src/xennet/miniport.c" />
 		<ClCompile Include="../../src/xennet/receiver.c" />
+		<ClCompile Include="../../src/xennet/string.c" />
 		<ClCompile Include="../../src/xennet/transmitter.c" />
 	</ItemGroup>
 	<ItemGroup>
diff --git a/vs2013/xennet/xennet.vcxproj b/vs2013/xennet/xennet.vcxproj
index bcc6025..58f4032 100644
--- a/vs2013/xennet/xennet.vcxproj
+++ b/vs2013/xennet/xennet.vcxproj
@@ -70,9 +70,9 @@
   <ItemGroup>
     <ClCompile Include="../../src/xennet/adapter.c" />
     <ClCompile Include="../../src/xennet/driver.c" />
-    <ClCompile Include="../../src/xennet/link.c" />
     <ClCompile Include="../../src/xennet/miniport.c" />
     <ClCompile Include="../../src/xennet/receiver.c" />
+    <ClCompile Include="../../src/xennet/string.c" />
     <ClCompile Include="../../src/xennet/transmitter.c" />
   </ItemGroup>
   <ItemGroup>
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Fri Jan 29 08:56:42 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 29 Jan 2016 08:56:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aP4rB-00029N-Ll; Fri, 29 Jan 2016 08:56:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mailinglists@websitemanagers.com.au>)
	id 1aOuog-0005HZ-Cq
	for win-pv-devel@lists.xenproject.org; Thu, 28 Jan 2016 22:13:26 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	6C/8D-31122-5829AA65; Thu, 28 Jan 2016 22:13:25 +0000
X-Env-Sender: mailinglists@websitemanagers.com.au
X-Msg-Ref: server-3.tower-21.messagelabs.com!1454019201!12303497!1
X-Originating-IP: [203.98.89.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8609 invoked from network); 28 Jan 2016 22:13:24 -0000
Received: from hammer.websitemanagers.com.au (HELO
	hammer.websitemanagers.com.au) (203.98.89.10)
	by server-3.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 28 Jan 2016 22:13:24 -0000
Received: (qmail 3884 invoked by uid 1011); 28 Jan 2016 22:13:19 -0000
Received: from 124.246.8.196 by hammer (envelope-from
	<mailinglists@websitemanagers.com.au>,
	uid 1008) with qmail-scanner-1.24 
	(clamdscan: 0.98.1/21317. spamassassin: 3.3.1.  
	Clear:RC:1(124.246.8.196):. 
	Processed in 0.031285 secs); 28 Jan 2016 22:13:19 -0000
Received: from unknown (HELO ?10.97.0.6?)
	(adamg+websitemanagers.com.au@124.246.8.196)
	by 0 with ESMTPA; 28 Jan 2016 22:13:19 -0000
To: "xen-users@lists.xen.org" <xen-users@lists.xen.org>,
	win-pv-devel@lists.xenproject.org
From: Adam Goryachev <mailinglists@websitemanagers.com.au>
Message-ID: <56AA927E.5030906@websitemanagers.com.au>
Date: Fri, 29 Jan 2016 09:13:18 +1100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.5.1
MIME-Version: 1.0
X-Mailman-Approved-At: Fri, 29 Jan 2016 08:56:41 +0000
Subject: [win-pv-devel] Windows PV Drivers
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Hi all,

I'm really confused with the current state of the Windows PV Drivers. 
AFAICT, there are/were 4 different versions:
1) GPL PV drivers (seem to be the original and current stable/commonly 
used version) signed versions from meadowcourt
2) EJB Digital (seem to be forked from GPL PV, for a time fixed various 
problems, but since 2014 no development, and not available) had signed 
drivers
3) XenServer Windows PV drivers, I've never used these, and assume they 
are signed, only work with XenServer, and restricted license. Don't see 
mention of these in most of the open source xen windows driver pages.
4) Xen Project Windows PV Driver sub project seems to be working on 
drivers - http://wiki.xenproject.org/wiki/Xen_FAQ_Drivers,_Windows "This 
project has taken the the XenServer Windows PV Drivers, re-written them 
and contributed them to the Xen Project." Currently don't seem to have 
any signed versions available, seems to be new and potentially unstable 
(how much was re-written? why? unknown, not explained on the FAQ)

Can anyone explain what is the current status of these projects?

Of specific interest to me, I'm currently using either xen 4.1 or xen 
4.4 (from debian packages) with Windows Server 2003/2008R2/2012R2. Which 
driver version and project is best (most stable, with best performance) 
for those variations?
How will this change in future?
Where is current development efforts?
If multiple projects are "current" what is the reason (benefit) in 
maintaining those multiple implementations of the "same" thing?

Regards,
Adam

-- 
Adam Goryachev Website Managers www.websitemanagers.com.au

_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Fri Jan 29 08:56:42 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 29 Jan 2016 08:56:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aP4rB-00029N-Ll; Fri, 29 Jan 2016 08:56:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mailinglists@websitemanagers.com.au>)
	id 1aOuog-0005HZ-Cq
	for win-pv-devel@lists.xenproject.org; Thu, 28 Jan 2016 22:13:26 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	6C/8D-31122-5829AA65; Thu, 28 Jan 2016 22:13:25 +0000
X-Env-Sender: mailinglists@websitemanagers.com.au
X-Msg-Ref: server-3.tower-21.messagelabs.com!1454019201!12303497!1
X-Originating-IP: [203.98.89.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8609 invoked from network); 28 Jan 2016 22:13:24 -0000
Received: from hammer.websitemanagers.com.au (HELO
	hammer.websitemanagers.com.au) (203.98.89.10)
	by server-3.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 28 Jan 2016 22:13:24 -0000
Received: (qmail 3884 invoked by uid 1011); 28 Jan 2016 22:13:19 -0000
Received: from 124.246.8.196 by hammer (envelope-from
	<mailinglists@websitemanagers.com.au>,
	uid 1008) with qmail-scanner-1.24 
	(clamdscan: 0.98.1/21317. spamassassin: 3.3.1.  
	Clear:RC:1(124.246.8.196):. 
	Processed in 0.031285 secs); 28 Jan 2016 22:13:19 -0000
Received: from unknown (HELO ?10.97.0.6?)
	(adamg+websitemanagers.com.au@124.246.8.196)
	by 0 with ESMTPA; 28 Jan 2016 22:13:19 -0000
To: "xen-users@lists.xen.org" <xen-users@lists.xen.org>,
	win-pv-devel@lists.xenproject.org
From: Adam Goryachev <mailinglists@websitemanagers.com.au>
Message-ID: <56AA927E.5030906@websitemanagers.com.au>
Date: Fri, 29 Jan 2016 09:13:18 +1100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.5.1
MIME-Version: 1.0
X-Mailman-Approved-At: Fri, 29 Jan 2016 08:56:41 +0000
Subject: [win-pv-devel] Windows PV Drivers
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Hi all,

I'm really confused with the current state of the Windows PV Drivers. 
AFAICT, there are/were 4 different versions:
1) GPL PV drivers (seem to be the original and current stable/commonly 
used version) signed versions from meadowcourt
2) EJB Digital (seem to be forked from GPL PV, for a time fixed various 
problems, but since 2014 no development, and not available) had signed 
drivers
3) XenServer Windows PV drivers, I've never used these, and assume they 
are signed, only work with XenServer, and restricted license. Don't see 
mention of these in most of the open source xen windows driver pages.
4) Xen Project Windows PV Driver sub project seems to be working on 
drivers - http://wiki.xenproject.org/wiki/Xen_FAQ_Drivers,_Windows "This 
project has taken the the XenServer Windows PV Drivers, re-written them 
and contributed them to the Xen Project." Currently don't seem to have 
any signed versions available, seems to be new and potentially unstable 
(how much was re-written? why? unknown, not explained on the FAQ)

Can anyone explain what is the current status of these projects?

Of specific interest to me, I'm currently using either xen 4.1 or xen 
4.4 (from debian packages) with Windows Server 2003/2008R2/2012R2. Which 
driver version and project is best (most stable, with best performance) 
for those variations?
How will this change in future?
Where is current development efforts?
If multiple projects are "current" what is the reason (benefit) in 
maintaining those multiple implementations of the "same" thing?

Regards,
Adam

-- 
Adam Goryachev Website Managers www.websitemanagers.com.au

_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Fri Jan 29 10:41:06 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 29 Jan 2016 10:41:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aP6UD-0002am-FZ; Fri, 29 Jan 2016 10:41:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aP6UB-0002ah-Ul
	for win-pv-devel@lists.xenproject.org; Fri, 29 Jan 2016 10:41:04 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	EC/1E-13487-FB14BA65; Fri, 29 Jan 2016 10:41:03 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1454064062!18720807!1
X-Originating-IP: [74.125.82.68]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 37532 invoked from network); 29 Jan 2016 10:41:02 -0000
Received: from mail-wm0-f68.google.com (HELO mail-wm0-f68.google.com)
	(74.125.82.68)
	by server-16.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 29 Jan 2016 10:41:02 -0000
Received: by mail-wm0-f68.google.com with SMTP id 128so6841894wmz.3
	for <win-pv-devel@lists.xenproject.org>;
	Fri, 29 Jan 2016 02:41:02 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=sUjYbxR39eBN/9ygXO6a3YZJ9If5LPTKM9EV8GhfjKI=;
	b=gpyb/IiPp9DfrbzE5160Ae0cg8Bh/kD9lEBApLhesbMpgwM1NLHnWuhtDdwYRoVJsW
	uDH7SZEQoULO11QVulZnaSeKJlFZysfzOEahuZ2/nkqrVYWIuFev+VsyjBVlZR1Ja+05
	6bsFEGh4K/GHgD8lotfAhnaDBziQVwymoTgJbVz+37H5NvkCLLf+6W6tQsOTgi8xMN0q
	rTlti87vL6YN5y9nLTdOqU/Aen9W9yS/Ihb8UNDjrKUdojs+V0sne0/0QPvuBMADUZEP
	WEWm/k1CesKmESHJuG2jiwFplVtiEliOS8URUfPj8jFe0Wkt8iNW3f5oioLvTLeUEqqj
	8wKg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id;
	bh=sUjYbxR39eBN/9ygXO6a3YZJ9If5LPTKM9EV8GhfjKI=;
	b=mWXOrRHECaqC5vYnAk8N+//2U+1wbscwn55kHTvz6HVGUQXnQq0sRKeU9RlchmUAE7
	khzBxIq6HJEDV2Hzo8sBV9GqAGaWWMHGEaXY6af7WbrEWMlntXWz3mie/sokYi+r5HML
	XWOUlMsbHgBx3OgwUvGhcE0XTSwwLdpfxi1UcN6FPSf1M2XalWQzX1hvzfKOid1hYNc0
	9NVVqlFttYZeX0r6wweG4vc+JDwWNKPrTP6bsQFCMNgMyWTARW6h0W0HKUO+kpKiaHsQ
	J+aSjDrNsbdc4vZzwfiIBzpEwdi1FbXgw197ScZnvLdVU/gnD0rfP0rpXApxCfmyp+Sp
	GApw==
X-Gm-Message-State: AG10YOQJTmHrDtOf+W0E8pWw+7ZVr22GVuePG55bB+T6iefq7TKaoipHa5UqhvKQ1sRxTA==
X-Received: by 10.28.129.202 with SMTP id c193mr7848383wmd.35.1454064062146;
	Fri, 29 Jan 2016 02:41:02 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	l67sm6845113wmf.11.2016.01.29.02.41.01
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Fri, 29 Jan 2016 02:41:01 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Fri, 29 Jan 2016 10:40:47 +0000
Message-Id: <1454064048-8976-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH 1/2] Make transmitter code the canonical
	place where multicast control...
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

...feature is handled

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xenvif/mac.c         | 28 +++++++---------------------
 src/xenvif/transmitter.c | 18 +++++++++++++++++-
 src/xenvif/transmitter.h |  5 +++++
 3 files changed, 29 insertions(+), 22 deletions(-)

diff --git a/src/xenvif/mac.c b/src/xenvif/mac.c
index 3d04670..3110dde 100644
--- a/src/xenvif/mac.c
+++ b/src/xenvif/mac.c
@@ -58,7 +58,6 @@ struct _XENVIF_MAC {
     ETHERNET_ADDRESS        BroadcastAddress;
     LIST_ENTRY              MulticastList;
     ULONG                   MulticastCount;
-    BOOLEAN                 MulticastControl;
     XENVIF_MAC_FILTER_LEVEL FilterLevel[ETHERNET_ADDRESS_TYPE_COUNT];
     XENBUS_DEBUG_INTERFACE  DebugInterface;
     PXENBUS_DEBUG_CALLBACK  DebugCallback;
@@ -391,22 +390,6 @@ MacConnect(
 
     Mac->MaximumFrameSize = (ULONG)Mtu + sizeof (ETHERNET_TAGGED_HEADER);
 
-    status = XENBUS_STORE(Read,
-                          &Mac->StoreInterface,
-                          NULL,
-                          FrontendGetBackendPath(Frontend),
-                          "feature-multicast-control",
-                          &Buffer);
-    if (!NT_SUCCESS(status)) {
-        Mac->MulticastControl = FALSE;
-    } else {
-        Mac->MulticastControl = (BOOLEAN)strtol(Buffer, NULL, 2);
-
-        XENBUS_STORE(Free,
-                     &Mac->StoreInterface,
-                     Buffer);
-    }
-
     status = XENBUS_DEBUG(Register,
                           &Mac->DebugInterface,
                           __MODULE__ "|MAC",
@@ -548,8 +531,6 @@ MacDisconnect(
                  Mac->DebugCallback);
     Mac->DebugCallback = NULL;
 
-    Mac->MulticastControl = FALSE;
-
     Mac->MaximumFrameSize = 0;
 
     RtlZeroMemory(&Mac->BroadcastAddress, sizeof (ETHERNET_ADDRESS));
@@ -971,9 +952,14 @@ MacApplyFilters(
             break;
 
         case XENVIF_MAC_FILTER_MATCHING: {
-            PLIST_ENTRY ListEntry;
+            PXENVIF_FRONTEND    Frontend;
+            PXENVIF_TRANSMITTER Transmitter;
+            PLIST_ENTRY         ListEntry;
+
+            Frontend = Mac->Frontend;
+            Transmitter = FrontendGetTransmitter(Frontend);
 
-            if (Mac->MulticastControl) {
+            if (TransmitterHasMulticastControl(Transmitter)) {
                 Allow = TRUE;
                 break;
             }
diff --git a/src/xenvif/transmitter.c b/src/xenvif/transmitter.c
index 5a70bea..7165ecc 100644
--- a/src/xenvif/transmitter.c
+++ b/src/xenvif/transmitter.c
@@ -4019,6 +4019,22 @@ fail1:
     return status;
 }
 
+static FORCEINLINE BOOLEAN
+__TransmitterHasMulticastControl(
+    IN  PXENVIF_TRANSMITTER Transmitter
+    )
+{
+    return Transmitter->MulticastControl;
+}
+
+BOOLEAN
+TransmitterHasMulticastControl(
+    IN  PXENVIF_TRANSMITTER Transmitter
+    )
+{
+    return __TransmitterHasMulticastControl(Transmitter);
+}
+
 static FORCEINLINE NTSTATUS
 __TransmitterRingQueueMulticastControl(
     IN  PXENVIF_TRANSMITTER_RING    Ring,
@@ -4034,7 +4050,7 @@ __TransmitterRingQueueMulticastControl(
     Transmitter = Ring->Transmitter;
 
     status = STATUS_NOT_SUPPORTED;
-    if (!Transmitter->MulticastControl)
+    if (!__TransmitterHasMulticastControl(Transmitter))
         goto fail1;
 
     Frontend = Transmitter->Frontend;
diff --git a/src/xenvif/transmitter.h b/src/xenvif/transmitter.h
index 31198fb..3e72b74 100644
--- a/src/xenvif/transmitter.h
+++ b/src/xenvif/transmitter.h
@@ -141,4 +141,9 @@ TransmitterQueryLargePacketSize(
     OUT PULONG                  Size
     );
 
+BOOLEAN
+TransmitterHasMulticastControl(
+    IN  PXENVIF_TRANSMITTER Transmitter
+    );
+
 #endif  // _XENVIF_TRANSMITTER_H
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Fri Jan 29 10:41:06 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 29 Jan 2016 10:41:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aP6UD-0002am-FZ; Fri, 29 Jan 2016 10:41:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aP6UB-0002ah-Ul
	for win-pv-devel@lists.xenproject.org; Fri, 29 Jan 2016 10:41:04 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	EC/1E-13487-FB14BA65; Fri, 29 Jan 2016 10:41:03 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1454064062!18720807!1
X-Originating-IP: [74.125.82.68]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 37532 invoked from network); 29 Jan 2016 10:41:02 -0000
Received: from mail-wm0-f68.google.com (HELO mail-wm0-f68.google.com)
	(74.125.82.68)
	by server-16.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 29 Jan 2016 10:41:02 -0000
Received: by mail-wm0-f68.google.com with SMTP id 128so6841894wmz.3
	for <win-pv-devel@lists.xenproject.org>;
	Fri, 29 Jan 2016 02:41:02 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=sUjYbxR39eBN/9ygXO6a3YZJ9If5LPTKM9EV8GhfjKI=;
	b=gpyb/IiPp9DfrbzE5160Ae0cg8Bh/kD9lEBApLhesbMpgwM1NLHnWuhtDdwYRoVJsW
	uDH7SZEQoULO11QVulZnaSeKJlFZysfzOEahuZ2/nkqrVYWIuFev+VsyjBVlZR1Ja+05
	6bsFEGh4K/GHgD8lotfAhnaDBziQVwymoTgJbVz+37H5NvkCLLf+6W6tQsOTgi8xMN0q
	rTlti87vL6YN5y9nLTdOqU/Aen9W9yS/Ihb8UNDjrKUdojs+V0sne0/0QPvuBMADUZEP
	WEWm/k1CesKmESHJuG2jiwFplVtiEliOS8URUfPj8jFe0Wkt8iNW3f5oioLvTLeUEqqj
	8wKg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id;
	bh=sUjYbxR39eBN/9ygXO6a3YZJ9If5LPTKM9EV8GhfjKI=;
	b=mWXOrRHECaqC5vYnAk8N+//2U+1wbscwn55kHTvz6HVGUQXnQq0sRKeU9RlchmUAE7
	khzBxIq6HJEDV2Hzo8sBV9GqAGaWWMHGEaXY6af7WbrEWMlntXWz3mie/sokYi+r5HML
	XWOUlMsbHgBx3OgwUvGhcE0XTSwwLdpfxi1UcN6FPSf1M2XalWQzX1hvzfKOid1hYNc0
	9NVVqlFttYZeX0r6wweG4vc+JDwWNKPrTP6bsQFCMNgMyWTARW6h0W0HKUO+kpKiaHsQ
	J+aSjDrNsbdc4vZzwfiIBzpEwdi1FbXgw197ScZnvLdVU/gnD0rfP0rpXApxCfmyp+Sp
	GApw==
X-Gm-Message-State: AG10YOQJTmHrDtOf+W0E8pWw+7ZVr22GVuePG55bB+T6iefq7TKaoipHa5UqhvKQ1sRxTA==
X-Received: by 10.28.129.202 with SMTP id c193mr7848383wmd.35.1454064062146;
	Fri, 29 Jan 2016 02:41:02 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	l67sm6845113wmf.11.2016.01.29.02.41.01
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Fri, 29 Jan 2016 02:41:01 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Fri, 29 Jan 2016 10:40:47 +0000
Message-Id: <1454064048-8976-1-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH 1/2] Make transmitter code the canonical
	place where multicast control...
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

...feature is handled

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xenvif/mac.c         | 28 +++++++---------------------
 src/xenvif/transmitter.c | 18 +++++++++++++++++-
 src/xenvif/transmitter.h |  5 +++++
 3 files changed, 29 insertions(+), 22 deletions(-)

diff --git a/src/xenvif/mac.c b/src/xenvif/mac.c
index 3d04670..3110dde 100644
--- a/src/xenvif/mac.c
+++ b/src/xenvif/mac.c
@@ -58,7 +58,6 @@ struct _XENVIF_MAC {
     ETHERNET_ADDRESS        BroadcastAddress;
     LIST_ENTRY              MulticastList;
     ULONG                   MulticastCount;
-    BOOLEAN                 MulticastControl;
     XENVIF_MAC_FILTER_LEVEL FilterLevel[ETHERNET_ADDRESS_TYPE_COUNT];
     XENBUS_DEBUG_INTERFACE  DebugInterface;
     PXENBUS_DEBUG_CALLBACK  DebugCallback;
@@ -391,22 +390,6 @@ MacConnect(
 
     Mac->MaximumFrameSize = (ULONG)Mtu + sizeof (ETHERNET_TAGGED_HEADER);
 
-    status = XENBUS_STORE(Read,
-                          &Mac->StoreInterface,
-                          NULL,
-                          FrontendGetBackendPath(Frontend),
-                          "feature-multicast-control",
-                          &Buffer);
-    if (!NT_SUCCESS(status)) {
-        Mac->MulticastControl = FALSE;
-    } else {
-        Mac->MulticastControl = (BOOLEAN)strtol(Buffer, NULL, 2);
-
-        XENBUS_STORE(Free,
-                     &Mac->StoreInterface,
-                     Buffer);
-    }
-
     status = XENBUS_DEBUG(Register,
                           &Mac->DebugInterface,
                           __MODULE__ "|MAC",
@@ -548,8 +531,6 @@ MacDisconnect(
                  Mac->DebugCallback);
     Mac->DebugCallback = NULL;
 
-    Mac->MulticastControl = FALSE;
-
     Mac->MaximumFrameSize = 0;
 
     RtlZeroMemory(&Mac->BroadcastAddress, sizeof (ETHERNET_ADDRESS));
@@ -971,9 +952,14 @@ MacApplyFilters(
             break;
 
         case XENVIF_MAC_FILTER_MATCHING: {
-            PLIST_ENTRY ListEntry;
+            PXENVIF_FRONTEND    Frontend;
+            PXENVIF_TRANSMITTER Transmitter;
+            PLIST_ENTRY         ListEntry;
+
+            Frontend = Mac->Frontend;
+            Transmitter = FrontendGetTransmitter(Frontend);
 
-            if (Mac->MulticastControl) {
+            if (TransmitterHasMulticastControl(Transmitter)) {
                 Allow = TRUE;
                 break;
             }
diff --git a/src/xenvif/transmitter.c b/src/xenvif/transmitter.c
index 5a70bea..7165ecc 100644
--- a/src/xenvif/transmitter.c
+++ b/src/xenvif/transmitter.c
@@ -4019,6 +4019,22 @@ fail1:
     return status;
 }
 
+static FORCEINLINE BOOLEAN
+__TransmitterHasMulticastControl(
+    IN  PXENVIF_TRANSMITTER Transmitter
+    )
+{
+    return Transmitter->MulticastControl;
+}
+
+BOOLEAN
+TransmitterHasMulticastControl(
+    IN  PXENVIF_TRANSMITTER Transmitter
+    )
+{
+    return __TransmitterHasMulticastControl(Transmitter);
+}
+
 static FORCEINLINE NTSTATUS
 __TransmitterRingQueueMulticastControl(
     IN  PXENVIF_TRANSMITTER_RING    Ring,
@@ -4034,7 +4050,7 @@ __TransmitterRingQueueMulticastControl(
     Transmitter = Ring->Transmitter;
 
     status = STATUS_NOT_SUPPORTED;
-    if (!Transmitter->MulticastControl)
+    if (!__TransmitterHasMulticastControl(Transmitter))
         goto fail1;
 
     Frontend = Transmitter->Frontend;
diff --git a/src/xenvif/transmitter.h b/src/xenvif/transmitter.h
index 31198fb..3e72b74 100644
--- a/src/xenvif/transmitter.h
+++ b/src/xenvif/transmitter.h
@@ -141,4 +141,9 @@ TransmitterQueryLargePacketSize(
     OUT PULONG                  Size
     );
 
+BOOLEAN
+TransmitterHasMulticastControl(
+    IN  PXENVIF_TRANSMITTER Transmitter
+    );
+
 #endif  // _XENVIF_TRANSMITTER_H
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Fri Jan 29 10:41:09 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 29 Jan 2016 10:41:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aP6UH-0002bC-Hh; Fri, 29 Jan 2016 10:41:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aP6UG-0002b3-2O
	for win-pv-devel@lists.xenproject.org; Fri, 29 Jan 2016 10:41:08 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	FB/A3-08977-3C14BA65; Fri, 29 Jan 2016 10:41:07 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1454064063!12812907!1
X-Originating-IP: [74.125.82.66]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12462 invoked from network); 29 Jan 2016 10:41:06 -0000
Received: from mail-wm0-f66.google.com (HELO mail-wm0-f66.google.com)
	(74.125.82.66)
	by server-15.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 29 Jan 2016 10:41:06 -0000
Received: by mail-wm0-f66.google.com with SMTP id l66so9030809wml.2
	for <win-pv-devel@lists.xenproject.org>;
	Fri, 29 Jan 2016 02:41:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:in-reply-to:references;
	bh=pTSOagbBxF9oe3KlPQ4zlNHGNJhERmo5Amui03/Yuws=;
	b=Raeu0H39My6OdkQeEAc488JPPNHbBTv5Xq+qJi5jXziAmIr2p3puga2H1XNChWFf+K
	v0KyrbTp1GDkF0rp/0wX3XVXIDSn3bQkRvlIky6nxCOR8S+DMqTa8Y37wEWsyUCeLux7
	mKB80PYO3W1nMQlWjexnNyfVXcuuJ7KSUkdbuiU1NeIs6x6kCA8RC+wdj8dTX8tNeMGa
	2ecjxVAjgV+ClhWBPShUX06rxtG7M0gvOjOtCAL7eawzjtU8YMa2fMKFYmJEPIhsqdcf
	nhpc4MBuOHQWkDEZJXxRbwHkOMxwZ82plrJ1rgHVthfe6iFi4G5/kvsUq2NpGzIabgeY
	w0Kg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
	:references;
	bh=pTSOagbBxF9oe3KlPQ4zlNHGNJhERmo5Amui03/Yuws=;
	b=JNTOSB+uO/59EzpGGP9gqxGzsE6oOXb7itc+HcCzQRrd3yypQL5WRZw9DQReAy4XVM
	BeEMFSq4t7OdlgZ6IX/8HCIJur2XX8ujQbKrtLHZkrOnARTnngQaPDTg2aFop30DCf4+
	VAXZkYnwUZxBSBp7QWzjg74IEmQd0asLKsAgRZSMpLZh+pj2OZ4osp1PSahQ03J1IYlr
	Q/+N1icmHpghqs9Q+E97fHnjYdL1MsxrF2+l1pot+wvwUyX5WkAotcjLqY8ig9c5wP5W
	41wJew1Y+dhZRVWmvpNfx6LA7RwnkbpqadBivkACgLugKkyM/QC022xOMrsV5O5BHgqg
	zjZg==
X-Gm-Message-State: AG10YOTkhOJ2K208R1IJQ79NKWDgmjDtwTasvOTIyS1J7YyUrXD0hW7fSgDeSWYU9IQc1A==
X-Received: by 10.28.22.201 with SMTP id 192mr8806925wmw.1.1454064062914;
	Fri, 29 Jan 2016 02:41:02 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	l67sm6845113wmf.11.2016.01.29.02.41.02
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Fri, 29 Jan 2016 02:41:02 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Fri, 29 Jan 2016 10:40:48 +0000
Message-Id: <1454064048-8976-2-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
In-Reply-To: <1454064048-8976-1-git-send-email-paul.durrant@citrix.com>
References: <1454064048-8976-1-git-send-email-paul.durrant@citrix.com>
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH 2/2] Dynamic multicast control
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Only use the multicast control feature of the backend if it supported
"feature-dynamic-multicast-control" otherwise attempts to enable the 'all
multicast' filter level in XENVIF will have no effect and the NDISTest 6.5
MultiCast Address test will fail.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xenvif/frontend.c    | 41 +++++++++++++++++++++++++++++++
 src/xenvif/frontend.h    |  7 ++++++
 src/xenvif/transmitter.c | 64 +++++++++++++++++++++++++++++++++++++++++++-----
 src/xenvif/transmitter.h |  6 +++++
 src/xenvif/vif.c         |  2 +-
 5 files changed, 113 insertions(+), 7 deletions(-)

diff --git a/src/xenvif/frontend.c b/src/xenvif/frontend.c
index 8f5a492..e513790 100644
--- a/src/xenvif/frontend.c
+++ b/src/xenvif/frontend.c
@@ -1119,6 +1119,47 @@ fail1:
     return status;
 }
 
+NTSTATUS
+FrontendSetFilterLevel(
+    IN  PXENVIF_FRONTEND        Frontend,
+    IN  ETHERNET_ADDRESS_TYPE   Type,
+    IN  XENVIF_MAC_FILTER_LEVEL Level
+    )
+{
+    PXENVIF_MAC                 Mac;
+    KIRQL                       Irql;
+    NTSTATUS                    status;
+
+    Mac = FrontendGetMac(Frontend);
+
+    KeRaiseIrql(DISPATCH_LEVEL, &Irql);
+
+    status = MacSetFilterLevel(Mac, Type, Level);
+    if (!NT_SUCCESS(status))
+        goto fail1;
+
+    if (Type == ETHERNET_ADDRESS_MULTICAST) {
+        PXENVIF_TRANSMITTER Transmitter;
+        BOOLEAN             Enabled;
+
+        Transmitter = FrontendGetTransmitter(Frontend);
+        Enabled = (Level != XENVIF_MAC_FILTER_ALL) ? TRUE : FALSE;
+
+        (VOID) TransmitterRequestMulticastControl(Transmitter, Enabled);
+    }
+
+    KeLowerIrql(Irql);
+
+    return STATUS_SUCCESS;
+
+fail1:
+    Error("fail1 (%08x)\n", status);
+
+    KeLowerIrql(Irql);
+
+    return status;
+}
+
 VOID
 FrontendAdvertiseIpAddresses(
     IN  PXENVIF_FRONTEND    Frontend
diff --git a/src/xenvif/frontend.h b/src/xenvif/frontend.h
index d90f977..9cac412 100644
--- a/src/xenvif/frontend.h
+++ b/src/xenvif/frontend.h
@@ -186,6 +186,13 @@ FrontendSetMulticastAddresses(
     IN  ULONG               Count
     );
 
+extern NTSTATUS
+FrontendSetFilterLevel(
+    IN  PXENVIF_FRONTEND        Frontend,
+    IN  ETHERNET_ADDRESS_TYPE   Type,
+    IN  XENVIF_MAC_FILTER_LEVEL Level
+    );
+
 extern VOID
 FrontendAdvertiseIpAddresses(
     IN  PXENVIF_FRONTEND        Frontend
diff --git a/src/xenvif/transmitter.c b/src/xenvif/transmitter.c
index 7165ecc..5289c6c 100644
--- a/src/xenvif/transmitter.c
+++ b/src/xenvif/transmitter.c
@@ -4312,7 +4312,7 @@ TransmitterConnect(
                           &Transmitter->StoreInterface,
                           NULL,
                           FrontendGetBackendPath(Frontend),
-                          "feature-multicast-control",
+                          "feature-dynamic-multicast-control",
                           &Buffer);
     if (!NT_SUCCESS(status)) {
         Transmitter->MulticastControl = FALSE;
@@ -4409,15 +4409,15 @@ fail1:
     return status;
 }
 
-NTSTATUS
-TransmitterStoreWrite(
+static FORCEINLINE NTSTATUS
+__TransmitterRequestMulticastControl(
     IN  PXENVIF_TRANSMITTER         Transmitter,
-    IN  PXENBUS_STORE_TRANSACTION   Transaction
+    IN  PXENBUS_STORE_TRANSACTION   Transaction,
+    IN  BOOLEAN                     Enabled
     )
 {
     PXENVIF_FRONTEND                Frontend;
     NTSTATUS                        status;
-    LONG                            Index;
 
     Frontend = Transmitter->Frontend;
 
@@ -4427,10 +4427,62 @@ TransmitterStoreWrite(
                           FrontendGetPath(Frontend),
                           "request-multicast-control",
                           "%u",
-                          TRUE);
+                          Enabled);
     if (!NT_SUCCESS(status))
         goto fail1;
 
+    return STATUS_SUCCESS;
+
+fail1:
+    Error("fail1 (%08x)\n", status);
+
+    return status;
+}
+
+NTSTATUS
+TransmitterRequestMulticastControl(
+    IN  PXENVIF_TRANSMITTER Transmitter,
+    IN  BOOLEAN             Enabled
+    )
+{
+    NTSTATUS                status;
+
+    status = STATUS_NOT_SUPPORTED;
+    if (!__TransmitterHasMulticastControl(Transmitter))
+        goto fail1;
+
+    status = __TransmitterRequestMulticastControl(Transmitter, NULL,
+                                                  Enabled);
+    if (!NT_SUCCESS(status))
+        goto fail2;
+
+    return STATUS_SUCCESS;
+
+fail2:
+fail1:
+    return status;
+}
+
+NTSTATUS
+TransmitterStoreWrite(
+    IN  PXENVIF_TRANSMITTER         Transmitter,
+    IN  PXENBUS_STORE_TRANSACTION   Transaction
+    )
+{
+    PXENVIF_FRONTEND                Frontend;
+    NTSTATUS                        status;
+    LONG                            Index;
+
+    Frontend = Transmitter->Frontend;
+
+    if (__TransmitterHasMulticastControl(Transmitter)) {
+        status = __TransmitterRequestMulticastControl(Transmitter,
+                                                      Transaction,
+                                                      TRUE);
+        if (!NT_SUCCESS(status))
+            goto fail1;
+    }
+
     Index = 0;
     while (Index < (LONG)FrontendGetNumQueues(Frontend)) {
         PXENVIF_TRANSMITTER_RING    Ring = Transmitter->Ring[Index];
diff --git a/src/xenvif/transmitter.h b/src/xenvif/transmitter.h
index 3e72b74..5e74667 100644
--- a/src/xenvif/transmitter.h
+++ b/src/xenvif/transmitter.h
@@ -146,4 +146,10 @@ TransmitterHasMulticastControl(
     IN  PXENVIF_TRANSMITTER Transmitter
     );
 
+NTSTATUS
+TransmitterRequestMulticastControl(
+    IN  PXENVIF_TRANSMITTER Transmitter,
+    IN  BOOLEAN             Enabled
+    );
+
 #endif  // _XENVIF_TRANSMITTER_H
diff --git a/src/xenvif/vif.c b/src/xenvif/vif.c
index 74df4ac..ce94a56 100644
--- a/src/xenvif/vif.c
+++ b/src/xenvif/vif.c
@@ -819,7 +819,7 @@ VifMacSetFilterLevel(
 
     AcquireMrswLockShared(&Context->Lock);
 
-    status = MacSetFilterLevel(FrontendGetMac(Context->Frontend), Type, Level);
+    status = FrontendSetFilterLevel(Context->Frontend, Type, Level);
 
     ReleaseMrswLockShared(&Context->Lock);
 
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Fri Jan 29 10:41:09 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 29 Jan 2016 10:41:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aP6UH-0002bC-Hh; Fri, 29 Jan 2016 10:41:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pdurrant@gmail.com>) id 1aP6UG-0002b3-2O
	for win-pv-devel@lists.xenproject.org; Fri, 29 Jan 2016 10:41:08 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	FB/A3-08977-3C14BA65; Fri, 29 Jan 2016 10:41:07 +0000
X-Env-Sender: pdurrant@gmail.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1454064063!12812907!1
X-Originating-IP: [74.125.82.66]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12462 invoked from network); 29 Jan 2016 10:41:06 -0000
Received: from mail-wm0-f66.google.com (HELO mail-wm0-f66.google.com)
	(74.125.82.66)
	by server-15.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 29 Jan 2016 10:41:06 -0000
Received: by mail-wm0-f66.google.com with SMTP id l66so9030809wml.2
	for <win-pv-devel@lists.xenproject.org>;
	Fri, 29 Jan 2016 02:41:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:in-reply-to:references;
	bh=pTSOagbBxF9oe3KlPQ4zlNHGNJhERmo5Amui03/Yuws=;
	b=Raeu0H39My6OdkQeEAc488JPPNHbBTv5Xq+qJi5jXziAmIr2p3puga2H1XNChWFf+K
	v0KyrbTp1GDkF0rp/0wX3XVXIDSn3bQkRvlIky6nxCOR8S+DMqTa8Y37wEWsyUCeLux7
	mKB80PYO3W1nMQlWjexnNyfVXcuuJ7KSUkdbuiU1NeIs6x6kCA8RC+wdj8dTX8tNeMGa
	2ecjxVAjgV+ClhWBPShUX06rxtG7M0gvOjOtCAL7eawzjtU8YMa2fMKFYmJEPIhsqdcf
	nhpc4MBuOHQWkDEZJXxRbwHkOMxwZ82plrJ1rgHVthfe6iFi4G5/kvsUq2NpGzIabgeY
	w0Kg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
	:references;
	bh=pTSOagbBxF9oe3KlPQ4zlNHGNJhERmo5Amui03/Yuws=;
	b=JNTOSB+uO/59EzpGGP9gqxGzsE6oOXb7itc+HcCzQRrd3yypQL5WRZw9DQReAy4XVM
	BeEMFSq4t7OdlgZ6IX/8HCIJur2XX8ujQbKrtLHZkrOnARTnngQaPDTg2aFop30DCf4+
	VAXZkYnwUZxBSBp7QWzjg74IEmQd0asLKsAgRZSMpLZh+pj2OZ4osp1PSahQ03J1IYlr
	Q/+N1icmHpghqs9Q+E97fHnjYdL1MsxrF2+l1pot+wvwUyX5WkAotcjLqY8ig9c5wP5W
	41wJew1Y+dhZRVWmvpNfx6LA7RwnkbpqadBivkACgLugKkyM/QC022xOMrsV5O5BHgqg
	zjZg==
X-Gm-Message-State: AG10YOTkhOJ2K208R1IJQ79NKWDgmjDtwTasvOTIyS1J7YyUrXD0hW7fSgDeSWYU9IQc1A==
X-Received: by 10.28.22.201 with SMTP id 192mr8806925wmw.1.1454064062914;
	Fri, 29 Jan 2016 02:41:02 -0800 (PST)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
	[46.102.197.194]) by smtp.gmail.com with ESMTPSA id
	l67sm6845113wmf.11.2016.01.29.02.41.02
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Fri, 29 Jan 2016 02:41:02 -0800 (PST)
From: Paul Durrant <pdurrant@gmail.com>
X-Google-Original-From: Paul Durrant <paul.durrant@citrix.com>
To: win-pv-devel@lists.xenproject.org
Date: Fri, 29 Jan 2016 10:40:48 +0000
Message-Id: <1454064048-8976-2-git-send-email-paul.durrant@citrix.com>
X-Mailer: git-send-email 2.1.1
In-Reply-To: <1454064048-8976-1-git-send-email-paul.durrant@citrix.com>
References: <1454064048-8976-1-git-send-email-paul.durrant@citrix.com>
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [win-pv-devel] [PATCH 2/2] Dynamic multicast control
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Only use the multicast control feature of the backend if it supported
"feature-dynamic-multicast-control" otherwise attempts to enable the 'all
multicast' filter level in XENVIF will have no effect and the NDISTest 6.5
MultiCast Address test will fail.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 src/xenvif/frontend.c    | 41 +++++++++++++++++++++++++++++++
 src/xenvif/frontend.h    |  7 ++++++
 src/xenvif/transmitter.c | 64 +++++++++++++++++++++++++++++++++++++++++++-----
 src/xenvif/transmitter.h |  6 +++++
 src/xenvif/vif.c         |  2 +-
 5 files changed, 113 insertions(+), 7 deletions(-)

diff --git a/src/xenvif/frontend.c b/src/xenvif/frontend.c
index 8f5a492..e513790 100644
--- a/src/xenvif/frontend.c
+++ b/src/xenvif/frontend.c
@@ -1119,6 +1119,47 @@ fail1:
     return status;
 }
 
+NTSTATUS
+FrontendSetFilterLevel(
+    IN  PXENVIF_FRONTEND        Frontend,
+    IN  ETHERNET_ADDRESS_TYPE   Type,
+    IN  XENVIF_MAC_FILTER_LEVEL Level
+    )
+{
+    PXENVIF_MAC                 Mac;
+    KIRQL                       Irql;
+    NTSTATUS                    status;
+
+    Mac = FrontendGetMac(Frontend);
+
+    KeRaiseIrql(DISPATCH_LEVEL, &Irql);
+
+    status = MacSetFilterLevel(Mac, Type, Level);
+    if (!NT_SUCCESS(status))
+        goto fail1;
+
+    if (Type == ETHERNET_ADDRESS_MULTICAST) {
+        PXENVIF_TRANSMITTER Transmitter;
+        BOOLEAN             Enabled;
+
+        Transmitter = FrontendGetTransmitter(Frontend);
+        Enabled = (Level != XENVIF_MAC_FILTER_ALL) ? TRUE : FALSE;
+
+        (VOID) TransmitterRequestMulticastControl(Transmitter, Enabled);
+    }
+
+    KeLowerIrql(Irql);
+
+    return STATUS_SUCCESS;
+
+fail1:
+    Error("fail1 (%08x)\n", status);
+
+    KeLowerIrql(Irql);
+
+    return status;
+}
+
 VOID
 FrontendAdvertiseIpAddresses(
     IN  PXENVIF_FRONTEND    Frontend
diff --git a/src/xenvif/frontend.h b/src/xenvif/frontend.h
index d90f977..9cac412 100644
--- a/src/xenvif/frontend.h
+++ b/src/xenvif/frontend.h
@@ -186,6 +186,13 @@ FrontendSetMulticastAddresses(
     IN  ULONG               Count
     );
 
+extern NTSTATUS
+FrontendSetFilterLevel(
+    IN  PXENVIF_FRONTEND        Frontend,
+    IN  ETHERNET_ADDRESS_TYPE   Type,
+    IN  XENVIF_MAC_FILTER_LEVEL Level
+    );
+
 extern VOID
 FrontendAdvertiseIpAddresses(
     IN  PXENVIF_FRONTEND        Frontend
diff --git a/src/xenvif/transmitter.c b/src/xenvif/transmitter.c
index 7165ecc..5289c6c 100644
--- a/src/xenvif/transmitter.c
+++ b/src/xenvif/transmitter.c
@@ -4312,7 +4312,7 @@ TransmitterConnect(
                           &Transmitter->StoreInterface,
                           NULL,
                           FrontendGetBackendPath(Frontend),
-                          "feature-multicast-control",
+                          "feature-dynamic-multicast-control",
                           &Buffer);
     if (!NT_SUCCESS(status)) {
         Transmitter->MulticastControl = FALSE;
@@ -4409,15 +4409,15 @@ fail1:
     return status;
 }
 
-NTSTATUS
-TransmitterStoreWrite(
+static FORCEINLINE NTSTATUS
+__TransmitterRequestMulticastControl(
     IN  PXENVIF_TRANSMITTER         Transmitter,
-    IN  PXENBUS_STORE_TRANSACTION   Transaction
+    IN  PXENBUS_STORE_TRANSACTION   Transaction,
+    IN  BOOLEAN                     Enabled
     )
 {
     PXENVIF_FRONTEND                Frontend;
     NTSTATUS                        status;
-    LONG                            Index;
 
     Frontend = Transmitter->Frontend;
 
@@ -4427,10 +4427,62 @@ TransmitterStoreWrite(
                           FrontendGetPath(Frontend),
                           "request-multicast-control",
                           "%u",
-                          TRUE);
+                          Enabled);
     if (!NT_SUCCESS(status))
         goto fail1;
 
+    return STATUS_SUCCESS;
+
+fail1:
+    Error("fail1 (%08x)\n", status);
+
+    return status;
+}
+
+NTSTATUS
+TransmitterRequestMulticastControl(
+    IN  PXENVIF_TRANSMITTER Transmitter,
+    IN  BOOLEAN             Enabled
+    )
+{
+    NTSTATUS                status;
+
+    status = STATUS_NOT_SUPPORTED;
+    if (!__TransmitterHasMulticastControl(Transmitter))
+        goto fail1;
+
+    status = __TransmitterRequestMulticastControl(Transmitter, NULL,
+                                                  Enabled);
+    if (!NT_SUCCESS(status))
+        goto fail2;
+
+    return STATUS_SUCCESS;
+
+fail2:
+fail1:
+    return status;
+}
+
+NTSTATUS
+TransmitterStoreWrite(
+    IN  PXENVIF_TRANSMITTER         Transmitter,
+    IN  PXENBUS_STORE_TRANSACTION   Transaction
+    )
+{
+    PXENVIF_FRONTEND                Frontend;
+    NTSTATUS                        status;
+    LONG                            Index;
+
+    Frontend = Transmitter->Frontend;
+
+    if (__TransmitterHasMulticastControl(Transmitter)) {
+        status = __TransmitterRequestMulticastControl(Transmitter,
+                                                      Transaction,
+                                                      TRUE);
+        if (!NT_SUCCESS(status))
+            goto fail1;
+    }
+
     Index = 0;
     while (Index < (LONG)FrontendGetNumQueues(Frontend)) {
         PXENVIF_TRANSMITTER_RING    Ring = Transmitter->Ring[Index];
diff --git a/src/xenvif/transmitter.h b/src/xenvif/transmitter.h
index 3e72b74..5e74667 100644
--- a/src/xenvif/transmitter.h
+++ b/src/xenvif/transmitter.h
@@ -146,4 +146,10 @@ TransmitterHasMulticastControl(
     IN  PXENVIF_TRANSMITTER Transmitter
     );
 
+NTSTATUS
+TransmitterRequestMulticastControl(
+    IN  PXENVIF_TRANSMITTER Transmitter,
+    IN  BOOLEAN             Enabled
+    );
+
 #endif  // _XENVIF_TRANSMITTER_H
diff --git a/src/xenvif/vif.c b/src/xenvif/vif.c
index 74df4ac..ce94a56 100644
--- a/src/xenvif/vif.c
+++ b/src/xenvif/vif.c
@@ -819,7 +819,7 @@ VifMacSetFilterLevel(
 
     AcquireMrswLockShared(&Context->Lock);
 
-    status = MacSetFilterLevel(FrontendGetMac(Context->Frontend), Type, Level);
+    status = FrontendSetFilterLevel(Context->Frontend, Type, Level);
 
     ReleaseMrswLockShared(&Context->Lock);
 
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Fri Jan 29 10:42:57 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 29 Jan 2016 10:42:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aP6W0-0002zv-Oj; Fri, 29 Jan 2016 10:42:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lars.kurth.xen@gmail.com>)
	id 1aP6Vy-0002zd-RZ; Fri, 29 Jan 2016 10:42:54 +0000
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	CB/28-09478-D224BA65; Fri, 29 Jan 2016 10:42:53 +0000
X-Env-Sender: lars.kurth.xen@gmail.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1454064172!19028662!1
X-Originating-IP: [74.125.82.41]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 47337 invoked from network); 29 Jan 2016 10:42:52 -0000
Received: from mail-wm0-f41.google.com (HELO mail-wm0-f41.google.com)
	(74.125.82.41)
	by server-2.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 29 Jan 2016 10:42:52 -0000
Received: by mail-wm0-f41.google.com with SMTP id p63so62543564wmp.1;
	Fri, 29 Jan 2016 02:42:52 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=content-type:mime-version:subject:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to;
	bh=ZItSW/6WdgwAU12GeExgQqJIUQBumiWmPiFyandvuB8=;
	b=ztnK3dnGl92MPM4Ba9OWtvgqO+JIS8MCPDDKxY6pJ2NWeriW525Mxp6Oq4OnTQ69wb
	DetpZ02+Gq/i23R1eqLRNupjF28NgkKpqJZ14aVzSGdnu3h1DSHNNv+89V5mMGvC38QO
	fBtG+3qG7+77V9VdlOwOom1ARTROuiIlSmQFuEut2Ip+JAnr72L2s3RNHlbiDxsoLOUW
	UMbvN/g+1dsWpaN3iC84WDY8Fs8Rfo6tFq7h4vhxfmyIcoyh/UoRtXQbWqWQFRcCvBKR
	yFDaDZsmi3L99e5g33fBpO2/5BINbvz6tXIrNEK/jKFGDbgHucVulzpLj+Nd/Kj9c20Q
	aBxA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:content-type:mime-version:subject:from
	:in-reply-to:date:cc:content-transfer-encoding:message-id:references
	:to; bh=ZItSW/6WdgwAU12GeExgQqJIUQBumiWmPiFyandvuB8=;
	b=QP91JrBjChdf2qx+4y+Ul4ztP0dj7aKJxXCL9oPpWIwYVJhLF3XuM3yZ6skCA/KkY2
	y6q2kcZJUi4TqwNspCp3x1WcvPUja4oHH9bQFKOO/91W+Lz5/LB96pKOHmKmjHG4mQHm
	Vn1TabBBn3oLD4wODpYKN7IYXQEAy7DUTulh5k3vyKQoXfOTpRVNb1acTrwIKL/HK6oT
	M1vQvbi5GFjgjKqYxgDumbVXdGJj92qZ8YQL+SmHy9hLw+DfaystnmbJxzASAjBmdkCh
	oCFoaCBGKe7JxVa07/XUUv0NwVwEYiEFftFqY1WAlZU09Y1g0+WwatRpEN2urF8stSYW
	aBVg==
X-Gm-Message-State: AG10YOT3+zOk3/bxwZx3MLCE07BCvJDt5uK4WF9YcHrzxZP123IcE7/UeVdeU5PN5ARF6g==
X-Received: by 10.28.63.206 with SMTP id m197mr7687109wma.21.1454064172376;
	Fri, 29 Jan 2016 02:42:52 -0800 (PST)
Received: from [192.168.0.9] (5ec0a1a0.skybroadband.com. [94.192.161.160])
	by smtp.gmail.com with ESMTPSA id
	jo6sm15040616wjb.48.2016.01.29.02.42.51
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 29 Jan 2016 02:42:51 -0800 (PST)
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\))
From: Lars Kurth <lars.kurth.xen@gmail.com>
In-Reply-To: <C49F5723-E3BE-456D-87C8-A2F4CDE8D43C@gmail.com>
Date: Fri, 29 Jan 2016 10:42:52 +0000
Message-Id: <406515BB-2973-4F6E-9540-F4F49F8A2A58@gmail.com>
References: <C49F5723-E3BE-456D-87C8-A2F4CDE8D43C@gmail.com>
To: xen-devel <xen-devel@lists.xenproject.org>,
	mirageos-devel <mirageos-devel@lists.xenproject.org>,
	Win-pv-devel@lists.xenproject.org, embedded-pv-devel@lists.xenproject.org
X-Mailer: Apple Mail (2.2104)
Cc: xen-users@lists.xenproject.org
Subject: Re: [win-pv-devel] Xen Project Infrastructure Maintenance: xenbits
	(Jan 28), qemu-bitslave & mail & downloads.xenproject.org (Feb 1),
	lists & etherpad (Feb 4th)
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Hi all,
this is a quick note to let you note that we are deferring the upgrades that were originally planned on Feb 1 and 4th. We ran into some issues with the Jan 28th upgrade, which would occur again. We are working with Rackspace to find a solution that avoids the issues we have seen on the 28th. Once we have a solution, we will re-schedule the planned upgrades.
Best Regards
Lars

> On 27 Jan 2016, at 16:48, Lars Kurth <lars.kurth.xen@gmail.com> wrote:
> 
> Hi everyone,
> 
> we are rebooting a number of Xen Project services in the next few days to upgrade operating systems. This means that a few services may be temporarily unavailable. The following websites are affected and will be done during the times below. If you notice any issues after the reboot, please reply to this mail or check on the #xeninfra IRC channel.
> 
> = Jan 28, 7am - 9am UTC : affecting xenbits =
> Affected services: Xen Project source code repositories, automatically generated xenproject docs, list of security vulnerabilities
> If you need to clone or commit to any affected repositories please do so before or after
> 
> = Feb 1, 7am - 9am UTC : affecting qemu-bitslave and xenproject.org mail aliases and downloads.xenproject.org =
> Affected services: qemu-bitslave, mail server, DNS and downloads.xenproject.org
> Note that mails to e-mails using foo-bar@xenproject.org may be delayed during the maintenance window. 
> 
> = Feb 4, 7am - 9am UTC : affecting xen project mailing lists & ether pad =
> Affected services: all foo@lists.xenproject.org mailing lists and ether pads
> Note that mails to all mailing lists will be delayed during the maintenance window
> 
> Best Regards
> Lars


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Fri Jan 29 10:42:57 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 29 Jan 2016 10:42:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aP6W0-0002zv-Oj; Fri, 29 Jan 2016 10:42:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lars.kurth.xen@gmail.com>)
	id 1aP6Vy-0002zd-RZ; Fri, 29 Jan 2016 10:42:54 +0000
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	CB/28-09478-D224BA65; Fri, 29 Jan 2016 10:42:53 +0000
X-Env-Sender: lars.kurth.xen@gmail.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1454064172!19028662!1
X-Originating-IP: [74.125.82.41]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 47337 invoked from network); 29 Jan 2016 10:42:52 -0000
Received: from mail-wm0-f41.google.com (HELO mail-wm0-f41.google.com)
	(74.125.82.41)
	by server-2.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted
	SMTP; 29 Jan 2016 10:42:52 -0000
Received: by mail-wm0-f41.google.com with SMTP id p63so62543564wmp.1;
	Fri, 29 Jan 2016 02:42:52 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=content-type:mime-version:subject:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to;
	bh=ZItSW/6WdgwAU12GeExgQqJIUQBumiWmPiFyandvuB8=;
	b=ztnK3dnGl92MPM4Ba9OWtvgqO+JIS8MCPDDKxY6pJ2NWeriW525Mxp6Oq4OnTQ69wb
	DetpZ02+Gq/i23R1eqLRNupjF28NgkKpqJZ14aVzSGdnu3h1DSHNNv+89V5mMGvC38QO
	fBtG+3qG7+77V9VdlOwOom1ARTROuiIlSmQFuEut2Ip+JAnr72L2s3RNHlbiDxsoLOUW
	UMbvN/g+1dsWpaN3iC84WDY8Fs8Rfo6tFq7h4vhxfmyIcoyh/UoRtXQbWqWQFRcCvBKR
	yFDaDZsmi3L99e5g33fBpO2/5BINbvz6tXIrNEK/jKFGDbgHucVulzpLj+Nd/Kj9c20Q
	aBxA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:content-type:mime-version:subject:from
	:in-reply-to:date:cc:content-transfer-encoding:message-id:references
	:to; bh=ZItSW/6WdgwAU12GeExgQqJIUQBumiWmPiFyandvuB8=;
	b=QP91JrBjChdf2qx+4y+Ul4ztP0dj7aKJxXCL9oPpWIwYVJhLF3XuM3yZ6skCA/KkY2
	y6q2kcZJUi4TqwNspCp3x1WcvPUja4oHH9bQFKOO/91W+Lz5/LB96pKOHmKmjHG4mQHm
	Vn1TabBBn3oLD4wODpYKN7IYXQEAy7DUTulh5k3vyKQoXfOTpRVNb1acTrwIKL/HK6oT
	M1vQvbi5GFjgjKqYxgDumbVXdGJj92qZ8YQL+SmHy9hLw+DfaystnmbJxzASAjBmdkCh
	oCFoaCBGKe7JxVa07/XUUv0NwVwEYiEFftFqY1WAlZU09Y1g0+WwatRpEN2urF8stSYW
	aBVg==
X-Gm-Message-State: AG10YOT3+zOk3/bxwZx3MLCE07BCvJDt5uK4WF9YcHrzxZP123IcE7/UeVdeU5PN5ARF6g==
X-Received: by 10.28.63.206 with SMTP id m197mr7687109wma.21.1454064172376;
	Fri, 29 Jan 2016 02:42:52 -0800 (PST)
Received: from [192.168.0.9] (5ec0a1a0.skybroadband.com. [94.192.161.160])
	by smtp.gmail.com with ESMTPSA id
	jo6sm15040616wjb.48.2016.01.29.02.42.51
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 29 Jan 2016 02:42:51 -0800 (PST)
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\))
From: Lars Kurth <lars.kurth.xen@gmail.com>
In-Reply-To: <C49F5723-E3BE-456D-87C8-A2F4CDE8D43C@gmail.com>
Date: Fri, 29 Jan 2016 10:42:52 +0000
Message-Id: <406515BB-2973-4F6E-9540-F4F49F8A2A58@gmail.com>
References: <C49F5723-E3BE-456D-87C8-A2F4CDE8D43C@gmail.com>
To: xen-devel <xen-devel@lists.xenproject.org>,
	mirageos-devel <mirageos-devel@lists.xenproject.org>,
	Win-pv-devel@lists.xenproject.org, embedded-pv-devel@lists.xenproject.org
X-Mailer: Apple Mail (2.2104)
Cc: xen-users@lists.xenproject.org
Subject: Re: [win-pv-devel] Xen Project Infrastructure Maintenance: xenbits
	(Jan 28), qemu-bitslave & mail & downloads.xenproject.org (Feb 1),
	lists & etherpad (Feb 4th)
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

Hi all,
this is a quick note to let you note that we are deferring the upgrades that were originally planned on Feb 1 and 4th. We ran into some issues with the Jan 28th upgrade, which would occur again. We are working with Rackspace to find a solution that avoids the issues we have seen on the 28th. Once we have a solution, we will re-schedule the planned upgrades.
Best Regards
Lars

> On 27 Jan 2016, at 16:48, Lars Kurth <lars.kurth.xen@gmail.com> wrote:
> 
> Hi everyone,
> 
> we are rebooting a number of Xen Project services in the next few days to upgrade operating systems. This means that a few services may be temporarily unavailable. The following websites are affected and will be done during the times below. If you notice any issues after the reboot, please reply to this mail or check on the #xeninfra IRC channel.
> 
> = Jan 28, 7am - 9am UTC : affecting xenbits =
> Affected services: Xen Project source code repositories, automatically generated xenproject docs, list of security vulnerabilities
> If you need to clone or commit to any affected repositories please do so before or after
> 
> = Feb 1, 7am - 9am UTC : affecting qemu-bitslave and xenproject.org mail aliases and downloads.xenproject.org =
> Affected services: qemu-bitslave, mail server, DNS and downloads.xenproject.org
> Note that mails to e-mails using foo-bar@xenproject.org may be delayed during the maintenance window. 
> 
> = Feb 4, 7am - 9am UTC : affecting xen project mailing lists & ether pad =
> Affected services: all foo@lists.xenproject.org mailing lists and ether pads
> Note that mails to all mailing lists will be delayed during the maintenance window
> 
> Best Regards
> Lars


_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Sat Jan 30 13:07:17 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Sat, 30 Jan 2016 13:07:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aPVFD-0000hS-Tz; Sat, 30 Jan 2016 13:07:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=8309105eb=Paul.Durrant@citrix.com>)
	id 1aPVFC-0000hH-H8
	for win-pv-devel@lists.xenproject.org; Sat, 30 Jan 2016 13:07:14 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	F9/AF-31443-185BCA65; Sat, 30 Jan 2016 13:07:13 +0000
X-Env-Sender: prvs=8309105eb=Paul.Durrant@citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1454159232!18900619!1
X-Originating-IP: [185.25.65.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=received_headers: No 
	Received headers
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17569 invoked from network); 30 Jan 2016 13:07:13 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (185.25.65.24)
	by server-15.tower-31.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Jan 2016 13:07:13 -0000
X-IronPort-AV: E=Sophos;i="5.22,370,1449532800"; d="scan'208";a="13742846"
From: Paul Durrant <Paul.Durrant@citrix.com>
To: Adam Goryachev <mailinglists@websitemanagers.com.au>,
	"xen-users@lists.xen.org" <xen-users@lists.xen.org>,
	"win-pv-devel@lists.xenproject.org" <win-pv-devel@lists.xenproject.org>
Thread-Topic: [win-pv-devel] Windows PV Drivers
Thread-Index: AQHRWnMC5MHpjOcpY0m25m0RExMk/Z8UBnrQ
Date: Sat, 30 Jan 2016 13:07:10 +0000
Message-ID: <d37f5ad4deff453087c3a76bfb9dbb7f@AMSPEX02CL03.citrite.net>
References: <56AA927E.5030906@websitemanagers.com.au>
In-Reply-To: <56AA927E.5030906@websitemanagers.com.au>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ms-exchange-transport-fromentityheader: Hosted
MIME-Version: 1.0
X-DLP: AMS1
Subject: Re: [win-pv-devel] Windows PV Drivers
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

> -----Original Message-----
> From: win-pv-devel-bounces@lists.xenproject.org [mailto:win-pv-devel-
> bounces@lists.xenproject.org] On Behalf Of Adam Goryachev
> Sent: 28 January 2016 22:13
> To: xen-users@lists.xen.org; win-pv-devel@lists.xenproject.org
> Subject: [win-pv-devel] Windows PV Drivers
> 
> Hi all,
> 

Hi.

> I'm really confused with the current state of the Windows PV Drivers.
> AFAICT, there are/were 4 different versions:
> 1) GPL PV drivers (seem to be the original and current stable/commonly
> used version) signed versions from meadowcourt

They are (or certainly were) maintained by James Harper, but I don't know their current state.

> 2) EJB Digital (seem to be forked from GPL PV, for a time fixed various
> problems, but since 2014 no development, and not available) had signed
> drivers

I know nothing about those drivers.

> 3) XenServer Windows PV drivers, I've never used these, and assume they
> are signed, only work with XenServer, and restricted license.

Recent versions of the Citrix drivers should also work with non-XenServer installations although there may be some quirks. They are certainly not deliberately locked to XenServer though.

> Don't see
> mention of these in most of the open source xen windows driver pages.
> 4) Xen Project Windows PV Driver sub project seems to be working on
> drivers - http://wiki.xenproject.org/wiki/Xen_FAQ_Drivers,_Windows "This
> project has taken the the XenServer Windows PV Drivers, re-written them
> and contributed them to the Xen Project." Currently don't seem to have
> any signed versions available, seems to be new and potentially unstable
> (how much was re-written? why? unknown, not explained on the FAQ)
> 
> Can anyone explain what is the current status of these projects?
> 

Citrix will be using the XenProject drivers in forthcoming releases of XenServer. Final logo testing of the staging-8.1 branches is nearly done and when it is complete it is my intention to declare a version 8.1 community release of all the drivers, which I will also (non-logo) sign through the Microsoft portal. (The Citrix branded version of the driver will be logo signed).

> Of specific interest to me, I'm currently using either xen 4.1 or xen
> 4.4 (from debian packages) with Windows Server 2003/2008R2/2012R2.
> Which
> driver version and project is best (most stable, with best performance)
> for those variations?

Well, 2003 has been out of extended support for a long time now and the Xen Project drivers do not support it. The source is good for anything from Vista onwards and the community builds will work on anything from Win 7 onwards (since they are built with the 8.1 WDK... you need to use the 8.0 WDK to build for Vista).

> How will this change in future?
> Where is current development efforts?

Citrix is committed to using the XenProject drivers and intends to actively develop features in the open using that source base.

HTH,

  Paul

> If multiple projects are "current" what is the reason (benefit) in
> maintaining those multiple implementations of the "same" thing?
> 
> Regards,
> Adam
> 
> --
> Adam Goryachev Website Managers www.websitemanagers.com.au
> 
> _______________________________________________
> win-pv-devel mailing list
> win-pv-devel@lists.xenproject.org
> http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

From win-pv-devel-bounces@lists.xenproject.org Sat Jan 30 13:07:17 2016
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Sat, 30 Jan 2016 13:07:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1aPVFD-0000hS-Tz; Sat, 30 Jan 2016 13:07:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=8309105eb=Paul.Durrant@citrix.com>)
	id 1aPVFC-0000hH-H8
	for win-pv-devel@lists.xenproject.org; Sat, 30 Jan 2016 13:07:14 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	F9/AF-31443-185BCA65; Sat, 30 Jan 2016 13:07:13 +0000
X-Env-Sender: prvs=8309105eb=Paul.Durrant@citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1454159232!18900619!1
X-Originating-IP: [185.25.65.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=received_headers: No 
	Received headers
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17569 invoked from network); 30 Jan 2016 13:07:13 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (185.25.65.24)
	by server-15.tower-31.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Jan 2016 13:07:13 -0000
X-IronPort-AV: E=Sophos;i="5.22,370,1449532800"; d="scan'208";a="13742846"
From: Paul Durrant <Paul.Durrant@citrix.com>
To: Adam Goryachev <mailinglists@websitemanagers.com.au>,
	"xen-users@lists.xen.org" <xen-users@lists.xen.org>,
	"win-pv-devel@lists.xenproject.org" <win-pv-devel@lists.xenproject.org>
Thread-Topic: [win-pv-devel] Windows PV Drivers
Thread-Index: AQHRWnMC5MHpjOcpY0m25m0RExMk/Z8UBnrQ
Date: Sat, 30 Jan 2016 13:07:10 +0000
Message-ID: <d37f5ad4deff453087c3a76bfb9dbb7f@AMSPEX02CL03.citrite.net>
References: <56AA927E.5030906@websitemanagers.com.au>
In-Reply-To: <56AA927E.5030906@websitemanagers.com.au>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ms-exchange-transport-fromentityheader: Hosted
MIME-Version: 1.0
X-DLP: AMS1
Subject: Re: [win-pv-devel] Windows PV Drivers
X-BeenThere: win-pv-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Developer list for the Windows PV Drivers subproject
	<win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel>,
	<mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: win-pv-devel-bounces@lists.xenproject.org
Errors-To: win-pv-devel-bounces@lists.xenproject.org

> -----Original Message-----
> From: win-pv-devel-bounces@lists.xenproject.org [mailto:win-pv-devel-
> bounces@lists.xenproject.org] On Behalf Of Adam Goryachev
> Sent: 28 January 2016 22:13
> To: xen-users@lists.xen.org; win-pv-devel@lists.xenproject.org
> Subject: [win-pv-devel] Windows PV Drivers
> 
> Hi all,
> 

Hi.

> I'm really confused with the current state of the Windows PV Drivers.
> AFAICT, there are/were 4 different versions:
> 1) GPL PV drivers (seem to be the original and current stable/commonly
> used version) signed versions from meadowcourt

They are (or certainly were) maintained by James Harper, but I don't know their current state.

> 2) EJB Digital (seem to be forked from GPL PV, for a time fixed various
> problems, but since 2014 no development, and not available) had signed
> drivers

I know nothing about those drivers.

> 3) XenServer Windows PV drivers, I've never used these, and assume they
> are signed, only work with XenServer, and restricted license.

Recent versions of the Citrix drivers should also work with non-XenServer installations although there may be some quirks. They are certainly not deliberately locked to XenServer though.

> Don't see
> mention of these in most of the open source xen windows driver pages.
> 4) Xen Project Windows PV Driver sub project seems to be working on
> drivers - http://wiki.xenproject.org/wiki/Xen_FAQ_Drivers,_Windows "This
> project has taken the the XenServer Windows PV Drivers, re-written them
> and contributed them to the Xen Project." Currently don't seem to have
> any signed versions available, seems to be new and potentially unstable
> (how much was re-written? why? unknown, not explained on the FAQ)
> 
> Can anyone explain what is the current status of these projects?
> 

Citrix will be using the XenProject drivers in forthcoming releases of XenServer. Final logo testing of the staging-8.1 branches is nearly done and when it is complete it is my intention to declare a version 8.1 community release of all the drivers, which I will also (non-logo) sign through the Microsoft portal. (The Citrix branded version of the driver will be logo signed).

> Of specific interest to me, I'm currently using either xen 4.1 or xen
> 4.4 (from debian packages) with Windows Server 2003/2008R2/2012R2.
> Which
> driver version and project is best (most stable, with best performance)
> for those variations?

Well, 2003 has been out of extended support for a long time now and the Xen Project drivers do not support it. The source is good for anything from Vista onwards and the community builds will work on anything from Win 7 onwards (since they are built with the 8.1 WDK... you need to use the 8.0 WDK to build for Vista).

> How will this change in future?
> Where is current development efforts?

Citrix is committed to using the XenProject drivers and intends to actively develop features in the open using that source base.

HTH,

  Paul

> If multiple projects are "current" what is the reason (benefit) in
> maintaining those multiple implementations of the "same" thing?
> 
> Regards,
> Adam
> 
> --
> Adam Goryachev Website Managers www.websitemanagers.com.au
> 
> _______________________________________________
> win-pv-devel mailing list
> win-pv-devel@lists.xenproject.org
> http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

