From patchwork Fri Feb 16 17:42:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 202280 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp688960dyb; Fri, 16 Feb 2024 10:06:39 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUKvoiFo0Oyu7zm49Wg8qWfUHIveGubyULOtau+nMoXAgTed32rRIUCL76ObZvFntolJMaGq1D4a12n825z/GJpTrayeA== X-Google-Smtp-Source: AGHT+IFfI/jbRjovHgtFZm2pBkdAj0YIsM5OhGc7tBD0fKwOEJr3kk19v6BStj0dXdDe//hnAymt X-Received: by 2002:a17:90a:8546:b0:298:c104:1eb8 with SMTP id a6-20020a17090a854600b00298c1041eb8mr8161502pjw.19.1708106798748; Fri, 16 Feb 2024 10:06:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708106798; cv=pass; d=google.com; s=arc-20160816; b=msDhRssIPT4tKFaxg6EdjRifipbIL+mE1vfz6AKoTXbHYxGbQ8SLvrUrYHLpaeQvh0 Tr1eNSWC+KM9dTAgAw0wop+jayQP7ExqwvJn3JSUyu4G2RJ6GS4azP8J7W72IcxT5H9S j0KZY+ZRVcdQZ51y2NhpiBflEx12VNCc1UVoy3cIVqZ4aO1mPf53MSIyq1/swXHo+GPE Q9/Jalc1ETlK4TKww6D4T5GB3+zZwmTc2yyxaw09EgtTt8RwlA+mQf28C7IjI455SbNg dhqWeBLCTIvnUTCk07QPN5ZbJNYN1SZBQfp5X/LFxAgCbN3ugGTPkIfj6lnzkU03Jwfx aOfA== 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=AFHP7WMf7cdabuKf8LPE+Tv/tjtS5NR+H70CJoKhySg=; fh=jshYI2NwtEb4RFDet1CibhjijWOL1JdxV9n387woDuM=; b=E9oTTY/UfAWlRyrYG1HsJrfYF53uh+qdsoRL9pH9DSy+1bnYk45ZM1vDYw10BVVgah UBYyvYZXLyE6Gi54VSd5nnq7HF2lKELzIEGt2VUE5toVST15jnG/R9kq13buaFgl/7JL Iei2va9pep0COGTqb16tWgERPgGReaL36R7IJ/mxBNTArk5la0EdeYqmzZ5MkK2JKieM lX5BlHAGjsxBiqLiZrGCxqTlYZ4a3tkFow6E6QnX0vcrYriPomR4WPss0PM/4pkK/8KH uNMW+3vu79oJjzlpr8+fYXBkYlzRVSvfl+picHwXicP6nwUbo5PfNCGO5SvxTM0eHQPG 1lOQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=fndWFhQn; 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-69089-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69089-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id x16-20020a17090abc9000b0029948cb794fsi295997pjr.25.2024.02.16.10.06.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 10:06:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69089-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=fndWFhQn; 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-69089-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69089-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 9774CB25B88 for ; Fri, 16 Feb 2024 17:43:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F01F81350E6; Fri, 16 Feb 2024 17:42:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="fndWFhQn" Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (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 E047E132477; Fri, 16 Feb 2024 17:42:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708105359; cv=none; b=My3Xaqr5ox+FgMUzTgVfxXM4RlhIdf+PrTQ5QAR/XuGT+UTzTSMa9QpCatl0PL7qYrlnxTqPbQiHHric5BTleFooKtjwdXCwqOvklQr/ejODnZJQIQErVeaJa+jwlWp/oGYEF8o0OdteGSTf4AzcqhK0iZLjrbc2paPn343nDi4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708105359; c=relaxed/simple; bh=+nDcBiIHyQC/Z9LgJL8sMYQAEOQa2wTWBrZ2ynWLh7o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sJRAyOLGS+1AIfzIzuJrXME3Pt3I3ezqqUgf+Tk43Bzi7HrPLS/AxYgI9i+Xw8lpiV7+rGyobpk3YscP22F/whmgZawH1jqqaoMG1Bi5RzQpK+nUKObj9POKDc2IymyupZRoBGek/X/DufRHC3slFo5AeO56Sx560hDO3VQAWKk= 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=fndWFhQn; arc=none smtp.client-ip=217.70.183.194 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 F3E4940008; Fri, 16 Feb 2024 17:42:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708105354; 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=AFHP7WMf7cdabuKf8LPE+Tv/tjtS5NR+H70CJoKhySg=; b=fndWFhQnrU1dyV5z02OwK+v7yQELtD72FtNXbHj/tQ9Q8ckEc4Y3Q/TdNmGNKs5eR8pPQw N2YyCWOuTKrk23qldccCI6XH0cyzFOLOfnSnKkfcG82Ge6wkhK2ZCETF3oyORqVBAsRJKL 2Pn73urZ5OVriEHkdE8oqVAUTWTnWcCHm/Cufk6OfQGlDZLlX0jm6mKQXgtjR6J6S4A2uG X5pgmAh5StE/NkZfC0mmfDWlmCLGXvA/BOPys3ePeNXQqrlORpmo7ZiX2SsOdH+gTYAQZH zMxx3vfTQ6Bk4bXXRZ9hoU/qVMhCzmgD9BRg8uaKqJr6gk37ueBVN/QbuxVrIQ== 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 v8 04/14] MIPS: traps: Give more explanations if ebase doesn't belong to KSEG0 Date: Fri, 16 Feb 2024 18:42:13 +0100 Message-ID: <20240216174227.409400-5-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240216174227.409400-1-gregory.clement@bootlin.com> References: <20240216174227.409400-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: 1791079794809580923 X-GMAIL-MSGID: 1791079794809580923 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. Reviewed-by: Jiaxun Yang 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 075bb08543eca..a9644c5e7ef4d 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -2345,10 +2345,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) {