Re: [RFC v2-fix-v4 1/1] x86: Introduce generic protected guest abstraction

From: Sathyanarayanan Kuppuswamy Natarajan
Date: Wed Jun 09 2021 - 18:55:20 EST


Hi All,

On Wed, Jun 9, 2021 at 12:42 PM Kuppuswamy Sathyanarayanan
<sathyanarayanan.kuppuswamy@xxxxxxxxxxxxxxx> wrote:
>
> Add a generic way to check if we run with an encrypted guest,
> without requiring x86 specific ifdefs. This can then be used in
> non architecture specific code.
>
> prot_guest_has() is used to check for protected guest feature
> flags.
>
> Originally-by: Andi Kleen <ak@xxxxxxxxxxxxxxx>
> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@xxxxxxxxxxxxxxx>
> ---

I have sent a non RFC version of this patch for x86 review. Please use
it for further
discussion.

https://lore.kernel.org/patchwork/patch/1444184/

> Changes since RFC v2-fix-v3:
> * Introduced ARCH_HAS_PROTECTED_GUEST and moved arch specific checks to
> asm/protected_guest.h
>
> Changes since RFC v2-fix-v2:
> * Renamed protected_guest_has() to prot_guest_has().
> * Changed flag prefix from VM_ to PR_GUEST_
> * Merged Borislav AMD implementation fix.




--
Sathyanarayanan Kuppuswamy
Linux Kernel Developer