Commit c7830236 authored by Linus Torvalds's avatar Linus Torvalds

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

Pull arm64 fix from Catalin Marinas:
 "arm64/ptrace fix to use the correct SVE layout based on the saved
  floating point state rather than the TIF_SVE flag. The latter may be
  left on during syscalls even if the SVE state is discarded"

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
  arm64/ptrace: Use saved floating point state type to determine SVE layout
parents 261b8e89 b017a0ce
...@@ -761,7 +761,6 @@ static void sve_init_header_from_task(struct user_sve_header *header, ...@@ -761,7 +761,6 @@ static void sve_init_header_from_task(struct user_sve_header *header,
{ {
unsigned int vq; unsigned int vq;
bool active; bool active;
bool fpsimd_only;
enum vec_type task_type; enum vec_type task_type;
memset(header, 0, sizeof(*header)); memset(header, 0, sizeof(*header));
...@@ -777,12 +776,10 @@ static void sve_init_header_from_task(struct user_sve_header *header, ...@@ -777,12 +776,10 @@ static void sve_init_header_from_task(struct user_sve_header *header,
case ARM64_VEC_SVE: case ARM64_VEC_SVE:
if (test_tsk_thread_flag(target, TIF_SVE_VL_INHERIT)) if (test_tsk_thread_flag(target, TIF_SVE_VL_INHERIT))
header->flags |= SVE_PT_VL_INHERIT; header->flags |= SVE_PT_VL_INHERIT;
fpsimd_only = !test_tsk_thread_flag(target, TIF_SVE);
break; break;
case ARM64_VEC_SME: case ARM64_VEC_SME:
if (test_tsk_thread_flag(target, TIF_SME_VL_INHERIT)) if (test_tsk_thread_flag(target, TIF_SME_VL_INHERIT))
header->flags |= SVE_PT_VL_INHERIT; header->flags |= SVE_PT_VL_INHERIT;
fpsimd_only = false;
break; break;
default: default:
WARN_ON_ONCE(1); WARN_ON_ONCE(1);
...@@ -790,7 +787,7 @@ static void sve_init_header_from_task(struct user_sve_header *header, ...@@ -790,7 +787,7 @@ static void sve_init_header_from_task(struct user_sve_header *header,
} }
if (active) { if (active) {
if (fpsimd_only) { if (target->thread.fp_type == FP_STATE_FPSIMD) {
header->flags |= SVE_PT_REGS_FPSIMD; header->flags |= SVE_PT_REGS_FPSIMD;
} else { } else {
header->flags |= SVE_PT_REGS_SVE; header->flags |= SVE_PT_REGS_SVE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment