public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] linux/powerpc: sync sys/ptrace.h with Linux 4.15 [BZ #22433, #22807]
@ 2018-02-11  8:36 Dmitry V. Levin
  2018-02-13 16:09 ` Tulio Magno Quites Machado Filho
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry V. Levin @ 2018-02-11  8:36 UTC (permalink / raw)
  To: libc-alpha

The unfortunate consequence of this change is that <sys/ptrace.h> could
no longer be included after <asm/ptrace.h>, and as <signal.h> leads to
inclusion of <asm/ptrace.h> on powerpc, <sys/ptrace.h> could no longer
be included after <signal.h>.

Tested with strace.

[BZ #22433]
[BZ #22807]
* sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h (__ptrace_request): Add
PTRACE_GETREGS, PTRACE_SETREGS, PTRACE_GETFPREGS, PTRACE_SETFPREGS,
PTRACE_GETVRREGS, PTRACE_SETVRREGS, PTRACE_GETEVRREGS,
PTRACE_SETEVRREGS, PTRACE_GETREGS64, PTRACE_SETREGS64,
PTRACE_GET_DEBUGREG, PTRACE_SET_DEBUGREG, PTRACE_GETVSRREGS,
and PTRACE_SETVSRREGS.
---
 ChangeLog                                    | 11 ++++++
 sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h | 58 ++++++++++++++++++++++++++++
 2 files changed, 69 insertions(+)

diff --git a/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h b/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
index 75567b2..dc1fcdb 100644
--- a/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
+++ b/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
@@ -69,6 +69,22 @@ enum __ptrace_request
   PTRACE_SINGLESTEP = 9,
 #define PT_STEP PTRACE_SINGLESTEP
 
+  /* Get all general purpose registers used by a process.  */
+  PTRACE_GETREGS = 12,
+#define PT_GETREGS PTRACE_GETREGS
+
+  /* Set all general purpose registers used by a process.  */
+  PTRACE_SETREGS = 13,
+#define PT_SETREGS PTRACE_SETREGS
+
+  /* Get all floating point registers used by a process.  */
+  PTRACE_GETFPREGS = 14,
+#define PT_GETFPREGS PTRACE_GETFPREGS
+
+  /* Set all floating point registers used by a process.  */
+  PTRACE_SETFPREGS = 15,
+#define PT_SETFPREGS PTRACE_SETFPREGS
+
   /* Attach to a process that is already running. */
   PTRACE_ATTACH = 16,
 #define PT_ATTACH PTRACE_ATTACH
@@ -77,10 +93,52 @@ enum __ptrace_request
   PTRACE_DETACH = 17,
 #define PT_DETACH PTRACE_DETACH
 
+  /* Get all altivec registers used by a process.  */
+  PTRACE_GETVRREGS = 18,
+#define PT_GETVRREGS PTRACE_GETVRREGS
+
+  /* Set all altivec registers used by a process.  */
+  PTRACE_SETVRREGS = 19,
+#define PT_SETVRREGS PTRACE_SETVRREGS
+
+  /* Get all SPE registers used by a process.  */
+  PTRACE_GETEVRREGS = 20,
+#define PT_GETEVRREGS PTRACE_GETEVRREGS
+
+  /* Set all SPE registers used by a process.  */
+  PTRACE_SETEVRREGS = 21,
+#define PT_SETEVRREGS PTRACE_SETEVRREGS
+
+  /* Same as PTRACE_GETREGS except a 32-bit process will obtain
+     the full 64-bit registers.  Implemented by 64-bit kernels only.  */
+  PTRACE_GETREGS64 = 22,
+#define PT_GETREGS64 PTRACE_GETREGS64
+
+  /* Same as PTRACE_SETREGS except a 32-bit process will set
+     the full 64-bit registers.  Implemented by 64-bit kernels only.  */
+  PTRACE_SETREGS64 = 23,
+#define PT_SETREGS64 PTRACE_SETREGS64
+
   /* Continue and stop at the next entry to or return from syscall.  */
   PTRACE_SYSCALL = 24,
 #define PT_SYSCALL PTRACE_SYSCALL
 
+  /* Get a debug register of a process.  */
+  PTRACE_GET_DEBUGREG = 25,
+#define PT_GET_DEBUGREG PTRACE_GET_DEBUGREG
+
+  /* Set a debug register of a process.  */
+  PTRACE_SET_DEBUGREG = 26,
+#define PT_SET_DEBUGREG PTRACE_SET_DEBUGREG
+
+  /* Get all VSX registers of a process.  */
+  PTRACE_GETVSRREGS = 27,
+#define PT_GETVSRREGS PTRACE_GETVSRREGS
+
+  /* Set all VSX registers of a process.  */
+  PTRACE_SETVSRREGS = 28,
+#define PT_SETVSRREGS PTRACE_SETVSRREGS
+
   /* Set ptrace filter options.  */
   PTRACE_SETOPTIONS = 0x4200,
 #define PT_SETOPTIONS PTRACE_SETOPTIONS
-- 
ldv

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] linux/powerpc: sync sys/ptrace.h with Linux 4.15 [BZ #22433, #22807]
  2018-02-11  8:36 [PATCH] linux/powerpc: sync sys/ptrace.h with Linux 4.15 [BZ #22433, #22807] Dmitry V. Levin
@ 2018-02-13 16:09 ` Tulio Magno Quites Machado Filho
  2018-02-15 18:07   ` [PATCH v2] " Dmitry V. Levin
  0 siblings, 1 reply; 4+ messages in thread
From: Tulio Magno Quites Machado Filho @ 2018-02-13 16:09 UTC (permalink / raw)
  To: Dmitry V. Levin, libc-alpha

"Dmitry V. Levin" <ldv@altlinux.org> writes:

> The unfortunate consequence of this change is that <sys/ptrace.h> could
> no longer be included after <asm/ptrace.h>, and as <signal.h> leads to
> inclusion of <asm/ptrace.h> on powerpc, <sys/ptrace.h> could no longer
> be included after <signal.h>.

I have proposed a patch [1] to deal with this.

[1] https://sourceware.org/ml/libc-alpha/2018-02/msg00426.html

> +  /* Get all VSX registers of a process.  */
> +  PTRACE_GETVSRREGS = 27,
> +#define PT_GETVSRREGS PTRACE_GETVSRREGS
> +
> +  /* Set all VSX registers of a process.  */
> +  PTRACE_SETVSRREGS = 28,
> +#define PT_SETVSRREGS PTRACE_SETVSRREGS
> +

Shouldn't this have been "the first 32 VSX registers" instead of "all VSX
registers"?

The patch looks good to me with that change, but I ask you to not merge it
until a fix is merged for the build issue.

Thanks!

-- 
Tulio Magno

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] linux/powerpc: sync sys/ptrace.h with Linux 4.15 [BZ #22433, #22807]
  2018-02-13 16:09 ` Tulio Magno Quites Machado Filho
@ 2018-02-15 18:07   ` Dmitry V. Levin
  2018-02-26 14:20     ` Tulio Magno Quites Machado Filho
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry V. Levin @ 2018-02-15 18:07 UTC (permalink / raw)
  To: Tulio Magno Quites Machado Filho; +Cc: libc-alpha

Tested with strace.

[BZ #22433]
[BZ #22807]
* sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h (__ptrace_request): Add
PTRACE_GETREGS, PTRACE_SETREGS, PTRACE_GETFPREGS, PTRACE_SETFPREGS,
PTRACE_GETVRREGS, PTRACE_SETVRREGS, PTRACE_GETEVRREGS,
PTRACE_SETEVRREGS, PTRACE_GETREGS64, PTRACE_SETREGS64,
PTRACE_GET_DEBUGREG, PTRACE_SET_DEBUGREG, PTRACE_GETVSRREGS,
PTRACE_SETVSRREGS, and PTRACE_SINGLEBLOCK.
---
 v2:
 - added PTRACE_SINGLEBLOCK;
 - fixed comments about PTRACE_GETVSRREGS and PT_SETVSRREGS;
 - removed the note about conflict between <asm/ptrace.h> and <sys/ptrace.h>
   that is going to be fixed by "powerpc: Undefine Linux ptrace macros
   that conflict with __ptrace_request" fix.

 ChangeLog                                    | 11 +++++
 sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h | 62 ++++++++++++++++++++++++++++
 2 files changed, 73 insertions(+)

diff --git a/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h b/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
index 75567b2..5ff65d5 100644
--- a/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
+++ b/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
@@ -69,6 +69,22 @@ enum __ptrace_request
   PTRACE_SINGLESTEP = 9,
 #define PT_STEP PTRACE_SINGLESTEP
 
+  /* Get all general purpose registers used by a process.  */
+  PTRACE_GETREGS = 12,
+#define PT_GETREGS PTRACE_GETREGS
+
+  /* Set all general purpose registers used by a process.  */
+  PTRACE_SETREGS = 13,
+#define PT_SETREGS PTRACE_SETREGS
+
+  /* Get all floating point registers used by a process.  */
+  PTRACE_GETFPREGS = 14,
+#define PT_GETFPREGS PTRACE_GETFPREGS
+
+  /* Set all floating point registers used by a process.  */
+  PTRACE_SETFPREGS = 15,
+#define PT_SETFPREGS PTRACE_SETFPREGS
+
   /* Attach to a process that is already running. */
   PTRACE_ATTACH = 16,
 #define PT_ATTACH PTRACE_ATTACH
@@ -77,10 +93,56 @@ enum __ptrace_request
   PTRACE_DETACH = 17,
 #define PT_DETACH PTRACE_DETACH
 
+  /* Get all altivec registers used by a process.  */
+  PTRACE_GETVRREGS = 18,
+#define PT_GETVRREGS PTRACE_GETVRREGS
+
+  /* Set all altivec registers used by a process.  */
+  PTRACE_SETVRREGS = 19,
+#define PT_SETVRREGS PTRACE_SETVRREGS
+
+  /* Get all SPE registers used by a process.  */
+  PTRACE_GETEVRREGS = 20,
+#define PT_GETEVRREGS PTRACE_GETEVRREGS
+
+  /* Set all SPE registers used by a process.  */
+  PTRACE_SETEVRREGS = 21,
+#define PT_SETEVRREGS PTRACE_SETEVRREGS
+
+  /* Same as PTRACE_GETREGS except a 32-bit process will obtain
+     the full 64-bit registers.  Implemented by 64-bit kernels only.  */
+  PTRACE_GETREGS64 = 22,
+#define PT_GETREGS64 PTRACE_GETREGS64
+
+  /* Same as PTRACE_SETREGS except a 32-bit process will set
+     the full 64-bit registers.  Implemented by 64-bit kernels only.  */
+  PTRACE_SETREGS64 = 23,
+#define PT_SETREGS64 PTRACE_SETREGS64
+
   /* Continue and stop at the next entry to or return from syscall.  */
   PTRACE_SYSCALL = 24,
 #define PT_SYSCALL PTRACE_SYSCALL
 
+  /* Get a debug register of a process.  */
+  PTRACE_GET_DEBUGREG = 25,
+#define PT_GET_DEBUGREG PTRACE_GET_DEBUGREG
+
+  /* Set a debug register of a process.  */
+  PTRACE_SET_DEBUGREG = 26,
+#define PT_SET_DEBUGREG PTRACE_SET_DEBUGREG
+
+  /* Get the first 32 VSX registers of a process.  */
+  PTRACE_GETVSRREGS = 27,
+#define PT_GETVSRREGS PTRACE_GETVSRREGS
+
+  /* Set the first 32 VSX registers of a process.  */
+  PTRACE_SETVSRREGS = 28,
+#define PT_SETVSRREGS PTRACE_SETVSRREGS
+
+  /* Execute process until next taken branch.  */
+  PTRACE_SINGLEBLOCK = 256,
+#define PT_STEPBLOCK PTRACE_SINGLEBLOCK
+
   /* Set ptrace filter options.  */
   PTRACE_SETOPTIONS = 0x4200,
 #define PT_SETOPTIONS PTRACE_SETOPTIONS

-- 
ldv

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] linux/powerpc: sync sys/ptrace.h with Linux 4.15 [BZ #22433, #22807]
  2018-02-15 18:07   ` [PATCH v2] " Dmitry V. Levin
@ 2018-02-26 14:20     ` Tulio Magno Quites Machado Filho
  0 siblings, 0 replies; 4+ messages in thread
From: Tulio Magno Quites Machado Filho @ 2018-02-26 14:20 UTC (permalink / raw)
  To: Dmitry V. Levin; +Cc: libc-alpha

"Dmitry V. Levin" <ldv@altlinux.org> writes:

> Tested with strace.
>
> [BZ #22433]
> [BZ #22807]
> * sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h (__ptrace_request): Add
> PTRACE_GETREGS, PTRACE_SETREGS, PTRACE_GETFPREGS, PTRACE_SETFPREGS,
> PTRACE_GETVRREGS, PTRACE_SETVRREGS, PTRACE_GETEVRREGS,
> PTRACE_SETEVRREGS, PTRACE_GETREGS64, PTRACE_SETREGS64,
> PTRACE_GET_DEBUGREG, PTRACE_SET_DEBUGREG, PTRACE_GETVSRREGS,
> PTRACE_SETVSRREGS, and PTRACE_SINGLEBLOCK.

LGTM.

Thanks!

-- 
Tulio Magno

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-02-26 13:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-11  8:36 [PATCH] linux/powerpc: sync sys/ptrace.h with Linux 4.15 [BZ #22433, #22807] Dmitry V. Levin
2018-02-13 16:09 ` Tulio Magno Quites Machado Filho
2018-02-15 18:07   ` [PATCH v2] " Dmitry V. Levin
2018-02-26 14:20     ` Tulio Magno Quites Machado Filho

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).