Commit fa8f11e8 authored by Marc Zyngier's avatar Marc Zyngier Committed by Oliver Upton
Browse files

irqchip/gic: Expose CPU interface VA to KVM



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: default avatarFuad Tabba <tabba@google.com>
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
Tested-by: default avatarMark Brown <broonie@kernel.org>
Link: https://msgid.link/20251120172540.2267180-3-maz@kernel.org


Signed-off-by: default avatarOliver Upton <oupton@kernel.org>
parent 8cb4ecec
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;

+3 −0
Original line number Diff line number Diff line
@@ -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);
}
+3 −0
Original line number Diff line number Diff line
@@ -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;

+2 −0
Original line number Diff line number Diff line
@@ -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 */