From patchwork Thu Jan 18 15:52:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 189275 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2bc4:b0:101:a8e8:374 with SMTP id hx4csp434425dyb; Thu, 18 Jan 2024 07:55:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IHVL1mifui61Ei+nDQyCbBoxnUET72ioGKY5p4qrXA+wfc7g1PMibA7unBfxWtfG78cdNVy X-Received: by 2002:a9d:6298:0:b0:6dc:3c65:2a70 with SMTP id x24-20020a9d6298000000b006dc3c652a70mr1069762otk.65.1705593303937; Thu, 18 Jan 2024 07:55:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705593303; cv=pass; d=google.com; s=arc-20160816; b=eNEGWmvtQzzNjW8J0a92+WIWrZ9cQFsEjv1cz7L5+aeDN3cq4CEuYiVVdTXPjCrUwJ feLva69CdukvJD0N/guI2twx+oFPa6b1XOu8X5fmBpeb+1rZPtDlxwadBjo3AJgW+f0u 3eJxKlRtUIkl04+OKoJd7mOVxS20PmRXJ0VeiJbSzhMU4cVaMIhZe8nTYtEgllIsrQMN 4Z/CluIWbuyuTtsxDA2nElDC0xCb1+qci975Z2rQ6P1Ci4KsZMi04hohtxXTGXRoJYAJ RbOm9mHdPpvLJmYmudXJhjOb/9DEa+bJzs1vaJgVPeZonVN+ofvxxe0rW8p1oRp6G+vm stnA== 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=kCu7pbyVCXYyBTkd+j43VhZPPnMfAyc4JbkgYZulLro=; fh=MwmhOnPCNEKQUh9CETmL1NjqsCe+66NMqSNy76XJ1mw=; b=X9x5Wd3Uqhz0cFKJgl5Ia/IncPB2ilKtLORK0jpW5Xu1MNcWa44oKpIh+KfN+JhtfU eXwRlEV3846WQiGPOrCdMbL9//AYELBXfzgDdM++6wx0HmZ75qeITPP45rwCA00D3hua me5uvL3SjjywjSrZleyIY3vkZvxYHKkDoCbVncThYzCsOU7bbw41wJ87kXIB2VBr3fTq EHBTp9Ky8DfxBeoXJoORvFjwr3sON9vUJH9I6zG2poHsROYhbSiDZNxuoy/3+tgdoGCr G4uR30BAOWSEpwwTiTB7XMc65CBv6wlwWoLN87f2VgNYZyQWEuJuOJebvNmiISLqM/Cw 2E2A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=PuashXyE; 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-30309-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30309-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x3-20020a654143000000b005c5e2488c32si1589975pgp.405.2024.01.18.07.55.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 07:55:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-30309-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=PuashXyE; 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-30309-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30309-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 63D93282BF0 for ; Thu, 18 Jan 2024 15:55:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 470972D04F; Thu, 18 Jan 2024 15:53:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="PuashXyE" 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 7FFA82942C; Thu, 18 Jan 2024 15:53:14 +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=1705593196; cv=none; b=PBn8exUHlgf+4gOGgksJFIgdJAuw1/2k+scU4r1JKEITX8x/2zZ4LZBHj3W3yA2rw4GXVdjEYDMQtiiegv1vsYFYYQXBc+nk245sTVnhYtCoSuO+YP1xHDeSX5SzEkepg4lH4je7VRfCG7R4nn7q8OgneLTmKx/B67qNA/eblQM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705593196; c=relaxed/simple; bh=oa5sejmaTh9U90I2mSDvC4U+biGVOnXDlP5i08xONzc=; 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=e3Tg5XTrY22CQQ3TfXEuCSKkwh9+eOirscPr5HIQ/HeeuuwqrFdinOxeuHK7syC/01SZILSNrBnjXYXx4C73fjMagUvCfNDVPMU0Vwqt86sNhIKv7/X/G5nQDpPB+LJ/3FkpXmd8Ofg6Y3PmE1GYM0c/2oxo+DpPVh71w7sl/QE= 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=PuashXyE; 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 E61CA40011; Thu, 18 Jan 2024 15:53:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1705593187; 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=kCu7pbyVCXYyBTkd+j43VhZPPnMfAyc4JbkgYZulLro=; b=PuashXyEi5c0KXOkf1IkbASzJtLtOHaa5cC1qzpY70IcFrJjC+313JcuudzerKoOfGynRs LAwmuuqQXLVPGF7X/GcoDjYT4ipwheFmgVl+O2pf9Q9xsbVMb7bgP5dfChtKrsSw2Hx6mN 0l6dpGpVfdQjiJ1hPRGUBRTOXsfLQP2l+Qr236GTSiAR1KrnBF0b//GGxIS3G4/JrdP8ac ghirlbucMOwfD3Gz6lthlHuuJXLgRJpUFNn1jLpKnXmBTVDzMOD/brg1Fx1+0jYyLUx8hY 5MPygr1n2KjzJxSRKWG89MukgDyZ4jYnCfBYmUIBAl71Gkjgju4TaSoqTJCcRQ== 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 , Vladimir Kondratiev , Gregory CLEMENT Subject: [PATCH v6 02/15] MIPS: Fix set_uncached_handler for ebase in XKPHYS Date: Thu, 18 Jan 2024 16:52:31 +0100 Message-ID: <20240118155252.397947-3-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: 1788444204291829089 X-GMAIL-MSGID: 1788444204291829089 From: Jiaxun Yang ebase might reside in XKPHYS if memblock is unable to allocate memory within the KSEG0 physical range. To map EBASE into uncached space, we convert it back to its physical address and utilize the new CKSEG1ADDR_OR_64BIT helper for mapping. Co-developed-by: Vladimir Kondratiev Signed-off-by: Vladimir Kondratiev Co-developed-by: Gregory CLEMENT Signed-off-by: Jiaxun Yang Signed-off-by: Gregory CLEMENT --- arch/mips/kernel/traps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 0e3f2f2fa732b..355d0f0709de8 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -2295,7 +2295,7 @@ static const char panic_null_cerr[] = void set_uncached_handler(unsigned long offset, void *addr, unsigned long size) { - unsigned long uncached_ebase = CKSEG1ADDR(ebase); + unsigned long uncached_ebase = CKSEG1ADDR_OR_64BIT(__pa(ebase)); if (!addr) panic(panic_null_cerr);