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.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 BEC41C4360F for ; Thu, 28 Feb 2019 15:20:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8959A214D8 for ; Thu, 28 Feb 2019 15:20:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551367202; bh=3Un7C7N5r4mmx8QY/Kwmwx0ob8XiTzIft+G35h6KIts=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=RxiALI4Nt2gjPmZ+p6g2m2jhtH7rySoOC8uR3eS0kvQGcll01tGtUMDtH6m4G1c9d cTRNEubG1gLKXL5G4rip1k+uljyjct2APB/WSdM0liAAFa/8LnV4QMzI+9M7ADQD1u 3Mg7+xMTeNw2FQUZWeKgw2XxECyDkYGoo2tqlB1Q= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731242AbfB1PT4 (ORCPT ); Thu, 28 Feb 2019 10:19:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:50444 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388123AbfB1PPK (ORCPT ); Thu, 28 Feb 2019 10:15:10 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1AB48218D3; Thu, 28 Feb 2019 15:15:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551366909; bh=3Un7C7N5r4mmx8QY/Kwmwx0ob8XiTzIft+G35h6KIts=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M8/AsU+HNJWBSj2LnucnowmGkzCBk8z3AjYirerVyLC0HuhWHcbKjbkZQ1kFh0TEH qxw+rbvgEAzIceLW23WbsEMD8EXTVAtiaOuATq7AUaTWBYy1KLr7myqeHBBZlejC4i sLy0taaNvKrZ4SOhxCLYip3aQdkeW/2PdzFbVBd4= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: 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 AUTOSEL 4.14 32/36] MIPS: Remove function size check in get_frame_info() Date: Thu, 28 Feb 2019 10:13:33 -0500 Message-Id: <20190228151337.12176-32-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190228151337.12176-1-sashal@kernel.org> References: <20190228151337.12176-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org From: Jun-Ru Chang [ 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 e8b166e9146a3..ea563bfea0e10 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c @@ -370,7 +370,7 @@ static inline int is_sp_move_ins(union mips_instruction *ip, int *frame_size) 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; @@ -383,10 +383,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.word = ip->halfword[0] << 16; last_insn_size = 2; -- 2.19.1