lkml.org 
[lkml]   [2023]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH v10 005/108] KVM: TDX: Initialize the TDX module when loading the KVM intel kernel module
    On Sat, Oct 29, 2022 at 11:24 PM <isaku.yamahata@intel.com> wrote:
    >
    > From: Isaku Yamahata <isaku.yamahata@intel.com>

    > +int __init tdx_hardware_setup(struct kvm_x86_ops *x86_ops)
    > +{
    > + int r;
    > +
    > + if (!enable_ept) {
    > + pr_warn("Cannot enable TDX with EPT disabled\n");
    > + return -EINVAL;
    > + }
    > +
    > + /* MOVDIR64B instruction is needed. */
    > + if (!static_cpu_has(X86_FEATURE_MOVDIR64B)) {
    > + pr_warn("Cannot enable TDX with MOVDIR64B supported ");
    > + return -ENODEV;
    > + }
    > +
    > + /* TDX requires VMX. */
    > + r = vmxon_all();
    > + if (!r)
    > + r = tdx_module_setup();
    > + vmxoff_all();

    if few CPUs have VMX enabled, this will disable VMX in all of them.
    Depending on what enabled VMX on those CPUs, would this not cause
    kernel crashes/problems?

    \
     
     \ /
      Last update: 2023-03-26 23:36    [W:2.681 / U:0.056 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site