diff mbox series

x86/cpu: Support Hygon architecture CPU during NMI initialization.

Message ID 20250104111109.2726-1-banmengtao@zju.edu.cn (mailing list archive)
State New
Headers show
Series x86/cpu: Support Hygon architecture CPU during NMI initialization. | expand

Commit Message

banmengtao Jan. 4, 2025, 11:11 a.m. UTC
From: banmengtao <jiuxie@outlook.com>

When I installed Xen on Ubuntu 22.04 and rebooted into the kernel, it kept freezing and threw an exception: "Unsupported processor. Unknown vendor 16."
This patch fixes the issue where the Hygon CPU could not be recognized when entering the Xen kernel.

Signed-off-by: banmengtao <jiuxie@outlook.com>
---
 xen/arch/x86/oprofile/nmi_int.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/xen/arch/x86/oprofile/nmi_int.c b/xen/arch/x86/oprofile/nmi_int.c
index fa3071d977..ef7c7b8f69 100644
--- a/xen/arch/x86/oprofile/nmi_int.c
+++ b/xen/arch/x86/oprofile/nmi_int.c
@@ -398,6 +398,7 @@  static int __init cf_check nmi_init(void)
 
 	switch (vendor) {
 		case X86_VENDOR_AMD:
+		case X86_VENDOR_HYGON:
 			/* Needs to be at least an Athlon (or hammer in 32bit mode) */
 
 			switch (family) {
@@ -435,6 +436,11 @@  static int __init cf_check nmi_init(void)
 				model = &op_athlon_spec;
 				cpu_type = "x86-64/family16h";
 				break;
+			case 0x18:
+				model = &op_athlon_spec;
+				cpu_type = "x86-64/family18h";
+				break;
+
 			}
 			break;