From: "Jan Beulich" Subject: [PATCH 2/2] x86/mwait_idle: support Haswell Date: Tue, 16 Apr 2013 09:48:24 +0100 Message-ID: <516D2C7802000078000CD7A6@nat28.tlf.novell.com> References: <516D2AB102000078000CD795@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part0C3C3D48.0__=" Return-path: In-Reply-To: <516D2AB102000078000CD795@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part0C3C3D48.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline This patch enables intel_idle to run on the next-generation Intel(R) Microarchitecture code named "Haswell". Signed-off-by: Len Brown =20 Signed-off-by: Jan Beulich --- a/xen/arch/x86/cpu/mwait-idle.c +++ b/xen/arch/x86/cpu/mwait-idle.c @@ -200,6 +200,34 @@ static const struct cpuidle_state ivb_cs } }; =20 +static const struct cpuidle_state hsw_cstates[MWAIT_MAX_NUM_CSTATES] =3D = { + { /* MWAIT C0 */ }, + { /* MWAIT C1 */ + .name =3D "C1-HSW", + .flags =3D MWAIT2flg(0x00), + .exit_latency =3D 2, + .target_residency =3D 2, + }, + { /* MWAIT C2 */ + .name =3D "C3-HSW", + .flags =3D MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED, + .exit_latency =3D 33, + .target_residency =3D 100, + }, + { /* MWAIT C3 */ + .name =3D "C6-HSW", + .flags =3D MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED, + .exit_latency =3D 133, + .target_residency =3D 400, + }, + { /* MWAIT C4 */ + .name =3D "C7s-HSW", + .flags =3D MWAIT2flg(0x32) | CPUIDLE_FLAG_TLB_FLUSHED, + .exit_latency =3D 166, + .target_residency =3D 500, + }, +}; + static const struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] =3D = { { /* MWAIT C0 */ }, { /* MWAIT C1 */ @@ -348,6 +376,10 @@ static const struct idle_cpu idle_cpu_iv .state_table =3D ivb_cstates, }; =20 +static const struct idle_cpu idle_cpu_hsw =3D { + .state_table =3D hsw_cstates, +}; + #define ICPU(model, cpu) { 6, model, &idle_cpu_##cpu } =20 static struct intel_idle_id { @@ -367,6 +399,10 @@ static struct intel_idle_id { ICPU(0x2d, snb), ICPU(0x3a, ivb), ICPU(0x3e, ivb), + ICPU(0x3c, hsw), + ICPU(0x3f, hsw), + ICPU(0x45, hsw), + ICPU(0x46, hsw), {} }; =20 --=__Part0C3C3D48.0__= Content-Type: text/plain; name="x86-mwait-idle-Haswell.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-mwait-idle-Haswell.patch" x86/mwait_idle: support Haswell=0A=0AThis patch enables intel_idle to run = on the next-generation Intel(R)=0AMicroarchitecture code named "Haswell".= =0A=0ASigned-off-by: Len Brown =0ASigned-off-by: Jan = Beulich =0A=0A--- a/xen/arch/x86/cpu/mwait-idle.c=0A+++ = b/xen/arch/x86/cpu/mwait-idle.c=0A@@ -200,6 +200,34 @@ static const struct = cpuidle_state ivb_cs=0A }=0A };=0A =0A+static const struct = cpuidle_state hsw_cstates[MWAIT_MAX_NUM_CSTATES] =3D {=0A+ { /* MWAIT = C0 */ },=0A+ { /* MWAIT C1 */=0A+ .name =3D "C1-HSW",=0A+ = .flags =3D MWAIT2flg(0x00),=0A+ .exit_latency =3D 2,=0A+ = .target_residency =3D 2,=0A+ },=0A+ { /* MWAIT C2 */=0A+ = .name =3D "C3-HSW",=0A+ .flags =3D MWAIT2flg(0x10) | CPUIDLE_FLAG_T= LB_FLUSHED,=0A+ .exit_latency =3D 33,=0A+ .target_res= idency =3D 100,=0A+ },=0A+ { /* MWAIT C3 */=0A+ .name =3D = "C6-HSW",=0A+ .flags =3D MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSH= ED,=0A+ .exit_latency =3D 133,=0A+ .target_residency = =3D 400,=0A+ },=0A+ { /* MWAIT C4 */=0A+ .name =3D = "C7s-HSW",=0A+ .flags =3D MWAIT2flg(0x32) | CPUIDLE_FLAG_TLB_FLUSH= ED,=0A+ .exit_latency =3D 166,=0A+ .target_residency = =3D 500,=0A+ },=0A+};=0A+=0A static const struct cpuidle_state = atom_cstates[MWAIT_MAX_NUM_CSTATES] =3D {=0A { /* MWAIT C0 */ },=0A { = /* MWAIT C1 */=0A@@ -348,6 +376,10 @@ static const struct idle_cpu = idle_cpu_iv=0A .state_table =3D ivb_cstates,=0A };=0A =0A+static const = struct idle_cpu idle_cpu_hsw =3D {=0A+ .state_table =3D hsw_cstates,=0A+};= =0A+=0A #define ICPU(model, cpu) { 6, model, &idle_cpu_##cpu }=0A =0A = static struct intel_idle_id {=0A@@ -367,6 +399,10 @@ static struct = intel_idle_id {=0A ICPU(0x2d, snb),=0A ICPU(0x3a, ivb),=0A = ICPU(0x3e, ivb),=0A+ ICPU(0x3c, hsw),=0A+ ICPU(0x3f, hsw),=0A+ = ICPU(0x45, hsw),=0A+ ICPU(0x46, hsw),=0A {}=0A };=0A =0A --=__Part0C3C3D48.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__Part0C3C3D48.0__=--