Skip to content

Commit edc541e

Browse files
kvaneeshmpe
authored andcommitted
powerpc/ptrace-view: Use pt_regs values instead of thread_struct based one.
We will remove thread.amr/iamr/uamor in a later patch Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20201127044424.40686-14-aneesh.kumar@linux.ibm.com
1 parent d5fa30e commit edc541e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

arch/powerpc/kernel/ptrace/ptrace-view.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -471,12 +471,12 @@ static int pkey_active(struct task_struct *target, const struct user_regset *reg
471471
static int pkey_get(struct task_struct *target, const struct user_regset *regset,
472472
struct membuf to)
473473
{
474-
BUILD_BUG_ON(TSO(amr) + sizeof(unsigned long) != TSO(iamr));
475474

476475
if (!arch_pkeys_enabled())
477476
return -ENODEV;
478477

479-
membuf_write(&to, &target->thread.amr, 2 * sizeof(unsigned long));
478+
membuf_store(&to, target->thread.regs->amr);
479+
membuf_store(&to, target->thread.regs->iamr);
480480
return membuf_store(&to, default_uamor);
481481
}
482482

@@ -509,7 +509,8 @@ static int pkey_set(struct task_struct *target, const struct user_regset *regset
509509
* Pick the AMR values for the keys that kernel is using. This
510510
* will be indicated by the ~default_uamor bits.
511511
*/
512-
target->thread.amr = (new_amr & default_uamor) | (target->thread.amr & ~default_uamor);
512+
target->thread.regs->amr = (new_amr & default_uamor) |
513+
(target->thread.regs->amr & ~default_uamor);
513514

514515
return 0;
515516
}

0 commit comments

Comments
 (0)