Skip to contentSkip to conversation

guest_base, gdbstub and Travis

PATCH In review Alex Bennée 3 participants 21 messages Apr 23, 2020

lore
Share & tools
lore
#0 lore raw

cover guest_base, gdbstub and Travis

Hi,

This is the current state of my random collection of fixes that didn't make it into 5.0. The gdbstub related fixes will probably get queued up separately (and possibly submitted for stable?) once the tree gets re-opened. We have:

- The linux-user guest_base rework (which enable more sanitisers)
- A bunch of gdbstub related test fixes:
- unix socket based debug for linux-user
- a generic multiarch gdbstub test vase
- some other clean-ups
- some minor .travis updates
- drop MacOSX from the build
- add a diagnostic df -h to post build script

The following patches need review:

- .travis.yml: drop MacOSX
- .travis.yml: show free disk space at end of run
- tests/tcg: add a multiarch linux-user gdb test
- tests/guest-debug: use the unix socket for linux-user tests
- gdbstub/linux-user: support debugging over a unix socket
- gdbstub: eliminate gdbserver_fd global
- tests/tcg: drop inferior.was_attached() test
- tests/tcg: better trap gdb failures
- configure: favour gdb-multiarch if we have it
- linux-user: completely re-write init_guest_space

Alex Bennée (11):
linux-user: completely re-write init_guest_space .gitignore: include common build sub-directories
configure: favour gdb-multiarch if we have it tests/tcg: better trap gdb failures
tests/tcg: drop inferior.was_attached() test
gdbstub: eliminate gdbserver_fd global gdbstub/linux-user: support debugging over a unix socket tests/guest-debug: use the unix socket for linux-user tests tests/tcg: add a multiarch linux-user gdb test .travis.yml: show free disk space at end of run .travis.yml: drop MacOSX

Philippe Mathieu-Daudé (1):
gdbstub: Introduce gdb_get_float64() to get 64-bit float registers

Richard Henderson (2):
exec/cpu-all: Use bool for have_guest_base accel/tcg: Relax va restrictions on 64-bit guests

 configure                                   |   2 +-
 include/exec/cpu-all.h                      |  25 +-
 include/exec/gdbstub.h                      |  25 +-
 linux-user/qemu.h                           |  31 +-
 target/alpha/cpu-param.h                    |  15 +-
 accel/tcg/translate-all.c                   |  15 +-
 bsd-user/main.c                             |  12 +-
 gdbstub.c                                   | 120 ++++-
 linux-user/elfload.c                        | 503 ++++++++++----------
 linux-user/flatload.c                       |   6 +
 linux-user/main.c                           |  39 +-
 target/m68k/helper.c                        |   3 +-
 target/ppc/gdbstub.c                        |   4 +-
 target/ppc/translate_init.inc.c             |   2 +-
 .gitignore                                  |   1 +
 .travis.yml                                 |  29 +-
 tests/guest-debug/run-test.py               |  29 +-
 tests/tcg/aarch64/Makefile.target           |   5 +-
 tests/tcg/aarch64/gdbstub/test-sve-ioctl.py |   4 -
 tests/tcg/aarch64/gdbstub/test-sve.py       |   4 -
 tests/tcg/cris/Makefile.target              |   1 +
 tests/tcg/multiarch/Makefile.target         |  14 +
 tests/tcg/multiarch/gdbstub/sha1.py         |  81 ++++
 23 files changed, 570 insertions(+), 400 deletions(-)
 create mode 100644 tests/tcg/multiarch/gdbstub/sha1.py
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/14 linux-user: completely re-write init_guest_space

First we ensure all guest space initialisation logic comes through probe_guest_base once we understand the nature of the binary we are loading. The convoluted init_guest_space routine is removed and replaced with a number of pgb_* helpers which are called depending on what requirements we have when loading the binary.

We first try to do what is requested by the host. Failing that we try and satisfy the guest requested base address. If all those options fail we fall back to finding a space in the memory map using our recently written read_self_maps() helper.

There are some additional complications we try and take into account when looking for holes in the address space. We try not to go directly after the system brk() space so there is space for a little growth. We also don't want to have to use negative offsets which would result in slightly less efficient code on x86 when it's unable to use the segment offset register.

Less mind-binding gotos and hopefully clearer logic throughout.

---
v3
- include rth updates that
- split probe_guest_base into multiple functions
- more heuristics on gap finding
v4
- whitespace fix

---
 linux-user/qemu.h     |  31 ++-
 linux-user/elfload.c  | 503 +++++++++++++++++++++---------------------
 linux-user/flatload.c |   6 +
 linux-user/main.c     |  23 +-
 4 files changed, 277 insertions(+), 286 deletions(-)
linux-user/qemu.h +20 -11
index 792c74290f..ce902f5132 100644
@@ -219,18 +219,27 @@ void init_qemu_uname_release(void);
 void fork_start(void);
 void fork_end(int child);
 
-/* Creates the initial guest address space in the host memory space using
- * the given host start address hint and size.  The guest_start parameter
- * specifies the start address of the guest space.  guest_base will be the
- * difference between the host start address computed by this function and
- * guest_start.  If fixed is specified, then the mapped address space must
- * start at host_start.  The real start address of the mapped memory space is
- * returned or -1 if there was an error.
+/**
+ * probe_guest_base:
+ * @image_name: the executable being loaded
+ * @loaddr: the lowest fixed address in the executable
+ * @hiaddr: the highest fixed address in the executable
+ *
+ * Creates the initial guest address space in the host memory space.
+ *
+ * If @loaddr == 0, then no address in the executable is fixed,
+ * i.e. it is fully relocatable.  In that case @hiaddr is the size
+ * of the executable.
+ *
+ * This function will not return if a valid value for guest_base
+ * cannot be chosen.  On return, the executable loader can expect
+ *
+ *    target_mmap(loaddr, hiaddr - loaddr, ...)
+ *
+ * to succeed.
  */
-unsigned long init_guest_space(unsigned long host_start,
-                               unsigned long host_size,
-                               unsigned long guest_start,
-                               bool fixed);
+void probe_guest_base(const char *image_name,
+                      abi_ulong loaddr, abi_ulong hiaddr);
 
 #include "qemu/log.h"
 
linux-user/elfload.c +250 -253

569 lines not on this page · raw message

linux-user/flatload.c +6 -0
index 66901f39cc..8fb448f0bf 100644
@@ -441,6 +441,12 @@ static int load_flat_file(struct linux_binprm * bprm,
     indx_len = MAX_SHARED_LIBS * sizeof(abi_ulong);
     indx_len = (indx_len + 15) & ~(abi_ulong)15;
 
+    /*
+     * Alloate the address space.
+     */
+    probe_guest_base(bprm->filename, 0,
+                     text_len + data_len + extra + indx_len);
+
     /*
      * there are a couple of cases here,  the separate code/data
      * case,  and then the fully copied to RAM case which lumps
linux-user/main.c +1 -22
index 22578b1633..1d20a83d4e 100644
@@ -24,6 +24,7 @@
 #include "qemu-version.h"
 #include <sys/syscall.h>
 #include <sys/resource.h>
+#include <sys/shm.h>
 
 #include "qapi/error.h"
 #include "qemu.h"
@@ -747,28 +748,6 @@ int main(int argc, char **argv, char **envp)
     target_environ = envlist_to_environ(envlist, NULL);
     envlist_free(envlist);
 
-    /*
-     * Now that page sizes are configured in tcg_exec_init() we can do
-     * proper page alignment for guest_base.
-     */
-    guest_base = HOST_PAGE_ALIGN(guest_base);
-
-    if (reserved_va || have_guest_base) {
-        guest_base = init_guest_space(guest_base, reserved_va, 0,
-                                      have_guest_base);
-        if (guest_base == (unsigned long)-1) {
-            fprintf(stderr, "Unable to reserve 0x%lx bytes of virtual address "
-                    "space for use as guest address space (check your virtual "
-                    "memory ulimit setting or reserve less using -R option)\n",
-                    reserved_va);
-            exit(EXIT_FAILURE);
-        }
-
-        if (reserved_va) {
-            mmap_next_start = reserved_va;
-        }
-    }
-
     /*
      * Read in mmap_min_addr kernel parameter.  This value is used
      * When loading the ELF image to determine whether guest_base
Signature · 1 line
2.20.1
#2 lore raw

PATCH 2/14 exec/cpu-all: Use bool for have_guest_base

In reply to Alex Bennée

From: Richard Henderson <[email protected]>

---
 include/exec/cpu-all.h | 2 +-
 bsd-user/main.c        | 4 ++--
 linux-user/main.c      | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)
include/exec/cpu-all.h +1 -1
index 49384bb66a..b4fb5832c4 100644
@@ -159,7 +159,7 @@ static inline void tswap64s(uint64_t *s)
  * This allows the guest address space to be offset to a convenient location.
  */
 extern unsigned long guest_base;
-extern int have_guest_base;
+extern bool have_guest_base;
 extern unsigned long reserved_va;
 
 #if HOST_LONG_BITS <= TARGET_VIRT_ADDR_SPACE_BITS
bsd-user/main.c +2 -2
index 770c2b267a..aef5531628 100644
@@ -42,7 +42,7 @@
 int singlestep;
 unsigned long mmap_min_addr;
 unsigned long guest_base;
-int have_guest_base;
+bool have_guest_base;
 unsigned long reserved_va;
 
 static const char *interp_prefix = CONFIG_QEMU_INTERP_PREFIX;
@@ -828,7 +828,7 @@ int main(int argc, char **argv)
             }
         } else if (!strcmp(r, "B")) {
            guest_base = strtol(argv[optind++], NULL, 0);
-           have_guest_base = 1;
+           have_guest_base = true;
         } else if (!strcmp(r, "drop-ld-preload")) {
             (void) envlist_unsetenv(envlist, "LD_PRELOAD");
         } else if (!strcmp(r, "bsd")) {
linux-user/main.c +2 -2
index 1d20a83d4e..90ad365b43 100644
@@ -59,7 +59,7 @@ static const char *cpu_type;
 static const char *seed_optarg;
 unsigned long mmap_min_addr;
 unsigned long guest_base;
-int have_guest_base;
+bool have_guest_base;
 
 /*
  * Used to implement backwards-compatibility for the `-strace`, and
@@ -334,7 +334,7 @@ static void handle_arg_cpu(const char *arg)
 static void handle_arg_guest_base(const char *arg)
 {
     guest_base = strtol(arg, NULL, 0);
-    have_guest_base = 1;
+    have_guest_base = true;
 }
 
 static void handle_arg_reserved_va(const char *arg)
Signature · 1 line
2.20.1
#3 lore raw

PATCH 3/14 accel/tcg: Relax va restrictions on 64-bit guests

In reply to Alex Bennée

From: Richard Henderson <[email protected]>

We cannot at present limit a 64-bit guest to a virtual address space smaller than the host. It will mostly work to ignore this limitation, except if the guest uses high bits of the address space for tags. But it will certainly work better, as presently we can wind up failing to allocate the guest stack.

Widen our user-only page tree to the host or abi pointer width. Remove the workaround for this problem from target/alpha. Always validate guest addresses vs reserved_va, as there we control allocation ourselves.

---
 include/exec/cpu-all.h    | 23 +++++++++++++++++++----
 target/alpha/cpu-param.h  | 15 ++-------------
 accel/tcg/translate-all.c | 15 +++++++++------
 3 files changed, 30 insertions(+), 23 deletions(-)
include/exec/cpu-all.h +19 -4
index b4fb5832c4..c0c2fa3cc5 100644
@@ -162,12 +162,27 @@ extern unsigned long guest_base;
 extern bool have_guest_base;
 extern unsigned long reserved_va;
 
-#if HOST_LONG_BITS <= TARGET_VIRT_ADDR_SPACE_BITS
-#define GUEST_ADDR_MAX (~0ul)
+/*
+ * Limit the guest addresses as best we can.
+ *
+ * When not using -R reserved_va, we cannot really limit the guest
+ * to less address space than the host.  For 32-bit guests, this
+ * acts as a sanity check that we're not giving the guest an address
+ * that it cannot even represent.  For 64-bit guests... the address
+ * might not be what the real kernel would give, but it is at least
+ * representable in the guest.
+ *
+ * TODO: Improve address allocation to avoid this problem, and to
+ * avoid setting bits at the top of guest addresses that might need
+ * to be used for tags.
+ */
+#if MIN(TARGET_VIRT_ADDR_SPACE_BITS, TARGET_ABI_BITS) <= 32
+# define GUEST_ADDR_MAX_  UINT32_MAX
 #else
-#define GUEST_ADDR_MAX (reserved_va ? reserved_va - 1 : \
-                                    (1ul << TARGET_VIRT_ADDR_SPACE_BITS) - 1)
+# define GUEST_ADDR_MAX_  ~0ul
 #endif
+#define GUEST_ADDR_MAX    (reserved_va ? reserved_va - 1 : GUEST_ADDR_MAX_)
+
 #else
 
 #include "exec/hwaddr.h"
target/alpha/cpu-param.h +2 -13
index 692aee27ca..1153992e42 100644
@@ -10,22 +10,11 @@
 
 #define TARGET_LONG_BITS 64
 #define TARGET_PAGE_BITS 13
