From: Paul Durrant Date: Wed, 1 Apr 2015 07:53:54 +0000 (+0100) Subject: Make sure SYNC per-processor structures are zeroed after resume X-Git-Tag: 8.1.0-rc1~33 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=51812817397bcd83c92ab318e845b08040f31b50;p=pvdrivers%2Fwin%2Fxenbus.git Make sure SYNC per-processor structures are zeroed after resume 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 --- diff --git a/src/xenbus/sync.c b/src/xenbus/sync.c index 835b46b..661aabe 100644 --- a/src/xenbus/sync.c +++ b/src/xenbus/sync.c @@ -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);