Re: [RFC v2 28/32] x86/tdx: Make pages shared in ioremap()
From: Borislav Petkov
Date: Mon May 31 2021 - 15:14:56 EST
On Mon, May 31, 2021 at 11:45:38AM -0700, Kuppuswamy, Sathyanarayanan 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.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette