mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
x86/hvm: 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@intel.com> Signed-off-by: Eddie Dong <eddie.dong@intel.com> Acked-by: Christoph Egger <Christoph.Egger@amd.com> Acked-by: Tim Deegan <Tim.Deegan@citrix.com> Committed-by: Tim Deegan <Tim.Deegan@citrix.com>
This commit is contained in:
1 parent
30da90d828
commit
dcbb72dd11
4 files changed
+10
-7
No files matched your search
@@ -1145,7 +1145,7 @@ void hvm_inject_exception(unsigned int trapnr, int errcode, unsigned long cr2)
|
||||
return;
|
||||
}
|
||||
|
||||
if ( nhvm_vmcx_guest_intercepts_trap(v, trapnr) )
|
||||
if ( nhvm_vmcx_guest_intercepts_trap(v, trapnr, errcode) )
|
||||
{
|
||||
enum nestedhvm_vmexits nsret;
|
||||
|
||||
@@ -4137,10 +4137,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;
|
||||
}
|
||||
|
||||
|
||||
@@ -955,7 +955,7 @@ nsvm_vmcb_guest_intercepts_exitcode(struct vcpu *v,
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -461,7 +462,8 @@ uint64_t nhvm_vcpu_hostcr3(struct vcpu *v);
|
||||
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);
|
||||
|
||||
@@ -117,7 +117,8 @@ uint64_t nsvm_vcpu_hostcr3(struct vcpu *v);
|
||||
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);
|
||||
|
||||
|
||||