[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] x86/HVM: EOI handling function adjustments
commit e722f1de2c82af870ba1caeb4fa9db45de53f4c7 Author: Jan Beulich <jbeulich@xxxxxxxx> AuthorDate: Mon Jun 22 11:34:57 2015 +0200 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Mon Jun 22 11:34:57 2015 +0200 x86/HVM: EOI handling function adjustments The vector parameters are more usefully u8 right away. This is particularly important for the vioapic_update_EOI() invocation from vioapic_write() (which luckily is only a latent issue, as VIOAPIC_VERSION_ID is still hard coded to 0x11 right now). But it at once allows simplifying VMX's EXIT_REASON_EOI_INDUCED handling (the kind of pointless helper function should have been static anyway; not being use for anything else, it gets removed altogether). Plus vlapic_handle_EOI() (now renamed for that purpose) can be used as the tail of vlapic_EOI_set() instead of duplicating that code. Finally replace a stray current->domain use in vlapic_handle_EOI(). Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> --- xen/arch/x86/hvm/vioapic.c | 2 +- xen/arch/x86/hvm/vlapic.c | 13 ++++++------- xen/arch/x86/hvm/vmx/vmx.c | 20 +++----------------- xen/include/asm-x86/hvm/vioapic.h | 2 +- xen/include/asm-x86/hvm/vlapic.h | 2 +- 5 files changed, 12 insertions(+), 27 deletions(-) diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c index 1e48110..f903420 100644 --- a/xen/arch/x86/hvm/vioapic.c +++ b/xen/arch/x86/hvm/vioapic.c @@ -386,7 +386,7 @@ void vioapic_irq_positive_edge(struct domain *d, unsigned int irq) } } -void vioapic_update_EOI(struct domain *d, int vector) +void vioapic_update_EOI(struct domain *d, u8 vector) { struct hvm_hw_vioapic *vioapic = domain_vioapic(d); struct hvm_irq *hvm_irq = &d->arch.hvm_domain.irq; diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c index 92b0fa8..fbc51d1 100644 --- a/xen/arch/x86/hvm/vlapic.c +++ b/xen/arch/x86/hvm/vlapic.c @@ -421,18 +421,17 @@ void vlapic_EOI_set(struct vlapic *vlapic) if ( hvm_funcs.handle_eoi ) hvm_funcs.handle_eoi(vector); - if ( vlapic_test_and_clear_vector(vector, &vlapic->regs->data[APIC_TMR]) ) - vioapic_update_EOI(vlapic_domain(vlapic), vector); - - hvm_dpci_msi_eoi(current->domain, vector); + vlapic_handle_EOI(vlapic, vector); } -void vlapic_handle_EOI_induced_exit(struct vlapic *vlapic, int vector) +void vlapic_handle_EOI(struct vlapic *vlapic, u8 vector) { + struct domain *d = vlapic_domain(vlapic); + if ( vlapic_test_and_clear_vector(vector, &vlapic->regs->data[APIC_TMR]) ) - vioapic_update_EOI(vlapic_domain(vlapic), vector); + vioapic_update_EOI(d, vector); - hvm_dpci_msi_eoi(current->domain, vector); + hvm_dpci_msi_eoi(d, vector); } static bool_t is_multicast_dest(struct vlapic *vlapic, unsigned int short_hand, diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index 0837627..fc29b89 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -2683,17 +2683,6 @@ static int vmx_handle_apic_write(void) return vlapic_apicv_write(current, exit_qualification & 0xfff); } -/* - * When "Virtual Interrupt Delivery" is enabled, this function is used - * to handle EOI-induced VM exit - */ -void vmx_handle_EOI_induced_exit(struct vlapic *vlapic, int vector) -{ - ASSERT(cpu_has_vmx_virtual_intr_delivery); - - vlapic_handle_EOI_induced_exit(vlapic, vector); -} - void vmx_vmexit_handler(struct cpu_user_regs *regs) { unsigned long exit_qualification, exit_reason, idtv_info, intr_info = 0; @@ -3127,15 +3116,12 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs) break; case EXIT_REASON_EOI_INDUCED: - { - int vector; - __vmread(EXIT_QUALIFICATION, &exit_qualification); - vector = exit_qualification & 0xff; - vmx_handle_EOI_induced_exit(vcpu_vlapic(v), vector); + ASSERT(cpu_has_vmx_virtual_intr_delivery); + + vlapic_handle_EOI(vcpu_vlapic(v), exit_qualification); break; - } case EXIT_REASON_IO_INSTRUCTION: __vmread(EXIT_QUALIFICATION, &exit_qualification); diff --git a/xen/include/asm-x86/hvm/vioapic.h b/xen/include/asm-x86/hvm/vioapic.h index a18ffd0..6bf21e8 100644 --- a/xen/include/asm-x86/hvm/vioapic.h +++ b/xen/include/asm-x86/hvm/vioapic.h @@ -62,6 +62,6 @@ int vioapic_init(struct domain *d); void vioapic_deinit(struct domain *d); void vioapic_reset(struct domain *d); void vioapic_irq_positive_edge(struct domain *d, unsigned int irq); -void vioapic_update_EOI(struct domain *d, int vector); +void vioapic_update_EOI(struct domain *d, u8 vector); #endif /* __ASM_X86_HVM_VIOAPIC_H__ */ diff --git a/xen/include/asm-x86/hvm/vlapic.h b/xen/include/asm-x86/hvm/vlapic.h index cfe9bdb..bbcd196 100644 --- a/xen/include/asm-x86/hvm/vlapic.h +++ b/xen/include/asm-x86/hvm/vlapic.h @@ -127,7 +127,7 @@ uint32_t vlapic_set_ppr(struct vlapic *vlapic); void vlapic_adjust_i8259_target(struct domain *d); void vlapic_EOI_set(struct vlapic *vlapic); -void vlapic_handle_EOI_induced_exit(struct vlapic *vlapic, int vector); +void vlapic_handle_EOI(struct vlapic *vlapic, u8 vector); void vlapic_ipi(struct vlapic *vlapic, uint32_t icr_low, uint32_t icr_high); -- generated by git-patchbot for /home/xen/git/xen.git#master _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |