]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
arm64: proton-pack: Expose whether the platform is mitigated by firmware
authorJames Morse <james.morse@arm.com>
Sat, 7 Jun 2025 15:35:30 +0000 (15:35 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:05:37 +0000 (11:05 +0100)
commit005f3b7bd3787a2c246f08b7190aa3289378e1dd
tree83677607a9b3aec82442e92cdd6b8aa822c867ea
parent3af65d4123fe8353c30ba64507e37bfae56a7650
arm64: proton-pack: Expose whether the platform is mitigated by firmware

[ Upstream commit e7956c92f396a44eeeb6eaf7a5b5e1ad24db6748 ]

is_spectre_bhb_fw_affected() allows the caller to determine if the CPU
is known to need a firmware mitigation. CPUs are either on the list
of CPUs we know about, or firmware has been queried and reported that
the platform is affected - and mitigated by firmware.

This helper is not useful to determine if the platform is mitigated
by firmware. A CPU could be on the know list, but the firmware may
not be implemented. Its affected but not mitigated.

spectre_bhb_enable_mitigation() handles this distinction by checking
the firmware state before enabling the mitigation.

Add a helper to expose this state. This will be used by the BPF JIT
to determine if calling firmware for a mitigation is necessary and
supported.

Signed-off-by: James Morse <james.morse@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Pu Lehui <pulehui@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/include/asm/spectre.h
arch/arm64/kernel/proton-pack.c