Message ID | 20231123152639.561231-14-gregory.clement@bootlin.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp526068vqx; Thu, 23 Nov 2023 07:28:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IHMkToA1P4Xo/nnD3eK1vG2gGXbkacB39Qwetf+p24NAtDHiBza/4d/aOuqr0+58R9R019R X-Received: by 2002:a05:6a20:734d:b0:18b:8d6b:e601 with SMTP id v13-20020a056a20734d00b0018b8d6be601mr2557368pzc.7.1700753293103; Thu, 23 Nov 2023 07:28:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700753293; cv=none; d=google.com; s=arc-20160816; b=M6vE01JgEa6ZZRWAgepKquRL4KOCHz4A8T9D2lm830LhHq+1LCj/RGGMzztt4KE9mr 5tcTWms1i7QyuZ/1Veq2CLWtev8FCRvYfkTeRu9WdFrJAFIpIVLKTvH1MA5UNyHgvrJa Vov3g48kKucA4ryd3IzeCf/wDv8RF1tLgBX+gVtjEEE1Jb663KvYuc29lS05afGDtTM7 d2wdreLk7XGj8IIBDaeHHFPaw9zWXkZkheUgva++Kmb7v4P3KPFOMCBE/aLE90XjLeWs QxLr3/NOK7kxOT6dqcDrpn1xcmq8akdvhREVZnrMH+Yzkbw7ElFGHULYb+YBfGAQNdfY n0Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RCKptM1WbQckX1/6TWdLw/l+WdnmH/2DKGhPgYFMpg4=; fh=jshYI2NwtEb4RFDet1CibhjijWOL1JdxV9n387woDuM=; b=vOUMQsqzjsHA89ou3WkK81PZPXMn5gU5T1pYeYs9VJvmCgn85CMRxTpGIJ711tfObJ YeTKI/+RWmRwIHdNONZd3dcfPMx8ymQGaO77ypqYKMB4/KICTvVpJWh9dnI5Yfp2Mhlg UeRacx7TScsd2LvFGLCgqF5nLe8YWXu1GDcpJR5HzsAKc0Jyxqrd7yx6iVAvApgWiwFJ p16yneQyObr6Wk2VlfNOPeVKmKsGKm+RDCX2t6YJ4gX1nxCmCK7I5ooKXT8GMAtzVhBv 7y1568yLqxlD8dm96LpoWUPoXNMnfAsc1UkndEfu0jkgxVq5YNORZYRfUPwFaUvKJ16l NQTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ezsiTQk1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id t5-20020a625f05000000b006cb83b233a2si1356186pfb.355.2023.11.23.07.28.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 07:28:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ezsiTQk1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 3DB4682385EA; Thu, 23 Nov 2023 07:28:10 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346187AbjKWP1v (ORCPT <rfc822;ouuuleilei@gmail.com> + 99 others); Thu, 23 Nov 2023 10:27:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346171AbjKWP1T (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 23 Nov 2023 10:27:19 -0500 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A571F10C0; Thu, 23 Nov 2023 07:27:06 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id EB15A40002; Thu, 23 Nov 2023 15:27:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700753225; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RCKptM1WbQckX1/6TWdLw/l+WdnmH/2DKGhPgYFMpg4=; b=ezsiTQk10iF+9RkJPCisP/IK3Du+KZIUqiD3vB+Ciz7VII/LNStwt40t5Y+EMuH41tc0rB 3DPKQ3b1MCSCAWWE02Q+0E/ARWNp5LcXXvZUSKpBqzC/z4vL5tNPtaF4U7+gygR2rcffDQ ISIxWgqkqz+C0XeYvnyRmnBUg8D/fgUsax+k1L92bfrECNaqNg6Pb1SAeqTKg9WqOyzQtE 7q5lzfNTsvO62erFgaFkWDghjB4ynCTh9YuxA6qR6DCG08oVovdasQ0mRHEMvExOm0hP4S FmMVIvvJpH8lvC0LjrZmHSJpFMm4rlPe2uwotxyZ6SuYY9fSCrOE8FLx2JEtig== From: Gregory CLEMENT <gregory.clement@bootlin.com> To: Paul Burton <paulburton@kernel.org>, Thomas Bogendoerfer <tsbogend@alpha.franken.de>, linux-mips@vger.kernel.org, Jiaxun Yang <jiaxun.yang@flygoat.com>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vladimir Kondratiev <vladimir.kondratiev@mobileye.com>, Tawfik Bayouk <tawfik.bayouk@mobileye.com>, Alexandre Belloni <alexandre.belloni@bootlin.com>, =?utf-8?q?Th=C3=A9o_Lebr?= =?utf-8?q?un?= <theo.lebrun@bootlin.com>, Thomas Petazzoni <thomas.petazzoni@bootlin.com>, Gregory CLEMENT <gregory.clement@bootlin.com> Subject: [PATCH v2 13/21] MIPS: traps: Give more explanations if ebase doesn't belong to KSEG0 Date: Thu, 23 Nov 2023 16:26:30 +0100 Message-ID: <20231123152639.561231-14-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231123152639.561231-1-gregory.clement@bootlin.com> References: <20231123152639.561231-1-gregory.clement@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: gregory.clement@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 23 Nov 2023 07:28:10 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783369084966396594 X-GMAIL-MSGID: 1783369084966396594 |
Series |
Add support for the Mobileye EyeQ5 SoC
|
|
Commit Message
Gregory CLEMENT
Nov. 23, 2023, 3:26 p.m. UTC
Now that we support having the kernel in XPHYS and not only in KSEG0,
the case where ebase doesn't belong to KSEG0 is more likely to
occur. However, in this scenariowe encounter a significant and
intimidating stack dump without any explanation. To address this, we
should eliminate the uninformative stack dump and replace it with a
warning that provides a clear explanation of the issue.
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
---
arch/mips/kernel/traps.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
Comments
Hi Gregory,
kernel test robot noticed the following build warnings:
[auto build test WARNING on robh/for-next]
[also build test WARNING on lee-mfd/for-mfd-next linus/master v6.7-rc2 next-20231124]
[cannot apply to lee-mfd/for-mfd-fixes]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Gregory-CLEMENT/MIPS-Export-higher-highest-relocation-functions-in-uasm/20231124-002644
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link: https://lore.kernel.org/r/20231123152639.561231-14-gregory.clement%40bootlin.com
patch subject: [PATCH v2 13/21] MIPS: traps: Give more explanations if ebase doesn't belong to KSEG0
config: mips-allyesconfig (https://download.01.org/0day-ci/archive/20231126/202311261838.wgZG2yvS-lkp@intel.com/config)
compiler: mips-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231126/202311261838.wgZG2yvS-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311261838.wgZG2yvS-lkp@intel.com/
All warnings (new ones prefixed by >>):
arch/mips/kernel/traps.c:371:6: warning: no previous prototype for 'show_registers' [-Wmissing-prototypes]
371 | void show_registers(struct pt_regs *regs)
| ^~~~~~~~~~~~~~
arch/mips/kernel/traps.c:448:17: warning: no previous prototype for 'do_be' [-Wmissing-prototypes]
448 | asmlinkage void do_be(struct pt_regs *regs)
| ^~~~~
arch/mips/kernel/traps.c:753:17: warning: no previous prototype for 'do_ov' [-Wmissing-prototypes]
753 | asmlinkage void do_ov(struct pt_regs *regs)
| ^~~~~
arch/mips/kernel/traps.c:875:17: warning: no previous prototype for 'do_fpe' [-Wmissing-prototypes]
875 | asmlinkage void do_fpe(struct pt_regs *regs, unsigned long fcr31)
| ^~~~~~
arch/mips/kernel/traps.c:1028:17: warning: no previous prototype for 'do_bp' [-Wmissing-prototypes]
1028 | asmlinkage void do_bp(struct pt_regs *regs)
| ^~~~~
arch/mips/kernel/traps.c:1115:17: warning: no previous prototype for 'do_tr' [-Wmissing-prototypes]
1115 | asmlinkage void do_tr(struct pt_regs *regs)
| ^~~~~
arch/mips/kernel/traps.c:1152:17: warning: no previous prototype for 'do_ri' [-Wmissing-prototypes]
1152 | asmlinkage void do_ri(struct pt_regs *regs)
| ^~~~~
arch/mips/kernel/traps.c:1403:17: warning: no previous prototype for 'do_cpu' [-Wmissing-prototypes]
1403 | asmlinkage void do_cpu(struct pt_regs *regs)
| ^~~~~~
arch/mips/kernel/traps.c:1508:17: warning: no previous prototype for 'do_msa_fpe' [-Wmissing-prototypes]
1508 | asmlinkage void do_msa_fpe(struct pt_regs *regs, unsigned int msacsr)
| ^~~~~~~~~~
arch/mips/kernel/traps.c:1528:17: warning: no previous prototype for 'do_msa' [-Wmissing-prototypes]
1528 | asmlinkage void do_msa(struct pt_regs *regs)
| ^~~~~~
arch/mips/kernel/traps.c:1549:17: warning: no previous prototype for 'do_mdmx' [-Wmissing-prototypes]
1549 | asmlinkage void do_mdmx(struct pt_regs *regs)
| ^~~~~~~
arch/mips/kernel/traps.c:1561:17: warning: no previous prototype for 'do_watch' [-Wmissing-prototypes]
1561 | asmlinkage void do_watch(struct pt_regs *regs)
| ^~~~~~~~
arch/mips/kernel/traps.c:1588:17: warning: no previous prototype for 'do_mcheck' [-Wmissing-prototypes]
1588 | asmlinkage void do_mcheck(struct pt_regs *regs)
| ^~~~~~~~~
arch/mips/kernel/traps.c: In function 'do_mcheck':
arch/mips/kernel/traps.c:1591:24: warning: variable 'prev_state' set but not used [-Wunused-but-set-variable]
1591 | enum ctx_state prev_state;
| ^~~~~~~~~~
arch/mips/kernel/traps.c: At top level:
arch/mips/kernel/traps.c:1613:17: warning: no previous prototype for 'do_mt' [-Wmissing-prototypes]
1613 | asmlinkage void do_mt(struct pt_regs *regs)
| ^~~~~
arch/mips/kernel/traps.c:1649:17: warning: no previous prototype for 'do_dsp' [-Wmissing-prototypes]
1649 | asmlinkage void do_dsp(struct pt_regs *regs)
| ^~~~~~
arch/mips/kernel/traps.c:1657:17: warning: no previous prototype for 'do_reserved' [-Wmissing-prototypes]
1657 | asmlinkage void do_reserved(struct pt_regs *regs)
| ^~~~~~~~~~~
arch/mips/kernel/traps.c:1833:17: warning: no previous prototype for 'cache_parity_error' [-Wmissing-prototypes]
1833 | asmlinkage void cache_parity_error(void)
| ^~~~~~~~~~~~~~~~~~
arch/mips/kernel/traps.c:1881:17: warning: no previous prototype for 'do_ftlb' [-Wmissing-prototypes]
1881 | asmlinkage void do_ftlb(void)
| ^~~~~~~
arch/mips/kernel/traps.c:1910:17: warning: no previous prototype for 'do_gsexc' [-Wmissing-prototypes]
1910 | asmlinkage void do_gsexc(struct pt_regs *regs, u32 diag1)
| ^~~~~~~~
arch/mips/kernel/traps.c:1945:6: warning: no previous prototype for 'ejtag_exception_handler' [-Wmissing-prototypes]
1945 | void ejtag_exception_handler(struct pt_regs *regs)
| ^~~~~~~~~~~~~~~~~~~~~~~
arch/mips/kernel/traps.c:1990:17: warning: no previous prototype for 'nmi_exception_handler' [-Wmissing-prototypes]
1990 | void __noreturn nmi_exception_handler(struct pt_regs *regs)
| ^~~~~~~~~~~~~~~~~~~~~
In file included from include/asm-generic/bug.h:22,
from arch/mips/include/asm/bug.h:42,
from include/linux/bug.h:5,
from arch/mips/kernel/traps.c:16:
arch/mips/kernel/traps.c: In function 'trap_init':
>> include/linux/kern_levels.h:5:25: warning: format '%llX' expects argument of type 'long long unsigned int', but argument 2 has type 'phys_addr_t' {aka 'unsigned int'} [-Wformat=]
5 | #define KERN_SOH "\001" /* ASCII Start Of Header */
| ^~~~~~
include/linux/printk.h:427:25: note: in definition of macro 'printk_index_wrap'
427 | _p_func(_fmt, ##__VA_ARGS__); \
| ^~~~
include/linux/printk.h:508:9: note: in expansion of macro 'printk'
508 | printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~
include/linux/kern_levels.h:12:25: note: in expansion of macro 'KERN_SOH'
12 | #define KERN_WARNING KERN_SOH "4" /* warning conditions */
| ^~~~~~~~
include/linux/printk.h:508:16: note: in expansion of macro 'KERN_WARNING'
508 | printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~~
arch/mips/kernel/traps.c:2428:25: note: in expansion of macro 'pr_warn'
2428 | pr_warn("ebase(0x%llX) should better be in KSeg0",
| ^~~~~~~
vim +5 include/linux/kern_levels.h
314ba3520e513a Joe Perches 2012-07-30 4
04d2c8c83d0e3a Joe Perches 2012-07-30 @5 #define KERN_SOH "\001" /* ASCII Start Of Header */
04d2c8c83d0e3a Joe Perches 2012-07-30 6 #define KERN_SOH_ASCII '\001'
04d2c8c83d0e3a Joe Perches 2012-07-30 7
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 68f1dd54cde1c..3af2aa82b4408 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -2420,10 +2420,13 @@ void __init trap_init(void) * EVA is special though as it allows segments to be rearranged * and to become uncached during cache error handling. */ - if (!IS_ENABLED(CONFIG_EVA) && !WARN_ON(ebase_pa >= 0x20000000)) + if (!IS_ENABLED(CONFIG_EVA) && ebase_pa < 0x20000000) ebase = CKSEG0ADDR(ebase_pa); else ebase = (unsigned long)phys_to_virt(ebase_pa); + if (ebase_pa >= 0x20000000) + pr_warn("ebase(0x%llX) should better be in KSeg0", + ebase_pa); } if (cpu_has_mmips) {