Linus Torvalds <torva...@linux-foundation.org> writes: > On Fri, Aug 7, 2020 at 6:14 AM Michael Ellerman <m...@ellerman.id.au> wrote: >> >> Just one minor conflict, in a comment in drivers/misc/ocxl/config.c. > > Well, this morning I merged the ptrace ->regset_get() updates from Al, > and that brought in a different conflict.
Ah fooey. > I _think_ I resolved it correctly, but while the new model is fairly > readable, the old one sure wasn't, and who knows how messed up my > attempt to sort it out was. I don't know the pkey details on powerpc.. The old API was horrible, nice to see it gone. > So I'd appreciate it if both Al and Aneesh Kumar would check that what > I did to pkey_get() in arch/powerpc/kernel/ptrace/ptrace-view.c makes > sense and works.. It looks right to me, except it doesn't build due to ret now being unused: /linux/arch/powerpc/kernel/ptrace/ptrace-view.c: In function ‘pkey_get’: /linux/arch/powerpc/kernel/ptrace/ptrace-view.c:473:6: error: unused variable ‘ret’ [-Werror=unused-variable] 473 | int ret; Patch below, do you mind taking it directly? With that fixed our pkey selftests pass and show the expected values in those regs. > Side note - it might have been cleaner to just make it do > > membuf_store(&to, target->thread.amr); > membuf_store(&to, target->thread.iamr); > return membuf_store(&to, default_uamor); > > instead of doing that membuf_write() for the first two ones and then > the membuf_store() for the uamor field, but I did what I did to keep > the logic as close to what it used to be as possible. Yep fair enough. > If I messed up, I apologize. > > And if you agree that making it three membuf_store() instead of that > odd "depend on the exact order of the thread struct and pick two > consecutive values", I'll leave that to you as a separate cleanup. Will do. cheers >From a280ae69f248a0f87b36170a94c5665ef5353f51 Mon Sep 17 00:00:00 2001 From: Michael Ellerman <m...@ellerman.id.au> Date: Sat, 8 Aug 2020 09:12:03 +1000 Subject: [PATCH] powerpc/ptrace: Fix build error in pkey_get() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The merge resolution in commit 25d8d4eecace left ret no longer used, leading to: /linux/arch/powerpc/kernel/ptrace/ptrace-view.c: In function ‘pkey_get’: /linux/arch/powerpc/kernel/ptrace/ptrace-view.c:473:6: error: unused variable ‘ret’ 473 | int ret; Fix it by removing ret. Fixes: 25d8d4eecace ("Merge tag 'powerpc-5.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux") Signed-off-by: Michael Ellerman <m...@ellerman.id.au> --- arch/powerpc/kernel/ptrace/ptrace-view.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/powerpc/kernel/ptrace/ptrace-view.c b/arch/powerpc/kernel/ptrace/ptrace-view.c index 19823a250aa0..7e6478e7ed07 100644 --- a/arch/powerpc/kernel/ptrace/ptrace-view.c +++ b/arch/powerpc/kernel/ptrace/ptrace-view.c @@ -470,8 +470,6 @@ static int pkey_active(struct task_struct *target, const struct user_regset *reg static int pkey_get(struct task_struct *target, const struct user_regset *regset, struct membuf to) { - int ret; - BUILD_BUG_ON(TSO(amr) + sizeof(unsigned long) != TSO(iamr)); if (!arch_pkeys_enabled()) -- 2.25.1