Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1455622

[PATCH 2/2] KVM: lapic: don't recalculate apic map table twice when enabling LAPIC

From Wanpeng Li <kernellwp@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 2/2] KVM: lapic: don't recalculate apic map table twice when enabling LAPIC
Date 2016-08-03 06:10 +0200
Message-ID <s1VFf-5Kv-17@gated-at.bofh.it> (permalink)
References <s1VFf-5Kv-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Wanpeng Li <wanpeng.li@hotmail.com>

APIC map table is recalculated during reset APIC ID to the initial value
when enabling LAPIC. This patch move the recalculate_apic_map() to the 
next branch since we don't need to recalculate apic map twice in current
codes.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
---
 arch/x86/kvm/lapic.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 0120a58..d676f4b 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -1760,9 +1760,10 @@ void kvm_lapic_set_base(struct kvm_vcpu *vcpu, u64 value)
 		if (value & MSR_IA32_APICBASE_ENABLE) {
 			kvm_apic_set_xapic_id(apic, vcpu->vcpu_id);
 			static_key_slow_dec_deferred(&apic_hw_disabled);
-		} else
+		} else {
 			static_key_slow_inc(&apic_hw_disabled.key);
-		recalculate_apic_map(vcpu->kvm);
+			recalculate_apic_map(vcpu->kvm);
+		}
 	}
 
 	if ((old_value ^ value) & X2APIC_ENABLE) {
-- 
1.9.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] KVM: lapic: fix access preemption timer stuff even if kernel_irqchip=off Wanpeng Li <kernellwp@gmail.com> - 2016-08-03 06:10 +0200
  [PATCH 2/2] KVM: lapic: don't recalculate apic map table twice when enabling LAPIC Wanpeng Li <kernellwp@gmail.com> - 2016-08-03 06:10 +0200
    Re: [PATCH 2/2] KVM: lapic: don't recalculate apic map table twice  when enabling LAPIC Radim Krčmář <rkrcmar@redhat.com> - 2016-08-03 12:00 +0200
  Re: [PATCH 1/2] KVM: lapic: fix access preemption timer stuff even  if kernel_irqchip=off Radim Krčmář <rkrcmar@redhat.com> - 2016-08-03 12:20 +0200
    Re: [PATCH 1/2] KVM: lapic: fix access preemption timer stuff even if kernel_irqchip=off Wanpeng Li <kernellwp@gmail.com> - 2016-08-03 13:00 +0200
  Re: [PATCH 1/2] KVM: lapic: fix access preemption timer stuff even if  kernel_irqchip=off Paolo Bonzini <pbonzini@redhat.com> - 2016-08-04 14:30 +0200

csiph-web