From patchwork Mon Feb 5 15:34:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 196865 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp953694dyb; Mon, 5 Feb 2024 07:36:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IFjHhmgVVXKT1kqReAyv40shJ+17i7cF8RMNbco2TiO2UBgMFitgUPmMk9QvVcF89SrGzKz X-Received: by 2002:a05:620a:158f:b0:783:f827:124 with SMTP id d15-20020a05620a158f00b00783f8270124mr12886630qkk.78.1707147380232; Mon, 05 Feb 2024 07:36:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707147380; cv=pass; d=google.com; s=arc-20160816; b=BeIDfzSptBqDPY9UR574RZcn7/S3hSKHB7LL/4KTk9AzxkRiRo2kvQlB1JNje2Hs16 1Yy11jPK8bMAA4+pEmwdSAkgXkQIC8A0Ep0vl862qoDJ51B/k40vkQcX+qYdGh5vcX4P KffNWB8ikc0uipbse/JXnZAlnn3CUeJ4IjeGJNct1a2kU5P1qANbLobnDyXblW9NlUE/ MWpXezA0XUQ/0BjnSQ1R+q0jDcsWJSqOlq35gtvWun2p0HxAXINcug9iOzw/l6PDjD2Y c7IXr8mnspZVYBzRyljaxNADVJ4RYVknwOnk2gAiIbnG5O0mTnwVibGjjNPuR5/Lp6xP LQhw== 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=RBDTGtqaqBT/M5/8NTG5B7VPnqyFJLT82daVWAYAGxA=; b=CqQkQjvh/wBHVQ2nA07pmzTZ1XmkbD3au6fq71pIGOgymnPRBC/0qH3B7eTMApDK80 kfly9CLdamOAY8l4hCUydFnQ9WuSIOVfxVJ9fWyFZnAv8shW0LKFRAOFQkVtB1GRRYPz Elv/r9K+ZOIGn92rb9QECF5hhOS9QJhV4FzhIqqd9xx/3D5RQ16Pgrd3BrSuqzJ1mcl3 WDgLdsYZd4DdLtgtx+IcB9ifuDRkpTDCKpA3SRNvR6kulOkG1b6cQJzAPUkVTs888ePa XwH9yHEMeKuGrzNmTJZaUO98wmAGfTWbofy7ezaOVuSHsCzIX+I1lvrOE2mXqSs1NLFA /+uA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=PbRjKJGe; 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-52924-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52924-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com X-Forwarded-Encrypted: i=1; AJvYcCVxPEXinoLo2/z+WhGxLncZLFatdQ2nACLuwLJdbM3mmLq7EYfKuqw2x8gToZTDSYzx3M4wdQYNTXRic6QUxSA4JouBGQ== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id t7-20020a05620a450700b007855370603bsi62665qkp.596.2024.02.05.07.36.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 07:36:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52924-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=PbRjKJGe; 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-52924-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52924-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 6F4551C2224A for ; Mon, 5 Feb 2024 15:36:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A5A6A3A1A0; Mon, 5 Feb 2024 15:35:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="PbRjKJGe" Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) (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 82A2F2E634; Mon, 5 Feb 2024 15:35:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707147313; cv=none; b=In7HNgu9BS84Ct5AgkRoRaOhBPr245rlZz/rRtGDXoWYmICvBKqe6JJBPnFe3PiR4HTNTXC4SucjcAbBWCw2/GB90Le9qfqLabOjRceP3p6Rws/pEoy+nhNIuPxYyrQRB/efTsTgylL2w57CIDtfbj77zKwVPXshQMVyWRbCN+Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707147313; c=relaxed/simple; bh=oa5sejmaTh9U90I2mSDvC4U+biGVOnXDlP5i08xONzc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RUVhpcumZkndubKJB/fMQtCA78wenLDdeEGNw7OIDdGD3y1agq9184wjZwt+gnlV/6I25pM1KqRz1E+liak4GKgbrMotZjqLuIWMPiSf6n7F3x1f1Xzcdjp/KEGRAGk+dKPV05GWqLtmUOUqHjFQ90MuIYcAqB51W4GuIpx1214= 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=PbRjKJGe; arc=none smtp.client-ip=217.70.183.201 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 064CA1BF208; Mon, 5 Feb 2024 15:35:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1707147308; 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=PbRjKJGe20Wre3g36e4elqWGh2SQLjS5H0anTaXoffAmMjTX/ucQLd32l6/nqucNABPa5O sEl7D56VJ2307krtD3AwN99Q1Zpicqt6z4WewCW2FGt1jBZpEHJsLcLuMpFhLTZA3eAGDX RKw29VHd8oAQMuHKeguplFrUpm+y4igmqgaMXM/yS3HBZqOZIdtQVYdRGj3YW454exU5sf vQN27JDxsiY82Cmb9OCg+RyrHXFhWlUT9iYRcLX++UzYwoMEhe5LTwFl0wZ/bXRXTcRSUV S/OVcUjS+ik2QEBpbacoZBlMpP5Sh77jFv97a+AJIc5J7LQsbC1LhuNwHKZDiw== 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 v7 02/14] MIPS: Fix set_uncached_handler for ebase in XKPHYS Date: Mon, 5 Feb 2024 16:34:48 +0100 Message-ID: <20240205153503.574468-3-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240205153503.574468-1-gregory.clement@bootlin.com> References: <20240205153503.574468-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: 1790073771018971201 X-GMAIL-MSGID: 1790073771018971201 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);