Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8127767imu; Tue, 4 Dec 2018 03:29:26 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wy3u40Tl9ISkigULdkADhj36jevJz0Jd12OZv7TIUh33oTsK0I7W5ZqIuQ5ZNM2Fx5bMMA X-Received: by 2002:a17:902:5601:: with SMTP id h1mr20148994pli.160.1543922966520; Tue, 04 Dec 2018 03:29:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543922966; cv=none; d=google.com; s=arc-20160816; b=TY/RNpVkxbvAB+lxeQRB2irtErFIbLh763d+nAkZrqFEecPZkLjcjH3z8lKjxwpo/e GdykH5ubxUMIScbTSo9QqLjxskZSWY8/bngozOgdcy68scIbJXdlUNE19oPuPcjB3e81 6xLlTluGFiodiNET2vFiPzy0p+ZC6bhyfyZuyJDwNChd99exOmBsNLHJyO47ew8ZEesl CHF7IcXoAaRKTChBzzUMBQvfsXmoClHLPAG8KTO8hr512RvqY7iga9rl6iNwM86Pa4Ao wcc0rI3yVglCEMN4b16vv4CHd5tpScPV0CUnC4nJcnlKOeYHlUR70hQPW/gBP7FAULH7 LeEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=O0gBKitBl0AC4nqJManLGGRLbDCoqdPQQw/mSM/l4rY=; b=xTuSRM+cTPEAS92Maws5fuRbYQAqBhfm/MQ7uMzoRgxImbtwHZY81jxm7PNJLfAeSl lBPS8lggDJ5SL4dO2pS+Pyp0LE0/pk5ypFIgjeFAvxE0qJyvnbbhWk+W9e/zU6RfsDyU enRds7cNd0wXCIwcLJdT7Bubmirt1pwCjzpGQ4T1zr/5ukuLWAotEj+Ux/SCI0Ncz5Dl 4fDImiAoVokswFgXRA5jFKjs1Oun1C15oRK1akjAJmTQLIYkH/QaPHCr0NaGDeSH0ML4 /t5jxLIAqD1vU5MXJXZQDSGcROwf1wxNeE/YTeBCZW6GjiEPbQUok2tWB/9UZbZF1WeM 2BGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eAmTktTz; 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 i62si15562859pgd.556.2018.12.04.03.29.11; Tue, 04 Dec 2018 03:29:26 -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; dkim=pass header.i=@kernel.org header.s=default header.b=eAmTktTz; 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 S1727089AbeLDK7O (ORCPT + 99 others); Tue, 4 Dec 2018 05:59:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:43840 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727087AbeLDK7L (ORCPT ); Tue, 4 Dec 2018 05:59:11 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 5BE9A2087F; Tue, 4 Dec 2018 10:59:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543921150; bh=H1TWguv+DMajJTFb9kOb9pphIz78VkeuJ0deYrJTy5k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eAmTktTzuWBnGf9aplv1yYKgJHiiMxJSzcZOqEqcaJDXJ1XcYDypiUNyUE874F1+j IcFxQx93k2wVCOTE7HyxmIVfDQkgpRn9g6RFBrY538kC3+ibUubsAyqc9E1SfXqBr7 CL+9g7DkLjE32cZG9vLWdzE4cF+fiXhAUVvH7BuY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michal Simek , stable@kernel.org, Masami Hiramatsu , "Steven Rostedt (VMware)" Subject: [PATCH 4.19 100/139] microblaze: function_graph: Simplify with function_graph_enter() Date: Tue, 4 Dec 2018 11:49:41 +0100 Message-Id: <20181204103654.587164492@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181204103649.950154335@linuxfoundation.org> References: <20181204103649.950154335@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Steven Rostedt (VMware) commit 556763e5a500d71879d632867b75826551acd49c upstream. The function_graph_enter() 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 microblaze 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: Michal Simek Cc: stable@kernel.org Fixes: 03274a3ffb449 ("tracing/fgraph: Adjust fgraph depth before calling trace return callback") Reviewed-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Greg Kroah-Hartman --- arch/microblaze/kernel/ftrace.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) --- a/arch/microblaze/kernel/ftrace.c +++ b/arch/microblaze/kernel/ftrace.c @@ -22,8 +22,7 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr) { unsigned long old; - int faulted, err; - struct ftrace_graph_ent trace; + int faulted; unsigned long return_hooker = (unsigned long) &return_to_handler; @@ -63,18 +62,8 @@ void prepare_ftrace_return(unsigned long return; } - err = ftrace_push_return_trace(old, self_addr, &trace.depth, 0, NULL); - if (err == -EBUSY) { + if (function_graph_enter(old, self_addr, 0, NULL)) *parent = old; - return; - } - - trace.func = self_addr; - /* Only trace if the calling function expects to */ - if (!ftrace_graph_entry(&trace)) { - current->curr_ret_stack--; - *parent = old; - } } #endif /* CONFIG_FUNCTION_GRAPH_TRACER */