In the previous code, the variable sw_apic_disabled influences recalculate_apic_map. Now it never has accessed sw_apic_disabled in recalculate_apic_map. Signed-off-by: Peng Hao <peng.hao2@xxxxxxxxxx> --- arch/x86/kvm/lapic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index b5cd846..d37a5fe 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@ -247,8 +247,7 @@ static inline void apic_set_spiv(struct kvm_lapic *apic, u32 val) if (enabled != apic->sw_enabled) { apic->sw_enabled = enabled; if (enabled) { - static_key_slow_dec_deferred(&apic_sw_disabled); - recalculate_apic_map(apic->vcpu->kvm); + static_key_slow_dec_deferred(&apic_sw_disabled); } else static_key_slow_inc(&apic_sw_disabled.key); } -- 1.8.3.1