From: "Jan Beulich" Subject: [PATCH] x86, idle: add barriers to CLFLUSH workaround Date: Mon, 08 Sep 2014 14:25:43 +0100 Message-ID: <540DCA770200007800032038@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartD8ED8C47.0__=" Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XQyx1-0000YC-85 for xen-devel@lists.xenproject.org; Mon, 08 Sep 2014 13:25:47 +0000 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 Cc: Keir Fraser 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. --=__PartD8ED8C47.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline ... since the documentation is explicit that CLFLUSH is only ordered with respect to MFENCE. Signed-off-by: H. Peter Anvin Signed-off-by: Jan Beulich --- a/xen/arch/x86/acpi/cpu_idle.c +++ b/xen/arch/x86/acpi/cpu_idle.c @@ -346,7 +346,11 @@ void mwait_idle_with_hints(unsigned int=20 s_time_t expires =3D per_cpu(timer_deadline, cpu); =20 if ( boot_cpu_has(X86_FEATURE_CLFLUSH_MONITOR) ) + { + mb(); clflush((void *)&mwait_wakeup(cpu)); + mb(); + } =20 __monitor((void *)&mwait_wakeup(cpu), 0, 0); smp_mb(); --=__PartD8ED8C47.0__= Content-Type: text/plain; name="x86-clflush-monitor-barriers.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-clflush-monitor-barriers.patch" x86, idle: add barriers to CLFLUSH workaround=0A=0A... since the documentat= ion is explicit that CLFLUSH is only ordered=0Awith respect to MFENCE.=0A= =0ASigned-off-by: H. Peter Anvin =0ASigned-off-by: = Jan Beulich =0A=0A--- a/xen/arch/x86/acpi/cpu_idle.c=0A+= ++ b/xen/arch/x86/acpi/cpu_idle.c=0A@@ -346,7 +346,11 @@ void mwait_idle_wi= th_hints(unsigned int =0A s_time_t expires =3D per_cpu(timer_deadline, = cpu);=0A =0A if ( boot_cpu_has(X86_FEATURE_CLFLUSH_MONITOR) )=0A+ = {=0A+ mb();=0A clflush((void *)&mwait_wakeup(cpu));=0A+ = mb();=0A+ }=0A =0A __monitor((void *)&mwait_wakeup(cpu), 0, = 0);=0A smp_mb();=0A --=__PartD8ED8C47.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 --=__PartD8ED8C47.0__=--