lkml.org 
[lkml]   [2022]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH v3 04/21] x86/virt/tdx: Add skeleton for detecting and initializing TDX on demand
    From
    Date
    > 
    > > > > +
    > > > > +/**
    > > > > + * tdx_detect - Detect whether the TDX module has been loaded
    > > > > + *
    > > > > + * Detect whether the TDX module has been loaded and ready for
    > > > > + * initialization. Only call this function when all cpus are
    > > > > + * already in VMX operation.
    > > > > + *
    > > > > + * This function can be called in parallel by multiple callers.
    > > > > + *
    > > > > + * Return:
    > > > > + *
    > > > > + * * -0: The TDX module has been loaded and ready for
    > > > > + * initialization.
    > > > > + * * -ENODEV: The TDX module is not loaded.
    > > > > + * * -EPERM: CPU is not in VMX operation.
    > > > > + * * -EFAULT: Other internal fatal errors.
    > > > > + */
    > > > > +int tdx_detect(void)
    > > >
    > > > Will this function be used separately or always along with
    > > > tdx_init()?
    > >
    > > The caller should first use tdx_detect() and then use tdx_init(). If caller
    > > only uses tdx_detect(), then TDX module won't be initialized (unless other
    > > caller does this). If caller calls tdx_init() before tdx_detect(), it will get
    > > error.
    > >
    >
    > I just checked your patch set to understand where you are using
    > tdx_detect()/tdx_init(). But I did not find any callers. Did I miss it?
    > or it is not used in your patch set?
    >

    No you didn't. They are not called in this series. KVM series which is under
    upstream process by Isaku will call them. Dave once said w/o caller is fine as
    for this particular case people know KVM is going to use them. In cover letter
    I also mentioned KVM support is under development by another series. Next
    version in cover letter, I'll explicitly call out this series doesn't have
    caller of them but depends on KVM to call them.


    --
    Thanks,
    -Kai


    \
     
     \ /
      Last update: 2022-04-21 00:36    [W:4.346 / U:1.684 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site