diff options
author | Marc Zyngier <maz@kernel.org> | 2024-05-02 16:45:45 +0100 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2024-05-03 11:33:50 +0100 |
commit | 03b3d00a70b55857439511c1b558ca00a99f4126 (patch) | |
tree | 67b50a9136daf5fe9d529ae990da806ca12409c2 /include/kvm | |
parent | e8533e58cae02923e8cbffca516d3d821cee1649 (diff) | |
download | linux-stable-03b3d00a70b55857439511c1b558ca00a99f4126.tar.gz linux-stable-03b3d00a70b55857439511c1b558ca00a99f4126.tar.bz2 linux-stable-03b3d00a70b55857439511c1b558ca00a99f4126.zip |
KVM: arm64: vgic: Allocate private interrupts on demand
Private interrupts are currently part of the CPU interface structure
that is part of each and every vcpu we create.
Currently, we have 32 of them per vcpu, resulting in a per-vcpu array
that is just shy of 4kB. On its own, that's no big deal, but it gets
in the way of other things:
- each vcpu gets mapped at EL2 on nVHE/hVHE configurations. This
requires memory that is physically contiguous. However, the EL2
code has no purpose looking at the interrupt structures and
could do without them being mapped.
- supporting features such as EPPIs, which extend the number of
private interrupts past the 32 limit would make the array
even larger, even for VMs that do not use the EPPI feature.
Address these issues by moving the private interrupt array outside
of the vcpu, and replace it with a simple pointer. We take this
opportunity to make it obvious what gets initialised when, as
that path was remarkably opaque, and tighten the locking.
Reviewed-by: Oliver Upton <oliver.upton@linux.dev>
Link: https://lore.kernel.org/r/20240502154545.3012089-1-maz@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'include/kvm')
-rw-r--r-- | include/kvm/arm_vgic.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h index 47035946648e..a7397f37f4dd 100644 --- a/include/kvm/arm_vgic.h +++ b/include/kvm/arm_vgic.h @@ -330,7 +330,7 @@ struct vgic_cpu { struct vgic_v3_cpu_if vgic_v3; }; - struct vgic_irq private_irqs[VGIC_NR_PRIVATE_IRQS]; + struct vgic_irq *private_irqs; raw_spinlock_t ap_list_lock; /* Protects the ap_list */ |