All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] x86/cpu/hygon: Introduce macros for hygon family numbers
@ 2026-08-06  0:35 Chaohong Guo
  2026-08-06  0:35 ` [PATCH v2 2/2] sched/numa: Apply remote socket distance averaging for Hygon CPUs Chaohong Guo
  2026-08-06  8:22 ` [PATCH v2 1/2] x86/cpu/hygon: Introduce macros for hygon family numbers Ingo Molnar
  0 siblings, 2 replies; 6+ messages in thread
From: Chaohong Guo @ 2026-08-06  0:35 UTC (permalink / raw)
  To: peterz, tim.c.chen, mingo, bp; +Cc: x86, linux-kernel

Consolidate all magic numbers of hygon CPUs into a header file.
The macros describe the family/model numbers of hygon CPUs.

Co-developed-by: Zhiquan Li <lizhiquan@open-hieco.net>
Signed-off-by: Zhiquan Li <lizhiquan@open-hieco.net>
Signed-off-by: Chaohong Guo <guochaohong@open-hieco.net>
---
 arch/x86/include/asm/cpu_device_id.h |  2 ++
 arch/x86/include/asm/hygon-family.h  | 17 +++++++++++++++++
 2 files changed, 19 insertions(+)
 create mode 100644 arch/x86/include/asm/hygon-family.h

diff --git a/arch/x86/include/asm/cpu_device_id.h b/arch/x86/include/asm/cpu_device_id.h
index c62d8fae52c3..2fa8018afecd 100644
--- a/arch/x86/include/asm/cpu_device_id.h
+++ b/arch/x86/include/asm/cpu_device_id.h
@@ -42,6 +42,8 @@
 #include <linux/device-id/x86_cpu.h>
 /* Get the INTEL_FAM* model defines */
 #include <asm/intel-family.h>
+/* Hygon HFM model defines */
+#include <asm/hygon-family.h>
 /* And the X86_VENDOR_* ones */
 #include <asm/processor.h>
 
diff --git a/arch/x86/include/asm/hygon-family.h b/arch/x86/include/asm/hygon-family.h
new file mode 100644
index 000000000000..2fb989acb433
--- /dev/null
+++ b/arch/x86/include/asm/hygon-family.h
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * The helpers to support Hygon CPU specific code path.
+ */
+
+#ifndef _ASM_X86_HYGON_FAMILY_H
+#define _ASM_X86_HYGON_FAMILY_H
+
+#include <asm/processor.h>
+
+#define HFM(_family, _model)	VFM_MAKE(X86_VENDOR_HYGON, _family, _model)
+
+#define HYGON_F18_M04		HFM(0x18, 4)
+#define HYGON_F18_M06		HFM(0x18, 6)
+#define HYGON_F18_M07		HFM(0x18, 7)
+
+#endif /* _ASM_X86_HYGON_FAMILY_H */
-- 
2.18.2


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

end of thread, other threads:[~2026-08-06  8:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-06  0:35 [PATCH v2 1/2] x86/cpu/hygon: Introduce macros for hygon family numbers Chaohong Guo
2026-08-06  0:35 ` [PATCH v2 2/2] sched/numa: Apply remote socket distance averaging for Hygon CPUs Chaohong Guo
2026-08-06  3:15   ` Zhan Xusheng
2026-08-06  5:25     ` Guo Chaohong
2026-08-06  8:22 ` [PATCH v2 1/2] x86/cpu/hygon: Introduce macros for hygon family numbers Ingo Molnar
2026-08-06  8:50   ` Guo Chaohong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.