Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp2301410imc; Tue, 12 Mar 2019 10:56:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqy7LaIGe/n5JiEd7dftH/Xxou9SryMGEFEBBZW9yLAIoPEnHHTbxnYtVHF/D/Ck7sEn+0G3 X-Received: by 2002:a17:902:7202:: with SMTP id ba2mr40230384plb.147.1552413403974; Tue, 12 Mar 2019 10:56:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552413403; cv=none; d=google.com; s=arc-20160816; b=Qa7YyHA5z9IY4vV60lnzQzmcpHC1CXh2YzS7ovwe4jESIMZRWgxvkZMQEK5D0rEnf9 GJLFqmlZ4StBnsczKYjUgxxx82qC9J47zL5X1kP8yAvQ6Rf7t9Rui9Y2AI21tMqr3wKk n6zg01dZwbrVuD36t0XupBGgYLv6bPaz5gXj9y/AZcmdyWhuYikOJ+F2+UZrUo8DtMd/ q6zjPuhSSN07AUQ7ANtJBslc/4zpMz1TM58AjlqDRARbqZdIRNoYe70EFtQXfePKaouU Dtje9A0/NZMRcxcOY9oB3M6HNHk+1tFgeXht14p1DyRtRC6rKgLjPDAvYbpvdU17ES26 yLvQ== 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=T9o5TgsBIeFwhFicek95N7zcMzcmT1vmtmiS4oNJ8fA=; b=gZCqsKLdqCpnXlH6VYHAUSo4f/cAfUJfqK8HCJb3xNgvFcS0uQJ6hkNJFXR5DxB3dh kTSxkMYvIPKOa51STLEvf5YzMV/TAUUoDq06ZEOLIOHlsNAtP3wqWaNNcRkKpzROl6MD LK2nQiZg1R00Iltx3CMr5e5TEKfaK/P4ZQWHcu0jVs+3oT/KKCVRQ7T+SalLAk4FZjMj R+Wzhv4iQ8ced4Xikyf75l5K/Nzu2Fa8v0L7dZdRCUMQhg4nmfEsyqaNSBCirSvzm1p2 RPIDgjWiJvw0cJirDyJOZhjINNp3LNL+6DY8Q3LgrhLjTn9mXK6OgNi6NJWT5xo0WIA7 iuZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wFWJ5ckS; 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 z20si8366665pfl.3.2019.03.12.10.56.27; Tue, 12 Mar 2019 10:56:43 -0700 (PDT) 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=wFWJ5ckS; 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 S1728227AbfCLROE (ORCPT + 99 others); Tue, 12 Mar 2019 13:14:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:49744 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727916AbfCLRNY (ORCPT ); Tue, 12 Mar 2019 13:13:24 -0400 Received: from localhost (unknown [104.133.8.98]) (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 209B12183E; Tue, 12 Mar 2019 17:13:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552410804; bh=B4Oq8vY4v/PHUA2mwC/kSY6YkPUrqqt1DPEqiaRRvLQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wFWJ5ckSE/I95DE7WEmN43xH9+qJBrDs4uHI56joUlBeCUICdrVWs3lRZUmX39jo5 +fTmIcGMpqwIG3Rhz7vnhCdTK7Pp9ZRzgE3z2DIviJqFMoxeDmOv4Xw5cZ/GjThheh EBTI8js2sfQfnMBdBGrtPnRAFazZ72NQ3tZyQjZ8= 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.20 132/171] MIPS: Remove function size check in get_frame_info() Date: Tue, 12 Mar 2019 10:08:32 -0700 Message-Id: <20190312170359.084168929@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190312170347.868927101@linuxfoundation.org> References: <20190312170347.868927101@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.20-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 d4f7fd4550e1..85522c137f19 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; -- 2.19.1