Skip to content
Snippets Groups Projects
  1. Jan 22, 2018
    • Max Filippov's avatar
      target/xtensa: disas/xtensa: fix coverity warnings · 847a6473
      Max Filippov authored
      
      Coverity warnings CID 1385146, 1385148 1385149 and 1385150 point that
      xtensa_opcode_num_operands and xtensa_format_num_slots may return -1
      even when xtensa_opcode_decode and xtensa_format_decode succeed. In that
      case unsigned counters used to iterate through operands/slots will not
      do the right thing.
      Make counters and loop bounds signed to fix the warnings.
      
      Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      847a6473
  2. Jan 16, 2018
    • Marc-André Lureau's avatar
      disas/s390: fix global-buffer-overflow · 02a2ad21
      Marc-André Lureau authored
      Spotted thanks to ASAN:
      
      ==25226==ERROR: AddressSanitizer: global-buffer-overflow on address 0x556715a1f120 at pc 0x556714b6f6b1 bp 0x7ffcdfac1360 sp 0x7ffcdfac1350
      READ of size 1 at 0x556715a1f120 thread T0
          #0 0x556714b6f6b0 in init_disasm /home/elmarco/src/qemu/disas/s390.c:219
          #1 0x556714b6fa6a in print_insn_s390 /home/elmarco/src/qemu/disas/s390.c:294
          #2 0x55671484d031 in monitor_disas /home/elmarco/src/qemu/disas.c:635
          #3 0x556714862ec0 in memory_dump /home/elmarco/src/qemu/monitor.c:1324
          #4 0x55671486342a in hmp_memory_dump /home/elmarco/src/qemu/monitor.c:1418
          #5 0x5567148670be in handle_hmp_command /home/elmarco/src/qemu/monitor.c:3109
          #6 0x5567148674ed in qmp_human_monitor_command /home/elmarco/src/qemu/monitor.c:613
          #7 0x556714b00918 in qmp_marshal_human_monitor_command /home/elmarco/src/qemu/build/qmp-marshal.c:1704
          #8 0x556715138a3e in do_qmp_dispatch /home/elmarco/src/qemu/qapi/qmp-dispatch.c:104
          #9 0x556715138f83 in qmp_dispatch /home/elmarco/src/qemu/qapi/qmp-dispatch.c:131
          #10 0x55671485cf88 in handle_qmp_command /home/elmarco/src/qemu/monitor.c:3839
          #11 0x55671514e80b in json_message_process_token /home/elmarco/src/qemu/qobject/json-streamer.c:105
          #12 0x5567151bf2dc in json_lexer_feed_char /home/elmarco/src/qemu/qobject/json-lexer.c:323
          #13 0x5567151bf827 in json_lexer_feed /home/elmarco/src/qemu/qobject/json-lexer.c:373
          #14 0x55671514ee62 in json_message_parser_feed /home/elmarco/src/qemu/qobject/json-streamer.c:124
          #15 0x556714854b1f in monitor_qmp_read /home/elmarco/src/qemu/monitor.c:3881
          #16 0x556715045440 in qemu_chr_be_write_impl /home/elmarco/src/qemu/chardev/char.c:172
          #17 0x556715047184 in qemu_chr_be_write /home/elmarco/src/qemu/chardev/char.c:184
          #18 0x55671505a8e6 in tcp_chr_read /home/elmarco/src/qemu/chardev/char-socket.c:440
          #19 0x5567150943c3 in qio_channel_fd_source_dispatch /home/elmarco/src/qemu/io/channel-watch.c:84
          #20 0x7fb90292b90b in g_main_dispatch ../glib/gmain.c:3182
          #21 0x7fb90292c7ac in g_main_context_dispatch ../glib/gmain.c:3847
          #22 0x556715162eca in glib_pollfds_poll /home/elmarco/src/qemu/util/main-loop.c:214
          #23 0x556715163001 in os_host_main_loop_wait /home/elmarco/src/qemu/util/main-loop.c:261
          #24 0x5567151631fa in main_loop_wait /home/elmarco/src/qemu/util/main-loop.c:515
          #25 0x556714ad6d3b in main_loop /home/elmarco/src/qemu/vl.c:1950
          #26 0x556714ade329 in main /home/elmarco/src/qemu/vl.c:4865
          #27 0x7fb8fe5c9009 in __libc_start_main (/lib64/libc.so.6+0x21009)
          #28 0x5567147af4d9 in _start (/home/elmarco/src/qemu/build/s390x-softmmu/qemu-system-s390x+0xf674d9)
      
      0x556715a1f120 is located 32 bytes to the left of global variable 'char_hci_type_info' defined in '/home/elmarco/src/qemu/hw/bt/hci-csr.c:493:23' (0x556715a1f140) of size 104
      0x556715a1f120 is located 8 bytes to the right of global variable 's390_opcodes' defined in '/home/elmarco/src/qemu/disas/s390.c:860:33' (0x556715a15280) of size 40600
      
      This fix is based on Andreas Arnez <arnez@linux.vnet.ibm.com> upstream
      commit:
      https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=9ace48f3d7d80ce09c5df60cccb433470410b11b
      
      
      
      2014-08-19  Andreas Arnez  <arnez@linux.vnet.ibm.com>
      
             * s390-dis.c (init_disasm): Simplify initialization of
             opc_index[].  This also fixes an access after the last element
             of s390_opcodes[].
      
      Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <20180104160523.22995-19-marcandre.lureau@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      02a2ad21
  3. Jan 09, 2018
  4. Dec 18, 2017
  5. Oct 25, 2017
  6. Sep 06, 2017
  7. Sep 05, 2017
  8. Jul 04, 2017
  9. Jun 07, 2017
    • Bruno Dominguez's avatar
      configure: split c and cxx extra flags · 11cde1c8
      Bruno Dominguez authored
      
      There was no possibility to add specific cxx flags using the configure
      file. So A new entrance has been created to support it.
      
      Duplication of information in configure and rules.mak. Taking
      QEMU_CFLAGS and add them to QEMU_CXXFLAGS, now the value of
      QEMU_CXXFLAGS is stored in config-host.mak, so there is no need for
      it.
      
      The makefile for libvixl was adding flags for QEMU_CXXFLAGS in
      QEMU_CFLAGS because of the addition in rules.mak. That was removed, so
      adding them where it should be.
      
      Signed-off-by: default avatarBruno Dominguez <bru.dominguez@gmail.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Message-id: 1496754467-20893-1-git-send-email-bru.dominguez@gmail.com
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      11cde1c8
  10. Jun 02, 2017
  11. Apr 03, 2017
  12. Mar 24, 2017
    • Peter Maydell's avatar
      disas/microblaze: Remove unused REG_PC define · bd517b43
      Peter Maydell authored
      
      The REG_PC define in disas/microblaze.c clashes with a define in
      the Linux SPARC system headers:
      
      /home/pm215/qemu/disas/microblaze.c:162:0: error: "REG_PC" redefined [-Werror]
       #define REG_PC  32 /* PC */
      
      In file included from /usr/include/signal.h:326:0,
                       from /home/pm215/qemu/include/qemu/osdep.h:86,
                       from /home/pm215/qemu/disas/microblaze.c:36:
      /usr/include/sparc64-linux-gnu/sys/ucontext.h:96:0: note: this is the location of the previous definition
       #define REG_PC  (1)
      
      Since the code doesn't actually use the REG_PC define
      anywhere, the simplest fix is just to remove it.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarEdgar E. Iglesias <edgar.iglesias@xilinx.com>
      Message-id: 1490272961-1128-1-git-send-email-peter.maydell@linaro.org
      bd517b43
  13. Mar 07, 2017
  14. Jan 30, 2017
  15. Jan 24, 2017
    • Marek Vasut's avatar
      nios2: Add disas entries · 3f0c3423
      Marek Vasut authored
      
      Add nios2 disassembler support. This patch is composed from binutils files
      from commit "Opcodes and assembler support for Nios II R2". The files from
      binutils used in this patch are:
      
          include/opcode/nios2.h
          include/opcode/nios2r1.h
          include/opcode/nios2r2.h
          opcodes/nios2-opc.c
          opcodes/nios2-dis.c
      
      Checkpatch says total: 114 errors, 0 warnings, 3609 lines checked , which
      is caused by a different coding style in those files. These warnings and
      errors are not addressed To let these files be easily synchronized between
      binutils and qemu.
      
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Cc: Chris Wulff <crwulff@gmail.com>
      Cc: Jeff Da Silva <jdasilva@altera.com>
      Cc: Ley Foon Tan <lftan@altera.com>
      Cc: Sandra Loosemore <sandra@codesourcery.com>
      Cc: Yves Vandervennet <yvanderv@altera.com>
      Reviewed-by: default avatarAlexander Graf <agraf@suse.de>
      Message-Id: <20170118220146.489-2-marex@denx.de>
      Signed-off-by: default avatarRichard Henderson <rth@twiddle.net>
      3f0c3423
    • Peter Maydell's avatar
      disas/cris.c: Fix Coverity warning about unchecked NULL · e1107884
      Peter Maydell authored
      
      Coverity (CID 1005689) warns that we don't check that
      spec_reg_info() returned non-NULL before dereferencing.
      Add the check, though as the comment notes this is
      a can't-really-happen case because the earlier constraint
      matching should have ruled out the "unknown reg" case.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarEdgar E. Iglesias <edgar.iglesias@xilinx.com>
      Signed-off-by: default avatarMichael Tokarev <mjt@tls.msk.ru>
      e1107884
  16. Jan 23, 2017
  17. Jan 10, 2017
  18. Dec 20, 2016
    • Yuval Shaia's avatar
    • Thomas Huth's avatar
      Move target-* CPU file into a target/ folder · fcf5ef2a
      Thomas Huth authored
      
      We've currently got 18 architectures in QEMU, and thus 18 target-xxx
      folders in the root folder of the QEMU source tree. More architectures
      (e.g. RISC-V, AVR) are likely to be included soon, too, so the main
      folder of the QEMU sources slowly gets quite overcrowded with the
      target-xxx folders.
      To disburden the main folder a little bit, let's move the target-xxx
      folders into a dedicated target/ folder, so that target-xxx/ simply
      becomes target/xxx/ instead.
      
      Acked-by: Laurent Vivier <laurent@vivier.eu> [m68k part]
      Acked-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> [tricore part]
      Acked-by: Michael Walle <michael@walle.cc> [lm32 part]
      Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> [s390x part]
      Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com> [s390x part]
      Acked-by: Eduardo Habkost <ehabkost@redhat.com> [i386 part]
      Acked-by: Artyom Tarasenko <atar4qemu@gmail.com> [sparc part]
      Acked-by: Richard Henderson <rth@twiddle.net> [alpha part]
      Acked-by: Max Filippov <jcmvbkbc@gmail.com> [xtensa part]
      Reviewed-by: David Gibson <david@gibson.dropbear.id.au> [ppc part]
      Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> [cris&microblaze part]
      Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn> [unicore32 part]
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      fcf5ef2a
  19. Nov 14, 2016
  20. Sep 22, 2016
  21. Sep 15, 2016
  22. Jul 19, 2016
  23. Jul 18, 2016
  24. May 20, 2016
  25. May 19, 2016
  26. Mar 22, 2016
Loading