[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87fsp2z8p8.ffs@tglx>
Date: Tue, 01 Feb 2022 20:29:55 +0100
From: Thomas Gleixner <tglx@...utronix.de>
To: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
mingo@...hat.com, bp@...en8.de, dave.hansen@...el.com,
luto@...nel.org, peterz@...radead.org
Cc: sathyanarayanan.kuppuswamy@...ux.intel.com, aarcange@...hat.com,
ak@...ux.intel.com, dan.j.williams@...el.com, david@...hat.com,
hpa@...or.com, jgross@...e.com, jmattson@...gle.com,
joro@...tes.org, jpoimboe@...hat.com, knsathya@...nel.org,
pbonzini@...hat.com, sdeep@...are.com, seanjc@...gle.com,
tony.luck@...el.com, vkuznets@...hat.com, wanpengli@...cent.com,
x86@...nel.org, linux-kernel@...r.kernel.org,
"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>
Subject: Re: [PATCHv2 01/29] x86/tdx: Detect running as a TDX guest in early
boot
Kirill,
On Mon, Jan 24 2022 at 18:01, Kirill A. Shutemov wrote:
Just a nitpick...
> +static bool tdx_guest_detected __ro_after_init;
> +
> +bool is_tdx_guest(void)
> +{
> + return tdx_guest_detected;
> +}
> +
> +void __init tdx_early_init(void)
> +{
> + u32 eax, sig[3];
> +
> + cpuid_count(TDX_CPUID_LEAF_ID, 0, &eax, &sig[0], &sig[2], &sig[1]);
> +
> + if (memcmp(TDX_IDENT, sig, 12))
> + return;
> +
> + tdx_guest_detected = true;
> +
> + setup_force_cpu_cap(X86_FEATURE_TDX_GUEST);
So with that we have two ways to detect a TDX guest:
- tdx_guest_detected
- X86_FEATURE_TDX_GUEST
Shouldn't X86_FEATURE_TDX_GUEST be good enough?
Thanks,
tglx
Powered by blists - more mailing lists