Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp2285241imc; Tue, 12 Mar 2019 10:35:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqyCMSJnsG8zlN8F1LZ1YDCIPBBLToesCNF9tOt2dmGxK4rNhth5bgvtgM9F6A5m7jwy5PrN X-Received: by 2002:a62:4553:: with SMTP id s80mr39295652pfa.141.1552412103578; Tue, 12 Mar 2019 10:35:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552412103; cv=none; d=google.com; s=arc-20160816; b=R3zdR6p5eDt/Jmym1mdv/5EpqWIkrEKkc8CZzpWXZG/RKqo5NKtLy2kBOWdlEzmCMd yiVYpZV+XQlWpzWyoL1e3rPemFw7k0zNR0UQgCH8+yhfz+3/R032OAdjNFWN3V6F43Ou ep9u5A8U+bl9hMdiUFL3827CBig2UxVldibUb/vTJzTz24d6OC+JWvAUHH7+9PuLC/pG rALI7L9lcdyaut8+XgSehaECoPLJBQea8HcAeppa6KQ8VMJYK0HZTUiKMbv+D48tGl9P WYUgJh+waNshDqjOSL6Kg5L39qdmngUwnQ0qO2Qc+t43yDdJDfeIkBDDVGEoOmpYU1o9 hw/g== 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=6n0c+fARMFAijiX+j5Q+710jnQTgRPUVtIsJV3qbYTM=; b=BQH0qJ+DWbURmOE80fN7N1quin7uTe0ouIVIbv2WSmwxvrbqLMf1EsPuPyY0seXpOb yKnBIl0f2Q13cxv8BJpi0Hc43qNzH6CZDLp7OQ/rHof/Snn23OI7iNR5AGmCkXjDOGwP 5rpkUdromPxPHeGlHWDQ34/0av3GbMoKN8NHHGjwu/LmmV/hUok6xQqCHdL3kvF2nRux N76mmGsAWxMAQCTas+JKLQS+lNYRdPFiYrDRpa1H07pp3d8OLteK+tIXSuNnTPtPhvWq oNAOos8+2fmwbtnb59DyuL62XMCy6H2DWGi1svAcXsrazqkjIAesI2mJHqJC+Ho6Y+YH dxlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IB3ijwoQ; 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 k7si8462257plt.198.2019.03.12.10.34.47; Tue, 12 Mar 2019 10:35:03 -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=IB3ijwoQ; 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 S1728699AbfCLRcS (ORCPT + 99 others); Tue, 12 Mar 2019 13:32:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:60292 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729418AbfCLRRF (ORCPT ); Tue, 12 Mar 2019 13:17:05 -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 D843F2087C; Tue, 12 Mar 2019 17:17:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552411025; bh=APZPdU7VhwYSGbvYpfEmcCtHjzc0PYTNatcOl+t67OE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IB3ijwoQNlPj9ajRuZuDMkpYDfyDypbVNcCfmNoCcrYST5pYvEPd5/5/In1YH3ZhE p/gaOjdqekWpLOECN4rLga3h2GoTiL4ncJ4gBBnUXv+g/d+M/I0Y9r0JYWWFmQfC6N K1mBSKu4qczBMPypx5g6tQM8l865azXrbXds3ax4= 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.14 115/135] MIPS: Remove function size check in get_frame_info() Date: Tue, 12 Mar 2019 10:09:22 -0700 Message-Id: <20190312170351.821104117@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190312170341.127810985@linuxfoundation.org> References: <20190312170341.127810985@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.14-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 e8b166e9146a..ea563bfea0e1 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