Re: [patch 02/15] x86/cpu: Uninline CR4 accessors

From: Thomas Gleixner
Date: Mon Apr 20 2020 - 13:25:36 EST


Christoph Hellwig <hch@xxxxxxxxxxxxx> writes:
>> --- a/arch/x86/kernel/cpu/common.c
>> +++ b/arch/x86/kernel/cpu/common.c
>> @@ -387,7 +387,30 @@ void native_write_cr4(unsigned long val)
>> bits_missing);
>> }
>> }
>> -EXPORT_SYMBOL(native_write_cr4);
>> +#if IS_MODULE(CONFIG_LKDTM)
>> +EXPORT_SYMBOL_GPL(native_write_cr4);
>> +#endif
>
> While this is better than what we had before we really need to have
> a discussion on lkdtm - it needs a lot of crap that otherwise wouldn't
> be exported, and I'm really worried about people enabling it and thus
> adding exports even if they are conditional. Can we force the code
> to be built in require a boot option for it to be activated?

I can live with that :)