qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* ping Re: [PATCH] Fix CPUID_Fn8000001E_EBX for AMD
@ 2021-07-26  9:49 Jade Cheng
  0 siblings, 0 replies; only message in thread
From: Jade Cheng @ 2021-07-26  9:49 UTC (permalink / raw)
  To: ehabkost, pbonzini; +Cc: qemu-devel, pizhenwei

[-- Attachment #1: Type: text/plain, Size: 1086 bytes --]

ping.
On Wed, Jun 30, 2021, 16:26 <chengjiayao@bytedance.com> wrote:
According to AMD64 Arch Programmer's Manual Appendix D, bits 7:0 in
Fn8000_001E_EBX should be physical core(s) per logical processor, not per
die. Signed-off-by: Jade Cheng <chengjiayao@bytedance.com> ---
target/i386/cpu.c | 8 +++++++- 1 file changed, 7 insertions(+), 1
deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index
a9fe1662d3..417f5ba81f 100644 --- a/target/i386/cpu.c +++
b/target/i386/cpu.c @@ -381,7 +381,13 @@ static void
encode_topo_cpuid8000001e(X86CPU *cpu, X86CPUTopoInfo *topo_info, * NOTE:
CoreId is already part of apic_id. Just use it. We can * use all the 8 bits
to represent the core_id here. */ - *ebx = ((topo_info->threads_per_core -
1) << 8) | (topo_ids.core_id & 0xFF); + uint32_t core_id =
topo_ids.core_id; + + if (IS_AMD_CPU(&cpu->env)) { + core_id =
topo_ids.core_id + topo_ids.die_id * topo_info->cores_per_die; + } + + *ebx
= ((topo_info->threads_per_core - 1) << 8) | (core_id & 0xFF); /* *
CPUID_Fn8000001E_ECX [Node Identifiers] (NodeId) -- 2.24.3 (Apple Git-128)

[-- Attachment #2: Type: text/html, Size: 2255 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-26  9:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-26  9:49 ping Re: [PATCH] Fix CPUID_Fn8000001E_EBX for AMD Jade Cheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).