1. 22 10月, 2020 30 次提交
  2. 20 10月, 2020 1 次提交
  3. 03 10月, 2020 1 次提交
  4. 29 9月, 2020 1 次提交
  5. 28 9月, 2020 7 次提交
    • P
      KVM: x86: do not attempt TSC synchronization on guest writes · 0c899c25
      Paolo Bonzini 提交于
      KVM special-cases writes to MSR_IA32_TSC so that all CPUs have
      the same base for the TSC.  This logic is complicated, and we
      do not want it to have any effect once the VM is started.
      
      In particular, if any guest started to synchronize its TSCs
      with writes to MSR_IA32_TSC rather than MSR_IA32_TSC_ADJUST,
      the additional effect of kvm_write_tsc code would be uncharted
      territory.
      
      Therefore, this patch makes writes to MSR_IA32_TSC behave
      essentially the same as writes to MSR_IA32_TSC_ADJUST when
      they come from the guest.  A new selftest (which passes
      both before and after the patch) checks the current semantics
      of writes to MSR_IA32_TSC and MSR_IA32_TSC_ADJUST originating
      from both the host and the guest.
      
      Upcoming work to remove the special side effects
      of host-initiated writes to MSR_IA32_TSC and MSR_IA32_TSC_ADJUST
      will be able to build onto this test, adjusting the host side
      to use the new APIs and achieve the same effect.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      0c899c25
    • P
      KVM: nSVM: delay MSR permission processing to first nested VM run · a7d5c7ce
      Paolo Bonzini 提交于
      Allow userspace to set up the memory map after KVM_SET_NESTED_STATE;
      to do so, move the call to nested_svm_vmrun_msrpm inside the
      KVM_REQ_GET_NESTED_STATE_PAGES handler (which is currently
      not used by nSVM).  This is similar to what VMX does already.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      a7d5c7ce
    • P
      KVM: x86: rename KVM_REQ_GET_VMCS12_PAGES · 729c15c2
      Paolo Bonzini 提交于
      We are going to use it for SVM too, so use a more generic name.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      729c15c2
    • A
      KVM: x86: Introduce MSR filtering · 1a155254
      Alexander Graf 提交于
      It's not desireable to have all MSRs always handled by KVM kernel space. Some
      MSRs would be useful to handle in user space to either emulate behavior (like
      uCode updates) or differentiate whether they are valid based on the CPU model.
      
      To allow user space to specify which MSRs it wants to see handled by KVM,
      this patch introduces a new ioctl to push filter rules with bitmaps into
      KVM. Based on these bitmaps, KVM can then decide whether to reject MSR access.
      With the addition of KVM_CAP_X86_USER_SPACE_MSR it can also deflect the
      denied MSR events to user space to operate on.
      
      If no filter is populated, MSR handling stays identical to before.
      Signed-off-by: NAlexander Graf <graf@amazon.com>
      
      Message-Id: <20200925143422.21718-8-graf@amazon.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      1a155254
    • A
      KVM: x86: VMX: Prevent MSR passthrough when MSR access is denied · 3eb90017
      Alexander Graf 提交于
      We will introduce the concept of MSRs that may not be handled in kernel
      space soon. Some MSRs are directly passed through to the guest, effectively
      making them handled by KVM from user space's point of view.
      
      This patch introduces all logic required to ensure that MSRs that
      user space wants trapped are not marked as direct access for guests.
      Signed-off-by: NAlexander Graf <graf@amazon.com>
      Message-Id: <20200925143422.21718-7-graf@amazon.com>
      [Replace "_idx" with "_slot". - Paolo]
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      3eb90017
    • A
      KVM: x86: SVM: Prevent MSR passthrough when MSR access is denied · fd6fa73d
      Alexander Graf 提交于
      We will introduce the concept of MSRs that may not be handled in kernel
      space soon. Some MSRs are directly passed through to the guest, effectively
      making them handled by KVM from user space's point of view.
      
      This patch introduces all logic required to ensure that MSRs that
      user space wants trapped are not marked as direct access for guests.
      Signed-off-by: NAlexander Graf <graf@amazon.com>
      Message-Id: <20200925143422.21718-6-graf@amazon.com>
      [Make terminology a bit more similar to VMX. - Paolo]
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      fd6fa73d
    • A
      KVM: x86: Prepare MSR bitmaps for userspace tracked MSRs · 476c9bd8
      Aaron Lewis 提交于
      Prepare vmx and svm for a subsequent change that ensures the MSR permission
      bitmap is set to allow an MSR that userspace is tracking to force a vmx_vmexit
      in the guest.
      Signed-off-by: NAaron Lewis <aaronlewis@google.com>
      Reviewed-by: NOliver Upton <oupton@google.com>
      [agraf: rebase, adapt SVM scheme to nested changes that came in between]
      Signed-off-by: NAlexander Graf <graf@amazon.com>
      Message-Id: <20200925143422.21718-5-graf@amazon.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      476c9bd8