Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp709076imu; Thu, 22 Nov 2018 04:16:33 -0800 (PST) X-Google-Smtp-Source: AFSGD/W59DDU6eJ+65k/hajz/uabJ1swZn5I1MwEr0XdHWByot0dLL4QnHSDm84BVEha3xbanc8o X-Received: by 2002:a17:902:d806:: with SMTP id a6mr10646713plz.172.1542888993336; Thu, 22 Nov 2018 04:16:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542888993; cv=none; d=google.com; s=arc-20160816; b=0guQCJIzEQypFhRHscETM7sIzOIk36/Y4YAorCcfEhlG0JVZGffAANmQ1s5E7JKbUh hchQBhk6EPk660Zg+lgC57g4+H7cHnbCP1NHllVmd1/yH/xzfl1iI6xen8IOj3qEDwbF 9FFz02lrQjTpJYFODjRMOZldgOr+6A6IAXF1FH4gTFsv21VUt2zTUoEh3t80YKWanNET 1wdRRFECCP4mp2k9nqHtiTMliqka0MksYGBMw76hslthdcryVRoq4s7OBYwFV71pe9P4 co8iDSDxelpA5NYOsp5ousOaxRigfr9vJiGwAR0RPnbtHzQterExtVqpQYl5+DcDK3cv zp4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:subject:cc:to :from:date:user-agent:message-id; bh=Fc2g6cRTiBHoXOzweMIXMQDM58qPsAEdidImQAnoDnY=; b=l1TQw+RD1BqD7zl6L7g25+TfXJPlehFgP9wjmnUxUCRqFEbPqwDGZdfZh7p3PY2s3U 9Je0aQkwaOWjlJpf/wn8tjtuMyW+7x5iLR8XCIQSOoFceoDlJC61W5Kx5uIKZzlXeK7o z83t54H9R+6fmSwKebLKHLDN4Uo8g3ataQ2FHsucs/Zh2OreqOF9TqTJviftZVaYNuSx o+9+Js9Stz+FxXLLCzgq10mpDZew8MKKKJ7VUTuZtvrrsD2Jq5Q1XHMvxU91DDHRW824 Wt3733OD/6vGpBUzQevtJEhEq8zU/mUsG/LJp011t8E8oogwQ4VqzI9y+/v7c1kVsthF cn0w== 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 z8si3085836pgk.183.2018.11.22.04.16.17; Thu, 22 Nov 2018 04:16:33 -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 S2391084AbeKVLLu (ORCPT + 99 others); Thu, 22 Nov 2018 06:11:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:47650 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390878AbeKVLKT (ORCPT ); Thu, 22 Nov 2018 06:10:19 -0500 Received: from gandalf.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EB7CB208A3; Thu, 22 Nov 2018 00:33:33 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.91) (envelope-from ) id 1gPcw1-0004Ut-1R; Wed, 21 Nov 2018 19:33:33 -0500 Message-Id: <20181122003332.940703297@goodmis.org> User-Agent: quilt/0.65 Date: Wed, 21 Nov 2018 19:28:12 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Ingo Molnar , Andrew Morton , Thomas Gleixner , Peter Zijlstra , linux-arch@vger.kernel.org, Joel Fernandes , Masami Hiramatsu , Josh Poimboeuf , Andy Lutomirski , Frederic Weisbecker , Martin Schwidefsky , Heiko Carstens , Julian Wiedmann , linux-s390@vger.kernel.org, stable@kernel.org Subject: [for-next][PATCH 11/18] s390/function_graph: Simplify with function_graph_entry() References: <20181122002801.501220343@goodmis.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Steven Rostedt (VMware)" The function_graph_entry() function does the work of calling the function graph hook function and the management of the shadow stack, simplifying the work done in the architecture dependent prepare_ftrace_return(). Have s390 use the new code, and remove the shadow stack management as well as having to set up the trace structure. This is needed to prepare for a fix of a design bug on how the curr_ret_stack is used. Cc: Martin Schwidefsky Cc: Heiko Carstens Cc: Julian Wiedmann Cc: linux-s390@vger.kernel.org Cc: stable@kernel.org Fixes: 03274a3ffb449 ("tracing/fgraph: Adjust fgraph depth before calling trace return callback") Signed-off-by: Steven Rostedt (VMware) --- arch/s390/kernel/ftrace.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/arch/s390/kernel/ftrace.c b/arch/s390/kernel/ftrace.c index 84be7f02d0c2..39b13d71a8fe 100644 --- a/arch/s390/kernel/ftrace.c +++ b/arch/s390/kernel/ftrace.c @@ -203,22 +203,13 @@ device_initcall(ftrace_plt_init); */ unsigned long prepare_ftrace_return(unsigned long parent, unsigned long ip) { - struct ftrace_graph_ent trace; - if (unlikely(ftrace_graph_is_dead())) goto out; if (unlikely(atomic_read(¤t->tracing_graph_pause))) goto out; ip -= MCOUNT_INSN_SIZE; - trace.func = ip; - trace.depth = current->curr_ret_stack + 1; - /* Only trace if the calling function expects to. */ - if (!ftrace_graph_entry(&trace)) - goto out; - if (ftrace_push_return_trace(parent, ip, &trace.depth, 0, - NULL) == -EBUSY) - goto out; - parent = (unsigned long) return_to_handler; + if (!function_graph_enter(parent, ip, 0, NULL)) + parent = (unsigned long) return_to_handler; out: return parent; } -- 2.19.1