Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

KVM: arm64: gic: Set vgic_model before initing private IRQs

Different GIC types require the private IRQs to be initialised
differently. GICv5 is the culprit as it supports both a different
number of private IRQs, and all of these are PPIs (there are no
SGIs). Moreover, as GICv5 uses the top bits of the interrupt ID to
encode the type, the intid also needs to computed differently.

Up until now, the GIC model has been set after initialising the
private IRQs for a VCPU. Move this earlier to ensure that the GIC
model is available when configuring the private IRQs. While we're at
it, also move the setting of the in_kernel flag and implementation
revision to keep them grouped together as before.

Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Link: https://patch.msgid.link/20260128175919.3828384-7-sascha.bischoff@arm.com
Signed-off-by: Marc Zyngier <maz@kernel.org>

authored by

Sascha Bischoff and committed by
Marc Zyngier
9435c1e1 b583177a

+4 -4
+4 -4
arch/arm64/kvm/vgic/vgic-init.c
··· 140 140 goto out_unlock; 141 141 } 142 142 143 + kvm->arch.vgic.in_kernel = true; 144 + kvm->arch.vgic.vgic_model = type; 145 + kvm->arch.vgic.implementation_rev = KVM_VGIC_IMP_REV_LATEST; 146 + 143 147 kvm_for_each_vcpu(i, vcpu, kvm) { 144 148 ret = vgic_allocate_private_irqs_locked(vcpu, type); 145 149 if (ret) ··· 159 155 160 156 goto out_unlock; 161 157 } 162 - 163 - kvm->arch.vgic.in_kernel = true; 164 - kvm->arch.vgic.vgic_model = type; 165 - kvm->arch.vgic.implementation_rev = KVM_VGIC_IMP_REV_LATEST; 166 158 167 159 kvm->arch.vgic.vgic_dist_base = VGIC_ADDR_UNDEF; 168 160