All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Bharat Gooty <bharat.gooty@broadcom.com>
Cc: Michael Walle <michael@walle.cc>,
	U-Boot Mailing List <u-boot@lists.denx.de>,
	Vladimir Oltean <vladimir.oltean@nxp.com>,
	Hou Zhiqiang <Zhiqiang.Hou@nxp.com>,
	Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>,
	Simon Glass <sjg@chromium.org>,
	Priyanka Jain <priyanka.jain@nxp.com>,
	Tom Rini <trini@konsulko.com>,
	Roman Bacik <roman.bacik@broadcom.com>
Subject: Re: [PATCH 0/2] arch: arm: gic-v3-its: stop abusing the device tree
Date: Thu, 28 Oct 2021 15:39:12 +0100	[thread overview]
Message-ID: <87v91h9ptb.wl-maz@kernel.org> (raw)
In-Reply-To: <CACvutz-3LKJgtHS9oWpaANsYNLfnAJm6985MSH3De6OXxDsnFw@mail.gmail.com>

On Thu, 28 Oct 2021 11:27:44 +0100,
Bharat Gooty <bharat.gooty@broadcom.com> wrote:
> 
> [1  <text/plain; UTF-8 (7bit)>]
> On Thu, Oct 28, 2021 at 3:19 PM Marc Zyngier <maz@kernel.org> wrote:
> 
> > On Thu, 28 Oct 2021 10:20:53 +0100,
> > Bharat Gooty <bharat.gooty@broadcom.com> wrote:
> > >
> > > For GIC V3, once the LPI tables are programmed, we can not update it,
> > > unless we do a reset.
> >
> > Please tell me something I don't know...
> >
> > For GIC V3 , once the Locality specific peripheral interrupts (LPI) table
> is programmed and enabled, unless the GIC is reset, we can not re-program
> the LPI tables. For these reasons, reserve the memory and program the GIC
> redistributor PROPBASER and LPI_PENDBASE registers.
> If we do not program the LPI table in the bootloader, during the Linux
> boot, Linux will allocate the LPI table memory. Assume you want to boot a
> new kernel and do the kexec kernel. For the kexec kernel boot, Linux will
> again allocate the LPI table memory. But writing to the GIC registers will
> fail. As the LPI for the redistributors is already enabled by the previous
> Linux kernel, unless we do GIC reset, we can not update the LPI
> tables.

This really was a rhetorical question. I am painfully aware of most of
the GIC's "features", having dealt with it in Linux and at the
architecture level for the past 10+ years.

> 
> 
> > > For the kexec kernel, where the reboot does not happen, in this case,
> > > during the new kernel boot, the new LPI tables address will not be
> > updated.
> >
> > Since July 2018, the Linux kernel is perfectly able to deal with this
> > without any extra support. It will communicate the reservation to the
> > secondary kernel, and the secondary kernel will happily use this.
> >
> > Can you specify the kernel version and the GIC versions which were used?

Any kernel containing this commit:

commit 5e2c9f9a627772672accd80fa15359c0de6aa894
Author: Marc Zyngier <maz@kernel.org>
Date:   Fri Jul 27 16:23:18 2018 +0100

    irqchip/gic-v3-its: Allow use of LPI tables in reserved memory
    
    If the LPI tables have been reserved with the EFI reservation
    mechanism, we assume that these tables are safe to use even
    when we find the redistributors to have LPIs enabled at
    boot time, meaning that kexec can now work with GICv3.
    
    You're welcome.
    
    Tested-by: Jeremy Linton <jeremy.linton@arm.com>
    Tested-by: Bhupesh Sharma <bhsharma@redhat.com>
    Tested-by: Lei Zhang <zhang.lei@jp.fujitsu.com>
    Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>

And the version of the IP doesn't matter at all.

> 
> > > For these reasons, We allocate the LPI table memory in u-boot and
> > > reserve that memory.
> >
> > What sort of antiquated kernel are you using? And even if you are
> > running something that predates the kernel changes, reserving the
> > memory in the DT serves the same purpose. Why the custom node
> > declaring the allocation?
> >
> > Tried using LTS 5.4 and 5.9 Linux kernels. Problem is updating the GIC V3
> registers with the new LPI table memory after enabling the LPI for the
> redistributors.

Then you are doing something wrong. There are two cases that work:

(1) You are using EFI: nothing to do. The kernel will reserve the
    memory, configure the RDs, and the secondary kernel will happily
    use the same memory, as the address is conveyed in an EFI-specific
    table, without attempting to reprogram the RDs

(2) You are not using EFI, and you need to reserve the memory *using
    the appropriate DT reservation mechanism* as well as program the
    RDs. The kernel will detect the reservation, and will not attempt
    to reprogram the RDs.

If you invent your own binding, use another reservation mechanism or
otherwise, this will not work. u-boot shouldn't expose this syscon
node, because it makes no sense at all, and no upstream software knows
about it. This code must die.

	M.

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

  reply	other threads:[~2021-10-28 14:39 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-27 16:54 [PATCH 0/2] arch: arm: gic-v3-its: stop abusing the device tree Michael Walle
2021-10-27 16:54 ` [PATCH 1/2] Revert "arm64: Layerscape: Survive LPI one-way reset workaround" Michael Walle
2021-10-28 21:11   ` Marc Zyngier
2021-10-31 16:23   ` Tom Rini
2021-10-27 16:54 ` [PATCH 2/2] Revert "arch: arm: use dt and UCLASS_SYSCON to get gic lpi details" Michael Walle
2021-10-28 21:09   ` Marc Zyngier
2021-10-28 21:35     ` Tom Rini
2021-10-29 11:49     ` Michael Walle
2021-10-29 12:00       ` Marc Zyngier
2021-10-31 16:45     ` Z.Q. Hou
2021-10-31 16:58       ` Michael Walle
2021-11-01  9:38       ` Marc Zyngier
2021-10-31 16:24   ` Tom Rini
2021-10-28  9:01 ` [PATCH 0/2] arch: arm: gic-v3-its: stop abusing the device tree Marc Zyngier
2021-10-28  9:20   ` Bharat Gooty
2021-10-28  9:49     ` Marc Zyngier
2021-10-28 10:27       ` Bharat Gooty
2021-10-28 14:39         ` Marc Zyngier [this message]
2021-10-28 11:21     ` Michael Walle
2021-10-28 11:35       ` Bharat Gooty
2021-10-28 12:09         ` Michael Walle
2021-10-28 14:42       ` Marc Zyngier
2021-10-28 12:31   ` Tom Rini
2021-10-28 13:38     ` Marc Zyngier
2021-10-28 13:51       ` Tom Rini
2021-10-28 22:36 ` Simon Glass
2021-10-29 11:54   ` Michael Walle
2021-10-29 21:17     ` Simon Glass

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=87v91h9ptb.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=Zhiqiang.Hou@nxp.com \
    --cc=bharat.gooty@broadcom.com \
    --cc=michael@walle.cc \
    --cc=priyanka.jain@nxp.com \
    --cc=rayagonda.kokatanur@broadcom.com \
    --cc=roman.bacik@broadcom.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=vladimir.oltean@nxp.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.