Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8126642imu; Tue, 4 Dec 2018 03:28:02 -0800 (PST) X-Google-Smtp-Source: AFSGD/XXmQ6UXXQg+A3uhBHbqqo1yuBym0iohYiMdoUuuaA2bCOWwaD4IPBkZIU+ZU79XshPA35/ X-Received: by 2002:a62:3006:: with SMTP id w6mr19891143pfw.258.1543922882247; Tue, 04 Dec 2018 03:28:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543922882; cv=none; d=google.com; s=arc-20160816; b=pJk8pWbjG5bkVU+yqbbfvPT5tcFGL4EYH5vgP/cvvkTRv5iwCqyLNZNpoCAzHcZ8XN CLemjEsn2CDU4SUYTy8sn+wrjTn6pyNF3jlLghwCHM/8Hv63WrRRgy75ebo1pchLXTLr x3hEHxNiiuTGWhrbrjBsjKYQcW68TtWrwJ6ye8pMtcLG9J3m0FNhFUHj3OHRPuuMNO5e WR+GKVEPeTsdtCZg4jLD+lGy1xkCUcjMetAuF8n9vWzT2eDwSRfQ9L1i7b+U13n4q7Ck RKFZlcrCSLFAfczrePt6xQIe/3ezBNTuRGOdQjJHBBgz8jkQieXmZaLltaTVP7QGCaBf leMg== 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=r0SaxkPpEgRh25FomQIlQRScw7aconc+e9FvyXKfOjk=; b=jx3+ibXaZJtQSEDSyFxCn2mrNFIz+I0PwhP4aFCfVkCV9G/+mSswfC97AB16M/LfK4 df9NvcCpTNKxm1YSriPzwADvdOXtw0nE3eNT6z4hR68rN7XsnL7fzT3fZgADqw8T03Rn rpBdbvmHQjCL1C2tcitNHmoiLrgcq+I++bGIjrCUBQBjw+Sh9QiGOPTl5AJ+SXQhIPJq caQzh281KFx9bXH8hDtiJFS0Fb/SfphU7XBt8r11dtKq5SqPMYE6wB8LIGfYjyZgC3Di DjSQxJiu6lY6+SsmQjxxJG4SsQV53oF1yM2PF/iHwKux/z2TvjNMB2jhhhT5kyhGbW3B sZzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uCF8h4zX; 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 q9si16213342pgi.89.2018.12.04.03.27.46; Tue, 04 Dec 2018 03:28:02 -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=uCF8h4zX; 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 S1727173AbeLDL1I (ORCPT + 99 others); Tue, 4 Dec 2018 06:27:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:44272 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726724AbeLDK71 (ORCPT ); Tue, 4 Dec 2018 05:59:27 -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 DA8CC2146D; Tue, 4 Dec 2018 10:59:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543921166; bh=bK26nDY1EY1JgSQZPBJ91Njz6ACtqd2L/bQkwgA+w9k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uCF8h4zXa5ZSIml9F8XLvVRyGMOLGU+Mdh02n+0dGACS7BfgM31klhcKtkK4ySDP/ 5MHGyMLeSAC+GZifL8rsVGDbSkd35qBiZ3NHI9dt+403Oe/7ZVaEHYxFDuJWHx9vMD uUxlBxmU8+0nUVBRIRPLid3E+GyBnNCt2dQ3f3/4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "David S. Miller" , sparclinux@vger.kernel.org, stable@kernel.org, Masami Hiramatsu , "Steven Rostedt (VMware)" Subject: [PATCH 4.19 105/139] sparc/function_graph: Simplify with function_graph_enter() Date: Tue, 4 Dec 2018 11:49:46 +0100 Message-Id: <20181204103654.853292807@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 9c4bf5e0db164f330a2d3e128e9832661f69f0e9 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 sparc 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: "David S. Miller" Cc: sparclinux@vger.kernel.org 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/sparc/kernel/ftrace.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) --- a/arch/sparc/kernel/ftrace.c +++ b/arch/sparc/kernel/ftrace.c @@ -126,20 +126,11 @@ unsigned long prepare_ftrace_return(unsi unsigned long frame_pointer) { unsigned long return_hooker = (unsigned long) &return_to_handler; - struct ftrace_graph_ent trace; if (unlikely(atomic_read(¤t->tracing_graph_pause))) return parent + 8UL; - trace.func = self_addr; - trace.depth = current->curr_ret_stack + 1; - - /* Only trace if the calling function expects to */ - if (!ftrace_graph_entry(&trace)) - return parent + 8UL; - - if (ftrace_push_return_trace(parent, self_addr, &trace.depth, - frame_pointer, NULL) == -EBUSY) + if (function_graph_enter(parent, self_addr, frame_pointer, NULL)) return parent + 8UL; return return_hooker;