mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
1 parent
e76ff6c156
commit
e722f1de2c
5 files changed
+13
-28
No files matched your search
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
if ( vlapic_test_and_clear_vector(vector, &vlapic->regs->data[APIC_TMR]) )
|
||||
vioapic_update_EOI(vlapic_domain(vlapic), vector);
|
||||
struct domain *d = vlapic_domain(vlapic);
|
||||
|
||||
hvm_dpci_msi_eoi(current->domain, vector);
|
||||
if ( vlapic_test_and_clear_vector(vector, &vlapic->regs->data[APIC_TMR]) )
|
||||
vioapic_update_EOI(d, vector);
|
||||
|
||||
hvm_dpci_msi_eoi(d, vector);
|
||||
}
|
||||
|
||||
static bool_t is_multicast_dest(struct vlapic *vlapic, unsigned int short_hand,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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__ */
|
||||
@@ -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);
|
||||
|
||||
|
||||