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: vgic: Don't reset cpuif/redist addresses at finalize time

Although we are OK with rewriting idregs at finalize time, resetting
the guest's cpuif (GICv3) or redistributor (GICv3) addresses once
we start running the guest is a pretty bad idea.

Move back this initialisation to vgic creation time.

Reviewed-by: Sascha Bischoff <sascha.bischoff@arm.com>
Fixes: a258a383b9177 ("KVM: arm64: gic-v5: Sanitize ID_AA64PFR2_EL1.GCIE")
Link: https://patch.msgid.link/20260323174713.3183111-1-maz@kernel.org
Link: https://patch.msgid.link/20260401103611.357092-2-maz@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>

+9 -2
+9 -2
arch/arm64/kvm/vgic/vgic-init.c
··· 147 147 kvm->arch.vgic.implementation_rev = KVM_VGIC_IMP_REV_LATEST; 148 148 kvm->arch.vgic.vgic_dist_base = VGIC_ADDR_UNDEF; 149 149 150 + switch (type) { 151 + case KVM_DEV_TYPE_ARM_VGIC_V2: 152 + kvm->arch.vgic.vgic_cpu_base = VGIC_ADDR_UNDEF; 153 + break; 154 + case KVM_DEV_TYPE_ARM_VGIC_V3: 155 + INIT_LIST_HEAD(&kvm->arch.vgic.rd_regions); 156 + break; 157 + } 158 + 150 159 /* 151 160 * We've now created the GIC. Update the system register state 152 161 * to accurately reflect what we've created. ··· 693 684 694 685 switch (type) { 695 686 case KVM_DEV_TYPE_ARM_VGIC_V2: 696 - kvm->arch.vgic.vgic_cpu_base = VGIC_ADDR_UNDEF; 697 687 break; 698 688 case KVM_DEV_TYPE_ARM_VGIC_V3: 699 - INIT_LIST_HEAD(&kvm->arch.vgic.rd_regions); 700 689 aa64pfr0 |= SYS_FIELD_PREP_ENUM(ID_AA64PFR0_EL1, GIC, IMP); 701 690 pfr1 |= SYS_FIELD_PREP_ENUM(ID_PFR1_EL1, GIC, GICv3); 702 691 break;