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

[Xen-changelog] [xen-unstable] x86: Fixes to VLAPIC and S3 state resets.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1211539596 -3600
# Node ID 21422854b9f8cec9d789951cf5c9514aff905896
# Parent  5cc5b9c37c6d429502e75536822810219b23b033
x86: Fixes to VLAPIC and S3 state resets.
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/domain.c     |   11 +++++++++--
 xen/arch/x86/hvm/hvm.c    |    2 ++
 xen/arch/x86/hvm/vlapic.c |   23 +++++++++++------------
 xen/common/domain.c       |    4 ++--
 4 files changed, 24 insertions(+), 16 deletions(-)

diff -r 5cc5b9c37c6d -r 21422854b9f8 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c     Fri May 23 11:15:19 2008 +0100
+++ b/xen/arch/x86/domain.c     Fri May 23 11:46:36 2008 +0100
@@ -825,8 +825,15 @@ int arch_set_info_guest(
 
 void arch_vcpu_reset(struct vcpu *v)
 {
-    destroy_gdt(v);
-    vcpu_destroy_pagetables(v);
+    if ( !is_hvm_vcpu(v) )
+    {
+        destroy_gdt(v);
+        vcpu_destroy_pagetables(v);
+    }
+    else
+    {
+        vcpu_end_shutdown_deferral(v);
+    }
 }
 
 /* 
diff -r 5cc5b9c37c6d -r 21422854b9f8 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c    Fri May 23 11:15:19 2008 +0100
+++ b/xen/arch/x86/hvm/hvm.c    Fri May 23 11:46:36 2008 +0100
@@ -2123,6 +2123,8 @@ void hvm_vcpu_reset_state(struct vcpu *v
         v->domain->vcpu[0]->arch.hvm_vcpu.cache_tsc_offset;
     hvm_funcs.set_tsc_offset(v, v->arch.hvm_vcpu.cache_tsc_offset);
 
+    paging_update_paging_modes(v);
+
     v->arch.flags |= TF_kernel_mode;
     v->is_initialised = 1;
     clear_bit(_VPF_down, &v->pause_flags);
diff -r 5cc5b9c37c6d -r 21422854b9f8 xen/arch/x86/hvm/vlapic.c
--- a/xen/arch/x86/hvm/vlapic.c Fri May 23 11:15:19 2008 +0100
+++ b/xen/arch/x86/hvm/vlapic.c Fri May 23 11:46:36 2008 +0100
@@ -22,18 +22,19 @@
 #include <xen/types.h>
 #include <xen/mm.h>
 #include <xen/xmalloc.h>
+#include <xen/domain.h>
 #include <xen/domain_page.h>
-#include <asm/page.h>
 #include <xen/event.h>
 #include <xen/trace.h>
+#include <xen/lib.h>
+#include <xen/sched.h>
+#include <xen/numa.h>
+#include <asm/current.h>
+#include <asm/page.h>
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/io.h>
 #include <asm/hvm/support.h>
-#include <xen/lib.h>
-#include <xen/sched.h>
-#include <asm/current.h>
 #include <asm/hvm/vmx/vmx.h>
-#include <xen/numa.h>
 #include <public/hvm/ioreq.h>
 #include <public/hvm/params.h>
 
@@ -259,6 +260,7 @@ static void vlapic_init_action(unsigned 
 {
     struct vcpu *v = (struct vcpu *)_vcpu;
     struct domain *d = v->domain;
+    bool_t fpu_initialised;
 
     /* If the VCPU is not on its way down we have nothing to do. */
     if ( !test_bit(_VPF_down, &v->pause_flags) )
@@ -270,15 +272,12 @@ static void vlapic_init_action(unsigned 
         return;
     }
 
+    /* Reset necessary VCPU state. This does not include FPU state. */
     domain_lock(d);
-
-    /* Paranoia makes us re-assert VPF_down under the domain lock. */
-    set_bit(_VPF_down, &v->pause_flags);
-    v->is_initialised = 0;
-    clear_bit(_VPF_blocked, &v->pause_flags);
-
+    fpu_initialised = v->fpu_initialised;
+    vcpu_reset(v);
+    v->fpu_initialised = fpu_initialised;
     vlapic_reset(vcpu_vlapic(v));
-
     domain_unlock(d);
 
     vcpu_unpause(v);
diff -r 5cc5b9c37c6d -r 21422854b9f8 xen/common/domain.c
--- a/xen/common/domain.c       Fri May 23 11:15:19 2008 +0100
+++ b/xen/common/domain.c       Fri May 23 11:46:36 2008 +0100
@@ -637,7 +637,7 @@ void vcpu_reset(struct vcpu *v)
 {
     struct domain *d = v->domain;
 
-    domain_pause(d);
+    vcpu_pause(v);
     domain_lock(d);
 
     arch_vcpu_reset(v);
@@ -653,7 +653,7 @@ void vcpu_reset(struct vcpu *v)
     clear_bit(_VPF_blocked, &v->pause_flags);
 
     domain_unlock(v->domain);
-    domain_unpause(d);
+    vcpu_unpause(v);
 }
 
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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