Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp954572rdb; Fri, 1 Dec 2023 03:17:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IHw7xuldio3XLJgiV7SEKxvoOhtDFkoSjR1hb0r4HxqSKJVHZKDVO2RbfthgWPnn3i7/gzl X-Received: by 2002:a05:6a20:9698:b0:18b:4dc2:a4e1 with SMTP id hp24-20020a056a20969800b0018b4dc2a4e1mr22602748pzc.55.1701429425509; Fri, 01 Dec 2023 03:17:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701429425; cv=none; d=google.com; s=arc-20160816; b=Oa+8PBCCabDWH5W7Z4XKliKtY8Gmzu/VzWCzV4ERRC4i9Y6QiVSVm9cRdYsh7dp7oU hxihPh+GMiYAwWeVexV2AWJ/zijOdyVuQVfQb4YQgNBIHZvMAwdt/IrAIuyIDxzLvJpG 7Bo8Kg/573G2SWD6AHnuPkegIfziEoe5P8q0P+Oeu+o6JFNf8045bzTC1UJF0ld4Wg6i lVbTcV1oJb/rlPNSZNRz1jj+IxxHVBvCKSsqSyElaKQ7PKTFO1VJAdw83MCVQD9bEqEV 36GhLA4rpT4TeGRsXY11SnS4hthzsvfkDW5rTHIjzkBnkcYoW6HjGSvazjrsnIk5bN/J 8TXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=p5Y4+QQx6IQCL0sfRkqEobRfltIrsUFlmPw44Fo9wsE=; fh=MwmhOnPCNEKQUh9CETmL1NjqsCe+66NMqSNy76XJ1mw=; b=psZABNA1v9F7byb1Wgrk9NtGoOP35VgPmZcSrFBCWV5/XNAlW+MSQl0WdumFvLyvib xsos8ZvWj92DBMBXYnPvbxb/vkulFHPyBRAk1AmjZ5z6H4YOZt1Bel20CJN8csK6tNdW inxdzv6p0qNKO49pPxqZJYGaLsoHmmWa3RRNRqtXUeyxuQfjMFBXZgUGX6gEAij3Tzgj vPHVpvMHE/8Os+xxuyFNIkWDVWMTb1ypCKBOxJMiEkq5VPT2K7rZxS1esiHZsPp5Rq/v 8V5NJb8iB8efuHW7mYleIOXHWL0JdsGuyU9mpgAMGqv4nvBXgHQlEPqEIRSxVh30lOUp bi+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=hk1EPBxx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id l2-20020a17090a72c200b00286579af121si1136917pjk.94.2023.12.01.03.16.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 03:17:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=hk1EPBxx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id B620780BEDF6; Fri, 1 Dec 2023 03:16:46 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378685AbjLALPv (ORCPT + 99 others); Fri, 1 Dec 2023 06:15:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378515AbjLALPY (ORCPT ); Fri, 1 Dec 2023 06:15:24 -0500 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E6AC10FC; Fri, 1 Dec 2023 03:15:28 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id EB6E024000A; Fri, 1 Dec 2023 11:15:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1701429326; 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=p5Y4+QQx6IQCL0sfRkqEobRfltIrsUFlmPw44Fo9wsE=; b=hk1EPBxxfDuPRzao8dYSg9XjL+82XECa5mha/s8D7odiVcFQjquvJ3U14VjT49wpLmmkv3 /feO+rjiGPq54X/fc0IrKYMitvllF6vnYmb1uoOJJqFSZBLMpsOzmQkme/VJMT/KYIgVsm D7KHq2QfS/qZQtRMBKO3IjIa57GYXjhzjEdHAPGi7Thn4IUmxDA6gxtnyhag0QNfQg/9GE f7ztQY5GnLgI0PClHxacQC9T2aqqNxl9+XrWbelK5Hi14PZnpSEXl2XFjZxpwTrYTJ0Qqu dg/wcjEtjn41Jz4Olzu9g+6mCvrGS2FD/1sQc/NUoOVFpcl0sBY3QlOJJGxTCQ== 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=20Lebrun?= , Thomas Petazzoni , Vladimir Kondratiev , Gregory CLEMENT Subject: [PATCH v3 05/22] MIPS: Fix set_uncached_handler for ebase in XKPHYS Date: Fri, 1 Dec 2023 12:14:48 +0100 Message-ID: <20231201111512.803120-6-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231201111512.803120-1-gregory.clement@bootlin.com> References: <20231201111512.803120-1-gregory.clement@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: gregory.clement@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 01 Dec 2023 03:16:47 -0800 (PST) From: Jiaxun Yang ebase may be in XKPHYS if memblock unable to allocate memory within KSEG0 physical range. To map ebase into uncached space we just convert it back to physical address and then use platform's TO_UNCAC helper to create 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 60c513c51684f..230728d76d11f 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -2346,7 +2346,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 = TO_UNCAC(__pa(ebase)); if (!addr) panic(panic_null_cerr); -- 2.42.0