[HIRSUTE][linux-riscv][PATCH 0/3] Disable ftrace of sbi functions

Dimitri John Ledkov dimitri.ledkov at canonical.com
Wed Aug 18 12:12:23 UTC 2021


[Impact]

 * A kernel build can fail to boot with Oops and illegal instruction
as seen at
https://bugs.launchpad.net/ubuntu/+source/linux-riscv-5.11/+bug/1934548
on Unmatched board.

 * One cannot frace functions, used in frace setup. On RISC-V these
are sbi calls to firmware from sbi.c which were not excluded for
tracing. Similar functions on other arches are already excluded.

 * Previously we have identified one call that was racing and causing
failure to boot and marked it for notrace. But the upstream solution
is to disable all functions in sbi.c which was implemented in v5.12
but did not make it to stable/earlier trees.

 * Note that this failure to boot is racy, meaning some lucky builds
of kernel always boot or always fail, as was observed on Unmatched.

[Test Plan]

 * Kernel should boot on baremetal Unmatched, Unleashed, and qemu

[Where problems could occur]

 * This patch disables profiling and tracing of sbi.c function
calls. Previously it was possible to trace them, somewhat, either
successfully in a racy manner or to cause a kernel panic.

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

Dimitri John Ledkov (1):
  Revert "UBUNTU: SAUCE: RISC-V: prevent sbi_send_cpumask_ipi race with
    ftrace"

Guo Ren (2):
  riscv: Fixup wrong ftrace remove cflag
  riscv: Fixup patch_text panic in ftrace

 arch/riscv/kernel/Makefile | 5 +++--
 arch/riscv/kernel/sbi.c    | 2 +-
 arch/riscv/mm/Makefile     | 3 ++-
 3 files changed, 6 insertions(+), 4 deletions(-)

-- 
2.30.2



More information about the kernel-team mailing list