[PATCH v2 2/6] powerpc/pkeys: Save the pkey registers before fork
Michael Ellerman
mpe at ellerman.id.au
Tue Jun 19 22:39:56 AEST 2018
Ram Pai <linuxram at us.ibm.com> writes:
> When a thread forks the contents of AMR, IAMR, UAMOR registers in the
> newly forked thread are not inherited.
>
> Save the registers before forking, for content of those
> registers to be automatically copied into the new thread.
>
> CC: Michael Ellerman <mpe at ellerman.id.au>
> CC: Florian Weimer <fweimer at redhat.com>
> CC: Andy Lutomirski <luto at kernel.org>
> CC: Thiago Jung Bauermann <bauerman at linux.ibm.com>
> Signed-off-by: Ram Pai <linuxram at us.ibm.com>
Again this is an ABI change but we'll call it a bug fix I guess.
I'll add:
Fixes: cf43d3b26452 ("powerpc: Enable pkey subsystem")
Cc: stable at vger.kernel.org # v4.16+
cheers
> diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
> index 9ef4aea..991d097 100644
> --- a/arch/powerpc/kernel/process.c
> +++ b/arch/powerpc/kernel/process.c
> @@ -583,6 +583,7 @@ static void save_all(struct task_struct *tsk)
> __giveup_spe(tsk);
>
> msr_check_and_clear(msr_all_available);
> + thread_pkey_regs_save(&tsk->thread);
> }
>
> void flush_all_to_thread(struct task_struct *tsk)
> --
> 1.7.1
More information about the Linuxppc-dev
mailing list