Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp954565rdb; Fri, 1 Dec 2023 03:17:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IE9A1dj6nGZ7qgLTm7w10rrWOgm7Y/j3GZA9Cd/7XvX9Bgj2k1PpvPUcs3hhzUasqLUE0qV X-Received: by 2002:a05:6a00:9a1:b0:6cd:f3f4:56bf with SMTP id u33-20020a056a0009a100b006cdf3f456bfmr5732087pfg.17.1701429424823; Fri, 01 Dec 2023 03:17:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701429424; cv=none; d=google.com; s=arc-20160816; b=VTEQjxm/WS8znoojg9CrwuL7YmHKHqrflkomWwtrtDnUB9Diu07Ar7JoVgQZCV0nfj 3s2rSKjaWXQ1P/Y7YQiaz2bG2YFSWtfz40UE8CAVovoKHqfDnfgcDjShdPgdmWGB0lEn WS+QG6Yspla+4A+4HVA3HeWdjM6PqqZi+0LmMEIy1ooXbbZdsRz1qeh2EMl6rSJP6+H5 cHl8U4BrgRtLd7kEO0F/PgGgTJ7eP8/chCCva8YD0LbAippc9U9fUVvno0IAO71aOn6q Di8mX/rKSSx2MtSDAAC5+KaQFYKm131q0mzYSaAWBqgbEvoiCGCcNEuivOzQDEl76P2Z HI4A== 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=hTh6lTTgBWK8V0IsaywMV05jTZIdp7n8HfjDKO7e3nAWM4YUvTG3VfH9r4pUQJRK7a LMzRIN2FCqZ5H1E7mQxcWNdaVgaENk1sxovNpGd76uRddQujhd+ruOyiWwpY+rSv+Sta QDN6XGsW6XyiW2EF/o6FZO0fkLkxQzbDrbmUIPJAA8XgBpv7TclAy59h6KsJFodsAuh8 HB4M2eIfeHaJBE2wrQ2iJuvSzRMWtKfzBgTcyHRUHFmvGUiJucCEWRqSUruBB4Uoeroe XRJftXRl/Q0I63LZ6u9sSUJ7wQg/bRmwU9zvQ7hWEnYhLH3ibdcgmRWNVNs7MC2n9bP6 tH7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="PG/59UkC"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id m3-20020a62f203000000b006cdd310540csi2940521pfh.350.2023.12.01.03.16.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 03:17:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="PG/59UkC"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 6C6C28266396; Fri, 1 Dec 2023 03:16:39 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378641AbjLALQM (ORCPT + 99 others); Fri, 1 Dec 2023 06:16:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378523AbjLALP2 (ORCPT ); Fri, 1 Dec 2023 06:15:28 -0500 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 133461704; Fri, 1 Dec 2023 03:15:33 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 61064E0010; Fri, 1 Dec 2023 11:15:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1701429332; 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=PG/59UkCiD8Da+NaKWqmkpGhkFnfPdkENgmb+8BnASxUBM1bNrTY9ki9c6ydjZozRTacZO zFvXm10pYaC3x5mV3zbPgDO1yn4loKOquf1ntufmPRHKbi+CJ5EtGnBPK53jUViy9EXBGk 5Al6KoJ6RaGyBJcD3XzePEYrh4TquJfLMMRTKSWCs7S+iEJCO64A1WQnDkFYID1VxJsGuz eOI+fjE7GB7NHNu7t73BWhJMf/2N8/CsMgCft1EAB0I74Az3Td+Z62yUiur2hk8k/jKXQv rb0VcLp5LNWTbl9N+psbN7mOCJtICg8YFVfqAlG2Ixgps8UBKR07FhtyS+627g== From: Gregory CLEMENT To: Paul Burton , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Jiaxun Yang , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vladimir Kondratiev , Tawfik Bayouk , Alexandre Belloni , =?UTF-8?q?Th=C3=A9o=20Lebrun?= , Thomas Petazzoni , Gregory CLEMENT Subject: [PATCH v3 13/22] MIPS: traps: Give more explanations if ebase doesn't belong to KSEG0 Date: Fri, 1 Dec 2023 12:14:56 +0100 Message-ID: <20231201111512.803120-14-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231201111512.803120-1-gregory.clement@bootlin.com> References: <20231201111512.803120-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 groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 01 Dec 2023 03:16:39 -0800 (PST) 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 --- arch/mips/kernel/traps.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) { -- 2.42.0