Re: [RFC][PATCH 11/34] x86/cpu/intel: Prepare MKTME for "address configuration" infrastructure

From: Kirill A. Shutemov
Date: Fri Feb 23 2024 - 06:33:24 EST


On Thu, Feb 22, 2024 at 10:39:41AM -0800, Dave Hansen wrote:
>
> From: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
>
> Intel also does memory encryption and also fiddles with the physical
> address bits. This is currently called for *each* CPU, but practically
> only done on the boot CPU because of 'mktme_status'.
>
> Move it from the "each CPU" ->c_init() function to ->c_bsp_init() where
> the whole thing only gets called once ever. This also necessitates moving
> detect_tme() and its entourage around in the file.

The state machine around mktme_state doesn't make sense if we only call it
on boot CPU, so detect_tme() can be drastically simplified. I can do it on
top of the patchset.

--
Kiryl Shutsemau / Kirill A. Shutemov