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: <738769693c52ed23e35850325ee414ab131a06ea.camel@amazon.com>
Date: Tue, 2 Apr 2024 02:30:23 +0000
From: "Okanovic, Haris" <harisokn@...zon.com>
To: "linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-assembly@...r.kernel.org" <linux-assembly@...r.kernel.org>
CC: "peterz@...radead.org" <peterz@...radead.org>, "Saidi, Ali"
	<alisaidi@...zon.com>, "Blake, Geoff" <blakgeof@...zon.com>, "Silver, Brian"
	<silverbr@...zon.com>
Subject: Re: [PATCH 3/3] arm64: cpuidle: Add arm_poll_idle

On Mon, 2024-04-01 at 20:47 -0500, Haris Okanovic wrote:
> +static int __cpuidle arm_idle_wfe_poll(struct cpuidle_device *dev,
> +                               struct cpuidle_driver *drv, int idx)
> +{
> +       u64 time_start, time_limit;
> +
> +       time_start = local_clock();
> +       dev->poll_time_limit = false;
> +
> +       local_irq_enable();

Re this comment from Peter Zijlstra [1], should I use
raw_local_irq_enable() instead? I see examples of both under
drivers/cpuidle/.

[1]
https://elixir.bootlin.com/linux/v6.9-rc2/source/include/linux/cpuidle.h#L119

> +
> +       if (current_set_polling_and_test())
> +               goto end;
> +
> +       time_limit = cpuidle_poll_time(drv, dev);
> +
> +       do {
> +               // exclusive read arms the monitor for wfe
> +               if (__READ_ONCE_EX(current_thread_info()->flags) &
> _TIF_NEED_RESCHED)
> +                       goto end;
> +
> +               // may exit prematurely, see ARM_ARCH_TIMER_EVTSTREAM
> +               wfe();
> +       } while (local_clock() - time_start < time_limit);
> +
> +       dev->poll_time_limit = true;
> +
> +end:
> +       current_clr_polling();
> +       return idx;
> +}
> +

Thanks,
Haris Okanovic

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