LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Valentin Schneider <valentin.schneider@arm.com>,
	linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org,
	Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Mel Gorman <mgorman@techsingularity.net>,
	Ard Biesheuvel <ardb@kernel.org>
Subject: Re: [SPLAT 2/3] irqchip/gic-v3-its: Sleeping spinlocks down gic_reserve_range()
Date: Wed, 11 Aug 2021 16:14:45 +0100	[thread overview]
Message-ID: <87im0c9foa.wl-maz@kernel.org> (raw)
In-Reply-To: <87a6lop3mi.ffs@tglx>

On Wed, 11 Aug 2021 13:28:21 +0100,
Thomas Gleixner <tglx@linutronix.de> wrote:
> 
> On Wed, Aug 11 2021 at 09:50, Marc Zyngier wrote:
> > On Tue, 10 Aug 2021 14:41:26 +0100,
> > Valentin Schneider <valentin.schneider@arm.com> wrote:
> > The issue is that although the redistributor tables have been
> > allocated ahead of time (outside of any cpuhp callback), they cannot
> > be programmed into the RDs until the corresponding CPUs have been
> > brought up (the registers may not be accessible).
> >
> > For the same reason, we don't know whether we can free them (because
> > there is already a table programmed there) or have to reserve them
> > with an efi_mem_reserve_persistent() call. efi_mem_reserve_iomem()
> > uses GFP_ATOMIC for its allocation, but this is not sufficient for RT
> > anymore.
> >
> > We could postpone the reservation of the memory to a later point (it
> > is only useful for kexec), but it isn't clear where that point is. The
> > CPU is not quite up yet, and we can't easily IPI the boot CPU to do
> > the reserve call.
> 
> Right, but don't you know about the need for reservation _before_
> bringing the CPU up?

Unfortunately not. To find out, you need to access a pair of per-CPU
registers which are not guaranteed to be powered-on until the
corresponding CPU has made it into the kernel (the firmware will power
things on as part of bringing the CPU up).

Which is why we always allocate the memory upfront for all the CPUs,
and each CPU either frees the memory if it already had something in
its redistributor, or point the redistributor to the memory and
reserves it.

This is probably the most epic fail of the GICv3 architecture...

Thanks,

	M.

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

  reply	other threads:[~2021-08-11 15:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-10 13:41 [SPLAT 0/3] Sleeping spinlocks in troublesome contexts on v5.14-rc4-rt6 Valentin Schneider
2021-08-10 13:41 ` [SPLAT 1/3] arm_pmu: Sleeping spinlocks down armpmu_alloc_atomic() Valentin Schneider
2021-08-10 13:54   ` Sebastian Andrzej Siewior
2021-08-10 17:16     ` Thomas Gleixner
2021-08-10 18:39       ` Sebastian Andrzej Siewior
2021-08-10 19:56         ` Thomas Gleixner
2021-08-10 13:41 ` [SPLAT 2/3] irqchip/gic-v3-its: Sleeping spinlocks down gic_reserve_range() Valentin Schneider
2021-08-11  8:50   ` Marc Zyngier
2021-08-11 12:28     ` Thomas Gleixner
2021-08-11 15:14       ` Marc Zyngier [this message]
2021-08-17 15:16     ` Ard Biesheuvel
2021-08-10 13:41 ` [SPLAT 3/3] gpio: dwapb: Sleeping spinlocks down IRQ mapping Valentin Schneider
2021-08-10 20:33   ` Thomas Gleixner
2021-08-11 10:52   ` Andy Shevchenko

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=87im0c9foa.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=ardb@kernel.org \
    --cc=bigeasy@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mgorman@techsingularity.net \
    --cc=tglx@linutronix.de \
    --cc=valentin.schneider@arm.com \
    --cc=will@kernel.org \
    --subject='Re: [SPLAT 2/3] irqchip/gic-v3-its: Sleeping spinlocks down gic_reserve_range()' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).