From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Hansen Subject: Re: [RFC PATCH v9 04/27] x86/cet: Add control-protection fault handler Date: Wed, 26 Feb 2020 09:10:41 -0800 Message-ID: <0bc74a85-7058-0cca-62b8-949c8a881c62@intel.com> References: <20200205181935.3712-1-yu-cheng.yu@intel.com> <20200205181935.3712-5-yu-cheng.yu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: <20200205181935.3712-5-yu-cheng.yu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> Content-Language: en-US Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Yu-cheng Yu , x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, linux-arch-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Arnd Bergmann , Andy Lutomirski , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz List-Id: linux-arch.vger.kernel.org On 2/5/20 10:19 AM, Yu-cheng Yu wrote: > 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? From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Subject: Re: [RFC PATCH v9 04/27] x86/cet: Add control-protection fault handler References: <20200205181935.3712-1-yu-cheng.yu@intel.com> <20200205181935.3712-5-yu-cheng.yu@intel.com> From: Dave Hansen Message-ID: <0bc74a85-7058-0cca-62b8-949c8a881c62@intel.com> Date: Wed, 26 Feb 2020 09:10:41 -0800 MIME-Version: 1.0 In-Reply-To: <20200205181935.3712-5-yu-cheng.yu@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Sender: owner-linux-mm@kvack.org To: Yu-cheng Yu , x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Andy Lutomirski , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Dave Martin , x86-patch-review@intel.com List-ID: Message-ID: <20200226171041.6dbT7gJRlIATUvonZqQ4YGpr4nR5MgC7biJVqJg-OII@z> On 2/5/20 10:19 AM, Yu-cheng Yu wrote: > 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[= ] =3D { > #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, lik= e: #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?