Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5937675imu; Sun, 20 Jan 2019 23:52:04 -0800 (PST) X-Google-Smtp-Source: ALg8bN7u25pJg8+ngfRPqr0E1qe/xi0XFSc2yUTQwlO6NS+4tJcU2EOkU42wXfzy7qk+2yGOlONi X-Received: by 2002:a63:5e43:: with SMTP id s64mr27257219pgb.101.1548057124350; Sun, 20 Jan 2019 23:52:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548057124; cv=none; d=google.com; s=arc-20160816; b=xNEYK0wX2SkXL+Z0R7Z3t+0RzevFFKRf33wHwTHeTFElRG2w2b7igwHzdc62F3nnxm UpylHcq3vgo7eXXgZ6Xvu2LHgYdJLNWak85wlnGC6MwoVRdBoMXzs2nDvIRzIW6y86n7 UY8F9HK7/fccRb+NOdhhbterutg0zPO3egCI+WdOTEEZG0T2cpRiaQaTs2Nx7scoXhPz KHg/h9nuqmk7TIhuQwHx9llYW4QsDE26uu90KFBHpVfZb7bYZ5k4sIfwU98dEcU6OaLc m5nbca06tdMLkaknmWvPEEoNJreqd6QjqRZOeu0ra10mc/lVvEciaOdh3QB1iHVMvnt1 r18g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:date:from:dkim-signature; bh=oMUSXr5QsF43bcIcsIiuh+5ymsAO1eFL7kdTCvBXLWI=; b=lSoF3j7RfjZ4gsEyRkNHd4FOrv7WcOsLPz/TgYZNUWFBsTl86hK7uZQ9g0CPfCmi8N 0R02xTwyXhbYrtVCt3N/1umW6ZF8pqnRRe6tqNqer8nO6eqVckcS+zzPRQmXTjWQbdLx XY+Z+KnsOCyFBLn2yYST5ZVppLspQnI84/wGTm/t1kSldLunIiqjDX8VWU7O79fF4ZXI 4ZhUcY/U6lr7OkZXJk/nMJLrq4SkDLOUJaKt/vqmvVlghZ/fduTBGNuXNr92n+8WWrMG FoZJpVAhV5CDQ5cu+9VwsOgOTjwZ0c5NFE8cKjXZViuiuGMA4CRqoteZWc2EtlraPssN Q+fQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nhKBAw61; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 26si9244289pgu.190.2019.01.20.23.51.49; Sun, 20 Jan 2019 23:52:04 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=nhKBAw61; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728346AbfAUHty (ORCPT + 99 others); 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-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-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.11.2 (2019-01-07) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 2.20.1