From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bugjF-0000za-Mx for qemu-devel@nongnu.org; Thu, 13 Oct 2016 10:11:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bugj9-0006Ng-Hz for qemu-devel@nongnu.org; Thu, 13 Oct 2016 10:11:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57932) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bugj9-0006NS-BH for qemu-devel@nongnu.org; Thu, 13 Oct 2016 10:11:19 -0400 Date: Thu, 13 Oct 2016 16:11:14 +0200 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Message-ID: <20161013141114.GD15008@potion> References: <1476352367-69400-1-git-send-email-imammedo@redhat.com> <1476352367-69400-9-git-send-email-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1476352367-69400-9-git-send-email-imammedo@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 08/13] pc: apic_common: reset APIC ID to initial ID when switching into x2APIC mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: qemu-devel@nongnu.org, ehabkost@redhat.com, liuxiaojian6@huawei.com, mst@redhat.com, peterx@redhat.com, kevin@koconnor.net, kraxel@redhat.com, pbonzini@redhat.com, lersek@redhat.com, chao.gao@intel.com 2016-10-13 11:52+0200, Igor Mammedov: > SDM: x2APIC State Transitions: > State Changes From xAPIC Mode to x2APIC Mode > " > Any APIC ID value written to the memory-mapped > local APIC ID register is not preserved > " >=20 > Signed-off-by: Igor Mammedov > --- Reviewed-by: Radim Kr=C4=8Dm=C3=A1=C5=99 > hw/intc/apic_common.c | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c > index ea3c8ca..d78c885 100644 > --- a/hw/intc/apic_common.c > +++ b/hw/intc/apic_common.c > @@ -40,6 +40,11 @@ void cpu_set_apic_base(DeviceState *dev, uint64_t va= l) > if (dev) { > APICCommonState *s =3D APIC_COMMON(dev); > APICCommonClass *info =3D APIC_COMMON_GET_CLASS(s); > + /* switching to x2APIC, reset possibly modified xAPIC ID */ > + if (!(s->apicbase & MSR_IA32_APICBASE_EXTD) && > + (val & MSR_IA32_APICBASE_EXTD)) { > + s->id =3D s->initial_apic_id; > + } > info->set_base(s, val); > } > } > --=20 > 2.7.4 >=20 >=20