From: duwe@lst.de (Torsten Duwe) To: Mark Rutland <mark.rutland@arm.com>, Will Deacon <will.deacon@arm.com>, Catalin Marinas <catalin.marinas@arm.com>, Julien Thierry <julien.thierry@arm.com>, Steven Rostedt <rostedt@goodmis.org>, Josh Poimboeuf <jpoimboe@redhat.com>, Ingo Molnar <mingo@redhat.com>, Ard Biesheuvel <ard.biesheuvel@linaro.org>, Arnd Bergmann <arnd@arndb.de>, AKASHI Takahiro <takahiro.akashi@linaro.org>, Amit Daniel Kachhap <amit.kachhap@arm.com> Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org Subject: [PATCH v7 3/3] arm64: use -fpatchable-function-entry if available Date: Fri, 18 Jan 2019 17:39:13 +0100 (CET) [thread overview] Message-ID: <20190118163913.0414868DCF@newverein.lst.de> (raw) In-Reply-To: <20190118163736.6A99268CEB@newverein.lst.de> Test whether gcc supports -fpatchable-function-entry and use it to promote DYNAMIC_FTRACE to DYNAMIC_FTRACE_WITH_REGS. Amend support for the new object section that holds the locations (__patchable_function_entries) and define a proper "notrace" attribute to switch it off. Signed-off-by: Torsten Duwe <duwe@suse.de> --- arch/arm64/Kconfig | 2 ++ arch/arm64/Makefile | 5 +++++ include/asm-generic/vmlinux.lds.h | 1 + include/linux/compiler_types.h | 2 ++ 4 files changed, 10 insertions(+) --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -132,6 +132,8 @@ config ARM64 select HAVE_DEBUG_KMEMLEAK select HAVE_DMA_CONTIGUOUS select HAVE_DYNAMIC_FTRACE + select HAVE_DYNAMIC_FTRACE_WITH_REGS \ + if $(cc-option,-fpatchable-function-entry=2) select HAVE_EFFICIENT_UNALIGNED_ACCESS select HAVE_FTRACE_MCOUNT_RECORD select HAVE_FUNCTION_TRACER --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -89,6 +89,11 @@ ifeq ($(CONFIG_ARM64_MODULE_PLTS),y) KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/arm64/kernel/module.lds endif +ifeq ($(CONFIG_DYNAMIC_FTRACE_WITH_REGS),y) + KBUILD_CPPFLAGS += -DCC_USING_PATCHABLE_FENTRY + CC_FLAGS_FTRACE := -fpatchable-function-entry=2 +endif + # Default value head-y := arch/arm64/kernel/head.o --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -113,6 +113,7 @@ #define MCOUNT_REC() . = ALIGN(8); \ __start_mcount_loc = .; \ KEEP(*(__mcount_loc)) \ + KEEP(*(__patchable_function_entries)) \ __stop_mcount_loc = .; #else #define MCOUNT_REC() --- a/include/linux/compiler_types.h +++ b/include/linux/compiler_types.h @@ -112,6 +112,8 @@ struct ftrace_likely_data { #if defined(CC_USING_HOTPATCH) #define notrace __attribute__((hotpatch(0, 0))) +#elif defined(CC_USING_PATCHABLE_FENTRY) +#define notrace __attribute__((patchable_function_entry(0))) #else #define notrace __attribute__((__no_instrument_function__)) #endif
WARNING: multiple messages have this Message-ID (diff)
From: duwe@lst.de (Torsten Duwe) To: Mark Rutland <mark.rutland@arm.com>, Will Deacon <will.deacon@arm.com>, Catalin Marinas <catalin.marinas@arm.com>, Julien Thierry <julien.thierry@arm.com>, Steven Rostedt <rostedt@goodmis.org>, Josh Poimboeuf <jpoimboe@redhat.com>, Ingo Molnar <mingo@redhat.com>, Ard Biesheuvel <ard.biesheuvel@linaro.org>, Arnd Bergmann <arnd@arndb.de>, AKASHI Takahiro <takahiro.akashi@linaro.org>, Amit Daniel Kachhap <amit.kachhap@arm.com> Cc: live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v7 3/3] arm64: use -fpatchable-function-entry if available Date: Fri, 18 Jan 2019 17:39:13 +0100 (CET) [thread overview] Message-ID: <20190118163913.0414868DCF@newverein.lst.de> (raw) In-Reply-To: <20190118163736.6A99268CEB@newverein.lst.de> Test whether gcc supports -fpatchable-function-entry and use it to promote DYNAMIC_FTRACE to DYNAMIC_FTRACE_WITH_REGS. Amend support for the new object section that holds the locations (__patchable_function_entries) and define a proper "notrace" attribute to switch it off. Signed-off-by: Torsten Duwe <duwe@suse.de> --- arch/arm64/Kconfig | 2 ++ arch/arm64/Makefile | 5 +++++ include/asm-generic/vmlinux.lds.h | 1 + include/linux/compiler_types.h | 2 ++ 4 files changed, 10 insertions(+) --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -132,6 +132,8 @@ config ARM64 select HAVE_DEBUG_KMEMLEAK select HAVE_DMA_CONTIGUOUS select HAVE_DYNAMIC_FTRACE + select HAVE_DYNAMIC_FTRACE_WITH_REGS \ + if $(cc-option,-fpatchable-function-entry=2) select HAVE_EFFICIENT_UNALIGNED_ACCESS select HAVE_FTRACE_MCOUNT_RECORD select HAVE_FUNCTION_TRACER --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -89,6 +89,11 @@ ifeq ($(CONFIG_ARM64_MODULE_PLTS),y) KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/arm64/kernel/module.lds endif +ifeq ($(CONFIG_DYNAMIC_FTRACE_WITH_REGS),y) + KBUILD_CPPFLAGS += -DCC_USING_PATCHABLE_FENTRY + CC_FLAGS_FTRACE := -fpatchable-function-entry=2 +endif + # Default value head-y := arch/arm64/kernel/head.o --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -113,6 +113,7 @@ #define MCOUNT_REC() . = ALIGN(8); \ __start_mcount_loc = .; \ KEEP(*(__mcount_loc)) \ + KEEP(*(__patchable_function_entries)) \ __stop_mcount_loc = .; #else #define MCOUNT_REC() --- a/include/linux/compiler_types.h +++ b/include/linux/compiler_types.h @@ -112,6 +112,8 @@ struct ftrace_likely_data { #if defined(CC_USING_HOTPATCH) #define notrace __attribute__((hotpatch(0, 0))) +#elif defined(CC_USING_PATCHABLE_FENTRY) +#define notrace __attribute__((patchable_function_entry(0))) #else #define notrace __attribute__((__no_instrument_function__)) #endif _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-01-18 16:39 UTC|newest] Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-01-18 16:37 [PATCH v7 0/3] arm64: ftrace with regs Torsten Duwe 2019-01-18 16:37 ` Torsten Duwe 2019-01-18 16:39 ` [PATCH v7 1/3] arm64: replace -pg with CC_FLAGS_FTRACE in Makefiles Torsten Duwe 2019-01-18 16:39 ` Torsten Duwe 2019-01-18 17:24 ` Mark Rutland 2019-01-18 17:24 ` Mark Rutland 2019-01-18 16:39 ` [PATCH v7 2/3] arm64: implement ftrace with regs Torsten Duwe 2019-01-18 16:39 ` Torsten Duwe 2019-01-22 1:39 ` Singh, Balbir 2019-01-22 1:39 ` Singh, Balbir 2019-01-22 13:09 ` Torsten Duwe 2019-01-22 13:09 ` Torsten Duwe 2019-01-23 20:38 ` Singh, Balbir 2019-01-23 20:38 ` Singh, Balbir 2019-01-22 10:18 ` Julien Thierry 2019-01-22 10:18 ` Julien Thierry 2019-01-22 13:28 ` Torsten Duwe 2019-01-22 13:28 ` Torsten Duwe 2019-01-22 13:49 ` Julien Thierry 2019-01-22 13:49 ` Julien Thierry 2019-01-22 13:55 ` Ard Biesheuvel 2019-01-22 13:55 ` Ard Biesheuvel 2019-02-04 12:03 ` Torsten Duwe 2019-02-04 12:03 ` Torsten Duwe 2019-02-04 13:43 ` Ard Biesheuvel 2019-02-04 13:43 ` Ard Biesheuvel 2019-02-06 8:59 ` Julien Thierry 2019-02-06 8:59 ` Julien Thierry 2019-02-06 9:30 ` Julien Thierry 2019-02-06 9:30 ` Julien Thierry 2019-02-06 14:09 ` Steven Rostedt 2019-02-06 14:09 ` Steven Rostedt 2019-02-06 15:05 ` Torsten Duwe 2019-02-06 15:05 ` Torsten Duwe 2019-02-07 10:33 ` Julien Thierry 2019-02-07 10:33 ` Julien Thierry 2019-02-07 12:51 ` Torsten Duwe 2019-02-07 12:51 ` Torsten Duwe 2019-02-07 13:47 ` Julien Thierry 2019-02-07 13:47 ` Julien Thierry 2019-02-07 14:51 ` Steven Rostedt 2019-02-07 14:51 ` Steven Rostedt 2019-02-07 14:58 ` Julien Thierry 2019-02-07 14:58 ` Julien Thierry 2019-02-07 15:00 ` Torsten Duwe 2019-02-07 15:00 ` Torsten Duwe 2019-04-03 2:48 ` Mark Rutland 2019-04-03 2:48 ` Mark Rutland 2019-04-03 12:30 ` Steven Rostedt 2019-04-03 12:30 ` Steven Rostedt 2019-04-03 13:05 ` Torsten Duwe 2019-04-03 13:05 ` Torsten Duwe 2019-01-18 16:39 ` Torsten Duwe [this message] 2019-01-18 16:39 ` [PATCH v7 3/3] arm64: use -fpatchable-function-entry if available Torsten Duwe
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190118163913.0414868DCF@newverein.lst.de \ --to=duwe@lst.de \ --cc=amit.kachhap@arm.com \ --cc=ard.biesheuvel@linaro.org \ --cc=arnd@arndb.de \ --cc=catalin.marinas@arm.com \ --cc=jpoimboe@redhat.com \ --cc=julien.thierry@arm.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=live-patching@vger.kernel.org \ --cc=mark.rutland@arm.com \ --cc=mingo@redhat.com \ --cc=rostedt@goodmis.org \ --cc=takahiro.akashi@linaro.org \ --cc=will.deacon@arm.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.