From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 621B7C43381 for ; Fri, 22 Mar 2019 11:32:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 31F4621929 for ; Fri, 22 Mar 2019 11:32:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553254364; bh=wtC7hLvVF4hIQdNnmRq/AYbnXwpIAWRPHSUy2MRas3Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Y27Gby6NYEco4Dr5NPQuUJcqTa0bFs3dkns1yR0uwh+0vqx5OdGTPW6Xs1T2nhpQy kMZ/DuI986iGcvPjhY8O/6vLj6wQiG2R44xLiPkuAEcq5d2kdw1M7L0bAoa28eJZw5 u8oj+1dJNU2e6fVooy2AQ31RLtnSpQJMLcTLvR7Q= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729994AbfCVLcm (ORCPT ); Fri, 22 Mar 2019 07:32:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:32940 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730174AbfCVLck (ORCPT ); Fri, 22 Mar 2019 07:32:40 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 D25F421916; Fri, 22 Mar 2019 11:32:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553254359; bh=wtC7hLvVF4hIQdNnmRq/AYbnXwpIAWRPHSUy2MRas3Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=duusSQ/xgFzhdyW+I9OzHAVpesHhnMiCNyosH6WcNUhCUWypg2zFTHzTbjdsNggcf CUI8KXvhpH05T6otJsIREbz1EGN6JGHX8k2CTIssXKhm/JFnRqryeWBG3/mA1On5s/ nOBBo6a4v+R2rw3YuX5t4UpMNlTJmHuiGd6CSUDc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jun-Ru Chang , Tony Wu , Paul Burton , ralf@linux-mips.org, jhogan@kernel.org, macro@mips.com, yamada.masahiro@socionext.com, peterz@infradead.org, mingo@kernel.org, linux-mips@vger.kernel.org, Sasha Levin Subject: [PATCH 4.4 111/230] MIPS: Remove function size check in get_frame_info() Date: Fri, 22 Mar 2019 12:14:09 +0100 Message-Id: <20190322111244.418293744@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190322111236.796964179@linuxfoundation.org> References: <20190322111236.796964179@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.4-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 2b424cfc69728224fcb5fad138ea7260728e0901 ] Patch (b6c7a324df37b "MIPS: Fix get_frame_info() handling of microMIPS function size.") introduces additional function size check for microMIPS by only checking insn between ip and ip + func_size. However, func_size in get_frame_info() is always 0 if KALLSYMS is not enabled. This causes get_frame_info() to return immediately without calculating correct frame_size, which in turn causes "Can't analyze schedule() prologue" warning messages at boot time. This patch removes func_size check, and let the frame_size check run up to 128 insns for both MIPS and microMIPS. Signed-off-by: Jun-Ru Chang Signed-off-by: Tony Wu Signed-off-by: Paul Burton Fixes: b6c7a324df37b ("MIPS: Fix get_frame_info() handling of microMIPS function size.") Cc: Cc: Cc: Cc: Cc: Cc: Cc: Cc: Signed-off-by: Sasha Levin --- arch/mips/kernel/process.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c index ebd8a715fe38..e6102775892d 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c @@ -339,7 +339,7 @@ static inline int is_sp_move_ins(union mips_instruction *ip) static int get_frame_info(struct mips_frame_info *info) { bool is_mmips = IS_ENABLED(CONFIG_CPU_MICROMIPS); - union mips_instruction insn, *ip, *ip_end; + union mips_instruction insn, *ip; const unsigned int max_insns = 128; unsigned int last_insn_size = 0; unsigned int i; @@ -351,10 +351,9 @@ static int get_frame_info(struct mips_frame_info *info) if (!ip) goto err; - ip_end = (void *)ip + info->func_size; - - for (i = 0; i < max_insns && ip < ip_end; i++) { + for (i = 0; i < max_insns; i++) { ip = (void *)ip + last_insn_size; + if (is_mmips && mm_insn_16bit(ip->halfword[0])) { insn.halfword[0] = 0; insn.halfword[1] = ip->halfword[0]; -- 2.19.1