From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8FD6C4332F for ; Tue, 18 Oct 2022 13:27:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230480AbiJRN1E (ORCPT ); Tue, 18 Oct 2022 09:27:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231131AbiJRN0k (ORCPT ); Tue, 18 Oct 2022 09:26:40 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5FCF55A157 for ; Tue, 18 Oct 2022 06:26:15 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4B135113E; Tue, 18 Oct 2022 06:26:20 -0700 (PDT) Received: from lakrids (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3685F3F792; Tue, 18 Oct 2022 06:26:13 -0700 (PDT) Date: Tue, 18 Oct 2022 14:26:07 +0100 From: Mark Rutland To: Peter Zijlstra Cc: Steven Rostedt , x86@kernel.org, linux-kernel@vger.kernel.org, Kees Cook , Sami Tolvanen Subject: Re: [PATCH] ftrace,kcfi: Separate ftrace_stub() and ftrace_stub_graph() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 18, 2022 at 03:18:46PM +0200, Peter Zijlstra wrote: > On Tue, Oct 18, 2022 at 02:35:16PM +0200, Peter Zijlstra wrote: > > --- a/include/asm-generic/vmlinux.lds.h > > +++ b/include/asm-generic/vmlinux.lds.h > > @@ -162,6 +162,16 @@ > > #define PATCHABLE_DISCARDS *(__patchable_function_entries) > > #endif > > > > +#ifndef ARCH_SUPPORTS_CFI_CLANG > > #ifndef CONFIG_ARCH_.. > > works much better as we found. > > > +/* > > + * Simply points to ftrace_stub, but with the proper protocol. > > + * Defined by the linker script in linux/vmlinux.lds.h > > + */ > > +#define FTRACE_STUB_HACK ftrace_stub_graph = ftrace_stub; > > +#else > > +#define FTRACE_STUB_HACK > > +#endif > > Fixed up version available at: > > git://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git x86/urgent Thanks for this! I've just tested that branch, (HEAD commit 586edc9c16e747ce). With kCFI enabled I can run the ftrace boot tests and ftrace selftests without issues. FWIW: Reviewed-by: Mark Rutland Tested-by: Mark Rutland Mark.