An error occurred fetching the project authors.
  1. 13 Jan, 2023 2 commits
  2. 27 Dec, 2022 1 commit
    • Vitaly Kuznetsov's avatar
      KVM: VMX: Resurrect vmcs_conf sanitization for KVM-on-Hyper-V · 15670376
      Vitaly Kuznetsov authored
      Commit 9bcb9065 ("KVM: VMX: Get rid of eVMCS specific VMX controls
      sanitization") dropped 'vmcs_conf' sanitization for KVM-on-Hyper-V because
      there's no known Hyper-V version which would expose a feature
      unsupported in eVMCS in VMX feature MSRs. This works well for all
      currently existing Hyper-V version, however, future Hyper-V versions
      may add features which are supported by KVM and are currently missing
      in eVMCSv1 definition (e.g. APIC virtualization, PML,...). When this
      happens, existing KVMs will get broken. With the inverted 'unsupported
      by eVMCSv1' checks, we can resurrect vmcs_conf sanitization and make
      KVM future proof.
      Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Message-Id: <20221104144708.435865-5-vkuznets@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      15670376
  3. 23 Dec, 2022 1 commit
    • Sean Christopherson's avatar
      KVM: nVMX: Don't stuff secondary execution control if it's not supported · a0860d68
      Sean Christopherson authored
      When stuffing the allowed secondary execution controls for nested VMX in
      response to CPUID updates, don't set the allowed-1 bit for a feature that
      isn't supported by KVM, i.e. isn't allowed by the canonical vmcs_config.
      
      WARN if KVM attempts to manipulate a feature that isn't supported.  All
      features that are currently stuffed are always advertised to L1 for
      nested VMX if they are supported in KVM's base configuration, and no
      additional features should ever be added to the CPUID-induced stuffing
      (updating VMX MSRs in response to CPUID updates is a long-standing KVM
      flaw that is slowly being fixed).
      Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
      Message-Id: <20221213062306.667649-3-seanjc@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      a0860d68
  4. 01 Dec, 2022 4 commits
  5. 18 Nov, 2022 2 commits
  6. 09 Nov, 2022 6 commits
  7. 02 Nov, 2022 2 commits
    • Sean Christopherson's avatar
      KVM: VMX: Ignore guest CPUID for host userspace writes to DEBUGCTL · b333b8eb
      Sean Christopherson authored
      Ignore guest CPUID for host userspace writes to the DEBUGCTL MSR, KVM's
      ABI is that setting CPUID vs. state can be done in any order, i.e. KVM
      allows userspace to stuff MSRs prior to setting the guest's CPUID that
      makes the new MSR "legal".
      
      Keep the vmx_get_perf_capabilities() check for guest writes, even though
      it's technically unnecessary since the vCPU's PERF_CAPABILITIES is
      consulted when refreshing LBR support.  A future patch will clean up
      vmx_get_perf_capabilities() to avoid the RDMSR on every call, at which
      point the paranoia will incur no meaningful overhead.
      
      Note, prior to vmx_get_perf_capabilities() checking that the host fully
      supports LBRs via x86_perf_get_lbr(), KVM effectively relied on
      intel_pmu_lbr_is_enabled() to guard against host userspace enabling LBRs
      on platforms without full support.
      
      Fixes: c6462363 ("KVM: vmx/pmu: Add PMU_CAP_LBR_FMT check when guest LBR is enabled")
      Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
      Message-Id: <20221006000314.73240-5-seanjc@google.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      b333b8eb
    • Sean Christopherson's avatar
      KVM: VMX: Fold vmx_supported_debugctl() into vcpu_supported_debugctl() · 18e897d2
      Sean Christopherson authored
      Fold vmx_supported_debugctl() into vcpu_supported_debugctl(), its only
      caller.  Setting bits only to clear them a few instructions later is
      rather silly, and splitting the logic makes things seem more complicated
      than they actually are.
      
      Opportunistically drop DEBUGCTLMSR_LBR_MASK now that there's a single
      reference to the pair of bits.  The extra layer of indirection provides
      no meaningful value and makes it unnecessarily tedious to understand
      what KVM is doing.
      
      No functional change.
      Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
      Message-Id: <20221006000314.73240-4-seanjc@google.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      18e897d2
  8. 27 Oct, 2022 1 commit
    • Emanuele Giuseppe Esposito's avatar
      KVM: VMX: fully disable SGX if SECONDARY_EXEC_ENCLS_EXITING unavailable · 1c1a4149
      Emanuele Giuseppe Esposito authored
      Clear enable_sgx if ENCLS-exiting is not supported, i.e. if SGX cannot be
      virtualized.  When KVM is loaded, adjust_vmx_controls checks that the
      bit is available before enabling the feature; however, other parts of the
      code check enable_sgx and not clearing the variable caused two different
      bugs, mostly affecting nested virtualization scenarios.
      
      First, because enable_sgx remained true, SECONDARY_EXEC_ENCLS_EXITING
      would be marked available in the capability MSR that are accessed by a
      nested hypervisor.  KVM would then propagate the control from vmcs12
      to vmcs02 even if it isn't supported by the processor, thus causing an
      unexpected VM-Fail (exit code 0x7) in L1.
      
      Second, vmx_set_cpu_caps() would not clear the SGX bits when hardware
      support is unavailable.  This is a much less problematic bug as it only
      happens if SGX is soft-disabled (available in the processor but hidden
      in CPUID) or if SGX is supported for bare metal but not in the VMCS
      (will never happen when running on bare metal, but can theoertically
      happen when running in a VM).
      
      Last but not least, this ensures that module params in sysfs reflect
      KVM's actual configuration.
      
      RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=2127128
      Fixes: 72add915 ("KVM: VMX: Enable SGX virtualization for SGX1, SGX2 and LC")
      Cc: stable@vger.kernel.org
      Suggested-by: default avatarSean Christopherson <seanjc@google.com>
      Suggested-by: default avatarBandan Das <bsd@redhat.com>
      Signed-off-by: default avatarEmanuele Giuseppe Esposito <eesposit@redhat.com>
      Message-Id: <20221025123749.2201649-1-eesposit@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      1c1a4149
  9. 26 Sep, 2022 21 commits