Skip to content
Snippets Groups Projects
  1. Jul 08, 2019
    • John Snow's avatar
    • Stefan Hajnoczi's avatar
      virtio-scsi: restart DMA after iothread · 1a8c091c
      Stefan Hajnoczi authored
      
      When the 'cont' command resumes guest execution the vm change state
      handlers are invoked.  Unfortunately there is no explicit ordering
      between classic qemu_add_vm_change_state_handler() callbacks.  When two
      layers of code both use vm change state handlers, we don't control which
      handler runs first.
      
      virtio-scsi with iothreads hits a deadlock when a failed SCSI command is
      restarted and completes before the iothread is re-initialized.
      
      This patch uses the new qdev_add_vm_change_state_handler() API to
      guarantee that virtio-scsi's virtio change state handler executes before
      the SCSI bus children.  This way DMA is restarted after the iothread has
      re-initialized.
      
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      1a8c091c
    • Stefan Hajnoczi's avatar
      qdev: add qdev_add_vm_change_state_handler() · e965ffa7
      Stefan Hajnoczi authored
      
      Children sometimes depend on their parent's vm change state handler
      having completed.  Add a vm change state handler API for devices that
      guarantees tree depth ordering.
      
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      e965ffa7
    • Stefan Hajnoczi's avatar
      vl: add qemu_add_vm_change_state_handler_prio() · 60dbc5a1
      Stefan Hajnoczi authored
      
      Add an API for registering vm change state handlers with a well-defined
      ordering.  This is necessary when handlers depend on each other.
      
      Small coding style fixes are included to make checkpatch.pl happy.
      
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      60dbc5a1
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20190708' into staging · df34fe31
      Peter Maydell authored
      
      target-arm queue:
       * tests/migration-test: Fix read off end of aarch64_kernel array
       * Fix sve_zcr_len_for_el off-by-one error
       * hw/arm/sbsa-ref: Silence Coverity nit
       * vfp_helper: Call set_fpscr_to_host before updating to FPSCR
      
      # gpg: Signature made Mon 08 Jul 2019 14:21:20 BST
      # gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
      # gpg:                issuer "peter.maydell@linaro.org"
      # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [ultimate]
      # gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [ultimate]
      # gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [ultimate]
      # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE
      
      * remotes/pmaydell/tags/pull-target-arm-20190708:
        target/arm/vfp_helper: Call set_fpscr_to_host before updating to FPSCR
        hw/arm/sbsa-ref: Remove unnecessary check for secure_sysmem == NULL
        tests/migration-test: Fix read off end of aarch64_kernel array
        target/arm: Fix sve_zcr_len_for_el
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      df34fe31
    • Philippe Mathieu-Daudé's avatar
      target/arm/vfp_helper: Call set_fpscr_to_host before updating to FPSCR · 85795187
      Philippe Mathieu-Daudé authored
      
      In commit e9d65282 we extracted the vfp_set_fpscr_to_host()
      function but failed at calling it in the correct place, we call
      it after xregs[ARM_VFP_FPSCR] is modified.
      
      Fix by calling this function before we update FPSCR.
      
      Reported-by: default avatarLaurent Desnogues <laurent.desnogues@gmail.com>
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Reviewed-by: default avatarLaurent Desnogues <laurent.desnogues@gmail.com>
      Tested-by: default avatarLaurent Desnogues <laurent.desnogues@gmail.com>
      Message-id: 20190705124318.1075-1-philmd@redhat.com
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      85795187
    • Peter Maydell's avatar
      hw/arm/sbsa-ref: Remove unnecessary check for secure_sysmem == NULL · c8ead571
      Peter Maydell authored
      
      In the virt machine, we support TrustZone being either present or
      absent, and so the code must deal with the secure_sysmem pointer
      possibly being NULL. In the sbsa-ref machine, TrustZone is always
      present, but some code and comments copied from virt still treat
      it as possibly not being present.
      
      This causes Coverity to complain (CID 1407287) that we check
      secure_sysmem for being NULL after an unconditional dereference.
      Simplify the code so that instead of initializing the variable
      to NULL, unconditionally assigning it, and then testing it for NULL,
      we just initialize it correctly in the variable declaration and
      then assume it to be non-NULL. We also delete a comment which
      only applied to the non-TrustZone config.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Message-id: 20190704142004.7150-1-peter.maydell@linaro.org
      Tested-by: default avatarRadosław Biernacki <radoslaw.biernacki@linaro.org>
      Reviewed-by: default avatarRadosław Biernacki <radoslaw.biernacki@linaro.org>
      c8ead571
    • Peter Maydell's avatar
      tests/migration-test: Fix read off end of aarch64_kernel array · 2785f196
      Peter Maydell authored
      
      The test aarch64 kernel is in an array defined with
       unsigned char aarch64_kernel[] = { [...] }
      
      which means it could be any size; currently it's quite small.
      However we write it to a file using init_bootfile(), which
      writes exactly 512 bytes to the file. This will break if
      we ever end up with a kernel larger than that, and will
      read garbage off the end of the array in the current setup
      where the kernel is smaller.
      
      Make init_bootfile() take an argument giving the length of
      the data to write. This allows us to use it for all architectures
      (previously s390 had a special-purpose init_bootfile_s390x
      which hardcoded the file to write so it could write the
      correct length). We assert that the x86 bootfile really is
      exactly 512 bytes as it should be (and as we were previously
      just assuming it was).
      
      This was detected by the clang-7 asan:
      ==15607==ERROR: AddressSanitizer: global-buffer-overflow on address 0x55a796f51d20 at pc 0x55a796b89c2f bp 0x7ffc58e89160 sp 0x7ffc58e88908
      READ of size 512 at 0x55a796f51d20 thread T0
          #0 0x55a796b89c2e in fwrite (/home/petmay01/linaro/qemu-from-laptop/qemu/build/sanitizers/tests/migration-test+0xb0c2e)
          #1 0x55a796c46492 in init_bootfile /home/petmay01/linaro/qemu-from-laptop/qemu/tests/migration-test.c:99:5
          #2 0x55a796c46492 in test_migrate_start /home/petmay01/linaro/qemu-from-laptop/qemu/tests/migration-test.c:593
          #3 0x55a796c44101 in test_baddest /home/petmay01/linaro/qemu-from-laptop/qemu/tests/migration-test.c:854:9
          #4 0x7f906ffd3cc9  (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x72cc9)
          #5 0x7f906ffd3bfa  (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x72bfa)
          #6 0x7f906ffd3bfa  (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x72bfa)
          #7 0x7f906ffd3ea1 in g_test_run_suite (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x72ea1)
          #8 0x7f906ffd3ec0 in g_test_run (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x72ec0)
          #9 0x55a796c43707 in main /home/petmay01/linaro/qemu-from-laptop/qemu/tests/migration-test.c:1187:11
          #10 0x7f906e9abb96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
          #11 0x55a796b6c2d9 in _start (/home/petmay01/linaro/qemu-from-laptop/qemu/build/sanitizers/tests/migration-test+0x932d9)
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarLaurent Vivier <lvivier@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Message-id: 20190702150311.20467-1-peter.maydell@linaro.org
      2785f196
    • Richard Henderson's avatar
      target/arm: Fix sve_zcr_len_for_el · 6a02a732
      Richard Henderson authored
      
      Off by one error in the EL2 and EL3 tests.  Remove the test
      against EL3 entirely, since it must always be true.
      
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Message-id: 20190702104732.31154-1-richard.henderson@linaro.org
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      6a02a732
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging · c4107e82
      Peter Maydell authored
      
      Bugfixes.
      
      # gpg: Signature made Fri 05 Jul 2019 21:21:52 BST
      # gpg:                using RSA key BFFBD25F78C7AE83
      # 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:
        ioapic: use irq number instead of vector in ioapic_eoi_broadcast
        hw/i386: Fix linker error when ISAPC is disabled
        Makefile: generate header file with the list of devices enabled
        target/i386: kvm: Fix when nested state is needed for migration
        minikconf: do not include variables from MINIKCONF_ARGS in config-all-devices.mak
        target/i386: fix feature check in hyperv-stub.c
        ioapic: clear irq_eoi when updating the ioapic redirect table entry
        intel_iommu: Fix unexpected unmaps during global unmap
        intel_iommu: Fix incorrect "end" for vtd_address_space_unmap
        i386/kvm: Fix build with -m32
        checkpatch: do not warn for multiline parenthesized returned value
        pc: fix possible NULL pointer dereference in pc_machine_get_device_memory_region_size()
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      c4107e82
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into staging · 3a1acf5d
      Peter Maydell authored
      
      Machine and x86 queue, 2019-07-05
      
      * CPU die topology support (Like Xu)
      * Deprecation of features (Igor Mammedov):
        * 'mem' parameter of '-numa node' option
        * implict memory distribution between NUMA nodes
        * deprecate -mem-path fallback to anonymous RAM
      * x86 versioned CPU models (Eduardo Habkost)
      * SnowRidge CPU model (Paul Lai)
      * Add deprecation information to query-machines (Eduardo Habkost)
      * Other i386 fixes
      
      # gpg: Signature made Fri 05 Jul 2019 23:12:09 BST
      # gpg:                using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6
      # gpg:                issuer "ehabkost@redhat.com"
      # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full]
      # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6
      
      * remotes/ehabkost/tags/machine-next-pull-request: (42 commits)
        tests: use -numa memdev option in tests instead of legacy 'mem' option
        numa: allow memory-less nodes when using memdev as backend
        numa: Make deprecation warnings conditional on !qtest_enabled()
        i386: Add Cascadelake-Server-v2 CPU model
        docs: Deprecate CPU model runnability guarantees
        i386: Make unversioned CPU models be aliases
        i386: Replace -noTSX, -IBRS, -IBPB CPU models with aliases
        i386: Define -IBRS, -noTSX, -IBRS versions of CPU models
        i386: Register versioned CPU models
        i386: Get model-id from CPU object on "-cpu help"
        i386: Add x-force-features option for testing
        qmp: Add "alias-of" field to query-cpu-definitions
        i386: Introduce SnowRidge CPU model
        qmp: Add deprecation information to query-machines
        vl.c: Add -smp, dies=* command line support and update doc
        machine: Refactor smp_parse() in vl.c as MachineClass::smp_parse()
        target/i386: Add CPUID.1F generation support for multi-dies PCMachine
        i386: Remove unused host_cpudef variable
        x86/cpu: use FeatureWordArray to define filtered_features
        i386: make 'hv-spinlocks' a regular uint32 property
        ...
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      3a1acf5d
  2. Jul 05, 2019
Loading