lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5947336.4NNQoPcqAU@kreacher>
Date:   Tue, 22 Sep 2020 21:03:15 +0200
From:   "Rafael J. Wysocki" <rjw@...ysocki.net>
To:     Guenter Roeck <linux@...ck-us.net>
Cc:     Peter Zijlstra <peterz@...radead.org>, bp@...en8.de,
        x86@...nel.org, tony.luck@...el.com, lenb@...nel.org,
        daniel.lezcano@...aro.org, linux-kernel@...r.kernel.org,
        linux-acpi@...r.kernel.org, linux-pm@...r.kernel.org,
        ulf.hansson@...aro.org, paulmck@...nel.org, tglx@...utronix.de,
        naresh.kamboju@...aro.org
Subject: Re: [RFC][PATCH 1/4] acpi: Use CPUIDLE_FLAG_TIMER_STOP

On Tuesday, September 22, 2020 5:26:51 AM CEST Guenter Roeck wrote:
> On Tue, Sep 15, 2020 at 12:31:58PM +0200, Peter Zijlstra wrote:
> > Make acpi_processor_idle use the common broadcast code, there's no
> > reason not to. This also removes some RCU usage after
> > rcu_idle_enter().
> > 
> > Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> > Acked-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> > Reported-by: Borislav Petkov <bp@...e.de>
> > Tested-by: Borislav Petkov <bp@...e.de>
> > ---
> >  drivers/acpi/processor_idle.c |   49 +++++++++++++-----------------------------
> >  1 file changed, 16 insertions(+), 33 deletions(-)
> > 
> > --- a/drivers/acpi/processor_idle.c
> > +++ b/drivers/acpi/processor_idle.c
> > @@ -161,18 +161,10 @@ static void lapic_timer_propagate_broadc
> >  }
> >  
> >  /* Power(C) State timer broadcast control */
> > -static void lapic_timer_state_broadcast(struct acpi_processor *pr,
> > -				       struct acpi_processor_cx *cx,
> > -				       int broadcast)
> > -{
> > -	int state = cx - pr->power.states;
> > -
> > -	if (state >= pr->power.timer_broadcast_on_state) {
> > -		if (broadcast)
> > -			tick_broadcast_enter();
> > -		else
> > -			tick_broadcast_exit();
> > -	}
> > +static bool lapic_timer_needs_broadcast(struct acpi_processor *pr,
> > +					struct acpi_processor_cx *cx)
> > +{
> > +	return cx - pr->power.states >= pr->power.timer_broadcast_on_state;
> >  }
> >  
> >  #else
> > @@ -180,9 +172,9 @@ static void lapic_timer_state_broadcast(
> >  static void lapic_timer_check_state(int state, struct acpi_processor *pr,
> >  				   struct acpi_processor_cx *cstate) { }
> >  static void lapic_timer_propagate_broadcast(struct acpi_processor *pr) { }
> > -static void lapic_timer_state_broadcast(struct acpi_processor *pr,
> > -				       struct acpi_processor_cx *cx,
> > -				       int broadcast)
> > +
> > +static bool lapic_timer_needs_broadcast(struct acpi_processor *pr,
> > +					struct acpi_processor_cx *cx)
> >  {
> >  }
> 
> drivers/acpi/processor_idle.c: In function 'lapic_timer_needs_broadcast':
> drivers/acpi/processor_idle.c:179:1: warning: no return statement in function returning non-void [-Wreturn-type]
> 
> Should this return true or false ?

false - if the lapic timer doesn't stop, it doesn't need broadcast.

FWIW, patch appended.

Cheers!

---
From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
Subject: [PATCH] ACPI: processor: Fix build for ARCH_APICTIMER_STOPS_ON_C3 unset

Fix the lapic_timer_needs_broadcast() stub for
ARCH_APICTIMER_STOPS_ON_C3 unset to actually return
a value.

Fixes: aa6b43d57f99 ("ACPI: processor: Use CPUIDLE_FLAG_TIMER_STOP")
Reported-by: Guenter Roeck <linux@...ck-us.net>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
---
 drivers/acpi/processor_idle.c |    1 +
 1 file changed, 1 insertion(+)

Index: linux-pm/drivers/acpi/processor_idle.c
===================================================================
--- linux-pm.orig/drivers/acpi/processor_idle.c
+++ linux-pm/drivers/acpi/processor_idle.c
@@ -176,6 +176,7 @@ static void lapic_timer_propagate_broadc
 static bool lapic_timer_needs_broadcast(struct acpi_processor *pr,
 					struct acpi_processor_cx *cx)
 {
+	return false;
 }
 
 #endif



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