All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Radim Krčmář" <rkrcmar@redhat.com>, linux-kernel@vger.kernel.org
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: x86: preserve x2APIC LDR on INIT
Date: Tue, 26 May 2015 12:38:10 +0200	[thread overview]
Message-ID: <55644D12.6020301@redhat.com> (raw)
In-Reply-To: <1432315330-20872-1-git-send-email-rkrcmar@redhat.com>



On 22/05/2015 19:22, Radim Krčmář wrote:
> Logical x2APIC stops working if we rewrite it with zeros.
> The best references are SDM April 2015: 10.12.10.1 Logical Destination
> Mode in x2APIC Mode
> 
>   [...], the LDR are initialized by hardware based on the value of
>   x2APIC ID upon x2APIC state transitions.
> 
> and SDM April 2015: 10.12.10.2 Deriving Logical x2APIC ID from the Local
> x2APIC ID
> 
>   The LDR initialization occurs whenever the x2APIC mode is enabled
> 
> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
> ---
>  arch/x86/kvm/lapic.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
> index c2a7d8a7a414..c789e00dfa8b 100644
> --- a/arch/x86/kvm/lapic.c
> +++ b/arch/x86/kvm/lapic.c
> @@ -1594,7 +1594,8 @@ void kvm_lapic_reset(struct kvm_vcpu *vcpu, bool init_event)
>  	apic_set_reg(apic, APIC_DFR, 0xffffffffU);
>  	apic_set_spiv(apic, 0xff);
>  	apic_set_reg(apic, APIC_TASKPRI, 0);
> -	kvm_apic_set_ldr(apic, 0);
> +	if (!apic_x2apic_mode(apic))
> +		kvm_apic_set_ldr(apic, 0);
>  	apic_set_reg(apic, APIC_ESR, 0);
>  	apic_set_reg(apic, APIC_ICR, 0);
>  	apic_set_reg(apic, APIC_ICR2, 0);
> 

Applied, thanks.

Paolo

      reply	other threads:[~2015-05-26 10:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-22 17:22 [PATCH] KVM: x86: preserve x2APIC LDR on INIT Radim Krčmář
2015-05-26 10:38 ` Paolo Bonzini [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=55644D12.6020301@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rkrcmar@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 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.