Re: [RFC v2 28/32] x86/tdx: Make pages shared in ioremap()

From: Kuppuswamy, Sathyanarayanan
Date: Tue Jun 01 2021 - 17:16:40 EST


Hi,

On 5/31/21 12:14 PM, Borislav Petkov wrote:
We can also use protected_guest_has(VM_VIRTIO_SECURE_FIX) or something
similar for this purpose. Andi, any comments?
protected_guest_has() is enough for that - no need for two functions.

IMHO, its better to use above generic config option in common header
file (linux/protected_guest.h). Any architecture that implements
protected guest feature can enable it. This will help is hide arch
specific config options in arch specific header file.
You define empty function stubs for when the arch config option is not
enabled. Everything else is unnecessary. When another architecture needs
this, then another architecture will generalize it like it is usually
done.

Please check the updated version in email titled "[RFC v2-fix-v2 1/1] x86:
Introduce generic protected guest abstraction".

We can continue the rest of the discussion in that email.

--
Sathyanarayanan Kuppuswamy
Linux Kernel Developer