-#ifdef CONFIG_USER_ONLY
-/*
- * ??? The kernel likes to give addresses in high memory.  If the host has
- * more virtual address space than the guest, this can lead to impossible
- * allocations.  Honor the long-standing assumption that only kernel addrs
- * are negative, but otherwise allow allocations anywhere.  This could lead
- * to tricky emulation problems for programs doing tagged addressing, but
- * that's far fewer than encounter the impossible allocation problem.
- */
-#define TARGET_PHYS_ADDR_SPACE_BITS  63
-#define TARGET_VIRT_ADDR_SPACE_BITS  63
-#else
+
 /* ??? EV4 has 34 phys addr bits, EV5 has 40, EV6 has 44.  */
 #define TARGET_PHYS_ADDR_SPACE_BITS  44
 #define TARGET_VIRT_ADDR_SPACE_BITS  (30 + TARGET_PAGE_BITS)
-#endif
+
 #define NB_MMU_MODES 3
 
 #endif
accel/tcg/translate-all.c +9 -6
index 9924e66d1f..e4f703a7e6 100644
@@ -173,8 +173,13 @@ struct page_collection {
 #define TB_FOR_EACH_JMP(head_tb, tb, n)                                 \
     TB_FOR_EACH_TAGGED((head_tb)->jmp_list_head, tb, n, jmp_list_next)
 
-/* In system mode we want L1_MAP to be based on ram offsets,
-   while in user mode we want it to be based on virtual addresses.  */
+/*
+ * In system mode we want L1_MAP to be based on ram offsets,
+ * while in user mode we want it to be based on virtual addresses.
+ *
+ * TODO: For user mode, see the caveat re host vs guest virtual
+ * address spaces near GUEST_ADDR_MAX.
+ */
 #if !defined(CONFIG_USER_ONLY)
 #if HOST_LONG_BITS < TARGET_PHYS_ADDR_SPACE_BITS
 # define L1_MAP_ADDR_SPACE_BITS  HOST_LONG_BITS
@@ -182,7 +187,7 @@ struct page_collection {
 # define L1_MAP_ADDR_SPACE_BITS  TARGET_PHYS_ADDR_SPACE_BITS
 #endif
 #else
-# define L1_MAP_ADDR_SPACE_BITS  TARGET_VIRT_ADDR_SPACE_BITS
+# define L1_MAP_ADDR_SPACE_BITS  MIN(HOST_LONG_BITS, TARGET_ABI_BITS)
 #endif
 
 /* Size of the L2 (and L3, etc) page tables.  */
@@ -2497,9 +2502,7 @@ void page_set_flags(target_ulong start, target_ulong end, int flags)
     /* This function should never be called with addresses outside the
        guest address space.  If this assert fires, it probably indicates
        a missing call to h2g_valid.  */
-#if TARGET_ABI_BITS > L1_MAP_ADDR_SPACE_BITS
-    assert(end <= ((target_ulong)1 << L1_MAP_ADDR_SPACE_BITS));
-#endif
+    assert(end - 1 <= GUEST_ADDR_MAX);
     assert(start < end);
     assert_memory_lock();
 
Signature · 1 line
2.20.1
#4 lore raw

PATCH 4/14 .gitignore: include common build sub-directories

In reply to Alex Bennée

As out-of-tree builds become more common (or rather building in a subdir) we can add a lot of load to "git ls-files" as it hunts down sub-directories that are irrelevant to the source tree. This is especially annoying if you have a prompt that attempts to summarise the current git status on command completion.

---
v2
- use build*/ to capture build and it's variants

---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)
.gitignore +1 -0
index 0c5af83aa7..8dccb61a44 100644
@@ -141,6 +141,7 @@ cscope.*
 tags
 TAGS
 docker-src.*
+build*/
 *~
 *.ast_raw
 *.depend_raw
Signature · 1 line
2.20.1
#5 lore raw

PATCH 5/14 configure: favour gdb-multiarch if we have it

In reply to Alex Bennée

As gdb will generally be talking to "foreign" guests lets use that if we can. Otherwise the chances of gdb barfing are considerably higher.

---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure +1 -1
index 23b5e93752..c58787100f 100755
@@ -303,7 +303,7 @@ libs_qga=""
 debug_info="yes"
 stack_protector=""
 use_containers="yes"
-gdb_bin=$(command -v "gdb")
+gdb_bin=$(command -v "gdb-multiarch" || command -v "gdb")
 
 if test -e "$source_path/.git"
 then
Signature · 1 line
2.20.1
Reviewed-by on v1 5/14
#6 lore raw

Re: [PATCH v1 05/14] configure: favour gdb-multiarch if we have it

Quoted 13 lines · Alex Bennée

As gdb will generally be talking to "foreign" guests lets use that if we can. Otherwise the chances of gdb barfing are considerably higher.

---
  configure | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
configure +0 -0
index 23b5e93752..c58787100f 100755

configure libs_qga="" · line 307

Quoted 6 lines
configure +1 -1
@@ -303,7 +303,7 @@ libs_qga=""
  debug_info="yes"
  stack_protector=""
  use_containers="yes"
-gdb_bin=$(command -v "gdb")
+gdb_bin=$(command -v "gdb-multiarch" || command -v "gdb")
 

Good one!

Quoted 3 lines
configure +0 -0
  if test -e "$source_path/.git"
  then
#7 lore raw

PATCH 6/14 gdbstub: Introduce gdb_get_float64() to get 64-bit float registers

In reply to Alex Bennée

From: Philippe Mathieu-Daudé <[email protected]>

When converted to use GByteArray in commits 462474d760c and a010bdbe719, the call to stfq_p() was removed. This call serialize a float.
Since we now use a GByteArray, we can not use stfq_p() directly. Introduce the gdb_get_float64() helper to load a float64 register.

Fixes 462474d760c ("target/m68k: use gdb_get_reg helpers")
Fixes a010bdbe719 ("extend GByteArray to read register helpers")

Message-Id: <[email protected]>

---
 include/exec/gdbstub.h          | 11 +++++++++++
 target/m68k/helper.c            |  3 ++-
 target/ppc/gdbstub.c            |  4 ++--
 target/ppc/translate_init.inc.c |  2 +-
 4 files changed, 16 insertions(+), 4 deletions(-)
include/exec/gdbstub.h +11 -0
index 20e1072692..4a2b8e3089 100644
@@ -134,6 +134,17 @@ static inline int gdb_get_float32(GByteArray *array, float32 val)
 
     return sizeof(buf);
 }
