[tip: x86/mm] x86/cpu: Export native_write_cr4() only when CONFIG_LKTDM=m

From: tip-bot2 for Thomas Gleixner
Date: Sun Apr 26 2020 - 14:42:54 EST


The following commit has been merged into the x86/mm branch of tip:

Commit-ID: 21953ee5013d6632bee90ec89f2df59c69050db0
Gitweb: https://git.kernel.org/tip/21953ee5013d6632bee90ec89f2df59c69050db0
Author: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
AuthorDate: Sun, 26 Apr 2020 18:55:15 +02:00
Committer: Borislav Petkov <bp@xxxxxxx>
CommitterDate: Sun, 26 Apr 2020 20:16:46 +02:00

x86/cpu: Export native_write_cr4() only when CONFIG_LKTDM=m

Modules have no business poking into this but fixing this is for later.

[ bp: Carve out from an earlier patch. ]

Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Signed-off-by: Borislav Petkov <bp@xxxxxxx>
Link: https://lkml.kernel.org/r/20200421092558.939985695@xxxxxxxxxxxxx
---
arch/x86/kernel/cpu/common.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 82042f4..eab3ebd 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -387,7 +387,9 @@ set_register:
bits_missing);
}
}
+#if IS_MODULE(CONFIG_LKDTM)
EXPORT_SYMBOL_GPL(native_write_cr4);
+#endif

void cr4_update_irqsoff(unsigned long set, unsigned long clear)
{