Thread (107 messages) 107 messages, 7 authors, 2020-04-08

Re: [RFC PATCH v9 04/27] x86/cet: Add control-protection fault handler

From: Yu-cheng Yu <hidden>
Date: 2020-03-05 20:44:23
Also in: linux-arch, linux-doc, linux-mm, lkml

On Wed, 2020-02-26 at 09:10 -0800, Dave Hansen wrote:
On 2/5/20 10:19 AM, Yu-cheng Yu wrote:
quoted
diff --git a/arch/x86/kernel/idt.c b/arch/x86/kernel/idt.c
index 87ef69a72c52..8ed406f469e7 100644
--- a/arch/x86/kernel/idt.c
+++ b/arch/x86/kernel/idt.c
@@ -102,6 +102,10 @@ static const __initconst struct idt_data def_idts[] = {
 #elif defined(CONFIG_X86_32)
 	SYSG(IA32_SYSCALL_VECTOR,	entry_INT80_32),
 #endif
+
+#ifdef CONFIG_X86_64
+	INTG(X86_TRAP_CP,		control_protection),
+#endif
 };
This patch in particular appears to have all of its code unconditionally
compiled in.  That's in contrast to things that have Kconfig options, like:

#ifdef CONFIG_X86_MCE
        INTG(X86_TRAP_MC,               &machine_check),
#endif

or:

#ifdef CONFIG_X86_THERMAL_VECTOR
        INTG(THERMAL_APIC_VECTOR,       thermal_interrupt),
#endif

Is there a reason this code is always compiled in on 64-bit even when
the config option is off?
I will change it to CONFIG_X86_INTEL_CET.

Yu-cheng
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help