lkml.org 
[lkml]   [2023]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v12 08/22] x86/virt/tdx: Get information about TDX module and TDX-capable memory
    On Tue, Jun 27, 2023 at 02:12:38AM +1200, Kai Huang wrote:
    > +static int tdx_get_sysinfo(struct tdsysinfo_struct *sysinfo,
    > + struct cmr_info *cmr_array)
    > +{
    > + struct tdx_module_output out;
    > + u64 sysinfo_pa, cmr_array_pa;
    > + int ret;
    > +
    > + sysinfo_pa = __pa(sysinfo);
    > + cmr_array_pa = __pa(cmr_array);
    > + ret = seamcall(TDH_SYS_INFO, sysinfo_pa, TDSYSINFO_STRUCT_SIZE,
    > + cmr_array_pa, MAX_CMRS, NULL, &out);
    > + if (ret)
    > + return ret;
    > +
    > + pr_info("TDX module: attributes 0x%x, vendor_id 0x%x, major_version %u, minor_version %u, build_date %u, build_num %u",
    > + sysinfo->attributes, sysinfo->vendor_id,
    > + sysinfo->major_version, sysinfo->minor_version,
    > + sysinfo->build_date, sysinfo->build_num);
    > +
    > + /* R9 contains the actual entries written to the CMR array. */

    So I'm vexed by this comment; it's either not enough or too much.

    I mean, as given you assume we all know about the magic parameters to
    TDH_SYS_INFO but then somehow need an explanation for how %r9 is changed
    from the array size to the number of used entries.

    Either describe the whole thing or none of it.

    Me, I would prefer all of it, because I've no idea where to begin
    looking for any of this, SDM doesn't seem to be the place. That doesn't
    even list TDCALL/SEAMCALL in Volume 2 :-( Let alone describe the magic
    values.

    > + print_cmrs(cmr_array, out.r9);
    > +
    > + return 0;
    > +}

    \
     
     \ /
      Last update: 2023-06-28 16:11    [W:6.360 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site