From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH] kvm: x86: fix apic_base enable check Date: Wed, 15 Jan 2014 13:40:58 +0100 Message-ID: <52D681DA.5010005@redhat.com> References: <1389789599-20729-1-git-send-email-drjones@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: jan.kiszka@siemens.com, mtosatti@redhat.com, kvm@vger.kernel.org To: Andrew Jones Return-path: Received: from mx1.redhat.com ([209.132.183.28]:42893 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751954AbaAOMlF (ORCPT ); Wed, 15 Jan 2014 07:41:05 -0500 In-Reply-To: <1389789599-20729-1-git-send-email-drjones@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Il 15/01/2014 13:39, Andrew Jones ha scritto: > Commit e66d2ae7c67bd moved the assignment > vcpu->arch.apic_base = value above a condition with > (vcpu->arch.apic_base ^ value), causing that check > to always fail. Use old_value, vcpu->arch.apic_base's > old value, in the condition instead. > > Signed-off-by: Andrew Jones > --- > arch/x86/kvm/lapic.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c > index 1673940cf9c35..775702f649ca6 100644 > --- a/arch/x86/kvm/lapic.c > +++ b/arch/x86/kvm/lapic.c > @@ -1355,7 +1355,7 @@ void kvm_lapic_set_base(struct kvm_vcpu *vcpu, u64 value) > vcpu->arch.apic_base = value; > > /* update jump label if enable bit changes */ > - if ((vcpu->arch.apic_base ^ value) & MSR_IA32_APICBASE_ENABLE) { > + if ((old_value ^ value) & MSR_IA32_APICBASE_ENABLE) { > if (value & MSR_IA32_APICBASE_ENABLE) > static_key_slow_dec_deferred(&apic_hw_disabled); > else > Thanks Drew, applying this patch to master branch.