From: "Jan Beulich" Subject: [PATCH] x86/cpuidle: restrict scope of mwait_ptr in acpi_dead_idle() Date: Tue, 06 Mar 2012 14:58:18 +0000 Message-ID: <4F56341A0200007800076ACC@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part4D63591A.0__=" Return-path: 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. --=__Part4D63591A.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline ... just to make sure it doesn't get used improperly (resulting from the discussion around what became c/s 24968:8964c223836c). Signed-off-by: Jan Beulich --- a/xen/arch/x86/acpi/cpu_idle.c +++ b/xen/arch/x86/acpi/cpu_idle.c @@ -565,7 +565,6 @@ static void acpi_dead_idle(void) { struct acpi_processor_power *power; struct acpi_processor_cx *cx; - void *mwait_ptr; =20 if ( (power =3D processor_powers[smp_processor_id()]) =3D=3D NULL ) goto default_halt; @@ -573,10 +572,10 @@ static void acpi_dead_idle(void) if ( (cx =3D &power->states[power->count-1]) =3D=3D NULL ) goto default_halt; =20 - mwait_ptr =3D (void *)&mwait_wakeup(smp_processor_id()); - if ( cx->entry_method =3D=3D ACPI_CSTATE_EM_FFH ) { + void *mwait_ptr =3D &mwait_wakeup(smp_processor_id()); + /* * Cache must be flushed as the last operation before sleeping. * Otherwise, CPU may still hold dirty data, breaking cache = coherency, --=__Part4D63591A.0__= Content-Type: text/plain; name="x86-cpuidle-scope.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-cpuidle-scope.patch" x86/cpuidle: restrict scope of mwait_ptr in acpi_dead_idle()=0A=0A... just = to make sure it doesn't get used improperly (resulting from=0Athe = discussion around what became c/s 24968:8964c223836c).=0A=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@@ -565,7 +565,6 @@ static void = acpi_dead_idle(void)=0A {=0A struct acpi_processor_power *power;=0A = struct acpi_processor_cx *cx;=0A- void *mwait_ptr;=0A =0A if ( = (power =3D processor_powers[smp_processor_id()]) =3D=3D NULL )=0A = goto default_halt;=0A@@ -573,10 +572,10 @@ static void acpi_dead_idle(void)= =0A if ( (cx =3D &power->states[power->count-1]) =3D=3D NULL )=0A = goto default_halt;=0A =0A- mwait_ptr =3D (void *)&mwait_wakeup(smp_pr= ocessor_id());=0A-=0A if ( cx->entry_method =3D=3D ACPI_CSTATE_EM_FFH = )=0A {=0A+ void *mwait_ptr =3D &mwait_wakeup(smp_processor_id())= ;=0A+=0A /*=0A * Cache must be flushed as the last = operation before sleeping.=0A * Otherwise, CPU may still hold = dirty data, breaking cache coherency,=0A --=__Part4D63591A.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 --=__Part4D63591A.0__=--