qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/7] i386/cpu: Clean Up Reserved CPUID Leaves & Topology Overflow Fix
@ 2025-07-14  8:08 Zhao Liu
  2025-07-14  8:08 ` [PATCH v2 1/7] i386/cpu: Mark EBX/ECX/EDX in CPUID 0x80000000 leaf as reserved for Intel Zhao Liu
                   ` (7 more replies)
  0 siblings, 8 replies; 20+ messages in thread
From: Zhao Liu @ 2025-07-14  8:08 UTC (permalink / raw)
  To: Paolo Bonzini, Daniel P . Berrangé, Igor Mammedov
  Cc: Ewan Hai, Xiaoyao Li, Tao Su, Yi Lai, Dapeng Mi, qemu-devel,
	Zhao Liu

Hi,

To avoid the series being too trivial, I've merged the two previous
series together again.

This series is based on:

https://lore.kernel.org/qemu-devel/20250711102143.1622339-1-zhao1.liu@intel.com/

And you can find the codes at:

https://gitlab.com/zhao.liu/qemu/-/tree/cache-model-v3.0-rebase-07-10-2025?ref_type=heads


Part 1 (Patch 1-3)
==================

Since the previsor unified cache model series has already introduced a
new compat property "x-vendor-cpuid-only-v2", it's a chance to once
again consolidate more vendor-specific CPUIDs.

I also checked the CPUID leaves currently supported by Intel & AMD and
found that since the previous "x-vendor-cpuid-only," AMD has already
cleaned up the Intel-specific CPUIDs quite well.

As for Intel, the only cleanup needed is for the "extended function
CPUID" leaves (0x80000000~0x80000008). That's what these patches does.

Considerring the disscussion around AMD's arch capabilities MSR,
explicitly changing feature bits in QEMU that require host support is
inappropriate. CPUID adjustments based on the vendor should be limited
to parts that are fully emulated within QEMU (such as topology, vendor,
etc.).

Therefore, in v2, I dropped the modifications to 0x80000007 and narrowed
the changes to 0x80000008 to only the fields related to CPU topology.

Previous v1:

https://lore.kernel.org/qemu-devel/20250627035129.2755537-1-zhao1.liu@intel.com/


Part 2 (Patch 4-7)
==================

These patches collect and organize several topology-related cleanups and
fixes.

Comparing with v1, I provides the oveflow example for patch 6 & 7.

Note, In addition to the 0x1, 0x4, and 0x8000001d leaves involved in the
patch series, there is also the 0x1f leaf related to topology. However,
the upper limit for CPUID.1FH.EBX[bits 15:0] is 65,535 threads, which
provides enough room. Therefore, this field does not currently require
overflow checks.

PS: The previous patch 4 tried to fix overflow directly. But now we have
the "x-vendor-cpuid-only-v2", it's a chance to fix addressable ID for
new machines.

Previous v1:

https://lore.kernel.org/qemu-devel/20250227062523.124601-1-zhao1.liu@intel.com/

Thanks and Best Regards,
Zhao

---
Chuang Xu (1):
  i386/cpu: Fix number of addressable IDs field for CPUID.01H.EBX[23:16]

Qian Wen (2):
  i386/cpu: Fix cpu number overflow in CPUID.01H.EBX[23:16]
  i386/cpu: Fix overflow of cache topology fields in CPUID.04H

Zhao Liu (4):
  i386/cpu: Mark EBX/ECX/EDX in CPUID 0x80000000 leaf as reserved for
    Intel
  i386/cpu: Mark CPUID 0x80000008 ECX bits[0:7] & [12:15] as reserved
    for Intel/Zhaoxin
  i386/cpu: Reorder CPUID leaves in cpu_x86_cpuid()
  i386/cpu: Honor maximum value for CPUID.8000001DH.EAX[25:14]

 target/i386/cpu.c | 130 ++++++++++++++++++++++++++++++----------------
 1 file changed, 84 insertions(+), 46 deletions(-)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2025-07-17  3:50 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-14  8:08 [PATCH v2 0/7] i386/cpu: Clean Up Reserved CPUID Leaves & Topology Overflow Fix Zhao Liu
2025-07-14  8:08 ` [PATCH v2 1/7] i386/cpu: Mark EBX/ECX/EDX in CPUID 0x80000000 leaf as reserved for Intel Zhao Liu
2025-07-14  8:15   ` Xiaoyao Li
2025-07-14  8:08 ` [PATCH v2 2/7] i386/cpu: Mark CPUID 0x80000008 ECX bits[0:7] & [12:15] as reserved for Intel/Zhaoxin Zhao Liu
2025-07-14  8:27   ` Xiaoyao Li
2025-07-14  9:23     ` Zhao Liu
2025-07-14  8:08 ` [PATCH v2 3/7] i386/cpu: Reorder CPUID leaves in cpu_x86_cpuid() Zhao Liu
2025-07-14  8:08 ` [PATCH v2 4/7] i386/cpu: Fix number of addressable IDs field for CPUID.01H.EBX[23:16] Zhao Liu
2025-07-14  8:29   ` Xiaoyao Li
2025-07-16 15:31   ` Michael Tokarev
2025-07-17  3:06     ` Zhao Liu
2025-07-17  3:25       ` Michael Tokarev
2025-07-17  4:09         ` Zhao Liu
2025-07-14  8:08 ` [PATCH v2 5/7] i386/cpu: Fix cpu number overflow in CPUID.01H.EBX[23:16] Zhao Liu
2025-07-14  8:08 ` [PATCH v2 6/7] i386/cpu: Fix overflow of cache topology fields in CPUID.04H Zhao Liu
2025-07-14  8:08 ` [PATCH v2 7/7] i386/cpu: Honor maximum value for CPUID.8000001DH.EAX[25:14] Zhao Liu
2025-07-14 14:51   ` Moger, Babu
2025-07-14 15:41     ` Zhao Liu
2025-07-14 15:25       ` Moger, Babu
2025-07-14  8:25 ` [PATCH v2 0/7] i386/cpu: Clean Up Reserved CPUID Leaves & Topology Overflow Fix Paolo Bonzini

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).