In the previous code, the variable sw_apic_disabled is accessed in recalculate_apic_map. Now it has never accessed sw_apic_disabled, so it is unnecessary to call recalculate_apic_map when sw_apic_disabled changes. 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