# HG changeset patch
# User Christoph Egger <Christoph.Egger@xxxxxxx>
# Date 1305187655 -3600
# Node ID 1e29db7a3b6bcae442676ed52f574434cfe0aba7
# Parent 19d6541c4abec3486c83de76102ec46d7fe22a16
nestedsvm: fix shadow-on-hap
Signed-off-by: Christoph Egger <Christoph.Egger@xxxxxxx>
Acked-by: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
---
diff -r 19d6541c4abe -r 1e29db7a3b6b xen/arch/x86/hvm/svm/entry.S
--- a/xen/arch/x86/hvm/svm/entry.S Thu May 12 09:00:46 2011 +0100
+++ b/xen/arch/x86/hvm/svm/entry.S Thu May 12 09:07:35 2011 +0100
@@ -65,12 +65,16 @@
testl $~0,(r(dx),r(ax),1)
jnz .Lsvm_process_softirqs
+ testb $0, VCPU_nsvm_hap_enabled(r(bx))
+ jz .Lsvm_asid_handle
+
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
+.Lsvm_asid_handle:
call svm_asid_handle_vmrun
cmpb $0,addr_of(tb_init_done)
diff -r 19d6541c4abe -r 1e29db7a3b6b xen/arch/x86/hvm/svm/nestedsvm.c
--- a/xen/arch/x86/hvm/svm/nestedsvm.c Thu May 12 09:00:46 2011 +0100
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c Thu May 12 09:07:35 2011 +0100
@@ -494,6 +494,7 @@
/* host nested paging + guest shadow paging. */
n2vmcb->_np_enable = 1;
/* Keep h_cr3 as it is. */
+ n2vmcb->_h_cr3 = n1vmcb->_h_cr3;
/* When l1 guest does shadow paging
* we assume it intercepts page faults.
*/
diff -r 19d6541c4abe -r 1e29db7a3b6b xen/arch/x86/x86_32/asm-offsets.c
--- a/xen/arch/x86/x86_32/asm-offsets.c Thu May 12 09:00:46 2011 +0100
+++ b/xen/arch/x86/x86_32/asm-offsets.c Thu May 12 09:07:35 2011 +0100
@@ -95,6 +95,7 @@
OFFSET(VCPU_nhvm_guestmode, struct vcpu, arch.hvm_vcpu.nvcpu.nv_guestmode);
OFFSET(VCPU_nhvm_p2m, struct vcpu, arch.hvm_vcpu.nvcpu.nv_p2m);
+ OFFSET(VCPU_nsvm_hap_enabled, struct vcpu,
arch.hvm_vcpu.nvcpu.u.nsvm.ns_hap_enabled);
BLANK();
OFFSET(VMCB_rax, struct vmcb_struct, rax);
diff -r 19d6541c4abe -r 1e29db7a3b6b xen/arch/x86/x86_64/asm-offsets.c
--- a/xen/arch/x86/x86_64/asm-offsets.c Thu May 12 09:00:46 2011 +0100
+++ b/xen/arch/x86/x86_64/asm-offsets.c Thu May 12 09:07:35 2011 +0100
@@ -117,6 +117,7 @@
OFFSET(VCPU_nhvm_guestmode, struct vcpu, arch.hvm_vcpu.nvcpu.nv_guestmode);
OFFSET(VCPU_nhvm_p2m, struct vcpu, arch.hvm_vcpu.nvcpu.nv_p2m);
+ OFFSET(VCPU_nsvm_hap_enabled, struct vcpu,
arch.hvm_vcpu.nvcpu.u.nsvm.ns_hap_enabled);
BLANK();
OFFSET(DOMAIN_is_32bit_pv, struct domain, arch.is_32bit_pv);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|