ia64/xen-unstable

changeset 14086:e8470a1a01af

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>
author kfraser@localhost.localdomain
date Fri Feb 23 10:35:16 2007 +0000 (2007-02-23)
parents 8407279d3751
children 6510cb03aae1
files xen/arch/x86/hvm/svm/svm.c xen/arch/x86/hvm/vmx/vmx.c xen/arch/x86/mm/shadow/multi.c xen/include/asm-x86/hvm/hvm.h
line diff
     1.1 --- a/xen/arch/x86/hvm/svm/svm.c	Thu Feb 22 21:32:17 2007 -0800
     1.2 +++ b/xen/arch/x86/hvm/svm/svm.c	Fri Feb 23 10:35:16 2007 +0000
     1.3 @@ -982,10 +982,10 @@ static void svm_hvm_inject_exception(
     1.4          v->arch.hvm_svm.vmcb->cr2 = v->arch.hvm_svm.cpu_cr2 = cr2;
     1.5  }
     1.6  
     1.7 -static int svm_injection_pending(struct vcpu *v)
     1.8 +static int svm_event_injection_faulted(struct vcpu *v)
     1.9  {
    1.10      struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
    1.11 -    return (vmcb->vintr.fields.irq || vmcb->exitintinfo.fields.v);
    1.12 +    return vmcb->exitintinfo.fields.v;
    1.13  }
    1.14  
    1.15  int start_svm(void)
    1.16 @@ -1064,7 +1064,7 @@ int start_svm(void)
    1.17      hvm_funcs.init_ap_context = svm_init_ap_context;
    1.18      hvm_funcs.init_hypercall_page = svm_init_hypercall_page;
    1.19  
    1.20 -    hvm_funcs.injection_pending = svm_injection_pending;
    1.21 +    hvm_funcs.event_injection_faulted = svm_event_injection_faulted;
    1.22  
    1.23      hvm_enable();
    1.24  
     2.1 --- a/xen/arch/x86/hvm/vmx/vmx.c	Thu Feb 22 21:32:17 2007 -0800
     2.2 +++ b/xen/arch/x86/hvm/vmx/vmx.c	Fri Feb 23 10:35:16 2007 +0000
     2.3 @@ -990,16 +990,14 @@ static void vmx_update_vtpr(struct vcpu 
     2.4      /* VMX doesn't have a V_TPR field */
     2.5  }
     2.6  
     2.7 -static int vmx_injection_pending(struct vcpu *v)
     2.8 +static int vmx_event_injection_faulted(struct vcpu *v)
     2.9  {
    2.10      unsigned int idtv_info_field;
    2.11  
    2.12      ASSERT(v == current);
    2.13  
    2.14      idtv_info_field = __vmread(IDT_VECTORING_INFO_FIELD);
    2.15 -
    2.16 -    return (v->arch.hvm_vmx.vector_injected ||
    2.17 -            (idtv_info_field & INTR_INFO_VALID_MASK));
    2.18 +    return (idtv_info_field & INTR_INFO_VALID_MASK);
    2.19  }
    2.20  
    2.21  /* Setup HVM interfaces */
    2.22 @@ -1038,7 +1036,7 @@ static void vmx_setup_hvm_funcs(void)
    2.23  
    2.24      hvm_funcs.init_hypercall_page = vmx_init_hypercall_page;
    2.25  
    2.26 -    hvm_funcs.injection_pending = vmx_injection_pending;
    2.27 +    hvm_funcs.event_injection_faulted = vmx_event_injection_faulted;
    2.28  }
    2.29  
    2.30  int start_vmx(void)
     3.1 --- a/xen/arch/x86/mm/shadow/multi.c	Thu Feb 22 21:32:17 2007 -0800
     3.2 +++ b/xen/arch/x86/mm/shadow/multi.c	Fri Feb 23 10:35:16 2007 +0000
     3.3 @@ -2909,7 +2909,7 @@ static int sh_page_fault(struct vcpu *v,
     3.4           * stack is currently considered to be a page table, so we should
     3.5           * unshadow the faulting page before exiting.
     3.6           */
     3.7 -        if ( unlikely(hvm_injection_pending(v)) )
     3.8 +        if ( unlikely(hvm_event_injection_faulted(v)) )
     3.9          {
    3.10              gdprintk(XENLOG_DEBUG, "write to pagetable during event "
    3.11                       "injection: cr2=%#lx, mfn=%#lx\n", 
     4.1 --- a/xen/include/asm-x86/hvm/hvm.h	Thu Feb 22 21:32:17 2007 -0800
     4.2 +++ b/xen/include/asm-x86/hvm/hvm.h	Fri Feb 23 10:35:16 2007 +0000
     4.3 @@ -135,7 +135,7 @@ struct hvm_function_table {
     4.4  
     4.5      void (*init_hypercall_page)(struct domain *d, void *hypercall_page);
     4.6  
     4.7 -    int  (*injection_pending)(struct vcpu *v);
     4.8 +    int  (*event_injection_faulted)(struct vcpu *v);
     4.9  };
    4.10  
    4.11  extern struct hvm_function_table hvm_funcs;
    4.12 @@ -264,9 +264,9 @@ hvm_inject_exception(unsigned int trapnr
    4.13  
    4.14  int hvm_bringup_ap(int vcpuid, int trampoline_vector);
    4.15  
    4.16 -static inline int hvm_injection_pending(struct vcpu *v)
    4.17 +static inline int hvm_event_injection_faulted(struct vcpu *v)
    4.18  {
    4.19 -    return hvm_funcs.injection_pending(v);
    4.20 +    return hvm_funcs.event_injection_faulted(v);
    4.21  }
    4.22  
    4.23  #endif /* __ASM_X86_HVM_HVM_H__ */