Skip to content

Conversation

@zhang-rui
Copy link
Contributor

@zhang-rui zhang-rui commented Oct 10, 2025

Add SST support for ClearWater Forest

Test:
Tested on CWF, after the PR, the TPMI RAPL driver probe the TPMI RAPL devices,
userspace intel-speed-select tool can show proper sst information.

Note:
This PR depends on the CWF CPUID support, so it is rebased on top of
#72
The first 11 patches are from #72

1: KVM: x86: Advertise AVX-VNNI-INT8 CPUID to user space
2: x86/cpu: Add model number for Intel Clearwater Forest processor
3: x86: KVM: Advertise CPUIDs for new instructions in Clearwater Forest
4: x86/cpu: Add model number for another Intel Arrow Lake mobile processor
5: x86/cpu/vfm: Add/initialize x86_vfm field to struct cpuinfo_x86
6: x86/cpu/vfm: Add new macros to work with (vendor/family/model) values
7: x86/cpu/vfm: Update arch/x86/include/asm/intel-family.h
8: x86/cpu: Switch to new Intel CPU model defines
9: x86/cpu/intel: Switch to new Intel CPU model defines
10: x86/cpu/intel: Drop stray FAM6 check with new Intel CPU model defines
11: perf/x86/intel: Switch to new Intel CPU model defines
12: platform/x86: ISST: Add Clearwater Forest to support list

Jiaxi Chen and others added 12 commits October 10, 2025 02:36
commit 24d74b9 upstream.

AVX-VNNI-INT8 is a new set of instructions in the latest Intel platform
Sierra Forest, aims for the platform to have superior AI capabilities.
This instruction multiplies the individual bytes of two unsigned or
unsigned source operands, then adds and accumulates the results into the
destination dword element size operand.

The bit definition:
CPUID.(EAX=7,ECX=1):EDX[bit 4]

AVX-VNNI-INT8 is on a new and sparse CPUID leaf and all bits on this
leaf have no truly kernel use case for now. Given that and to save space
for kernel feature bits, move this new leaf to KVM-only subleaf and plus
an x86_FEATURE definition for AVX-VNNI-INT8 to direct it to the KVM
entry.

Advertise AVX-VNNI-INT8 to KVM userspace. This is safe because there are
no new VMX controls or additional host enabling required for guests to
use this feature.

Intel-SIG: commit 24d74b9 KVM: x86: Advertise AVX-VNNI-INT8 CPUID to user space.
ClearWater support including CPU model and new ISAs and its dependency

Signed-off-by: Jiaxi Chen <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
[ Quanxian Wang: amend commit log ]
Signed-off-by: Quanxian Wang <[email protected]>
commit 090e3be upstream.

Server product based on the Atom Darkmont core.

Intel-SIG: commit 090e3be x86/cpu: Add model number for Intel Clearwater Forest processor.
ClearWater support including CPU model and new ISAs and its dependency

Signed-off-by: Tony Luck <[email protected]>
Signed-off-by: Borislav Petkov (AMD) <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ Quanxian Wang: amend commit log ]
Signed-off-by: Quanxian Wang <[email protected]>
commit a0423af92cb31e6fc4f53ef9b6e19fdf08ad4395 upstream.

Latest Intel platform Clearwater Forest has introduced new instructions
enumerated by CPUIDs of SHA512, SM3, SM4 and AVX-VNNI-INT16. Advertise
these CPUIDs to userspace so that guests can query them directly.

SHA512, SM3 and SM4 are on an expected-dense CPUID leaf and some other
bits on this leaf have kernel usages. Considering they have not truly
kernel usages, hide them in /proc/cpuinfo.

These new instructions only operate in xmm, ymm registers and have no new
VMX controls, so there is no additional host enabling required for guests
to use these instructions, i.e. advertising these CPUIDs to userspace is
safe.

Intel-SIG: commit a0423af92cb3 x86: KVM: Advertise CPUIDs for new instructions in Clearwater Forest.
ClearWater support including CPU model and new ISAs and its dependency

Tested-by: Jiaan Lu <[email protected]>
Tested-by: Xuelian Guo <[email protected]>
Signed-off-by: Tao Su <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
[ Quanxian Wang: amend commit log ]
Signed-off-by: Quanxian Wang <[email protected]>
commit 8a8a9c9 upstream.

This one is the regular laptop CPU.

Intel-SIG: commit 8a8a9c9 x86/cpu: Add model number for another Intel Arrow Lake mobile processor.
New Intel X86 CPU Family definition

Signed-off-by: Tony Luck <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ Quanxian Wang: amend commit log ]
Signed-off-by: Quanxian Wang <[email protected]>
commit a9d0adc upstream.

Refactor struct cpuinfo_x86 so that the vendor, family, and model
fields are overlaid in a union with a 32-bit field that combines
all three (together with a one byte reserved field in the upper
byte).

This will make it easy, cheap, and reliable to check all three
values at once.

See

  https://lore.kernel.org/r/Zgr6kT8oULbnmEXx@agluck-desk3

for why the ordering is (low-to-high bits):

  (vendor, family, model)

  [ bp: Move comments over the line, add the backstory about the
    particular order of the fields. ]

Intel-SIG: commit a9d0adc x86/cpu/vfm: Add/initialize x86_vfm field to struct cpuinfo_x86.
New Intel X86 CPU Family definition

Signed-off-by: Tony Luck <[email protected]>
Signed-off-by: Borislav Petkov (AMD) <[email protected]>
Reviewed-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ Quanxian Wang: amend commit log ]
Signed-off-by: Quanxian Wang <[email protected]>
commit e6dfdc2 upstream.

To avoid adding a slew of new macros for each new Intel CPU family
switch over from providing CPU model number #defines to a new
scheme that encodes vendor, family, and model in a single number.

  [ bp: s/casted/cast/g ]

Intel-SIG: commit e6dfdc2 x86/cpu/vfm: Add new macros to work with (vendor/family/model) values.
New Intel X86 CPU Family definition

Signed-off-by: Tony Luck <[email protected]>
Signed-off-by: Borislav Petkov (AMD) <[email protected]>
Reviewed-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ Quanxian Wang: amend commit log ]
Signed-off-by: Quanxian Wang <[email protected]>
commit f055b62 upstream.

New CPU #defines encode vendor and family as well as model.

Update the example usage comment in arch/x86/kernel/cpu/match.c

Intel-SIG: commit f055b62 x86/cpu/vfm: Update arch/x86/include/asm/intel-family.h.
New Intel X86 CPU Family definition

Signed-off-by: Tony Luck <[email protected]>
Signed-off-by: Borislav Petkov (AMD) <[email protected]>
Reviewed-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ Quanxian Wang: amend commit log ]
Signed-off-by: Quanxian Wang <[email protected]>
commit 744866f upstream.

New CPU #defines encode vendor and family as well as model.

Update INTEL_CPU_DESC() to work with vendor/family/model.

Intel-SIG: commit 744866f x86/cpu: Switch to new Intel CPU model defines.
New Intel X86 CPU Family definition

Signed-off-by: Tony Luck <[email protected]>
Signed-off-by: Dave Hansen <[email protected]>
Link: https://lore.kernel.org/all/20240520224620.9480-34-tony.luck%40intel.com
[ Quanxian Wang: amend commit log ]
Signed-off-by: Quanxian Wang <[email protected]>
commit 6568fc1 upstream.

New CPU #defines encode vendor and family as well as model.

Intel-SIG: commit 6568fc1 x86/cpu/intel: Switch to new Intel CPU model defines.
New Intel X86 CPU Family definition

Signed-off-by: Tony Luck <[email protected]>
Signed-off-by: Dave Hansen <[email protected]>
Link: https://lore.kernel.org/all/20240520224620.9480-29-tony.luck%40intel.com
[ Quanxian Wang: amend commit log ]
Signed-off-by: Quanxian Wang <[email protected]>
commit 34b3fc5 upstream.

The outer if () should have been dropped when switching to c->x86_vfm.

Fixes: 6568fc1 ("x86/cpu/intel: Switch to new Intel CPU model defines")
Intel-SIG: commit 34b3fc5 x86/cpu/intel: Drop stray FAM6 check with new Intel CPU model defines.
New Intel X86 CPU Family definition

Signed-off-by: Andrew Cooper <[email protected]>
Signed-off-by: Borislav Petkov (AMD) <[email protected]>
Acked-by: Tony Luck <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ Quanxian Wang: amend commit log ]
Signed-off-by: Quanxian Wang <[email protected]>
commit d142df1 upstream.

New CPU #defines encode vendor and family as well as model.

Intel-SIG: commit d142df1 perf/x86/intel: Switch to new Intel CPU model defines.
New Intel X86 CPU Family definition

Signed-off-by: Tony Luck <[email protected]>
Signed-off-by: Dave Hansen <[email protected]>
Link: https://lore.kernel.org/all/20240520224620.9480-32-tony.luck%40intel.com
[ Quanxian Wang: amend commit log ]
Signed-off-by: Quanxian Wang <[email protected]>
commit cc1ff7bc1bb378e7c46992c977b605e97d908801 upstream.

Add Clearwater Forest (INTEL_ATOM_DARKMONT_X) to SST support list by
adding to isst_cpu_ids.

Intel-SIG: commit cc1ff7bc1bb3 platform/x86: ISST: Add Clearwater Forest to support list
Add SST support for ClearWater Forest

Signed-off-by: Srinivas Pandruvada <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Ilpo Järvinen <[email protected]>
Signed-off-by: Ilpo Järvinen <[email protected]>
[ Zhang Rui: resolve conflict (use old X86 Macro) and amend commit log ]
Signed-off-by: Zhang Rui <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants