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

[PATCH 1/4] x86/mwait-idle: switch to asm/intel-family.h naming


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 26 Apr 2022 12:04:45 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nfvkLKxgZzpvNh45ZE00gKlfe5dLJE1wRsQWU7S2WTw=; b=J0rwVSM9JCqGuJm04XFmAE8avLQbMgghsc47M2yGUpI15jCV1KPZQGUcBC40XE2KRrPa7D3ci67UGk+J90M4pf+9iBjX8NuXyaA7+OYq8rQAQxWU1T4QFfllLuw5AofQlkHDd8zbPywIhu3q0cRVKFoTMGQ+h3FRgE7Eyyb2ckxoZgOfc6ga/3YLw+rYC92ItXnoFwwmYRBghjmGFw3E0OIIJgP7mOjntvtWgjIErDuunj3/Xsm40BZnAgTX5S12U0Xl8XAGMCKMx/eLFAKvkcXDc0K9nVTnoUmyGEgb4LKDm2FwWX5aDp0JtLHgSM/u7XzVijJNBsY+hZuDw4lhaQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PAz+FdWzrIJ+uQarPrKlgDZRWGEO24nSTJhhJgbW39Y/91X7auGdApdW4WBvsgJi3v70L+bJdi8VUnNHxKQNcEiTU7XgmqT7y8mfRuudtzDUQyTMxGMA83rAMY0fvBc61aSBXpV0qH0euqAqGcle3A0aW2NIhySlmWRnh4xugEXvFjxgUZ8BnXqoocK8xM/HSUzaC1VXYZsiHotdCxA6CiXXbq2SzH9P7WU+QpP/bOr1xaBGbfYqElPVkrHFEwlRYST9QtfCGHi79fHm+jIE+nLq2sCUOQ5qIwzM+BA3Oq58tus32XBpmEEL3vWiih74OBEslIV9URtuSNbDy9qKCw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 26 Apr 2022 10:04:53 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

This brings us (back) closer to the original Linux source.

While touching mwait_idle_state_table_update() also drop a stray leading
blank.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -61,6 +61,7 @@
 #include <xen/trace.h>
 #include <asm/cpuidle.h>
 #include <asm/hpet.h>
+#include <asm/intel-family.h>
 #include <asm/mwait.h>
 #include <asm/msr.h>
 #include <asm/spec_ctrl.h>
@@ -996,48 +997,49 @@ static const struct idle_cpu idle_cpu_sn
 };
 
 #define ICPU(model, cpu) \
