lkml.org 
[lkml]   [2022]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v5 1/22] x86/virt/tdx: Detect TDX during kernel boot
From

On 2022/6/22 19:15, Kai Huang wrote:
> + /*
> + * TDX guarantees at least two TDX KeyIDs are configured by
> + * BIOS, otherwise SEAMRR is disabled. Invalid TDX private
> + * range means kernel bug (TDX is broken).
> + */
> + if (WARN_ON(!tdx_keyid_start || tdx_keyid_num < 2)) {
Do you think it's better to define a meaningful macro instead of the
number here and below?
> + tdx_keyid_start = tdx_keyid_num = 0;
> + return -EINVAL;
> + }
> +
> + return 0;
> +}
> +

> +
> +/**
> + * platform_tdx_enabled() - Return whether BIOS has enabled TDX
> + *
> + * Return whether BIOS has enabled TDX regardless whether the TDX module
> + * has been loaded or not.
> + */
> +bool platform_tdx_enabled(void)
> +{
> + return tdx_keyid_num >= 2;
> +}
>
>

\
 
 \ /
  Last update: 2022-08-02 04:02    [W:1.355 / U:1.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site