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: <8634f0mall.wl-maz@kernel.org>
Date: Wed, 26 Mar 2025 08:59:02 +0000
From: Marc Zyngier <maz@...nel.org>
To: Youngmin Nam <youngmin.nam@...sung.com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
	Saravana Kannan <saravanak@...gle.com>,
	Ulf Hansson
	<ulf.hansson@...aro.org>,
	Vincent Guittot <vincent.guittot@...aro.org>,
	linux-arm-kernel@...ts.infradead.org,
	linux-kernel@...r.kernel.org,
	kernel-team@...roid.com,
	hajun.sung@...sung.com,
	d7271.choe@...sung.com,
	joonki.min@...sung.com
Subject: Re: [GICv3 ITS]S2IDLE framework does not invoke syscore_ops in GICv3 ITS driver

On Wed, 26 Mar 2025 03:09:37 +0000,
Youngmin Nam <youngmin.nam@...sung.com> wrote:
> 
> Hi.
> 
> On our SoC, we are using S2IDLE instead of S2R as a system suspend mode.
> However, when I try to enable ARM GICv3 ITS driver (drivers/irqchip/irq-gic-v3-its.c),
> I noticed that there is no proper way to invoke suspend/resume callback,
> because it only uses syscore_ops, which is not called in an s2idle scenario.

This is *by design*.

> Please refer to the codes below.
> 
> <drivers/irqchip/irq-gic-v3-its.c>
> 5028 static struct syscore_ops its_syscore_ops = {
> 5029         .suspend = its_save_disable,
> 5030         .resume = its_restore_enable,
> 5031 };
> ...
> 5803         register_syscore_ops(&its_syscore_ops);
> 
> <kernel/power/suspend.c>
> 444         if (state == PM_SUSPEND_TO_IDLE) {
> 445                 s2idle_loop();
> 446                 goto Platform_wake;
> 447         }
> 448
> 449         error = pm_sleep_disable_secondary_cpus();
> 450         if (error || suspend_test(TEST_CPUS)) {
> 451                 log_suspend_abort_reason("Disabling non-boot cpus failed");
> 452                 goto Enable_cpus;
> 453         }
> 454
> 455         arch_suspend_disable_irqs();
> 456         BUG_ON(!irqs_disabled());
> 457
> 458         system_state = SYSTEM_SUSPEND;
> 459
> 460         error = syscore_suspend();
> 
> How should we handle this situation ?

By implementing anything related to GIC power-management in your EL3
firmware. Only your firmware knows whether you are going into a state
where the GIC (and the ITS) is going to lose its state (because power
is going to be removed) or if the sleep period is short enough that
you can come back from idle without loss of context.

Furthermore, there is a lot of things that non-secure cannot do when
it comes to GIC power management (most the controls are secure only),
so it is pretty clear that the kernel is the wrong place for this.

I'd suggest you look at what TF-A provides, because this is not
exactly a new problem (it has been solved several years ago).

	M.

-- 
Without deviation from the norm, progress is not possible.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