Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp102176imj; Wed, 13 Feb 2019 05:26:27 -0800 (PST) X-Google-Smtp-Source: AHgI3IbyBdLIZIQTLSrVGQpiGNUxDdDSKJt+3VBnaoSruKvHiLnfScjyEyJxw348oJuhqkgUObbY X-Received: by 2002:a65:484c:: with SMTP id i12mr448435pgs.309.1550064387500; Wed, 13 Feb 2019 05:26:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550064387; cv=none; d=google.com; s=arc-20160816; b=yck4cnMc+WIXT86sdsblqHGQxmD6LEzd+No5A18SYzL7wW3lSyrtLTy/QKus1mVllv DSh1DjF0+Cc79Z9Jn7NshrcdRuRB2+EAdtU4uO5LgATiHZ4HGVUQAw4myEiJezQFuJyw eqIRpXg9P6vKVWmjwg9kEOdo9wxoB6QUiMULSslaeX0NgPI25Q4MCkZip1+TGCYayJqq qhCf29CfdAy7ii3nCoHwt9WenrxnbNO4+ceZpXLM0gpWLbTML1bMz6g0w3FPOiz2jekM 4ULA2NbDU9YFccZtZsat+s7kryLd+dYpP6yJx3HeLDTtoExBhLcLe1/JRv8ftWx2XHJR uWqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date; bh=9LrJzkP7pTvNNGDjDenm8pIs/XDrhggKSvmerhbS4e4=; b=SSLg75iPdRq5FeGeqNm+05KW9vVrdoc1tMuoKsSN63Rt+7QiRbOsk+6bC3isw6PcXp tB16ykYchZ+YsrEwWdrbtRZi/GqB8+h/aQd0NcD0rusrH8jia9BnA02w7wS9kGkg1efj N0chIsTrbFiI7x42gXykFOTgNReK6NHjw4BRA1QxrNIyDpLv1Nh4hJjmLI5SCmAfjYzz TQIIyYh2cpIKY90IaPuB+Xozq3R4U6EdSbNMGqJpD4uaJe3ceaCVmVyhMgAuKziJ3Gkx 9PmmXf1Cs14RqepzHSlJx+MDm1vNlxa6TuoDUBQDk9wkH8ZnvZrw4Zeycv3N+Nl55KAG X2rw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n15si7294658pgh.477.2019.02.13.05.26.11; Wed, 13 Feb 2019 05:26:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389889AbfBMJBL (ORCPT + 99 others); Wed, 13 Feb 2019 04:01:11 -0500 Received: from terminus.zytor.com ([198.137.202.136]:48977 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727206AbfBMJBL (ORCPT ); Wed, 13 Feb 2019 04:01:11 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x1D8xWw1195711 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 13 Feb 2019 00:59:32 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x1D8xVZi195708; Wed, 13 Feb 2019 00:59:31 -0800 Date: Wed, 13 Feb 2019 00:59:31 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Masami Hiramatsu Message-ID: Cc: hpa@zytor.com, mingo@kernel.org, alexander.shishkin@linux.intel.com, jolsa@redhat.com, mhiramat@kernel.org, mathieu.desnoyers@efficios.com, rostedt@goodmis.org, peterz@infradead.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, acme@redhat.com, torvalds@linux-foundation.org, righi.andrea@gmail.com Reply-To: mathieu.desnoyers@efficios.com, rostedt@goodmis.org, jolsa@redhat.com, mhiramat@kernel.org, alexander.shishkin@linux.intel.com, mingo@kernel.org, hpa@zytor.com, righi.andrea@gmail.com, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, acme@redhat.com, tglx@linutronix.de, peterz@infradead.org In-Reply-To: <154998790744.31052.3016106262944915510.stgit@devbox> References: <154998790744.31052.3016106262944915510.stgit@devbox> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] x86/kprobes: Move trampoline code into RODATA Git-Commit-ID: 877b145f0f4723133f934be402b8dfc769eb971f X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED,BAYES_00, FREEMAIL_FORGED_REPLYTO,T_DATE_IN_FUTURE_96_Q autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 877b145f0f4723133f934be402b8dfc769eb971f Gitweb: https://git.kernel.org/tip/877b145f0f4723133f934be402b8dfc769eb971f Author: Masami Hiramatsu AuthorDate: Wed, 13 Feb 2019 01:11:47 +0900 Committer: Ingo Molnar CommitDate: Wed, 13 Feb 2019 08:16:39 +0100 x86/kprobes: Move trampoline code into RODATA Move optprobe trampoline code into RODATA since it is not executed, but copied and modified to be used on a trampoline buffer. Signed-off-by: Masami Hiramatsu Cc: Alexander Shishkin Cc: Andrea Righi Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Linus Torvalds Cc: Mathieu Desnoyers Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/154998790744.31052.3016106262944915510.stgit@devbox Signed-off-by: Ingo Molnar --- arch/x86/kernel/kprobes/opt.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/arch/x86/kernel/kprobes/opt.c b/arch/x86/kernel/kprobes/opt.c index 544bd41a514c..f14262952015 100644 --- a/arch/x86/kernel/kprobes/opt.c +++ b/arch/x86/kernel/kprobes/opt.c @@ -97,6 +97,7 @@ static void synthesize_set_arg1(kprobe_opcode_t *addr, unsigned long val) } asm ( + ".pushsection .rodata\n" "optprobe_template_func:\n" ".global optprobe_template_entry\n" "optprobe_template_entry:\n" @@ -136,16 +137,10 @@ asm ( #endif ".global optprobe_template_end\n" "optprobe_template_end:\n" - ".type optprobe_template_func, @function\n" - ".size optprobe_template_func, .-optprobe_template_func\n"); + ".popsection\n"); void optprobe_template_func(void); STACK_FRAME_NON_STANDARD(optprobe_template_func); -NOKPROBE_SYMBOL(optprobe_template_func); -NOKPROBE_SYMBOL(optprobe_template_entry); -NOKPROBE_SYMBOL(optprobe_template_val); -NOKPROBE_SYMBOL(optprobe_template_call); -NOKPROBE_SYMBOL(optprobe_template_end); #define TMPL_MOVE_IDX \ ((long)optprobe_template_val - (long)optprobe_template_entry)