[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <3rkCQx0jldz9sBl@ozlabs.org>
Date: Tue, 5 Jul 2016 15:40:40 +1000 (AEST)
From: Michael Ellerman <mpe@...erman.id.au>
To: Simon Guo <wei.guo.simon@...il.com>
Cc: Kees Cook <keescook@...omium.org>,
Simon Guo <wei.guo.simon@...il.com>,
Rashmica Gupta <rashmicy@...il.com>,
linux-kernel@...r.kernel.org,
Simon Guo <simonguo@...ux.vnet.ibm.com>,
Paul Mackerras <paulus@...ba.org>,
Laurent Dufour <ldufour@...ux.vnet.ibm.com>,
linuxppc-dev@...ts.ozlabs.org
Subject: Re: [RESEND, v2] powerpc: Export thread_struct.used_vr/used_vsr to user space
On Wed, 2016-06-04 at 07:00:12 UTC, Simon Guo wrote:
> These 2 fields track whether user process has used Altivec/VSX
> registers or not. They are used by kernel to setup signal frame
> on user stack correctly regarding vector part.
>
> CRIU(Checkpoint and Restore In User space) builds signal frame
> for restored process. It will need this export information to
> setup signal frame correctly. And CRIU will need to restore these
> 2 fields for the restored process.
>
> Signed-off-by: Simon Guo <wei.guo.simon@...il.com>
> Reviewed-by: Laurent Dufour <ldufour@...ux.vnet.ibm.com>
>
> diff --git a/arch/powerpc/include/uapi/asm/ptrace.h b/arch/powerpc/include/uapi/asm/ptrace.h
> index 8036b38..d5afe95 100644
> --- a/arch/powerpc/include/uapi/asm/ptrace.h
> +++ b/arch/powerpc/include/uapi/asm/ptrace.h
> @@ -176,6 +176,17 @@ struct pt_regs {
> #define PTRACE_GETREGS64 0x16
> #define PTRACE_SETREGS64 0x17
>
> +/*
> + * Get or set some register used bit.
> + * The flags will be saved in a 32 bit data.
> + * Currently it is only used for VR/VSR usage.
> + */
> +#define PTRACE_GET_REGS_USAGE 0x1e
> +#define PTRACE_SET_REGS_USAGE 0x1f
> +
> +#define PTRACE_REGS_USAGE_VR_BIT 0x00000001
> +#define PTRACE_REGS_USAGE_VSR_BIT 0x00000002
It looks like you just made up this new ptrace ABI ?
Or is it used on other arches ? (no AFAICS)
How do other arches handle this ?
I'm a bit wary of adding new ptrace ABIs.
If we do want to do this, I'd at least think the mask should be u64, to give us
more capacity to add new registers.
cheers
Powered by blists - more mailing lists