Re: [PATCHv3.1 2.1/2] x86/coco: Add API to handle encryption mask
From: Borislav Petkov
Date: Mon Feb 21 2022 - 17:36:56 EST
On Tue, Feb 22, 2022 at 01:10:49AM +0300, Kirill A. Shutemov wrote:
> I'm not sure it is a good idea. It leaves room for code between these two
> calls. I believe they conceptually has to initialized in one shot. That's
> the only way we get consistent state.
Really, where?
My expectation would be that those things are set early enough during
boot, in your case in tdx_early_init(), for example, where stuff gets
initialized - not where it is used.
If you worry about having inconsistent state, then you're doing the init
not early enough.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette