This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-changelog] [xen-3.4-testing] Fix clock for XCP Windows PV drivers o

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.4-testing] Fix clock for XCP Windows PV drivers on restore
From: "Xen patchbot-3.4-testing" <patchbot-3.4-testing@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 14 Dec 2009 01:45:44 -0800
Delivery-date: Mon, 14 Dec 2009 01:47:30 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1260783696 0
# Node ID ae60cbc5bb6d731a0b7d1bad829a853335ae0e68
# Parent  122788bdebaeb3ce32e2a61e504f3df0a3809284
Fix clock for XCP Windows PV drivers on restore

This fixes a timekeeping issue for 32 bit guests running XCP Windows
paravirtual drivers on a 64 bit hypervisor where their clock was set
to the 1970s after live migration or restore. Thanks to Paul Durrant
for helping track this down.

>From the original XCP patch:

Arrange that the wallclock time fields in the shared_info structure
are set correctly in 32 bit HVM guests on a 64 bit hypervisor.  HVM
guests on a 64 bit hypervisor always start with a 64 bit shared info,
and then change to a 32 bit one if they're using 32 bit drivers.  The
32-bit and 64-bit shared info structures put their wallclock times in
slightly different places, and so the wallclock time needs to be
regenerated when you do the conversion.

It can be argued that we should convert the other fields of shared
info at the same time (e.g. if an event channel is pending beforehand,
it should be pending afterwards), but that's much harder to arrange,
because the 32 bit structure can't represent all the states which the
64 bit one can.  Just setting the time seems to be sufficient for
our purposes.

Signed-off-by: Steven Smith <steven.smith@xxxxxxxxxx>
Signed-off-by: Keith Coleman <keith@xxxxxxxxxxx>
xen-unstable changeset:   20630:db8a985693f7
xen-unstable date:        Mon Dec 14 07:55:35 2009 +0000
 xen/arch/x86/hvm/hvm.c |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diff -r 122788bdebae -r ae60cbc5bb6d xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c    Fri Dec 11 09:06:47 2009 +0000
+++ b/xen/arch/x86/hvm/hvm.c    Mon Dec 14 09:41:36 2009 +0000
@@ -2148,14 +2148,32 @@ int hvm_do_hypercall(struct cpu_user_reg
 static void hvm_latch_shinfo_size(struct domain *d)
+    bool_t new_has_32bit;
      * Called from operations which are among the very first executed by
      * PV drivers on initialisation or after save/restore. These are sensible
      * points at which to sample the execution mode of the guest and latch
      * 32- or 64-bit format for shared state.
-    if ( current->domain == d )
-        d->arch.has_32bit_shinfo = (hvm_guest_x86_mode(current) != 8);
+    if ( current->domain == d ) {
+        new_has_32bit = (hvm_guest_x86_mode(current) != 8);
+        if (new_has_32bit != d->arch.has_32bit_shinfo) {
+            d->arch.has_32bit_shinfo = new_has_32bit;
+            /*
+             * Make sure that the timebase in the shared info
+             * structure is correct for its new bit-ness.  We should
+             * arguably try to convert the other fields as well, but
+             * that's much more problematic (e.g. what do you do if
+             * you're going from 64 bit to 32 bit and there's an event
+             * channel pending which doesn't exist in the 32 bit
+             * version?).  Just setting the wallclock time seems to be
+             * sufficient for everything we do, even if it is a bit of
+             * a hack.
+             */
+            update_domain_wallclock_time(d);
+        }
+    }
 /* Initialise a hypercall transfer page for a VMX domain using

Xen-changelog mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.4-testing] Fix clock for XCP Windows PV drivers on restore, Xen patchbot-3.4-testing <=