public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Detect 64-bit-ness in PowerPC Book III-E
@ 2014-12-11 11:15 Yao Qi
  2014-12-11 15:31 ` Ulrich Weigand
  0 siblings, 1 reply; 12+ messages in thread
From: Yao Qi @ 2014-12-11 11:15 UTC (permalink / raw)
  To: gdb-patches

This patch is to teach GDBServer to detect 64-bit inferior correctly.
We find a problem that GDBServer is unable to detect on an e5500 core
processor.  Current GDBServer assumes that MSR is a 64-bit register,
but MSR is a 32-bit register in Book III-E.  This patch is to fix this
problem by checking both bits in MSR, in order to handle both Book
III-S and Book III-E.

Is it OK?

gdb/gdbserver:

2014-12-11  Yao Qi  <yao@codesourcery.com>

	* linux-ppc-low.c (ppc_arch_setup) [__powerpc64__]: Change
	variable msr to type 'unsigned long'.  Check bit 63 or bit 31
	is one.
---
 gdb/gdbserver/linux-ppc-low.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
index 8fd4b38..0c0ced6 100644
--- a/gdb/gdbserver/linux-ppc-low.c
+++ b/gdb/gdbserver/linux-ppc-low.c
@@ -401,7 +401,7 @@ ppc_arch_setup (void)
 {
   const struct target_desc *tdesc;
 #ifdef __powerpc64__
-  long msr;
+  unsigned long msr;
   struct regcache *regcache;
 
   /* On a 64-bit host, assume 64-bit inferior process with no
@@ -411,13 +411,17 @@ ppc_arch_setup (void)
   current_process ()->tdesc = tdesc;
   ppc_hwcap = 0;
 
-  /* Only if the high bit of the MSR is set, we actually have
-     a 64-bit inferior.  */
+  /* We actually have a 64-bit inferior only if the certain bit of the
+     MSR is set.  The PowerISA Book III-S MSR is different from the
+     PowerISA Book III-E MSR.  The Book III-S MSR is 64 bits wide, and
+     its MSR[SF] is the bit 0 of a 64-bit value.  Book III-E MSR is 32
+     bits wide, and its MSR[CM] is the bit 0 of a 32-bit value.  We check
+     both here.  */
   regcache = new_register_cache (tdesc);
   fetch_inferior_registers (regcache, find_regno (tdesc, "msr"));
   collect_register_by_name (regcache, "msr", &msr);
   free_register_cache (regcache);
-  if (msr < 0)
+  if (msr & 0x8000000080000000)
     {
       ppc_get_hwcap (&ppc_hwcap);
       if (ppc_hwcap & PPC_FEATURE_CELL)
-- 
1.9.3

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

* Re: [PATCH] Detect 64-bit-ness in PowerPC Book III-E
  2014-12-11 11:15 [PATCH] Detect 64-bit-ness in PowerPC Book III-E Yao Qi
@ 2014-12-11 15:31 ` Ulrich Weigand
  2014-12-19  8:06   ` Yao Qi
  0 siblings, 1 reply; 12+ messages in thread
From: Ulrich Weigand @ 2014-12-11 15:31 UTC (permalink / raw)
  To: Yao Qi, anton; +Cc: gdb-patches

Yao Qi wrote:

> This patch is to teach GDBServer to detect 64-bit inferior correctly.
> We find a problem that GDBServer is unable to detect on an e5500 core
> processor.  Current GDBServer assumes that MSR is a 64-bit register,
> but MSR is a 32-bit register in Book III-E.  This patch is to fix this
> problem by checking both bits in MSR, in order to handle both Book
> III-S and Book III-E.

Hmm.  If it actually is Book III-S, then bit 32 is "reserved", so I'm
not sure including it in the check is safe.

Anton, what would you suggest a user program to use to safely detect
whether a ptrace-attached child is 64-bit or not, on either Book III-S
or Book III-E systems?

In any case, whatever we do, we should do both in native GDB and
gdbserver.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com

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

* Re: [PATCH] Detect 64-bit-ness in PowerPC Book III-E
  2014-12-11 15:31 ` Ulrich Weigand
@ 2014-12-19  8:06   ` Yao Qi
  2014-12-19 15:49     ` Ulrich Weigand
  0 siblings, 1 reply; 12+ messages in thread
From: Yao Qi @ 2014-12-19  8:06 UTC (permalink / raw)
  To: Ulrich Weigand; +Cc: anton, gdb-patches

Ulrich Weigand <uweigand@de.ibm.com> writes:

> Hmm.  If it actually is Book III-S, then bit 32 is "reserved", so I'm
> not sure including it in the check is safe.

Yeah, in fact, I borrow such check from strace 4.9.

>
> Anton, what would you suggest a user program to use to safely detect
> whether a ptrace-attached child is 64-bit or not, on either Book III-S
> or Book III-E systems?

Maybe, we can first detect the Book III-S vs. Book III-E, and then
detect 64-bit-ness.  However, I go through PowerISA, but don't find a
way to differentiate Book III-S and Book III-E.

>
> In any case, whatever we do, we should do both in native GDB and
> gdbserver.

Agreed.

-- 
Yao (齐尧)

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

* Re: [PATCH] Detect 64-bit-ness in PowerPC Book III-E
  2014-12-19  8:06   ` Yao Qi
@ 2014-12-19 15:49     ` Ulrich Weigand
  2015-01-11  8:27       ` [PATCH 0/2, V2] " Yao Qi
  0 siblings, 1 reply; 12+ messages in thread
From: Ulrich Weigand @ 2014-12-19 15:49 UTC (permalink / raw)
  To: Yao Qi; +Cc: anton, gdb-patches

Yao Qi wrote:
> Ulrich Weigand <uweigand@de.ibm.com> writes:
> > Anton, what would you suggest a user program to use to safely detect
> > whether a ptrace-attached child is 64-bit or not, on either Book III-S
> > or Book III-E systems?
> 
> Maybe, we can first detect the Book III-S vs. Book III-E, and then
> detect 64-bit-ness.  However, I go through PowerISA, but don't find a
> way to differentiate Book III-S and Book III-E.

Well, on Linux a reliable way should be to check HWCAP for the bit:
#define PPC_FEATURE_BOOKE         0x00008000
This should be true if and only if we're running on any Book E
machine.

Of course, we cannot use the *inferior* process' HWCAP to decide
this, since we need to know the inferior process' wordsize in order
to decode its auxv.  We could use gdbserver's (or native GDB's)
*own* HWCAP to check for Book E, I guess, since this is an
invariant for the whole machine ...


Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com

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

* [PATCH 2/2] Detect 64-bit-ness in PowerPC Book III-E
  2015-01-11  8:27       ` [PATCH 0/2, V2] " Yao Qi