+
+static inline int gdb_get_float64(GByteArray *array, float64 val)
+{
+    uint8_t buf[sizeof(CPU_DoubleU)];
+
+    stfq_p(buf, val);
+    g_byte_array_append(array, buf, sizeof(buf));
+
+    return sizeof(buf);
+}
+
 static inline int gdb_get_zeroes(GByteArray *array, size_t len)
 {
     guint oldlen = array->len;
target/m68k/helper.c +2 -1
index cad4083895..79b0b10ea9 100644
@@ -72,7 +72,8 @@ static int cf_fpu_gdb_get_reg(CPUM68KState *env, GByteArray *mem_buf, int n)
 {
     if (n < 8) {
         float_status s;
-        return gdb_get_reg64(mem_buf, floatx80_to_float64(env->fregs[n].d, &s));
+        return gdb_get_float64(mem_buf,
+                               floatx80_to_float64(env->fregs[n].d, &s));
     }
     switch (n) {
     case 8: /* fpcontrol */
target/ppc/gdbstub.c +2 -2
index eb362dd9ae..5c11c88b2a 100644
@@ -130,7 +130,7 @@ int ppc_cpu_gdb_read_register(CPUState *cs, GByteArray *buf, int n)
         gdb_get_regl(buf, env->gpr[n]);
     } else if (n < 64) {
         /* fprs */
-        gdb_get_reg64(buf, *cpu_fpr_ptr(env, n - 32));
+        gdb_get_float64(buf, *cpu_fpr_ptr(env, n - 32));
     } else {
         switch (n) {
         case 64:
@@ -184,7 +184,7 @@ int ppc_cpu_gdb_read_register_apple(CPUState *cs, GByteArray *buf, int n)
         gdb_get_reg64(buf, env->gpr[n]);
     } else if (n < 64) {
         /* fprs */
-        gdb_get_reg64(buf, *cpu_fpr_ptr(env, n - 32));
+        gdb_get_float64(buf, *cpu_fpr_ptr(env, n - 32));
     } else if (n < 96) {
         /* Altivec */
         gdb_get_reg64(buf, n - 64);
target/ppc/translate_init.inc.c +1 -1
index e853164a86..d825cb5975 100644
@@ -9881,7 +9881,7 @@ static int gdb_get_float_reg(CPUPPCState *env, GByteArray *buf, int n)
 {
     uint8_t *mem_buf;
     if (n < 32) {
-        gdb_get_reg64(buf, *cpu_fpr_ptr(env, n));
+        gdb_get_float64(buf, *cpu_fpr_ptr(env, n));
         mem_buf = gdb_get_reg_ptr(buf, 8);
         ppc_maybe_bswap_register(env, mem_buf, 8);
         return 8;
Signature · 1 line
2.20.1
#8 lore raw

PATCH 7/14 tests/tcg: better trap gdb failures

In reply to Alex Bennée

It seems older and non-multiarach aware GDBs might not fail gracefully when faced with something they don't know. For example when faced with a target XML for s390x the Ubuntu 18.04 gdb will generate an internal fault and prompt for a core dump.

Work around this by invoking GDB in a more batch orientated way and then trying to filter out between test failures and gdb failures.

---
 tests/guest-debug/run-test.py               | 19 ++++++++++++++++++-
 tests/tcg/aarch64/gdbstub/test-sve-ioctl.py |  1 -
 tests/tcg/aarch64/gdbstub/test-sve.py       |  1 -
 3 files changed, 18 insertions(+), 3 deletions(-)
tests/guest-debug/run-test.py +18 -1
index 8c49ee2f22..2bbb8fbaa3 100755
@@ -50,8 +50,25 @@ if __name__ == '__main__':
     inferior = subprocess.Popen(shlex.split(cmd))
 
     # Now launch gdb with our test and collect the result
-    gdb_cmd = "%s %s -ex 'target remote localhost:1234' -x %s" % (args.gdb, args.binary, args.test)
+    gdb_cmd = "%s %s" % (args.gdb, args.binary)
+    # run quietly and ignore .gdbinit
+    gdb_cmd += " -q -n -batch"
+    # disable prompts in case of crash
+    gdb_cmd += " -ex 'set confirm off'"
+    # connect to remote
+    gdb_cmd += " -ex 'target remote localhost:1234'"
+    # finally the test script itself
+    gdb_cmd += " -x %s" % (args.test)
+
+    print("GDB CMD: %s" % (gdb_cmd))
 
     result = subprocess.call(gdb_cmd, shell=True);
 
+    # A negative result is the result of an internal gdb failure like
+    # a crash. We force a return of 0 so we don't fail the test on
+    # account of broken external tools.
+    if result < 0:
+        print("GDB crashed? SKIPPING")
+        exit(0)
+
     exit(result)
tests/tcg/aarch64/gdbstub/test-sve-ioctl.py +0 -1
index 984fbeb277..387b2fc20a 100644
@@ -70,7 +70,6 @@ except (gdb.error, AttributeError):
 try:
     # These are not very useful in scripts
     gdb.execute("set pagination off")
-    gdb.execute("set confirm off")
 
     # Run the actual tests
     run_test()
tests/tcg/aarch64/gdbstub/test-sve.py +0 -1
index dbe7f2aa93..5995689625 100644
@@ -71,7 +71,6 @@ except (gdb.error, AttributeError):
 try:
     # These are not very useful in scripts
     gdb.execute("set pagination off")
-    gdb.execute("set confirm off")
 
     # Run the actual tests
     run_test()
Signature · 1 line
2.20.1
#9 lore raw

PATCH 8/14 tests/tcg: drop inferior.was_attached() test

In reply to Alex Bennée

This test seems flaky and reports attachment even when we failed to negotiate the architecture. However the fetching of the guest architecture will fail tripping up the gdb AttributeError which will trigger our early no error status exit from the test

---
 tests/tcg/aarch64/gdbstub/test-sve-ioctl.py | 3 ---
 tests/tcg/aarch64/gdbstub/test-sve.py       | 3 ---
 2 files changed, 6 deletions(-)
tests/tcg/aarch64/gdbstub/test-sve-ioctl.py +0 -3
index 387b2fc20a..972cf73c31 100644
@@ -58,9 +58,6 @@ def run_test():
 #
 try:
     inferior = gdb.selected_inferior()
-    if inferior.was_attached == False:
-        print("SKIPPING (failed to attach)", file=sys.stderr)
-        exit(0)
     arch = inferior.architecture()
     report(arch.name() == "aarch64", "connected to aarch64")
 except (gdb.error, AttributeError):
tests/tcg/aarch64/gdbstub/test-sve.py +0 -3
index 5995689625..b96bdbb99a 100644
@@ -59,9 +59,6 @@ def run_test():
 #
 try:
     inferior = gdb.selected_inferior()
-    if inferior.was_attached == False:
-        print("SKIPPING (failed to attach)", file=sys.stderr)
-        exit(0)
     arch = inferior.architecture()
     report(arch.name() == "aarch64", "connected to aarch64")
 except (gdb.error, AttributeError):
Signature · 1 line
2.20.1
#10 lore raw

PATCH 9/14 gdbstub: eliminate gdbserver_fd global

In reply to Alex Bennée

We don't really need to track this fd beyond the initial creation of the socket. We already know if the system has been initialised by virtue of the gdbserver_state so lets remove it. This makes the later re-factoring easier.

---
 gdbstub.c | 23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)
gdbstub.c +10 -13
index 171e150950..8c53cc0e1c 100644
@@ -398,8 +398,6 @@ static void reset_gdbserver_state(void)
 bool gdb_has_xml;
 
 #ifdef CONFIG_USER_ONLY
-/* XXX: This is not thread safe.  Do we care?  */
-static int gdbserver_fd = -1;
 
 static int get_char(void)
 {
@@ -2964,7 +2962,7 @@ void gdb_exit(CPUArchState *env, int code)
       return;
   }
 #ifdef CONFIG_USER_ONLY
-  if (gdbserver_fd < 0 || gdbserver_state.fd < 0) {
+  if (gdbserver_state.fd < 0) {
       return;
   }
 #endif
@@ -3011,7 +3009,7 @@ gdb_handlesig(CPUState *cpu, int sig)
     char buf[256];
     int n;
 
-    if (gdbserver_fd < 0 || gdbserver_state.fd < 0) {
+    if (!gdbserver_state.init || gdbserver_state.fd < 0) {
         return sig;
     }
 
@@ -3060,7 +3058,7 @@ void gdb_signalled(CPUArchState *env, int sig)
 {
     char buf[4];
 
-    if (gdbserver_fd < 0 || gdbserver_state.fd < 0) {
+    if (!gdbserver_state.init || gdbserver_state.fd < 0) {
         return;
     }
 
@@ -3068,7 +3066,7 @@ void gdb_signalled(CPUArchState *env, int sig)
     put_packet(buf);
 }
 
-static bool gdb_accept(void)
+static bool gdb_accept(int gdb_fd)
 {
     struct sockaddr_in sockaddr;
     socklen_t len;
@@ -3076,7 +3074,7 @@ static bool gdb_accept(void)
 
     for(;;) {
         len = sizeof(sockaddr);
-        fd = accept(gdbserver_fd, (struct sockaddr *)&sockaddr, &len);
+        fd = accept(gdb_fd, (struct sockaddr *)&sockaddr, &len);
         if (fd < 0 && errno != EINTR) {
             perror("accept");
             return false;
@@ -3137,13 +3135,12 @@ static int gdbserver_open(int port)
 
 int gdbserver_start(int port)
 {
-    gdbserver_fd = gdbserver_open(port);
-    if (gdbserver_fd < 0)
+    int gdb_fd = gdbserver_open(port);
+    if (gdb_fd < 0)
         return -1;
     /* accept connections */
-    if (!gdb_accept()) {
-        close(gdbserver_fd);
-        gdbserver_fd = -1;
+    if (!gdb_accept(gdb_fd)) {
+        close(gdb_fd);
         return -1;
     }
     return 0;
@@ -3152,7 +3149,7 @@ int gdbserver_start(int port)
 /* Disable gdb stub for child processes.  */
 void gdbserver_fork(CPUState *cpu)
 {
-    if (gdbserver_fd < 0 || gdbserver_state.fd < 0) {
+    if (!gdbserver_state.init || gdbserver_state.fd < 0) {
         return;
     }
     close(gdbserver_state.fd);
Signature · 1 line
2.20.1
Reviewed-by on v1 9/14
#11 lore raw

Re: [PATCH v1 09/14] gdbstub: eliminate gdbserver_fd global

Quoted 88 lines · Alex Bennée

We don't really need to track this fd beyond the initial creation of the socket. We already know if the system has been initialised by virtue of the gdbserver_state so lets remove it. This makes the later re-factoring easier.

---
  gdbstub.c | 23 ++++++++++-------------
  1 file changed, 10 insertions(+), 13 deletions(-)
gdbstub.c +9 -12
index 171e150950..8c53cc0e1c 100644
@@ -398,8 +398,6 @@ static void reset_gdbserver_state(void)
  bool gdb_has_xml;
 
  #ifdef CONFIG_USER_ONLY
-/* XXX: This is not thread safe.  Do we care?  */
-static int gdbserver_fd = -1;
 
  static int get_char(void)
  {
@@ -2964,7 +2962,7 @@ void gdb_exit(CPUArchState *env, int code)
        return;
    }
  #ifdef CONFIG_USER_ONLY
-  if (gdbserver_fd < 0 || gdbserver_state.fd < 0) {
+  if (gdbserver_state.fd < 0) {
        return;
    }
  #endif
@@ -3011,7 +3009,7 @@ gdb_handlesig(CPUState *cpu, int sig)
      char buf[256];
      int n;
 
-    if (gdbserver_fd < 0 || gdbserver_state.fd < 0) {
+    if (!gdbserver_state.init || gdbserver_state.fd < 0) {
          return sig;
      }
 
@@ -3060,7 +3058,7 @@ void gdb_signalled(CPUArchState *env, int sig)
  {
      char buf[4];
 
-    if (gdbserver_fd < 0 || gdbserver_state.fd < 0) {
+    if (!gdbserver_state.init || gdbserver_state.fd < 0) {
          return;
      }
 
@@ -3068,7 +3066,7 @@ void gdb_signalled(CPUArchState *env, int sig)
      put_packet(buf);
  }
 
-static bool gdb_accept(void)
+static bool gdb_accept(int gdb_fd)
  {
      struct sockaddr_in sockaddr;
      socklen_t len;
@@ -3076,7 +3074,7 @@ static bool gdb_accept(void)
 
      for(;;) {
          len = sizeof(sockaddr);
-        fd = accept(gdbserver_fd, (struct sockaddr *)&sockaddr, &len);
+        fd = accept(gdb_fd, (struct sockaddr *)&sockaddr, &len);
          if (fd < 0 && errno != EINTR) {
              perror("accept");
              return false;
@@ -3137,13 +3135,12 @@ static int gdbserver_open(int port)
 
  int gdbserver_start(int port)
  {
-    gdbserver_fd = gdbserver_open(port);
-    if (gdbserver_fd < 0)
+    int gdb_fd = gdbserver_open(port);
+    if (gdb_fd < 0)
          return -1;
      /* accept connections */
-    if (!gdb_accept()) {
-        close(gdbserver_fd);
-        gdbserver_fd = -1;
+    if (!gdb_accept(gdb_fd)) {
+        close(gdb_fd);
          return -1;
      }
      return 0;

gdbstub.c int gdbserver_start(int port) · line 3155

Quoted 8 lines
gdbstub.c +1 -1
@@ -3152,7 +3149,7 @@ int gdbserver_start(int port)
  /* Disable gdb stub for child processes.  */
  void gdbserver_fork(CPUState *cpu)
  {
-    if (gdbserver_fd < 0 || gdbserver_state.fd < 0) {
+    if (!gdbserver_state.init || gdbserver_state.fd < 0) {
          return;
      }
      close(gdbserver_state.fd);
#12 lore raw

PATCH 10/14 gdbstub/linux-user: support debugging over a unix socket

In reply to Alex Bennée

While debugging over TCP is fairly straightforward now we have test cases that want to orchestrate via make and currently a parallel build fails as two processes can't use the same listening port. While system emulation offers a wide cornucopia of connection methods thanks to the chardev abstraction we are a little more limited for linux user. Thankfully the programming API for a TCP socket and a local UNIX socket is pretty much the same once it's set up.

---
 include/exec/gdbstub.h |  14 ++++--
 bsd-user/main.c        |   8 +--
 gdbstub.c              | 107 ++++++++++++++++++++++++++++++++++-------
 linux-user/main.c      |  12 ++---
 4 files changed, 108 insertions(+), 33 deletions(-)
include/exec/gdbstub.h +9 -5
index 4a2b8e3089..94d8f83e92 100644
@@ -177,11 +177,15 @@ static inline uint8_t * gdb_get_reg_ptr(GByteArray *buf, int len)
 
 #endif
 
-#ifdef CONFIG_USER_ONLY
-int gdbserver_start(int);
-#else
-int gdbserver_start(const char *port);
-#endif
+/**
+ * gdbserver_start: start the gdb server
+ * @port_or_device: connection spec for gdb
+ *
+ * For CONFIG_USER this is either a tcp port or a path to a fifo. For
+ * system emulation you can use a full chardev spec for your gdbserver
+ * port.
+ */
+int gdbserver_start(const char *port_or_device);
 
 void gdbserver_cleanup(void);
 
bsd-user/main.c +4 -4
index aef5531628..0bfe46cff9 100644
@@ -738,7 +738,7 @@ int main(int argc, char **argv)
     CPUState *cpu;
     int optind;
     const char *r;
-    int gdbstub_port = 0;
+    const char *gdbstub = NULL;
     char **target_environ, **wrk;
     envlist_t *envlist = NULL;
     char *trace_file = NULL;
@@ -814,7 +814,7 @@ int main(int argc, char **argv)
                 exit(1);
             }
         } else if (!strcmp(r, "g")) {
-            gdbstub_port = atoi(argv[optind++]);
+            gdbstub = g_strdup(argv[optind++]);
         } else if (!strcmp(r, "r")) {
             qemu_uname_release = argv[optind++];
         } else if (!strcmp(r, "cpu")) {
@@ -1124,8 +1124,8 @@ int main(int argc, char **argv)
 #error unsupported target CPU
 #endif
 
-    if (gdbstub_port) {
-        gdbserver_start (gdbstub_port);
+    if (gdbstub) {
+        gdbserver_start(gdbstub);
         gdb_handlesig(cpu, 0);
     }
     cpu_loop(env);
gdbstub.c +89 -18

152 lines not on this page · raw message

linux-user/main.c +6 -6
index 90ad365b43..3597e99bb1 100644
@@ -52,7 +52,7 @@ char *exec_path;
 
 int singlestep;
 static const char *argv0;
-static int gdbstub_port;
+static const char *gdbstub;
 static envlist_t *envlist;
 static const char *cpu_model;
 static const char *cpu_type;
@@ -311,7 +311,7 @@ static void handle_arg_seed(const char *arg)
 
 static void handle_arg_gdb(const char *arg)
 {
-    gdbstub_port = atoi(arg);
+    gdbstub = g_strdup(arg);
 }
 
 static void handle_arg_uname(const char *arg)
@@ -840,10 +840,10 @@ int main(int argc, char **argv, char **envp)
 
     target_cpu_copy_regs(env, regs);
 
-    if (gdbstub_port) {
-        if (gdbserver_start(gdbstub_port) < 0) {
-            fprintf(stderr, "qemu: could not open gdbserver on port %d\n",
-                    gdbstub_port);
+    if (gdbstub) {
+        if (gdbserver_start(gdbstub) < 0) {
+            fprintf(stderr, "qemu: could not open gdbserver on %s\n",
+                    gdbstub);
             exit(EXIT_FAILURE);
         }
         gdb_handlesig(cpu, 0);
Signature · 1 line
2.20.1
#13 lore raw

PATCH 11/14 tests/guest-debug: use the unix socket for linux-user tests

In reply to Alex Bennée

Now we have support for debugging over a unix socket for linux-user lets use it in our test harness.

---
 tests/guest-debug/run-test.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
tests/guest-debug/run-test.py +10 -2
index 2bbb8fbaa3..2441a1d623 100755
@@ -15,6 +15,8 @@ import argparse
 import subprocess
 import shutil
 import shlex
+import os
+from tempfile import TemporaryDirectory
 
 def get_args():
     parser = argparse.ArgumentParser(description="A gdbstub test runner")
@@ -41,11 +43,14 @@ if __name__ == '__main__':
         print("We need gdb to run the test")
         exit(-1)
 
+    socket_dir = TemporaryDirectory("qemu-gdbstub")
+    socket_name = os.path.join(socket_dir.name, "gdbstub.socket")
+
     # Launch QEMU with binary
     if "system" in args.qemu:
         cmd = "%s %s %s -s -S" % (args.qemu, args.qargs, args.binary)
     else:
-        cmd = "%s %s -g 1234 %s" % (args.qemu, args.qargs, args.binary)
+        cmd = "%s %s -g %s %s" % (args.qemu, args.qargs, socket_name, args.binary)
 
     inferior = subprocess.Popen(shlex.split(cmd))
 
@@ -56,7 +61,10 @@ if __name__ == '__main__':
     # disable prompts in case of crash
     gdb_cmd += " -ex 'set confirm off'"
     # connect to remote
-    gdb_cmd += " -ex 'target remote localhost:1234'"
+    if "system" in args.qemu:
+        gdb_cmd += " -ex 'target remote localhost:1234'"
+    else:
+        gdb_cmd += " -ex 'target remote %s'" % (socket_name)
     # finally the test script itself
     gdb_cmd += " -x %s" % (args.test)
 
Signature · 1 line
2.20.1
#14 lore raw

PATCH 12/14 tests/tcg: add a multiarch linux-user gdb test

In reply to Alex Bennée

When the gdbstub code was converted to the new API we missed a few snafus in the various guests. Add a simple gdb test script which can be used on all our linux-user guests to check for obvious failures.

---
v2
- use EXTRA_RUNS to queue the tests so as not to break plugins

---
 tests/tcg/aarch64/Makefile.target   |  5 +-
 tests/tcg/cris/Makefile.target      |  1 +
 tests/tcg/multiarch/Makefile.target | 14 +++++
 tests/tcg/multiarch/gdbstub/sha1.py | 81 +++++++++++++++++++++++++++++
 4 files changed, 98 insertions(+), 3 deletions(-)
 create mode 100644 tests/tcg/multiarch/gdbstub/sha1.py
tests/tcg/aarch64/Makefile.target +2 -3
index d99b2a9ece..312f36cde5 100644
@@ -54,9 +54,6 @@ sve-ioctls: CFLAGS+=-march=armv8.1-a+sve
 ifneq ($(HAVE_GDB_BIN),)
 GDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py
 
-AARCH64_TESTS += gdbstub-sysregs gdbstub-sve-ioctls
-
-.PHONY: gdbstub-sysregs gdbstub-sve-ioctls
 run-gdbstub-sysregs: sysregs
 	$(call run-test, $@, $(GDB_SCRIPT) \
 		--gdb $(HAVE_GDB_BIN) \
@@ -70,6 +67,8 @@ run-gdbstub-sve-ioctls: sve-ioctls
 		--qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
 		--bin $< --test $(AARCH64_SRC)/gdbstub/test-sve-ioctl.py, \
 	"basic gdbstub SVE ZLEN support")
+
+EXTRA_RUNS += run-gdbstub-sysregs run-gdbstub-sve-ioctls
 endif
 
 endif
tests/tcg/cris/Makefile.target +1 -0
index 24c7f2e761..e72d3cbdb2 100644
@@ -23,6 +23,7 @@ CRIS_RUNS = $(patsubst %, run-%, $(CRIS_USABLE_TESTS))
 
 # override the list of tests, as we can't build the multiarch tests
 TESTS = $(CRIS_USABLE_TESTS)
+EXTRA_RUNS =
 VPATH = $(CRIS_SRC)
 
 AS	= $(CC) -x assembler-with-cpp
tests/tcg/multiarch/Makefile.target +14 -0
index 035b09c853..51fb75ecfd 100644
@@ -42,5 +42,19 @@ run-test-mmap-%: test-mmap
 	$(call run-test, test-mmap-$*, $(QEMU) -p $* $<,\
 		"$< ($* byte pages) on $(TARGET_NAME)")
 
+ifneq ($(HAVE_GDB_BIN),)
+GDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py
+
+run-gdbstub-sha1: sha1
+	$(call run-test, $@, $(GDB_SCRIPT) \
+		--gdb $(HAVE_GDB_BIN) \
+		--qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
+		--bin $< --test $(MULTIARCH_SRC)/gdbstub/sha1.py, \
+	"basic gdbstub support")
+
+EXTRA_RUNS += run-gdbstub-sha1
+endif
+
+
 # Update TESTS
 TESTS += $(MULTIARCH_TESTS)
tests/tcg/multiarch/gdbstub/sha1.py new file +81 -0

81 lines not on this page · raw message

Signature · 1 line
2.20.1
#15 lore raw

PATCH 13/14 .travis.yml: show free disk space at end of run

In reply to Alex Bennée
---
 .travis.yml | 1 +
 1 file changed, 1 insertion(+)
.travis.yml +1 -0
index 2fd63eceaa..a4c3c6c805 100644
@@ -113,6 +113,7 @@ script:
         $(exit $BUILD_RC);
     fi
 after_script:
+  - df -h
   - if command -v ccache ; then ccache --show-stats ; fi
 
 
Signature · 1 line
2.20.1
Reviewed-by on v1 13/14
#16 lore raw

Re: [PATCH v1 13/14] .travis.yml: show free disk space at end of run

Quoted 10 lines · Alex Bennée
---
  .travis.yml | 1 +
  1 file changed, 1 insertion(+)
.travis.yml +0 -0
index 2fd63eceaa..a4c3c6c805 100644

.travis.yml script: · line 116

Quoted 4 lines
.travis.yml +1 -0
@@ -113,6 +113,7 @@ script:
          $(exit $BUILD_RC);
      fi
  after_script:
+  - df -h

Well, I suppose it helps to realize we didn't break the runner, it was already dying...

Quoted 4 lines
.travis.yml +0 -0
    - if command -v ccache ; then ccache --show-stats ; fi
 
 
#17 lore raw

PATCH 14/14 .travis.yml: drop MacOSX

In reply to Alex Bennée

This keeps breaking on Travis so lets just fall back to the Cirrus CI builds which seem to be better maintained. Fix up the comments while we are doing this as we never had a windows build.

---
 .travis.yml | 28 +---------------------------
 1 file changed, 1 insertion(+), 27 deletions(-)
.travis.yml +1 -27
index a4c3c6c805..49267b73b3 100644
@@ -9,9 +9,8 @@ compiler:
 cache:
   # There is one cache per branch and compiler version.
   # characteristics of each job are used to identify the cache:
-  # - OS name (currently, linux, osx, or windows)
+  # - OS name (currently only linux)
   # - OS distribution (for Linux, xenial, trusty, or precise)
-  # - macOS image name (e.g., xcode7.2)
   # - Names and values of visible environment variables set in .travis.yml or Settings panel
   timeout: 1200
   ccache: true
@@ -271,31 +270,6 @@ jobs:
         - TEST_CMD=""
 
 
-    # MacOSX builds - cirrus.yml also tests some MacOS builds including latest Xcode
-
-    - name: "OSX Xcode 10.3"
-      env:
-        - BASE_CONFIG="--disable-docs --enable-tools"
-        - CONFIG="--target-list=i386-softmmu,ppc-softmmu,ppc64-softmmu,m68k-softmmu,x86_64-softmmu"
-      os: osx
-      osx_image: xcode10.3
-      compiler: clang
-      addons:
-        homebrew:
-          packages:
-            - ccache
-            - glib
-            - pixman
-            - gnu-sed
-            - python
-          update: true
-      before_script:
-        - brew link --overwrite python
-        - export PATH="/usr/local/opt/ccache/libexec:$PATH"
-        - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
-        - ${SRC_DIR}/configure ${BASE_CONFIG} ${CONFIG} || { cat config.log && exit 1; }
-
-
     # Python builds
     - name: "GCC Python 3.5 (x86_64-softmmu)"
       env:
Signature · 1 line
2.20.1
Reviewed-by on v1 14/14
#18 lore raw

Re: [PATCH v1 14/14] .travis.yml: drop MacOSX

Quoted 3 lines · Alex Bennée

This keeps breaking on Travis so lets just fall back to the Cirrus CI builds which seem to be better maintained. Fix up the comments while we are doing this as we never had a windows build.

I certainly vouch this.

Quoted 54 lines
---
  .travis.yml | 28 +---------------------------
  1 file changed, 1 insertion(+), 27 deletions(-)
.travis.yml +1 -27
index a4c3c6c805..49267b73b3 100644
@@ -9,9 +9,8 @@ compiler:
  cache:
    # There is one cache per branch and compiler version.
    # characteristics of each job are used to identify the cache:
-  # - OS name (currently, linux, osx, or windows)
+  # - OS name (currently only linux)
    # - OS distribution (for Linux, xenial, trusty, or precise)
-  # - macOS image name (e.g., xcode7.2)
    # - Names and values of visible environment variables set in .travis.yml or Settings panel
    timeout: 1200
    ccache: true
@@ -271,31 +270,6 @@ jobs:
          - TEST_CMD=""
 
 
-    # MacOSX builds - cirrus.yml also tests some MacOS builds including latest Xcode
-
-    - name: "OSX Xcode 10.3"
-      env:
-        - BASE_CONFIG="--disable-docs --enable-tools"
-        - CONFIG="--target-list=i386-softmmu,ppc-softmmu,ppc64-softmmu,m68k-softmmu,x86_64-softmmu"
-      os: osx
-      osx_image: xcode10.3
-      compiler: clang
-      addons:
-        homebrew:
-          packages:
-            - ccache
-            - glib
-            - pixman
-            - gnu-sed
-            - python
-          update: true
-      before_script:
-        - brew link --overwrite python
-        - export PATH="/usr/local/opt/ccache/libexec:$PATH"
-        - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
-        - ${SRC_DIR}/configure ${BASE_CONFIG} ${CONFIG} || { cat config.log && exit 1; }
-
-
      # Python builds
      - name: "GCC Python 3.5 (x86_64-softmmu)"
        env:
#19 lore raw
In reply to Alex Bennée
Patchew URL: https://patchew.org/QEMU/[email protected]/

Patchew URL: https://patchew.org/QEMU/[email protected]/

Hi,

This series seems to have some coding style problems. See output below for more information:

Subject: [PATCH for 5.1 v1 00/14] guest_base, gdbstub and Travis
Message-id: [email protected]
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
- [tag update] patchew/[email protected] -> patchew/[email protected]
- [tag update] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'
689e6e8 .travis.yml: drop MacOSX
f7c8828 .travis.yml: show free disk space at end of run c2d0ee7 tests/tcg: add a multiarch linux-user gdb test
5002abd tests/guest-debug: use the unix socket for linux-user tests 98d25bf gdbstub/linux-user: support debugging over a unix socket 37544e1 gdbstub: eliminate gdbserver_fd global
852d87f tests/tcg: drop inferior.was_attached() test
72e9645 tests/tcg: better trap gdb failures
8a161b1 gdbstub: Introduce gdb_get_float64() to get 64-bit float registers d0f142f configure: favour gdb-multiarch if we have it
bc6da7bb .gitignore: include common build sub-directories ad7e15b accel/tcg: Relax va restrictions on 64-bit guests 55ee255 exec/cpu-all: Use bool for have_guest_base
55dbacd linux-user: completely re-write init_guest_space

=== OUTPUT BEGIN ===
1/14 Checking commit 55dbacd6b444 (linux-user: completely re-write init_guest_space) 2/14 Checking commit 55ee255da7f6 (exec/cpu-all: Use bool for have_guest_base) 3/14 Checking commit ad7e15b42dc2 (accel/tcg: Relax va restrictions on 64-bit guests)
ERROR: Macros with complex values should be enclosed in parenthesis #91: FILE: include/exec/cpu-all.h:182:
+# define GUEST_ADDR_MAX_ ~0ul

total: 1 errors, 0 warnings, 88 lines checked

Patch 3/14 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

4/14 Checking commit bc6da7bb0a03 (.gitignore: include common build sub-directories) 5/14 Checking commit d0f142fa8cfd (configure: favour gdb-multiarch if we have it) 6/14 Checking commit 8a161b12a736 (gdbstub: Introduce gdb_get_float64() to get 64-bit float registers) 7/14 Checking commit 72e964519511 (tests/tcg: better trap gdb failures)
8/14 Checking commit 852d87fc501d (tests/tcg: drop inferior.was_attached() test)
9/14 Checking commit 37544e18de5c (gdbstub: eliminate gdbserver_fd global)
ERROR: suspect code indent for conditional statements (2, 6)
#33: FILE: gdbstub.c:2965:

+  if (gdbserver_state.fd < 0) {
       return;

ERROR: braces {} are necessary for all arms of this statement #80: FILE: gdbstub.c:3139:
+ if (gdb_fd < 0)
[...]

total: 2 errors, 0 warnings, 73 lines checked

Patch 9/14 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

10/14 Checking commit 98d25bf64760 (gdbstub/linux-user: support debugging over a unix socket)
ERROR: suspect code indent for conditional statements (2, 6)
#67: FILE: gdbstub.c:2966:
+ if (gdbserver_state.socket_path) {
+ unlink(gdbserver_state.socket_path);

ERROR: space required before the open parenthesis '(' #101: FILE: gdbstub.c:3087:
+ for(;;) {

ERROR: spaces required around that '-' (ctx:VxV)
#128: FILE: gdbstub.c:3114:

+    pstrcpy(sockaddr.sun_path, sizeof(sockaddr.sun_path)-1, path);
                                                         ^

total: 3 errors, 0 warnings, 228 lines checked

Patch 10/14 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

11/14 Checking commit 5002abd35782 (tests/guest-debug: use the unix socket for linux-user tests)
WARNING: line over 80 characters
#38: FILE: tests/guest-debug/run-test.py:53:
+ cmd = "%s %s -g %s %s" % (args.qemu, args.qargs, socket_name, args.binary)

total: 0 errors, 1 warnings, 34 lines checked

Patch 11/14 has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
12/14 Checking commit c2d0ee78fa1d (tests/tcg: add a multiarch linux-user gdb test)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #75:
new file mode 100644

total: 0 errors, 1 warnings, 124 lines checked

Patch 12/14 has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
13/14 Checking commit f7c88287e116 (.travis.yml: show free disk space at end of run) 14/14 Checking commit 689e6e8641c4 (.travis.yml: drop MacOSX)
=== OUTPUT END ===

Test command exited with code: 1

The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]

#20 lore raw
In reply to Alex Bennée
Patchew URL: https://patchew.org/QEMU/[email protected]/

Patchew URL: https://patchew.org/QEMU/[email protected]/

Hi,

This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1 === TEST SCRIPT END ===

Cleared directory 'slirp'
Submodule 'slirp' (https://git.qemu.org/git/libslirp.git) unregistered for path 'slirp' Submodule 'ui/keycodemapdb' (https://git.qemu.org/git/keycodemapdb.git) unregistered for path 'ui/keycodemapdb' make[1]: *** [/var/tmp/patchew-tester-tmp-rhig99s_/src/docker-src.2020-04-23-14.15.56.12776] Error 1 make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-rhig99s_/src'
make: *** [docker-run-test-quick@centos7] Error 2

real 2m0.927s
user 0m5.275s

The full log is available at
http://patchew.org/logs/[email protected]/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]