Skip to content
Snippets Groups Projects
  1. Jan 08, 2022
  2. Oct 22, 2021
  3. Oct 06, 2021
  4. Aug 12, 2021
  5. May 25, 2021
    • Philippe Mathieu-Daudé's avatar
      disas/libvixl: Protect C system header for C++ compiler · 2fed21d2
      Philippe Mathieu-Daudé authored
      When selecting an ARM target on Debian unstable, we get:
      
        Compiling C++ object libcommon.fa.p/disas_libvixl_vixl_utils.cc.o
        FAILED: libcommon.fa.p/disas_libvixl_vixl_utils.cc.o
        c++ -Ilibcommon.fa.p -I. -I.. [...] -o libcommon.fa.p/disas_libvixl_vixl_utils.cc.o -c ../disas/libvixl/vixl/utils.cc
        In file included from /home/philmd/qemu/disas/libvixl/vixl/utils.h:30,
                         from ../disas/libvixl/vixl/utils.cc:27:
        /usr/include/string.h:36:43: error: missing binary operator before token "("
           36 | #if defined __cplusplus && (__GNUC_PREREQ (4, 4) \
              |                                           ^
        /usr/include/string.h:53:62: error: missing binary operator before token "("
           53 | #if defined __USE_MISC || defined __USE_XOPEN || __GLIBC_USE (ISOC2X)
              |                                                              ^
        /usr/include/string.h:165:21: error: missing binary operator before token "("
          165 |      || __GLIBC_USE (LIB_EXT2) || __GLIBC_USE (ISOC2X))
              |                     ^
        /usr/include/string.h:174:43: error: missing binary operator before token "("
          174 | #if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2) || __GLIBC_USE (ISOC2X)
              |                                           ^
        /usr/include/string.h:492:19: error: missing binary operator before token "("
          492 | #if __GNUC_PREREQ (3,4)
              |                   ^
      
      Relevant information from the host:
      
        $ lsb_release -d
        Description:    Debian GNU/Linux 11 (bullseye)
        $ gcc --version
        gcc (Debian 10.2.1-6) 10.2.1 20210110
        $ dpkg -S /usr/include/string.h
        libc6-dev: /usr/include/string.h
        $ apt-cache show libc6-dev
        Package: libc6-dev
        Version: 2.31-11
      
      Partially cherry-pick vixl commit 78973f258039f6e96 [*]:
      
        Refactor VIXL to use `extern` block when including C header
        that do not have a C++ counterpart.
      
      which is similar to commit 875df03b ('osdep: protect qemu/osdep.h
      with extern "C"').
      
      [*] https://git.linaro.org/arm/vixl.git/commit/?id=78973f258039f6e96
      
      Buglink: https://bugs.launchpad.net/qemu/+bug/1914870
      
      
      Suggested-by: default avatarThomas Huth <thuth@redhat.com>
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
      Message-id: 20210516171023.510778-1-f4bug@amsat.org
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      2fed21d2
  6. May 12, 2021
  7. May 10, 2021
  8. Apr 17, 2021
    • Paolo Bonzini's avatar
      osdep: protect qemu/osdep.h with extern "C" · 875df03b
      Paolo Bonzini authored
      
      System headers may include templates if compiled with a C++ compiler,
      which cause the compiler to complain if qemu/osdep.h is included
      within a C++ source file's 'extern "C"' block.  Add
      an 'extern "C"' block directly to qemu/osdep.h, so that
      system headers can be kept out of it.
      
      There is a stray declaration early in qemu/osdep.h, which needs
      to be special cased.  Add a definition in qemu/compiler.h to
      make it look nice.
      
      config-host.h, CONFIG_TARGET, exec/poison.h and qemu/compiler.h
      are included outside the 'extern "C"' block; that is not
      an issue because they consist entirely of preprocessor directives.
      
      This allows us to move the include of osdep.h in our two C++
      source files outside the extern "C" block they were previously
      using for it, which in turn means that they compile successfully
      against newer versions of glib which insist that glib.h is
      *not* inside an extern "C" block.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      Acked-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20210416135543.20382-3-peter.maydell@linaro.org
      [PMM: Moved disas/arm-a64.cc osdep.h include out of its extern "C" block;
       explained in commit message why we're doing this]
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      875df03b
  9. Mar 17, 2021
  10. Mar 09, 2021
  11. Feb 18, 2021
  12. Jan 21, 2021
  13. Jan 07, 2021
  14. Dec 18, 2020
  15. Nov 15, 2020
  16. Nov 02, 2020
    • Peter Maydell's avatar
      disas/capstone: Fix monitor disassembly of >32 bytes · 437588d8
      Peter Maydell authored
      If we're using the capstone disassembler, disassembly of a run of
      instructions more than 32 bytes long disassembles the wrong data for
      instructions beyond the 32 byte mark:
      
      (qemu) xp /16x 0x100
      0000000000000100: 0x00000005 0x54410001 0x00000001 0x00001000
      0000000000000110: 0x00000000 0x00000004 0x54410002 0x3c000000
      0000000000000120: 0x00000000 0x00000004 0x54410009 0x74736574
      0000000000000130: 0x00000000 0x00000000 0x00000000 0x00000000
      (qemu) xp /16i 0x100
      0x00000100: 00000005 andeq r0, r0, r5
      0x00000104: 54410001 strbpl r0, [r1], #-1
      0x00000108: 00000001 andeq r0, r0, r1
      0x0000010c: 00001000 andeq r1, r0, r0
      0x00000110: 00000000 andeq r0, r0, r0
      0x00000114: 00000004 andeq r0, r0, r4
      0x00000118: 54410002 strbpl r0, [r1], #-2
      0x0000011c: 3c000000 .byte 0x00, 0x00, 0x00, 0x3c
      0x00000120: 54410001 strbpl r0, [r1], #-1
      0x00000124: 00000001 andeq r0, r0, r1
      0x00000128: 00001000 andeq r1, r0, r0
      0x0000012c: 00000000 andeq r0, r0, r0
      0x00000130: 00000004 andeq r0, r0, r4
      0x00000134: 54410002 strbpl r0, [r1], #-2
      0x00000138: 3c000000 .byte 0x00, 0x00, 0x00, 0x3c
      0x0000013c: 00000000 andeq r0, r0, r0
      
      Here the disassembly of 0x120..0x13f is using the data that is in
      0x104..0x123.
      
      This is caused by passing the wrong value to the read_memory_func().
      The intention is that at this point in the loop the 'cap_buf' buffer
      already contains 'csize' bytes of data for the instruction at guest
      addr 'pc', and we want to read in an extra 'tsize' bytes.  Those
      extra bytes are therefore at 'pc + csize', not 'pc'.  On the first
      time through the loop 'csize' happens to be zero, so the initial read
      of 32 bytes into cap_buf is correct and as long as the disassembly
      never needs to read more data we return the correct information.
      
      Use the correct guest address in the call to read_memory_func().
      
      Cc: qemu-stable@nongnu.org
      Fixes: https://bugs.launchpad.net/qemu/+bug/1900779
      
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-id: 20201022132445.25039-1-peter.maydell@linaro.org
      437588d8
  17. Oct 03, 2020
  18. Sep 17, 2020
  19. Sep 08, 2020
  20. Aug 21, 2020
  21. Jul 13, 2020
  22. Jan 29, 2020
  23. Dec 17, 2019
    • Paolo Bonzini's avatar
      libvixl: remove per-target compiler flags · 53422040
      Paolo Bonzini authored
      
      We are already including -D__STDC_LIMIT_MACROS in the global CXXFLAGS,
      so it makes sense to do the same for -D__STDC_CONSTANT_MACROS and
      -D__STDC_FORMAT_MACROS instead of limiting that to libvixl.
      
      The -Wno-sign-compare option can also be removed since GCC 4.6 is not
      supported anymore.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      53422040
  24. Oct 04, 2019
  25. Aug 21, 2019
    • Paul A. Clarke's avatar
      ppc: Add support for 'mffsl' instruction · 31eb7ddd
      Paul A. Clarke authored
      
      ISA 3.0B added a set of Floating-Point Status and Control Register (FPSCR)
      instructions: mffsce, mffscdrn, mffscdrni, mffscrn, mffscrni, mffsl.
      This patch adds support for 'mffsl'.
      
      'mffsl' is identical to 'mffs', except it only returns mode, status, and enable
      bits from the FPSCR.
      
      On CPUs without support for 'mffsl' (below ISA 3.0), the 'mffsl' instruction
      will execute identically to 'mffs'.
      
      Note: I renamed FPSCR_RN to FPSCR_RN0 so I could create an FPSCR_RN mask which
      is both bits of the FPSCR rounding mode, as defined in the ISA.
      
      I also fixed a typo in the definition of FPSCR_FR.
      
      Signed-off-by: default avatarPaul A. Clarke <pc@us.ibm.com>
      
      v4:
      - nit: added some braces to resolve a checkpatch complaint.
      
      v3:
      - Changed tcg_gen_and_i64 to tcg_gen_andi_i64, eliminating the need for a
        temporary, per review from Richard Henderson.
      
      v2:
      - I found that I copied too much of the 'mffs' implementation.
        The 'Rc' condition code bits are not needed for 'mffsl'.  Removed.
      - I now free the (renamed) 'tmask' temporary.
      - I now bail early for older ISA to the original 'mffs' implementation.
      
      Message-Id: <1565982203-11048-1-git-send-email-pc@us.ibm.com>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      31eb7ddd
  26. Jun 27, 2019
  27. Jun 12, 2019
    • Markus Armbruster's avatar
      Include qemu-common.h exactly where needed · a8d25326
      Markus Armbruster authored
      
      No header includes qemu-common.h after this commit, as prescribed by
      qemu-common.h's file comment.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190523143508.25387-5-armbru@redhat.com>
      [Rebased with conflicts resolved automatically, except for
      include/hw/arm/xlnx-zynqmp.h hw/arm/nrf51_soc.c hw/arm/msf2-soc.c
      block/qcow2-refcount.c block/qcow2-cluster.c block/qcow2-cache.c
      target/arm/cpu.h target/lm32/cpu.h target/m68k/cpu.h target/mips/cpu.h
      target/moxie/cpu.h target/nios2/cpu.h target/openrisc/cpu.h
      target/riscv/cpu.h target/tilegx/cpu.h target/tricore/cpu.h
      target/unicore32/cpu.h target/xtensa/cpu.h; bsd-user/main.c and
      net/tap-bsd.c fixed up]
      a8d25326
  28. May 13, 2019
  29. Apr 18, 2019
  30. Mar 19, 2019
  31. Mar 05, 2019
  32. Feb 27, 2019
  33. Jan 24, 2019
  34. Jan 11, 2019
  35. Jan 03, 2019
Loading