mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 23:22:31 +02:00
KVM: arm64: Advertise PMUv3 if IMPDEF traps are present
Advertise a baseline PMUv3 implementation when running on hardware with IMPDEF traps of the PMUv3 sysregs. Tested-by: Janne Grunau <j@jannau.net> Reviewed-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20250305202641.428114-11-oliver.upton@linux.dev Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
This commit is contained in:
parent
2c433f70dc
commit
bed9b8ec8c
|
|
@ -1231,7 +1231,17 @@ u8 kvm_arm_pmu_get_pmuver_limit(void)
|
|||
pmuver = SYS_FIELD_GET(ID_AA64DFR0_EL1, PMUVer,
|
||||
read_sanitised_ftr_reg(SYS_ID_AA64DFR0_EL1));
|
||||
|
||||
/* Treat IMPLEMENTATION DEFINED functionality as unimplemented */
|
||||
/*
|
||||
* Spoof a barebones PMUv3 implementation if the system supports IMPDEF
|
||||
* traps of the PMUv3 sysregs
|
||||
*/
|
||||
if (cpus_have_final_cap(ARM64_WORKAROUND_PMUV3_IMPDEF_TRAPS))
|
||||
return ID_AA64DFR0_EL1_PMUVer_IMP;
|
||||
|
||||
/*
|
||||
* Otherwise, treat IMPLEMENTATION DEFINED functionality as
|
||||
* unimplemented
|
||||
*/
|
||||
if (pmuver == ID_AA64DFR0_EL1_PMUVer_IMP_DEF)
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user