mbox series

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

Message ID 20210818121426.195205-1-dimitri.ledkov@canonical.com
Headers show
Series Disable ftrace of sbi functions | expand

Message

Dimitri John Ledkov Aug. 18, 2021, 12:14 p.m. UTC
[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

Changes since v1:
 * Use a new buglink
 * Add buglink to all patches

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(-)

Comments

Tim Gardner Aug. 18, 2021, 12:26 p.m. UTC | #1
Acked-by: Tim Gardner <tim.gardner@canonical.com>

On 8/18/21 6:14 AM, Dimitri John Ledkov wrote:
> [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
> 
> Changes since v1:
>   * Use a new buglink
>   * Add buglink to all patches
> 
> 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(-)
>
Stefan Bader Aug. 18, 2021, 1:08 p.m. UTC | #2
On 18.08.21 14:14, Dimitri John Ledkov wrote:
> [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
> 
> Changes since v1:
>   * Use a new buglink
>   * Add buglink to all patches
> 
> 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(-)
> 
I probably would suggest to move the BugLink either to the first line of commit 
message or before the new s-o-b area. That can be done when applying. I tried to 
leave that possibility also for adding the missing bug reference on the fly. But 
I guess my cheery morning mood did not suggest that.


Acked-by: Stefan Bader <stefan.bader@canonical.com>
Stefan Bader Aug. 18, 2021, 2:25 p.m. UTC | #3
On 18.08.21 14:14, Dimitri John Ledkov wrote:
> [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
> 
> Changes since v1:
>   * Use a new buglink
>   * Add buglink to all patches
> 
> 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(-)
> 

Applied to hirsute:linux-riscv/master. Thanks.

-Stefan