Skip to contentSkip to conversation

x86/cstate: Add Zhaoxin ACPI Cx FFH MWAIT support

PATCH In review Tony W Wang-oc 2 participants 3 messages Jun 22, 2022 – Jun 23, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/cstate: Add Zhaoxin ACPI Cx FFH MWAIT support

Recent Zhaoxin CPUs support X86_FEATURE_MWAIT that implies the MONITOR/MWAIT instructions can be used for ACPI Cx state. The BIOS declares Cx state in _CST object to use FFH on Zhaoxin systems. So let function ffh_cstate_init() support Zhaoxin too.

---
 arch/x86/kernel/acpi/cstate.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/x86/kernel/acpi/cstate.c +3 -1
index 7945eae..d4185e1 100644
@@ -213,7 +213,9 @@ static int __init ffh_cstate_init(void)
 
 	if (c->x86_vendor != X86_VENDOR_INTEL &&
 	    c->x86_vendor != X86_VENDOR_AMD &&
-	    c->x86_vendor != X86_VENDOR_HYGON)
+	    c->x86_vendor != X86_VENDOR_HYGON &&
+	    c->x86_vendor != X86_VENDOR_CENTAUR &&
+	    c->x86_vendor != X86_VENDOR_ZHAOXIN)
 		return -1;
 
 	cpu_cstate_entry = alloc_percpu(struct cstate_entry);
Signature · 1 line
2.7.4
#1 lore raw

Please CC [email protected] on ACPI-related changes (added now).

Quoted 16 lines · Tony W Wang-oc

Recent Zhaoxin CPUs support X86_FEATURE_MWAIT that implies the MONITOR/MWAIT instructions can be used for ACPI Cx state. The BIOS declares Cx state in _CST object to use FFH on Zhaoxin systems. So let function ffh_cstate_init() support Zhaoxin too.

---
  arch/x86/kernel/acpi/cstate.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
arch/x86/kernel/acpi/cstate.c +0 -0
index 7945eae..d4185e1 100644

arch/x86/kernel/acpi/cstate.c static int __init ffh_cstate_init(void) · line 218

Quoted 7 lines
arch/x86/kernel/acpi/cstate.c +3 -1
@@ -213,7 +213,9 @@ static int __init ffh_cstate_init(void)
 
        if (c->x86_vendor != X86_VENDOR_INTEL &&
            c->x86_vendor != X86_VENDOR_AMD &&
-           c->x86_vendor != X86_VENDOR_HYGON)
+           c->x86_vendor != X86_VENDOR_HYGON &&
+           c->x86_vendor != X86_VENDOR_CENTAUR &&
+           c->x86_vendor != X86_VENDOR_ZHAOXIN)

Centaur is not mentioned in the changelog and it should be.

Quoted 4 lines
arch/x86/kernel/acpi/cstate.c +0 -1
                return -1;
 
        cpu_cstate_entry = alloc_percpu(struct cstate_entry);
--
#2 lore raw
Quoted 1 line · Rafael J. Wysocki

Please CC [email protected] on ACPI-related changes (added now).

Ok.

Quoted 19 lines · Tony W Wang-oc
Quoted 17 lines

Recent Zhaoxin CPUs support X86_FEATURE_MWAIT that implies the MONITOR/MWAIT instructions can be used for ACPI Cx state. The BIOS declares Cx state in _CST object to use FFH on Zhaoxin systems. So let function ffh_cstate_init() support Zhaoxin too.

---
   arch/x86/kernel/acpi/cstate.c | 4 +++-
   1 file changed, 3 insertions(+), 1 deletion(-)
arch/x86/kernel/acpi/cstate.c +0 -0
index 7945eae..d4185e1 100644
@@ -213,7 +213,9 @@ static int __init ffh_cstate_init(void)
 
Quoted 8 lines

arch/x86/kernel/acpi/cstate.c static int __init ffh_cstate_init(void) · line 218

Quoted 6 lines
arch/x86/kernel/acpi/cstate.c +3 -1
         if (c->x86_vendor != X86_VENDOR_INTEL &&
             c->x86_vendor != X86_VENDOR_AMD &&
-           c->x86_vendor != X86_VENDOR_HYGON)
+           c->x86_vendor != X86_VENDOR_HYGON &&
+           c->x86_vendor != X86_VENDOR_CENTAUR &&
+           c->x86_vendor != X86_VENDOR_ZHAOXIN)

Centaur is not mentioned in the changelog and it should be.

Will add Centaur in the changelog. Thanks a lot.

Quoted 7 lines

arch/x86/kernel/acpi/cstate.c static int __init ffh_cstate_init(void)

Quoted 5 lines
arch/x86/kernel/acpi/cstate.c +0 -1
                 return -1;
 
         cpu_cstate_entry = alloc_percpu(struct cstate_entry);
--

.

Signature · 2 lines
Sincerely
TonyWWang-oc