All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Radim Krčmář" <rkrcmar@redhat.com>
To: Wanpeng Li <kernellwp@gmail.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	Wanpeng Li <wanpeng.li@hotmail.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH 2/2] KVM: lapic: don't recalculate apic map table twice when enabling LAPIC
Date: Wed, 3 Aug 2016 11:57:51 +0200	[thread overview]
Message-ID: <20160803095750.GB22251@potion> (raw)
In-Reply-To: <1470197053-3581-2-git-send-email-wanpeng.li@hotmail.com>

2016-08-03 12:04+0800, Wanpeng Li:
> 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>
> ---

Reviewed-by: Radim Krčmář <rkrcmar@redhat.com>

> diff --git 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
> 

  reply	other threads:[~2016-08-03  9:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-03  4:04 [PATCH 1/2] KVM: lapic: fix access preemption timer stuff even if kernel_irqchip=off Wanpeng Li
2016-08-03  4:04 ` [PATCH 2/2] KVM: lapic: don't recalculate apic map table twice when enabling LAPIC Wanpeng Li
2016-08-03  9:57   ` Radim Krčmář [this message]
2016-08-03  9:55 ` [PATCH 1/2] KVM: lapic: fix access preemption timer stuff even if kernel_irqchip=off Radim Krčmář
2016-08-03 10:03   ` Wanpeng Li
2016-08-04 12:20 ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160803095750.GB22251@potion \
    --to=rkrcmar@redhat.com \
    --cc=kernellwp@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=wanpeng.li@hotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.