1. 03 4月, 2017 8 次提交
    • P
      tcg/sparc: Zero extend data argument to store helpers · 709a340d
      Peter Maydell 提交于
      The C store helper functions take the data argument as a uint8_t,
      uint16_t, etc depending on the store size. The SPARC calling
      convention requires that data types smaller than the register
      size must be extended by the caller. We weren't doing this,
      which meant that if QEMU was compiled with optimizations enabled
      we could end up storing incorrect values to guest memory.
      (In particular the i386 guest BIOS would crash on startup.)
      
      Add code to the trampolines that call the store helpers to
      do the zero extension as required.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-id: 1490871151-29029-2-git-send-email-peter.maydell@linaro.org
      Reviewed-by: NRichard Henderson <rth@twiddle.net>
      709a340d
    • P
      Merge remote-tracking branch 'remotes/kraxel/tags/pull-fixes-20170403-1' into staging · f9e46d37
      Peter Maydell 提交于
      bugfixes: xhci, input-linux and vnc
      
      # gpg: Signature made Mon 03 Apr 2017 11:25:29 BST
      # gpg:                using RSA key 0x4CB6D8EED3E87138
      # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
      # gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
      # gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
      # Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138
      
      * remotes/kraxel/tags/pull-fixes-20170403-1:
        vnc: allow to connect with add_client when -vnc none
        Fix input-linux reading from device
        xhci: flush dequeue pointer to endpoint context
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      f9e46d37
    • P
      Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.9-20170403' into staging · 9eb5adae
      Peter Maydell 提交于
      ppc patch queue 2017-04-03
      
      A single bugfix in this pull request, for an ugly assert() failure, if
      the user ignores the information in query-hotpluggable-cpus and tries
      to hot add CPUs to pseries with bad parameters.
      
      # gpg: Signature made Mon 03 Apr 2017 11:06:58 BST
      # gpg:                using RSA key 0x6C38CACA20D9B392
      # gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>"
      # gpg:                 aka "David Gibson (Red Hat) <dgibson@redhat.com>"
      # gpg:                 aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>"
      # gpg:                 aka "David Gibson (kernel.org) <dwg@kernel.org>"
      # Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392
      
      * remotes/dgibson/tags/ppc-for-2.9-20170403:
        pseries: Enforce homogeneous threads-per-core
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      9eb5adae
    • M
      vnc: allow to connect with add_client when -vnc none · fa03cb7f
      Marc-André Lureau 提交于
      Do not skip VNC initialization, in particular of auth method when vnc is
      configured without sockets, since we should still allow connections
      through QMP add_client.
      
      Fixes:
      https://bugzilla.redhat.com/show_bug.cgi?id=1434551Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-id: 20170328160646.21250-1-marcandre.lureau@redhat.com
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      fa03cb7f
    • J
      Fix input-linux reading from device · 1684907c
      Javier Celaya 提交于
      The evdev devices in input-linux.c are read in blocks of one whole
      event. If there are not enough bytes available, they are discarded,
      instead of being kept for the next read operation. This results in
      lost events, of even non-working devices.
      
      This patch keeps track of the number of bytes to be read to fill up
      a whole event, and then handle it.
      
      Changes from v1 to v2:
      - Fix: Calculate offset on each iteration
      
      Changes from v2 to v3:
      - Fix coding style
      - Store offset instead of bytes to be read
      Signed-off-by: NJavier Celaya <jcelaya@gmail.com>
      Message-id: 20170327182624.2914-1-jcelaya@gmail.com
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      1684907c
    • G
      xhci: flush dequeue pointer to endpoint context · 243afe85
      Gerd Hoffmann 提交于
      When done processing a endpoint ring we must update the dequeue pointer
      in the endpoint context in guest memory.  This is needed to make sure
      the guest has a correct view of things and also to make live migration
      work properly, because xhci post_load restores alot of the state from
      xhci data structures in guest memory.
      
      Add xhci_set_ep_state() call to do that.
      
      The recursive calls stopped by commit
      ddb603ab had the (unintentional) side
      effect to hiding this bug.  xhci_set_ep_state() was called before
      processing, to set the state to running, which updated the dequeue
      pointer too.
      Reported-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Tested-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Message-id: 20170331102521.29253-1-kraxel@redhat.com
      243afe85
    • P
      Merge remote-tracking branch 'remotes/cody/tags/block-pull-request' into staging · 6954cdc0
      Peter Maydell 提交于
      # gpg: Signature made Sat 01 Apr 2017 02:23:29 BST
      # gpg:                using RSA key 0xBDBE7B27C0DE3057
      # gpg: Good signature from "Jeffrey Cody <jcody@redhat.com>"
      # gpg:                 aka "Jeffrey Cody <jeff@codyprime.org>"
      # gpg:                 aka "Jeffrey Cody <codyprime@gmail.com>"
      # Primary key fingerprint: 9957 4B4D 3474 90E7 9D98  D624 BDBE 7B27 C0DE 3057
      
      * remotes/cody/tags/block-pull-request:
        block/curl: Check protocol prefix
        qapi/curl: Extend and fix blockdev-add schema
        rbd: Fix regression in legacy key/values containing escaped :
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      6954cdc0
    • D
      pseries: Enforce homogeneous threads-per-core · 8149e299
      David Gibson 提交于
      For reasons that may be useful in future, CPU core objects, as used on the
      pseries machine type have their own nr-threads property, potentially
      allowing cores with different numbers of threads in the same system.
      
      If the user/management uses the values specified in query-hotpluggable-cpus
      as they're expected to do, this will never matter in pratice.  But that's
      not actually enforced - it's possible to manually specify a core with
      a different number of threads from that in -smp.  That will confuse the
      platform - most immediately, this can be used to create a CPU thread with
      index above max_cpus which leads to an assertion failure in
      spapr_cpu_core_realize().
      
      For now, enforce that all cores must have the same, standard, number of
      threads.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NBharata B Rao <bharata@linux.vnet.ibm.com>
      8149e299
  2. 01 4月, 2017 5 次提交
    • M
      block/curl: Check protocol prefix · 34634ca2
      Max Reitz 提交于
      If the user has explicitly specified a block driver and thus a protocol,
      we have to make sure the URL's protocol prefix matches. Otherwise the
      latter will silently override the former which might catch some users by
      surprise.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-id: 20170331120431.1767-3-mreitz@redhat.com
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      34634ca2
    • M
      qapi/curl: Extend and fix blockdev-add schema · 6b9d62db
      Max Reitz 提交于
      The curl block driver accepts more options than just "filename"; also,
      the URL is actually expected to be passed through the "url" option
      instead of "filename".
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-id: 20170331120431.1767-2-mreitz@redhat.com
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      6b9d62db
    • E
      rbd: Fix regression in legacy key/values containing escaped : · e98c6961
      Eric Blake 提交于
      Commit c7cacb3e accidentally broke legacy key-value parsing through
      pseudo-filename parsing of -drive file=rbd://..., for any key that
      contains an escaped ':'.  Such a key is surprisingly common, thanks
      to mon_host specifying a 'host:port' string.  The break happens
      because passing things from QDict through QemuOpts back to another
      QDict requires that we pack our parsed key/value pairs into a string,
      and then reparse that string, but the intermediate string that we
      created ("key1=value1:key2=value2") lost the \: escaping that was
      present in the original, so that we could no longer see which : were
      used as separators vs. those used as part of the original input.
      
      Fix it by collecting the key/value pairs through a QList, and
      sending that list on a round trip through a JSON QString (as in
      '["key1","value1","key2","value2"]') on its way through QemuOpts,
      rather than hand-rolling our own string.  Since the string is only
      handled internally, this was faster than creating a full-blown
      struct of '[{"key1":"value1"},{"key2":"value2"}]', and safer at
      guaranteeing order compared to '{"key1":"value1","key2":"value2"}'.
      
      It would be nicer if we didn't have to round-trip through QemuOpts
      in the first place, but that's a much bigger task for later.
      
      Reproducer:
      ./x86_64-softmmu/qemu-system-x86_64 -nodefaults -nographic -qmp stdio \
      -drive 'file=rbd:volumes/volume-ea141b5c-cdb3-4765-910d-e7008b209a70'\
      ':id=compute:key=AQAVkvxXAAAAABAA9ZxWFYdRmV+DSwKr7BKKXg=='\
      ':auth_supported=cephx\;none:mon_host=192.168.1.2\:6789'\
      ',format=raw,if=none,id=drive-virtio-disk0,'\
      'serial=ea141b5c-cdb3-4765-910d-e7008b209a70,cache=writeback'
      
      Even without an RBD setup, this serves a test of whether we get
      the incorrect parser error of:
      qemu-system-x86_64: -drive file=rbd:...cache=writeback: conf option 6789 has no value
      or the correct behavior of hanging while trying to connect to
      the requested mon_host of 192.168.1.2:6789.
      Reported-by: NAlexandru Avadanii <Alexandru.Avadanii@enea.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 20170331152730.12514-1-eblake@redhat.com
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      e98c6961
    • P
      Merge remote-tracking branch 'remotes/awilliam/tags/vfio-updates-20170331.0' into staging · 95b31d70
      Peter Maydell 提交于
      VFIO fixes 2017-03-31
      
       - We can't disable stolen memory for UPT mode, it breaks Windows
         drivers on Gen9+ IGD (Xiong Zhang)
      
      # gpg: Signature made Fri 31 Mar 2017 17:13:48 BST
      # gpg:                using RSA key 0x239B9B6E3BB08B22
      # gpg: Good signature from "Alex Williamson <alex.williamson@redhat.com>"
      # gpg:                 aka "Alex Williamson <alex@shazbot.org>"
      # gpg:                 aka "Alex Williamson <alwillia@redhat.com>"
      # gpg:                 aka "Alex Williamson <alex.l.williamson@gmail.com>"
      # Primary key fingerprint: 42F6 C04E 540B D1A9 9E7B  8A90 239B 9B6E 3BB0 8B22
      
      * remotes/awilliam/tags/vfio-updates-20170331.0:
        Revert "vfio/pci-quirks.c: Disable stolen memory for igd VFIO"
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      95b31d70
    • X
      Revert "vfio/pci-quirks.c: Disable stolen memory for igd VFIO" · 93587e3a
      Xiong Zhang 提交于
      This reverts commit c2b2e158.
      
      The original patch intend to prevent linux i915 driver from using
      stolen meory. But this patch breaks windows IGD driver loading on
      Gen9+, as IGD HW will use stolen memory on Gen9+, once windows IGD
      driver see zero size stolen memory, it will unload.
      Meanwhile stolen memory will be disabled in 915 when i915 run as
      a guest.
      Signed-off-by: NXiong Zhang <xiong.y.zhang@intel.com>
      [aw: Gen9+ is SkyLake and newer]
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      93587e3a
  3. 31 3月, 2017 12 次提交
  4. 30 3月, 2017 5 次提交
    • P
      Merge remote-tracking branch 'remotes/thibault/tags/samuel-thibault' into staging · e839001d
      Peter Maydell 提交于
      slirp updates
      
      # gpg: Signature made Tue 28 Mar 2017 23:51:51 BST
      # gpg:                using RSA key 0xB0A51BF58C9179C5
      # gpg: Good signature from "Samuel Thibault <samuel.thibault@aquilenet.fr>"
      # gpg:                 aka "Samuel Thibault <sthibault@debian.org>"
      # gpg:                 aka "Samuel Thibault <samuel.thibault@gnu.org>"
      # gpg:                 aka "Samuel Thibault <samuel.thibault@inria.fr>"
      # gpg:                 aka "Samuel Thibault <samuel.thibault@labri.fr>"
      # gpg:                 aka "Samuel Thibault <samuel.thibault@ens-lyon.org>"
      # gpg:                 aka "Samuel Thibault <samuel.thibault@u-bordeaux.fr>"
      # gpg: WARNING: This key is not certified with sufficiently trusted signatures!
      # gpg:          It is not certain that the signature belongs to the owner.
      # Primary key fingerprint: 900C B024 B679 31D4 0F82  304B D017 8C76 7D06 9EE6
      #      Subkey fingerprint: AEBF 7448 FAB9 453A 4552  390E B0A5 1BF5 8C91 79C5
      
      * remotes/thibault/tags/samuel-thibault:
        slirp: Send RDNSS in RA only if host has an IPv6 DNS server
        slirp: Make RA build more flexible
        slirp: fix compilation errors with DEBUG set
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      e839001d
    • P
      Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.9-20170329' into staging · a67ec6ee
      Peter Maydell 提交于
      ppc patch queue for 2017-03-29
      
      Two more bugfixes of sufficient severity to warrant going into 2.9.
      
      # gpg: Signature made Wed 29 Mar 2017 04:33:19 BST
      # gpg:                using RSA key 0x6C38CACA20D9B392
      # gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>"
      # gpg:                 aka "David Gibson (Red Hat) <dgibson@redhat.com>"
      # gpg:                 aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>"
      # gpg:                 aka "David Gibson (kernel.org) <dwg@kernel.org>"
      # Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392
      
      * remotes/dgibson/tags/ppc-for-2.9-20170329:
        spapr: fix memory hot-unplugging
        spapr: fix buffer-overflow
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      a67ec6ee
    • P
      Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging · e68dd684
      Peter Maydell 提交于
      virtio, pci: fixes
      
      More fixes for 2.9.
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      
      # gpg: Signature made Wed 29 Mar 2017 00:35:49 BST
      # gpg:                using RSA key 0x281F0DB8D28D5469
      # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>"
      # gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>"
      # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
      #      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469
      
      * remotes/mst/tags/for_upstream:
        virtio: fix vring_align() on 64-bit windows
        pci: Add missing drop of bus master AS reference
        event_notifier: prevent accidental use after close
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      e68dd684
    • P
      configure: Don't claim 'unsupported host OS' when better message available · fb59dabd
      Peter Maydell 提交于
      The change in commit 898be3e0 which made completely
      unrecognized OSes cause an error_exit "Unsupported host OS"
      has some unfortunate unintended effects:
       * if you run 'configure --help' on an unsupported host OS
         (eg if intending to use it as a build machine for a
         cross compile to a supported host) then the message
         is printed instead of --help
       * if the C compiler doesn't work or is missing (eg if
         you passed an incorrect --cross-prefix by mistake)
         the message is printed instead of the more useful
         'compiler does not exist or does not work' message
      
      Fix this by postponing the error_exit in this situation
      until later, when we have already identified the more
      useful cases for this.
      
      The long term fix for this would be to move handling
      of --help much further up in the configure script,
      and make its output not dependent on checks that configure
      runs. However for 2.9 this would be too invasive.
      Reported-by: NStefan Weil <sw@weilnetz.de>
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NStefan Weil <sw@weilnetz.de>
      Tested-by: NStefan Weil <sw@weilnetz.de>
      fb59dabd
    • P
      Merge remote-tracking branch 'remotes/ehabkost/tags/x86-pull-request' into staging · b529aec1
      Peter Maydell 提交于
      i386: Fix for "-cpu host,invtsc=on" bug
      
      # gpg: Signature made Tue 28 Mar 2017 20:50:33 BST
      # gpg:                using RSA key 0x2807936F984DC5A6
      # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>"
      # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6
      
      * remotes/ehabkost/tags/x86-pull-request:
        i386: Don't override -cpu options on -cpu host/max
        i386: Replace uint32_t* with FeatureWord on feature getter/setter
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      b529aec1
  5. 29 3月, 2017 10 次提交
    • L
      spapr: fix memory hot-unplugging · fe6824d1
      Laurent Vivier 提交于
      If, once the kernel has booted, we try to remove a memory
      hotplugged while the kernel was not started, QEMU crashes on
      an assert:
      
          qemu-system-ppc64: hw/virtio/vhost.c:651:
                             vhost_commit: Assertion `r >= 0' failed.
          ...
          #4  in vhost_commit
          #5  in memory_region_transaction_commit
          #6  in pc_dimm_memory_unplug
          #7  in spapr_memory_unplug
          #8  spapr_machine_device_unplug
          #9  in hotplug_handler_unplug
          #10 in spapr_lmb_release
          #11 in detach
          #12 in set_allocation_state
          #13 in rtas_set_indicator
          ...
      
      If we take a closer look to the guest kernel log, we can see when
      we try to unplug the memory:
      
          pseries-hotplug-mem: Attempting to hot-add 4 LMB(s)
      
      What happens:
      
          1- The kernel has ignored the memory hotplug event because
             it was not started when it was generated.
      
          2- When we hot-unplug the memory,
             QEMU starts to remove the memory,
                  generates an hot-unplug event,
              and signals the kernel of the incoming new event
      
          3- as the kernel is started, on the QEMU signal, it reads
             the event list, decodes the hotplug event and tries to
             finish the hotplugging.
      
          4- QEMU receive the the hotplug notification while it
             is trying to hot-unplug the memory. This moves the memory
             DRC to an invalid state
      
      This patch prevents this by not allowing to set the allocation
      state to USABLE while the DRC is awaiting release.
      
      RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1432382Signed-off-by: NLaurent Vivier <lvivier@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      fe6824d1
    • M
      spapr: fix buffer-overflow · 24ec2863
      Marc-André Lureau 提交于
      Running postcopy-test with ASAN produces the following error:
      
      QTEST_QEMU_BINARY=ppc64-softmmu/qemu-system-ppc64  tests/postcopy-test
      ...
      =================================================================
      ==23641==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7f1556600000 at pc 0x55b8e9d28208 bp 0x7f1555f4d3c0 sp 0x7f1555f4d3b0
      READ of size 8 at 0x7f1556600000 thread T6
          #0 0x55b8e9d28207 in htab_save_first_pass /home/elmarco/src/qq/hw/ppc/spapr.c:1528
          #1 0x55b8e9d2939c in htab_save_iterate /home/elmarco/src/qq/hw/ppc/spapr.c:1665
          #2 0x55b8e9beae3a in qemu_savevm_state_iterate /home/elmarco/src/qq/migration/savevm.c:1044
          #3 0x55b8ea677733 in migration_thread /home/elmarco/src/qq/migration/migration.c:1976
          #4 0x7f15845f46c9 in start_thread (/lib64/libpthread.so.0+0x76c9)
          #5 0x7f157d9d0f7e in clone (/lib64/libc.so.6+0x107f7e)
      
      0x7f1556600000 is located 0 bytes to the right of 2097152-byte region [0x7f1556400000,0x7f1556600000)
      allocated by thread T0 here:
          #0 0x7f159bb76980 in posix_memalign (/lib64/libasan.so.3+0xc7980)
          #1 0x55b8eab185b2 in qemu_try_memalign /home/elmarco/src/qq/util/oslib-posix.c:106
          #2 0x55b8eab186c8 in qemu_memalign /home/elmarco/src/qq/util/oslib-posix.c:122
          #3 0x55b8e9d268a8 in spapr_reallocate_hpt /home/elmarco/src/qq/hw/ppc/spapr.c:1214
          #4 0x55b8e9d26e04 in ppc_spapr_reset /home/elmarco/src/qq/hw/ppc/spapr.c:1261
          #5 0x55b8ea12e913 in qemu_system_reset /home/elmarco/src/qq/vl.c:1697
          #6 0x55b8ea13fa40 in main /home/elmarco/src/qq/vl.c:4679
          #7 0x7f157d8e9400 in __libc_start_main (/lib64/libc.so.6+0x20400)
      
      Thread T6 created by T0 here:
          #0 0x7f159bae0488 in __interceptor_pthread_create (/lib64/libasan.so.3+0x31488)
          #1 0x55b8eab1d9cb in qemu_thread_create /home/elmarco/src/qq/util/qemu-thread-posix.c:465
          #2 0x55b8ea67874c in migrate_fd_connect /home/elmarco/src/qq/migration/migration.c:2096
          #3 0x55b8ea66cbb0 in migration_channel_connect /home/elmarco/src/qq/migration/migration.c:500
          #4 0x55b8ea678f38 in socket_outgoing_migration /home/elmarco/src/qq/migration/socket.c:87
          #5 0x55b8eaa5a03a in qio_task_complete /home/elmarco/src/qq/io/task.c:142
          #6 0x55b8eaa599cc in gio_task_thread_result /home/elmarco/src/qq/io/task.c:88
          #7 0x7f15823e38e6  (/lib64/libglib-2.0.so.0+0x468e6)
      SUMMARY: AddressSanitizer: heap-buffer-overflow /home/elmarco/src/qq/hw/ppc/spapr.c:1528 in htab_save_first_pass
      
      index seems to be wrongly incremented, unless I miss something that
      would be worth a comment.
      Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      24ec2863
    • A
      virtio: fix vring_align() on 64-bit windows · b8adbc65
      Andrew Baumann 提交于
      long is 32-bits on 64-bit windows, which caused the top half of the
      address to be truncated; this patch changes it to use the
      QEMU_ALIGN_UP macro which does not suffer the same problem
      Signed-off-by: NAndrew Baumann <Andrew.Baumann@microsoft.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: NStefan Weil <sw@weilnetz.de>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      b8adbc65
    • A
      pci: Add missing drop of bus master AS reference · c53598ed
      Alexey Kardashevskiy 提交于
      The recent introduction of a bus master container added
      memory_region_add_subregion() into the PCI device registering path but
      missed memory_region_del_subregion() in the unregistering path leaving
      a reference to the root memory region of the new container.
      
      This adds missing memory_region_del_subregion().
      
      Fixes: 3716d590 ("pci: introduce a bus master container")
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      c53598ed
    • H
      event_notifier: prevent accidental use after close · aa262928
      Halil Pasic 提交于
      Let's set the handles to the underlying facilities to their extremal
      value so no accidental misuse can happen, and to make it obvious that the
      notifier is dysfunctional. E.g. if we just close an fd but do not touch
      the int holding the fd eventually a read/write could succeed again when
      the fd gets reused, and corrupt the file addressed by the fd.
      Signed-off-by: NHalil Pasic <pasic@linux.vnet.ibm.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      aa262928
    • S
      slirp: Send RDNSS in RA only if host has an IPv6 DNS server · a2f80fdf
      Samuel Thibault 提交于
      Previously we would always send an RDNSS option in the RA, making the guest
      try to resolve DNS through IPv6, even if the host does not actually have
      and IPv6 DNS server available.
      
      This makes the RDNSS option enabled only when an IPv6 DNS server is
      available.
      Signed-off-by: NSamuel Thibault <samuel.thibault@ens-lyon.org>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      a2f80fdf
    • S
      slirp: Make RA build more flexible · e42f869b
      Samuel Thibault 提交于
      Do not hardcode the RA size at all, use a pl_size variable which
      accounts the accumulated size, and fill rip->ip_pl at the end.
      
      This will allow to make some blocks optional.
      Signed-off-by: NSamuel Thibault <samuel.thibault@ens-lyon.org>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      e42f869b
    • L
      slirp: fix compilation errors with DEBUG set · 51149a2a
      Laurent Vivier 提交于
      slirp/slirp.c: In function 'get_dns_addr_resolv_conf':
      slirp/slirp.c:202:29: error: initialization discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
                       char *res = inet_ntop(af, tmp_addr, s, sizeof(s));
                                   ^~~~~~~~~
      slirp/slirp.c:204:25: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
                           res = "(string conversion error)";
      Signed-off-by: NLaurent Vivier <laurent@vivier.eu>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Signed-off-by: NSamuel Thibault <samuel.thibault@ens-lyon.org>
      51149a2a
    • E
      i386: Don't override -cpu options on -cpu host/max · d4a606b3
      Eduardo Habkost 提交于
      The existing code for "host" and "max" CPU models overrides every
      single feature in the CPU object at realize time, even the ones
      that were explicitly enabled or disabled by the user using
      "feat=on" or "feat=off", while features set using +feat/-feat are
      kept.
      
      This means "-cpu host,+invtsc" works as expected, while
      "-cpu host,invtsc=on" doesn't.
      
      This was a known bug, already documented in a comment inside
      x86_cpu_expand_features(). What makes this bug worse now is that
      libvirt 3.0.0 and newer now use "feat=on|off" instead of
      +feat/-feat when it detects a QEMU version that supports it (see
      libvirt commit d47db7b16dd5422c7e487c8c8ee5b181a2f9cd66).
      
      Change the feature property getter/setter to set a
      env->user_features field, to keep track of features that were
      explicitly changed using QOM properties. Then make the
      max_features code not override user features when handling "-cpu
      host" and "-cpu max".
      
      This will also allow us to remove the plus_features/minus_features
      hack in the future, but I plan to do that after 2.9.0 is
      released.
      Reported-by: NJiri Denemark <jdenemar@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <20170327144815.8043-3-ehabkost@redhat.com>
      Reviewed-by: NIgor Mammedov <imammedo@redhat.com>
      Tested-by: NJiri Denemark <jdenemar@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      d4a606b3
    • E
      i386: Replace uint32_t* with FeatureWord on feature getter/setter · a7b0ffac
      Eduardo Habkost 提交于
      Instead of passing a pointer to the feature property getter and
      setter functions, pass a FeatureWord enum so they can perform
      other actions related to the feature flag.
      
      This will be used to add a new "user_features" field to keep
      track of features that were explicitly set by the user.
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <20170327144815.8043-2-ehabkost@redhat.com>
      Reviewed-by: NIgor Mammedov <imammedo@redhat.com>
      Tested-by: NJiri Denemark <jdenemar@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      a7b0ffac