diff options
author | Jan Beulich <jbeulich@suse.com> | 2013-07-17 08:47:18 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2013-07-17 08:47:18 +0200 |
commit | 303066fdb1e4fe816e48acd665453f58b8399e81 (patch) | |
tree | 61cd57057814cf581bc20e42476b702f8e9f8cdf /xen/arch/x86/hvm | |
parent | 85047d9e4f4afeb73bca1e98f705a2f4f1d51c03 (diff) | |
download | xen-303066fdb1e4fe816e48acd665453f58b8399e81.tar.gz xen-303066fdb1e4fe816e48acd665453f58b8399e81.tar.bz2 xen-303066fdb1e4fe816e48acd665453f58b8399e81.zip |
VMX: fix interaction of APIC-V and Viridian emulation
Viridian using a synthetic MSR for issuing EOI notifications bypasses
the normal in-processor handling, which would clear
GUEST_INTR_STATUS.SVI. Hence we need to do this in software in order
for future interrupts to get delivered.
Based on analysis by Yang Z Zhang <yang.z.zhang@intel.com>.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Yang Zhang <yang.z.zhang@intel.com>
Diffstat (limited to 'xen/arch/x86/hvm')
-rw-r--r-- | xen/arch/x86/hvm/vlapic.c | 3 | ||||
-rw-r--r-- | xen/arch/x86/hvm/vmx/vmx.c | 15 |
2 files changed, 17 insertions, 1 deletions
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c index e039ed0945..7a154f9ac2 100644 --- a/xen/arch/x86/hvm/vlapic.c +++ b/xen/arch/x86/hvm/vlapic.c @@ -386,6 +386,9 @@ void vlapic_EOI_set(struct vlapic *vlapic) vlapic_clear_vector(vector, &vlapic->regs->data[APIC_ISR]); + 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); diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index d6540e3d79..24098e468d 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -1505,6 +1505,15 @@ static void vmx_sync_pir_to_irr(struct vcpu *v) vlapic_set_vector(i, &vlapic->regs->data[APIC_IRR]); } +static void vmx_handle_eoi(u8 vector) +{ + unsigned long status = __vmread(GUEST_INTR_STATUS); + + /* We need to clear the SVI field. */ + status &= VMX_GUEST_INTR_STATUS_SUBFIELD_BITMASK; + __vmwrite(GUEST_INTR_STATUS, status); +} + static struct hvm_function_table __initdata vmx_function_table = { .name = "VMX", .cpu_up_prepare = vmx_cpu_up_prepare, @@ -1557,6 +1566,7 @@ static struct hvm_function_table __initdata vmx_function_table = { .process_isr = vmx_process_isr, .deliver_posted_intr = vmx_deliver_posted_intr, .sync_pir_to_irr = vmx_sync_pir_to_irr, + .handle_eoi = vmx_handle_eoi, .nhvm_hap_walk_L1_p2m = nvmx_hap_walk_L1_p2m, }; @@ -1583,7 +1593,10 @@ const struct hvm_function_table * __init start_vmx(void) setup_ept_dump(); } - + + if ( !cpu_has_vmx_virtual_intr_delivery ) + vmx_function_table.handle_eoi = NULL; + if ( cpu_has_vmx_posted_intr_processing ) alloc_direct_apic_vector(&posted_intr_vector, event_check_interrupt); else |