[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] x86/mwait-idle: add Granite Rapids Xeon support



commit 3c7186b2a82b23265650d404d27a41dcfa956191
Author:     Artem Bityutskiy <artem.bityutskiy@xxxxxxxxxxxxxxx>
AuthorDate: Wed Jul 9 11:02:08 2025 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Jul 9 11:02:08 2025 +0200

    x86/mwait-idle: add Granite Rapids Xeon support
    
    Add Granite Rapids Xeon C-states, which are C1, C1E, C6, and C6P.
    
    Comparing to previous Xeon Generations (e.g., Emerald Rapids), C6
    requests end up only in core C6 state, and no package C-state promotion
    takes place even if all cores in the package are in core C6.
    
    C6P requests also end up in core C6, but if all cores have requested
    C6P, the SoC will enter the package C6 state.
    
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy@xxxxxxxxxxxxxxx>
    Link: 
https://patch.msgid.link/20240806160310.3719205-1-artem.bityutskiy@xxxxxxxxxxxxxxx
    [ rjw: Changelog edits ]
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
    Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
370406bf5738
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/arch/x86/cpu/mwait-idle.c | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index 1a75023e5d..4c16c0bf15 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -756,6 +756,34 @@ static struct cpuidle_state __ro_after_init spr_cstates[] 
= {
        {}
 };
 
+static const struct cpuidle_state gnr_cstates[] = {
+       {
+               .name = "C1",
+               .flags = MWAIT2flg(0x00),
+               .exit_latency = 1,
+               .target_residency = 1,
+       },
+       {
+               .name = "C1E",
+               .flags = MWAIT2flg(0x01),
+               .exit_latency = 4,
+               .target_residency = 4,
+       },
+       {
+               .name = "C6",
+               .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED,
+               .exit_latency = 170,
+               .target_residency = 650,
+       },
+       {
+               .name = "C6P",
+               .flags = MWAIT2flg(0x21) | CPUIDLE_FLAG_TLB_FLUSHED,
+               .exit_latency = 210,
+               .target_residency = 1000,
+       },
+       {}
+};
+
 static const struct cpuidle_state atom_cstates[] = {
        {
                .name = "C1E",
@@ -1202,6 +1230,11 @@ static const struct idle_cpu idle_cpu_spr = {
        .c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
+static const struct idle_cpu idle_cpu_gnr = {
+       .state_table = gnr_cstates,
+       .c1e_promotion = C1E_PROMOTION_DISABLE,
+};
+
 static const struct idle_cpu idle_cpu_avn = {
        .state_table = avn_cstates,
        .c1e_promotion = C1E_PROMOTION_DISABLE,
@@ -1276,6 +1309,7 @@ static const struct x86_cpu_id intel_idle_ids[] 
__initconstrel = {
        ICPU(ATOM_GRACEMONT,            gmt),
        ICPU(SAPPHIRERAPIDS_X,          spr),
        ICPU(EMERALDRAPIDS_X,           spr),
+       ICPU(GRANITERAPIDS_X,           gnr),
        ICPU(ATOM_GOLDMONT,             bxt),
        ICPU(ATOM_GOLDMONT_PLUS,        bxt),
        ICPU(ATOM_GOLDMONT_D,           dnv),
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.