[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] target-i386: implement CPUID[0xB] (Extended Top
From: |
Radim Krčmář |
Subject: |
Re: [Qemu-devel] [PATCH] target-i386: implement CPUID[0xB] (Extended Topology Enumeration) |
Date: |
Tue, 10 May 2016 14:23:32 +0200 |
2016-05-09 22:49+0200, Radim Krčmář:
> 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 <= 4 cores).
>
> 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.
>
> Signed-off-by: Radim Krčmář <address@hidden>
> ---
> diff --git a/target-i386/cpu.c b/target-i386/cpu.c
> @@ -2460,6 +2461,32 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index,
> uint32_t count,
> *edx = 0;
> }
> break;
> + case 0xB:
> + /* Extended Topology Enumeration Leaf */
> + *ecx = count & 0xff;
> + *edx = cpu->apic_id;
> +
> + switch (*ecx) {
*ecx is wrong, should be count. I'll wait few days for comments before
posting a v2.