]> xenbits.xensource.com Git - pvdrivers/win/xenbus.git/commitdiff
Make sure SYNC per-processor structures are zeroed after resume
authorPaul Durrant <paul.durrant@citrix.com>
Wed, 1 Apr 2015 07:53:54 +0000 (08:53 +0100)
committerPaul Durrant <paul.durrant@citrix.com>
Wed, 1 Apr 2015 07:53:54 +0000 (08:53 +0100)
Since the per-processor data in the SYNC code was split out from the
main context structure, the code that zeroes that structure on resume
no longer clears the per-processor Exit flag. This means that a multi-
vcpu VM can only be suspended once; subsequent attempts will fail.
This patch fixes the problem by zeroing the full page containing the SYNC
context structure and any per-processor data.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
src/xenbus/sync.c

index 835b46b536bdda9c837282e161a8669545600c5d..661aabe54a0d1104201365119fb640732a438ef6 100644 (file)
@@ -255,7 +255,7 @@ SyncCapture(
 
     Trace("====> (%u:%u)\n", Group, Number);
 
-    ASSERT(IsZeroMemory(Context, sizeof (SYNC_CONTEXT)));
+    ASSERT(IsZeroMemory(Context, PAGE_SIZE));
 
     Context->Sequence++;
     Context->CompletionCount = 0;
@@ -427,7 +427,7 @@ SyncRelease(
         KeMemoryBarrier();
     }
 
-    RtlZeroMemory(Context, sizeof (SYNC_CONTEXT));
+    RtlZeroMemory(Context, PAGE_SIZE);
 
     Index = KeGetCurrentProcessorNumberEx(NULL);
     __SyncRelease(Index);