Re: [RFC v2 10/32] x86/tdx: Wire up KVM hypercalls

From: Dave Hansen
Date: Thu May 13 2021 - 15:33:38 EST


On 5/13/21 12:29 PM, Kuppuswamy, Sathyanarayanan wrote:
>> If there isn't, then the way we do it is adding another (invisible)
>> Kconfig variable to express the dependency for tdx-kvm.o:
>>
>> config INTEL_TDX_GUEST_KVM
>>     bool
>>     depends on KVM_GUEST && INTEL_TDX_GUEST
>
> Currently it will only be used for KVM hypercall code. Will it to be
> overkill to create a new config over #ifdefs for this use case ? But,
> if this is the preferred approach, I will go with this suggestion.

You'll see this done lots of different (valid) ways over the kernel.
(#ifdef'd #including C files is not one of them.)

*My* preference is to use Kconfig in the way I described. It keeps
makefiles and #ifdef's clean and obvious, relegating the logic to Kconfig.