Skip to content

Commit 16abeb6

Browse files
Marc Zyngieroupton
authored andcommitted
KVM: arm64: nv: Load timer before the GIC
In order for vgic_v3_load_nested to be able to observe which timer interrupts have the HW bit set for the current context, the timers must have been loaded in the new mode and the right timer mapped to their corresponding HW IRQs. At the moment, we load the GIC first, meaning that timer interrupts injected to an L2 guest will never have the HW bit set (we see the old configuration). Swapping the two loads solves this particular problem. Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20250225172930.1850838-5-maz@kernel.org Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
1 parent b7a252e commit 16abeb6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

arch/arm64/kvm/arm.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,8 +576,12 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
576576
nommu:
577577
vcpu->cpu = cpu;
578578

579-
kvm_vgic_load(vcpu);
579+
/*
580+
* The timer must be loaded before the vgic to correctly set up physical
581+
* interrupt deactivation in nested state (e.g. timer interrupt).
582+
*/
580583
kvm_timer_vcpu_load(vcpu);
584+
kvm_vgic_load(vcpu);
581585
kvm_vcpu_load_debug(vcpu);
582586
if (has_vhe())
583587
kvm_vcpu_load_vhe(vcpu);

0 commit comments

Comments
 (0)