lkml.org 
[lkml]   [2021]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v10 03/11] x86/cpufeatures: Add TDX Guest CPU feature
From
Date

On 10/13/21 2:37 PM, Borislav Petkov wrote:
> On Wed, Oct 13, 2021 at 11:25:35PM +0200, Thomas Gleixner wrote:
>> So this ends up in doing:
>>
>> use();
>> init();
>>
>> Can you spot what's wrong with that?
>>
>> That's a clear violation of common sense and is simply not going to
>> happen. Why? If you think about deep defensive programming then use()
>> will look like this:
>>
>> use()
>> {
>> assert(initialized);
>> }
>>
>> which is not something made up. It's a fundamental principle of
>> programming and some languages enforce that for very good reasons.
>>
>> Just because it can be done in C is no justification.
> Oh, I heartily agree.
>
>> What's wrong with:
>>
>> x86_64_start_kernel()
>>
>> tdx_early_init();
>>
>> copy_bootdata();
>>
>> tdx_late_init();
>>
>> Absolutely nothing. It's clear, simple and well defined.
> I like simple more than anyone, so sure, I'd prefer that a lot more.
>
> And so the options parsing would need to happen early using, say,
> cmdline_find_option() or so, like sme_enable() does.

Since in tdx_early_init() all we are going to do is to initialize
"tdx_guest_detected" using cpuid call, shall we name it
tdx_guest_cpuid_init()? (similar to sme_enable call in AMD)

>
> Hmmm.
>
--
Sathyanarayanan Kuppuswamy
Linux Kernel Developer

\
 
 \ /
  Last update: 2021-10-14 00:30    [W:0.183 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site