All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Nicholas Piggin <npiggin@gmail.com>, linuxppc-dev@lists.ozlabs.org
Cc: Nicholas Piggin <npiggin@gmail.com>
Subject: Re: [PATCH v3 11/11] powerpc/64: use interrupt restart table to speed up return from interrupt
Date: Tue, 15 Jun 2021 23:44:09 +1000	[thread overview]
Message-ID: <87bl87tf86.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <20210610130921.706938-12-npiggin@gmail.com>

Nicholas Piggin <npiggin@gmail.com> writes:
> diff --git a/arch/powerpc/lib/feature-fixups.c b/arch/powerpc/lib/feature-fixups.c
> index fe26f2fa0f3f..fbe94e2d5011 100644
> --- a/arch/powerpc/lib/feature-fixups.c
> +++ b/arch/powerpc/lib/feature-fixups.c
> @@ -412,12 +430,19 @@ void do_entry_flush_fixups(enum l1d_flush_type types)
>  	stop_machine(__do_entry_flush_fixups, &types, NULL);
>  }
>  
> -void do_rfi_flush_fixups(enum l1d_flush_type types)
> +static int __do_rfi_flush_fixups(void *data)
>  {
> +	enum l1d_flush_type types = *(enum l1d_flush_type *)data;
>  	unsigned int instrs[3], *dest;
>  	long *start, *end;
>  	int i;
>  
> +	if (types & L1D_FLUSH_FALLBACK)
> +		rfi_exit_not_reentrant = true;
> +	else
> +		rfi_exit_not_reentrant = false;
> +	update_interrupt_exit();

This is not happy:

[    0.000000][    T0] ============================================
[    0.000000][    T0] WARNING: possible recursive locking detected
[    0.000000][    T0] 5.13.0-rc2-00118-gca433a3a44e3 #1 Not tainted
[    0.000000][    T0] --------------------------------------------
[    0.000000][    T0] swapper/0 is trying to acquire lock:
[    0.000000][    T0] c00000000252fa10 (cpu_hotplug_lock){....}-{0:0}, at: static_key_enable+0x24/0x50
[    0.000000][    T0]
[    0.000000][    T0] but task is already holding lock:
[    0.000000][    T0] c00000000252fa10 (cpu_hotplug_lock){....}-{0:0}, at: stop_machine+0x2c/0x60
[    0.000000][    T0]
[    0.000000][    T0] other info that might help us debug this:
[    0.000000][    T0]  Possible unsafe locking scenario:
[    0.000000][    T0]
[    0.000000][    T0]        CPU0
[    0.000000][    T0]        ----
[    0.000000][    T0]   lock(cpu_hotplug_lock);
[    0.000000][    T0]   lock(cpu_hotplug_lock);
[    0.000000][    T0]
[    0.000000][    T0]  *** DEADLOCK ***
[    0.000000][    T0]
[    0.000000][    T0]  May be due to missing lock nesting notation
[    0.000000][    T0]
[    0.000000][    T0] 1 lock held by swapper/0:
[    0.000000][    T0]  #0: c00000000252fa10 (cpu_hotplug_lock){....}-{0:0}, at: stop_machine+0x2c/0x60
[    0.000000][    T0]
[    0.000000][    T0] stack backtrace:
[    0.000000][    T0] CPU: 0 PID: 0 Comm: swapper Not tainted 5.13.0-rc2-00118-gca433a3a44e3 #1
[    0.000000][    T0] Call Trace:
[    0.000000][    T0] [c0000000027db8f0] [c00000000093dd28] dump_stack+0xec/0x144 (unreliable)
[    0.000000][    T0] [c0000000027db940] [c0000000001ed5b4] __lock_acquire+0x1744/0x28b0
[    0.000000][    T0] [c0000000027dba70] [c0000000001ef338] lock_acquire+0x128/0x600
[    0.000000][    T0] [c0000000027dbb70] [c00000000015035c] cpus_read_lock+0x4c/0x170
[    0.000000][    T0] [c0000000027dbba0] [c0000000003c2594] static_key_enable+0x24/0x50
[    0.000000][    T0] [c0000000027dbbd0] [c0000000000ae87c] __do_rfi_flush_fixups+0x7c/0x300
[    0.000000][    T0] [c0000000027dbc80] [c0000000002ab7e4] stop_machine_cpuslocked+0xe4/0x200
[    0.000000][    T0] [c0000000027dbcf0] [c0000000002ab940] stop_machine+0x40/0x60
[    0.000000][    T0] [c0000000027dbd30] [c0000000000aef30] do_rfi_flush_fixups+0x30/0x50
[    0.000000][    T0] [c0000000027dbd60] [c000000000040890] setup_rfi_flush+0xa0/0x140
[    0.000000][    T0] [c0000000027dbdd0] [c00000000201c6c4] pnv_setup_arch+0x304/0x4ac
[    0.000000][    T0] [c0000000027dbe60] [c00000000200a31c] setup_arch+0x374/0x3c4
[    0.000000][    T0] [c0000000027dbee0] [c000000002003d08] start_kernel+0xb0/0x790
[    0.000000][    T0] [c0000000027dbf90] [c00000000000d79c] start_here_common+0x1c/0x600
[    0.000000][    T0] rfi-flush: patched 12 locations (fallback displacement flush)


cheers

  reply	other threads:[~2021-06-15 13:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10 13:09 [PATCH v3 00/11] powerpc/64: fast interrupt exits Nicholas Piggin
2021-06-10 13:09 ` [PATCH v3 01/11] powerpc: remove interrupt exit helpers unused argument Nicholas Piggin
2021-06-10 13:09 ` [PATCH v3 02/11] powerpc/64s: introduce different functions to return from SRR vs HSRR interrupts Nicholas Piggin
2021-06-10 13:09 ` [PATCH v3 03/11] powerpc/64s: avoid reloading (H)SRR registers if they are still valid Nicholas Piggin
2021-06-15 13:39   ` Michael Ellerman
2021-06-10 13:09 ` [PATCH v3 04/11] powerpc/64: handle MSR EE and RI in interrupt entry wrapper Nicholas Piggin
2021-06-10 13:09 ` [PATCH v3 05/11] powerpc/64: move interrupt return asm to interrupt_64.S Nicholas Piggin
2021-06-10 13:09 ` [PATCH v3 06/11] powerpc/64s: system call avoid setting MSR[RI] until we set MSR[EE] Nicholas Piggin
2021-06-10 13:09 ` [PATCH v3 07/11] powerpc/64s: save one more register in the masked interrupt handler Nicholas Piggin
2021-06-10 13:09 ` [PATCH v3 08/11] powerpc/64: allow alternate return locations for soft-masked interrupts Nicholas Piggin
2021-06-10 13:09 ` [PATCH v3 09/11] powerpc/64: interrupt soft-enable race fix Nicholas Piggin
2021-06-10 13:09 ` [PATCH v3 10/11] powerpc/64: treat low kernel text as irqs soft-masked Nicholas Piggin
2021-06-10 13:09 ` [PATCH v3 11/11] powerpc/64: use interrupt restart table to speed up return from interrupt Nicholas Piggin
2021-06-15 13:44   ` Michael Ellerman [this message]
2021-06-16  1:20     ` Nicholas Piggin
2021-06-15 14:07 ` [PATCH v3 00/11] powerpc/64: fast interrupt exits Michael Ellerman
2021-06-16  1:25   ` Nicholas Piggin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bl87tf86.fsf@mpe.ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=npiggin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.