lkml.org 
[lkml]   [2023]   [Jun]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v11 10/20] x86/virt/tdx: Add placeholder to construct TDMRs to cover all TDX memory regions
    On Mon, Jun 05, 2023 at 02:27:23AM +1200, Kai Huang wrote:
    > @@ -50,6 +51,8 @@ static DEFINE_MUTEX(tdx_module_lock);
    > /* All TDX-usable memory regions. Protected by mem_hotplug_lock. */
    > static LIST_HEAD(tdx_memlist);
    >
    > +static struct tdmr_info_list tdx_tdmr_list;
    > +
    > /*
    > * Wrapper of __seamcall() to convert SEAMCALL leaf function error code
    > * to kernel error code. @seamcall_ret and @out contain the SEAMCALL

    The name is misleading. It is not list, it is an array.


    ...

    > @@ -112,6 +135,15 @@ struct tdx_memblock {
    > unsigned long end_pfn;
    > };
    >
    > +struct tdmr_info_list {
    > + void *tdmrs; /* Flexible array to hold 'tdmr_info's */
    > + int nr_consumed_tdmrs; /* How many 'tdmr_info's are in use */
    > +
    > + /* Metadata for finding target 'tdmr_info' and freeing @tdmrs */
    > + int tdmr_sz; /* Size of one 'tdmr_info' */
    > + int max_tdmrs; /* How many 'tdmr_info's are allocated */
    > +};
    > +
    > struct tdx_module_output;
    > u64 __seamcall(u64 fn, u64 rcx, u64 rdx, u64 r8, u64 r9,
    > struct tdx_module_output *out);

    Otherwise, looks okay.

    Reviewed-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>

    --
    Kiryl Shutsemau / Kirill A. Shutemov

    \
     
     \ /
      Last update: 2023-06-09 00:53    [W:4.154 / U:0.052 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site