Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4761025rdb; Tue, 12 Dec 2023 08:36:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IESumW8vk3bqSenzdbFs5ElZtf8WD8kw9hiA/UlBU/PxNQEb3hFMBIfxLNfIT3UvEm+G+cW X-Received: by 2002:a17:902:784a:b0:1d0:4778:fb3f with SMTP id e10-20020a170902784a00b001d04778fb3fmr2517014pln.32.1702398961611; Tue, 12 Dec 2023 08:36:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702398961; cv=none; d=google.com; s=arc-20160816; b=wI9btBeHCyEKUM16rh5XOsUE5nyFCz8Vx9i6BoNOmnfqm+CRNfIoHSZ29L+Q+spOeK e2v00XQCKsjeSZqy5MTAtLbhGdBaTqSUPLY6uAZkFzreO9m7Ldq93tD0r3dsMAUjt6V6 g/U+Ur6taiQsVHYbg7DwX2p9ytQkwBwBPq8ju4A/WEhPfSY0ZxUFqS/pPnoLcJhu/mNg IzXqyXB+tDBkPgVO4p8m1aMYpk/kByY/AOO0FHl8YJTI8pSRFl3xh0+qj6YdJW18L6G7 OjiNxdI6r6KDrdOrn8Aqy597j/34VH0qjpX5kt7XdmVCur3HwrSv0hU3f44CiNsEUUH4 SGkw== 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=D5cCBpjLVQJIEyNHt7kbmGhJLdSXgsITn2458HFNHoY=; fh=MwmhOnPCNEKQUh9CETmL1NjqsCe+66NMqSNy76XJ1mw=; b=fW9d2VVMHiOOLVtbWSovkF6SrIz7Tt9gSQfgQu0CX6t6wgU8Pp4BaNKmyQ3Ure7zds sMLpP/DgVHbzujuF++FXru6zATqc5HOxdcQ0dZ3WqeZCAOFRfQ0ASrI+jWJrf3oRsG2l bDn0Qr522GH9MD8ZvHvuzX+9UxYgwtdl7soZ7yipPCD8oxAMqXS0MNtxJQkJgv6e1D2G lRdMshZLvWwt/9yzC/lMKHu5oD+suwFNUGDmMKMj0yBLjnJKtxUF2N7bv0bOwwBuzHnN 5LHOUXSvnzy5zR0z0kpVGgZ4/qi3CHhl4VTalxpsKCWwrEyRCR9q2EUMozzuZZun+NAu aX6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Ch3z9zB4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id c18-20020a170903235200b001cffdccdecdsi8288305plh.135.2023.12.12.08.36.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 08:36:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Ch3z9zB4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 9460680755CF; Tue, 12 Dec 2023 08:36:00 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232917AbjLLQft (ORCPT + 99 others); Tue, 12 Dec 2023 11:35:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232779AbjLLQfZ (ORCPT ); Tue, 12 Dec 2023 11:35:25 -0500 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF4BA110; Tue, 12 Dec 2023 08:35:30 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 48ED3E0003; Tue, 12 Dec 2023 16:35:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1702398929; 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=D5cCBpjLVQJIEyNHt7kbmGhJLdSXgsITn2458HFNHoY=; b=Ch3z9zB4RfHk6MKx0YDBteFeS7lmL3PQi6ptvM+2yfXzfwg0lvT/drOiiKQG0bjH5mLVpa cys/hkO9rn4Qc6k7GtEsdRdJYEhLHFJ2rTGnrgfdPvs+Gyq36bHYt5agBmyZNF69bhjXH4 Tg5Q5rupmYUy2pYZFtNYVdfyfhQkY/nEQZDWUDI6cT0E6tcmMgnLMIPETXHXN8POQa45N9 CSpu5Rgeg7C5oY2hOjUNYEIdQPRGv3pAGWHY0JIgl3Z1Cb54g/M+gxUpdc6H6rBqxlH7YB uiLGgwb8fDhiw+GEJovOacpEiIf+ABroJmV+BuEW5TuVLISbzEpluTBqFbELkw== 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 v5 05/22] MIPS: Fix set_uncached_handler for ebase in XKPHYS Date: Tue, 12 Dec 2023 17:34:37 +0100 Message-ID: <20231212163459.1923041-6-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231212163459.1923041-1-gregory.clement@bootlin.com> References: <20231212163459.1923041-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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Tue, 12 Dec 2023 08:36:00 -0800 (PST) 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 platform's TO_UNCAC 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 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