* [PATCH v3] target/i386: Fix model number of Zhaoxin YongFeng vCPU template
@ 2025-04-14 7:53 Ewan Hai
2025-04-14 15:05 ` Zhao Liu
0 siblings, 1 reply; 3+ messages in thread
From: Ewan Hai @ 2025-04-14 7:53 UTC (permalink / raw)
To: pbonzini, zhao1.liu, xiaoyao.li; +Cc: ewanhai, cobechen, qemu-devel
The model number was mistakenly set to 0x0b (11) in commit ff04bc1ac4.
The correct value is 0x5b. This mistake occurred because the extended
model bits in cpuid[eax=0x1].eax were overlooked, and only the base
model was used.
Using the wrong model number can affect guest behavior. One known issue
is that vPMU (which relies on the model number) may fail to operate
correctly.
This patch corrects the model field by introducing a new vCPU version.
Fixes: ff04bc1ac4 ("target/i386: Introduce Zhaoxin Yongfeng CPU model")
Signed-off-by: Ewan Hai <ewanhai-oc@zhaoxin.com>
---
target/i386/cpu.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 1b64ceaaba..3fb1ec62da 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -5621,6 +5621,18 @@ static const X86CPUDefinition builtin_x86_defs[] = {
.features[FEAT_VMX_VMFUNC] = MSR_VMX_VMFUNC_EPT_SWITCHING,
.xlevel = 0x80000008,
.model_id = "Zhaoxin YongFeng Processor",
+ .versions = (X86CPUVersionDefinition[]) {
+ { .version = 1 },
+ {
+ .version = 2,
+ .note = "with the correct model number",
+ .props = (PropValue[]) {
+ { "model", "0x5b" },
+ { /* end of list */ }
+ }
+ },
+ { /* end of list */ }
+ }
},
};
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v3] target/i386: Fix model number of Zhaoxin YongFeng vCPU template
2025-04-14 7:53 [PATCH v3] target/i386: Fix model number of Zhaoxin YongFeng vCPU template Ewan Hai
@ 2025-04-14 15:05 ` Zhao Liu
2025-04-15 1:44 ` Ewan Hai
0 siblings, 1 reply; 3+ messages in thread
From: Zhao Liu @ 2025-04-14 15:05 UTC (permalink / raw)
To: Ewan Hai; +Cc: pbonzini, xiaoyao.li, ewanhai, cobechen, qemu-devel
On Mon, Apr 14, 2025 at 03:53:42AM -0400, Ewan Hai wrote:
> Date: Mon, 14 Apr 2025 03:53:42 -0400
> From: Ewan Hai <ewanhai-oc@zhaoxin.com>
> Subject: [PATCH v3] target/i386: Fix model number of Zhaoxin YongFeng vCPU
> template
> X-Mailer: git-send-email 2.34.1
>
> The model number was mistakenly set to 0x0b (11) in commit ff04bc1ac4.
> The correct value is 0x5b. This mistake occurred because the extended
> model bits in cpuid[eax=0x1].eax were overlooked, and only the base
> model was used.
>
> Using the wrong model number can affect guest behavior. One known issue
> is that vPMU (which relies on the model number) may fail to operate
> correctly.
>
> This patch corrects the model field by introducing a new vCPU version.
>
> Fixes: ff04bc1ac4 ("target/i386: Introduce Zhaoxin Yongfeng CPU model")
> Signed-off-by: Ewan Hai <ewanhai-oc@zhaoxin.com>
> ---
> target/i386/cpu.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
BTW, if you want to add more notes or explaination to strongly ask users
to use v2, you can add a section "Preferred CPU models for Zhaoxin x86
hosts" in docs/system/cpu-models-x86.rst.inc.
Thanks,
Zhao
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3] target/i386: Fix model number of Zhaoxin YongFeng vCPU template
2025-04-14 15:05 ` Zhao Liu
@ 2025-04-15 1:44 ` Ewan Hai
0 siblings, 0 replies; 3+ messages in thread
From: Ewan Hai @ 2025-04-15 1:44 UTC (permalink / raw)
To: Zhao Liu; +Cc: pbonzini, xiaoyao.li, ewanhai, cobechen, qemu-devel
On 4/14/25 11:05 PM, Zhao Liu wrote:
>
> On Mon, Apr 14, 2025 at 03:53:42AM -0400, Ewan Hai wrote:
>> Date: Mon, 14 Apr 2025 03:53:42 -0400
>> From: Ewan Hai <ewanhai-oc@zhaoxin.com>
>> Subject: [PATCH v3] target/i386: Fix model number of Zhaoxin YongFeng vCPU
>> template
>> X-Mailer: git-send-email 2.34.1
>>
>> The model number was mistakenly set to 0x0b (11) in commit ff04bc1ac4.
>> The correct value is 0x5b. This mistake occurred because the extended
>> model bits in cpuid[eax=0x1].eax were overlooked, and only the base
>> model was used.
>>
>> Using the wrong model number can affect guest behavior. One known issue
>> is that vPMU (which relies on the model number) may fail to operate
>> correctly.
>>
>> This patch corrects the model field by introducing a new vCPU version.
>>
>> Fixes: ff04bc1ac4 ("target/i386: Introduce Zhaoxin Yongfeng CPU model")
>> Signed-off-by: Ewan Hai <ewanhai-oc@zhaoxin.com>
>> ---
>> target/i386/cpu.c | 12 ++++++++++++
>> 1 file changed, 12 insertions(+)
>
> Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
>
> BTW, if you want to add more notes or explaination to strongly ask users
> to use v2, you can add a section "Preferred CPU models for Zhaoxin x86
> hosts" in docs/system/cpu-models-x86.rst.inc.
Thanks for the reminder and the review, Zhao. I'll send a v4 patch that includes
a new section titled “Preferred CPU models for Zhaoxin x86 hosts” in
docs/system/cpu-models-x86.rst.inc to strongly recommend using v2.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-04-15 1:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-14 7:53 [PATCH v3] target/i386: Fix model number of Zhaoxin YongFeng vCPU template Ewan Hai
2025-04-14 15:05 ` Zhao Liu
2025-04-15 1:44 ` Ewan Hai
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).