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

KVM: arm64: vgic: Let an interrupt controller advertise lack of HW deactivation

The vGIC, as architected by ARM, allows a virtual interrupt to
trigger the deactivation of a physical interrupt. This allows
the following interrupt to be delivered without requiring an exit.

However, some implementations have choosen not to implement this,
meaning that we will need some unsavoury workarounds to deal with this.

On detecting such a case, taint the kernel and spit a nastygram.
We'll deal with this in later patches.

Signed-off-by: Marc Zyngier <maz@kernel.org>

+15
+10
arch/arm64/kvm/vgic/vgic-init.c
··· 532 532 return -ENXIO; 533 533 } 534 534 535 + /* 536 + * If we get one of these oddball non-GICs, taint the kernel, 537 + * as we have no idea of how they *really* behave. 538 + */ 539 + if (gic_kvm_info->no_hw_deactivation) { 540 + kvm_info("Non-architectural vgic, tainting kernel\n"); 541 + add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_STILL_OK); 542 + kvm_vgic_global_state.no_hw_deactivation = true; 543 + } 544 + 535 545 switch (gic_kvm_info->type) { 536 546 case GIC_V2: 537 547 ret = vgic_v2_probe(gic_kvm_info);
+3
include/kvm/arm_vgic.h
··· 72 72 bool has_gicv4; 73 73 bool has_gicv4_1; 74 74 75 + /* Pseudo GICv3 from outer space */ 76 + bool no_hw_deactivation; 77 + 75 78 /* GIC system register CPU interface */ 76 79 struct static_key_false gicv3_cpuif; 77 80
+2
include/linux/irqchip/arm-vgic-info.h
··· 32 32 bool has_v4; 33 33 /* rvpeid support */ 34 34 bool has_v4_1; 35 + /* Deactivation impared, subpar stuff */ 36 + bool no_hw_deactivation; 35 37 }; 36 38 37 39 #ifdef CONFIG_KVM