diff options
| author | Jan H. Schönherr <jschoenh@amazon.de> | 2017-05-20 13:24:32 +0200 | 
|---|---|---|
| committer | Paolo Bonzini <pbonzini@redhat.com> | 2017-05-26 18:01:21 +0200 | 
| commit | 52b5419016997f2960e9c8b6584c4acb3875d126 (patch) | |
| tree | 8179887b77543d7caae5653560f5f1c95542e44b /arch | |
| parent | e1d39b17e044e8ae819827810d87d809ba5f58c0 (diff) | |
KVM: x86: Fix virtual wire mode
Intel SDM says, that at most one LAPIC should be configured with ExtINT
delivery. KVM configures all LAPICs this way. This causes pic_unlock()
to kick the first available vCPU from the internal KVM data structures.
If this vCPU is not the BSP, but some not-yet-booted AP, the BSP may
never realize that there is an interrupt.
Fix that by enabling ExtINT delivery only for the BSP.
This allows booting a Linux guest without a TSC in the above situation.
Otherwise the BSP gets stuck in calibrate_delay_converge().
Signed-off-by: Jan H. Schönherr <jschoenh@amazon.de>
Reviewed-by: Wanpeng Li <wanpeng.li@hotmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/x86/kvm/lapic.c | 3 | 
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index 6e6f345adfe6..d24c8742d9b0 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@ -1936,7 +1936,8 @@ void kvm_lapic_reset(struct kvm_vcpu *vcpu, bool init_event)  	for (i = 0; i < KVM_APIC_LVT_NUM; i++)  		kvm_lapic_set_reg(apic, APIC_LVTT + 0x10 * i, APIC_LVT_MASKED);  	apic_update_lvtt(apic); -	if (kvm_check_has_quirk(vcpu->kvm, KVM_X86_QUIRK_LINT0_REENABLED)) +	if (kvm_vcpu_is_reset_bsp(vcpu) && +	    kvm_check_has_quirk(vcpu->kvm, KVM_X86_QUIRK_LINT0_REENABLED))  		kvm_lapic_set_reg(apic, APIC_LVT0,  			     SET_APIC_DELIVERY_MODE(0, APIC_MODE_EXTINT));  	apic_manage_nmi_watchdog(apic, kvm_lapic_get_reg(apic, APIC_LVT0));  | 
