From: Sascha Bischoff <Sascha.Bischoff@arm.com>
To: "Jonathan.Cameron@huawei.com" <Jonathan.Cameron@huawei.com>
Cc: "yuzenghui@huawei.com" <yuzenghui@huawei.com>,
"tglx@linutronix.de" <tglx@linutronix.de>,
Timothy Hayes <Timothy.Hayes@arm.com>, nd <nd@arm.com>,
"oliver.upton@linux.dev" <oliver.upton@linux.dev>,
"lpieralisi@kernel.org" <lpieralisi@kernel.org>,
"kvmarm@lists.linux.dev" <kvmarm@lists.linux.dev>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
Joey Gouly <Joey.Gouly@arm.com>,
"maz@kernel.org" <maz@kernel.org>,
Suzuki Poulose <Suzuki.Poulose@arm.com>,
"will@kernel.org" <will@kernel.org>
Subject: Re: [PATCH v2 1/5] irqchip/gic-v5: Skip deactivate for forwarded PPI interrupts
Date: Thu, 3 Jul 2025 08:58:02 +0000 [thread overview]
Message-ID: <7e105ceb41faa0d48430af99f6a04eb8add828cb.camel@arm.com> (raw)
In-Reply-To: <20250702152816.000010da@huawei.com>
On Wed, 2025-07-02 at 15:28 +0100, Jonathan Cameron wrote:
> On Fri, 27 Jun 2025 10:09:01 +0000
> Sascha Bischoff <Sascha.Bischoff@arm.com> wrote:
>
> > If a PPI interrupt is forwarded to a guest, skip the deactivate and
> > only EOI. Rely on the guest deactivating both the virtual and
> > physical
> > interrupts (due to ICH_LRx_EL2.HW being set) later on as part of
> > handling the injected interrupt. This mimics the behaviour seen on
> > native GICv3.
> >
> > This is part of adding support for the GICv3 compatibility mode on
> > a
> > GICv5 host.
> >
> > Reviewed-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
> >
>
> Trivial but no gaps in tag blocks. So no blank line here.
> Some scripting will moan about this and I think that will hit you if
> this goes into linux next.
Ah, thanks for pointing that out! I've fixed that (and tag ordering -
thanks, Lorenzo).
Thanks,
Sascha
>
> > Co-authored-by: Timothy Hayes <timothy.hayes@arm.com>
> > Signed-off-by: Timothy Hayes <timothy.hayes@arm.com>
> > Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com>
> > ---
> > drivers/irqchip/irq-gic-v5.c | 17 +++++++++++++++++
> > 1 file changed, 17 insertions(+)
> >
> > diff --git a/drivers/irqchip/irq-gic-v5.c b/drivers/irqchip/irq-
> > gic-v5.c
> > index 7a11521eeeca..6b42c4af5c79 100644
> > --- a/drivers/irqchip/irq-gic-v5.c
> > +++ b/drivers/irqchip/irq-gic-v5.c
> > @@ -213,6 +213,12 @@ static void gicv5_hwirq_eoi(u32 hwirq_id, u8
> > hwirq_type)
> >
> > static void gicv5_ppi_irq_eoi(struct irq_data *d)
> > {
> > + /* Skip deactivate for forwarded PPI interrupts */
> > + if (irqd_is_forwarded_to_vcpu(d)) {
> > + gic_insn(0, CDEOI);
> > + return;
> > + }
> > +
> > gicv5_hwirq_eoi(d->hwirq, GICV5_HWIRQ_TYPE_PPI);
> > }
> >
> > @@ -494,6 +500,16 @@ static bool
> > gicv5_ppi_irq_is_level(irq_hw_number_t hwirq)
> > return !!(read_ppi_sysreg_s(hwirq, PPI_HM) & bit);
> > }
> >
> > +static int gicv5_ppi_irq_set_vcpu_affinity(struct irq_data *d,
> > void *vcpu)
> > +{
> > + if (vcpu)
> > + irqd_set_forwarded_to_vcpu(d);
> > + else
> > + irqd_clr_forwarded_to_vcpu(d);
> > +
> > + return 0;
> > +}
> > +
> > static const struct irq_chip gicv5_ppi_irq_chip = {
> > .name = "GICv5-PPI",
> > .irq_mask = gicv5_ppi_irq_mask,
> > @@ -501,6 +517,7 @@ static const struct irq_chip gicv5_ppi_irq_chip
> > = {
> > .irq_eoi = gicv5_ppi_irq_eoi,
> > .irq_get_irqchip_state = gicv5_ppi_irq_get_irqchip_state,
> > .irq_set_irqchip_state = gicv5_ppi_irq_set_irqchip_state,
> > + .irq_set_vcpu_affinity = gicv5_ppi_irq_set_vcpu_affinity,
> > .flags = IRQCHIP_SKIP_SET_WAKE
> > |
> > IRQCHIP_MASK_ON_SUSPEND,
> > };
>
next prev parent reply other threads:[~2025-07-03 8:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-27 10:09 [PATCH v2 0/5] KVM: arm64: Enable GICv3 guests on GICv5 hosts using FEAT_GCIE_LEGACY Sascha Bischoff
2025-06-27 10:09 ` [PATCH v2 1/5] irqchip/gic-v5: Skip deactivate for forwarded PPI interrupts Sascha Bischoff
2025-07-02 14:28 ` Jonathan Cameron
2025-07-03 8:58 ` Sascha Bischoff [this message]
2025-06-27 10:09 ` [PATCH v2 3/5] arm64/sysreg: Add ICH_VCTLR_EL2 Sascha Bischoff
2025-06-27 10:09 ` [PATCH v2 2/5] irqchip/gic-v5: Populate struct gic_kvm_info Sascha Bischoff
2025-07-01 9:45 ` Lorenzo Pieralisi
2025-07-03 8:58 ` Sascha Bischoff
2025-06-27 10:09 ` [PATCH v2 5/5] KVM: arm64: gic-v5: Probe for GICv5 Sascha Bischoff
2025-06-27 10:09 ` [PATCH v2 4/5] KVM: arm64: gic-v5: Support GICv3 compat Sascha Bischoff
2025-07-08 22:24 ` [PATCH v2 0/5] KVM: arm64: Enable GICv3 guests on GICv5 hosts using FEAT_GCIE_LEGACY Oliver Upton
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=7e105ceb41faa0d48430af99f6a04eb8add828cb.camel@arm.com \
--to=sascha.bischoff@arm.com \
--cc=Joey.Gouly@arm.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=Suzuki.Poulose@arm.com \
--cc=Timothy.Hayes@arm.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=maz@kernel.org \
--cc=nd@arm.com \
--cc=oliver.upton@linux.dev \
--cc=tglx@linutronix.de \
--cc=will@kernel.org \
--cc=yuzenghui@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox