Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2442318rdb; Fri, 8 Dec 2023 08:13:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IFo75FavdlukSoF3rHAkVi7+C4IsC6+wxjNWNCIeH9FZ0+2S3Z9Hy7Y62oRIIF9aFRAO+C/ X-Received: by 2002:a17:90b:1c0e:b0:286:6cc1:8676 with SMTP id oc14-20020a17090b1c0e00b002866cc18676mr259982pjb.91.1702052030436; Fri, 08 Dec 2023 08:13:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702052030; cv=none; d=google.com; s=arc-20160816; b=zHBZBDrnLDVHsYhBAWd99vvzck45k7cNAWGEDcWNNkbQNLJlApHNh9LgPs6lcawXuU 3b075CDt5aoMaAAO4VhrkZxAQuB9QG+W67OoSh0L1j6mVdTy/DDD1/y4eb9wrHnGMnCW 1C0oz6PUgRoljwNH59NLRCeynpyJhs9qzZhaD5W1aavWw5gZDgdYJRXsyCdMr2dbIUx1 fc2/W27i/YuHzjvUq6hzwtvGt5hDgWI5ota1I6jDroJlJri4ZjbHEMu/XcZvwKssOBc5 JiEqab11fm7sOjvyuYmPaNv3nY63eq3lDlgIWaKo41zGVGi6hFT8ASefWXrvuFsC1i2U 1PjA== 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=H7xLfxUYcwv7Riq1WHIn/RhOYVTg87eiUqaEEpdrB/s=; fh=jshYI2NwtEb4RFDet1CibhjijWOL1JdxV9n387woDuM=; b=QeCIhZmkqNAtuFqCj16JgxTmIkSpHIIQkjXfl7otAa7lITAo59pQlTOq2HuHqIa6/P UeJzex30iiHfKTuFK6+h3ncwScf4K1ZRsowifpeZv2/gGC7tQd+7m9WuoLwY/JFsHW7X YBAIy/i6iSg7KLkyY1wZET43G71mcqmofDe7X81tAsNJA8ou4pPTMU/3JpVp54IX9eHT 1j8fPiaqSlhww0/R+XbRPnpZ81xlcIWrsAyBNCFASuTf4036J/QhbNjacZW0+XXO0gD2 RIOrJjctwh8k67XvkrinoEXm79qCd6pcpM6Dg3sR7WleKyUgIeXhfBmL5rQqkXGGz48B YmAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=a1XWrhBw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id b3-20020a170902d30300b001d04d730685si1741015plc.543.2023.12.08.08.13.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 08:13:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=a1XWrhBw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id BE02580FA9DD; Fri, 8 Dec 2023 08:13:48 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1574474AbjLHQNe (ORCPT + 99 others); Fri, 8 Dec 2023 11:13:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1574141AbjLHQNE (ORCPT ); Fri, 8 Dec 2023 11:13:04 -0500 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::225]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C396B19B9; Fri, 8 Dec 2023 08:13:05 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 0DD5F1C0002; Fri, 8 Dec 2023 16:13:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1702051984; 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=H7xLfxUYcwv7Riq1WHIn/RhOYVTg87eiUqaEEpdrB/s=; b=a1XWrhBwy2U42+CHAI15N1pZZw64nKtcKOiF8/HzhGMSh3OlhtYU+v4OGR/MAbSdRCYtjY CTKh835lzvz4q15lYwWofmlQtxpo38uRt6hfmdhfr6kPOegVhjQ0ifchkoVP8/dTeSS1Ni Fm0116kMeAZdB5zU/TZuNT4iawBv1ByuXdgEhFxX4U1ODavMIxAu3J9Xy0eobLBsTisl6u XzcSpRkr7i1y0wtKIpcVnAeKW/CGqa4zJ/L4rkRpwibpe/nT99NSdlJDjxWdeJ0hDorjfE bD/Liomt/UKYSKiZZ3nTqb7XtNX7mBH3w+fa3ip6ToGQ3XHwfAzjLPBLWnY5xw== 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 v4 13/22] MIPS: traps: Give more explanations if ebase doesn't belong to KSEG0 Date: Fri, 8 Dec 2023 17:12:29 +0100 Message-ID: <20231208161249.1827174-14-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231208161249.1827174-1-gregory.clement@bootlin.com> References: <20231208161249.1827174-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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Fri, 08 Dec 2023 08:13:48 -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..ec0cebfd2ef7b 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(%pa) should better be in KSeg0", + &ebase_pa); } if (cpu_has_mmips) { -- 2.42.0