* [PATCH v2 1/5] irqchip/gic-v5: Skip deactivate for forwarded PPI interrupts
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 ` Sascha Bischoff
2025-07-02 14:28 ` Jonathan Cameron
2025-06-27 10:09 ` [PATCH v2 2/5] irqchip/gic-v5: Populate struct gic_kvm_info Sascha Bischoff
` (4 subsequent siblings)
5 siblings, 1 reply; 11+ messages in thread
From: Sascha Bischoff @ 2025-06-27 10:09 UTC (permalink / raw)
To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: nd, maz@kernel.org, oliver.upton@linux.dev, Joey Gouly,
Suzuki Poulose, yuzenghui@huawei.com, will@kernel.org,
tglx@linutronix.de, lpieralisi@kernel.org, Timothy Hayes
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>
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,
};
--
2.34.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH v2 1/5] irqchip/gic-v5: Skip deactivate for forwarded PPI interrupts
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
0 siblings, 1 reply; 11+ messages in thread
From: Jonathan Cameron @ 2025-07-02 14:28 UTC (permalink / raw)
To: Sascha Bischoff
Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org, nd,
maz@kernel.org, oliver.upton@linux.dev, Joey Gouly,
Suzuki Poulose, yuzenghui@huawei.com, will@kernel.org,
tglx@linutronix.de, lpieralisi@kernel.org, Timothy Hayes
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.
> 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,
> };
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH v2 1/5] irqchip/gic-v5: Skip deactivate for forwarded PPI interrupts
2025-07-02 14:28 ` Jonathan Cameron
@ 2025-07-03 8:58 ` Sascha Bischoff
0 siblings, 0 replies; 11+ messages in thread
From: Sascha Bischoff @ 2025-07-03 8:58 UTC (permalink / raw)
To: Jonathan.Cameron@huawei.com
Cc: yuzenghui@huawei.com, tglx@linutronix.de, Timothy Hayes, nd,
oliver.upton@linux.dev, lpieralisi@kernel.org,
kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org,
Joey Gouly, maz@kernel.org, Suzuki Poulose, will@kernel.org
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,
> > };
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 2/5] irqchip/gic-v5: Populate struct gic_kvm_info
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-06-27 10:09 ` Sascha Bischoff
2025-07-01 9:45 ` Lorenzo Pieralisi
2025-06-27 10:09 ` [PATCH v2 3/5] arm64/sysreg: Add ICH_VCTLR_EL2 Sascha Bischoff
` (3 subsequent siblings)
5 siblings, 1 reply; 11+ messages in thread
From: Sascha Bischoff @ 2025-06-27 10:09 UTC (permalink / raw)
To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: nd, maz@kernel.org, oliver.upton@linux.dev, Joey Gouly,
Suzuki Poulose, yuzenghui@huawei.com, will@kernel.org,
tglx@linutronix.de, lpieralisi@kernel.org, Timothy Hayes
Populate the gic_kvm_info struct based on support for
FEAT_GCIE_LEGACY. The struct is used by KVM to probe for a compatible
GIC.
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 | 33 +++++++++++++++++++++++++++
include/linux/irqchip/arm-vgic-info.h | 4 ++++
2 files changed, 37 insertions(+)
diff --git a/drivers/irqchip/irq-gic-v5.c b/drivers/irqchip/irq-gic-v5.c
index 6b42c4af5c79..9ba43ec9318b 100644
--- a/drivers/irqchip/irq-gic-v5.c
+++ b/drivers/irqchip/irq-gic-v5.c
@@ -13,6 +13,7 @@
#include <linux/irqchip.h>
#include <linux/irqchip/arm-gic-v5.h>
+#include <linux/irqchip/arm-vgic-info.h>
#include <asm/cpufeature.h>
#include <asm/exception.h>
@@ -1049,6 +1050,36 @@ static void gicv5_set_cpuif_idbits(void)
}
}
+#ifdef CONFIG_KVM
+static struct gic_kvm_info gic_v5_kvm_info __initdata;
+
+static bool __init gicv5_cpuif_has_gcie_legacy(void)
+{
+ u64 idr0 = read_sysreg_s(SYS_ICC_IDR0_EL1);
+ return !!FIELD_GET(ICC_IDR0_EL1_GCIE_LEGACY, idr0);
+}
+
+static void __init gic_of_setup_kvm_info(struct device_node *node)
+{
+ gic_v5_kvm_info.type = GIC_V5;
+ gic_v5_kvm_info.has_gcie_v3_compat = gicv5_cpuif_has_gcie_legacy();
+
+ /* GIC Virtual CPU interface maintenance interrupt */
+ gic_v5_kvm_info.no_maint_irq_mask = false;
+ gic_v5_kvm_info.maint_irq = irq_of_parse_and_map(node, 0);
+ if (!gic_v5_kvm_info.maint_irq) {
+ pr_warn("cannot find GICv5 virtual CPU interface maintenance interrupt\n");
+ return;
+ }
+
+ vgic_set_kvm_info(&gic_v5_kvm_info);
+}
+#else
+static inline void __init gic_of_setup_kvm_info(struct device_node *node)
+{
+}
+#endif // CONFIG_KVM
+
static int __init gicv5_of_init(struct device_node *node, struct device_node *parent)
{
int ret = gicv5_irs_of_probe(node);
@@ -1081,6 +1112,8 @@ static int __init gicv5_of_init(struct device_node *node, struct device_node *pa
gicv5_irs_its_probe();
+ gic_of_setup_kvm_info(node);
+
return 0;
out_int:
diff --git a/include/linux/irqchip/arm-vgic-info.h b/include/linux/irqchip/arm-vgic-info.h
index a75b2c7de69d..ca1713fac6e3 100644
--- a/include/linux/irqchip/arm-vgic-info.h
+++ b/include/linux/irqchip/arm-vgic-info.h
@@ -15,6 +15,8 @@ enum gic_type {
GIC_V2,
/* Full GICv3, optionally with v2 compat */
GIC_V3,
+ /* Full GICv5, optionally with v3 compat */
+ GIC_V5,
};
struct gic_kvm_info {
@@ -34,6 +36,8 @@ struct gic_kvm_info {
bool has_v4_1;
/* Deactivation impared, subpar stuff */
bool no_hw_deactivation;
+ /* v3 compat support (GICv5 hosts, only) */
+ bool has_gcie_v3_compat;
};
#ifdef CONFIG_KVM
--
2.34.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH v2 2/5] irqchip/gic-v5: Populate struct gic_kvm_info
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
0 siblings, 1 reply; 11+ messages in thread
From: Lorenzo Pieralisi @ 2025-07-01 9:45 UTC (permalink / raw)
To: Sascha Bischoff
Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org, nd,
maz@kernel.org, oliver.upton@linux.dev, Joey Gouly,
Suzuki Poulose, yuzenghui@huawei.com, will@kernel.org,
tglx@linutronix.de, Timothy Hayes
On Fri, Jun 27, 2025 at 10:09:01AM +0000, Sascha Bischoff wrote:
> Populate the gic_kvm_info struct based on support for
> FEAT_GCIE_LEGACY. The struct is used by KVM to probe for a compatible
> GIC.
>
> 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 | 33 +++++++++++++++++++++++++++
> include/linux/irqchip/arm-vgic-info.h | 4 ++++
> 2 files changed, 37 insertions(+)
Reviewed-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
> diff --git a/drivers/irqchip/irq-gic-v5.c b/drivers/irqchip/irq-gic-v5.c
> index 6b42c4af5c79..9ba43ec9318b 100644
> --- a/drivers/irqchip/irq-gic-v5.c
> +++ b/drivers/irqchip/irq-gic-v5.c
> @@ -13,6 +13,7 @@
>
> #include <linux/irqchip.h>
> #include <linux/irqchip/arm-gic-v5.h>
> +#include <linux/irqchip/arm-vgic-info.h>
>
> #include <asm/cpufeature.h>
> #include <asm/exception.h>
> @@ -1049,6 +1050,36 @@ static void gicv5_set_cpuif_idbits(void)
> }
> }
>
> +#ifdef CONFIG_KVM
> +static struct gic_kvm_info gic_v5_kvm_info __initdata;
> +
> +static bool __init gicv5_cpuif_has_gcie_legacy(void)
> +{
> + u64 idr0 = read_sysreg_s(SYS_ICC_IDR0_EL1);
> + return !!FIELD_GET(ICC_IDR0_EL1_GCIE_LEGACY, idr0);
> +}
> +
> +static void __init gic_of_setup_kvm_info(struct device_node *node)
> +{
> + gic_v5_kvm_info.type = GIC_V5;
> + gic_v5_kvm_info.has_gcie_v3_compat = gicv5_cpuif_has_gcie_legacy();
> +
> + /* GIC Virtual CPU interface maintenance interrupt */
> + gic_v5_kvm_info.no_maint_irq_mask = false;
> + gic_v5_kvm_info.maint_irq = irq_of_parse_and_map(node, 0);
> + if (!gic_v5_kvm_info.maint_irq) {
> + pr_warn("cannot find GICv5 virtual CPU interface maintenance interrupt\n");
> + return;
> + }
> +
> + vgic_set_kvm_info(&gic_v5_kvm_info);
> +}
> +#else
> +static inline void __init gic_of_setup_kvm_info(struct device_node *node)
> +{
> +}
> +#endif // CONFIG_KVM
> +
> static int __init gicv5_of_init(struct device_node *node, struct device_node *parent)
> {
> int ret = gicv5_irs_of_probe(node);
> @@ -1081,6 +1112,8 @@ static int __init gicv5_of_init(struct device_node *node, struct device_node *pa
>
> gicv5_irs_its_probe();
>
> + gic_of_setup_kvm_info(node);
> +
> return 0;
>
> out_int:
> diff --git a/include/linux/irqchip/arm-vgic-info.h b/include/linux/irqchip/arm-vgic-info.h
> index a75b2c7de69d..ca1713fac6e3 100644
> --- a/include/linux/irqchip/arm-vgic-info.h
> +++ b/include/linux/irqchip/arm-vgic-info.h
> @@ -15,6 +15,8 @@ enum gic_type {
> GIC_V2,
> /* Full GICv3, optionally with v2 compat */
> GIC_V3,
> + /* Full GICv5, optionally with v3 compat */
> + GIC_V5,
> };
>
> struct gic_kvm_info {
> @@ -34,6 +36,8 @@ struct gic_kvm_info {
> bool has_v4_1;
> /* Deactivation impared, subpar stuff */
> bool no_hw_deactivation;
> + /* v3 compat support (GICv5 hosts, only) */
> + bool has_gcie_v3_compat;
> };
>
> #ifdef CONFIG_KVM
> --
> 2.34.1
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH v2 2/5] irqchip/gic-v5: Populate struct gic_kvm_info
2025-07-01 9:45 ` Lorenzo Pieralisi
@ 2025-07-03 8:58 ` Sascha Bischoff
0 siblings, 0 replies; 11+ messages in thread
From: Sascha Bischoff @ 2025-07-03 8:58 UTC (permalink / raw)
To: lpieralisi@kernel.org
Cc: yuzenghui@huawei.com, tglx@linutronix.de, Timothy Hayes, nd,
oliver.upton@linux.dev, kvmarm@lists.linux.dev,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org,
Joey Gouly, maz@kernel.org, Suzuki Poulose, will@kernel.org
On Tue, 2025-07-01 at 11:45 +0200, Lorenzo Pieralisi wrote:
> On Fri, Jun 27, 2025 at 10:09:01AM +0000, Sascha Bischoff wrote:
> > Populate the gic_kvm_info struct based on support for
> > FEAT_GCIE_LEGACY. The struct is used by KVM to probe for a
> > compatible
> > GIC.
> >
> > 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 | 33
> > +++++++++++++++++++++++++++
> > include/linux/irqchip/arm-vgic-info.h | 4 ++++
> > 2 files changed, 37 insertions(+)
>
> Reviewed-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
Done, thanks!
>
> > diff --git a/drivers/irqchip/irq-gic-v5.c b/drivers/irqchip/irq-
> > gic-v5.c
> > index 6b42c4af5c79..9ba43ec9318b 100644
> > --- a/drivers/irqchip/irq-gic-v5.c
> > +++ b/drivers/irqchip/irq-gic-v5.c
> > @@ -13,6 +13,7 @@
> >
> > #include <linux/irqchip.h>
> > #include <linux/irqchip/arm-gic-v5.h>
> > +#include <linux/irqchip/arm-vgic-info.h>
> >
> > #include <asm/cpufeature.h>
> > #include <asm/exception.h>
> > @@ -1049,6 +1050,36 @@ static void gicv5_set_cpuif_idbits(void)
> > }
> > }
> >
> > +#ifdef CONFIG_KVM
> > +static struct gic_kvm_info gic_v5_kvm_info __initdata;
> > +
> > +static bool __init gicv5_cpuif_has_gcie_legacy(void)
> > +{
> > + u64 idr0 = read_sysreg_s(SYS_ICC_IDR0_EL1);
> > + return !!FIELD_GET(ICC_IDR0_EL1_GCIE_LEGACY, idr0);
> > +}
> > +
> > +static void __init gic_of_setup_kvm_info(struct device_node *node)
> > +{
> > + gic_v5_kvm_info.type = GIC_V5;
> > + gic_v5_kvm_info.has_gcie_v3_compat =
> > gicv5_cpuif_has_gcie_legacy();
> > +
> > + /* GIC Virtual CPU interface maintenance interrupt */
> > + gic_v5_kvm_info.no_maint_irq_mask = false;
> > + gic_v5_kvm_info.maint_irq = irq_of_parse_and_map(node, 0);
> > + if (!gic_v5_kvm_info.maint_irq) {
> > + pr_warn("cannot find GICv5 virtual CPU interface
> > maintenance interrupt\n");
> > + return;
> > + }
> > +
> > + vgic_set_kvm_info(&gic_v5_kvm_info);
> > +}
> > +#else
> > +static inline void __init gic_of_setup_kvm_info(struct device_node
> > *node)
> > +{
> > +}
> > +#endif // CONFIG_KVM
> > +
> > static int __init gicv5_of_init(struct device_node *node, struct
> > device_node *parent)
> > {
> > int ret = gicv5_irs_of_probe(node);
> > @@ -1081,6 +1112,8 @@ static int __init gicv5_of_init(struct
> > device_node *node, struct device_node *pa
> >
> > gicv5_irs_its_probe();
> >
> > + gic_of_setup_kvm_info(node);
> > +
> > return 0;
> >
> > out_int:
> > diff --git a/include/linux/irqchip/arm-vgic-info.h
> > b/include/linux/irqchip/arm-vgic-info.h
> > index a75b2c7de69d..ca1713fac6e3 100644
> > --- a/include/linux/irqchip/arm-vgic-info.h
> > +++ b/include/linux/irqchip/arm-vgic-info.h
> > @@ -15,6 +15,8 @@ enum gic_type {
> > GIC_V2,
> > /* Full GICv3, optionally with v2 compat */
> > GIC_V3,
> > + /* Full GICv5, optionally with v3 compat */
> > + GIC_V5,
> > };
> >
> > struct gic_kvm_info {
> > @@ -34,6 +36,8 @@ struct gic_kvm_info {
> > bool has_v4_1;
> > /* Deactivation impared, subpar stuff */
> > bool no_hw_deactivation;
> > + /* v3 compat support (GICv5 hosts, only) */
> > + bool has_gcie_v3_compat;
> > };
> >
> > #ifdef CONFIG_KVM
> > --
> > 2.34.1
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 3/5] arm64/sysreg: Add ICH_VCTLR_EL2
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-06-27 10:09 ` [PATCH v2 2/5] irqchip/gic-v5: Populate struct gic_kvm_info Sascha Bischoff
@ 2025-06-27 10:09 ` Sascha Bischoff
2025-06-27 10:09 ` [PATCH v2 4/5] KVM: arm64: gic-v5: Support GICv3 compat Sascha Bischoff
` (2 subsequent siblings)
5 siblings, 0 replies; 11+ messages in thread
From: Sascha Bischoff @ 2025-06-27 10:09 UTC (permalink / raw)
To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: nd, maz@kernel.org, oliver.upton@linux.dev, Joey Gouly,
Suzuki Poulose, yuzenghui@huawei.com, will@kernel.org,
tglx@linutronix.de, lpieralisi@kernel.org, Timothy Hayes
This system register is required to enable/disable V3 legacy mode when
running on a GICv5 host.
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>
---
arch/arm64/tools/sysreg | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/arm64/tools/sysreg b/arch/arm64/tools/sysreg
index aab58bf4ed9c..dd1ae04eb033 100644
--- a/arch/arm64/tools/sysreg
+++ b/arch/arm64/tools/sysreg
@@ -4530,6 +4530,12 @@ Field 1 U
Field 0 EOI
EndSysreg
+Sysreg ICH_VCTLR_EL2 3 4 12 11 4
+Res0 63:2
+Field 1 V3
+Field 0 En
+EndSysreg
+
Sysreg CONTEXTIDR_EL2 3 4 13 0 1
Fields CONTEXTIDR_ELx
EndSysreg
--
2.34.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH v2 4/5] KVM: arm64: gic-v5: Support GICv3 compat
2025-06-27 10:09 [PATCH v2 0/5] KVM: arm64: Enable GICv3 guests on GICv5 hosts using FEAT_GCIE_LEGACY Sascha Bischoff
` (2 preceding siblings ...)
2025-06-27 10:09 ` [PATCH v2 3/5] arm64/sysreg: Add ICH_VCTLR_EL2 Sascha Bischoff
@ 2025-06-27 10:09 ` Sascha Bischoff
2025-06-27 10:09 ` [PATCH v2 5/5] KVM: arm64: gic-v5: Probe for GICv5 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
5 siblings, 0 replies; 11+ messages in thread
From: Sascha Bischoff @ 2025-06-27 10:09 UTC (permalink / raw)
To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: nd, maz@kernel.org, oliver.upton@linux.dev, Joey Gouly,
Suzuki Poulose, yuzenghui@huawei.com, will@kernel.org,
tglx@linutronix.de, lpieralisi@kernel.org, Timothy Hayes
Add support for GICv3 compat mode (FEAT_GCIE_LEGACY) which allows a
GICv5 host to run GICv3-based VMs. This change enables the
VHE/nVHE/hVHE/protected modes, but does not support nested
virtualization.
A lazy-disable approach is taken for compat mode; it is enabled on the
vgic_v3_load path but not disabled on the vgic_v3_put path. A
non-GICv3 VM, i.e., one based on GICv5, is responsible for disabling
compat mode on the corresponding vgic_v5_load path. Currently, GICv5
is not supported, and hence compat mode is not disabled again once it
is enabled, and this function is intentionally omitted from the code.
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>
---
arch/arm64/kvm/hyp/vgic-v3-sr.c | 51 +++++++++++++++++++++++++++------
arch/arm64/kvm/sys_regs.c | 10 ++++++-
arch/arm64/kvm/vgic/vgic-init.c | 6 ++--
arch/arm64/kvm/vgic/vgic.h | 11 +++++++
include/kvm/arm_vgic.h | 6 +++-
5 files changed, 72 insertions(+), 12 deletions(-)
diff --git a/arch/arm64/kvm/hyp/vgic-v3-sr.c b/arch/arm64/kvm/hyp/vgic-v3-sr.c
index f162b0df5cae..6ce88e56ccb8 100644
--- a/arch/arm64/kvm/hyp/vgic-v3-sr.c
+++ b/arch/arm64/kvm/hyp/vgic-v3-sr.c
@@ -296,12 +296,19 @@ void __vgic_v3_activate_traps(struct vgic_v3_cpu_if *cpu_if)
}
/*
- * Prevent the guest from touching the ICC_SRE_EL1 system
- * register. Note that this may not have any effect, as
- * ICC_SRE_EL2.Enable being RAO/WI is a valid implementation.
+ * GICv5 BET0 FEAT_GCIE_LEGACY doesn't include ICC_SRE_EL2. This is due
+ * to be relaxed in a future spec release, at which point this in
+ * condition can be dropped.
*/
- write_gicreg(read_gicreg(ICC_SRE_EL2) & ~ICC_SRE_EL2_ENABLE,
- ICC_SRE_EL2);
+ if (!cpus_have_final_cap(ARM64_HAS_GICV5_CPUIF)) {
+ /*
+ * Prevent the guest from touching the ICC_SRE_EL1 system
+ * register. Note that this may not have any effect, as
+ * ICC_SRE_EL2.Enable being RAO/WI is a valid implementation.
+ */
+ write_gicreg(read_gicreg(ICC_SRE_EL2) & ~ICC_SRE_EL2_ENABLE,
+ ICC_SRE_EL2);
+ }
/*
* If we need to trap system registers, we must write
@@ -322,8 +329,14 @@ void __vgic_v3_deactivate_traps(struct vgic_v3_cpu_if *cpu_if)
cpu_if->vgic_vmcr = read_gicreg(ICH_VMCR_EL2);
}
- val = read_gicreg(ICC_SRE_EL2);
- write_gicreg(val | ICC_SRE_EL2_ENABLE, ICC_SRE_EL2);
+ /*
+ * Can be dropped in the future when GICv5 spec is relaxed. See comment
+ * above.
+ */
+ if (!cpus_have_final_cap(ARM64_HAS_GICV5_CPUIF)) {
+ val = read_gicreg(ICC_SRE_EL2);
+ write_gicreg(val | ICC_SRE_EL2_ENABLE, ICC_SRE_EL2);
+ }
if (!cpu_if->vgic_sre) {
/* Make sure ENABLE is set at EL2 before setting SRE at EL1 */
@@ -423,9 +436,19 @@ void __vgic_v3_init_lrs(void)
*/
u64 __vgic_v3_get_gic_config(void)
{
- u64 val, sre = read_gicreg(ICC_SRE_EL1);
+ u64 val, sre;
unsigned long flags = 0;
+ /*
+ * In compat mode, we cannot access ICC_SRE_EL1 at any EL
+ * other than EL1 itself; just return the
+ * ICH_VTR_EL2. ICC_IDR0_EL1 is only implemented on a GICv5
+ * system, so we first check if we have GICv5 support.
+ */
+ if (cpus_have_final_cap(ARM64_HAS_GICV5_CPUIF))
+ return read_gicreg(ICH_VTR_EL2);
+
+ sre = read_gicreg(ICC_SRE_EL1);
/*
* To check whether we have a MMIO-based (GICv2 compatible)
* CPU interface, we need to disable the system register
@@ -471,6 +494,16 @@ u64 __vgic_v3_get_gic_config(void)
return val;
}
+static void __vgic_v3_compat_mode_enable(void)
+{
+ if (!cpus_have_final_cap(ARM64_HAS_GICV5_CPUIF))
+ return;
+
+ sysreg_clear_set_s(SYS_ICH_VCTLR_EL2, 0, ICH_VCTLR_EL2_V3);
+ /* Wait for V3 to become enabled */
+ isb();
+}
+
static u64 __vgic_v3_read_vmcr(void)
{
return read_gicreg(ICH_VMCR_EL2);
@@ -490,6 +523,8 @@ void __vgic_v3_save_vmcr_aprs(struct vgic_v3_cpu_if *cpu_if)
void __vgic_v3_restore_vmcr_aprs(struct vgic_v3_cpu_if *cpu_if)
{
+ __vgic_v3_compat_mode_enable();
+
/*
* If dealing with a GICv2 emulation on GICv3, VMCR_EL2.VFIQen
* is dependent on ICC_SRE_EL1.SRE, and we have to perform the
diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
index 76c2f0da821f..f01953c7c2a9 100644
--- a/arch/arm64/kvm/sys_regs.c
+++ b/arch/arm64/kvm/sys_regs.c
@@ -1811,7 +1811,7 @@ static u64 sanitise_id_aa64pfr0_el1(const struct kvm_vcpu *vcpu, u64 val)
val |= SYS_FIELD_PREP_ENUM(ID_AA64PFR0_EL1, CSV3, IMP);
}
- if (kvm_vgic_global_state.type == VGIC_V3) {
+ if (vgic_is_v3(vcpu->kvm)) {
val &= ~ID_AA64PFR0_EL1_GIC_MASK;
val |= SYS_FIELD_PREP_ENUM(ID_AA64PFR0_EL1, GIC, IMP);
}
@@ -1953,6 +1953,14 @@ static int set_id_aa64pfr0_el1(struct kvm_vcpu *vcpu,
(vcpu_has_nv(vcpu) && !FIELD_GET(ID_AA64PFR0_EL1_EL2, user_val)))
return -EINVAL;
+ /*
+ * If we are running on a GICv5 host and support FEAT_GCIE_LEGACY, then
+ * we support GICv3. Fail attempts to do anything but set that to IMP.
+ */
+ if (vgic_is_v3_compat(vcpu->kvm) &&
+ FIELD_GET(ID_AA64PFR0_EL1_GIC_MASK, user_val) != ID_AA64PFR0_EL1_GIC_IMP)
+ return -EINVAL;
+
return set_id_reg(vcpu, rd, user_val);
}
diff --git a/arch/arm64/kvm/vgic/vgic-init.c b/arch/arm64/kvm/vgic/vgic-init.c
index eb1205654ac8..1f1f0c9ce64f 100644
--- a/arch/arm64/kvm/vgic/vgic-init.c
+++ b/arch/arm64/kvm/vgic/vgic-init.c
@@ -674,10 +674,12 @@ void kvm_vgic_init_cpu_hardware(void)
* We want to make sure the list registers start out clear so that we
* only have the program the used registers.
*/
- if (kvm_vgic_global_state.type == VGIC_V2)
+ if (kvm_vgic_global_state.type == VGIC_V2) {
vgic_v2_init_lrs();
- else
+ } else if (kvm_vgic_global_state.type == VGIC_V3 ||
+ kvm_vgic_global_state.has_gcie_v3_compat) {
kvm_call_hyp(__vgic_v3_init_lrs);
+ }
}
/**
diff --git a/arch/arm64/kvm/vgic/vgic.h b/arch/arm64/kvm/vgic/vgic.h
index 4349084cb9a6..23d393998085 100644
--- a/arch/arm64/kvm/vgic/vgic.h
+++ b/arch/arm64/kvm/vgic/vgic.h
@@ -389,6 +389,17 @@ void vgic_v3_put_nested(struct kvm_vcpu *vcpu);
void vgic_v3_handle_nested_maint_irq(struct kvm_vcpu *vcpu);
void vgic_v3_nested_update_mi(struct kvm_vcpu *vcpu);
+static inline bool vgic_is_v3_compat(struct kvm *kvm)
+{
+ return cpus_have_final_cap(ARM64_HAS_GICV5_CPUIF) &&
+ kvm_vgic_global_state.has_gcie_v3_compat;
+}
+
+static inline bool vgic_is_v3(struct kvm *kvm)
+{
+ return kvm_vgic_global_state.type == VGIC_V3 || vgic_is_v3_compat(kvm);
+}
+
int vgic_its_debug_init(struct kvm_device *dev);
void vgic_its_debug_destroy(struct kvm_device *dev);
diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h
index 4a34f7f0a864..5c293e0ff5c1 100644
--- a/include/kvm/arm_vgic.h
+++ b/include/kvm/arm_vgic.h
@@ -38,6 +38,7 @@
enum vgic_type {
VGIC_V2, /* Good ol' GICv2 */
VGIC_V3, /* New fancy GICv3 */
+ VGIC_V5, /* Newer, fancier GICv5 */
};
/* same for all guests, as depending only on the _host's_ GIC model */
@@ -77,9 +78,12 @@ struct vgic_global {
/* Pseudo GICv3 from outer space */
bool no_hw_deactivation;
- /* GIC system register CPU interface */
+ /* GICv3 system register CPU interface */
struct static_key_false gicv3_cpuif;
+ /* GICv3 compat mode on a GICv5 host */
+ bool has_gcie_v3_compat;
+
u32 ich_vtr_el2;
};
--
2.34.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH v2 5/5] KVM: arm64: gic-v5: Probe for GICv5
2025-06-27 10:09 [PATCH v2 0/5] KVM: arm64: Enable GICv3 guests on GICv5 hosts using FEAT_GCIE_LEGACY Sascha Bischoff
` (3 preceding siblings ...)
2025-06-27 10:09 ` [PATCH v2 4/5] KVM: arm64: gic-v5: Support GICv3 compat Sascha Bischoff
@ 2025-06-27 10:09 ` 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
5 siblings, 0 replies; 11+ messages in thread
From: Sascha Bischoff @ 2025-06-27 10:09 UTC (permalink / raw)
To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: nd, maz@kernel.org, oliver.upton@linux.dev, Joey Gouly,
Suzuki Poulose, yuzenghui@huawei.com, will@kernel.org,
tglx@linutronix.de, lpieralisi@kernel.org, Timothy Hayes
Add in a probe function for GICv5 which enables support for GICv3
guests on a GICv5 host, if FEAT_GCIE_LEGACY is supported by the
hardware.
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>
---
arch/arm64/kvm/Makefile | 3 +-
arch/arm64/kvm/vgic/vgic-init.c | 3 ++
arch/arm64/kvm/vgic/vgic-v5.c | 52 +++++++++++++++++++++++++++++++++
arch/arm64/kvm/vgic/vgic.h | 2 ++
4 files changed, 59 insertions(+), 1 deletion(-)
create mode 100644 arch/arm64/kvm/vgic/vgic-v5.c
diff --git a/arch/arm64/kvm/Makefile b/arch/arm64/kvm/Makefile
index 7c329e01c557..3ebc0570345c 100644
--- a/arch/arm64/kvm/Makefile
+++ b/arch/arm64/kvm/Makefile
@@ -23,7 +23,8 @@ kvm-y += arm.o mmu.o mmio.o psci.o hypercalls.o pvtime.o \
vgic/vgic-v3.o vgic/vgic-v4.o \
vgic/vgic-mmio.o vgic/vgic-mmio-v2.o \
vgic/vgic-mmio-v3.o vgic/vgic-kvm-device.o \
- vgic/vgic-its.o vgic/vgic-debug.o vgic/vgic-v3-nested.o
+ vgic/vgic-its.o vgic/vgic-debug.o vgic/vgic-v3-nested.o \
+ vgic/vgic-v5.o
kvm-$(CONFIG_HW_PERF_EVENTS) += pmu-emul.o pmu.o
kvm-$(CONFIG_ARM64_PTR_AUTH) += pauth.o
diff --git a/arch/arm64/kvm/vgic/vgic-init.c b/arch/arm64/kvm/vgic/vgic-init.c
index 1f1f0c9ce64f..72442c825d19 100644
--- a/arch/arm64/kvm/vgic/vgic-init.c
+++ b/arch/arm64/kvm/vgic/vgic-init.c
@@ -724,6 +724,9 @@ int kvm_vgic_hyp_init(void)
kvm_info("GIC system register CPU interface enabled\n");
}
break;
+ case GIC_V5:
+ ret = vgic_v5_probe(gic_kvm_info);
+ break;
default:
ret = -ENODEV;
}
diff --git a/arch/arm64/kvm/vgic/vgic-v5.c b/arch/arm64/kvm/vgic/vgic-v5.c
new file mode 100644
index 000000000000..6bdbb221bcde
--- /dev/null
+++ b/arch/arm64/kvm/vgic/vgic-v5.c
@@ -0,0 +1,52 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+#include <kvm/arm_vgic.h>
+#include <linux/irqchip/arm-vgic-info.h>
+
+#include "vgic.h"
+
+/*
+ * Probe for a vGICv5 compatible interrupt controller, returning 0 on success.
+ * Currently only supports GICv3-based VMs on a GICv5 host, and hence only
+ * registers a VGIC_V3 device.
+ */
+int vgic_v5_probe(const struct gic_kvm_info *info)
+{
+ u64 ich_vtr_el2;
+ int ret;
+
+ if (!info->has_gcie_v3_compat)
+ return -ENODEV;
+
+ kvm_vgic_global_state.type = VGIC_V5;
+ kvm_vgic_global_state.has_gcie_v3_compat = true;
+
+ /* We only support v3 compat mode - use vGICv3 limits */
+ kvm_vgic_global_state.max_gic_vcpus = VGIC_V3_MAX_CPUS;
+
+ kvm_vgic_global_state.vcpu_base = 0;
+ kvm_vgic_global_state.vctrl_base = NULL;
+ kvm_vgic_global_state.can_emulate_gicv2 = false;
+ kvm_vgic_global_state.has_gicv4 = false;
+ kvm_vgic_global_state.has_gicv4_1 = false;
+
+ ich_vtr_el2 = kvm_call_hyp_ret(__vgic_v3_get_gic_config);
+ kvm_vgic_global_state.ich_vtr_el2 = (u32)ich_vtr_el2;
+
+ /*
+ * The ListRegs field is 5 bits, but there is an architectural
+ * maximum of 16 list registers. Just ignore bit 4...
+ */
+ kvm_vgic_global_state.nr_lr = (ich_vtr_el2 & 0xf) + 1;
+
+ ret = kvm_register_vgic_device(KVM_DEV_TYPE_ARM_VGIC_V3);
+ if (ret) {
+ kvm_err("Cannot register GICv3-legacy KVM device.\n");
+ return ret;
+ }
+
+ static_branch_enable(&kvm_vgic_global_state.gicv3_cpuif);
+ kvm_info("GCIE legacy system register CPU interface\n");
+
+ return 0;
+}
diff --git a/arch/arm64/kvm/vgic/vgic.h b/arch/arm64/kvm/vgic/vgic.h
index 23d393998085..4f1e123b063e 100644
--- a/arch/arm64/kvm/vgic/vgic.h
+++ b/arch/arm64/kvm/vgic/vgic.h
@@ -308,6 +308,8 @@ int vgic_init(struct kvm *kvm);
void vgic_debug_init(struct kvm *kvm);
void vgic_debug_destroy(struct kvm *kvm);
+int vgic_v5_probe(const struct gic_kvm_info *info);
+
static inline int vgic_v3_max_apr_idx(struct kvm_vcpu *vcpu)
{
struct vgic_cpu *cpu_if = &vcpu->arch.vgic_cpu;
--
2.34.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH v2 0/5] KVM: arm64: Enable GICv3 guests on GICv5 hosts using FEAT_GCIE_LEGACY
2025-06-27 10:09 [PATCH v2 0/5] KVM: arm64: Enable GICv3 guests on GICv5 hosts using FEAT_GCIE_LEGACY Sascha Bischoff
` (4 preceding siblings ...)
2025-06-27 10:09 ` [PATCH v2 5/5] KVM: arm64: gic-v5: Probe for GICv5 Sascha Bischoff
@ 2025-07-08 22:24 ` Oliver Upton
5 siblings, 0 replies; 11+ messages in thread
From: Oliver Upton @ 2025-07-08 22:24 UTC (permalink / raw)
To: linux-arm-kernel, kvmarm, linux-kernel, kvm, Sascha Bischoff
Cc: Oliver Upton, nd, maz, Joey Gouly, Suzuki Poulose, yuzenghui,
will, tglx, lpieralisi, Timothy Hayes
On Fri, 27 Jun 2025 10:09:01 +0000, Sascha Bischoff wrote:
> This series introduces support for running GICv3 guests on GICv5 hosts
> by leveraging the GICv5 legacy compatibility feature
> (FEAT_GCIE_LEGACY). The main motivation is to enable existing GICv3
> VMs on GICv5 system without VM or VMM modifications - things should
> work out of the box.
>
> The changes are focused on two main areas:
>
> [...]
I've picked this up now that the GICv5 driver is baking in -next. No
promises that these patches actually land in 6.17 (if the host side
doesn't land) but I'm quite happy with the KVM bits.
Applied to next, thanks!
[1/5] irqchip/gic-v5: Skip deactivate for forwarded PPI interrupts
https://git.kernel.org/kvmarm/kvmarm/c/244e9a89ca76
[2/5] irqchip/gic-v5: Populate struct gic_kvm_info
https://git.kernel.org/kvmarm/kvmarm/c/1ec38ce3d024
[3/5] arm64/sysreg: Add ICH_VCTLR_EL2
https://git.kernel.org/kvmarm/kvmarm/c/b62f4b5dec91
[4/5] KVM: arm64: gic-v5: Support GICv3 compat
https://git.kernel.org/kvmarm/kvmarm/c/c017e49ed138
[5/5] KVM: arm64: gic-v5: Probe for GICv5
https://git.kernel.org/kvmarm/kvmarm/c/ff2aa6495d4b
--
Best,
Oliver
^ permalink raw reply [flat|nested] 11+ messages in thread