@ 2015-01-11  8:27         ` Yao Qi
  2015-01-13 17:00           ` Ulrich Weigand
  2015-01-11  8:27         ` [PATCH 1/2] Move some ppc macros to nat/ppc-linux.h Yao Qi
  1 sibling, 1 reply; 12+ messages in thread
From: Yao Qi @ 2015-01-11  8:27 UTC (permalink / raw)
  To: gdb-patches

This patch is to teach both GDB and GDBServer to detect 64-bit inferior
correctly.  We find a problem that GDBServer is unable to detect on a
e5500 core processor.  Current GDBServer assumes that MSR is a 64-bit
register, but MSR is a 32-bit register in Book III-E.  This patch is
to fix this problem by checking the right bit in MSR, in order to handle
both Book III-S and Book III-E.  In order to detect Book III-S and
Book III-E, we check the PPC_FEATURE_BOOKE from the host's HWCAP,
because it should an invariant on the same machine cross different
processes.

In order to share code, I add nat/ppc-linux.c for both GDB and
GDBserver side.  Note that this patch only adds ppc-linux.o to
NATDEPFILES in config/powerpc/ppc64-linux.mh, but doesn't add
ppc-linux.o to NATDEPFILES in config/powerpc/linux.mh, because
ppc-linux.o is only needed for ppc64-linux so far.  Once we add
functions for ppc32-linux target in ppc-linux.c in the future,
we can add ppc-linux.o to config/powerpc/linux.mh.

gdb:

2015-01-11  Yao Qi  <yao@codesourcery.com>

	* Makefile.in (ppc-linux.o): New rule.
	* config/powerpc/ppc64-linux.mh (NATDEPFILES): Add ppc-linux.o.
	* nat/ppc-linux.h [__powerpc64__] (ppc64_64bit_inferior_p):
	Declare.
	* nat/ppc-linux.c: New file.
	* ppc-linux-nat.c (ppc_linux_target_wordsize) [__powerpc64__]:
	Call ppc64_64bit_inferior_p.

gdb/gdbserver:

2015-01-11  Yao Qi  <yao@codesourcery.com>

	* Makefile.in (SFILES): Add nat/ppc-linux.c.
	(ppc-linux.o): New rule.
	* configure.srv (powerpc*-*-linux*): Add ppc-linux.o.
	* linux-ppc-low.c (ppc_arch_setup) [__powerpc64__]: Call
	ppc64_64bit_inferior_p
---
 gdb/Makefile.in                   |  4 +++
 gdb/config/powerpc/ppc64-linux.mh |  2 +-
 gdb/gdbserver/Makefile.in         |  5 ++-
 gdb/gdbserver/configure.srv       |  2 +-
 gdb/gdbserver/linux-ppc-low.c     |  4 +--
 gdb/nat/ppc-linux.c               | 69 +++++++++++++++++++++++++++++++++++++++
 gdb/nat/ppc-linux.h               |  6 ++++
 gdb/ppc-linux-nat.c               |  2 +-
 8 files changed, 87 insertions(+), 7 deletions(-)
 create mode 100644 gdb/nat/ppc-linux.c

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index f519f0a..fc1c7fa 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -2271,6 +2271,10 @@ mips-linux-watch.o: ${srcdir}/nat/mips-linux-watch.c
 	$(COMPILE) $(srcdir)/nat/mips-linux-watch.c
 	$(POSTCOMPILE)
 
+ppc-linux.o: ${srcdir}/nat/ppc-linux.c
+	$(COMPILE) $(srcdir)/nat/ppc-linux.c
+	$(POSTCOMPILE)
+
 #
 # gdb/tui/ dependencies
 #
diff --git a/gdb/config/powerpc/ppc64-linux.mh b/gdb/config/powerpc/ppc64-linux.mh
index 4b91408..1b3fbc7 100644
--- a/gdb/config/powerpc/ppc64-linux.mh
+++ b/gdb/config/powerpc/ppc64-linux.mh
@@ -6,7 +6,7 @@ NAT_FILE= config/nm-linux.h
 NATDEPFILES= inf-ptrace.o fork-child.o \
 	ppc-linux-nat.o proc-service.o linux-thread-db.o \
 	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-	linux-waitpid.o
+	linux-waitpid.o ppc-linux.o
 NAT_CDEPS = $(srcdir)/proc-service.list
 
 # The PowerPC has severe limitations on TOC size, and uses them even
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index 1ed2ec8..0e442fc 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -155,7 +155,7 @@ SFILES=	$(srcdir)/gdbreplay.c $(srcdir)/inferiors.c $(srcdir)/dll.c \
 	$(srcdir)/linux-m32r-low.c \
 	$(srcdir)/linux-m68k-low.c $(srcdir)/linux-mips-low.c \
 	$(srcdir)/linux-nios2-low.c \
-	$(srcdir)/linux-ppc-low.c \
+	$(srcdir)/linux-ppc-low.c $(srcdir)/nat/ppc-linux.c \
 	$(srcdir)/linux-s390-low.c \
 	$(srcdir)/linux-sh-low.c $(srcdir)/linux-sparc-low.c \
 	$(srcdir)/linux-x86-low.c \
@@ -581,6 +581,9 @@ linux-waitpid.o: ../nat/linux-waitpid.c
 mips-linux-watch.o: ../nat/mips-linux-watch.c
 	$(COMPILE) $<
 	$(POSTCOMPILE)
+ppc-linux.o: ../nat/ppc-linux.c
+	$(COMPILE) $<
+	$(POSTCOMPILE)
 
 aarch64.c : $(srcdir)/../regformats/aarch64.dat $(regdat_sh)
 	$(SHELL) $(regdat_sh) $(srcdir)/../regformats/aarch64.dat aarch64.c
diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv
index 679fc9f..f52aee2 100644
--- a/gdb/gdbserver/configure.srv
+++ b/gdb/gdbserver/configure.srv
@@ -217,7 +217,7 @@ case "${target}" in
 			srv_regobj="${srv_regobj} powerpc-isa205-64l.o"
 			srv_regobj="${srv_regobj} powerpc-isa205-altivec64l.o"
 			srv_regobj="${srv_regobj} powerpc-isa205-vsx64l.o"
-			srv_tgtobj="$srv_linux_obj linux-ppc-low.o"
+			srv_tgtobj="$srv_linux_obj linux-ppc-low.o ppc-linux.o"
 			srv_xmlfiles="rs6000/powerpc-32l.xml"
 			srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-altivec32l.xml"
 			srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-cell32l.xml"
diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
index 6e880c1..188fac0 100644
--- a/gdb/gdbserver/linux-ppc-low.c
+++ b/gdb/gdbserver/linux-ppc-low.c
@@ -398,13 +398,11 @@ ppc_arch_setup (void)
   current_process ()->tdesc = tdesc;
   ppc_hwcap = 0;
 
-  /* Only if the high bit of the MSR is set, we actually have
-     a 64-bit inferior.  */
   regcache = new_register_cache (tdesc);
   fetch_inferior_registers (regcache, find_regno (tdesc, "msr"));
   collect_register_by_name (regcache, "msr", &msr);
   free_register_cache (regcache);
-  if (msr < 0)
+  if (ppc64_64bit_inferior_p (msr))
     {
       ppc_get_hwcap (&ppc_hwcap);
       if (ppc_hwcap & PPC_FEATURE_CELL)
diff --git a/gdb/nat/ppc-linux.c b/gdb/nat/ppc-linux.c
new file mode 100644
index 0000000..f6eaab2
--- /dev/null
+++ b/gdb/nat/ppc-linux.c
@@ -0,0 +1,69 @@
+/*Copyright (C) 2015 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include "common-defs.h"
+#include "ppc-linux.h"
+#include <elf.h>
+
+#ifdef __powerpc64__
+
+/* Get the HWCAP from the process of GDB or GDBserver.  If success,
+   save it in *VALP.   */
+
+static void
+ppc64_host_hwcap (unsigned long *valp)
+{
+  unsigned char data[2 * 8];
+  FILE *f = fopen ("/proc/self/auxv", "r");
+
+  if (f == NULL)
+    return;
+
+  while (fread (data, sizeof (data), 1, f) > 0)
+    {
+      unsigned long *data_p = (unsigned long *) data;
+
+      if (data_p[0] == AT_HWCAP)
+	{
+	  *valp = data_p[1];
+	  break;
+	}
+    }
+
+  fclose (f);
+}
+
+int
+ppc64_64bit_inferior_p (long msr)
+{
+  unsigned long ppc_host_hwcap = 0;
+
+  /* Get host's HWCAP to check whether the machine is Book E.  */
+  ppc64_host_hwcap (&ppc_host_hwcap);
+
+  /* We actually have a 64-bit inferior only if the certain bit of the
+     MSR is set.  The PowerISA Book III-S MSR is different from the
+     PowerISA Book III-E MSR.  The Book III-S MSR is 64 bits wide, and
+     its MSR[SF] is the bit 0 of a 64-bit value.  Book III-E MSR is 32
+     bits wide, and its MSR[CM] is the bit 0 of a 32-bit value.   */
+  if (ppc_host_hwcap & PPC_FEATURE_BOOKE)
+    return msr & 0x80000000;
+  else
+    return msr < 0;
+}
+
+#endif
diff --git a/gdb/nat/ppc-linux.h b/gdb/nat/ppc-linux.h
index 30d936f..0ff2223 100644
--- a/gdb/nat/ppc-linux.h
+++ b/gdb/nat/ppc-linux.h
@@ -82,4 +82,10 @@
 #define PTRACE_SETEVRREGS 21
 #endif
 
+#ifdef __powerpc64__
+/* Return whether the inferior is 64bit or not by checking certain bit
+   in MSR.  */
+int ppc64_64bit_inferior_p (long msr);
+#endif
+
 #endif
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index c5a286b..88ca49e 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -2367,7 +2367,7 @@ ppc_linux_target_wordsize (void)
 
   errno = 0;
   msr = (long) ptrace (PTRACE_PEEKUSER, tid, PT_MSR * 8, 0);
-  if (errno == 0 && msr < 0)
+  if (errno == 0 && ppc64_64bit_inferior_p (msr))
     wordsize = 8;
 #endif
 
-- 
1.9.3

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

* [PATCH 1/2] Move some ppc macros to nat/ppc-linux.h
  2015-01-11  8:27       ` [PATCH 0/2, V2] " Yao Qi
  2015-01-11  8:27         ` [PATCH 2/2] " Yao Qi
@ 2015-01-11  8:27         ` Yao Qi
  2015-01-13 16:57           ` Ulrich Weigand
  1 sibling, 1 reply; 12+ messages in thread
From: Yao Qi @ 2015-01-11  8:27 UTC (permalink / raw)
  To: gdb-patches

When I use PPC_FEATURE_BOOKE in GDBserver, I find it is defined in GDB
but not in GDBserver.  After taking a further look, I find some macros
are duplicated between ppc-linux-nat.c and linux-ppc-low.c, so this
patch is to move them into nat/ppc-linux.h.

gdb/gdbserver:

2015-01-11  Yao Qi  <yao@codesourcery.com>

	* linux-ppc-low.c: Include "nat/ppc-linux.h".
	 (PPC_FEATURE_HAS_VSX): Move to nat/ppc-linux.h.
	(PPC_FEATURE_HAS_ALTIVEC,  PPC_FEATURE_HAS_SPE): Likewise.
	(PT_ORIG_R3, PT_TRAP): Likewise.
	(PTRACE_GETVSXREGS, PTRACE_SETVSXREGS): Likewise.
	(PTRACE_GETVRREGS, PTRACE_SETVRREGS): Likewise.
	(PTRACE_GETEVRREGS, PTRACE_SETEVRREGS): Likewise.

gdb:

2015-01-11  Yao Qi  <yao@codesourcery.com>

	* ppc-linux-nat.c (PT_ORIG_R3, PT_TRAP): Move to
	nat/ppc-linux.h.
	(PPC_FEATURE_CELL, PPC_FEATURE_BOOKE): Likewise.
	(PPC_FEATURE_HAS_DFP): Likewise.
	(PTRACE_GETVRREGS, PTRACE_SETVRREGS): Likewise.
	(PTRACE_GETVSXREGS, PTRACE_SETVSXREGS): Likewise.
	(PTRACE_GETEVRREGS, PTRACE_SETEVRREGS): Likewise.
	Include "nat/ppc-linux.h".
	* nat/ppc-linux.h: New file.
	* Makefile.in (HFILES_NO_SRCDIR): Add nat/ppc-linux.h.
---
 gdb/Makefile.in               |  2 +-
 gdb/gdbserver/linux-ppc-low.c | 30 +--------------
 gdb/nat/ppc-linux.h           | 85 +++++++++++++++++++++++++++++++++++++++++++
 gdb/ppc-linux-nat.c           | 52 +-------------------------
 4 files changed, 88 insertions(+), 81 deletions(-)
 create mode 100644 gdb/nat/ppc-linux.h

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 5dae3e6..f519f0a 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -955,7 +955,7 @@ common/common-utils.h common/xml-utils.h common/buffer.h common/ptid.h \
 common/format.h common/host-defs.h utils.h common/queue.h \
 nat/linux-osdata.h gdb-dlfcn.h auto-load.h probe.h stap-probe.h \
 gdb_bfd.h sparc-ravenscar-thread.h ppc-ravenscar-thread.h nat/linux-btrace.h \
-ctf.h nat/x86-cpuid.h nat/x86-gcc-cpuid.h target/resume.h \
+nat/ppc-linux.h ctf.h nat/x86-cpuid.h nat/x86-gcc-cpuid.h target/resume.h \
 target/wait.h target/waitstatus.h nat/linux-nat.h nat/linux-waitpid.h \
 common/print-utils.h common/rsp-low.h nat/x86-dregs.h x86-linux-nat.h \
 i386-linux-nat.h common/common-defs.h common/errors.h common/common-types.h \
diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
index 697fa6c..6e880c1 100644
--- a/gdb/gdbserver/linux-ppc-low.c
+++ b/gdb/gdbserver/linux-ppc-low.c
@@ -23,12 +23,7 @@
 #include <elf.h>
 #include <asm/ptrace.h>
 
-/* These are in <asm/cputable.h> in current kernels.  */
-#define PPC_FEATURE_HAS_VSX		0x00000080
-#define PPC_FEATURE_HAS_ALTIVEC         0x10000000
-#define PPC_FEATURE_HAS_SPE             0x00800000
-#define PPC_FEATURE_CELL                0x00010000
-#define PPC_FEATURE_HAS_DFP             0x00000400
+#include "nat/ppc-linux.h"
 
 static unsigned long ppc_hwcap;
 
@@ -95,14 +90,6 @@ extern const struct target_desc *tdesc_powerpc_isa205_vsx64l;
 
 #define ppc_num_regs 73
 
-/* This sometimes isn't defined.  */
-#ifndef PT_ORIG_R3
-#define PT_ORIG_R3 34
-#endif
-#ifndef PT_TRAP
-#define PT_TRAP 40
-#endif
-
 #ifdef __powerpc64__
 /* We use a constant for FPSCR instead of PT_FPSCR, because
    many shipped PPC64 kernels had the wrong value in ptrace.h.  */
@@ -544,11 +531,6 @@ static void ppc_fill_gregset (struct regcache *regcache, void *buf)
     ppc_collect_ptrace_register (regcache, i, (char *) buf + ppc_regmap[i]);
 }
 
-#ifndef PTRACE_GETVSXREGS
-#define PTRACE_GETVSXREGS 27
-#define PTRACE_SETVSXREGS 28
-#endif
-
 #define SIZEOF_VSXREGS 32*8
 
 static void
@@ -579,11 +561,6 @@ ppc_store_vsxregset (struct regcache *regcache, const void *buf)
     supply_register (regcache, base + i, &regset[i * 8]);
 }
 
-#ifndef PTRACE_GETVRREGS
-#define PTRACE_GETVRREGS 18
-#define PTRACE_SETVRREGS 19
-#endif
-
 #define SIZEOF_VRREGS 33*16+4
 
 static void
@@ -620,11 +597,6 @@ ppc_store_vrregset (struct regcache *regcache, const void *buf)
   supply_register_by_name (regcache, "vrsave", &regset[33 * 16]);
 }
 
-#ifndef PTRACE_GETEVRREGS
-#define PTRACE_GETEVRREGS	20
-#define PTRACE_SETEVRREGS	21
-#endif
-
 struct gdb_evrregset_t
 {
   unsigned long evr[32];
diff --git a/gdb/nat/ppc-linux.h b/gdb/nat/ppc-linux.h
new file mode 100644
index 0000000..30d936f
--- /dev/null
+++ b/gdb/nat/ppc-linux.h
@@ -0,0 +1,85 @@
+/* Copyright (C) 1995-2015 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef PPC_LINUX_H
+#define PPC_LINUX_H 1
+
+#include <asm/ptrace.h>
+#include <asm/cputable.h>
+
+/* This sometimes isn't defined.  */
+#ifndef PT_ORIG_R3
+#define PT_ORIG_R3 34
+#endif
+#ifndef PT_TRAP
+#define PT_TRAP 40
+#endif
+
+/* The PPC_FEATURE_* defines should be provided by <asm/cputable.h>.
+   If they aren't, we can provide them ourselves (their values are fixed
+   because they are part of the kernel ABI).  They are used in the AT_HWCAP
+   entry of the AUXV.  */
+#ifndef PPC_FEATURE_CELL
+#define PPC_FEATURE_CELL 0x00010000
+#endif
+#ifndef PPC_FEATURE_BOOKE
+#define PPC_FEATURE_BOOKE 0x00008000
+#endif
+#ifndef PPC_FEATURE_HAS_DFP
+#define PPC_FEATURE_HAS_DFP	0x00000400  /* Decimal Floating Point.  */
+#endif
+#ifndef PPC_FEATURE_HAS_VSX
+#define PPC_FEATURE_HAS_VSX 0x00000080
+#endif
+#ifndef PPC_FEATURE_HAS_ALTIVEC
+#define PPC_FEATURE_HAS_ALTIVEC 0x10000000
+#endif
+#ifndef PPC_FEATURE_HAS_SPE
+#define PPC_FEATURE_HAS_SPE 0x00800000
+#endif
+
+/* Glibc's headers don't define PTRACE_GETVRREGS so we cannot use a
+   configure time check.  Some older glibc's (for instance 2.2.1)
+   don't have a specific powerpc version of ptrace.h, and fall back on
+   a generic one.  In such cases, sys/ptrace.h defines
+   PTRACE_GETFPXREGS and PTRACE_SETFPXREGS to the same numbers that
+   ppc kernel's asm/ptrace.h defines PTRACE_GETVRREGS and
+   PTRACE_SETVRREGS to be.  This also makes a configury check pretty
+   much useless.  */
+
+/* These definitions should really come from the glibc header files,
+   but Glibc doesn't know about the vrregs yet.  */
+#ifndef PTRACE_GETVRREGS
+#define PTRACE_GETVRREGS 18
+#define PTRACE_SETVRREGS 19
+#endif
+
+/* PTRACE requests for POWER7 VSX registers.  */
+#ifndef PTRACE_GETVSXREGS
+#define PTRACE_GETVSXREGS 27
+#define PTRACE_SETVSXREGS 28
+#endif
+
+/* Similarly for the ptrace requests for getting / setting the SPE
+   registers (ev0 -- ev31, acc, and spefscr).  See the description of
+   gdb_evrregset_t for details.  */
+#ifndef PTRACE_GETEVRREGS
+#define PTRACE_GETEVRREGS 20
+#define PTRACE_SETEVRREGS 21
+#endif
+
+#endif
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index ce78b36..c5a286b 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -46,57 +46,7 @@
 #include "elf/common.h"
 #include "auxv.h"
 
-/* This sometimes isn't defined.  */
-#ifndef PT_ORIG_R3
-#define PT_ORIG_R3 34
-#endif
-#ifndef PT_TRAP
-#define PT_TRAP 40
-#endif
-
-/* The PPC_FEATURE_* defines should be provided by <asm/cputable.h>.
-   If they aren't, we can provide them ourselves (their values are fixed
-   because they are part of the kernel ABI).  They are used in the AT_HWCAP
-   entry of the AUXV.  */
-#ifndef PPC_FEATURE_CELL
-#define PPC_FEATURE_CELL 0x00010000
-#endif
-#ifndef PPC_FEATURE_BOOKE
-#define PPC_FEATURE_BOOKE 0x00008000
-#endif
-#ifndef PPC_FEATURE_HAS_DFP
-#define PPC_FEATURE_HAS_DFP	0x00000400  /* Decimal Floating Point.  */
-#endif
-
-/* Glibc's headers don't define PTRACE_GETVRREGS so we cannot use a
-   configure time check.  Some older glibc's (for instance 2.2.1)
-   don't have a specific powerpc version of ptrace.h, and fall back on
-   a generic one.  In such cases, sys/ptrace.h defines
-   PTRACE_GETFPXREGS and PTRACE_SETFPXREGS to the same numbers that
-   ppc kernel's asm/ptrace.h defines PTRACE_GETVRREGS and
-   PTRACE_SETVRREGS to be.  This also makes a configury check pretty
-   much useless.  */
-
-/* These definitions should really come from the glibc header files,
-   but Glibc doesn't know about the vrregs yet.  */
-#ifndef PTRACE_GETVRREGS
-#define PTRACE_GETVRREGS 18
-#define PTRACE_SETVRREGS 19
-#endif
-
-/* PTRACE requests for POWER7 VSX registers.  */
-#ifndef PTRACE_GETVSXREGS
-#define PTRACE_GETVSXREGS 27
-#define PTRACE_SETVSXREGS 28
-#endif
-
-/* Similarly for the ptrace requests for getting / setting the SPE
-   registers (ev0 -- ev31, acc, and spefscr).  See the description of
-   gdb_evrregset_t for details.  */
-#ifndef PTRACE_GETEVRREGS
-#define PTRACE_GETEVRREGS 20
-#define PTRACE_SETEVRREGS 21
-#endif
+#include "nat/ppc-linux.h"
 
 /* Similarly for the hardware watchpoint support.  These requests are used
    when the PowerPC HWDEBUG ptrace interface is not available.  */
-- 
1.9.3

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

* [PATCH 0/2, V2] Detect 64-bit-ness in PowerPC Book III-E
  2014-12-19 15:49     ` Ulrich Weigand
@ 2015-01-11  8:27       ` Yao Qi
  2015-01-11  8:27         ` [PATCH 2/2] " Yao Qi
  2015-01-11  8:27         ` [PATCH 1/2] Move some ppc macros to nat/ppc-linux.h Yao Qi
  0 siblings, 2 replies; 12+ messages in thread
From: Yao Qi @ 2015-01-11  8:27 UTC (permalink / raw)
  To: gdb-patches

This patch is the V2 of https://sourceware.org/ml/gdb-patches/2014-12/msg00239.html
In V2, we check the different bit of register MSR on Book III-E and
Book III-S.  In order to differentiate Book III-E and Book III-S, we
check the PPC_FEATURE_BOOKE from host's HWCAP, as Ulrich suggested.
Patch 1 is to move common macros into nat/ppc-linux.h, and patch 2
is the major part of this series.

Regression tested on powerpc-linux with GDBserver.  Native powerpc
gdb isn't tested.  Is it OK?

*** BLURB HERE ***

Yao Qi (2):
  Move some ppc macros to nat/ppc-linux.h
  Detect 64-bit-ness in PowerPC Book III-E

 gdb/Makefile.in                   |  6 ++-
 gdb/config/powerpc/ppc64-linux.mh |  2 +-
 gdb/gdbserver/Makefile.in         |  5 ++-
 gdb/gdbserver/configure.srv       |  2 +-
 gdb/gdbserver/linux-ppc-low.c     | 34 +--------------
 gdb/nat/ppc-linux.c               | 69 ++++++++++++++++++++++++++++++
 gdb/nat/ppc-linux.h               | 88 +++++++++++++++++++++++++++++++++++++++
 gdb/ppc-linux-nat.c               | 54 +-----------------------
 8 files changed, 172 insertions(+), 88 deletions(-)
 create mode 100644 gdb/nat/ppc-linux.c
 create mode 100644 gdb/nat/ppc-linux.h

-- 
1.9.3

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

* Re: [PATCH 1/2] Move some ppc macros to nat/ppc-linux.h
  2015-01-11  8:27         ` [PATCH 1/2] Move some ppc macros to nat/ppc-linux.h Yao Qi
