riscv: Only check online cpus for emulated accesses

BugLink: https://bugs.launchpad.net/bugs/2060097

[ Upstream commit 313130c62cf1fc410ac8730b291fd4fde582d032 ]

The unaligned access checker only sets valid values for online cpus.
Check for these values on online cpus rather than on present cpus.

Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Fixes: 71c54b3d16 ("riscv: report misaligned accesses emulation to hwprobe")
Tested-by: Samuel Holland <samuel.holland@sifive.com>
Link: https://lore.kernel.org/r/20240308-disable_misaligned_probe_config-v9-2-a388770ba0ce@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 52805f2f5e340d84d0d2829e050873456c716a2a)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
This commit is contained in:
Charlie Jenkins
2024-03-08 10:25:56 -08:00
committed by Roxana Nicolescu
parent d8b8e5a65a
commit cac7e39f50
+1 -1
View File
@@ -632,7 +632,7 @@ void unaligned_emulation_finish(void)
* accesses emulated since tasks requesting such control can run on any
* CPU.
*/
for_each_present_cpu(cpu) {
for_each_online_cpu(cpu) {
if (per_cpu(misaligned_access_speed, cpu) !=
RISCV_HWPROBE_MISALIGNED_EMULATED) {
return;