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

[win-pv-devel] [PATCH] Turn off Spectre mitigation warning



VS2017 warns when spectre mitigations are inserted, which
causes an error when all warnings are treated as errors.

Disable warning C5045

Signed-off-by: Ben Chalmers <ben.chalmers@xxxxxxxxxx>
---
 src/xenvif/poller.c      | 3 +++
 src/xenvif/receiver.c    | 6 ++++++
 src/xenvif/transmitter.c | 3 +++
 3 files changed, 12 insertions(+)

diff --git a/src/xenvif/poller.c b/src/xenvif/poller.c
index 6ff2c8c..65427a8 100644
--- a/src/xenvif/poller.c
+++ b/src/xenvif/poller.c
@@ -790,6 +790,8 @@ PollerInstanceEnable(
     return STATUS_SUCCESS;
 }
 
+#pragma warning(push)
+#pragma warning(disable: 5045)
 __drv_requiresIRQL(DISPATCH_LEVEL)
 static NTSTATUS
 PollerInstanceSend(
@@ -874,6 +876,7 @@ fail1:
     return status;
 }
 
+#pragma warning(pop)
 static VOID
 PollerInstanceDebugCallback(
     IN  PXENVIF_POLLER_INSTANCE Instance
diff --git a/src/xenvif/receiver.c b/src/xenvif/receiver.c
index ab3e416..3501ea6 100644
--- a/src/xenvif/receiver.c
+++ b/src/xenvif/receiver.c
@@ -341,6 +341,8 @@ ReceiverFragmentCtor(
     return STATUS_SUCCESS;
 }
 
+#pragma warning(push)
+#pragma warning(disable: 5045)
 static VOID
 ReceiverFragmentDtor(
     IN  PVOID                   Argument,
@@ -353,6 +355,7 @@ ReceiverFragmentDtor(
 
     ASSERT(IsZeroMemory(Fragment, sizeof (XENVIF_RECEIVER_FRAGMENT)));
 }
+#pragma warning(pop)
 
 static FORCEINLINE PXENVIF_RECEIVER_FRAGMENT
 __ReceiverRingGetFragment(
@@ -1388,6 +1391,8 @@ ReceiverRingAcquireLock(
     __ReceiverRingAcquireLock(Ring);
 }
 
+#pragma warning(push)
+#pragma warning(disable: 5045)
 static FORCEINLINE VOID
 __drv_requiresIRQL(DISPATCH_LEVEL)
 __ReceiverRingReleaseLock(
@@ -1598,6 +1603,7 @@ __ReceiverRingReleaseLock(
 
     ASSERT3U(Count, ==, 0);
 }
+#pragma warning(pop)
 
 static DECLSPEC_NOINLINE VOID
 ReceiverRingReleaseLock(
diff --git a/src/xenvif/transmitter.c b/src/xenvif/transmitter.c
index bf6004a..a4f652a 100644
--- a/src/xenvif/transmitter.c
+++ b/src/xenvif/transmitter.c
@@ -325,6 +325,8 @@ __TransmitterGetPacket(
                         Transmitter->PacketCache,
                         FALSE);
 }
+#pragma warning(push)
+#pragma warning(disable: 5045)
 
 static FORCEINLINE VOID
 __TransmitterPutPacket(
@@ -357,6 +359,7 @@ __TransmitterPutPacket(
                  Packet,
                  FALSE);
 }
+#pragma warning(pop)
 
 static NTSTATUS
 TransmitterBufferCtor(
-- 
2.10.1.windows.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/win-pv-devel

 


Rackspace

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