From patchwork Thu Jan 18 15:52:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 189271 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2bc4:b0:101:a8e8:374 with SMTP id hx4csp433812dyb; Thu, 18 Jan 2024 07:54:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IHfdTWgazTBoI1Vq+lWNs+QrlZ29qslrbH9krR9u1rG5SgxU8t/DZ4QRf945Sxhd5K0632r X-Received: by 2002:a05:6512:3d90:b0:50e:96d1:3165 with SMTP id k16-20020a0565123d9000b0050e96d13165mr886769lfv.98.1705593242169; Thu, 18 Jan 2024 07:54:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705593242; cv=pass; d=google.com; s=arc-20160816; b=DedQTtgP4ujL3Hl03xJsgr3cOixbenh9w36OD8JT1kHzn5rP4zv1KrOQvycSi/Kl5I Pl9rwW9so45DkBeUseKoaa4eTyUrOZq0EusoVFX50qHo4V9yc6ClViStKhGkh8mixiRZ 1VtP6TxDXmewhCnjFa07U/RcwJjLXyh2QAY2Pk1uMoxYArr33LClcUOXEjqlY/haYvbf l57HeBVfm3pMUIvwRW3ICxYZ9QZb4jKAZPI1maG9rz4Zvuw0WCpx4RV89mbVTHZGy3+y jKV5zuaS70M9Yx/gWqZFRIQCpxxUdO8EEGTJfV+/zrAnIKvW8qpOGoqZixfn52gTgOHM rv/g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=+jfDXwpJOlckaLV3N+26lV5tYsCgTGsva2UsQmLLTiU=; fh=jshYI2NwtEb4RFDet1CibhjijWOL1JdxV9n387woDuM=; b=YIhZmUfvyiyYblQVqDwiMY+5q1iHP+3w3x2pygJ8IIkOn0drwNeFko5Fi6OrNg4JRv A11tfjQrAXtl1jZ+0Ljv/pgbcXTKQRp7YE958rNXJ3TKajXpr432WbhbGfPOUb7XTH1h OUbI8QH06FGZQ1ClZ4QsuJOXm0mvR1Ti2JggbG53swcTNLaDN6uV+FS0y4tgDl9//fWY ECHWiazJ2emPvc8NlLdXhzvrRJA12gSdYVx21LJFDO2YSuXOSRkd9mJlRC/NlKk9tB/r nRnCmNukejzZLSRKyVaRfliPNQ3sapeNYU3pIuRn/KuUzlk9rz2ZHTdprsFGeFuQylIR q9SA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=NW50GUni; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-30304-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30304-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id jz6-20020a170906bb0600b00a2d5d72fe09si4682077ejb.671.2024.01.18.07.54.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 07:54:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-30304-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=NW50GUni; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-30304-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30304-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C27ED1F2265A for ; Thu, 18 Jan 2024 15:54:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1B8F42C1BB; Thu, 18 Jan 2024 15:53:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="NW50GUni" Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 130732575C; Thu, 18 Jan 2024 15:53:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.198 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705593193; cv=none; b=qL/3Uc5MEuCXly1xplK7l+ORfsiANNhh+Ljcrf9y9FEehozOzIlmJY/parWZlrPI6hFcvJiTQIEFllDD5fIBsl40Tf1lPttb2KWGZkxVp1Zi+12L7qWFprw6cJrTPgsL4bz9nkDPVn+TII3gJaGFbJIXVxm5aF7ob2pT3ILRPJQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705593193; c=relaxed/simple; bh=ybEa4dcyEPEWICOPd9fwlUWO52POhOtdC7gkpwjOtmw=; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID: X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-GND-Sasl; b=iREeOlH68TqAjshTde72azHOZViLvYPx43Nd5rsZHkA5PpF+vuLarAiFWUwDQ3hiNwMQpILQbNNQgT2jHGBZiX8CDR/AKFWEpdjHsJ1+4WkaqBjTZZWgzbahq/aq5D4/w6/Dx3tjkJv6vJ2D19Ghj6oXBWv7Tio4l5X+rkLE+JI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=NW50GUni; arc=none smtp.client-ip=217.70.183.198 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id B849BC000F; Thu, 18 Jan 2024 15:53:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1705593189; 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=+jfDXwpJOlckaLV3N+26lV5tYsCgTGsva2UsQmLLTiU=; b=NW50GUniLxpYy7F7gyqZvtWUE0t/7SA7A99hg27xv53frQUToOFOAl/L1QN5zz/AYIArXg nZpOTj9cKGn4Tm1nL0v2TatZnrWkhjwWX8iQGmrAkux27R2Wp5t0JanOh82dH1H0jTzWxW JR0elOSDORFEwuhLJnatxd68CKCU/jZLbBydRrsNTHtCp5V+DFig+M1xZlFpQXWU7NDiFM W9mKJ4rzzh8iLi4wtoAnaEccBnT0tJJPaMcI8HQD2yszz1Z7PsS1yD4HA9k8W0bPm9sHFI 8QUhuGU2zDwNBh68Mg4utWkyh62u3c9Qy1d8JDI70vcuEseHUt4h1RHxBWL08Q== 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_Lebr?= =?utf-8?q?un?= , Thomas Petazzoni , Gregory CLEMENT Subject: [PATCH v6 04/15] MIPS: traps: Give more explanations if ebase doesn't belong to KSEG0 Date: Thu, 18 Jan 2024 16:52:33 +0100 Message-ID: <20240118155252.397947-5-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240118155252.397947-1-gregory.clement@bootlin.com> References: <20240118155252.397947-1-gregory.clement@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-Sasl: gregory.clement@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788444139883801370 X-GMAIL-MSGID: 1788444139883801370 With the expanded support for placing the kernel in XPHYS rather than just KSEG0, scenarios where ebase doesn't belong to KSEG0 are more likely to occur. In such cases, we currently experience a substantial and perplexing stack dump without any accompanying explanation. To rectify this, we aim to replace the uninformative stack dump with a warning that offers a clear explanation of the issue. Signed-off-by: Gregory CLEMENT Reviewed-by: Jiaxun Yang --- 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 355d0f0709de8..911d2233d6d0b 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -2347,10 +2347,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) {