more randome fixes (user, pie, docker and gdbstub)
v2 cover more randome fixes (user, pie, docker and gdbstub)
Hi,
This is version 2 of my random fixes for rc3 series. In no particular order we have:
- A trivial fix to /proc/self/stat output
- An attempt to fix broken PIE builds for Windows (please test!)
- Some fixes to get "make docker-all-tests" running again
- A tweak to .gitignore
- A couple of bugs found in the gdbstub GByteArray conversion
- A new test case for linux-user gdbstub support
- Which found a few more gdbstub bugs :-/
The m68k FPU patch is definitely a hack but it seemed easier than disabling completely. The chatter on #gdb seems to be there is some combination of qemu and gdb tress that does work but I suspect this needs some maintainer action.
I've dropped the MacOSX travis patch as Travis has hopefully sorted itself out.
I've also included the guest base re-factoring patches as it makes it easier for me to soak test the tree with the sanitiser although those actual fixes won't go into 5.0 at this late stage.
The following patches need review:
- tests/tcg: add a multiarch linux-user gdb test
- tests/tcg: drop inferior.was_attached() test
- target/m68k: hack around the FPU register support (HACK!)
- linux-user: completely re-write init_guest_space
Alex Bennée (9):
linux-user: completely re-write init_guest_space .gitignore: include common build sub-directories tests/docker: add docs FEATURE flag and use for test-misc
configure: redirect sphinx-build check to config.log
configure: disable PIE for Windows builds
linux-user: fix /proc/self/stat handling target/m68k: hack around the FPU register support (HACK!) tests/tcg: drop inferior.was_attached() test tests/tcg: add a multiarch linux-user gdb test
Peter Xu (1):
gdbstub: i386: Fix gdb_get_reg16() parameter to unbreak gdb
Philippe Mathieu-Daudé (4):
target/m68k/helper: Fix m68k_fpu_gdb_get_reg() use of GByteArray
gdbstub: Do not use memset() on GByteArray
gdbstub: Introduce gdb_get_float32() to get 32-bit float registers
gdbstub: Introduce gdb_get_float64() to get 64-bit float registers
Richard Henderson (3):
exec/cpu-all: Use bool for have_guest_base accel/tcg: Relax va restrictions on 64-bit guests linux-user/ppc: Fix padding in mcontext_t for ppc64
configure | 5 +- include/exec/cpu-all.h | 25 +- include/exec/gdbstub.h | 29 ++ linux-user/qemu.h | 31 +- target/alpha/cpu-param.h | 15 +- accel/tcg/translate-all.c | 15 +- bsd-user/main.c | 4 +- linux-user/elfload.c | 503 ++++++++++---------- linux-user/flatload.c | 6 + linux-user/main.c | 27 +- linux-user/ppc/signal.c | 69 ++- linux-user/syscall.c | 43 +- target/arm/gdbstub.c | 3 +- target/i386/gdbstub.c | 2 +- target/m68k/helper.c | 14 +- target/ppc/gdbstub.c | 4 +- target/ppc/translate_init.inc.c | 2 +- target/sh4/gdbstub.c | 6 +- target/xtensa/gdbstub.c | 6 +- .gitignore | 1 + gdb-xml/m68k-fp.xml | 16 +- tests/docker/dockerfiles/debian10.docker | 2 + tests/docker/dockerfiles/debian9.docker | 2 - tests/docker/dockerfiles/fedora.docker | 2 +- tests/docker/dockerfiles/travis.docker | 2 +- tests/docker/dockerfiles/ubuntu.docker | 2 +- tests/docker/dockerfiles/ubuntu1804.docker | 2 +- tests/docker/test-misc | 2 + tests/tcg/aarch64/gdbstub/test-sve-ioctl.py | 3 - tests/tcg/aarch64/gdbstub/test-sve.py | 3 - tests/tcg/multiarch/Makefile.target | 15 + tests/tcg/multiarch/gdbstub/sha1.py | 81 ++++ 32 files changed, 522 insertions(+), 420 deletions(-) create mode 100644 tests/tcg/multiarch/gdbstub/sha1.py
Signature · 1 line
2.20.1
PATCH v2 1/17 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
@@ -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
@@ -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
@@ -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
PATCH v2 2/17 exec/cpu-all: Use bool for have_guest_base
In reply to Alex BennéeFrom: 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
@@ -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
@@ -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
@@ -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
PATCH v2 3/17 accel/tcg: Relax va restrictions on 64-bit guests
In reply to Alex BennéeFrom: 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
@@ -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
@@ -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
@@ -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
PATCH v2 4/17 .gitignore: include common build sub-directories
In reply to Alex BennéeAs 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
@@ -141,6 +141,7 @@ cscope.* tags TAGS docker-src.* +build*/ *~ *.ast_raw *.depend_raw
Signature · 1 line
2.20.1
PATCH v2 5/17 linux-user/ppc: Fix padding in mcontext_t for ppc64
In reply to Alex BennéeFrom: Richard Henderson <[email protected]>
The padding that was added in 95cda4c44ee was added to a union, and so it had no effect. This fixes misalignment errors detected by clang sanitizers for ppc64 and ppc64le.
In addition, only ppc64 allocates space for VSX registers, so do not save them for ppc32. The kernel only has references to CONFIG_SPE in signal_32.c, so do not attempt to save them for ppc64.
--- linux-user/ppc/signal.c | 69 +++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 40 deletions(-)
linux-user/ppc/signal.c +29 -40
@@ -35,12 +35,26 @@ struct target_mcontext {target_ulong mc_gregs[48 ];/* Includes fpscr. */ uint64_t mc_fregs[33 ]; +#if defined(TARGET_PPC64 )/* Pointer to the vector regs */ target_ulong v_regs; +/* +* On ppc64, this mcontext structure is naturally *unaligned*, +* or rather it is aligned on a 8 bytes boundary but not on +* a 16 byte boundary. This pad fixes it up. This is why we +* cannot use ppc_avr_t, which would force alignment. This is +* also why the vector regs are referenced in the ABI by the +* v_regs pointer above so any amount of padding can be added here. +*/ +target_ulong pad; +/* VSCR and VRSAVE are saved separately. Also reserve space for VSX. */ +struct { +uint64_t altivec[34 +16 ][2 ]; + } mc_vregs;#else target_ulong mc_pad[2 ]; -#endif +/* We need to handle Altivec and SPE at the same time, which no kernel needs to do. Fortunately, the kernel defines this bit to be Altivec-register-large all the time, rather than trying to
@@ -48,32 +62,14 @@ struct target_mcontext {union {/* SPE vector registers. One extra for SPEFSCR. */ uint32_t spe[33 ]; -/* Altivec vector registers. The packing of VSCR and VRSAVE -varies depending on whether we're PPC64 or not: PPC64 splits -them apart; PPC32 stuffs them together. -We also need to account for the VSX registers on PPC64 -*/ -#if defined(TARGET_PPC64 ) -#define QEMU_NVRREG (34 + 16) -/* On ppc64, this mcontext structure is naturally *unaligned*, -* or rather it is aligned on a 8 bytes boundary but not on -* a 16 bytes one. This pad fixes it up. This is also why the -* vector regs are referenced by the v_regs pointer above so -* any amount of padding can be added here -*/ -target_ulong pad; -#else -/* On ppc32, we are already aligned to 16 bytes */ -#define QEMU_NVRREG 33 -#endif -/* We cannot use ppc_avr_t here as we do *not* want the implied -* 16-bytes alignment that would result from it. This would have -* the effect of making the whole struct target_mcontext aligned -* which breaks the layout of struct target_ucontext on ppc64. +/* +* Altivec vector registers. One extra for VRSAVE. +* On ppc32, we are already aligned to 16 bytes. We could +* use ppc_avr_t, but choose to share the same type as ppc64. */ -uint64_t altivec[QEMU_NVRREG ][2 ]; -#undef QEMU_NVRREG +uint64_t altivec[33 ][2 ]; } mc_vregs; +#endif };/* See arch/powerpc/include/asm/sigcontext.h. */
@@ -278,6 +274,7 @@ static void save_user_regs(CPUPPCState *env, struct target_mcontext *frame)__put_user ((uint32_t )env->spr[SPR_VRSAVE ], vrsave); } +#if defined(TARGET_PPC64 )/* Save VSX second halves */ if (env->insns_flags2 &PPC2_VSX ) {uint64_t *vsregs = (uint64_t *)&frame->mc_vregs.altivec[34 ];
@@ -286,6 +283,7 @@ static void save_user_regs(CPUPPCState *env, struct target_mcontext *frame) __put_user(*vsrl, &vsregs[i]); } } +#endif /* Save floating point registers. */ if (env->insns_flags &PPC_FLOAT ) {
@@ -296,22 +294,18 @@ static void save_user_regs(CPUPPCState *env, struct target_mcontext *frame)__put_user ((uint64_t ) env->fpscr, &frame->mc_fregs[32 ]); } +#if !defined(TARGET_PPC64 )/* Save SPE registers. The kernel only saves the high half. */ if (env->insns_flags &PPC_SPE ) { -#if defined(TARGET_PPC64 ) -for (i =0 ; i <ARRAY_SIZE (env->gpr); i++) { -__put_user (env->gpr[i] >>32 , &frame->mc_vregs.spe[i]); - } -#else for (i =0 ; i <ARRAY_SIZE (env->gprh); i++) {__put_user (env->gprh[i], &frame->mc_vregs.spe[i]); } -#endif /* Set MSR_SPE in the saved MSR value to indicate that frame->mc_vregs contains valid data. */ msr |=MSR_SPE ;__put_user (env->spe_fscr, &frame->mc_vregs.spe[32 ]); } +#endif /* Store MSR. */ __put_user (msr, &frame->mc_gregs[TARGET_PT_MSR ]);
@@ -392,6 +386,7 @@ static void restore_user_regs(CPUPPCState *env,__get_user (env->spr[SPR_VRSAVE ], vrsave); } +#if defined(TARGET_PPC64 )/* Restore VSX second halves */ if (env->insns_flags2 &PPC2_VSX ) {uint64_t *vsregs = (uint64_t *)&frame->mc_vregs.altivec[34 ];
@@ -400,6 +395,7 @@ static void restore_user_regs(CPUPPCState *env, __get_user(*vsrl, &vsregs[i]); } } +#endif /* Restore floating point registers. */ if (env->insns_flags &PPC_FLOAT ) {
@@ -412,22 +408,15 @@ static void restore_user_regs(CPUPPCState *env, env->fpscr = (uint32_t ) fpscr; } +#if !defined(TARGET_PPC64 )/* Save SPE registers. The kernel only saves the high half. */ if (env->insns_flags &PPC_SPE ) { -#if defined(TARGET_PPC64 ) -for (i =0 ; i <ARRAY_SIZE (env->gpr); i++) { -uint32_t hi; - -__get_user (hi, &frame->mc_vregs.spe[i]); - env->gpr[i] = ((uint64_t )hi <<32 ) | ((uint32_t ) env->gpr[i]); - } -#else for (i =0 ; i <ARRAY_SIZE (env->gprh); i++) {__get_user (env->gprh[i], &frame->mc_vregs.spe[i]); } -#endif __get_user (env->spe_fscr, &frame->mc_vregs.spe[32 ]); } +#endif }#if !defined(TARGET_PPC64 )
Signature · 1 line
2.20.1
PATCH v2 6/17 tests/docker: add docs FEATURE flag and use for test-misc
In reply to Alex BennéeThe test-misc docker test fails on a number of images which don't have the prerequisites to build the docs. Use the FEATURES flag so we can skip those tests.
As the sphinx test fails to detect whatever feature we need to get hxtool to work we drop them from debian9 so the windows build doesn't attempt to build the docs.
--- tests/docker/dockerfiles/debian10.docker | 2 ++ tests/docker/dockerfiles/debian9.docker | 2 -- tests/docker/dockerfiles/fedora.docker | 2 +- tests/docker/dockerfiles/travis.docker | 2 +- tests/docker/dockerfiles/ubuntu.docker | 2 +- tests/docker/dockerfiles/ubuntu1804.docker | 2 +- tests/docker/test-misc | 2 ++ 7 files changed, 8 insertions(+), 6 deletions(-)
tests/docker/dockerfiles/debian10.docker +2 -0
@@ -34,3 +34,5 @@ RUN apt update && \ python3-sphinx \ texinfo \ $(apt-get -s build-dep qemu | egrep ^Inst | fgrep '[all]' | cut -d\ -f2) + +ENV FEATURES docs
tests/docker/dockerfiles/debian9.docker +0 -2
@@ -30,6 +30,4 @@ RUN apt update && \ pkg-config \ psmisc \ python3 \ - python3-sphinx \ - texinfo \ $(apt-get -s build-dep qemu | egrep ^Inst | fgrep '[all]' | cut -d\ -f2)
tests/docker/dockerfiles/fedora.docker +1 -1
@@ -103,4 +103,4 @@ ENV QEMU_CONFIGURE_OPTS --python=/usr/bin/python3 RUN dnf install -y $PACKAGES RUN rpm -q $PACKAGES | sort > /packages.txt ENV PATH $PATH:/usr/libexec/python3-sphinx/ -ENV FEATURES mingw clang pyyaml asan +ENV FEATURES mingw clang pyyaml asan docs
tests/docker/dockerfiles/travis.docker +1 -1
@@ -13,5 +13,5 @@ RUN apt-get -y install device-tree-compiler python3 python3-yaml dh-autoreconf g # Travis tools require PhantomJS / Neo4j / Maven accessible # in their PATH (QEMU build won't access them). ENV PATH /usr/local/phantomjs/bin:/usr/local/phantomjs:/usr/local/neo4j-3.2.7/bin:/usr/local/maven-3.5.2/bin:/usr/local/cmake-3.9.2/bin:/usr/local/clang-5.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -ENV FEATURES clang pyyaml +ENV FEATURES clang pyyaml docs USER travis
tests/docker/dockerfiles/ubuntu.docker +1 -1
@@ -68,4 +68,4 @@ ENV PACKAGES flex bison \ RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get -y install $PACKAGES RUN dpkg -l $PACKAGES | sort > /packages.txt -ENV FEATURES clang pyyaml sdl2 +ENV FEATURES clang pyyaml sdl2 docs
tests/docker/dockerfiles/ubuntu1804.docker +1 -1
@@ -54,7 +54,7 @@ ENV PACKAGES flex bison \ RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get -y install $PACKAGES RUN dpkg -l $PACKAGES | sort > /packages.txt -ENV FEATURES clang pyyaml sdl2 +ENV FEATURES clang pyyaml sdl2 docs # https://bugs.launchpad.net/qemu/+bug/1838763 ENV QEMU_CONFIGURE_OPTS --disable-libssh
tests/docker/test-misc +2 -0
@@ -14,6 +14,8 @@ . common.rc +requires docs + cd "$BUILD_DIR" # build everything else but QEMU
Signature · 1 line
2.20.1
PATCH v2 7/17 configure: redirect sphinx-build check to config.log
In reply to Alex BennéeOtherwise it's hard to debug whats going on.
--- configure | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
configure +3 -1
@@ -4942,7 +4942,9 @@ has_sphinx_build() { # sphinx-build doesn't exist at all or if it is too old. mkdir -p "$TMPDIR1/sphinx" touch "$TMPDIR1/sphinx/index.rst" - "$sphinx_build" $sphinx_werror -c "$source_path/docs" -b html "$TMPDIR1/sphinx" "$TMPDIR1/sphinx/out" >/dev/null 2>&1 + "$sphinx_build" $sphinx_werror -c "$source_path/docs" \ + -b html "$TMPDIR1/sphinx" \ + "$TMPDIR1/sphinx/out" >> config.log 2>&1 } # Check if tools are available to build documentation.
Signature · 1 line
2.20.1
PATCH v2 8/17 configure: disable PIE for Windows builds
In reply to Alex BennéeIt seems on some compilers the test can pass but still give you broken binaries.
--- configure | 1 + 1 file changed, 1 insertion(+)
configure +1 -0
@@ -807,6 +807,7 @@ MINGW32*) audio_drv_list="" fi supported_os="yes" + pie="no" ;; GNU/kFreeBSD) bsd="yes"
Signature · 1 line
2.20.1
PATCH v2 9/17 linux-user: fix /proc/self/stat handling
In reply to Alex BennéeIn the original bug report long files names in Guix caused /proc/self/stat be truncated without the trailing ") " as specified in proc manpage which says:
(2) comm %s
The filename of the executable, in parentheses. This is visible whether or not the executable is swapped out.
In the kernel this is currently done by do_task_stat calling proc_task_name() which uses a structure limited by TASK_COMM_LEN (16).
Additionally it should only be reporting the executable name rather than the full path. Fix both these failings while cleaning up the code to use GString to build up the reported values. As the whole function is cleaned up also adjust the white space to the current coding style.
Message-ID: <[email protected]>
--- linux-user/syscall.c | 43 +++++++++++++++++++------------------------ 1 file changed, 19 insertions(+), 24 deletions(-)
linux-user/syscall.c +19 -24
@@ -7295,34 +7295,29 @@ static int open_self_stat(void *cpu_env, int fd) {CPUState *cpu =env_cpu ((CPUArchState *)cpu_env);TaskState *ts = cpu->opaque; -abi_ulong start_stack = ts->info->start_stack; +g_autoptr (GString) buf =g_string_new (NULL );int i;for (i =0 ; i <44 ; i++) { -char buf[128 ]; -int len; -uint64_t val =0 ; - -if (i ==0 ) { -/* pid */ - val =getpid (); -snprintf (buf,sizeof (buf),"%" PRId64" " , val); - }else if (i ==1 ) { -/* app name */ -snprintf (buf,sizeof (buf),"(%s) " , ts->bprm->argv[0 ]); - }else if (i ==27 ) { -/* stack bottom */ - val = start_stack; -snprintf (buf,sizeof (buf),"%" PRId64" " , val); - }else { -/* for the rest, there is MasterCard */ -snprintf (buf,sizeof (buf),"0%c" , i ==43 ?'\n' :' ' ); - } +if (i ==0 ) { +/* pid */ +g_string_printf (buf, FMT_pid" " ,getpid ()); + }else if (i ==1 ) { +/* app name */ +gchar *bin =g_strrstr (ts->bprm->argv[0 ],"/" ); + bin = bin ? bin +1 : ts->bprm->argv[0 ]; +g_string_printf (buf,"(%.15s) " , bin); + }else if (i ==27 ) { +/* stack bottom */ +g_string_printf (buf, TARGET_ABI_FMT_ld" " , ts->info->start_stack); + }else { +/* for the rest, there is MasterCard */ +g_string_printf (buf,"0%c" , i ==43 ?'\n' :' ' ); + } - len =strlen (buf); -if (write (fd, buf, len) != len) { -return -1 ; - } +if (write (fd, buf->str, buf->len) != buf->len) { +return -1 ; + } }return 0 ;
Signature · 1 line
2.20.1
PATCH v2 10/17 target/m68k/helper: Fix m68k_fpu_gdb_get_reg() use of GByteArray
In reply to Alex BennéeFrom: Philippe Mathieu-Daudé <[email protected]>
Since a010bdbe719 the gdbstub API takes a GByteArray*. Unfortunately we forgot to update the gdb_get_reg*() calls. Do it now.
Message-Id: <[email protected]>
--- target/m68k/helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
target/m68k/helper.c +2 -2
@@ -109,8 +109,8 @@ static int m68k_fpu_gdb_get_reg(CPUM68KState *env, GByteArray *mem_buf, int n) {if (n <8 ) {int len =gdb_get_reg16 (mem_buf, env->fregs[n].l.upper); - len +=gdb_get_reg16 (mem_buf + len,0 ); - len +=gdb_get_reg64 (mem_buf + len, env->fregs[n].l.lower); + len +=gdb_get_reg16 (mem_buf,0 ); + len +=gdb_get_reg64 (mem_buf, env->fregs[n].l.lower);return len; }switch (n) {
Signature · 1 line
2.20.1
PATCH v2 11/17 gdbstub: i386: Fix gdb_get_reg16() parameter to unbreak gdb
In reply to Alex BennéeFrom: Peter Xu <[email protected]>
We should only pass in gdb_get_reg16() with the GByteArray* object itself, no need to shift. Without this patch, gdb remote attach will crash QEMU:
(gdb) target remote :1234
Remote debugging using :1234
Remote communication error. Target disconnected.: Connection reset by peer.
$ qemu-system-x86_64 -m 1G -smp 4 ... -s ERROR:qemu/gdbstub.c:1843:handle_read_all_regs: assertion failed: (len == gdbserver_state.mem_buf->len) Bail out! ERROR:qemu/gdbstub.c:1843:handle_read_all_regs: assertion failed: (len == gdbserver_state.mem_buf->len)
Message-Id: <[email protected]>
---
v2
- tags and expand comment
--- target/i386/gdbstub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/i386/gdbstub.c +1 -1
@@ -106,7 +106,7 @@ int x86_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n) }else if (n >=IDX_FP_REGS && n <IDX_FP_REGS +8 ) {floatx80 *fp = (floatx80 *) &env->fpregs[n -IDX_FP_REGS ];int len =gdb_get_reg64 (mem_buf,cpu_to_le64 (fp->low)); - len +=gdb_get_reg16 (mem_buf + len,cpu_to_le16 (fp->high)); + len +=gdb_get_reg16 (mem_buf,cpu_to_le16 (fp->high));return len; }else if (n >=IDX_XMM_REGS && n <IDX_XMM_REGS +CPU_NB_REGS ) { n -=IDX_XMM_REGS ;
Signature · 1 line
2.20.1
PATCH v2 12/17 gdbstub: Do not use memset() on GByteArray
In reply to Alex BennéeFrom: Philippe Mathieu-Daudé <[email protected]>
Introduce gdb_get_zeroes() to fill a GByteArray with zeroes.
Message-Id: <[email protected]>
--- include/exec/gdbstub.h | 9 +++++++++ target/arm/gdbstub.c | 3 +-- target/xtensa/gdbstub.c | 6 ++---- 3 files changed, 12 insertions(+), 6 deletions(-)
include/exec/gdbstub.h +9 -0
@@ -125,6 +125,15 @@ static inline int gdb_get_reg128(GByteArray *buf, uint64_t val_hi,return 16 ; } +static inline int gdb_get_zeroes (GByteArray *array,size_t len) +{ +guint oldlen = array->len; +g_byte_array_set_size (array, oldlen + len); +memset (array->data + oldlen,0 , len); + +return len; +} +/** * gdb_get_reg_ptr: get pointer to start of last element * @len: length of element
target/arm/gdbstub.c +1 -2
@@ -47,8 +47,7 @@ int arm_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)if (gdb_has_xml) {return 0 ; } -memset (mem_buf,0 ,12 ); -return 12 ; +return gdb_get_zeroes (mem_buf,12 ); }switch (n) {case 24 :
target/xtensa/gdbstub.c +2 -4
@@ -105,8 +105,7 @@ int xtensa_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)default :qemu_log_mask (LOG_UNIMP ,"%s from reg %d of unsupported size %d\n" , __func__, n, reg->size); -memset (mem_buf,0 , reg->size); -return reg->size; +return gdb_get_zeroes (mem_buf, reg->size); }case xtRegisterTypeWindow:/*a*/
@@ -115,8 +114,7 @@ int xtensa_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)default :qemu_log_mask (LOG_UNIMP ,"%s from reg %d of unsupported type %d\n" , __func__, n, reg->type); -memset (mem_buf,0 , reg->size); -return reg->size; +return gdb_get_zeroes (mem_buf, reg->size); } }
Signature · 1 line
2.20.1
PATCH v2 13/17 gdbstub: Introduce gdb_get_float32() to get 32-bit float registers
In reply to Alex BennéeFrom: Philippe Mathieu-Daudé <[email protected]>
Since we now use a GByteArray, we can not use stfl_p() directly. Introduce the gdb_get_float32() helper to load a float32 register.
Message-Id: <[email protected]>
--- include/exec/gdbstub.h | 9 +++++++++ target/sh4/gdbstub.c | 6 ++---- 2 files changed, 11 insertions(+), 4 deletions(-)
include/exec/gdbstub.h +9 -0
@@ -125,6 +125,15 @@ static inline int gdb_get_reg128(GByteArray *buf, uint64_t val_hi,return 16 ; } +static inline int gdb_get_float32 (GByteArray *array,float32 val) +{ +uint8_t buf[sizeof (CPU_FloatU)]; + +stfl_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/sh4/gdbstub.c +2 -4
@@ -58,11 +58,9 @@ int superh_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)return gdb_get_regl (mem_buf, env->fpscr); case 25 ... 40:if (env->fpscr &FPSCR_FR ) { -stfl_p (mem_buf, env->fregs[n -9 ]); - }else { -stfl_p (mem_buf, env->fregs[n -25 ]); +return gdb_get_float32 (mem_buf, env->fregs[n -9 ]); } -return 4 ; +return gdb_get_float32 (mem_buf, env->fregs[n -25 ]);case 41 :return gdb_get_regl (mem_buf, env->ssr);case 42 :
Signature · 1 line
2.20.1
Re: [PATCH v2 13/17] gdbstub: Introduce gdb_get_float32() to get 32-bit float registers
Quoted 5 lines · Alex Bennée
From: Philippe Mathieu-Daudé <[email protected]>
Since we now use a GByteArray, we can not use
stfl_p()directly. Introduce thegdb_get_float32()helper to load a float32 register.
Quoted 8 lines
Fixes a010bdbe719 ("extend GByteArray to read register helpers")Signed-off-by Philippe Mathieu-Daudé <[email protected]>Signed-off-by Alex Bennée <[email protected]>Message-Id: <[email protected]>
--- include/exec/gdbstub.h | 9 +++++++++ target/sh4/gdbstub.c | 6 ++---- 2 files changed, 11 insertions(+), 4 deletions(-)
r~
PATCH v2 14/17 gdbstub: Introduce gdb_get_float64() to get 64-bit float registers
In reply to Alex BennéeFrom: 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.
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
@@ -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
@@ -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
@@ -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
@@ -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
Re: [PATCH v2 14/17] gdbstub: Introduce gdb_get_float64() to get 64-bit float registers
Quoted 12 lines · Alex Bennée
From: Philippe Mathieu-Daudé <[email protected]>
When converted to use GByteArray in commits
462474d760canda010bdbe719, the call tostfq_p()was removed. This call serialize a float.
Since we now use a GByteArray, we can not usestfq_p()directly. Introduce thegdb_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")Signed-off-by Philippe Mathieu-Daudé <[email protected]>Signed-off-by Alex Bennée <[email protected]>
Quoted 7 lines
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(-)
Not for 5.0, please.
As I mentioned in reply to Phil, this is not a bug fix. Unlike the float32 sh4 usage, the places changed properly use gdb_get_reg64().
r~
PATCH v2 15/17 target/m68k: hack around the FPU register support (HACK!)
In reply to Alex BennéeAttempting to attach to the gdbstub causes GDB to complain:
warning: Register "fp0" has an unsupported size (80 bits)
warning: Register "fp1" has an unsupported size (80 bits)
warning: Register "fp2" has an unsupported size (80 bits)
warning: Register "fp3" has an unsupported size (80 bits)
warning: Register "fp4" has an unsupported size (80 bits)
warning: Register "fp5" has an unsupported size (80 bits)
warning: Register "fp6" has an unsupported size (80 bits)
warning: Register "fp7" has an unsupported size (80 bits)
Remote 'g' packet reply is too long (expected 148 bytes, got 164 bytes): 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000$ 00000000000000000000408009f000000000800003407fffffffffffffffffff7fffffffffffffffffff7fffffffffffffffffff7fffffffffffffffffff7fffffffffffffffffff7fffffffffffffffffff7fffffff$ fffffffffff7fffffffffffffffffff000000000000000000000000
and then subsequently fail. The root problem seems to be this is an undefined size register for the target description. There does exist a floatformats_m68881_ext in GDB but setting "m68881_ext" also fails as the only "weird" tdesc types gdb seems to understand are:
{ "arm_fpa_ext", TDESC_TYPE_ARM_FPA_EXT },
{ "i387_ext", TDESC_TYPE_I387_EXT }
So present the register as a i386_ext as some sort of hack. The values are garbage but at least we can continue to connect. Perhaps we should just delete the code because I don't think this ever worked with upstream tools.
--- target/m68k/helper.c | 11 +++++------ gdb-xml/m68k-fp.xml | 16 ++++++++-------- 2 files changed, 13 insertions(+), 14 deletions(-)
target/m68k/helper.c +5 -6
@@ -109,9 +109,8 @@ static int cf_fpu_gdb_set_reg(CPUM68KState *env, uint8_t *mem_buf, int n)static int m68k_fpu_gdb_get_reg (CPUM68KState *env,GByteArray *mem_buf,int n) {if (n <8 ) { -int len =gdb_get_reg16 (mem_buf, env->fregs[n].l.upper); - len +=gdb_get_reg16 (mem_buf,0 ); - len +=gdb_get_reg64 (mem_buf, env->fregs[n].l.lower); +int len =gdb_get_reg64 (mem_buf,cpu_to_le64 (env->fregs[n].l.lower)); + len +=gdb_get_reg16 (mem_buf,cpu_to_le16 (env->fregs[n].l.upper));return len; }switch (n) {
@@ -128,9 +127,9 @@ static int m68k_fpu_gdb_get_reg(CPUM68KState *env, GByteArray *mem_buf, int n)static int m68k_fpu_gdb_set_reg (CPUM68KState *env,uint8_t *mem_buf,int n) {if (n <8 ) { - env->fregs[n].l.upper =lduw_be_p (mem_buf); - env->fregs[n].l.lower =ldq_be_p (mem_buf +4 ); -return 12 ; + env->fregs[n].l.lower =le64_to_cpu (* (uint64_t *) mem_buf); + env->fregs[n].l.upper =le16_to_cpu (* (uint16_t *) (mem_buf +8 )); +return 10 ; }switch (n) {case 8 :/* fpcontrol */
gdb-xml/m68k-fp.xml +8 -8
@@ -6,14 +6,14 @@ notice and this notice are preserved. --> <!DOCTYPE feature SYSTEM "gdb-target.dtd"> <feature name="org.gnu.gdb.coldfire.fp"> - <reg name="fp0" bitsize="96" type="float" group="float"/> - <reg name="fp1" bitsize="96" type="float" group="float"/> - <reg name="fp2" bitsize="96" type="float" group="float"/> - <reg name="fp3" bitsize="96" type="float" group="float"/> - <reg name="fp4" bitsize="96" type="float" group="float"/> - <reg name="fp5" bitsize="96" type="float" group="float"/> - <reg name="fp6" bitsize="96" type="float" group="float"/> - <reg name="fp7" bitsize="96" type="float" group="float"/> + <reg name="fp0" bitsize="80" type="i387_ext" group="float"/> + <reg name="fp1" bitsize="80" type="i387_ext" group="float"/> + <reg name="fp2" bitsize="80" type="i387_ext" group="float"/> + <reg name="fp3" bitsize="80" type="i387_ext" group="float"/> + <reg name="fp4" bitsize="80" type="i387_ext" group="float"/> + <reg name="fp5" bitsize="80" type="i387_ext" group="float"/> + <reg name="fp6" bitsize="80" type="i387_ext" group="float"/> + <reg name="fp7" bitsize="80" type="i387_ext" group="float"/> <reg name="fpcontrol" bitsize="32" group="float"/> <reg name="fpstatus" bitsize="32" group="float"/>,
Signature · 1 line
2.20.1
PATCH v2 16/17 tests/tcg: drop inferior.was_attached() test
In reply to Alex BennéeThis 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
@@ -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
@@ -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
PATCH v2 17/17 tests/tcg: add a multiarch linux-user gdb test
In reply to Alex BennéeWhen 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.
--- tests/tcg/multiarch/Makefile.target | 15 ++++++ tests/tcg/multiarch/gdbstub/sha1.py | 81 +++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 tests/tcg/multiarch/gdbstub/sha1.py
tests/tcg/multiarch/Makefile.target +15 -0
@@ -42,5 +42,20 @@ 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 + +MULTIARCH_TESTS += gdbstub-sha1 + +.PHONY: gdbstub-sha1 +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") +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
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 v2 for 5.0-rc3 00/17] more randome fixes (user, pie, docker and gdbstub)
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 ===
Switched to a new branch 'test'
1d9b560 tests/tcg: add a multiarch linux-user gdb test
0421111 tests/tcg: drop inferior.was_attached() test
d252cf5 target/m68k: hack around the FPU register support (HACK!) fe2d373 gdbstub: Introduce gdb_get_float64() to get 64-bit float registers a067a36 gdbstub: Introduce gdb_get_float32() to get 32-bit float registers 22159df gdbstub: Do not use memset() on GByteArray
0440574 gdbstub: i386: Fix gdb_get_reg16() parameter to unbreak gdb 661c288 target/m68k/helper: Fix m68k_fpu_gdb_get_reg() use of GByteArray 6d7f04a linux-user: fix /proc/self/stat handling
8077d16 configure: disable PIE for Windows builds
3525a95 configure: redirect sphinx-build check to config.log d7cc6ea tests/docker: add docs FEATURE flag and use for test-misc 2faca0a linux-user/ppc: Fix padding in mcontext_t for ppc64 bd002dd .gitignore: include common build sub-directories 2cb4915 accel/tcg: Relax va restrictions on 64-bit guests b81214a exec/cpu-all: Use bool for have_guest_base
56dda0e linux-user: completely re-write init_guest_space
=== OUTPUT BEGIN ===
1/17 Checking commit 56dda0ee6d96 (linux-user: completely re-write init_guest_space) 2/17 Checking commit b81214a4a7b1 (exec/cpu-all: Use bool for have_guest_base) 3/17 Checking commit 2cb4915f8641 (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/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
4/17 Checking commit bd002dddde97 (.gitignore: include common build sub-directories) 5/17 Checking commit 2faca0a20813 (linux-user/ppc: Fix padding in mcontext_t for ppc64) 6/17 Checking commit d7cc6eab6083 (tests/docker: add docs FEATURE flag and use for test-misc) 7/17 Checking commit 3525a9514500 (configure: redirect sphinx-build check to config.log) 8/17 Checking commit 8077d168511c (configure: disable PIE for Windows builds)
9/17 Checking commit 6d7f04aaf64a (linux-user: fix /proc/self/stat handling)
10/17 Checking commit 661c288d6e96 (target/m68k/helper: Fix m68k_fpu_gdb_get_reg() use of GByteArray) 11/17 Checking commit 04405743253c (gdbstub: i386: Fix gdb_get_reg16() parameter to unbreak gdb) 12/17 Checking commit 22159df16cb9 (gdbstub: Do not use memset() on GByteArray)
13/17 Checking commit a067a369add1 (gdbstub: Introduce gdb_get_float32() to get 32-bit float registers) 14/17 Checking commit fe2d3733f79b (gdbstub: Introduce gdb_get_float64() to get 64-bit float registers) 15/17 Checking commit d252cf53d601 (target/m68k: hack around the FPU register support (HACK!))
ERROR: space prohibited after that '*' (ctx:BxW)
#88: FILE: target/m68k/helper.c:130:
+ env->fregs[n].l.lower = le64_to_cpu(* (uint64_t *) mem_buf);
^ERROR: space prohibited after that '*' (ctx:BxW)
#89: FILE: target/m68k/helper.c:131:
+ env->fregs[n].l.upper = le16_to_cpu(* (uint16_t *) (mem_buf + 8));
^total: 2 errors, 0 warnings, 45 lines checked
Patch 15/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
16/17 Checking commit 04211112b3bd (tests/tcg: drop inferior.was_attached() test) 17/17 Checking commit 1d9b560da197 (tests/tcg: add a multiarch linux-user gdb test)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #40:
new file mode 100644
total: 0 errors, 1 warnings, 101 lines checked
Patch 17/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
=== 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]