lapic.c (1d8c681fb6ed459128ab9d5e36adb7ec06a26aea) lapic.c (987f625e0799c9666ce0a0e18c2d0c001db96fad)
1// SPDX-License-Identifier: GPL-2.0-only
2
3/*
4 * Local APIC virtualization
5 *
6 * Copyright (C) 2006 Qumranet, Inc.
7 * Copyright (C) 2007 Novell
8 * Copyright (C) 2007 Intel

--- 2079 unchanged lines hidden (view full) ---

2088 if (kvm_lapic_get_reg(apic, APIC_LVR) & APIC_LVR_DIRECTED_EOI)
2089 mask |= APIC_SPIV_DIRECTED_EOI;
2090 apic_set_spiv(apic, val & mask);
2091 if (!(val & APIC_SPIV_APIC_ENABLED)) {
2092 int i;
2093 u32 lvt_val;
2094
2095 for (i = 0; i < KVM_APIC_MAX_NR_LVT_ENTRIES; i++) {
1// SPDX-License-Identifier: GPL-2.0-only
2
3/*
4 * Local APIC virtualization
5 *
6 * Copyright (C) 2006 Qumranet, Inc.
7 * Copyright (C) 2007 Novell
8 * Copyright (C) 2007 Intel

--- 2079 unchanged lines hidden (view full) ---

2088 if (kvm_lapic_get_reg(apic, APIC_LVR) & APIC_LVR_DIRECTED_EOI)
2089 mask |= APIC_SPIV_DIRECTED_EOI;
2090 apic_set_spiv(apic, val & mask);
2091 if (!(val & APIC_SPIV_APIC_ENABLED)) {
2092 int i;
2093 u32 lvt_val;
2094
2095 for (i = 0; i < KVM_APIC_MAX_NR_LVT_ENTRIES; i++) {
2096 lvt_val = kvm_lapic_get_reg(apic,
2097 APIC_LVTT + 0x10 * i);
2098 kvm_lapic_set_reg(apic, APIC_LVTT + 0x10 * i,
2096 lvt_val = kvm_lapic_get_reg(apic, APIC_LVTx(i));
2097 kvm_lapic_set_reg(apic, APIC_LVTx(i),
2099 lvt_val | APIC_LVT_MASKED);
2100 }
2101 apic_update_lvtt(apic);
2102 atomic_set(&apic->lapic_timer.pending, 0);
2103
2104 }
2105 break;
2106 }

--- 299 unchanged lines hidden (view full) ---

2406 hrtimer_cancel(&apic->lapic_timer.timer);
2407
2408 /* The xAPIC ID is set at RESET even if the APIC was already enabled. */
2409 if (!init_event)
2410 kvm_apic_set_xapic_id(apic, vcpu->vcpu_id);
2411 kvm_apic_set_version(apic->vcpu);
2412
2413 for (i = 0; i < KVM_APIC_MAX_NR_LVT_ENTRIES; i++)
2098 lvt_val | APIC_LVT_MASKED);
2099 }
2100 apic_update_lvtt(apic);
2101 atomic_set(&apic->lapic_timer.pending, 0);
2102
2103 }
2104 break;
2105 }

--- 299 unchanged lines hidden (view full) ---

2405 hrtimer_cancel(&apic->lapic_timer.timer);
2406
2407 /* The xAPIC ID is set at RESET even if the APIC was already enabled. */
2408 if (!init_event)
2409 kvm_apic_set_xapic_id(apic, vcpu->vcpu_id);
2410 kvm_apic_set_version(apic->vcpu);
2411
2412 for (i = 0; i < KVM_APIC_MAX_NR_LVT_ENTRIES; i++)
2414 kvm_lapic_set_reg(apic, APIC_LVTT + 0x10 * i, APIC_LVT_MASKED);
2413 kvm_lapic_set_reg(apic, APIC_LVTx(i), APIC_LVT_MASKED);
2415 apic_update_lvtt(apic);
2416 if (kvm_vcpu_is_reset_bsp(vcpu) &&
2417 kvm_check_has_quirk(vcpu->kvm, KVM_X86_QUIRK_LINT0_REENABLED))
2418 kvm_lapic_set_reg(apic, APIC_LVT0,
2419 SET_APIC_DELIVERY_MODE(0, APIC_MODE_EXTINT));
2420 apic_manage_nmi_watchdog(apic, kvm_lapic_get_reg(apic, APIC_LVT0));
2421
2422 kvm_apic_set_dfr(apic, 0xffffffffU);

--- 625 unchanged lines hidden ---
2414 apic_update_lvtt(apic);
2415 if (kvm_vcpu_is_reset_bsp(vcpu) &&
2416 kvm_check_has_quirk(vcpu->kvm, KVM_X86_QUIRK_LINT0_REENABLED))
2417 kvm_lapic_set_reg(apic, APIC_LVT0,
2418 SET_APIC_DELIVERY_MODE(0, APIC_MODE_EXTINT));
2419 apic_manage_nmi_watchdog(apic, kvm_lapic_get_reg(apic, APIC_LVT0));
2420
2421 kvm_apic_set_dfr(apic, 0xffffffffU);

--- 625 unchanged lines hidden ---