@ 2015-01-13 16:57           ` Ulrich Weigand
  0 siblings, 0 replies; 12+ messages in thread
From: Ulrich Weigand @ 2015-01-13 16:57 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

Yao Qi wrote:

> gdb/gdbserver:
> 
> 2015-01-11  Yao Qi  <yao@codesourcery.com>
> 
> 	* linux-ppc-low.c: Include "nat/ppc-linux.h".
> 	 (PPC_FEATURE_HAS_VSX): Move to nat/ppc-linux.h.
> 	(PPC_FEATURE_HAS_ALTIVEC,  PPC_FEATURE_HAS_SPE): Likewise.
> 	(PT_ORIG_R3, PT_TRAP): Likewise.
> 	(PTRACE_GETVSXREGS, PTRACE_SETVSXREGS): Likewise.
> 	(PTRACE_GETVRREGS, PTRACE_SETVRREGS): Likewise.
> 	(PTRACE_GETEVRREGS, PTRACE_SETEVRREGS): Likewise.
> 
> gdb:
> 
> 2015-01-11  Yao Qi  <yao@codesourcery.com>
> 
> 	* ppc-linux-nat.c (PT_ORIG_R3, PT_TRAP): Move to
> 	nat/ppc-linux.h.
> 	(PPC_FEATURE_CELL, PPC_FEATURE_BOOKE): Likewise.
> 	(PPC_FEATURE_HAS_DFP): Likewise.
> 	(PTRACE_GETVRREGS, PTRACE_SETVRREGS): Likewise.
> 	(PTRACE_GETVSXREGS, PTRACE_SETVSXREGS): Likewise.
> 	(PTRACE_GETEVRREGS, PTRACE_SETEVRREGS): Likewise.
> 	Include "nat/ppc-linux.h".
> 	* nat/ppc-linux.h: New file.
> 	* Makefile.in (HFILES_NO_SRCDIR): Add nat/ppc-linux.h.

This is OK.

Thanks,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com

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

* Re: [PATCH 2/2] Detect 64-bit-ness in PowerPC Book III-E
  2015-01-11  8:27         ` [PATCH 2/2] " Yao Qi
