Re: [RFC v2-fix-v2 1/1] x86: Introduce generic protected guest abstractionn
From: Borislav Petkov
Date: Mon Jun 07 2021 - 16:14:39 EST
On Mon, Jun 07, 2021 at 10:55:44PM +0300, Kirill A. Shutemov wrote:
> I think conversions like this are wrong: relocate_kernel(), which got
> called here, only knows how to deal with SME, not how to handle some
> generic case.
What do you mean wrong? Wrong for TDX?
If so, then that can be
protected_guest_has(SME)
or so, which would be false on Intel.
And this patch was only a mechanical conversion to see how it would look
like.
> If code is written to handle a specific technology we need to stick
> with a check that makes it clear. Trying to make sound generic only
> leads to confusion.
Sure, fine by me.
And I don't want a zoo of gazillion small checking functions per
technology. sev_<something>, tdx_<something>, yadda yadda.
So stuff better be unified. Even if you'd have vendor-specific defines
you hand into that function - and you will have such - it is still much
saner than what it turns into with the AMD side of things.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette