Acked-by: Christoph Egger <Christoph.Egger@xxxxxxx>
On 06/09/11 10:25, Eddie Dong wrote:
# HG changeset patch
# User Eddie Dong<eddie.dong@xxxxxxxxx>
# Date 1307607849 -28800
# Node ID 722771a2d429bbf5ab15e2979c0aa767a97caabe
# Parent 0c446850d85e654dfde039a0a1a5acd4e6b3c278
pre-cleanup1: Extend nhvm_vmcx_guest_intercepts_trap to include errcode to
assist decision of TRAP_page_fault in VMX.
Signed-off-by: Qing He<qing.he@xxxxxxxxx>
Signed-off-by: Eddie Dong<eddie.dong@xxxxxxxxx>
diff -r 0c446850d85e -r 722771a2d429 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 Thu Jun 09 16:24:09 2011 +0800
@@ -1152,7 +1152,7 @@ void hvm_inject_exception(unsigned int t
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 @@ uint32_t nhvm_vcpu_asid(struct vcpu *v)
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 -r 722771a2d429 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 Thu Jun 09 16:24:09 2011 +0800
@@ -895,7 +895,7 @@ nsvm_vmcb_guest_intercepts_exitcode(stru
}
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 -r 722771a2d429 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 Thu Jun 09 16:24:09 2011 +0800
@@ -164,7 +164,8 @@ struct hvm_function_table {
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 @@ uint64_t nhvm_vcpu_hostcr3(struct vcpu *
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 -r 722771a2d429 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 Thu Jun 09 16:24:09 2011 +0800
@@ -114,7 +114,8 @@ uint64_t nsvm_vcpu_hostcr3(struct vcpu *
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);
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
--
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85689 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|