Skip to content
Snippets Groups Projects
  1. Jan 13, 2021
  2. Jan 11, 2021
  3. Jan 08, 2021
  4. Jan 07, 2021
  5. Jan 06, 2021
  6. Jan 04, 2021
  7. Jan 02, 2021
    • Richard Henderson's avatar
      util: Extract flush_icache_range to cacheflush.c · 084cfca1
      Richard Henderson authored
      
      This has been a tcg-specific function, but is also in use
      by hardware accelerators via physmem.c.  This can cause
      link errors when tcg is disabled.
      
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Reviewed-by: default avatarJoelle van Dyne <j@getutm.app>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <20201214140314.18544-3-richard.henderson@linaro.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      084cfca1
    • Daniele Buono's avatar
      cfi: Initial support for cfi-icall in QEMU · c905a368
      Daniele Buono authored
      
      LLVM/Clang, supports runtime checks for forward-edge Control-Flow
      Integrity (CFI).
      
      CFI on indirect function calls (cfi-icall) ensures that, in indirect
      function calls, the function called is of the right signature for the
      pointer type defined at compile time.
      
      For this check to work, the code must always respect the function
      signature when using function pointer, the function must be defined
      at compile time, and be compiled with link-time optimization.
      
      This rules out, for example, shared libraries that are dynamically loaded
      (given that functions are not known at compile time), and code that is
      dynamically generated at run-time.
      
      This patch:
      
      1) Introduces the CONFIG_CFI flag to support cfi in QEMU
      
      2) Introduces a decorator to allow the definition of "sensitive"
      functions, where a non-instrumented function may be called at runtime
      through a pointer. The decorator will take care of disabling cfi-icall
      checks on such functions, when cfi is enabled.
      
      3) Marks functions currently in QEMU that exhibit such behavior,
      in particular:
      - The function in TCG that calls pre-compiled TBs
      - The function in TCI that interprets instructions
      - Functions in the plugin infrastructures that jump to callbacks
      - Functions in util that directly call a signal handler
      
      Signed-off-by: default avatarDaniele Buono <dbuono@linux.vnet.ibm.com>
      Acked-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Message-Id: <20201204230615.2392-3-dbuono@linux.vnet.ibm.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      c905a368
  8. Dec 19, 2020
    • Markus Armbruster's avatar
      keyval: Use GString to accumulate value strings · 7ece4211
      Markus Armbruster authored
      
      QString supports modifying its string, but it's quite limited: you can
      only append.  The remaining callers use it for building an initial
      string, never for modifying it later.
      
      Change keyval_parse_one() to do build the initial string with GString.
      This is another step towards making QString immutable.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20201211171152.146877-19-armbru@redhat.com>
      7ece4211
    • Eric Blake's avatar
      qapi: Use QAPI_LIST_PREPEND() where possible · 54aa3de7
      Eric Blake authored
      
      Anywhere we create a list of just one item or by prepending items
      (typically because order doesn't matter), we can use
      QAPI_LIST_PREPEND().  But places where we must keep the list in order
      by appending remain open-coded until later patches.
      
      Note that as a side effect, this also performs a cleanup of two minor
      issues in qga/commands-posix.c: the old code was performing
       new = g_malloc0(sizeof(*ret));
      which 1) is confusing because you have to verify whether 'new' and
      'ret' are variables with the same type, and 2) would conflict with C++
      compilation (not an actual problem for this file, but makes
      copy-and-paste harder).
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Message-Id: <20201113011340.463563-5-eblake@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Acked-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      [Straightforward conflicts due to commit a8aa94b5 "qga: update
      schema for guest-get-disks 'dependents' field" and commit a10b453a
      "target/mips: Move mips_cpu_add_definition() from helper.c to cpu.c"
      resolved.  Commit message tweaked.]
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      54aa3de7
  9. Dec 15, 2020
  10. Dec 10, 2020
    • Paolo Bonzini's avatar
      config-file: move -set implementation to vl.c · ed7fa564
      Paolo Bonzini authored
      
      We want to make it independent of QemuOpts.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      ed7fa564
    • Paolo Bonzini's avatar
      qemu-option: restrict qemu_opts_set to merge-lists QemuOpts · 32c02fdd
      Paolo Bonzini authored
      
      qemu_opts_set is used to create default network backends and to
      parse sugar options -kernel, -initrd, -append, -bios and -dtb.
      These are very different uses:
      
      I would *expect* a function named qemu_opts_set to set an option in a
      merge-lists QemuOptsList, such as -kernel, and possibly to set an option
      in a non-merge-lists QemuOptsList with non-NULL id, similar to -set.
      
      However, it wouldn't *work* to use qemu_opts_set for the latter
      because qemu_opts_set uses fail_if_exists==1. So, for non-merge-lists
      QemuOptsList and non-NULL id, the semantics of qemu_opts_set (fail if the
      (QemuOptsList, id) pair already exists) are debatable.
      
      On the other hand, I would not expect qemu_opts_set to create a
      non-merge-lists QemuOpts with a single option; which it does, though.
      For this case of non-merge-lists QemuOptsList and NULL id, qemu_opts_set
      hardly adds value over qemu_opts_parse.  It does skip some parsing and
      unescaping, but that's not needed when creating default network
      backends.
      
      So qemu_opts_set has warty behavior for non-merge-lists QemuOptsList
      if id is non-NULL, and it's mostly pointless if id is NULL.  My
      solution to keeping the API as simple as possible is to limit
      qemu_opts_set to merge-lists QemuOptsList.  For them, it's useful (we
      don't want comma-unescaping for -kernel) *and* has sane semantics.
      Network backend creation is switched to qemu_opts_parse.
      
      qemu_opts_set is now only used on merge-lists QemuOptsList... except
      in the testcase, which is changed to use a merge-list QemuOptsList.
      
      With this change we can also remove the id parameter.  With the
      parameter always NULL, we know that qemu_opts_create cannot fail
      and can pass &error_abort to it.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      32c02fdd
    • Markus Armbruster's avatar
      Clean up includes · 4bd802b2
      Markus Armbruster authored
      
      Clean up includes so that osdep.h is included first and headers
      which it implies are not included manually.
      
      This commit was created with scripts/clean-includes, with the changes
      to the following files manually reverted:
      
          contrib/libvhost-user/libvhost-user-glib.h
          contrib/libvhost-user/libvhost-user.c
          contrib/libvhost-user/libvhost-user.h
          contrib/plugins/hotblocks.c
          contrib/plugins/hotpages.c
          contrib/plugins/howvec.c
          contrib/plugins/lockstep.c
          linux-user/mips64/cpu_loop.c
          linux-user/mips64/signal.c
          linux-user/sparc64/cpu_loop.c
          linux-user/sparc64/signal.c
          linux-user/x86_64/cpu_loop.c
          linux-user/x86_64/signal.c
          target/s390x/gen-features.c
          tests/fp/platform.h
          tests/migration/s390x/a-b-bios.c
          tests/plugin/bb.c
          tests/plugin/empty.c
          tests/plugin/insn.c
          tests/plugin/mem.c
          tests/test-rcu-simpleq.c
          tests/test-rcu-slist.c
          tests/test-rcu-tailq.c
          tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c
      
      contrib/plugins/, tests/plugin/, and tests/test-rcu-slist.c appear not
      to include osdep.h intentionally.  The remaining reverts are the same
      as in commit bbfff196.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20201113061216.2483385-1-armbru@redhat.com>
      Acked-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Acked-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Tested-by: default avatarThomas Huth <thuth@redhat.com>
      Acked-by: default avatarCornelia Huck <cohuck@redhat.com>
      Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Acked-by: default avatarAlexander Bulekov <alxndr@bu.edu>
      4bd802b2
  11. Nov 17, 2020
  12. Nov 16, 2020
    • David Hildenbrand's avatar
      util/vfio-helpers.c: Use ram_block_discard_disable() in qemu_vfio_open_pci() · b430b513
      David Hildenbrand authored
      
      Currently, when using "nvme://" for a block device, like
          -drive file=nvme://0000:01:00.0/1,if=none,id=drive0 \
          -device virtio-blk,drive=drive0 \
      
      VFIO may pin all guest memory, and discarding of RAM no longer works as
      expected. I was able to reproduce this easily with my
          01:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd
                  NVMe SSD Controller SM981/PM981/PM983
      
      Similar to common VFIO, we have to disable it, making sure that:
      a) virtio-balloon won't discard any memory ("silently disabled")
      b) virtio-mem and nvme:// run mutually exclusive
      
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Alex Williamson <alex.williamson@redhat.com>
      Cc: Wei Yang <richardw.yang@linux.intel.com>
      Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
      Cc: Igor Mammedov <imammedo@redhat.com>
      Cc: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
      Cc: Peter Xu <peterx@redhat.com>
      Signed-off-by: default avatarDavid Hildenbrand <david@redhat.com>
      Message-Id: <20201116105947.9194-1-david@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      b430b513
  13. Nov 15, 2020
  14. Nov 04, 2020
  15. Nov 03, 2020
  16. Oct 29, 2020
Loading