From: "Suthikulpanit, Suravee" Subject: [PATCH] svm/avic: Fix invalidate logical APIC id entry Date: Fri, 22 Mar 2019 10:17:43 +0000 Message-ID: <20190322101706.9377-1-suravee.suthikulpanit@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: "joro@8bytes.org" , "pbonzini@redhat.com" , "rkrcmar@redhat.com" , "Suthikulpanit, Suravee" To: "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" Return-path: Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org Only clear the valid bit when invalidate logical APIC id entry. The current logic clear the valid bit, but also set the rest of the bits (including reserved bits) to 1. Fixes: 98d90582be2e ('svm: Fix AVIC DFR and LDR handling') Signed-off-by: Suravee Suthikulpanit --- arch/x86/kvm/svm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 7a4ce1a22ca0..f4fb766e474c 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -4640,7 +4640,7 @@ static void avic_invalidate_logical_id_entry(struct k= vm_vcpu *vcpu) u32 *entry =3D avic_get_logical_id_entry(vcpu, svm->ldr_reg, flat); =20 if (entry) - WRITE_ONCE(*entry, (u32) ~AVIC_LOGICAL_ID_ENTRY_VALID_MASK); + WRITE_ONCE(*entry, (u32)(*entry & ~AVIC_LOGICAL_ID_ENTRY_VALID_MASK)); } =20 static int avic_handle_ldr_update(struct kvm_vcpu *vcpu) --=20 2.17.1