From: "Jan Beulich" Subject: Re: [PATCH 2/2] mwait_idle: Broadwell support Date: Mon, 08 Sep 2014 14:24:19 +0100 Message-ID: <540DCA230200007800032034@mail.emea.novell.com> References: <1410180127-4812-1-git-send-email-ross.lagerwall@citrix.com> <1410180127-4812-2-git-send-email-ross.lagerwall@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part8CB9D813.1__=" Return-path: In-Reply-To: <1410180127-4812-2-git-send-email-ross.lagerwall@citrix.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: Ross Lagerwall Cc: Keir Fraser , 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. --=__Part8CB9D813.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline >>> On 08.09.14 at 14:42, wrote: > From: Len Brown >=20 > Broadwell (BDW) is similar to Haswell (HSW), the preceding processor=20 > generation. >=20 > Currently, the only difference in their C-state tables is that PC3 max = exit=20 > latency > is 33usec on HSW and 40usec on BDW. >=20 > Signed-off-by: Len Brown > Signed-off-by: Ross Lagerwall Here yours is almost identical to mine - yours lacking a "const" and having some indentation issues. Jan x86/mwait-idle: Broadwell support Broadwell (BDW) is similar to Haswell (HSW), the preceding processor = generation. Currently, the only difference in their C-state tables is that PC3 max = exit latency is 33usec on HSW and 40usec on BDW. Signed-off-by: Len Brown Signed-off-by: Jan Beulich --- a/xen/arch/x86/cpu/mwait-idle.c +++ b/xen/arch/x86/cpu/mwait-idle.c @@ -398,6 +398,58 @@ static const struct cpuidle_state hsw_cs {} }; =20 +static const struct cpuidle_state bdw_cstates[] =3D { + { + .name =3D "C1-BDW", + .flags =3D MWAIT2flg(0x00), + .exit_latency =3D 2, + .target_residency =3D 2, + }, + { + .name =3D "C1E-BDW", + .flags =3D MWAIT2flg(0x01), + .exit_latency =3D 10, + .target_residency =3D 20, + }, + { + .name =3D "C3-BDW", + .flags =3D MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED, + .exit_latency =3D 40, + .target_residency =3D 100, + }, + { + .name =3D "C6-BDW", + .flags =3D MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED, + .exit_latency =3D 133, + .target_residency =3D 400, + }, + { + .name =3D "C7s-BDW", + .flags =3D MWAIT2flg(0x32) | CPUIDLE_FLAG_TLB_FLUSHED, + .exit_latency =3D 166, + .target_residency =3D 500, + }, + { + .name =3D "C8-BDW", + .flags =3D MWAIT2flg(0x40) | CPUIDLE_FLAG_TLB_FLUSHED, + .exit_latency =3D 300, + .target_residency =3D 900, + }, + { + .name =3D "C9-BDW", + .flags =3D MWAIT2flg(0x50) | CPUIDLE_FLAG_TLB_FLUSHED, + .exit_latency =3D 600, + .target_residency =3D 1800, + }, + { + .name =3D "C10-BDW", + .flags =3D MWAIT2flg(0x60) | CPUIDLE_FLAG_TLB_FLUSHED, + .exit_latency =3D 2600, + .target_residency =3D 7700, + }, + {} +}; + static const struct cpuidle_state atom_cstates[] =3D { { .name =3D "C1E-ATM", @@ -596,6 +648,11 @@ static const struct idle_cpu idle_cpu_hs .disable_promotion_to_c1e =3D 1, }; =20 +static const struct idle_cpu idle_cpu_bdw =3D { + .state_table =3D bdw_cstates, + .disable_promotion_to_c1e =3D 1, +}; + static const struct idle_cpu idle_cpu_avn =3D { .state_table =3D avn_cstates, .disable_promotion_to_c1e =3D 1, @@ -627,6 +684,9 @@ static struct intel_idle_id { ICPU(0x45, hsw), ICPU(0x46, hsw), ICPU(0x4d, avn), + ICPU(0x3d, bdw), + ICPU(0x4f, bdw), + ICPU(0x56, bdw), {} }; =20 --=__Part8CB9D813.1__= Content-Type: text/plain; name="x86-mwait-idle-Broadwell.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-mwait-idle-Broadwell.patch" x86/mwait-idle: Broadwell support=0A=0ABroadwell (BDW) is similar to = Haswell (HSW), the preceding processor generation.=0A=0ACurrently, the = only difference in their C-state tables is that PC3 max exit latency=0Ais = 33usec on HSW and 40usec on BDW.=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@@ = -398,6 +398,58 @@ static const struct cpuidle_state hsw_cs=0A {}=0A = };=0A =0A+static const struct cpuidle_state bdw_cstates[] =3D {=0A+ = {=0A+ .name =3D "C1-BDW",=0A+ .flags =3D MWAIT2flg(0x00),= =0A+ .exit_latency =3D 2,=0A+ .target_residency = =3D 2,=0A+ },=0A+ {=0A+ .name =3D "C1E-BDW",=0A+ = .flags =3D MWAIT2flg(0x01),=0A+ .exit_latency =3D 10,=0A+ = .target_residency =3D 20,=0A+ },=0A+ {=0A+ .name =3D = "C3-BDW",=0A+ .flags =3D MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSH= ED,=0A+ .exit_latency =3D 40,=0A+ .target_residency = =3D 100,=0A+ },=0A+ {=0A+ .name =3D "C6-BDW",=0A+ = .flags =3D MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED,=0A+ = .exit_latency =3D 133,=0A+ .target_residency =3D 400,=0A+ = },=0A+ {=0A+ .name =3D "C7s-BDW",=0A+ .flags =3D = MWAIT2flg(0x32) | CPUIDLE_FLAG_TLB_FLUSHED,=0A+ .exit_latency =3D = 166,=0A+ .target_residency =3D 500,=0A+ },=0A+ {=0A+ = .name =3D "C8-BDW",=0A+ .flags =3D MWAIT2flg(0x40) | CPUIDLE_FLAG_T= LB_FLUSHED,=0A+ .exit_latency =3D 300,=0A+ .target_res= idency =3D 900,=0A+ },=0A+ {=0A+ .name =3D "C9-BDW",=0A+ = .flags =3D MWAIT2flg(0x50) | CPUIDLE_FLAG_TLB_FLUSHED,=0A+ = .exit_latency =3D 600,=0A+ .target_residency =3D 1800,=0A+ = },=0A+ {=0A+ .name =3D "C10-BDW",=0A+ .flags =3D = MWAIT2flg(0x60) | CPUIDLE_FLAG_TLB_FLUSHED,=0A+ .exit_latency =3D = 2600,=0A+ .target_residency =3D 7700,=0A+ },=0A+ {}=0A+};=0A= +=0A static const struct cpuidle_state atom_cstates[] =3D {=0A {=0A = .name =3D "C1E-ATM",=0A@@ -596,6 +648,11 @@ static const struct idle_cpu = idle_cpu_hs=0A .disable_promotion_to_c1e =3D 1,=0A };=0A =0A+static const = struct idle_cpu idle_cpu_bdw =3D {=0A+ .state_table =3D bdw_cstates,=0A+ = .disable_promotion_to_c1e =3D 1,=0A+};=0A+=0A static const struct idle_cpu = idle_cpu_avn =3D {=0A .state_table =3D avn_cstates,=0A .disable_pr= omotion_to_c1e =3D 1,=0A@@ -627,6 +684,9 @@ static struct intel_idle_id = {=0A ICPU(0x45, hsw),=0A ICPU(0x46, hsw),=0A ICPU(0x4d, = avn),=0A+ ICPU(0x3d, bdw),=0A+ ICPU(0x4f, bdw),=0A+ ICPU(0x56, = bdw),=0A {}=0A };=0A =0A --=__Part8CB9D813.1__= 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 --=__Part8CB9D813.1__=--