]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
irqchip/gic: Expose CPU interface VA to KVM
authorMarc Zyngier <maz@kernel.org>
Thu, 20 Nov 2025 17:24:52 +0000 (17:24 +0000)
committerOliver Upton <oupton@kernel.org>
Mon, 24 Nov 2025 22:29:11 +0000 (14:29 -0800)
Future changes will require KVM to be able to perform deactivations
by writing to the physical CPU interface. Add the corresponding
VA to the kvm_info structure, and let KVM stash it.

Tested-by: Fuad Tabba <tabba@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Tested-by: Mark Brown <broonie@kernel.org>
Link: https://msgid.link/20251120172540.2267180-3-maz@kernel.org
Signed-off-by: Oliver Upton <oupton@kernel.org>
arch/arm64/kvm/vgic/vgic-v2.c
drivers/irqchip/irq-gic.c
include/kvm/arm_vgic.h
include/linux/irqchip/arm-vgic-info.h

index 381673f03c395dc096849c85477054b6a63df5dd..441efef80d609bd68a9e19b45647543dc8144795 100644 (file)
@@ -385,6 +385,7 @@ int vgic_v2_probe(const struct gic_kvm_info *info)
 
        kvm_vgic_global_state.can_emulate_gicv2 = true;
        kvm_vgic_global_state.vcpu_base = info->vcpu.start;
+       kvm_vgic_global_state.gicc_base = info->gicc_base;
        kvm_vgic_global_state.type = VGIC_V2;
        kvm_vgic_global_state.max_gic_vcpus = VGIC_V2_MAX_CPUS;
 
index 1269ab8eb726afbb80849fd062612861680cb4d1..ec70c84e9f91dd7bc280661a2a34e4e420316d67 100644 (file)
@@ -1459,6 +1459,8 @@ static void __init gic_of_setup_kvm_info(struct device_node *node)
        if (ret)
                return;
 
+       gic_v2_kvm_info.gicc_base = gic_data[0].cpu_base.common_base;
+
        if (static_branch_likely(&supports_deactivate_key))
                vgic_set_kvm_info(&gic_v2_kvm_info);
 }
@@ -1620,6 +1622,7 @@ static void __init gic_acpi_setup_kvm_info(void)
                return;
 
        gic_v2_kvm_info.maint_irq = irq;
+       gic_v2_kvm_info.gicc_base = gic_data[0].cpu_base.common_base;
 
        vgic_set_kvm_info(&gic_v2_kvm_info);
 }
index 7a0b972eb1b129dbc52e37178ad9d33960d34399..577723f5599bdd4be1ee381429d8f3c49e056255 100644 (file)
@@ -59,6 +59,9 @@ struct vgic_global {
        /* virtual control interface mapping, HYP VA */
        void __iomem            *vctrl_hyp;
 
+       /* Physical CPU interface, kernel VA */
+       void __iomem            *gicc_base;
+
        /* Number of implemented list registers */
        int                     nr_lr;
 
index a470a73a805aac94d035f3fbad54ebbc8c1724a9..67d9d960273b9986dcab475e3661a7934026c840 100644 (file)
@@ -24,6 +24,8 @@ struct gic_kvm_info {
        enum gic_type   type;
        /* Virtual CPU interface */
        struct resource vcpu;
+       /* GICv2 GICC VA */
+       void __iomem    *gicc_base;
        /* Interrupt number */
        unsigned int    maint_irq;
        /* No interrupt mask, no need to use the above field */