public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Jan Kiszka <jan.kiszka@web.de>
Cc: Gleb Natapov <gleb@kernel.org>,
	Paolo Bonzini <pbonzini@redhat.com>, kvm <kvm@vger.kernel.org>
Subject: Re: [PATCH] KVM: x86: Fix APIC map calculation after re-enabling
Date: Mon, 30 Dec 2013 18:59:09 -0200	[thread overview]
Message-ID: <20131230205909.GA10059@amt.cnet> (raw)
In-Reply-To: <52BF7AFA.4050806@web.de>

On Sun, Dec 29, 2013 at 02:29:30AM +0100, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> Update arch.apic_base before triggering recalculate_apic_map. Otherwise
> the recalculation will work against the previous state of the APIC and
> will fail to build the correct map when an APIC is hardware-enabled
> again.
> 
> This fixes a regression of 1e08ec4a13.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> 
> Stable material.
> 
>  arch/x86/kvm/lapic.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
> index 5439117..ab58ea4 100644
> --- a/arch/x86/kvm/lapic.c
> +++ b/arch/x86/kvm/lapic.c
> @@ -1346,6 +1346,10 @@ void kvm_lapic_set_base(struct kvm_vcpu *vcpu, u64 value)
>  		return;
>  	}
>  
> +	if (!kvm_vcpu_is_bsp(apic->vcpu))
> +		value &= ~MSR_IA32_APICBASE_BSP;
> +	vcpu->arch.apic_base = value;
> +
>  	/* update jump label if enable bit changes */
>  	if ((vcpu->arch.apic_base ^ value) & MSR_IA32_APICBASE_ENABLE) {
>  		if (value & MSR_IA32_APICBASE_ENABLE)
> @@ -1355,10 +1359,6 @@ void kvm_lapic_set_base(struct kvm_vcpu *vcpu, u64 value)
>  		recalculate_apic_map(vcpu->kvm);
>  	}
>  
> -	if (!kvm_vcpu_is_bsp(apic->vcpu))
> -		value &= ~MSR_IA32_APICBASE_BSP;
> -
> -	vcpu->arch.apic_base = value;
>  	if ((old_value ^ value) & X2APIC_ENABLE) {
>  		if (value & X2APIC_ENABLE) {
>  			u32 id = kvm_apic_id(apic);
> -- 

Applied to master branch, thanks.


      reply	other threads:[~2013-12-30 20:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-29  1:29 [PATCH] KVM: x86: Fix APIC map calculation after re-enabling Jan Kiszka
2013-12-30 20:59 ` Marcelo Tosatti [this message]

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=20131230205909.GA10059@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=gleb@kernel.org \
    --cc=jan.kiszka@web.de \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox