Skip to content
Snippets Groups Projects
  1. Apr 07, 2020
  2. Apr 06, 2020
  3. Apr 05, 2020
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2020-04-04' into staging · 547522cd
      Peter Maydell authored
      
      Error reporting patches for 2020-04-04
      
      # gpg: Signature made Sat 04 Apr 2020 13:19:40 BST
      # gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
      # gpg:                issuer "armbru@redhat.com"
      # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
      # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
      # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653
      
      * remotes/armbru/tags/pull-error-2020-04-04:
        qga/commands-posix: fix use after free of local_err
        dump/win_dump: fix use after free of err
        scripts/coccinelle: add error-use-after-free.cocci
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      547522cd
  4. Apr 04, 2020
  5. Apr 03, 2020
  6. Apr 02, 2020
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging · 5142ca07
      Peter Maydell authored
      
      Bugfixes for 5.0-rc2.
      
      # gpg: Signature made Thu 02 Apr 2020 19:57:47 BST
      # gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
      # gpg:                issuer "pbonzini@redhat.com"
      # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full]
      # gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [full]
      # 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:
        xen: fixup RAM memory region initialization
        object-add: don't create return value if failed
        qmp: fix leak on callbacks that return both value and error
        migration: fix cleanup_bh leak on resume
        target/i386: do not set unsupported VMX secondary execution controls
        serial: Fix double migration data
        i386: hvf: Reset IRQ inhibition after moving RIP
        vl: fix broken IPA range for ARM -M virt with KVM enabled
        util/bufferiszero: improve avx2 accelerator
        util/bufferiszero: assign length_to_accel value for each accelerator case
        MAINTAINERS: Add an entry for the HVF accelerator
        softmmu: fix crash with invalid -M memory-backend=
        virtio-iommu: depend on PCI
        hw/isa/superio: Correct the license text
        hw/scsi/vmw_pvscsi: Remove assertion for kick after reset
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      5142ca07
    • Igor Mammedov's avatar
      xen: fixup RAM memory region initialization · 0dc0389f
      Igor Mammedov authored
      
      Since bd457782 ("x86/pc: use memdev for RAM") Xen
      machine fails to start with:
         qemu-system-i386: xen: failed to populate ram at 0
      
      The reason is that xen_ram_alloc() which is called by
      memory_region_init_ram(), compares memory region with
      statically allocated 'global' ram_memory memory region
      that it uses for RAM, and does nothing in case it matches.
      
      While it's possible feed machine->ram to xen_ram_alloc()
      in the same manner to keep that hack working, I'd prefer
      not to keep that circular dependency and try to untangle that.
      
      However it doesn't look trivial to fix, so as temporary
      fixup opt out Xen machine from memdev based RAM allocation,
      and let xen_ram_alloc() do its trick for now.
      
      Reported-by: default avatarAnthony PERARD <anthony.perard@citrix.com>
      Signed-off-by: default avatarIgor Mammedov <imammedo@redhat.com>
      Message-Id: <20200402145418.5139-1-imammedo@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      0dc0389f
    • Paolo Bonzini's avatar
      object-add: don't create return value if failed · 7f5d9b20
      Paolo Bonzini authored
      
      No need to return an empty value from object-add (it would also leak
      if the command failed).  While at it, remove the "if" around object_unref
      since object_unref handles NULL arguments just fine.
      
      Reported-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <20200325184723.2029630-4-marcandre.lureau@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      7f5d9b20
    • Marc-André Lureau's avatar
      qmp: fix leak on callbacks that return both value and error · b3fbb328
      Marc-André Lureau authored
      
      Direct leak of 4120 byte(s) in 1 object(s) allocated from:
          #0 0x7fa114931887 in __interceptor_calloc (/lib64/libasan.so.6+0xb0887)
          #1 0x7fa1144ad8f0 in g_malloc0 (/lib64/libglib-2.0.so.0+0x588f0)
          #2 0x561e3c9c8897 in qmp_object_add /home/elmarco/src/qemu/qom/qom-qmp-cmds.c:291
          #3 0x561e3cf48736 in qmp_dispatch /home/elmarco/src/qemu/qapi/qmp-dispatch.c:155
          #4 0x561e3c8efb36 in monitor_qmp_dispatch /home/elmarco/src/qemu/monitor/qmp.c:145
          #5 0x561e3c8f09ed in monitor_qmp_bh_dispatcher /home/elmarco/src/qemu/monitor/qmp.c:234
          #6 0x561e3d08c993 in aio_bh_call /home/elmarco/src/qemu/util/async.c:136
          #7 0x561e3d08d0a5 in aio_bh_poll /home/elmarco/src/qemu/util/async.c:164
          #8 0x561e3d0a535a in aio_dispatch /home/elmarco/src/qemu/util/aio-posix.c:380
          #9 0x561e3d08e3ca in aio_ctx_dispatch /home/elmarco/src/qemu/util/async.c:298
          #10 0x7fa1144a776e in g_main_context_dispatch (/lib64/libglib-2.0.so.0+0x5276e)
      
      Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <20200325184723.2029630-3-marcandre.lureau@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      b3fbb328
    • Marc-André Lureau's avatar
      migration: fix cleanup_bh leak on resume · 9cbc3649
      Marc-André Lureau authored
      
      Since commit 8c6b0356 ("util/async:
      make bh_aio_poll() O(1)"), migration-test reveals a leak:
      
      QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64
      tests/qtest/migration-test  -p /x86_64/migration/postcopy/recovery
      tests/qtest/libqtest.c:140: kill_qemu() tried to terminate QEMU
      process but encountered exit status 1 (expected 0)
      
      =================================================================
      ==2082571==ERROR: LeakSanitizer: detected memory leaks
      
      Direct leak of 40 byte(s) in 1 object(s) allocated from:
          #0 0x7f25971dfc58 in __interceptor_malloc (/lib64/libasan.so.5+0x10dc58)
          #1 0x7f2596d08358 in g_malloc (/lib64/libglib-2.0.so.0+0x57358)
          #2 0x560970d006f8 in qemu_bh_new /home/elmarco/src/qemu/util/main-loop.c:532
          #3 0x5609704afa02 in migrate_fd_connect
      /home/elmarco/src/qemu/migration/migration.c:3407
          #4 0x5609704b6b6f in migration_channel_connect
      /home/elmarco/src/qemu/migration/channel.c:92
          #5 0x5609704b2bfb in socket_outgoing_migration
      /home/elmarco/src/qemu/migration/socket.c:108
          #6 0x560970b9bd6c in qio_task_complete /home/elmarco/src/qemu/io/task.c:196
          #7 0x560970b9aa97 in qio_task_thread_result
      /home/elmarco/src/qemu/io/task.c:111
          #8 0x7f2596cfee3a  (/lib64/libglib-2.0.so.0+0x4de3a)
      
      Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <20200325184723.2029630-2-marcandre.lureau@redhat.com>
      Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      9cbc3649
    • Vitaly Kuznetsov's avatar
      target/i386: do not set unsupported VMX secondary execution controls · 4a910e1f
      Vitaly Kuznetsov authored
      
      Commit 048c9516 ("target/i386: work around KVM_GET_MSRS bug for
      secondary execution controls") added a workaround for KVM pre-dating
      commit 6defc591846d ("KVM: nVMX: include conditional controls in /dev/kvm
      KVM_GET_MSRS") which wasn't setting certain available controls. The
      workaround uses generic CPUID feature bits to set missing VMX controls.
      
      It was found that in some cases it is possible to observe hosts which
      have certain CPUID features but lack the corresponding VMX control.
      
      In particular, it was reported that Azure VMs have RDSEED but lack
      VMX_SECONDARY_EXEC_RDSEED_EXITING; attempts to enable this feature
      bit result in QEMU abort.
      
      Resolve the issue but not applying the workaround when we don't have
      to. As there is no good way to find out if KVM has the fix itself, use
      95c5c7c77c ("KVM: nVMX: list VMX MSRs in KVM_GET_MSR_INDEX_LIST") instead
      as these [are supposed to] come together.
      
      Fixes: 048c9516 ("target/i386: work around KVM_GET_MSRS bug for secondary execution controls")
      Suggested-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Message-Id: <20200331162752.1209928-1-vkuznets@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      4a910e1f
    • Dr. David Alan Gilbert's avatar
      serial: Fix double migration data · f602d047
      Dr. David Alan Gilbert authored
      After c9808d60 we have both an object representing the serial-isa
      device and a separate object representing the underlying common serial
      uart.  Both of these have vmsd's associated with them and thus the
      migration stream ends up with two copies of the migration data - the
      serial-isa includes the vmstate of the core serial.   Besides
      being wrong, it breaks backwards migration compatibility.
      
      Fix this by removing the dc->vmsd from the core device, so it only
      gets migrated by any parent devices including it.
      Add a vmstate_serial_mm so that any device that uses serial_mm_init
      rather than creating a device still gets migrated.
      (That doesn't fix backwards migration for serial_mm_init users,
      but does seem to work forwards for ppce500).
      
      Fixes: c9808d60 ('serial: realize the serial device')
      Buglink: https://bugs.launchpad.net/qemu/+bug/1869426
      
      
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Message-Id: <20200330164712.198282-1-dgilbert@redhat.com>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      f602d047
    • Roman Bolshakov's avatar
      i386: hvf: Reset IRQ inhibition after moving RIP · ddd31732
      Roman Bolshakov authored
      
      The sequence of instructions exposes an issue:
        sti
        hlt
      
      Interrupts cannot be delivered to hvf after hlt instruction cpu because
      HF_INHIBIT_IRQ_MASK is set just before hlt is handled and never reset
      after moving instruction pointer beyond hlt.
      
      So, after hvf_vcpu_exec() returns, CPU thread gets locked up forever in
      qemu_wait_io_event() (cpu_thread_is_idle() evaluates inhibition
      flag and considers the CPU idle if the flag is set).
      
      Cc: Cameron Esfahani <dirty@apple.com>
      Signed-off-by: default avatarRoman Bolshakov <r.bolshakov@yadro.com>
      Message-Id: <20200328174411.51491-1-r.bolshakov@yadro.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      ddd31732
    • Igor Mammedov's avatar
      vl: fix broken IPA range for ARM -M virt with KVM enabled · 622e99c5
      Igor Mammedov authored
      
      Commit a1b18df9, broke virt_kvm_type() logic, which depends on
      maxram_size, ram_size, ram_slots being parsed/set on machine instance
      at the time accelerator (KVM) is initialized.
      
      set_memory_options() part was already reverted by commit 2a7b18a3,
      so revert remaining initialization of above machine fields to make
      virt_kvm_type() work as it used to.
      
      Signed-off-by: default avatarIgor Mammedov <imammedo@redhat.com>
      Reported-by: default avatarAuger Eric <eric.auger@redhat.com>
      Reviewed-by: default avatarEric Auger <eric.auger@redhat.com>
      Tested-by: default avatarEric Auger <eric.auger@redhat.com>
      Message-Id: <20200326112829.19989-1-imammedo@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      622e99c5
    • Christian Borntraeger's avatar
      vl/s390x: fixup ram sizes for compat machines · 5c30ef93
      Christian Borntraeger authored
      
      Older QEMU versions did fixup the ram size to match what can be reported
      via sclp. We need to mimic this behaviour for machine types 4.2 and
      older to not fail on inbound migration for memory sizes that do not fit.
      Old machines with proper aligned memory sizes are not affected.
      
      Alignment table:
       VM size (<=) | Alignment
      --------------------------
            1020M   |     1M
            2040M   |     2M
            4080M   |     4M
            8160M   |     8M
           16320M   |    16M
           32640M   |    32M
           65280M   |    64M
          130560M   |   128M
          261120M   |   256M
          522240M   |   512M
         1044480M   |     1G
         2088960M   |     2G
         4177920M   |     4G
         8355840M   |     8G
      
      Suggested action is to replace unaligned -m value with a suitable
      aligned one or if a change to a newer machine type is possible, use a
      machine version >= 5.0.
      
      A future version might remove the compatibility handling.
      
      For machine types >= 5.0 we can simply use an increment size of 1M and
      use the full range of increment number which allows for all possible
      memory sizes. The old limitation of having a maximum of 1020 increments
      was added for standby memory, which we no longer support. With that we
      can now support even weird memory sizes like 10001234 MB.
      
      As we no longer fixup maxram_size as well, make other users use ram_size
      instead. Keep using maxram_size when setting the maximum ram size in KVM,
      as that will come in handy in the future when supporting memory hotplug
      (in contrast, storage keys and storage attributes for hotplugged memory
      will have to be migrated per RAM block in the future).
      
      Fixes: 3a12fc61 ("390x/s390-virtio-ccw: use memdev for RAM")
      Reported-by: default avatarLukáš Doktor <ldoktor@redhat.com>
      Signed-off-by: default avatarDavid Hildenbrand <david@redhat.com>
      Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
      Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
      Acked-by: default avatarIgor Mammedov <imammedo@redhat.com>
      Cc: Igor Mammedov <imammedo@redhat.com>
      Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
      Message-Id: <20200401123754.109602-1-borntraeger@de.ibm.com>
      [CH: fixed up message on memory size fixup]
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      5c30ef93
    • Janosch Frank's avatar
      s390x: kvm: Fix number of cpu reports for stsi 3.2.2 · edd075ae
      Janosch Frank authored
      
      The cpu number reporting is handled by KVM and QEMU only fills in the
      VM name, uuid and other values.
      
      Unfortunately KVM doesn't report reserved cpus and doesn't even know
      they exist until the are created via the ioctl.
      
      So let's fix up the cpu values after KVM has written its values to the
      3.2.2 sysib. To be consistent, we use the same code to retrieve the cpu
      numbers as the STSI TCG code in target/s390x/misc_helper.c:HELPER(stsi).
      
      Signed-off-by: default avatarJanosch Frank <frankja@linux.ibm.com>
      Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
      Message-Id: <20200331110123.3774-1-frankja@linux.ibm.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      edd075ae
  7. Apr 01, 2020
  8. Mar 31, 2020
Loading