1. 21 6月, 2019 6 次提交
    • V
      i386/kvm: document existing Hyper-V enlightenments · fb19f72b
      Vitaly Kuznetsov 提交于
      Currently, there is no doc describing hv-* CPU flags, people are
      encouraged to get the information from Microsoft Hyper-V Top Level
      Functional specification (TLFS). There is, however, a bit of QEMU
      specifics.
      Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
      Message-Id: <20190517141924.19024-5-vkuznets@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      fb19f72b
    • V
      i386/kvm: move Hyper-V CPUID filling to hyperv_handle_properties() · 2344d22e
      Vitaly Kuznetsov 提交于
      Let's consolidate Hyper-V features handling in hyperv_handle_properties().
      The change is necessary to support 'hv-passthrough' mode as we'll be just
      copying CPUIDs from KVM instead of filling them in.
      Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
      Message-Id: <20190517141924.19024-4-vkuznets@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      2344d22e
    • V
      i386/kvm: add support for KVM_GET_SUPPORTED_HV_CPUID · 6760bd20
      Vitaly Kuznetsov 提交于
      KVM now supports reporting supported Hyper-V features through CPUID
      (KVM_GET_SUPPORTED_HV_CPUID ioctl). Going forward, this is going to be
      the only way to announce new functionality and this has already happened
      with Direct Mode stimers.
      
      While we could just support KVM_GET_SUPPORTED_HV_CPUID for new features,
      it seems to be beneficial to use it for all Hyper-V enlightenments when
      possible. This way we can implement 'hv-all' pass-through mode giving the
      guest all supported Hyper-V features even when QEMU knows nothing about
      them.
      
      Implementation-wise we create a new kvm_hyperv_properties structure
      defining Hyper-V features, get_supported_hv_cpuid()/
      get_supported_hv_cpuid_legacy() returning the supported CPUID set and
      a bit over-engineered hv_cpuid_check_and_set() which we will also be
      used to set cpu->hyperv_* properties for 'hv-all' mode.
      Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
      Message-Id: <20190517141924.19024-3-vkuznets@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      6760bd20
    • V
      i386/kvm: convert hyperv enlightenments properties from bools to bits · 2d384d7c
      Vitaly Kuznetsov 提交于
      Representing Hyper-V properties as bits will allow us to check features
      and dependencies between them in a natural way.
      Suggested-by: NRoman Kagan <rkagan@virtuozzo.com>
      Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
      Message-Id: <20190517141924.19024-2-vkuznets@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      2d384d7c
    • C
      hax: Honor CPUState::halted · 6f38dca6
      Colin Xu 提交于
      QEMU tracks whether a vcpu is halted using CPUState::halted. E.g.,
      after initialization or reset, halted is 0 for the BSP (vcpu 0)
      and 1 for the APs (vcpu 1, 2, ...). A halted vcpu should not be
      handed to the hypervisor to run (e.g. hax_vcpu_run()).
      
      Under HAXM, Android Emulator sometimes boots into a "vcpu shutdown
      request" error while executing in SeaBIOS, with the HAXM driver
      logging a guest triple fault in vcpu 1, 2, ... at RIP 0x3. That is
      ultimately because the HAX accelerator asks HAXM to run those APs
      when they are still in the halted state.
      
      Normally, the vcpu thread for an AP will start by looping in
      qemu_wait_io_event(), until the BSP kicks it via a pair of IPIs
      (INIT followed by SIPI). But because the HAX accelerator does not
      honor cpu->halted, it allows the AP vcpu thread to proceed to
      hax_vcpu_run() as soon as it receives any kick, even if the kick
      does not come from the BSP. It turns out that emulator has a
      worker thread which periodically kicks every vcpu thread (possibly
      to collect CPU usage data), and if one of these kicks comes before
      those by the BSP, the AP will start execution from the wrong RIP,
      resulting in the aforementioned SMP boot failure.
      
      The solution is inspired by the KVM accelerator (credit to
      Chuanxiao Dong <chuanxiao.dong@intel.com> for the pointer):
      
      1. Get rid of questionable logic that unconditionally resets
         cpu->halted before hax_vcpu_run(). Instead, only reset it at the
         right moments (there are only a few "unhalt" events).
      2. Add a check for cpu->halted before hax_vcpu_run().
      
      Note that although the non-Unrestricted Guest (!ug_platform) code
      path also forcibly resets cpu->halted, it is left untouched,
      because only the UG code path supports SMP guests.
      
      The patch is first merged to android emulator with Change-Id:
      I9c5752cc737fd305d7eace1768ea12a07309d716
      
      Cc: Yu Ning <yu.ning@intel.com>
      Cc: Chuanxiao Dong <chuanxiao.dong@intel.com>
      Signed-off-by: NColin Xu <colin.xu@intel.com>
      Message-Id: <20190610021939.13669-1-colin.xu@intel.com>
      6f38dca6
    • Y
      kvm-all: Add/update fprintf's for kvm_*_ioeventfd_del · e346bcbf
      Yury Kotov 提交于
      Signed-off-by: NYury Kotov <yury-kotov@yandex-team.ru>
      Message-Id: <20190607090830.18807-1-yury-kotov@yandex-team.ru>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      e346bcbf
  2. 19 6月, 2019 1 次提交
    • P
      Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging · 33d60999
      Peter Maydell 提交于
      Block layer patches:
      
      - block: Remove bs->job
      - block: Ignore loosening perm restrictions failures
      - block/null: Expose read-zeroes option in QAPI schema
      - iotests: Hide timestamps for skipped tests
      
      # gpg: Signature made Tue 18 Jun 2019 15:44:12 BST
      # gpg:                using RSA key 7F09B272C88F2FD6
      # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full]
      # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6
      
      * remotes/kevin/tags/for-upstream:
        block/null: Expose read-zeroes option in QAPI schema
        iotests: Test failure to loosen restrictions
        block: Ignore loosening perm restrictions failures
        block: Add *tighten_restrictions to *check*_perm()
        block: Fix order in bdrv_replace_child()
        block/commit: Drop bdrv_child_try_set_perm()
        block/mirror: Fix child permissions
        block: Add bdrv_child_refresh_perms()
        file-posix: Update open_flags in raw_set_perm()
        block: drop bs->job
        blockdev: blockdev_mark_auto_del: drop usage of bs->job
        block/block-backend: blk_iostatus_reset: drop usage of bs->job
        block/replication: drop usage of bs->job
        iotests: Hide timestamps for skipped tests
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      33d60999
  3. 18 6月, 2019 33 次提交