[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <874k9k8v62.ffs@tglx>
Date: Wed, 13 Oct 2021 23:35:49 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Sathyanarayanan Kuppuswamy
<sathyanarayanan.kuppuwamy@...ux.intel.com>,
Kuppuswamy Sathyanarayanan
<sathyanarayanan.kuppuswamy@...ux.intel.com>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
x86@...nel.org, Paolo Bonzini <pbonzini@...hat.com>,
David Hildenbrand <david@...hat.com>,
Andrea Arcangeli <aarcange@...hat.com>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Juergen Gross <jgross@...e.com>, Deep Shah <sdeep@...are.com>,
VMware Inc <pv-drivers@...are.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>
Cc: Peter H Anvin <hpa@...or.com>, Dave Hansen <dave.hansen@...el.com>,
Tony Luck <tony.luck@...el.com>,
Dan Williams <dan.j.williams@...el.com>,
Andi Kleen <ak@...ux.intel.com>,
Kirill Shutemov <kirill.shutemov@...ux.intel.com>,
Sean Christopherson <seanjc@...gle.com>,
Kuppuswamy Sathyanarayanan <knsathya@...nel.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v10 03/11] x86/cpufeatures: Add TDX Guest CPU feature
Sathyanarayanan,
On Wed, Oct 13 2021 at 14:05, Sathyanarayanan Kuppuswamy wrote:
> On 10/13/21 1:44 PM, Thomas Gleixner wrote:
>> tdx_early_init() is invoked from x86_64_start_kernel() very early in the
>> boot process __before__ is_tdx_guest() is invoked.
>>
>> So why on earth is it requried to keep those conditionals and cpuid()
>> muck around after init?
>
> is_tdx_guest() is also used by cc_platform_has() API. Please check
> the following patch [1]. cc_platform_has() will be called much earlier
> than x86_64_start_kernel() (like __startup_64() [2]).
That's just fundamentally wrong as I pointed out to Borislav already.
AMD has done it the right way.
__startup_64()
sme_enable()
x86_64_start_kernel()
sme_early_init()
copy_bootdata()
...
It's not that hard and we are not going to make this fundamentally
different just because Intel.
Thanks,
tglx
Powered by blists - more mailing lists