@ 2015-01-13 17:00           ` Ulrich Weigand
  2015-01-14  2:54             ` Yao Qi
  0 siblings, 1 reply; 12+ messages in thread
From: Ulrich Weigand @ 2015-01-13 17:00 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

Yao Qi wrote:

> gdb:
> 
> 2015-01-11  Yao Qi  <yao@codesourcery.com>
> 
> 	* Makefile.in (ppc-linux.o): New rule.
> 	* config/powerpc/ppc64-linux.mh (NATDEPFILES): Add ppc-linux.o.
> 	* nat/ppc-linux.h [__powerpc64__] (ppc64_64bit_inferior_p):
> 	Declare.
> 	* nat/ppc-linux.c: New file.
> 	* ppc-linux-nat.c (ppc_linux_target_wordsize) [__powerpc64__]:
> 	Call ppc64_64bit_inferior_p.
> 
> gdb/gdbserver:
> 
> 2015-01-11  Yao Qi  <yao@codesourcery.com>
> 
> 	* Makefile.in (SFILES): Add nat/ppc-linux.c.
> 	(ppc-linux.o): New rule.
> 	* configure.srv (powerpc*-*-linux*): Add ppc-linux.o.
> 	* linux-ppc-low.c (ppc_arch_setup) [__powerpc64__]: Call
> 	ppc64_64bit_inferior_p

This is OK in principle, however:

> +static void
> +ppc64_host_hwcap (unsigned long *valp)
> +{
> +  unsigned char data[2 * 8];
> +  FILE *f = fopen ("/proc/self/auxv", "r");
> +
> +  if (f == NULL)
> +    return;
> +
> +  while (fread (data, sizeof (data), 1, f) > 0)
> +    {
> +      unsigned long *data_p = (unsigned long *) data;
> +
> +      if (data_p[0] == AT_HWCAP)
> +	{
> +	  *valp = data_p[1];
> +	  break;
> +	}
> +    }
> +
> +  fclose (f);
> +}

All this can be done using "getauxval (AT_HWCAP)", which is faster and works
even if /proc is not mounted.  However, getauxval was only introduced with
glibc 2.16, so we'll probably still need the fallback ...

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com

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

* Re: [PATCH 2/2] Detect 64-bit-ness in PowerPC Book III-E
  2015-01-13 17:00           ` Ulrich Weigand
@ 2015-01-14  2:54             ` Yao Qi
  2015-01-14 12:47               ` Ulrich Weigand
  0 siblings, 1 reply; 12+ messages in thread
From: Yao Qi @ 2015-01-14  2:54 UTC (permalink / raw)
  To: Ulrich Weigand; +Cc: gdb-patches

Ulrich Weigand <uweigand@de.ibm.com> writes:

> All this can be done using "getauxval (AT_HWCAP)", which is faster and works
> even if /proc is not mounted.  However, getauxval was only introduced with
> glibc 2.16, so we'll probably still need the fallback ...

In the updated patch below, I add configure check to function
getauxval.  If it exists, we use getauxval, otherwise fallback to
parsing /proc/self/auxv.  Manually test gdbserver and it works well.  My
target glibc is >= 2.16, so getauxval path is tested.

Is the patch OK?

-- 
Yao (齐尧)
Subject: [PATCH] Detect 64-bit-ness in PowerPC Book III-E

This patch is to teach both GDB and GDBServer to detect 64-bit inferior
correctly.  We find a problem that GDBServer is unable to detect on a
e5500 core processor.  Current GDBServer assumes that MSR is a 64-bit
register, but MSR is a 32-bit register in Book III-E.  This patch is
to fix this problem by checking the right bit in MSR, in order to handle
both Book III-S and Book III-E.  In order to detect Book III-S and
Book III-E, we check the PPC_FEATURE_BOOKE from the host's HWCAP (by
getauxval on glibc >= 2.16.  If getauxval doesn't exist, we implement
the fallback by parsing /proc/self/auxv), because it should an invariant
on the same machine cross different processes.

In order to share code, I add nat/ppc-linux.c for both GDB and
GDBserver side.

gdb:

2015-01-14  Yao Qi  <yao@codesourcery.com>

	* Makefile.in (ppc-linux.o): New rule.
	* config/powerpc/ppc64-linux.mh (NATDEPFILES): Add ppc-linux.o.
	* configure.ac: AC_CHECK_FUNCS(getauxval).
	* config.in: Re-generated.
	* configure: Re-generated.
	* nat/ppc-linux.h [__powerpc64__] (ppc64_64bit_inferior_p):
	Declare.
	* nat/ppc-linux.c: New file.
	* ppc-linux-nat.c (ppc_linux_target_wordsize) [__powerpc64__]:
	Call ppc64_64bit_inferior_p.

gdb/gdbserver:

2015-01-14  Yao Qi  <yao@codesourcery.com>

	* Makefile.in (SFILES): Add nat/ppc-linux.c.
	(ppc-linux.o): New rule.
	* configure.srv (powerpc*-*-linux*): Add ppc-linux.o.
	* configure.ac: AC_CHECK_FUNCS(getauxval).
	* config.in: Re-generated.
	* configure: Re-generated.
	* linux-ppc-low.c (ppc_arch_setup) [__powerpc64__]: Call
	ppc64_64bit_inferior_p

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index f519f0a..fc1c7fa 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -2271,6 +2271,10 @@ mips-linux-watch.o: ${srcdir}/nat/mips-linux-watch.c
 	$(COMPILE) $(srcdir)/nat/mips-linux-watch.c
 	$(POSTCOMPILE)
 
+ppc-linux.o: ${srcdir}/nat/ppc-linux.c
+	$(COMPILE) $(srcdir)/nat/ppc-linux.c
+	$(POSTCOMPILE)
+
 #
 # gdb/tui/ dependencies
 #
diff --git a/gdb/config.in b/gdb/config.in
index 9d3f32d..806cbac 100644
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -138,6 +138,9 @@
 /* Define if <sys/procfs.h> has fpregset_t. */
 #undef HAVE_FPREGSET_T
 
+/* Define to 1 if you have the `getauxval' function. */
+#undef HAVE_GETAUXVAL
+
 /* Define to 1 if you have the `getgid' function. */
 #undef HAVE_GETGID
 
diff --git a/gdb/config/powerpc/ppc64-linux.mh b/gdb/config/powerpc/ppc64-linux.mh
index 4b91408..1b3fbc7 100644
--- a/gdb/config/powerpc/ppc64-linux.mh
+++ b/gdb/config/powerpc/ppc64-linux.mh
@@ -6,7 +6,7 @@ NAT_FILE= config/nm-linux.h
 NATDEPFILES= inf-ptrace.o fork-child.o \
 	ppc-linux-nat.o proc-service.o linux-thread-db.o \
 	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-	linux-waitpid.o
+	linux-waitpid.o ppc-linux.o
 NAT_CDEPS = $(srcdir)/proc-service.list
 
 # The PowerPC has severe limitations on TOC size, and uses them even
diff --git a/gdb/configure b/gdb/configure
index 7ff74ba..661d8a7 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -10509,6 +10509,19 @@ _ACEOF
 fi
 done
 
+# glibc >= 2.16 provides getauxval().
+for ac_func in getauxval
+do :
+  ac_fn_c_check_func "$LINENO" "getauxval" "ac_cv_func_getauxval"
+if test "x$ac_cv_func_getauxval" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_GETAUXVAL 1
+_ACEOF
+
+fi
+done
+
+
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5
 $as_echo_n "checking for nl_langinfo and CODESET... " >&6; }