-       { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ALWAYS, &idle_cpu_##cpu}
+       { X86_VENDOR_INTEL, 6, INTEL_FAM6_ ## model, X86_FEATURE_ALWAYS, \
+         &idle_cpu_ ## cpu}
 
 static const struct x86_cpu_id intel_idle_ids[] __initconstrel = {
-       ICPU(0x1a, nehalem),
-       ICPU(0x1e, nehalem),
-       ICPU(0x1f, nehalem),
-       ICPU(0x25, nehalem),
-       ICPU(0x2c, nehalem),
-       ICPU(0x2e, nehalem),
-       ICPU(0x2f, nehalem),
-       ICPU(0x1c, atom),
-       ICPU(0x26, lincroft),
-       ICPU(0x2a, snb),
-       ICPU(0x2d, snb),
-       ICPU(0x36, atom),
-       ICPU(0x37, byt),
-       ICPU(0x4a, tangier),
-       ICPU(0x4c, cht),
-       ICPU(0x3a, ivb),
-       ICPU(0x3e, ivt),
-       ICPU(0x3c, hsw),
-       ICPU(0x3f, hsw),
-       ICPU(0x45, hsw),
-       ICPU(0x46, hsw),
-       ICPU(0x4d, avn),
-       ICPU(0x3d, bdw),
-       ICPU(0x47, bdw),
-       ICPU(0x4f, bdw),
-       ICPU(0x56, bdw),
-       ICPU(0x4e, skl),
-       ICPU(0x5e, skl),
-       ICPU(0x8e, skl),
-       ICPU(0x9e, skl),
-       ICPU(0x55, skx),
-       ICPU(0x6a, icx),
-       ICPU(0x6c, icx),
-       ICPU(0x57, knl),
-       ICPU(0x85, knl),
-       ICPU(0x5c, bxt),
-       ICPU(0x7a, bxt),
-       ICPU(0x5f, dnv),
-       ICPU(0x86, snr),
+       ICPU(NEHALEM_EP,                nehalem),
+       ICPU(NEHALEM,                   nehalem),
+       ICPU(NEHALEM_G,                 nehalem),
+       ICPU(WESTMERE,                  nehalem),
+       ICPU(WESTMERE_EP,               nehalem),
+       ICPU(NEHALEM_EX,                nehalem),
+       ICPU(WESTMERE_EX,               nehalem),
+       ICPU(ATOM_BONNELL,              atom),
+       ICPU(ATOM_BONNELL_MID,          lincroft),
+       ICPU(SANDYBRIDGE,               snb),
+       ICPU(SANDYBRIDGE_X,             snb),
+       ICPU(ATOM_SALTWELL,             atom),
+       ICPU(ATOM_SILVERMONT,           byt),
+       ICPU(ATOM_SILVERMONT_MID,       tangier),
+       ICPU(ATOM_AIRMONT,              cht),
+       ICPU(IVYBRIDGE,                 ivb),
+       ICPU(IVYBRIDGE_X,               ivt),
+       ICPU(HASWELL,                   hsw),
+       ICPU(HASWELL_X,                 hsw),
+       ICPU(HASWELL_L,                 hsw),
+       ICPU(HASWELL_G,                 hsw),
+       ICPU(ATOM_SILVERMONT_D,         avn),
+       ICPU(BROADWELL,                 bdw),
+       ICPU(BROADWELL_G,               bdw),
+       ICPU(BROADWELL_X,               bdw),
+       ICPU(BROADWELL_D,               bdw),
+       ICPU(SKYLAKE_L,                 skl),
+       ICPU(SKYLAKE,                   skl),
+       ICPU(KABYLAKE_L,                skl),
+       ICPU(KABYLAKE,                  skl),
+       ICPU(SKYLAKE_X,                 skx),
+       ICPU(ICELAKE_X,                 icx),
+       ICPU(ICELAKE_D,                 icx),
+       ICPU(XEON_PHI_KNL,              knl),
+       ICPU(XEON_PHI_KNM,              knl),
+       ICPU(ATOM_GOLDMONT,             bxt),
+       ICPU(ATOM_GOLDMONT_PLUS,        bxt),
+       ICPU(ATOM_GOLDMONT_D,           dnv),
+       ICPU(ATOM_TREMONT_D,            snr),
        {}
 };
 
@@ -1208,20 +1210,20 @@ static void __init skx_idle_state_table_
 static void __init mwait_idle_state_table_update(void)
 {
        switch (boot_cpu_data.x86_model) {
-       case 0x3e: /* IVT */
+       case INTEL_FAM6_IVYBRIDGE_X:
                ivt_idle_state_table_update();
                break;
-       case 0x5c: /* BXT */
-       case 0x7a:
+       case INTEL_FAM6_ATOM_GOLDMONT:
+       case INTEL_FAM6_ATOM_GOLDMONT_PLUS:
                bxt_idle_state_table_update();
                break;
-       case 0x5e: /* SKL-H */
+       case INTEL_FAM6_SKYLAKE:
                sklh_idle_state_table_update();
                break;
-       case 0x55: /* SKL-X */
+       case INTEL_FAM6_SKYLAKE_X:
                skx_idle_state_table_update();
                break;
-       }
+       }
 }
 
 static int __init mwait_idle_probe(void)




 


Rackspace

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