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

From: Kuppuswamy, Sathyanarayanan
Date: Wed Jun 09 2021 - 10:01:19 EST




On 6/7/21 11:26 AM, Borislav Petkov wrote:
This header only exists in x86 arch code. So it is better to protect
it with x86 specific header file.
That doesn't sound like a special reason to me. And compilers are
usually very able at discarding unused symbols so I don't see a problem
with keeping all includes at the top, like it is usually done.

I am still not clear. What happens when a driver which includes
linux/protected-guest.h is compiled for non-x86 arch (s390 or arm64)?

Since asm/sev.h and asm/tdx.h exists only in x86_64 arch, IMO, it
should be placed under CONFIG_INTEL_TDX_GUEST or CONFIG_AMD_MEM_ENCRYPT

did I miss anything?

--
Sathyanarayanan Kuppuswamy
Linux Kernel Developer