Skip to content
Snippets Groups Projects
  1. Jun 21, 2019
    • Vitaly Kuznetsov's avatar
      i386/kvm: move Hyper-V CPUID filling to hyperv_handle_properties() · 2344d22e
      Vitaly Kuznetsov authored
      
      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: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Message-Id: <20190517141924.19024-4-vkuznets@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      2344d22e
    • Vitaly Kuznetsov's avatar
      i386/kvm: add support for KVM_GET_SUPPORTED_HV_CPUID · 6760bd20
      Vitaly Kuznetsov authored
      
      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: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Message-Id: <20190517141924.19024-3-vkuznets@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      6760bd20
    • Vitaly Kuznetsov's avatar
      i386/kvm: convert hyperv enlightenments properties from bools to bits · 2d384d7c
      Vitaly Kuznetsov authored
      
      Representing Hyper-V properties as bits will allow us to check features
      and dependencies between them in a natural way.
      
      Suggested-by: default avatarRoman Kagan <rkagan@virtuozzo.com>
      Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Message-Id: <20190517141924.19024-2-vkuznets@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      2d384d7c
    • Colin Xu's avatar
      hax: Honor CPUState::halted · 6f38dca6
      Colin Xu authored
      
      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: default avatarColin Xu <colin.xu@intel.com>
      Message-Id: <20190610021939.13669-1-colin.xu@intel.com>
      6f38dca6
    • Yury Kotov's avatar
      kvm-all: Add/update fprintf's for kvm_*_ioeventfd_del · e346bcbf
      Yury Kotov authored
      
      Signed-off-by: default avatarYury Kotov <yury-kotov@yandex-team.ru>
      Message-Id: <20190607090830.18807-1-yury-kotov@yandex-team.ru>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      e346bcbf
  2. Jun 18, 2019
  3. Jun 17, 2019
Loading