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-devel

[Xen-devel] pre-cleanup1 for nested VMX

To: Tim Deegan <Tim.Deegan@xxxxxxxxxx>, Keir Fraser <keir@xxxxxxx>
Subject: [Xen-devel] pre-cleanup1 for nested VMX
From: "Dong, Eddie" <eddie.dong@xxxxxxxxx>
Date: Wed, 1 Jun 2011 11:44:55 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc: Egger <Christoph.Egger@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "Dong, Eddie" <eddie.dong@xxxxxxxxx>, Christoph
Delivery-date: Tue, 31 May 2011 20:46:57 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <osstest-7468-mainreport@xxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <osstest-7468-mainreport@xxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcwgAhjDwUdZ/2BOTBqtK+IA8ti/WgAC9edg
Thread-topic: [Xen-devel] pre-cleanup1 for nested VMX
Extend nhvm_vmcx_guest_intercepts_trap to include errcode to assist decision of 
TRAP_page_fault in VMX.
Thanks, Eddie

diff -r 0c446850d85e xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c    Wed May 11 12:58:04 2011 +0100
+++ b/xen/arch/x86/hvm/hvm.c    Tue May 31 17:58:08 2011 +0800
@@ -1152,7 +1152,7 @@
         return;
     }
 
-    if ( nhvm_vmcx_guest_intercepts_trap(v, trapnr) )
+    if ( nhvm_vmcx_guest_intercepts_trap(v, trapnr, errcode) )
     {
         enum nestedhvm_vmexits nsret;
 
@@ -4175,10 +4175,10 @@
     return -EOPNOTSUPP;
 }
 
-int nhvm_vmcx_guest_intercepts_trap(struct vcpu *v, unsigned int trap)
+int nhvm_vmcx_guest_intercepts_trap(struct vcpu *v, unsigned int trap, int 
errcode)
 {
     if (hvm_funcs.nhvm_vmcx_guest_intercepts_trap)
-        return hvm_funcs.nhvm_vmcx_guest_intercepts_trap(v, trap);
+        return hvm_funcs.nhvm_vmcx_guest_intercepts_trap(v, trap, errcode);
     return -EOPNOTSUPP;
 }
 
diff -r 0c446850d85e xen/arch/x86/hvm/svm/nestedsvm.c
--- a/xen/arch/x86/hvm/svm/nestedsvm.c  Wed May 11 12:58:04 2011 +0100
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c  Tue May 31 17:58:08 2011 +0800
@@ -895,7 +895,7 @@
 }
 
 int
-nsvm_vmcb_guest_intercepts_trap(struct vcpu *v, unsigned int trapnr)
+nsvm_vmcb_guest_intercepts_trap(struct vcpu *v, unsigned int trapnr, int 
errcode)
 {
     return nsvm_vmcb_guest_intercepts_exitcode(v,
         guest_cpu_user_regs(), VMEXIT_EXCEPTION_DE + trapnr);
diff -r 0c446850d85e xen/include/asm-x86/hvm/hvm.h
--- a/xen/include/asm-x86/hvm/hvm.h     Wed May 11 12:58:04 2011 +0100
+++ b/xen/include/asm-x86/hvm/hvm.h     Tue May 31 17:58:08 2011 +0800
@@ -164,7 +164,8 @@
     uint64_t (*nhvm_vcpu_guestcr3)(struct vcpu *v);
     uint64_t (*nhvm_vcpu_hostcr3)(struct vcpu *v);
     uint32_t (*nhvm_vcpu_asid)(struct vcpu *v);
-    int (*nhvm_vmcx_guest_intercepts_trap)(struct vcpu *v, unsigned int 
trapnr);
+    int (*nhvm_vmcx_guest_intercepts_trap)(struct vcpu *v, 
+                               unsigned int trapnr, int errcode);
 
     bool_t (*nhvm_vmcx_hap_enabled)(struct vcpu *v);
 
@@ -443,7 +444,8 @@
 uint32_t nhvm_vcpu_asid(struct vcpu *v);
 
 /* returns true, when l1 guest intercepts the specified trap */
-int nhvm_vmcx_guest_intercepts_trap(struct vcpu *v, unsigned int trapnr);
+int nhvm_vmcx_guest_intercepts_trap(struct vcpu *v, 
+                                    unsigned int trapnr, int errcode);
 
 /* returns true when l1 guest wants to use hap to run l2 guest */
 bool_t nhvm_vmcx_hap_enabled(struct vcpu *v);
diff -r 0c446850d85e xen/include/asm-x86/hvm/svm/nestedsvm.h
--- a/xen/include/asm-x86/hvm/svm/nestedsvm.h   Wed May 11 12:58:04 2011 +0100
+++ b/xen/include/asm-x86/hvm/svm/nestedsvm.h   Tue May 31 17:58:08 2011 +0800
@@ -114,7 +114,8 @@
 uint32_t nsvm_vcpu_asid(struct vcpu *v);
 int nsvm_vmcb_guest_intercepts_exitcode(struct vcpu *v,
     struct cpu_user_regs *regs, uint64_t exitcode);
-int nsvm_vmcb_guest_intercepts_trap(struct vcpu *v, unsigned int trapnr);
+int nsvm_vmcb_guest_intercepts_trap(struct vcpu *v, unsigned int trapnr,
+                                    int errcode);
 bool_t nsvm_vmcb_hap_enabled(struct vcpu *v);
 enum hvm_intblk nsvm_intr_blocked(struct vcpu *v);

Attachment: pre0
Description: pre0

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