Skip to content
  1. Jun 01, 2020
    • Peter Shier's avatar
      KVM: nVMX: Fix VMX preemption timer migration · 850448f3
      Peter Shier authored
      
      
      Add new field to hold preemption timer expiration deadline
      appended to struct kvm_vmx_nested_state_hdr. This is to prevent
      the first VM-Enter after migration from incorrectly restarting the timer
      with the full timer value instead of partially decayed timer value.
      KVM_SET_NESTED_STATE restarts timer using migrated state regardless
      of whether L1 sets VM_EXIT_SAVE_VMX_PREEMPTION_TIMER.
      
      Fixes: cf8b84f4 ("kvm: nVMX: Prepare for checkpointing L2 state")
      
      Signed-off-by: default avatarPeter Shier <pshier@google.com>
      Signed-off-by: default avatarMakarand Sonare <makarandsonare@google.com>
      Message-Id: <20200526215107.205814-2-makarandsonare@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      850448f3
    • Jon Doron's avatar
      x86/kvm/hyper-v: Explicitly align hcall param for kvm_hyperv_exit · f7d31e65
      Jon Doron authored
      
      
      The problem the patch is trying to address is the fact that 'struct
      kvm_hyperv_exit' has different layout on when compiling in 32 and 64 bit
      modes.
      
      In 64-bit mode the default alignment boundary is 64 bits thus
      forcing extra gaps after 'type' and 'msr' but in 32-bit mode the
      boundary is at 32 bits thus no extra gaps.
      
      This is an issue as even when the kernel is 64 bit, the userspace using
      the interface can be both 32 and 64 bit but the same 32 bit userspace has
      to work with 32 bit kernel.
      
      The issue is fixed by forcing the 64 bit layout, this leads to ABI
      change for 32 bit builds and while we are obviously breaking '32 bit
      userspace with 32 bit kernel' case, we're fixing the '32 bit userspace
      with 64 bit kernel' one.
      
      As the interface has no (known) users and 32 bit KVM is rather baroque
      nowadays, this seems like a reasonable decision.
      
      Reviewed-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: default avatarJon Doron <arilou@gmail.com>
      Message-Id: <20200424113746.3473563-2-arilou@gmail.com>
      Reviewed-by: default avatarRoman Kagan <rvkagan@yandex-team.ru>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      f7d31e65
    • Vitaly Kuznetsov's avatar
      KVM: x86: announce KVM_FEATURE_ASYNC_PF_INT · 72de5fa4
      Vitaly Kuznetsov authored
      
      
      Introduce new capability to indicate that KVM supports interrupt based
      delivery of 'page ready' APF events. This includes support for both
      MSR_KVM_ASYNC_PF_INT and MSR_KVM_ASYNC_PF_ACK.
      
      Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Message-Id: <20200525144125.143875-8-vkuznets@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      72de5fa4
    • Vitaly Kuznetsov's avatar
      KVM: x86: acknowledgment mechanism for async pf page ready notifications · 557a961a
      Vitaly Kuznetsov authored
      
      
      If two page ready notifications happen back to back the second one is not
      delivered and the only mechanism we currently have is
      kvm_check_async_pf_completion() check in vcpu_run() loop. The check will
      only be performed with the next vmexit when it happens and in some cases
      it may take a while. With interrupt based page ready notification delivery
      the situation is even worse: unlike exceptions, interrupts are not handled
      immediately so we must check if the slot is empty. This is slow and
      unnecessary. Introduce dedicated MSR_KVM_ASYNC_PF_ACK MSR to communicate
      the fact that the slot is free and host should check its notification
      queue. Mandate using it for interrupt based 'page ready' APF event
      delivery.
      
      As kvm_check_async_pf_completion() is going away from vcpu_run() we need
      a way to communicate the fact that vcpu->async_pf.done queue has
      transitioned from empty to non-empty state. Introduce
      kvm_arch_async_page_present_queued() and KVM_REQ_APF_READY to do the job.
      
      Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Message-Id: <20200525144125.143875-7-vkuznets@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      557a961a
    • Vitaly Kuznetsov's avatar
      KVM: x86: interrupt based APF 'page ready' event delivery · 2635b5c4
      Vitaly Kuznetsov authored
      
      
      Concerns were expressed around APF delivery via synthetic #PF exception as
      in some cases such delivery may collide with real page fault. For 'page
      ready' notifications we can easily switch to using an interrupt instead.
      Introduce new MSR_KVM_ASYNC_PF_INT mechanism and deprecate the legacy one.
      
      One notable difference between the two mechanisms is that interrupt may not
      get handled immediately so whenever we would like to deliver next event
      (regardless of its type) we must be sure the guest had read and cleared
      previous event in the slot.
      
      While on it, get rid on 'type 1/type 2' names for APF events in the
      documentation as they are causing confusion. Use 'page not present'
      and 'page ready' everywhere instead.
      
      Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Message-Id: <20200525144125.143875-6-vkuznets@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      2635b5c4
  2. May 15, 2020
  3. May 06, 2020
  4. Apr 24, 2020
  5. Apr 21, 2020
    • Sean Christopherson's avatar
      KVM: nVMX: Remove non-functional "support" for CR3 target values · b8d295f9
      Sean Christopherson authored
      
      
      Remove all references to cr3_target_value[0-3] and replace the fields
      in vmcs12 with "dead_space" to preserve the vmcs12 layout.  KVM doesn't
      support emulating CR3-target values, despite a variety of code that
      implies otherwise, as KVM unconditionally reports '0' for the number of
      supported CR3-target values.
      
      This technically fixes a bug where KVM would incorrectly allow VMREAD
      and VMWRITE to nonexistent fields, i.e. cr3_target_value[0-3].  Per
      Intel's SDM, the number of supported CR3-target values reported in
      VMX_MISC also enumerates the existence of the associated VMCS fields:
      
        If a future implementation supports more than 4 CR3-target values, they
        will be encoded consecutively following the 4 encodings given here.
      
      Alternatively, the "bug" could be fixed by actually advertisting support
      for 4 CR3-target values, but that'd likely just enable kvm-unit-tests
      given that no one has complained about lack of support for going on ten
      years, e.g. KVM, Xen and HyperV don't use CR3-target values.
      
      Signed-off-by: default avatarSean Christopherson <sean.j.christopherson@intel.com>
      Message-Id: <20200416000739.9012-1-sean.j.christopherson@intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      b8d295f9
  6. Mar 27, 2020
  7. Mar 26, 2020
    • Paul Mackerras's avatar
      KVM: PPC: Book3S HV: Add a capability for enabling secure guests · 9a5788c6
      Paul Mackerras authored
      
      
      At present, on Power systems with Protected Execution Facility
      hardware and an ultravisor, a KVM guest can transition to being a
      secure guest at will.  Userspace (QEMU) has no way of knowing
      whether a host system is capable of running secure guests.  This
      will present a problem in future when the ultravisor is capable of
      migrating secure guests from one host to another, because
      virtualization management software will have no way to ensure that
      secure guests only run in domains where all of the hosts can
      support secure guests.
      
      This adds a VM capability which has two functions: (a) userspace
      can query it to find out whether the host can support secure guests,
      and (b) userspace can enable it for a guest, which allows that
      guest to become a secure guest.  If userspace does not enable it,
      KVM will return an error when the ultravisor does the hypercall
      that indicates that the guest is starting to transition to a
      secure guest.  The ultravisor will then abort the transition and
      the guest will terminate.
      
      Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
      Reviewed-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: default avatarRam Pai <linuxram@us.ibm.com>
      9a5788c6
  8. Mar 24, 2020
  9. Mar 20, 2020
  10. Mar 16, 2020
  11. Feb 27, 2020
  12. Feb 24, 2020
  13. Feb 12, 2020
Loading