diff --git a/gdb/configure.ac b/gdb/configure.ac
index ec776d7..dadaf76 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1318,6 +1318,9 @@ AC_CHECK_FUNCS([getrusage getuid getgid \
 		ttrace wborder wresize setlocale iconvlist libiconvlist btowc \
 		setrlimit getrlimit posix_madvise waitpid \
 		ptrace64 sigaltstack mkdtemp])
+# glibc >= 2.16 provides getauxval().
+AC_CHECK_FUNCS(getauxval)
+
 AM_LANGINFO_CODESET
 GDB_AC_COMMON
 
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index 1ed2ec8..0e442fc 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -155,7 +155,7 @@ SFILES=	$(srcdir)/gdbreplay.c $(srcdir)/inferiors.c $(srcdir)/dll.c \
 	$(srcdir)/linux-m32r-low.c \
 	$(srcdir)/linux-m68k-low.c $(srcdir)/linux-mips-low.c \
 	$(srcdir)/linux-nios2-low.c \
-	$(srcdir)/linux-ppc-low.c \
+	$(srcdir)/linux-ppc-low.c $(srcdir)/nat/ppc-linux.c \
 	$(srcdir)/linux-s390-low.c \
 	$(srcdir)/linux-sh-low.c $(srcdir)/linux-sparc-low.c \
 	$(srcdir)/linux-x86-low.c \
@@ -581,6 +581,9 @@ linux-waitpid.o: ../nat/linux-waitpid.c
 mips-linux-watch.o: ../nat/mips-linux-watch.c
 	$(COMPILE) $<
 	$(POSTCOMPILE)
+ppc-linux.o: ../nat/ppc-linux.c
+	$(COMPILE) $<
+	$(POSTCOMPILE)
 
 aarch64.c : $(srcdir)/../regformats/aarch64.dat $(regdat_sh)
 	$(SHELL) $(regdat_sh) $(srcdir)/../regformats/aarch64.dat aarch64.c
diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in
index fd80adc..8f68ed2 100644
--- a/gdb/gdbserver/config.in
+++ b/gdb/gdbserver/config.in
@@ -60,6 +60,9 @@
 /* Define to 1 if you have the `fdwalk' function. */
 #undef HAVE_FDWALK
 
+/* Define to 1 if you have the `getauxval' function. */
+#undef HAVE_GETAUXVAL
+
 /* Define to 1 if you have the `getrlimit' function. */
 #undef HAVE_GETRLIMIT
 
diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
index 45efc51..14594ec 100755
--- a/gdb/gdbserver/configure
+++ b/gdb/gdbserver/configure
@@ -4758,6 +4758,18 @@ _ACEOF
 fi
 done
 
+# glibc >= 2.16 provides getauxval().
+for ac_func in getauxval
+do :
+  ac_fn_c_check_func "$LINENO" "getauxval" "ac_cv_func_getauxval"
+if test "x$ac_cv_func_getauxval" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_GETAUXVAL 1
+_ACEOF
+
+fi
+done
+
 
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index 02082cc..93a5ed1 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -91,6 +91,8 @@ AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h string.h dnl
 		 sys/ioctl.h netinet/in.h sys/socket.h netdb.h dnl
 		 netinet/tcp.h arpa/inet.h)
 AC_CHECK_FUNCS(pread pwrite pread64)
+# glibc >= 2.16 provides getauxval().
+AC_CHECK_FUNCS(getauxval)
 
 GDB_AC_COMMON
 
diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv
index 679fc9f..f52aee2 100644
--- a/gdb/gdbserver/configure.srv
+++ b/gdb/gdbserver/configure.srv
@@ -217,7 +217,7 @@ case "${target}" in
 			srv_regobj="${srv_regobj} powerpc-isa205-64l.o"
 			srv_regobj="${srv_regobj} powerpc-isa205-altivec64l.o"
 			srv_regobj="${srv_regobj} powerpc-isa205-vsx64l.o"
-			srv_tgtobj="$srv_linux_obj linux-ppc-low.o"
+			srv_tgtobj="$srv_linux_obj linux-ppc-low.o ppc-linux.o"
 			srv_xmlfiles="rs6000/powerpc-32l.xml"
 			srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-altivec32l.xml"
 			srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-cell32l.xml"
diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
index 6e880c1..188fac0 100644
--- a/gdb/gdbserver/linux-ppc-low.c
+++ b/gdb/gdbserver/linux-ppc-low.c
@@ -398,13 +398,11 @@ ppc_arch_setup (void)
   current_process ()->tdesc = tdesc;
   ppc_hwcap = 0;
 
-  /* Only if the high bit of the MSR is set, we actually have
-     a 64-bit inferior.  */
   regcache = new_register_cache (tdesc);
   fetch_inferior_registers (regcache, find_regno (tdesc, "msr"));
   collect_register_by_name (regcache, "msr", &msr);
   free_register_cache (regcache);
