Skip to content
Snippets Groups Projects
  1. Mar 31, 2017
  2. Mar 30, 2017
    • Michael Roth's avatar
      qga: don't fail if mount doesn't have slave devices · 8251a72f
      Michael Roth authored
      
      In some cases the slave devices of a virtual block device are tracked
      by the parent in the corresponding sysfs node. For instance, if we
      have a loop-back mount of the form:
      
        /dev/loop3p1 on /home/mdroth/mnt type ext4 (rw,relatime,data=ordered)
      
      this will be reflected in sysfs as:
      
        /sys/devices/virtual/block/loop3/
        ...
        /sys/devices/virtual/block/loop3/slaves
        /sys/devices/virtual/block/loop3/loop3p1
      
      The current code however assumes the mounted virtual block device,
      loop3p1 in this case, contains the slaves directory, and reports an
      error otherwise. This breaks 'make check' in certain environments.
      
      Fix this by simply skipping attempts to generate disk topology
      information in these cases. Since this information is documented
      in QAPI as optionally-reported, this should be ok from an API
      perspective.
      
      In the future, this can possibly be improved upon by collecting
      topology information from the parent in these cases.
      
      Reported-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarMichael Roth <mdroth@linux.vnet.ibm.com>
      Tested-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      8251a72f
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging · ddc2c3a5
      Peter Maydell authored
      
      vhost, pc: fixes
      
      More fixes for 2.9. Region caching is still causing
      issues around reset, but we seem to be getting there.
      
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      
      # gpg: Signature made Thu 30 Mar 2017 17:14:45 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:
        tests/acpi: don't pack a structure
        vhost: generalize iommu memory region
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      ddc2c3a5
    • Michael S. Tsirkin's avatar
      tests/acpi: don't pack a structure · 0d876080
      Michael S. Tsirkin authored
      
      There's no reason to pack structures where we don't care about size or
      padding, this applies to AcpiStdTable in tests/acpi-utils.h.
      
      OTOH bios-tables-test happens to be passing the address of a field in
      this  struct to a function that expects a pointer to normally aligned
      data which results in a SIGBUS on architectures like SPARC that have
      strict alignment requirements.
      
      Fixes: 9e8458c0 ("acpi unit-test: compare DSDT and SSDT tables against expected values")
      Reported-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Tested-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      0d876080
    • Jason Wang's avatar
      vhost: generalize iommu memory region · 375f74f4
      Jason Wang authored
      
      We assumes the iommu_ops were attached to the root region of address
      space. This may not be true for all kinds of IOMMU implementation and
      especially after commit 3716d590 ("pci: introduce a bus master
      container"). So fix this by not assuming as->root has iommu_ops,
      instead depending on the regions reported by memory listener through:
      
      - register a memory listener to dma_as
      - during region_add, if it's a region of IOMMU, register a specific
        IOMMU notifier, and store all notifiers in a list.
      - during region_del, compare and delete the IOMMU notifier from the list
      
      This is also a must for making vhost device IOTLB works for all types
      of IOMMUs. Note, since we register one notifier during each
      .region_add, the IOTLB may be flushed more than one times, this is
      suboptimal and could be optimized in the future.
      
      Reported-by: default avatarMaxime Coquelin <maxime.coquelin@redhat.com>
      Fixes: 3716d590 ("pci: introduce a bus master container")
      Cc: Peter Xu <peterx@redhat.com>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: default avatarPeter Xu <peterx@redhat.com>
      Tested-by: default avatarMaxime Coquelin <maxime.coquelin@redhat.com>
      375f74f4
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/thibault/tags/samuel-thibault' into staging · e839001d
      Peter Maydell authored
      
      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: default avatarPeter Maydell <peter.maydell@linaro.org>
      e839001d
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.9-20170329' into staging · a67ec6ee
      Peter Maydell authored
      
      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: default avatarPeter Maydell <peter.maydell@linaro.org>
      a67ec6ee
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging · e68dd684
      Peter Maydell authored
      
      virtio, pci: fixes
      
      More fixes for 2.9.
      
      Signed-off-by: default avatarMichael 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: default avatarPeter Maydell <peter.maydell@linaro.org>
      e68dd684
    • Peter Maydell's avatar
      configure: Don't claim 'unsupported host OS' when better message available · fb59dabd
      Peter Maydell authored
      
      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: default avatarStefan Weil <sw@weilnetz.de>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarStefan Weil <sw@weilnetz.de>
      Tested-by: default avatarStefan Weil <sw@weilnetz.de>
      fb59dabd
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/ehabkost/tags/x86-pull-request' into staging · b529aec1
      Peter Maydell authored
      
      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: default avatarPeter Maydell <peter.maydell@linaro.org>
      b529aec1
  3. Mar 29, 2017
    • Laurent Vivier's avatar
      spapr: fix memory hot-unplugging · fe6824d1
      Laurent Vivier authored
      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=1432382
      
      
      
      Signed-off-by: default avatarLaurent Vivier <lvivier@redhat.com>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      fe6824d1
    • Marc-André Lureau's avatar
      spapr: fix buffer-overflow · 24ec2863
      Marc-André Lureau authored
      
      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: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      24ec2863
  4. Mar 28, 2017
Loading