lkml.org 
[lkml]   [2022]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 09/26] x86/tdx: Detect TDX at early kernel decompression time
On Tue, Dec 14, 2021 at 06:02:47PM +0300, Kirill A. Shutemov wrote:
> @@ -370,6 +370,14 @@ asmlinkage __visible void *extract_kernel(void *rmode, memptr heap,
> lines = boot_params->screen_info.orig_video_lines;
> cols = boot_params->screen_info.orig_video_cols;
>
> + /*
> + * Detect if we are running in TDX guest environment.

Please use passive voice: no "we" or "I", etc,

> + *
> + * It has to be done before console_init() to use paravirtualized
^
in order

...

> +void early_tdx_detect(void)
> +{
> + u32 eax, sig[3];
> +
> + if (cpuid_max_leaf() < TDX_CPUID_LEAF_ID)

What's the use of that helper?

AFAICT, none because you call cpuid_count below anyway. And you use that
helper only here.

IOW, you can simply use cpuid_count() and not add it.

> + return;
> +
> + cpuid_count(TDX_CPUID_LEAF_ID, 0, &eax, &sig[0], &sig[2], &sig[1]);
> +
> + if (memcmp(TDX_IDENT, sig, 12))
> + return;
> +
> + /* Cache TDX guest feature status */
> + tdx_guest_detected = true;
> +}

...

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette

\
 
 \ /
  Last update: 2022-01-07 17:28    [W:0.576 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site