All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: linux-kernel@vger.kernel.org,
	Andre Przywara <andre.przywara@arm.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Eric Auger <eric.auger@redhat.com>
Subject: Re: [PATCH 2/3] irqchip/gic-v3: Detect LPI invalidation MMIO registers
Date: Mon, 21 Mar 2022 09:31:39 +0000	[thread overview]
Message-ID: <87k0cny7lw.wl-maz@kernel.org> (raw)
In-Reply-To: <YjNxW5iFIYFApshg@lpieralisi>

On Thu, 17 Mar 2022 17:35:23 +0000,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> wrote:
> 
> On Tue, Mar 15, 2022 at 04:50:33PM +0000, Marc Zyngier wrote:
> > Since GICv4.1, an implementation can offer the same MMIO-based
> > implementation as DirectLPI, only with an ITS. Given that this
> > can be hugely beneficial for workloads that are very LPI masking
> > heavy (although these workloads are admitedly a bit odd).
> > 
> > Interestingly, this is independent of RVPEI, which only *implies*
> > the functionnality.
> > 
> > So let's detect whether the implementation has GICR_CTLR.IR set,
> > and propagate this as DirectLPI to the ITS driver.
> > 
> > Signed-off-by: Marc Zyngier <maz@kernel.org>
> > ---
> >  drivers/irqchip/irq-gic-v3.c       | 15 +++++++++++----
> >  include/linux/irqchip/arm-gic-v3.h |  2 ++
> >  2 files changed, 13 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
> > index 736163d36b13..363bfe172033 100644
> > --- a/drivers/irqchip/irq-gic-v3.c
> > +++ b/drivers/irqchip/irq-gic-v3.c
> > @@ -918,7 +918,11 @@ static int gic_populate_rdist(void)
> >  static int __gic_update_rdist_properties(struct redist_region *region,
> >  					 void __iomem *ptr)
> >  {
> > -	u64 typer = gic_read_typer(ptr + GICR_TYPER);
> > +	u64 typer;
> > +	u32 ctlr;
> > +
> > +	typer = gic_read_typer(ptr + GICR_TYPER);
> > +	ctlr = readl_relaxed(ptr + GICR_CTLR);
> >  
> >  	/* Boot-time cleanip */
> >  	if ((typer & GICR_TYPER_VLPIS) && (typer & GICR_TYPER_RVPEID)) {
> > @@ -941,6 +945,7 @@ static int __gic_update_rdist_properties(struct redist_region *region,
> >  	/* RVPEID implies some form of DirectLPI, no matter what the doc says... :-/ */
> >  	gic_data.rdists.has_rvpeid &= !!(typer & GICR_TYPER_RVPEID);
> >  	gic_data.rdists.has_direct_lpi &= (!!(typer & GICR_TYPER_DirectLPIS) |
> > +					   !!(ctlr & GICR_CTLR_IR) |
> >  					   gic_data.rdists.has_rvpeid);
> >  	gic_data.rdists.has_vpend_valid_dirty &= !!(typer & GICR_TYPER_DIRTY);
> >  
> > @@ -962,7 +967,11 @@ static void gic_update_rdist_properties(void)
> >  	gic_iterate_rdists(__gic_update_rdist_properties);
> >  	if (WARN_ON(gic_data.ppi_nr == UINT_MAX))
> >  		gic_data.ppi_nr = 0;
> > -	pr_info("%d PPIs implemented\n", gic_data.ppi_nr);
> > +	pr_info("GICv3 features: %d PPIs, %s%s\n",
> > +		gic_data.ppi_nr,
> > +		gic_data.has_rss ? "RSS " : "",
> > +		gic_data.rdists.has_direct_lpi ? "DirectLPI " : "");
> 
> I understand GICR_CTLR.IR detection (which is v4.1 feature) - I don't

No, it is *also* a GICv3 feature. RVPEI implies IR, but IR is a
feature on its own (see my reply to Andre on the same subject).
Nothing restrict IR to a GICv4.1+ implementation, and KVM is about to
expose these registers to the GICv*3* guest.

> get why in this patch we are adding a GICv3 DirectLPI info dump (hunk
> above), it is probably nitpicking but the hunk above does not seem to
> belong in this patch - it is a separate print info refactoring or I am
> reading it wrongly.

It is indeed just refactoring the kernel messages so that we can see
that we enable DirectLPI for GICv3 as well. I honestly don't think
this deserves a separate patch.

Thanks,

	M.

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

  reply	other threads:[~2022-03-21  9:31 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-15 16:50 [PATCH 0/3] irqchip/gic-v3: Assorted fixes and improvements Marc Zyngier
2022-03-15 16:50 ` [PATCH 1/3] irqchip/gic-v3: Fix GICR_CTLR.RWP polling Marc Zyngier
2022-03-16 14:51   ` Andre Przywara
2022-03-16 15:19     ` Marc Zyngier
2022-03-17 17:03   ` Lorenzo Pieralisi
2022-03-21  9:19   ` [irqchip: irq/irqchip-next] " irqchip-bot for Marc Zyngier
2022-03-21 14:07   ` irqchip-bot for Marc Zyngier
2022-04-05 15:39   ` [irqchip: irq/irqchip-fixes] " irqchip-bot for Marc Zyngier
2022-03-15 16:50 ` [PATCH 2/3] irqchip/gic-v3: Detect LPI invalidation MMIO registers Marc Zyngier
2022-03-16 11:21   ` Marc Zyngier
2022-03-16 14:51   ` Andre Przywara
2022-03-16 15:36     ` Marc Zyngier
2022-03-16 15:52       ` Andre Przywara
2022-03-17 17:35   ` Lorenzo Pieralisi
2022-03-21  9:31     ` Marc Zyngier [this message]
2022-03-15 16:50 ` [PATCH 3/3] irqchip/gic-v3: Relax polling of GIC{R,D}_CTLR.RWP Marc Zyngier
2022-03-16 14:54   ` Andre Przywara
2022-03-16 15:42     ` Marc Zyngier

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=87k0cny7lw.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=andre.przywara@arm.com \
    --cc=eric.auger@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=tglx@linutronix.de \
    /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.