OSDN Git Service

Merge branch 'kvm-tsx-ctrl' into HEAD
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 21 Nov 2019 09:01:51 +0000 (10:01 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 21 Nov 2019 11:03:40 +0000 (12:03 +0100)
Conflicts:
arch/x86/kvm/vmx/vmx.c

16 files changed:
1  2 
Documentation/admin-guide/kernel-parameters.txt
arch/arm64/kernel/cpu_errata.c
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/lapic.c
arch/x86/kvm/lapic.h
arch/x86/kvm/mmu.c
arch/x86/kvm/svm.c
arch/x86/kvm/vmx/nested.c
arch/x86/kvm/vmx/nested.h
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/vmx/vmx.h
arch/x86/kvm/x86.c
include/linux/kvm_host.h
include/linux/perf_event.h
kernel/events/core.c
virt/kvm/kvm_main.c

Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -11,9 -21,10 +21,10 @@@ void nested_vmx_setup_ctls_msrs(struct 
                                bool apicv);
  void nested_vmx_hardware_unsetup(void);
  __init int nested_vmx_hardware_setup(int (*exit_handlers[])(struct kvm_vcpu *));
 -void nested_vmx_vcpu_setup(void);
 +void nested_vmx_set_vmcs_shadowing_bitmap(void);
  void nested_vmx_free_vcpu(struct kvm_vcpu *vcpu);
- int nested_vmx_enter_non_root_mode(struct kvm_vcpu *vcpu, bool from_vmentry);
+ enum nvmx_vmentry_status nested_vmx_enter_non_root_mode(struct kvm_vcpu *vcpu,
+                                                    bool from_vmentry);
  bool nested_vmx_exit_reflected(struct kvm_vcpu *vcpu, u32 exit_reason);
  void nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 exit_reason,
                       u32 exit_intr_info, unsigned long exit_qualification);
@@@ -6703,21 -6791,6 +6738,34 @@@ static struct kvm_vcpu *vmx_create_vcpu
        if (!vmx->guest_msrs)
                goto free_pml;
  
-               vmx->guest_msrs[j].mask = -1ull;
 +      for (i = 0; i < ARRAY_SIZE(vmx_msr_index); ++i) {
 +              u32 index = vmx_msr_index[i];
 +              u32 data_low, data_high;
 +              int j = vmx->nmsrs;
 +
 +              if (rdmsr_safe(index, &data_low, &data_high) < 0)
 +                      continue;
 +              if (wrmsr_safe(index, data_low, data_high) < 0)
 +                      continue;
++
 +              vmx->guest_msrs[j].index = i;
 +              vmx->guest_msrs[j].data = 0;
++              switch (index) {
++              case MSR_IA32_TSX_CTRL:
++                      /*
++                       * No need to pass TSX_CTRL_CPUID_CLEAR through, so
++                       * let's avoid changing CPUID bits under the host
++                       * kernel's feet.
++                       */
++                      vmx->guest_msrs[j].mask = ~(u64)TSX_CTRL_CPUID_CLEAR;
++                      break;
++              default:
++                      vmx->guest_msrs[j].mask = -1ull;
++                      break;
++              }
 +              ++vmx->nmsrs;
 +      }
 +
        err = alloc_loaded_vmcs(&vmx->vmcs01);
        if (err < 0)
                goto free_msrs;
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge