Skip to content
Snippets Groups Projects
  1. Sep 19, 2017
    • David Hildenbrand's avatar
      cpu: drop old comments describing members · 6fda014e
      David Hildenbrand authored
      
      These comments are obviously stale.
      
      Acked-by: default avatarCornelia Huck <cohuck@redhat.com>
      Signed-off-by: default avatarDavid Hildenbrand <david@redhat.com>
      Message-Id: <20170913132417.24384-3-david@redhat.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      6fda014e
    • David Hildenbrand's avatar
      exec,dump,i386,ppc,s390x: don't include exec/cpu-all.h explicitly · 7f579e27
      David Hildenbrand authored
      
      All but a handful of files include exec/cpu-all.h via cpu.h only.
      As these files already include cpu.h, let's just drop the additional
      include.
      
      Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
      Signed-off-by: default avatarDavid Hildenbrand <david@redhat.com>
      Message-Id: <20170913132417.24384-2-david@redhat.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      7f579e27
    • Viktor Mihajlovski's avatar
      s390: set DHCP client architecure id for netboot · a8fbbf1d
      Viktor Mihajlovski authored
      Setting the client architecture DHCP option to 0x001f (s390 Basic) [1]
      allows the DHCP server to return a s390-specific bootfile if wanted.
      DHCP servers not configured for the option (or not yet recognizing the
      option value) will continue to work as they have done before.
      
      [1] https://www.iana.org/assignments/dhcpv6-parameters
      
      
      
      Signed-off-by: default avatarViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      Message-Id: <1505126027-1704-1-git-send-email-mihajlov@linux.vnet.ibm.com>
      Acked-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
      Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      a8fbbf1d
    • Halil Pasic's avatar
      s390x/css: remove unused error handling branch · ce4a4453
      Halil Pasic authored
      
      The case in question actually never happens. Let us get rid of the dead
      code.
      
      Signed-off-by: default avatarHalil Pasic <pasic@linux.vnet.ibm.com>
      Message-Id: <20170908152446.14606-4-pasic@linux.vnet.ibm.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      ce4a4453
    • Halil Pasic's avatar
      s390x/css: fix NULL handling for CCW addresses · cc6a9f8d
      Halil Pasic authored
      
      Back then in the time of df1fe5bb ("s390: Virtual channel subsystem
      support.", 2013-01-24) -EIO used to map to a channel-program check (via
      the default label of the switch statement).  Then 2dc95b4c
      ("s390x/3270: 3270 data stream handling", 2016-04-01) came along
      and that changed dramatically.
      
      Let us roll back this undesired side effect, and go back to
      channel-program check.
      
      Signed-off-by: default avatarHalil Pasic <pasic@linux.vnet.ibm.com>
      Fixes: 2dc95b4c "s390x/3270: 3270 data stream handling"
      Message-Id: <20170908152446.14606-3-pasic@linux.vnet.ibm.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      cc6a9f8d
    • Halil Pasic's avatar
      s390x/css: drop data-check in interpretation · 248b920d
      Halil Pasic authored
      
      The architecture says that channel-data check is indicating that
      an uncorrected storage (memory) error has been detected in regard
      to the data residing in main storage (memory) that is currently
      used for an I/O operation. The described detection is done using
      the CBC technology.
      
      The ccw interpretation code is however generating a channel-data check
      effectively when the (device specific) ccw_cb returns -EFAULT.  In case
      of virtio-ccw devices this happens when mapping memory fails, or when a
      NULL pointer is encountered. So this behavior is not architecture
      conform.
      
      Furthermore the best fit for these situations (null pointer, mapping a
      piece of guest memory fails) from architectural perspective the condition
      described as the channel subsystem refers to a location that is not
      available, which when encountered shall result in a channel-program
      check.
      
      To fix this, all we have to do is to get rid of the switch case matching
      -EFAULT: the default is generating a channel-program check.
      
      Signed-off-by: default avatarHalil Pasic <pasic@linux.vnet.ibm.com>
      Message-Id: <20170908152446.14606-2-pasic@linux.vnet.ibm.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      248b920d
    • Thomas Huth's avatar
      hw/misc/ivshmem: Fix ivshmem_recv_msg() to also work on big endian systems · 51af0ec9
      Thomas Huth authored
      
      The "slow" ivshmem-tests currently fail when they are running on a
      big endian host:
      
      $ uname -m
      ppc64
      $ V=1 QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 tests/ivshmem-test -m slow
      /x86_64/ivshmem/single: OK
      /x86_64/ivshmem/hotplug: OK
      /x86_64/ivshmem/memdev: OK
      /x86_64/ivshmem/pair: OK
      /x86_64/ivshmem/server-msi: qemu-system-x86_64:
       -device ivshmem-doorbell,chardev=chr0,vectors=2: server sent invalid ID message
      Broken pipe
      
      The problem is that the server side code in ivshmem_server_send_one_msg()
      correctly translates all messages IDs into little endian 64-bit values,
      but the client side code in the ivshmem_recv_msg() function does not swap
      the byte order back. Fix it by passing the value through le64_to_cpu().
      
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      Message-Id: <1504100343-26607-1-git-send-email-thuth@redhat.com>
      Tested-by: default avatarCornelia Huck <cohuck@redhat.com>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      51af0ec9
    • Yi Min Zhao's avatar
      s390x/pci: add iommu replay callback · 6c5e7402
      Yi Min Zhao authored
      
      Let's introduce iommu replay callback for s390 pci iommu memory region.
      Currently we don't need any dma mapping replay. So let it return
      directly. This implementation will avoid meaningless loops calling
      translation callback.
      
      Reviewed-by: default avatarPierre Morel <pmorel@linux.vnet.ibm.com>
      Reviewed-by: default avatarHalil Pasic <pasic@linux.vnet.ibm.com>
      Signed-off-by: default avatarYi Min Zhao <zyimin@linux.vnet.ibm.com>
      Message-Id: <1504606380-49341-4-git-send-email-zyimin@linux.vnet.ibm.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      6c5e7402
    • Yi Min Zhao's avatar
      s390x/pci: fixup ind_offset of msix routing entry · 01c36195
      Yi Min Zhao authored
      
      The guest uses the mpcifc instruction to register the aibvo of a zpci
      device, which is the starting offset of indicators in the indicator
      area and thus remains constant. Each msix vector is an offset from the
      aibvo. When we map a msix route to an adapter route, we should not
      modify the starting offset, but instead add the vector to the starting
      offset to get the absolute offset in the specific route.
      
      Signed-off-by: default avatarYi Min Zhao <zyimin@linux.vnet.ibm.com>
      Message-Id: <1504606380-49341-3-git-send-email-zyimin@linux.vnet.ibm.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      01c36195
    • Yi Min Zhao's avatar
      s390x/pci: remove idx from msix msg data · ceb7054f
      Yi Min Zhao authored
      
      PCIDevice pointer has been a parameter of kvm_arch_fixup_msi_route().
      So we don't need to store zpci idx in msix message data to find out the
      specific zpci device. Instead, we could use pci device id to find its
      corresponding zpci device.
      
      Signed-off-by: default avatarYi Min Zhao <zyimin@linux.vnet.ibm.com>
      Message-Id: <1504606380-49341-2-git-send-email-zyimin@linux.vnet.ibm.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      ceb7054f
    • Thomas Huth's avatar
      tests: Enable the drive_del test also on s390x · 2f84a92e
      Thomas Huth authored
      
      We can use the drive_del test on s390x, too, to check that adding and
      deleting also works fine with the virtio-ccw bus. But we have to make
      sure that we use the devices with the "-ccw" suffix instead of the
      "-pci" suffix for the virtio-ccw transport on s390x. Introduce a helper
      function called qvirtio_get_dev_type() that returns the correct string
      for the current architecture.
      
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      Message-Id: <1504190408-11143-1-git-send-email-thuth@redhat.com>
      Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      2f84a92e
    • Halil Pasic's avatar
      s390x/css: fix cc handling for XSCH · 6c864622
      Halil Pasic authored
      
      The function ioinst_handle_xsch is presenting cc 2 when it's supposed to
      present cc 1 and the other way around, because css_do_xsch has the error
      codes mixed up. Because cc 1 has precedence over cc 2 we also have to
      swap the two checks.
      
      Let us fix this.
      
      Signed-off-by: default avatarHalil Pasic <pasic@linux.vnet.ibm.com>
      Reported-by: default avatarPierre Morel <pmorel@linux.vnet.ibm.com>
      Message-Id: <20170831121828.85885-1-pasic@linux.vnet.ibm.com>
      Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      6c864622
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging · 7ec6a364
      Peter Maydell authored
      
      * warning improvements (Alistair)
      * KVM code cleanup (David)
      * scsi-block support for rerror/werror (Fam)
      * support for >64 vCPUs in Windows (Gonglei)
      * SCSI fix (Hannes)
      * SSE bugfixes (Joseph)
      * SmartOS compilation fixes (Kamil)
      * Hyper-V frequency MSR support (Ladi)
      * move more files to accel/tcg (Philippe, Thomas)
      * multiboot validation (PJP)
      * virtqueue size configuration for virtio-scsi (Richard)
      * Hyper-V header cleanup (Roman)
      * Maintainer email update (Guangrong)
      * checkpatch.pl --branch (Daniel), fixes (Greg)
      * introducing scsi/ (me)
      
      # gpg: Signature made Tue 19 Sep 2017 15:21:26 BST
      # gpg:                using RSA key 0xBFFBD25F78C7AE83
      # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>"
      # gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>"
      # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
      #      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83
      
      * remotes/bonzini/tags/for-upstream: (51 commits)
        docker: fix creation of archives
        default-configs: Replace $(and ...) with $(call land, ...)
        osdep.h: Prohibit disabling assert() in supported builds
        checkpatch: add hwaddr to @typeList
        accel/hax: move hax-stub.c to accel/stubs/
        target/i386: fix "info mem" for LA57 mode
        scripts: let checkpatch.pl process an entire GIT branch
        update-linux-headers: prepare for hyperv.h removal
        hyperv: add header with protocol definitions
        i386/cpu/hyperv: support over 64 vcpus for windows guests
        Convert remaining single line fprintf() to warn_report()
        Makefile: Remove libqemustub.a
        ptimer-test: do not link to libqemustub.a/libqemuutil.a
        target/mips: Convert VM clock update prints to warn_report
        General warn report fixups
        Convert multi-line fprintf() to warn_report()
        Convert single line fprintf(.../n) to warn_report()
        Convert remaining error_report() to warn_report()
        hw/i386: Improve some of the warning messages
        test-qga: add missing qemu-ga tool dependency
        ...
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      7ec6a364
    • Paolo Bonzini's avatar
      docker: fix creation of archives · 7437866b
      Paolo Bonzini authored
      
      The pixman submodule does not exist anymore, and its removal broke
      docker-based tests.  Fix it.
      
      Cc: Fam Zheng <famz@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      7437866b
    • Thomas Huth's avatar
      default-configs: Replace $(and ...) with $(call land, ...) · d321e6d5
      Thomas Huth authored
      
      Using $(and ...) is dangerous here: It only works as long as the first
      argument is set to 'y' or completely unset. It does not work if the
      first argument is set to 'n' for example. Let's use the "land" make
      function instead which has been written explicitely for this purpose.
      
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      Message-Id: <1505759538-15365-1-git-send-email-thuth@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      d321e6d5
    • Eric Blake's avatar
      osdep.h: Prohibit disabling assert() in supported builds · 262a69f4
      Eric Blake authored
      
      We already have several files that knowingly require assert()
      to work, sometimes because refactoring the code for proper
      error handling has not been tackled yet; there are probably
      other files that have a similar situation but with no comments
      documenting the same.  In fact, we have places in migration
      that handle untrusted input with assertions, where disabling
      the assertions risks a worse security hole than the current
      behavior of losing the guest to SIGABRT when migration fails
      because of the assertion.  Promote our current per-file
      safety-valve to instead be project-wide, and expand it to also
      cover glib's g_assert().
      
      Note that we do NOT want to encourage 'assert(side-effects);'
      (that is a bad practice that prevents copy-and-paste of code to
      other projects that CAN disable assertions; plus it costs
      unnecessary reviewer mental cycles to remember whether a project
      special-cases the crippling of asserts); and we would LIKE to
      fix migration to not rely on asserts (but that takes a big code
      audit).  But in the meantime, we DO want to send a message
      that anyone that disables assertions has to tweak code in order
      to compile, making it obvious that they are taking on additional
      risk that we are not going to support.  At the same time, leave
      comments mentioning NDEBUG in files that we know still need to
      be scrubbed, so there is at least something to grep for.
      
      It would be possible to come up with some other mechanism for
      doing runtime checking by default, but which does not abort
      the program on failure, while leaving side effects in place
      (unlike how crippling assert() avoids even the side effects),
      perhaps under the name q_verify(); but it was not deemed worth
      the effort (developers should not have to learn a replacement
      when the standard C macro works just fine, and it would be a lot
      of churn for little gain).  The patch specifically uses #error
      rather than #warn so that a user is forced to tweak the header
      to acknowledge the issue, even when not using a -Werror
      compilation.
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
      
      Message-Id: <20170911211320.25385-1-eblake@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      262a69f4
    • Greg Kurz's avatar
      checkpatch: add hwaddr to @typeList · 825bfa00
      Greg Kurz authored
      
      The script doesn't know about all possible types and learn them as
      it parses the code. If it reaches a line with a type cast but the
      type isn't known yet, it is misinterpreted as an identifier.
      
      For example the following line:
      
          foo = (hwaddr) -1;
      
      results in the following false-positive to be reported:
      
      ERROR: spaces required around that '-' (ctx:VxV)
      
      Let's add this standard QEMU type to the list of pre-known types.
      
      Signed-off-by: default avatarGreg Kurz <groug@kaod.org>
      Message-Id: <150538015789.8149.10902725348939486674.stgit@bahia.lan>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      825bfa00
    • Philippe Mathieu-Daudé's avatar
      accel/hax: move hax-stub.c to accel/stubs/ · 4c44a007
      Philippe Mathieu-Daudé authored
      
      Suggested-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <20170913221149.30382-1-f4bug@amsat.org>
      Reviewed-by: default avatarStefan Weil <sw@weilnetz.de>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      4c44a007
    • Paolo Bonzini's avatar
      128b52e8
    • Daniel P. Berrangé's avatar
      scripts: let checkpatch.pl process an entire GIT branch · 8e1fe175
      Daniel P. Berrangé authored
      
      Currently before submitting a series, devs should run checkpatch.pl
      across each patch to be submitted. This can be automated using a
      command such as:
      
        git rebase -i master -x 'git show | ./scripts/checkpatch.pl -'
      
      This is rather long winded to type, so this patch introduces a way
      to tell checkpatch.pl to validate a series of GIT revisions.
      
      There are now three modes it can operate in 1) check a patch 2) check a source
      file, or 3) check a git branch.
      
      If no flags are given, the mode is determined by checking the args passed to
      the command. If the args contain a literal ".." it is treated as a GIT revision
      list. If the args end in ".patch" or equal "-" it is treated as a patch file.
      Otherwise it is treated as a source file.
      
      This automatic guessing can be overridden using --[no-]patch --[no-]file or
      --[no-]branch
      
      For example to check a GIT revision list:
      
          $ ./scripts/checkpatch.pl master..
          total: 0 errors, 0 warnings, 297 lines checked
      
          b886d352a2bf58f0996471fb3991a138373a2957 has no obvious style problems and is ready for submission.
          total: 0 errors, 0 warnings, 182 lines checked
      
          2a731f9a9ce145e0e0df6d42dd2a3ce4dfc543fa has no obvious style problems and is ready for submission.
          total: 0 errors, 0 warnings, 102 lines checked
      
          11844169bcc0c8ed4449eb3744a69877ed329dd7 has no obvious style problems and is ready for submission.
      
      If a genuine patch filename contains the characters '..' it is
      possible to force interpretation of the arg as a patch
      
        $ ./scripts/checkpatch.pl --patch master..
      
      will force it to load a patch file called "master..", or equivalently
      
        $ ./scripts/checkpatch.pl --no-branch master..
      
      will simply turn off guessing of GIT revision lists.
      
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <20170913091000.9005-1-berrange@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      8e1fe175
    • Roman Kagan's avatar
      update-linux-headers: prepare for hyperv.h removal · 40bf8e9a
      Roman Kagan authored
      
      All definitions related to Hyper-V emulation are now taken from the QEMU
      own header, so the one imported from the kernel is no longer needed.
      
      Unfortunately it's included by kvm_para.h.
      
      So, until this is fixed in the kernel, teach the header harvesting
      script to substitute kernel's hyperv.h with a dummy.
      
      Signed-off-by: default avatarRoman Kagan <rkagan@virtuozzo.com>
      Message-Id: <20170713201522.13765-3-rkagan@virtuozzo.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      40bf8e9a
    • Roman Kagan's avatar
      hyperv: add header with protocol definitions · 5e953812
      Roman Kagan authored
      
      The definitions for Hyper-V emulation are currently taken from a header
      imported from the Linux kernel.
      
      However, as these describe a third-party protocol rather than a kernel
      API, it probably wasn't a good idea to publish it in the kernel uapi.
      
      This patch introduces a header that provides all the necessary
      definitions, superseding the one coming from the kernel.
      
      The new header supports (temporary) coexistence with the kernel one.
      The constants explicitly named in the Hyper-V specification (e.g. msr
      numbers) are defined in a non-conflicting way.  Other constants and
      types have got new names.
      
      While at this, the protocol data structures are defined in a more
      conventional way, without bitfields, enums, and excessive unions.
      
      The code using this stuff is adjusted, too; it can now be built both
      with and without the kernel header in the tree.
      
      Signed-off-by: default avatarRoman Kagan <rkagan@virtuozzo.com>
      Message-Id: <20170713201522.13765-2-rkagan@virtuozzo.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      5e953812
    • Gonglei (Arei)'s avatar
      i386/cpu/hyperv: support over 64 vcpus for windows guests · 6c69dfb6
      Gonglei (Arei) authored
      Starting with Windows Server 2012 and Windows 8, if
      CPUID.40000005.EAX contains a value of -1, Windows assumes specific
      limit to the number of VPs. In this case, Windows Server 2012
      guest VMs may use more than 64 VPs, up to the maximum supported
      number of processors applicable to the specific Windows
      version being used.
      
      https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/reference/tlfs
      
      
      
      For compatibility, Let's introduce a new property for X86CPU,
      named "x-hv-max-vps" as Eduardo's suggestion, and set it
      to 0x40 before machine 2.10.
      
      (The "x-" prefix indicates that the property is not supposed to
      be a stable user interface.)
      
      Signed-off-by: default avatarGonglei <arei.gonglei@huawei.com>
      Message-Id: <1505143227-14324-1-git-send-email-arei.gonglei@huawei.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      6c69dfb6
    • Alistair Francis's avatar
      Convert remaining single line fprintf() to warn_report() · 05cb8ed5
      Alistair Francis authored
      
      Convert any remaining uses of fprintf(stderr, "warning:"...
      to use warn_report() instead. This helps standardise on a single
      method of printing warnings to the user.
      
      All of the warnings were changed using this command:
        find ./* -type f -exec sed -i 's|fprintf(.*".*warning[,:] |warn_report("|Ig' {} +
      
      The #include lines and chagnes to the test Makefile were manually
      updated to allow the code to compile.
      
      Signed-off-by: default avatarAlistair Francis <alistair.francis@xilinx.com>
      Message-Id: <2c94ac3bb116cc6b8ebbcd66a254920a69665515.1503077821.git.alistair.francis@xilinx.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      05cb8ed5
    • Paolo Bonzini's avatar
      Makefile: Remove libqemustub.a · ebedb37c
      Paolo Bonzini authored
      
      Using two libraries (libqemuutil.a and libqemustub.a) would sometimes
      result in circular dependencies. To avoid these issues let's just
      combine both into a single library that functions as both.
      
      Signed-off-by: default avatarAlistair Francis <alistair.francis@xilinx.com>
      Message-Id: <54e6458745493d10901964624479a7d9a872f481.1503077821.git.alistair.francis@xilinx.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      ebedb37c
    • Paolo Bonzini's avatar
      ptimer-test: do not link to libqemustub.a/libqemuutil.a · 9ee24e98
      Paolo Bonzini authored
      
      This test provides its own mocks, so do not use the "standard"
      stubs in libqemustub.a or the event loop implementation in
      libqemuutil.a.
      
      This is required on OS X, which otherwise brings in qemu-timer.o,
      async.o and main-loop.o from libqemuutil.a.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      9ee24e98
    • Alistair Francis's avatar
      target/mips: Convert VM clock update prints to warn_report · 288cb949
      Alistair Francis authored
      
      Convert the fprintf() messages in kvm_mips_update_state() to use
      warn_report() as they aren't errors, but are just warnings.
      
      Signed-off-by: default avatarAlistair Francis <alistair.francis@xilinx.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Message-Id: <e6acff8db6d264f913a18c86858b9aa600554e51.1505158760.git.alistair.francis@xilinx.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      288cb949
    • Alistair Francis's avatar
      General warn report fixups · b62e39b4
      Alistair Francis authored
      
      Tidy up some of the warn_report() messages after having converted them
      to use warn_report().
      
      Signed-off-by: default avatarAlistair Francis <alistair.francis@xilinx.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <9cb1d23551898c9c9a5f84da6773e99871285120.1505158760.git.alistair.francis@xilinx.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      b62e39b4
    • Alistair Francis's avatar
      Convert multi-line fprintf() to warn_report() · 8297be80
      Alistair Francis authored
      
      Convert all the multi-line uses of fprintf(stderr, "warning:"..."\n"...
      to use warn_report() instead. This helps standardise on a single
      method of printing warnings to the user.
      
      All of the warnings were changed using these commands:
        find ./* -type f -exec sed -i \
          'N; {s|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \
          {} +
        find ./* -type f -exec sed -i \
          'N;N; {s|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \
          {} +
        find ./* -type f -exec sed -i \
          'N;N;N; {s|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \
          {} +
        find ./* -type f -exec sed -i \
          'N;N;N;N {s|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \
          {} +
        find ./* -type f -exec sed -i \
          'N;N;N;N;N {s|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \
          {} +
        find ./* -type f -exec sed -i \
          'N;N;N;N;N;N {s|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \
          {} +
        find ./* -type f -exec sed -i \
          'N;N;N;N;N;N;N; {s|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \
          {} +
      
      Indentation fixed up manually afterwards.
      
      Some of the lines were manually edited to reduce the line length to below
      80 charecters. Some of the lines with newlines in the middle of the
      string were also manually edit to avoid checkpatch errrors.
      
      The #include lines were manually updated to allow the code to compile.
      
      Several of the warning messages can be improved after this patch, to
      keep this patch mechanical this has been moved into a later patch.
      
      Signed-off-by: default avatarAlistair Francis <alistair.francis@xilinx.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Max Reitz <mreitz@redhat.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Igor Mammedov <imammedo@redhat.com>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: Stefano Stabellini <sstabellini@kernel.org>
      Cc: Anthony Perard <anthony.perard@citrix.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: Yongbok Kim <yongbok.kim@imgtec.com>
      Cc: Cornelia Huck <cohuck@redhat.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Alexander Graf <agraf@suse.de>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: David Gibson <david@gibson.dropbear.id.au>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Acked-by: default avatarCornelia Huck <cohuck@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <5def63849ca8f551630c6f2b45bcb1c482f765a6.1505158760.git.alistair.francis@xilinx.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      8297be80
    • Alistair Francis's avatar
      Convert single line fprintf(.../n) to warn_report() · 2ab4b135
      Alistair Francis authored
      
      Convert all the single line uses of fprintf(stderr, "warning:"..."\n"...
      to use warn_report() instead. This helps standardise on a single
      method of printing warnings to the user.
      
      All of the warnings were changed using this command:
        find ./* -type f -exec sed -i \
          's|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig' \
          {} +
      
      Some of the lines were manually edited to reduce the line length to below
      80 charecters.
      
      The #include lines were manually updated to allow the code to compile.
      
      Signed-off-by: default avatarAlistair Francis <alistair.francis@xilinx.com>
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Max Reitz <mreitz@redhat.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Igor Mammedov <imammedo@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: Yongbok Kim <yongbok.kim@imgtec.com>
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: James Hogan <james.hogan@imgtec.com> [mips]
      Message-Id: <ae8f8a7f0a88ded61743dff2adade21f8122a9e7.1505158760.git.alistair.francis@xilinx.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      2ab4b135
    • Alistair Francis's avatar
      Convert remaining error_report() to warn_report() · 55d527a9
      Alistair Francis authored
      
      In a previous patch (3dc6f869) we
      converted uses of error_report("warning:"... to use warn_report()
      instead. This was to help standardise on a single method of printing
      warnings to the user.
      
      There appears to have been some cases that slipped through in patch sets
      applied around the same time, this patch catches the few remaining
      cases.
      
      All of the warnings were changed using this command:
        find ./* -type f -exec sed -i \
          's|error_report(".*warning[,:] |warn_report("|Ig' {} +
      
      Indentation fixed up manually afterwards.
      
      Two messages were manually fixed up as well.
      
      Signed-off-by: default avatarAlistair Francis <alistair.francis@xilinx.com>
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Max Reitz <mreitz@redhat.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Cornelia Huck <cohuck@redhat.com>
      Cc: Alexander Graf <agraf@suse.de>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Acked-by: default avatarCornelia Huck <cohuck@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <eec8cba0d5434bd828639e5e45f12182490ff47d.1505158760.git.alistair.francis@xilinx.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      55d527a9
    • Alistair Francis's avatar
      hw/i386: Improve some of the warning messages · 9e5d2c52
      Alistair Francis authored
      
      Signed-off-by: default avatarAlistair Francis <alistair.francis@xilinx.com>
      Suggested-by: default avatarEduardo Habkost <ehabkost@redhat.com>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Message-Id: <1d6ef2ccd9667878ed5820fcf17eef35957ea5d8.1505158760.git.alistair.francis@xilinx.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      9e5d2c52
    • Philippe Mathieu-Daudé's avatar
      test-qga: add missing qemu-ga tool dependency · 4be75077
      Philippe Mathieu-Daudé authored
      
      this fixes running 'make check-unit' without running 'make all' beforehand:
      
      $ make check-unit
        ...
        GTESTER tests/test-qga
      **
      ERROR:tests/test-qga.c:73:fixture_setup: assertion failed (error == NULL): Failed to execute child process "/build/qemu/qemu-ga" (No such file or directory) (g-exec-error-quark, 8)
      make: *** [check-tests/test-qga] Error 1
      
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <20170911210129.5874-1-f4bug@amsat.org>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      4be75077
    • David Hildenbrand's avatar
      kvm: kvm_log_sync() is only called with known memory sections · 67548f09
      David Hildenbrand authored
      
      Flatview will make sure that we can only end up in this function with
      memory sections that correspond to exactly one slot. So we don't
      have to iterate multiple times. There won't be overlapping slots but
      only matching slots.
      
      Properly align the section and look up the corresponding slot. This
      heavily simplifies this function.
      
      We can now get rid of kvm_lookup_overlapping_slot().
      
      Signed-off-by: default avatarDavid Hildenbrand <david@redhat.com>
      Message-Id: <20170911174933.20789-7-david@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      67548f09
    • David Hildenbrand's avatar
      kvm: kvm_log_start/stop are only called with known sections · 343562e8
      David Hildenbrand authored
      
      Let's properly align the sections first and bail out if we would ever
      get called with a memory section we don't know yet.
      
      Signed-off-by: default avatarDavid Hildenbrand <david@redhat.com>
      Message-Id: <20170911174933.20789-6-david@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      343562e8
    • David Hildenbrand's avatar
      kvm: we never have overlapping slots in kvm_set_phys_mem() · f357f564
      David Hildenbrand authored
      
      The way flatview handles memory sections, we will never have overlapping
      memory sections in kvm.
      
      address_space_update_topology_pass() will make sure that we will only
      get called for
      
      a) an existing memory section for which we only update parameters
      (log_start, log_stop).
      b) an existing memory section we want to delete (region_del)
      c) a brand new memory section we want to add (region_add)
      
      We cannot have overlapping memory sections in kvm as we will first remove
      the overlapping sections and then add the ones without conflicts.
      
      Therefore we can remove the complexity for handling prefix and suffix
      slots.
      
      Signed-off-by: default avatarDavid Hildenbrand <david@redhat.com>
      Message-Id: <20170911174933.20789-5-david@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      f357f564
    • David Hildenbrand's avatar
      kvm: use start + size for memory ranges · 2747e716
      David Hildenbrand authored
      
      Convert kvm_lookup_matching_slot().
      
      Signed-off-by: default avatarDavid Hildenbrand <david@redhat.com>
      Message-Id: <20170911174933.20789-4-david@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      2747e716
    • David Hildenbrand's avatar
      kvm: factor out alignment of memory section · 5ea69c2e
      David Hildenbrand authored
      
      Factor it out, so we can reuse it later.
      
      Signed-off-by: default avatarDavid Hildenbrand <david@redhat.com>
      Message-Id: <20170911174933.20789-3-david@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      5ea69c2e
    • David Hildenbrand's avatar
      kvm: require JOIN_MEMORY_REGIONS_WORKS · 89de4b91
      David Hildenbrand authored
      
      We already require DESTROY_MEMORY_REGION_WORKS, JOIN_MEMORY_REGIONS_WORKS
      was added just half a year later.
      
      In addition, with flatview overlapping memory regions are first
      removed before adding the changed one. So we can't really detect joining
      memory regions this way.
      
      Let's just get rid of this special handling.
      
      Signed-off-by: default avatarDavid Hildenbrand <david@redhat.com>
      Message-Id: <20170911174933.20789-2-david@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      89de4b91
    • Prasad J Pandit's avatar
      multiboot: validate multiboot header address values · ed4f86e8
      Prasad J Pandit authored
      
      While loading kernel via multiboot-v1 image, (flags & 0x00010000)
      indicates that multiboot header contains valid addresses to load
      the kernel image. These addresses are used to compute kernel
      size and kernel text offset in the OS image. Validate these
      address values to avoid an OOB access issue.
      
      This is CVE-2017-14167.
      
      Reported-by: default avatarThomas Garnier <thgarnie@google.com>
      Signed-off-by: default avatarPrasad J Pandit <pjp@fedoraproject.org>
      Message-Id: <20170907063256.7418-1-ppandit@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      ed4f86e8
Loading