linux/arch/riscv/kernel
Palmer Dabbelt 5835437609
Merge patch series "riscv: Improve KASAN coverage to fix unit tests"
Samuel Holland <samuel.holland@sifive.com> says:

This series fixes two areas where uninstrumented assembly routines
caused gaps in KASAN coverage on RISC-V, which were caught by KUnit
tests. The KASAN KUnit test suite passes after applying this series.

This series fixes the following test failures:
  # kasan_strings: EXPECTATION FAILED at mm/kasan/kasan_test.c:1520
  KASAN failure expected in "kasan_int_result = strcmp(ptr, "2")", but none occurred
  # kasan_strings: EXPECTATION FAILED at mm/kasan/kasan_test.c:1524
  KASAN failure expected in "kasan_int_result = strlen(ptr)", but none occurred
  not ok 60 kasan_strings
  # kasan_bitops_generic: EXPECTATION FAILED at mm/kasan/kasan_test.c:1531
  KASAN failure expected in "set_bit(nr, addr)", but none occurred
  # kasan_bitops_generic: EXPECTATION FAILED at mm/kasan/kasan_test.c:1533
  KASAN failure expected in "clear_bit(nr, addr)", but none occurred
  # kasan_bitops_generic: EXPECTATION FAILED at mm/kasan/kasan_test.c:1535
  KASAN failure expected in "clear_bit_unlock(nr, addr)", but none occurred
  # kasan_bitops_generic: EXPECTATION FAILED at mm/kasan/kasan_test.c:1536
  KASAN failure expected in "__clear_bit_unlock(nr, addr)", but none occurred
  # kasan_bitops_generic: EXPECTATION FAILED at mm/kasan/kasan_test.c:1537
  KASAN failure expected in "change_bit(nr, addr)", but none occurred
  # kasan_bitops_generic: EXPECTATION FAILED at mm/kasan/kasan_test.c:1543
  KASAN failure expected in "test_and_set_bit(nr, addr)", but none occurred
  # kasan_bitops_generic: EXPECTATION FAILED at mm/kasan/kasan_test.c:1545
  KASAN failure expected in "test_and_set_bit_lock(nr, addr)", but none occurred
  # kasan_bitops_generic: EXPECTATION FAILED at mm/kasan/kasan_test.c:1546
  KASAN failure expected in "test_and_clear_bit(nr, addr)", but none occurred
  # kasan_bitops_generic: EXPECTATION FAILED at mm/kasan/kasan_test.c:1548
  KASAN failure expected in "test_and_change_bit(nr, addr)", but none occurred
  not ok 61 kasan_bitops_generic

Samuel Holland (2):
  riscv: Omit optimized string routines when using KASAN
  riscv: Enable bitops instrumentation

arch/riscv/include/asm/bitops.h | 43 ++++++++++++++++++---------------
 arch/riscv/include/asm/string.h |  2 ++
 arch/riscv/kernel/riscv_ksyms.c |  3 ---
 arch/riscv/lib/Makefile         |  2 ++
 arch/riscv/lib/strcmp.S         |  1 +
 arch/riscv/lib/strlen.S         |  1 +
 arch/riscv/lib/strncmp.S        |  1 +
 arch/riscv/purgatory/Makefile   |  2 ++
 8 files changed, 32 insertions(+), 23 deletions(-)

* b4-shazam-merge:
  riscv: Enable bitops instrumentation
  riscv: Omit optimized string routines when using KASAN

