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

Merge tag 'kvmarm-fixes-5.12-3' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD

KVM/arm64 fixes for 5.12, take #3

- Fix GICv3 MMIO compatibility probing
- Prevent guests from using the ARMv8.4 self-hosted tracing extension

+12 -1
+1
arch/arm64/include/asm/kvm_arm.h
··· 278 278 #define CPTR_EL2_DEFAULT CPTR_EL2_RES1 279 279 280 280 /* Hyp Debug Configuration Register bits */ 281 + #define MDCR_EL2_TTRF (1 << 19) 281 282 #define MDCR_EL2_TPMS (1 << 14) 282 283 #define MDCR_EL2_E2PB_MASK (UL(0x3)) 283 284 #define MDCR_EL2_E2PB_SHIFT (UL(12))
-1
arch/arm64/kernel/cpufeature.c
··· 383 383 * of support. 384 384 */ 385 385 S_ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_EXACT, ID_AA64DFR0_PMUVER_SHIFT, 4, 0), 386 - ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_EXACT, ID_AA64DFR0_TRACEVER_SHIFT, 4, 0), 387 386 ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_EXACT, ID_AA64DFR0_DEBUGVER_SHIFT, 4, 0x6), 388 387 ARM64_FTR_END, 389 388 };
+2
arch/arm64/kvm/debug.c
··· 89 89 * - Debug ROM Address (MDCR_EL2_TDRA) 90 90 * - OS related registers (MDCR_EL2_TDOSA) 91 91 * - Statistical profiler (MDCR_EL2_TPMS/MDCR_EL2_E2PB) 92 + * - Self-hosted Trace Filter controls (MDCR_EL2_TTRF) 92 93 * 93 94 * Additionally, KVM only traps guest accesses to the debug registers if 94 95 * the guest is not actively using them (see the KVM_ARM64_DEBUG_DIRTY ··· 113 112 vcpu->arch.mdcr_el2 = __this_cpu_read(mdcr_el2) & MDCR_EL2_HPMN_MASK; 114 113 vcpu->arch.mdcr_el2 |= (MDCR_EL2_TPM | 115 114 MDCR_EL2_TPMS | 115 + MDCR_EL2_TTRF | 116 116 MDCR_EL2_TPMCR | 117 117 MDCR_EL2_TDRA | 118 118 MDCR_EL2_TDOSA);
+9
arch/arm64/kvm/hyp/vgic-v3-sr.c
··· 429 429 if (has_vhe()) 430 430 flags = local_daif_save(); 431 431 432 + /* 433 + * Table 11-2 "Permitted ICC_SRE_ELx.SRE settings" indicates 434 + * that to be able to set ICC_SRE_EL1.SRE to 0, all the 435 + * interrupt overrides must be set. You've got to love this. 436 + */ 437 + sysreg_clear_set(hcr_el2, 0, HCR_AMO | HCR_FMO | HCR_IMO); 438 + isb(); 432 439 write_gicreg(0, ICC_SRE_EL1); 433 440 isb(); 434 441 435 442 val = read_gicreg(ICC_SRE_EL1); 436 443 437 444 write_gicreg(sre, ICC_SRE_EL1); 445 + isb(); 446 + sysreg_clear_set(hcr_el2, HCR_AMO | HCR_FMO | HCR_IMO, 0); 438 447 isb(); 439 448 440 449 if (has_vhe())