mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
hvm: Rename injection_pending() to event_injection_faulted().
Fix the VMX and SVM handlers to reflect the new semantics (which is what is actually required by the one caller, in shadow fault path). Signed-off-by: Keir Fraser <keir@xensource.com>
This commit is contained in:
1 parent
11e8d023ca
commit
66c10a7e53
4 files changed
+10
-12
No files matched your search
@@ -982,10 +982,10 @@ static void svm_hvm_inject_exception(
|
||||
v->arch.hvm_svm.vmcb->cr2 = v->arch.hvm_svm.cpu_cr2 = cr2;
|
||||
}
|
||||
|
||||
static int svm_injection_pending(struct vcpu *v)
|
||||
static int svm_event_injection_faulted(struct vcpu *v)
|
||||
{
|
||||
struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
|
||||
return (vmcb->vintr.fields.irq || vmcb->exitintinfo.fields.v);
|
||||
return vmcb->exitintinfo.fields.v;
|
||||
}
|
||||
|
||||
int start_svm(void)
|
||||
@@ -1064,7 +1064,7 @@ int start_svm(void)
|
||||
hvm_funcs.init_ap_context = svm_init_ap_context;
|
||||
hvm_funcs.init_hypercall_page = svm_init_hypercall_page;
|
||||
|
||||
hvm_funcs.injection_pending = svm_injection_pending;
|
||||
hvm_funcs.event_injection_faulted = svm_event_injection_faulted;
|
||||
|
||||
hvm_enable();
|
||||
|
||||
|
||||
@@ -990,16 +990,14 @@ static void vmx_update_vtpr(struct vcpu *v, unsigned long value)
|
||||
/* VMX doesn't have a V_TPR field */
|
||||
}
|
||||
|
||||
static int vmx_injection_pending(struct vcpu *v)
|
||||
static int vmx_event_injection_faulted(struct vcpu *v)
|
||||
{
|
||||
unsigned int idtv_info_field;
|
||||
|
||||
ASSERT(v == current);
|
||||
|
||||
idtv_info_field = __vmread(IDT_VECTORING_INFO_FIELD);
|
||||
|
||||
return (v->arch.hvm_vmx.vector_injected ||
|
||||
(idtv_info_field & INTR_INFO_VALID_MASK));
|
||||
return (idtv_info_field & INTR_INFO_VALID_MASK);
|
||||
}
|
||||
|
||||
/* Setup HVM interfaces */
|
||||
@@ -1038,7 +1036,7 @@ static void vmx_setup_hvm_funcs(void)
|
||||
|
||||
hvm_funcs.init_hypercall_page = vmx_init_hypercall_page;
|
||||
|
||||
hvm_funcs.injection_pending = vmx_injection_pending;
|
||||
hvm_funcs.event_injection_faulted = vmx_event_injection_faulted;
|
||||
}
|
||||
|
||||
int start_vmx(void)
|
||||
|
||||
@@ -2909,7 +2909,7 @@ static int sh_page_fault(struct vcpu *v,
|
||||
* stack is currently considered to be a page table, so we should
|
||||
* unshadow the faulting page before exiting.
|
||||
*/
|
||||
if ( unlikely(hvm_injection_pending(v)) )
|
||||
if ( unlikely(hvm_event_injection_faulted(v)) )
|
||||
{
|
||||
gdprintk(XENLOG_DEBUG, "write to pagetable during event "
|
||||
"injection: cr2=%#lx, mfn=%#lx\n",
|
||||
|
||||
@@ -135,7 +135,7 @@ struct hvm_function_table {
|
||||
|
||||
void (*init_hypercall_page)(struct domain *d, void *hypercall_page);
|
||||
|
||||
int (*injection_pending)(struct vcpu *v);
|
||||
int (*event_injection_faulted)(struct vcpu *v);
|
||||
};
|
||||
|
||||
extern struct hvm_function_table hvm_funcs;
|
||||
@@ -264,9 +264,9 @@ hvm_inject_exception(unsigned int trapnr, int errcode, unsigned long cr2)
|
||||
|
||||
int hvm_bringup_ap(int vcpuid, int trampoline_vector);
|
||||
|
||||
static inline int hvm_injection_pending(struct vcpu *v)
|
||||
static inline int hvm_event_injection_faulted(struct vcpu *v)
|
||||
{
|
||||
return hvm_funcs.injection_pending(v);
|
||||
return hvm_funcs.event_injection_faulted(v);
|
||||
}
|
||||
|
||||
#endif /* __ASM_X86_HVM_HVM_H__ */
|
||||