Link: https://lore.kernel.org/r/20240801033725.28816-1-samuel.holland@sifive.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2024-09-19 01:10:44 -07:00
..
compat_vdso Makefile: remove redundant tool coverage variables 2024-05-14 23:35:48 +09:00
pi RISC-V: Use Zkr to seed KASLR base address 2024-08-05 12:06:41 -07:00
probes trace: riscv: Remove deprecated kprobe on ftrace support 2024-07-24 06:14:05 -07:00
tests treewide: replace or remove redundant def_bool in Kconfig files 2024-02-20 20:47:45 +09:00
vdso riscv: vdso: do not strip debugging info for vdso.so.dbg 2024-09-14 01:02:30 -07:00
vendor_extensions riscv: Make riscv_isa_vendor_ext_andes array static 2024-09-17 08:05:08 -07:00
.gitignore
acpi_numa.c ACPI: RISCV: Make acpi_numa_get_nid() to be static 2024-09-17 12:02:48 -07:00
acpi.c Merge patch "Enable SPCR table for console output on RISC-V" 2024-07-26 05:50:48 -07:00
alternative.c riscv: errata: Rename defines for Andes 2024-03-12 07:13:12 -07:00
asm-offsets.c riscv: Stop emitting preventive sfence.vma for new vmalloc mappings 2024-09-15 00:11:04 -07:00
cacheinfo.c riscv: cacheinfo: Add back init_cache_level() function 2024-09-15 20:15:50 -07:00
cfi.c bpf, riscv64/cfi: Support kCFI + BPF on riscv64 2024-03-06 15:18:16 -08:00
compat_signal.c riscv: compat: signal: Add rt_frame implementation 2022-05-17 16:37:21 -07:00
compat_syscall_table.c riscv: convert to generic syscall table 2024-07-10 14:23:38 +02:00
copy-unaligned.h RISC-V: Probe for unaligned access speed 2023-09-01 09:06:25 -07:00
copy-unaligned.S riscv: Use SYM_*() assembly macros instead of deprecated ones 2023-11-06 09:42:47 -08:00
cpu_ops_sbi.c riscv: prevent pt_regs corruption for secondary idle threads 2024-05-30 09:42:51 -07:00
cpu_ops_spinwait.c riscv: prevent pt_regs corruption for secondary idle threads 2024-05-30 09:42:51 -07:00
cpu_ops.c riscv: Use the same CPU operations for all CPUs 2024-01-04 15:03:07 -08:00
cpu-hotplug.c riscv: Use the same CPU operations for all CPUs 2024-01-04 15:03:07 -08:00
cpu.c riscv: Add vendor extensions to /proc/cpuinfo 2024-07-22 15:36:55 -07:00
cpufeature.c Merge patch series "Svvptc extension to remove preventive sfence.vma" 2024-09-15 20:58:24 -07:00
crash_dump.c vmcore: convert copy_oldmem_page() to take an iov_iter 2022-04-29 14:37:59 -07:00
crash_save_regs.S RISC-V: Fixup get incorrect user mode PC for kernel mode regs 2022-08-11 08:54:40 -07:00
efi-header.S riscv: Prepare EFI header for relocatable kernels 2023-04-19 07:46:28 -07:00
efi.c riscv: Use accessors to page table entries instead of direct dereference 2023-12-20 10:48:15 -08:00
elf_kexec.c riscv/kexec_file: Fix relocation type R_RISCV_ADD16 and R_RISCV_SUB16 unknown 2024-08-14 17:44:33 -07:00
entry.S riscv: avoid Imbalance in RAS 2024-09-15 20:58:25 -07:00
fpu.S riscv: typo in comment for get_f64_reg 2024-05-22 16:12:53 -07:00
ftrace.c riscv: patch: Flush the icache right after patching to avoid illegal insns 2024-06-26 07:37:27 -07:00
head.h riscv: entry: Convert to generic entry 2023-03-23 08:47:00 -07:00
head.S riscv: set trap vector earlier 2024-07-12 08:55:31 -07:00
hibernate-asm.S riscv: Use SYM_*() assembly macros instead of deprecated ones 2023-11-06 09:42:47 -08:00
hibernate.c riscv: hibernate: remove WARN_ON in save_processor_state 2023-06-23 10:06:22 -07:00
image-vars.h efi: move screen_info into efi init code 2023-10-17 16:33:39 +02:00
irq.c Merge patch "drivers: perf: Do not broadcast to other cpus when starting a counter" 2023-11-09 06:44:13 -08:00
jump_label.c riscv: jump_label: Batch icache maintenance 2024-06-26 07:36:27 -07:00
kernel_mode_fpu.c riscv: add support for kernel-mode FPU 2024-05-19 14:36:19 -07:00
kernel_mode_vector.c riscv: vector: allow kernel-mode Vector with preemption 2024-01-16 07:14:02 -08:00
kexec_relocate.S riscv: kexec: Cleanup riscv_kexec_relocate 2023-09-20 02:53:29 -07:00
kgdb.c RISC-V: rename parse_asm.h to insn.h 2022-12-29 06:59:47 -08:00
machine_kexec_file.c RISC-V: Add kexec_file support 2022-05-19 12:14:18 -07:00
machine_kexec.c riscv: kexec: Avoid deadlock in kexec crash path 2024-07-03 13:11:30 -07:00
Makefile Merge patch series "riscv: Separate vendor extensions from standard extensions" 2024-07-22 15:37:01 -07:00
Makefile.syscalls syscalls: fix syscall macros for newfstat/newfstatat 2024-08-02 15:20:47 +02:00
mcount-dyn.S ftrace: riscv: move from REGS to ARGS 2024-05-22 16:12:48 -07:00
mcount.S riscv: remove MCOUNT_NAME workaround 2024-02-22 15:38:54 -08:00
module-sections.c
module.c riscv: Use LIST_HEAD() to simplify code 2024-09-17 06:26:07 -07:00
paravirt.c RISC-V: KVM: Rename the SBI_STA_SHMEM_DISABLE to a generic name 2024-04-22 11:13:52 +05:30
patch.c riscv: Re-introduce global icache flush in patch_text_XXX() 2024-08-06 06:49:14 -07:00
perf_callchain.c riscv: stacktrace: Add USER_STACKTRACE support 2024-09-14 23:57:16 -07:00
perf_regs.c
process.c riscv: Randomize lower bits of stack address 2024-09-17 08:05:10 -07:00
ptrace.c Merge patch series "riscv: Introduce compat-mode helpers & improve arch_get_mmap_end()" 2024-03-20 08:56:05 -07:00
reset.c riscv: Use do_kernel_power_off() 2022-05-19 19:30:30 +02:00
return_address.c riscv: add CALLER_ADDRx support 2024-02-22 12:17:47 -08:00
riscv_ksyms.c riscv: Omit optimized string routines when using KASAN 2024-09-19 01:10:00 -07:00
sbi-ipi.c RISC-V: Enable the IPI before workqueue_online_cpu() 2024-08-01 07:15:43 -07:00
sbi.c riscv: Improve sbi_ecall() code generation by reordering arguments 2024-07-10 13:30:56 -07:00
setup.c ACPI: RISCV: Add NUMA support based on SRAT and SLIT 2024-07-22 07:13:06 -07:00
signal.c riscv: signal: Remove unlikely() from WARN_ON() condition 2024-07-26 05:50:46 -07:00
smp.c RISC-V: Implement kgdb_roundup_cpus() to enable future NMI Roundup 2024-09-17 05:52:44 -07:00
smpboot.c Merge patch series "Add ACPI NUMA support for RISC-V" 2024-07-22 10:31:51 -07:00
soc.c
stacktrace.c riscv: stacktrace: Add USER_STACKTRACE support 2024-09-14 23:57:16 -07:00
suspend_entry.S riscv: Use SYM_*() assembly macros instead of deprecated ones 2023-11-06 09:42:47 -08:00
suspend.c riscv: Do not save the scratch CSR during suspend 2024-04-28 14:50:36 -07:00
sys_hwprobe.c RISC-V: Provide the frequency of time CSR via hwprobe 2024-07-26 05:50:51 -07:00
sys_riscv.c syscalls: mmap(): use unsigned offset type consistently 2024-06-25 15:57:38 +02:00
syscall_table.c riscv: convert to generic syscall table 2024-07-10 14:23:38 +02:00
time.c RISC-V: paravirt: Add skeleton for pv-time support 2023-12-30 11:25:03 +05:30
traps_misaligned.c riscv: misaligned: remove CONFIG_RISCV_M_MODE specific code 2024-04-28 14:50:37 -07:00
traps.c riscv: entry: always initialize regs->a0 to -ENOSYS 2024-08-14 13:12:22 -07:00
unaligned_access_speed.c riscv: Use kcalloc() instead of kzalloc() 2024-03-20 08:56:07 -07:00
vdso.c riscv: vdso: Use generic union vdso_data_store 2024-02-20 20:56:00 +01:00
vector.c riscv: vector: adjust minimum Vector requirement to ZVE32X 2024-05-30 14:33:10 -07:00
vendor_extensions.c riscv: Extend cpufeature.c to detect vendor extensions 2024-07-22 15:36:54 -07:00
vmcore_info.c riscv: don't export va_kernel_pa_offset in vmcoreinfo for XIP kernel 2024-09-12 07:22:56 -07:00
vmlinux-xip.lds.S riscv: remove limit on the size of read-only section for XIP kernel 2024-09-12 07:23:02 -07:00
vmlinux.lds.S riscv: Check if the code to patch lies in the exit section 2024-01-09 10:58:59 -08:00