From patchwork Mon Jan 21 03:45:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun-Ru Chang X-Patchwork-Id: 10772737 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3A90D17FB for ; Mon, 21 Jan 2019 07:49:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A55629B11 for ; Mon, 21 Jan 2019 07:49:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E8D829B23; Mon, 21 Jan 2019 07:49:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DC2129B11 for ; Mon, 21 Jan 2019 07:49:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727903AbfAUHty (ORCPT ); Mon, 21 Jan 2019 02:49:54 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:39616 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727882AbfAUHty (ORCPT ); Mon, 21 Jan 2019 02:49:54 -0500 Received: by mail-pf1-f193.google.com with SMTP id r136so9740668pfc.6; Sun, 20 Jan 2019 23:49:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=oMUSXr5QsF43bcIcsIiuh+5ymsAO1eFL7kdTCvBXLWI=; b=nhKBAw61LBsc1KZvQRmxBkPBknsCXawIVZAdBMR00NyVT3zwFiGabAhsTyCDO0VO4g mUBSoLtGzh9mwWstNx7/DGl8PlY3oRefvQRBz+K7qdqNheS/Zu5AfzcuUl4G1hI7CFcS FUTPkJxc9An4I9Bwxs8q7TExmOdP97G9GdS8BwesLNhZsijjXO3mA6uirK4T2RtWNZjP 0c2wRbaNMmEBjwHIwBVaYlTtx4MUcSg4gOarQ38CHH4t3yrw4TmlXIubmxWxb/NvOtma YpkJQgfd3zLyWAyDd4CqP+7+V4cfxBmISOSZlGbPHPVBI5l9hFmWfbmH1xCWfevOZSPC DiGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=oMUSXr5QsF43bcIcsIiuh+5ymsAO1eFL7kdTCvBXLWI=; b=li055qVZ1pyZKs85tWT/nsvi2UsiqDaEn6JCDU6vVa78qCaiZkzqoMZJab8thy+pLp fi80Ngkc8YUfq0r0n3dSrMqlfs0D3G5nKEJWZyLvoBFX5VKbTww75j/nLWvmXOZBFtw5 kpX3YadeWiRJcHVxjwGapQm/gaKtY75Abiv+O72czvXaZlK43CwjGDhyxYfORWLv4kyT 2Umf6qpMRkpqYSO/3EOLKYBv6cZkrqHS+7DuMEnKffUb1IfYzodk+hi3QPFwr7xzClOe hTOhvEtb68i5PfRQGxInz0P8sjqHD3NFTRj9g6VEY+foYxmNpa9IA2YefdvJbHhaA1DG 9WEw== X-Gm-Message-State: AJcUukdjCzFu/G/wvD0HVyFG+s4fLCsJRQExcmegcb/WatLPuRGEYeI7 w7JFlIc4guwtHUUBoELnQB4rCIU= X-Google-Smtp-Source: ALg8bN7IS+OseEJcGrMGJ3Qx7LLRPIrTleJj4d2q5EAJkJbSWmYtih9VDuMdMeJWN6tf2H9CMhDMLQ== X-Received: by 2002:a62:9657:: with SMTP id c84mr28960807pfe.77.1548042310585; Sun, 20 Jan 2019 19:45:10 -0800 (PST) Received: from genru-archlinux (220-135-242-25.HINET-IP.hinet.net. [220.135.242.25]) by smtp.gmail.com with ESMTPSA id c4sm22977095pfm.151.2019.01.20.19.45.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Jan 2019 19:45:10 -0800 (PST) From: Jun-Ru Chang X-Google-Original-From: Jun-Ru Chang Date: Mon, 21 Jan 2019 11:45:05 +0800 To: ralf@linux-mips.org Cc: paul.burton@mips.com, jhogan@kernel.org, macro@mips.com, tonywu@realtek.com, mingo@kernel.org, peterz@infradead.org, jrjang@realtek.com, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] MIPS: Remove function size check in get_frame_info() Message-ID: <20190121034505.GA1522@genru-archlinux> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.11.2 (2019-01-07) Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Fixes: b6c7a324df37b ("MIPS: Fix get_frame_info() handling of microMIPS function size.") --- 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 6829a064aac8..339870ed92f7 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c @@ -371,7 +371,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; @@ -384,10 +384,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;