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.

arm64: cpucaps: Add GICv5 Legacy vCPU interface (GCIE_LEGACY) capability

Implement the GCIE_LEGACY capability as a system feature to be able to
check for support from KVM. The type is explicitly
ARM64_CPUCAP_EARLY_LOCAL_CPU_FEATURE, which means that the capability
is enabled early if all boot CPUs support it. Additionally, if this
capability is enabled during boot, it prevents late onlining of CPUs
that lack it, thereby avoiding potential mismatched configurations
which would break KVM.

Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Reviewed-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Marc Zyngier <maz@kernel.org>

authored by

Sascha Bischoff and committed by
Marc Zyngier
7847f511 d5a012af

+16
+15
arch/arm64/kernel/cpufeature.c
··· 2539 2539 return idr & MPAMIDR_EL1_HAS_HCR; 2540 2540 } 2541 2541 2542 + static bool 2543 + test_has_gicv5_legacy(const struct arm64_cpu_capabilities *entry, int scope) 2544 + { 2545 + if (!this_cpu_has_cap(ARM64_HAS_GICV5_CPUIF)) 2546 + return false; 2547 + 2548 + return !!(read_sysreg_s(SYS_ICC_IDR0_EL1) & ICC_IDR0_EL1_GCIE_LEGACY); 2549 + } 2550 + 2542 2551 static const struct arm64_cpu_capabilities arm64_features[] = { 2543 2552 { 2544 2553 .capability = ARM64_ALWAYS_BOOT, ··· 3164 3155 .capability = ARM64_HAS_GICV5_CPUIF, 3165 3156 .matches = has_cpuid_feature, 3166 3157 ARM64_CPUID_FIELDS(ID_AA64PFR2_EL1, GCIE, IMP) 3158 + }, 3159 + { 3160 + .desc = "GICv5 Legacy vCPU interface", 3161 + .type = ARM64_CPUCAP_EARLY_LOCAL_CPU_FEATURE, 3162 + .capability = ARM64_HAS_GICV5_LEGACY, 3163 + .matches = test_has_gicv5_legacy, 3167 3164 }, 3168 3165 {}, 3169 3166 };
+1
arch/arm64/tools/cpucaps
··· 37 37 HAS_GENERIC_AUTH_IMP_DEF 38 38 HAS_GICV3_CPUIF 39 39 HAS_GICV5_CPUIF 40 + HAS_GICV5_LEGACY 40 41 HAS_GIC_PRIO_MASKING 41 42 HAS_GIC_PRIO_RELAXED_SYNC 42 43 HAS_HCR_NV1