WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] Nested SVM: fix race in remote shootdown.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Nested SVM: fix race in remote shootdown.
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Sat, 09 Apr 2011 09:20:17 +0100
Delivery-date: Sat, 09 Apr 2011 01:27:30 -0700
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 Tim Deegan <Tim.Deegan@xxxxxxxxxx>
# Date 1302085359 -3600
# Node ID 86f87da1445a0a9bf3094917bc98c64e9b82799b
# Parent  2a39222f0071295bdae703c928403d30c63674cc
Nested SVM: fix race in remote shootdown.

nestedhvm_flushtlb_ipi() can run between nsvm_vcpu_switch() and CLGI,
which would leave the VMCB pointing at the wrong p2m table.
Check for this after CLGI.

Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
---


diff -r 2a39222f0071 -r 86f87da1445a xen/arch/x86/hvm/svm/entry.S
--- a/xen/arch/x86/hvm/svm/entry.S      Wed Apr 06 11:22:39 2011 +0100
+++ b/xen/arch/x86/hvm/svm/entry.S      Wed Apr 06 11:22:39 2011 +0100
@@ -65,6 +65,12 @@
         testl $~0,(r(dx),r(ax),1)
         jnz  .Lsvm_process_softirqs
 
+        mov  VCPU_nhvm_p2m(r(bx)),r(ax)
+        test r(ax),r(ax)
+        sete %al
+        andb VCPU_nhvm_guestmode(r(bx)),%al
+        jnz  .Lsvm_nsvm_no_p2m
+
         call svm_asid_handle_vmrun
 
         cmpb $0,addr_of(tb_init_done)
@@ -174,3 +180,9 @@
 .Lsvm_trace:
         call svm_trace_vmentry
         jmp  .Lsvm_trace_done
+
+.Lsvm_nsvm_no_p2m:
+        /* Someone shot down our nested p2m table; go round again
+         * and nsvm_vcpu_switch() will fix it for us. */
+        STGI
+        jmp  svm_asm_do_resume
diff -r 2a39222f0071 -r 86f87da1445a xen/arch/x86/x86_32/asm-offsets.c
--- a/xen/arch/x86/x86_32/asm-offsets.c Wed Apr 06 11:22:39 2011 +0100
+++ b/xen/arch/x86/x86_32/asm-offsets.c Wed Apr 06 11:22:39 2011 +0100
@@ -93,6 +93,10 @@
     OFFSET(VCPU_hvm_guest_cr2, struct vcpu, arch.hvm_vcpu.guest_cr[2]);
     BLANK();
 
+    OFFSET(VCPU_nhvm_guestmode, struct vcpu, arch.hvm_vcpu.nvcpu.nv_guestmode);
+    OFFSET(VCPU_nhvm_p2m, struct vcpu, arch.hvm_vcpu.nvcpu.nv_p2m);
+    BLANK();
+
     OFFSET(VMCB_rax, struct vmcb_struct, rax);
     OFFSET(VMCB_rip, struct vmcb_struct, rip);
     OFFSET(VMCB_rsp, struct vmcb_struct, rsp);
diff -r 2a39222f0071 -r 86f87da1445a xen/arch/x86/x86_64/asm-offsets.c
--- a/xen/arch/x86/x86_64/asm-offsets.c Wed Apr 06 11:22:39 2011 +0100
+++ b/xen/arch/x86/x86_64/asm-offsets.c Wed Apr 06 11:22:39 2011 +0100
@@ -115,6 +115,10 @@
     OFFSET(VCPU_hvm_guest_cr2, struct vcpu, arch.hvm_vcpu.guest_cr[2]);
     BLANK();
 
+    OFFSET(VCPU_nhvm_guestmode, struct vcpu, arch.hvm_vcpu.nvcpu.nv_guestmode);
+    OFFSET(VCPU_nhvm_p2m, struct vcpu, arch.hvm_vcpu.nvcpu.nv_p2m);
+    BLANK();
+
     OFFSET(DOMAIN_is_32bit_pv, struct domain, arch.is_32bit_pv);
     BLANK();
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Nested SVM: fix race in remote shootdown., Xen patchbot-unstable <=