linux/Documentation/arch
Evan Green c42e2f0767
RISC-V: hwprobe: Add MISALIGNED_PERF key
RISCV_HWPROBE_KEY_CPUPERF_0 was mistakenly flagged as a bitmask in
hwprobe_key_is_bitmask(), when in reality it was an enum value. This
causes problems when used in conjunction with RISCV_HWPROBE_WHICH_CPUS,
since SLOW, FAST, and EMULATED have values whose bits overlap with
each other. If the caller asked for the set of CPUs that was SLOW or
EMULATED, the returned set would also include CPUs that were FAST.

Introduce a new hwprobe key, RISCV_HWPROBE_KEY_MISALIGNED_PERF, which
returns the same values in response to a direct query (with no flags),
but is properly handled as an enumerated value. As a result, SLOW,
FAST, and EMULATED are all correctly treated as distinct values under
the new key when queried with the WHICH_CPUS flag.

Leave the old key in place to avoid disturbing applications which may
have already come to rely on the key, with or without its broken
behavior with respect to the WHICH_CPUS flag.

Fixes: e178bf146e ("RISC-V: hwprobe: Introduce which-cpus flag")
Signed-off-by: Evan Green <evan@rivosinc.com>
Reviewed-by: Charlie Jenkins <charlie@rivosinc.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Link: https://lore.kernel.org/r/20240809214444.3257596-2-evan@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2024-08-14 13:13:23 -07:00
..
arc docs: kernel_feat.py: fix potential command injection 2024-01-11 09:21:01 -07:00
arm docs: kernel_feat.py: fix potential command injection 2024-01-11 09:21:01 -07:00
arm64 Merge branch 'for-next/vcpu-hotplug' into for-next/core 2024-07-11 19:10:02 +01:00
loongarch A handful of late-arriving documentation fixes. 2024-01-17 11:49:11 -08:00
m68k Docs: typos/spelling 2024-05-02 10:02:29 -06:00
mips docs: kernel_feat.py: fix potential command injection 2024-01-11 09:21:01 -07:00
nios2 docs: kernel_feat.py: fix potential command injection 2024-01-11 09:21:01 -07:00
openrisc docs: kernel_feat.py: fix potential command injection 2024-01-11 09:21:01 -07:00
parisc docs: kernel_feat.py: fix potential command injection 2024-01-11 09:21:01 -07:00
powerpc Merge branch 'topic/ppc-kvm' into next 2024-07-18 14:32:46 +10:00
riscv RISC-V: hwprobe: Add MISALIGNED_PERF key 2024-08-14 13:13:23 -07:00
s390 docs: Update s390 vfio-ap doc for ap_config sysfs attribute 2024-04-22 12:49:18 +02:00
sh docs: kernel_feat.py: fix potential command injection 2024-01-11 09:21:01 -07:00
sparc Docs: typos/spelling 2024-05-02 10:02:29 -06:00
x86 Nothing hugely exciting happening in the documentation tree this time 2024-07-18 15:54:16 -07:00
xtensa docs: kernel_feat.py: fix potential command injection 2024-01-11 09:21:01 -07:00
index.rst The number of commits for documentation is not huge this time around, but 2023-11-01 17:11:41 -10:00