-  if (msr < 0)
+  if (ppc64_64bit_inferior_p (msr))
     {
       ppc_get_hwcap (&ppc_hwcap);
       if (ppc_hwcap & PPC_FEATURE_CELL)
diff --git a/gdb/nat/ppc-linux.c b/gdb/nat/ppc-linux.c
new file mode 100644
index 0000000..a29c9bd
--- /dev/null
+++ b/gdb/nat/ppc-linux.c
@@ -0,0 +1,77 @@
+/*Copyright (C) 2015 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include "common-defs.h"
+#include "ppc-linux.h"
+#include <elf.h>
+
+#ifdef HAVE_GETAUXVAL
+#include <sys/auxv.h>
+#endif
+
+#ifdef __powerpc64__
+
+/* Get the HWCAP from the process of GDB or GDBserver.  If success,
+   save it in *VALP.   */
+
+static void
+ppc64_host_hwcap (unsigned long *valp)
+{
+#ifdef HAVE_GETAUXVAL
+  *valp = getauxval (AT_HWCAP);
+#else
+  unsigned char data[2 * 8];
+  FILE *f = fopen ("/proc/self/auxv", "r");
+
+  if (f == NULL)
+    return;
+
+  while (fread (data, sizeof (data), 1, f) > 0)
+    {
+      unsigned long *data_p = (unsigned long *) data;
+
+      if (data_p[0] == AT_HWCAP)
+	{
+	  *valp = data_p[1];
+	  break;
+	}
+    }
+
+  fclose (f);
+#endif /* HAVE_GETAUXVAL */
+}
+
+int
+ppc64_64bit_inferior_p (long msr)
+{
+  unsigned long ppc_host_hwcap = 0;
+
+  /* Get host's HWCAP to check whether the machine is Book E.  */
+  ppc64_host_hwcap (&ppc_host_hwcap);
+
+  /* We actually have a 64-bit inferior only if the certain bit of the
+     MSR is set.  The PowerISA Book III-S MSR is different from the
+     PowerISA Book III-E MSR.  The Book III-S MSR is 64 bits wide, and
+     its MSR[SF] is the bit 0 of a 64-bit value.  Book III-E MSR is 32
+     bits wide, and its MSR[CM] is the bit 0 of a 32-bit value.   */
+  if (ppc_host_hwcap & PPC_FEATURE_BOOKE)
+    return msr & 0x80000000;
+  else
+    return msr < 0;
+}
+
+#endif
diff --git a/gdb/nat/ppc-linux.h b/gdb/nat/ppc-linux.h
index 30d936f..0ff2223 100644
--- a/gdb/nat/ppc-linux.h
+++ b/gdb/nat/ppc-linux.h
@@ -82,4 +82,10 @@
 #define PTRACE_SETEVRREGS 21
 #endif
 
+#ifdef __powerpc64__
+/* Return whether the inferior is 64bit or not by checking certain bit
+   in MSR.  */
+int ppc64_64bit_inferior_p (long msr);
+#endif
+
 #endif
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index c5a286b..88ca49e 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -2367,7 +2367,7 @@ ppc_linux_target_wordsize (void)
 
   errno = 0;
   msr = (long) ptrace (PTRACE_PEEKUSER, tid, PT_MSR * 8, 0);
-  if (errno == 0 && msr < 0)
+  if (errno == 0 && ppc64_64bit_inferior_p (msr))
     wordsize = 8;
 #endif
 

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

* Re: [PATCH 2/2] Detect 64-bit-ness in PowerPC Book III-E
  2015-01-14  2:54             ` Yao Qi
@ 2015-01-14 12:47               ` Ulrich Weigand
  2015-01-14 14:22                 ` Yao Qi
  0 siblings, 1 reply; 12+ messages in thread
From: Ulrich Weigand @ 2015-01-14 12:47 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

Yao Qi wrote:

> --- a/gdb/configure.ac
> +++ b/gdb/configure.ac
> @@ -1318,6 +1318,9 @@ AC_CHECK_FUNCS([getrusage getuid getgid \
>  		ttrace wborder wresize setlocale iconvlist libiconvlist btowc \
>  		setrlimit getrlimit posix_madvise waitpid \
>  		ptrace64 sigaltstack mkdtemp])
> +# glibc >= 2.16 provides getauxval().
> +AC_CHECK_FUNCS(getauxval)
> +

Any reason why this has to be a second AC_CHECK_FUNCS ?  I thought
we usually just add functions to the one AC_CHECK_FUNCS call ...

> --- a/gdb/gdbserver/configure.ac
> +++ b/gdb/gdbserver/configure.ac
> @@ -91,6 +91,8 @@ AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h str=
> ing.h dnl
>  		 sys/ioctl.h netinet/in.h sys/socket.h netdb.h dnl
>  		 netinet/tcp.h arpa/inet.h)
>  AC_CHECK_FUNCS(pread pwrite pread64)
> +# glibc >= 2.16 provides getauxval().
> +AC_CHECK_FUNCS(getauxval)

Likewise.

> +  unsigned char data[2 * 8];
> +  FILE *f = fopen ("/proc/self/auxv", "r");
> +
> +  if (f == NULL)
> +    return;
> +
> +  while (fread (data, sizeof (data), 1, f) > 0)
> +    {
> +      unsigned long *data_p = (unsigned long *) data;

Hmm, this looks a violation of C aliasing rules.  It would
be better to declare the array as unsigned long in the first
place, and cast to char for the fread call.  Sorry for not
noticing that in the first review.

Otherwise this looks good.

Thanks,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com

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

* Re: [PATCH 2/2] Detect 64-bit-ness in PowerPC Book III-E
  2015-01-14 12:47               ` Ulrich Weigand
@ 2015-01-14 14:22                 ` Yao Qi
  0 siblings, 0 replies; 12+ messages in thread
From: Yao Qi @ 2015-01-14 14:22 UTC (permalink / raw)
  To: Ulrich Weigand; +Cc: gdb-patches

Ulrich Weigand <uweigand@de.ibm.com> writes:

>> +# glibc >= 2.16 provides getauxval().
>> +AC_CHECK_FUNCS(getauxval)
>> +
>
> Any reason why this has to be a second AC_CHECK_FUNCS ?  I thought
> we usually just add functions to the one AC_CHECK_FUNCS call ...
>

I feel it is clearer on why do we check for getauxval, if we call
AC_CHECK_FUNCS separately for getauxval.  I've removed the second
AC_CHECK_FUNCS in the updated patch.

>> +  unsigned char data[2 * 8];
>> +  FILE *f = fopen ("/proc/self/auxv", "r");
>> +
>> +  if (f == NULL)
>> +    return;
>> +
>> +  while (fread (data, sizeof (data), 1, f) > 0)
>> +    {
>> +      unsigned long *data_p = (unsigned long *) data;
>
> Hmm, this looks a violation of C aliasing rules.  It would
> be better to declare the array as unsigned long in the first
> place, and cast to char for the fread call.  Sorry for not
> noticing that in the first review.

OK, it is fixed the updated patch.

>
> Otherwise this looks good.

Patch below is what I pushed in.  Thanks for the review.

-- 
Yao (齐尧)

Subject: [PATCH] Detect 64-bit-ness in PowerPC Book III-E

This patch is to teach both GDB and GDBServer to detect 64-bit inferior
correctly.  We find a problem that GDBServer is unable to detect on a
e5500 core processor.  Current GDBServer assumes that MSR is a 64-bit
register, but MSR is a 32-bit register in Book III-E.  This patch is
to fix this problem by checking the right bit in MSR, in order to handle
both Book III-S and Book III-E.  In order to detect Book III-S and
Book III-E, we check the PPC_FEATURE_BOOKE from the host's HWCAP (by
getauxval on glibc >= 2.16.  If getauxval doesn't exist, we implement
the fallback by parsing /proc/self/auxv), because it should an invariant
on the same machine cross different processes.

In order to share code, I add nat/ppc-linux.c for both GDB and
GDBserver side.

gdb:

2015-01-14  Yao Qi  <yao@codesourcery.com>

	* Makefile.in (ppc-linux.o): New rule.
	* config/powerpc/ppc64-linux.mh (NATDEPFILES): Add ppc-linux.o.
	* configure.ac: AC_CHECK_FUNCS(getauxval).
	* config.in: Re-generated.
	* configure: Re-generated.
	* nat/ppc-linux.h [__powerpc64__] (ppc64_64bit_inferior_p):
	Declare.
	* nat/ppc-linux.c: New file.
	* ppc-linux-nat.c (ppc_linux_target_wordsize) [__powerpc64__]:
	Call ppc64_64bit_inferior_p.

gdb/gdbserver:

2015-01-14  Yao Qi  <yao@codesourcery.com>

	* Makefile.in (SFILES): Add nat/ppc-linux.c.
	(ppc-linux.o): New rule.
	* configure.srv (powerpc*-*-linux*): Add ppc-linux.o.
	* configure.ac: AC_CHECK_FUNCS(getauxval).
	* config.in: Re-generated.
	* configure: Re-generated.
	* linux-ppc-low.c (ppc_arch_setup) [__powerpc64__]: Call
	ppc64_64bit_inferior_p

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index f519f0a..fc1c7fa 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -2271,6 +2271,10 @@ mips-linux-watch.o: ${srcdir}/nat/mips-linux-watch.c
 	$(COMPILE) $(srcdir)/nat/mips-linux-watch.c
 	$(POSTCOMPILE)
 
+ppc-linux.o: ${srcdir}/nat/ppc-linux.c
+	$(COMPILE) $(srcdir)/nat/ppc-linux.c
+	$(POSTCOMPILE)
+
 #
 # gdb/tui/ dependencies
 #
diff --git a/gdb/config.in b/gdb/config.in
index 9d3f32d..806cbac 100644
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -138,6 +138,9 @@
 /* Define if <sys/procfs.h> has fpregset_t. */
 #undef HAVE_FPREGSET_T
 
+/* Define to 1 if you have the `getauxval' function. */
+#undef HAVE_GETAUXVAL
+
 /* Define to 1 if you have the `getgid' function. */
 #undef HAVE_GETGID
 
diff --git a/gdb/config/powerpc/ppc64-linux.mh b/gdb/config/powerpc/ppc64-linux.mh
index 4b91408..1b3fbc7 100644
--- a/gdb/config/powerpc/ppc64-linux.mh
+++ b/gdb/config/powerpc/ppc64-linux.mh
@@ -6,7 +6,7 @@ NAT_FILE= config/nm-linux.h
 NATDEPFILES= inf-ptrace.o fork-child.o \
 	ppc-linux-nat.o proc-service.o linux-thread-db.o \
 	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-	linux-waitpid.o
+	linux-waitpid.o ppc-linux.o
 NAT_CDEPS = $(srcdir)/proc-service.list
 
 # The PowerPC has severe limitations on TOC size, and uses them even
diff --git a/gdb/configure b/gdb/configure
index 7ff74ba..fdcf215 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -10490,7 +10490,7 @@ $as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h
 
 fi
 
-for ac_func in getrusage getuid getgid \
+for ac_func in getauxval getrusage getuid getgid \
 		pipe poll pread pread64 pwrite resize_term \
 		sbrk setpgid setpgrp setsid \
 		sigaction sigprocmask sigsetmask socketpair \
diff --git a/gdb/configure.ac b/gdb/configure.ac
index ec776d7..cc18174 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1311,7 +1311,7 @@ AC_C_BIGENDIAN
 
 AC_FUNC_MMAP
 AC_FUNC_VFORK
-AC_CHECK_FUNCS([getrusage getuid getgid \
+AC_CHECK_FUNCS([getauxval getrusage getuid getgid \
 		pipe poll pread pread64 pwrite resize_term \
 		sbrk setpgid setpgrp setsid \
 		sigaction sigprocmask sigsetmask socketpair \
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index 1ed2ec8..0e442fc 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -155,7 +155,7 @@ SFILES=	$(srcdir)/gdbreplay.c $(srcdir)/inferiors.c $(srcdir)/dll.c \
 	$(srcdir)/linux-m32r-low.c \
 	$(srcdir)/linux-m68k-low.c $(srcdir)/linux-mips-low.c \
 	$(srcdir)/linux-nios2-low.c \
-	$(srcdir)/linux-ppc-low.c \
+	$(srcdir)/linux-ppc-low.c $(srcdir)/nat/ppc-linux.c \
 	$(srcdir)/linux-s390-low.c \
 	$(srcdir)/linux-sh-low.c $(srcdir)/linux-sparc-low.c \
 	$(srcdir)/linux-x86-low.c \
@@ -581,6 +581,9 @@ linux-waitpid.o: ../nat/linux-waitpid.c
 mips-linux-watch.o: ../nat/mips-linux-watch.c
 	$(COMPILE) $<
 	$(POSTCOMPILE)
+ppc-linux.o: ../nat/ppc-linux.c
+	$(COMPILE) $<
+	$(POSTCOMPILE)
 
 aarch64.c : $(srcdir)/../regformats/aarch64.dat $(regdat_sh)
 	$(SHELL) $(regdat_sh) $(srcdir)/../regformats/aarch64.dat aarch64.c
diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in
index fd80adc..8f68ed2 100644
--- a/gdb/gdbserver/config.in
+++ b/gdb/gdbserver/config.in
@@ -60,6 +60,9 @@
 /* Define to 1 if you have the `fdwalk' function. */
 #undef HAVE_FDWALK
 
+/* Define to 1 if you have the `getauxval' function. */
+#undef HAVE_GETAUXVAL
+
 /* Define to 1 if you have the `getrlimit' function. */
 #undef HAVE_GETRLIMIT
 
diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
index 45efc51..55bd2c5 100755
--- a/gdb/gdbserver/configure
+++ b/gdb/gdbserver/configure
@@ -4745,7 +4745,7 @@ fi
 
 done
 
-for ac_func in pread pwrite pread64
+for ac_func in getauxval pread pwrite pread64
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index 02082cc..39e3a06 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -90,7 +90,7 @@ AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h string.h dnl
 		 fcntl.h signal.h sys/file.h dnl
 		 sys/ioctl.h netinet/in.h sys/socket.h netdb.h dnl
 		 netinet/tcp.h arpa/inet.h)
-AC_CHECK_FUNCS(pread pwrite pread64)
+AC_CHECK_FUNCS(getauxval pread pwrite pread64)
 
 GDB_AC_COMMON
 
diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv
index 679fc9f..f52aee2 100644
--- a/gdb/gdbserver/configure.srv
+++ b/gdb/gdbserver/configure.srv
@@ -217,7 +217,7 @@ case "${target}" in
 			srv_regobj="${srv_regobj} powerpc-isa205-64l.o"
 			srv_regobj="${srv_regobj} powerpc-isa205-altivec64l.o"
 			srv_regobj="${srv_regobj} powerpc-isa205-vsx64l.o"
-			srv_tgtobj="$srv_linux_obj linux-ppc-low.o"
+			srv_tgtobj="$srv_linux_obj linux-ppc-low.o ppc-linux.o"
 			srv_xmlfiles="rs6000/powerpc-32l.xml"
 			srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-altivec32l.xml"
 			srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-cell32l.xml"
diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
index 6e880c1..188fac0 100644
--- a/gdb/gdbserver/linux-ppc-low.c
+++ b/gdb/gdbserver/linux-ppc-low.c
@@ -398,13 +398,11 @@ ppc_arch_setup (void)
   current_process ()->tdesc = tdesc;
   ppc_hwcap = 0;
 
-  /* Only if the high bit of the MSR is set, we actually have
-     a 64-bit inferior.  */
   regcache = new_register_cache (tdesc);
   fetch_inferior_registers (regcache, find_regno (tdesc, "msr"));
   collect_register_by_name (regcache, "msr", &msr);
   free_register_cache (regcache);
-  if (msr < 0)
+  if (ppc64_64bit_inferior_p (msr))
     {
       ppc_get_hwcap (&ppc_hwcap);
       if (ppc_hwcap & PPC_FEATURE_CELL)
diff --git a/gdb/nat/ppc-linux.c b/gdb/nat/ppc-linux.c
new file mode 100644
index 0000000..76b3574
--- /dev/null
+++ b/gdb/nat/ppc-linux.c
@@ -0,0 +1,75 @@
+/*Copyright (C) 2015 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include "common-defs.h"
+#include "ppc-linux.h"
+#include <elf.h>
+
+#ifdef HAVE_GETAUXVAL
+#include <sys/auxv.h>
+#endif
+
+#ifdef __powerpc64__
+
+/* Get the HWCAP from the process of GDB or GDBserver.  If success,
+   save it in *VALP.   */
+
+static void
+ppc64_host_hwcap (unsigned long *valp)
+{
+#ifdef HAVE_GETAUXVAL
+  *valp = getauxval (AT_HWCAP);
+#else
+  unsigned long data[2];
+  FILE *f = fopen ("/proc/self/auxv", "r");
+
+  if (f == NULL)
+    return;
+
+  while (fread (data, sizeof (data), 1, f) > 0)
+    {
+      if (data[0] == AT_HWCAP)
+	{
+	  *valp = data[1];
+	  break;
+	}
+    }
+
+  fclose (f);
+#endif /* HAVE_GETAUXVAL */
+}
+
+int
+ppc64_64bit_inferior_p (long msr)
+{
+  unsigned long ppc_host_hwcap = 0;
+
+  /* Get host's HWCAP to check whether the machine is Book E.  */
+  ppc64_host_hwcap (&ppc_host_hwcap);
+
+  /* We actually have a 64-bit inferior only if the certain bit of the
+     MSR is set.  The PowerISA Book III-S MSR is different from the
+     PowerISA Book III-E MSR.  The Book III-S MSR is 64 bits wide, and
+     its MSR[SF] is the bit 0 of a 64-bit value.  Book III-E MSR is 32
+     bits wide, and its MSR[CM] is the bit 0 of a 32-bit value.   */
+  if (ppc_host_hwcap & PPC_FEATURE_BOOKE)
+    return msr & 0x80000000;
+  else
+    return msr < 0;
+}
+
+#endif
diff --git a/gdb/nat/ppc-linux.h b/gdb/nat/ppc-linux.h
index 30d936f..0ff2223 100644
--- a/gdb/nat/ppc-linux.h
+++ b/gdb/nat/ppc-linux.h
@@ -82,4 +82,10 @@
 #define PTRACE_SETEVRREGS 21
 #endif
 
+#ifdef __powerpc64__
+/* Return whether the inferior is 64bit or not by checking certain bit
+   in MSR.  */
+int ppc64_64bit_inferior_p (long msr);
+#endif
+
 #endif
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index c5a286b..88ca49e 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -2367,7 +2367,7 @@ ppc_linux_target_wordsize (void)
 
   errno = 0;
   msr = (long) ptrace (PTRACE_PEEKUSER, tid, PT_MSR * 8, 0);
-  if (errno == 0 && msr < 0)
+  if (errno == 0 && ppc64_64bit_inferior_p (msr))
     wordsize = 8;
 #endif
 

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

end of thread, other threads:[~2015-01-14 14:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-11 11:15 [PATCH] Detect 64-bit-ness in PowerPC Book III-E Yao Qi
2014-12-11 15:31 ` Ulrich Weigand
2014-12-19  8:06   ` Yao Qi
2014-12-19 15:49     ` Ulrich Weigand
2015-01-11  8:27       ` [PATCH 0/2, V2] " Yao Qi
2015-01-11  8:27         ` [PATCH 2/2] " Yao Qi
2015-01-13 17:00           ` Ulrich Weigand
2015-01-14  2:54             ` Yao Qi
2015-01-14 12:47               ` Ulrich Weigand
2015-01-14 14:22                 ` Yao Qi
2015-01-11  8:27         ` [PATCH 1/2] Move some ppc macros to nat/ppc-linux.h Yao Qi
2015-01-13 16:57           ` Ulrich Weigand

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).