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: 13522988 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="PuashXyE" 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-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-Sasl: gregory.clement@bootlin.com 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);