1. 20 Oct, 2017 3 commits
    • Wanpeng Li's avatar
      KVM: X86: #GP when guest attempts to write MCi_STATUS register w/o 0 · 9ffd986c
      Wanpeng Li authored
      Both Intel SDM and AMD APM mentioned that MCi_STATUS, when the register is
      implemented, this register can be cleared by explicitly writing 0s to this
      register. Writing 1s to this register will cause a general-protection
      exception.
      
      The mce is emulated in qemu, so just the guest attempts to write 1 to this
      register should cause a #GP, this patch does it.
      
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Radim Krčmář <rkrcmar@redhat.com>
      Cc: Jim Mattson <jmattson@google.com>
      Signed-off-by: default avatarWanpeng Li <wanpeng.li@hotmail.com>
      Reviewed-by: default avatarJim Mattson <jmattson@google.com>
      Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
      9ffd986c
    • Wanpeng Li's avatar
      KVM: VMX: Fix VPID capability detection · 61f1dd90
      Wanpeng Li authored
      In my setup, EPT is not exposed to L1, the VPID capability is exposed and
      can be observed by vmxcap tool in L1:
      INVVPID supported                        yes
      Individual-address INVVPID               yes
      Single-context INVVPID                   yes
      All-context INVVPID                      yes
      Single-context-retaining-globals INVVPID yes
      
      However, the module parameter of VPID observed in L1 is always N, the
      cpu_has_vmx_invvpid() check in L1 KVM fails since vmx_capability.vpid
      is 0 and it is not read from MSR due to EPT is not exposed.
      
      The VPID can be used to tag linear mappings when EPT is not enabled. However,
      current logic just detects VPID capability if EPT is enabled, this patch
      fixes it.
      
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Radim Krčmář <rkrcmar@redhat.com>
      Cc: Jim Mattson <jmattson@google.com>
      Signed-off-by: default avatarWanpeng Li <wanpeng.li@hotmail.com>
      Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
      61f1dd90
    • Wanpeng Li's avatar
      KVM: nVMX: Fix EPT switching advertising · 575b3a2c
      Wanpeng Li authored
      I can use vmxcap tool to observe "EPTP Switching   yes" even if EPT is not
      exposed to L1.
      
      EPT switching is advertised unconditionally since it is emulated, however,
      it can be treated as an extended feature for EPT and it should not be
      advertised if EPT itself is not exposed. This patch fixes it.
      Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Radim Krčmář <rkrcmar@redhat.com>
      Cc: Jim Mattson <jmattson@google.com>
      Signed-off-by: default avatarWanpeng Li <wanpeng.li@hotmail.com>
      Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
      575b3a2c
  2. 18 Oct, 2017 1 commit
  3. 12 Oct, 2017 36 commits