projects/linux·commit 087aa69a

Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

087aa69a · Linus Torvalds <[email protected]> · 2022-09-11 07:48:21 -04:00

Pull arm64 fixes from Will Deacon:
 "Three small arm64 fixes, all related to optional architecture
  extensions: BTI, SME and 52-bit virtual addressing:

   - Disable in-kernel BTI when compiling with GCC, as it makes invalid
     assumptions about the distance between functions which has led to
     crashes when calling modules on a CPU with BTI support

   - Remove bogus TIF_SME flag management if memory allocation fails in
     the ptrace code

   - Fix the resume path when configured for 52-bit virtual addressing"

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
  arm64: mm: fix resume for 52-bit enabled builds
  arm64/ptrace: Don't clear calling process' TIF_SME on OOM
  arm64/bti: Disable in kernel BTI when cross section thunks are broken
Commit
087aa69a9f2b2f1aaa173f976fec94058f623a9d
Parents
6429883a · 3fe3fd5f

Merge commit. Changes below are compared with the first parent: 6429883a.

Changes

3 files changed · +5 −2

FileStatusAddDelContent
arch/arm64/Kconfigmodified+2−0View file
arch/arm64/kernel/ptrace.cmodified+0−2View file
arch/arm64/kernel/sleep.Smodified+3−0View file

arch/arm64/Kconfig

View file
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 9fb9fff..1ce7685 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1887,6 +1887,8 @@ config ARM64_BTI_KERNEL
depends on CC_HAS_BRANCH_PROT_PAC_RET_BTI
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94697
depends on !CC_IS_GCC || GCC_VERSION >= 100100
+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106671
+ depends on !CC_IS_GCC
# https://github.com/llvm/llvm-project/commit/a88c722e687e6780dcd6a58718350dc76fcc4cc9
depends on !CC_IS_CLANG || CLANG_VERSION >= 120000
depends on (!FUNCTION_GRAPH_TRACER || DYNAMIC_FTRACE_WITH_REGS)

arch/arm64/kernel/ptrace.c

View file
diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
index eb7c08d..041d2ae 100644
--- a/arch/arm64/kernel/ptrace.c
+++ b/arch/arm64/kernel/ptrace.c
@@ -1084,7 +1084,6 @@ static int za_set(struct task_struct *target,
if (!target->thread.sve_state) {
sve_alloc(target, false);
if (!target->thread.sve_state) {
- clear_thread_flag(TIF_SME);
ret = -ENOMEM;
goto out;
}
@@ -1094,7 +1093,6 @@ static int za_set(struct task_struct *target,
sme_alloc(target);
if (!target->thread.za_state) {
ret = -ENOMEM;
- clear_tsk_thread_flag(target, TIF_SME);
goto out;
}

arch/arm64/kernel/sleep.S

View file
diff --git a/arch/arm64/kernel/sleep.S b/arch/arm64/kernel/sleep.S
index 617f78a..97c9de5 100644
--- a/arch/arm64/kernel/sleep.S
+++ b/arch/arm64/kernel/sleep.S
@@ -101,6 +101,9 @@ SYM_FUNC_END(__cpu_suspend_enter)
SYM_CODE_START(cpu_resume)
bl init_kernel_el
bl finalise_el2
+#if VA_BITS > 48
+ ldr_l x0, vabits_actual
+#endif
bl __cpu_setup
/* enable the MMU early - so we can access sleep_save_stash by va */
adrp x1, swapper_pg_dir