From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b06hQ-0005ex-So for qemu-devel@nongnu.org; Tue, 10 May 2016 08:23:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b06hL-0007rC-PR for qemu-devel@nongnu.org; Tue, 10 May 2016 08:23:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57205) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b06hL-0007r4-IW for qemu-devel@nongnu.org; Tue, 10 May 2016 08:23:35 -0400 Date: Tue, 10 May 2016 14:23:32 +0200 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Message-ID: <20160510122331.GB806@potion> References: <1462826940-2422-1-git-send-email-rkrcmar@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1462826940-2422-1-git-send-email-rkrcmar@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] target-i386: implement CPUID[0xB] (Extended Topology Enumeration) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Eduardo Habkost , Richard Henderson 2016-05-09 22:49+0200, Radim Kr=C4=8Dm=C3=A1=C5=99: > I looked at a dozen Intel CPU that have this CPUID and all of them > always had Core offset as 1 (a wasted bit when hyperthreading is > disabled) and Package offset at least 4 (wasted bits at <=3D 4 cores). >=20 > QEMU uses more compact IDs and it doesn't make much sense to change it > now. I keep the SMT and Core sub-leaves even if there is just one > thread/core; it makes the code simpler and there should be no harm. >=20 > Signed-off-by: Radim Kr=C4=8Dm=C3=A1=C5=99 > --- > diff --git a/target-i386/cpu.c b/target-i386/cpu.c > @@ -2460,6 +2461,32 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t in= dex, uint32_t count, > *edx =3D 0; > } > break; > + case 0xB: > + /* Extended Topology Enumeration Leaf */ > + *ecx =3D count & 0xff; > + *edx =3D cpu->apic_id; > + > + switch (*ecx) { *ecx is wrong, should be count. I'll wait few days for comments before posting a v2.