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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZyD3TiU1Dk_zYsXE@J2N7QTR9R3.cambridge.arm.com>
Date: Tue, 29 Oct 2024 14:55:10 +0000
From: Mark Rutland <mark.rutland@....com>
To: Jinjie Ruan <ruanjinjie@...wei.com>
Cc: oleg@...hat.com, linux@...linux.org.uk, will@...nel.org,
	catalin.marinas@....com, sstabellini@...nel.org, maz@...nel.org,
	tglx@...utronix.de, peterz@...radead.org, luto@...nel.org,
	kees@...nel.org, wad@...omium.org, akpm@...ux-foundation.org,
	samitolvanen@...gle.com, arnd@...db.de, ojeda@...nel.org,
	rppt@...nel.org, hca@...ux.ibm.com, aliceryhl@...gle.com,
	samuel.holland@...ive.com, paulmck@...nel.org, aquini@...hat.com,
	petr.pavlu@...e.com, viro@...iv.linux.org.uk,
	rmk+kernel@...linux.org.uk, ardb@...nel.org,
	wangkefeng.wang@...wei.com, surenb@...gle.com,
	linus.walleij@...aro.org, yangyj.ee@...il.com, broonie@...nel.org,
	mbenes@...e.cz, puranjay@...nel.org, pcc@...gle.com,
	guohanjun@...wei.com, sudeep.holla@....com,
	Jonathan.Cameron@...wei.com, prarit@...hat.com, liuwei09@...tc.cn,
	dwmw@...zon.co.uk, oliver.upton@...ux.dev,
	kristina.martsenko@....com, ptosi@...gle.com, frederic@...nel.org,
	vschneid@...hat.com, thiago.bauermann@...aro.org,
	joey.gouly@....com, liuyuntao12@...wei.com, leobras@...hat.com,
	linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	xen-devel@...ts.xenproject.org
Subject: Re: [PATCH -next v4 07/19] arm64: entry: Call
 arm64_preempt_schedule_irq() only if irqs enabled

On Fri, Oct 25, 2024 at 06:06:48PM +0800, Jinjie Ruan wrote:
> Only if irqs are enabled when the interrupt trapped, there may be
> a chance to reschedule after the interrupt has been handled, so move
> arm64_preempt_schedule_irq() into regs_irqs_disabled() check false
> if block.
> 
> As Mark pointed out, this change will have the following key impact:
> 
>     "We will not preempt when taking interrupts from a region of kernel
>     code where IRQs are enabled but RCU is not watching, matching the
>     behaviour of the generic entry code.
> 
>     This has the potential to introduce livelock if we can ever have a
>     screaming interrupt in such a region, so we'll need to go figure out
>     whether that's actually a problem.
> 
>     Having this as a separate patch will make it easier to test/bisect
>     for that specifically."
> 
> Suggested-by: Mark Rutland <mark.rutland@....com>
> Signed-off-by: Jinjie Ruan <ruanjinjie@...wei.com>

This should be folded into the prior patch.

Mark.

> ---
>  arch/arm64/kernel/entry-common.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/kernel/entry-common.c b/arch/arm64/kernel/entry-common.c
> index e0380812d71e..b57f6dc66115 100644
> --- a/arch/arm64/kernel/entry-common.c
> +++ b/arch/arm64/kernel/entry-common.c
> @@ -114,8 +114,6 @@ static void __sched arm64_preempt_schedule_irq(void)
>  static void noinstr exit_to_kernel_mode(struct pt_regs *regs,
>  					irqentry_state_t state)
>  {
> -	arm64_preempt_schedule_irq();
> -
>  	mte_check_tfsr_exit();
>  
>  	lockdep_assert_irqs_disabled();
> @@ -129,6 +127,8 @@ static void noinstr exit_to_kernel_mode(struct pt_regs *regs,
>  			return;
>  		}
>  
> +		arm64_preempt_schedule_irq();
> +
>  		trace_hardirqs_on();
>  	} else {
>  		if (state.exit_rcu)
> -- 
> 2.34.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