mirror of https://github.com/torvalds/linux.git
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: 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>
This commit is contained in:
parent
8cb4ecec5e
commit
fa8f11e8e1
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Reference in New Issue