Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp695087rdb; Thu, 30 Nov 2023 16:13:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IHPtjy9T1jb7N1UspV/w+e8hAqKzQl6bJ6xbXpjT2ixPjtgN28Clc1vhWtlgg2r+jsrDctW X-Received: by 2002:a05:6358:998a:b0:168:e707:2e56 with SMTP id j10-20020a056358998a00b00168e7072e56mr18934480rwb.16.1701389639275; Thu, 30 Nov 2023 16:13:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701389639; cv=none; d=google.com; s=arc-20160816; b=TSZ7tK4o8CBGkRl7xrYRnRmbCvwn+RBGuVc7NK5hgF7MywCt4er/9bSf4lsEwrywXh 4c3Hs4JlVt0sX0lvnVS6mtqw/Ew6oYrP9Hatdmx5tyxzn6gUCDSdALc9V/bSabpwa8M3 HWuvOQRelAm+XYFNhLE8NB6PWcnjjsNNVB1sS4HAYbYQMy378jDBPpxc++KBw3ywI6s1 iosaSeqCxaIOZsCY6DWfEsSWGOGUxPI8t6CUV4JQG29tevP2HMRMTpM1uFGnisu3CkOK UFheY5DDT//kx2F5Af+vT3JjrAZUsQlHqODJ0cOZgEA1kOv5/PPZqls0brtkhlU5qXgq fcAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:subject:cc:to:from :date:references:in-reply-to:message-id:mime-version:user-agent :feedback-id:dkim-signature:dkim-signature; bh=6hNLsCFhInh22vC2aH0mgObvwR0nMUCdEXPsUGEMxfE=; fh=GtiosRRM9gcEygW4tc5kZXYOacBr92YhFajaYxKj+zk=; b=Y4S+OxkgPSwn+W9nOhTOXJGgOmBO7MvEvSQV+xXlyg4FS80nG1mNKcCKT0eE0Ecna3 E4aFkfemia5Z9StlIXqBymfklch7mJJcnI4Vw6Bd5tni9oHZtLqRFkpdOmFAScFCUEB3 vJWb3MaT4ZJjuJ7Wn9UwrZJ1kKi+M18viLZ8OBe0HDNfjJd/1/4XfTpr3ivxpI/T4NDm pRSqptyU4aXrIrwe+GVwPJzig2UJdocXX1PYsYtMs8ki15/xqbZbeTdnCyaxL5VUDc9Z ZQJ0OAttKB/5oEYHw1q1O9RDQ5GZ5AeNj/itdfb2IR1h/hZAKvWt5PrtmPWAtCNg/P6X HU8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm2 header.b=p4TuFmo2; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=AseeZUAs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id cl14-20020a056a02098e00b005be10674e53si2519515pgb.479.2023.11.30.16.13.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 16:13:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm2 header.b=p4TuFmo2; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=AseeZUAs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 78B5485BF2F2; Thu, 30 Nov 2023 16:13:56 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377384AbjLAANi (ORCPT + 99 others); Thu, 30 Nov 2023 19:13:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235228AbjLAANg (ORCPT ); Thu, 30 Nov 2023 19:13:36 -0500 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72E8110FA; Thu, 30 Nov 2023 16:13:42 -0800 (PST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 7DA245C0114; Thu, 30 Nov 2023 19:13:41 -0500 (EST) Received: from imap44 ([10.202.2.94]) by compute3.internal (MEProxy); Thu, 30 Nov 2023 19:13:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1701389621; x=1701476021; bh=6hNLsCFhInh22vC2aH0mgObvwR0nMUCdEXP sUGEMxfE=; b=p4TuFmo2BFWKo6nUyzd0VhruEGR7APHOVeHa7t90HtYDDkV2GOs WbwD4W+8XGQHFzA6R46rClyZ9uhsApeYU9Bq3qCK8SOAbEH0ByqRIqlcdjEyI9+4 LxyiFamBQFNzRhGxUmy0PggFnSiP6eH0bMoFtnjor0Jxw2KO97FXc0npahB0MDqx wVtXRagjRm3scqpbc//fDJ8vLhjMOfDqJZMpZvh8Osj9a5xJoo4qedI3SECKEzqX yA8wjoIYfNuFwD89mweOxyuhcxV/gxq5W004xEYCe92NUWczdo0+u8adnH67fqgD JuPP/kpRa3we6p4x8IrsfM+zUIO/TXvFjrA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1701389621; x=1701476021; bh=6hNLsCFhInh22vC2aH0mgObvwR0nMUCdEXP sUGEMxfE=; b=AseeZUAspHBmVT0quRu/fmAKonz1GQGNxx9/2hHz/DOFvlD86Tc WSxoaTL/yKw9O64tFfm+I9zOS/vN8FdAwKrKUw4CNwDfJdoBZWldSBgz96c2nGIN vY2YNoLDLYX7w7mlimXfIwhfCCcYIyc/MutJhgQLmFnoPvq2vu6oJ6dKfYFE+SKX ONJVmDmyPtN+tF8DkvxuvUlN1+2G2Fk1UigU4ZYt/r/1kXau4YGaldnbxInqe2sA 31hYutAGc2pxbjhnU1B+qqeUd5UqVwQRv7TtXOj+4rjdH3iyCbdGSzlwgNZMRzis NYnIUgGwy+ZPjKej0V4+3mmgnqVNtNU3NKA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudeikedgvddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtgfesthhqredtreerjeenucfhrhhomhepfdfl ihgrgihunhcujggrnhhgfdcuoehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtoh hmqeenucggtffrrghtthgvrhhnpedufeegfeetudeghefftdehfefgveffleefgfehhfej ueegveethfduuddvieehgfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtohhm X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id DD1A836A0075; Thu, 30 Nov 2023 19:13:39 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-1238-g6cccb1fa34-fm-20231128.002-g6cccb1fa MIME-Version: 1.0 Message-Id: In-Reply-To: References: <245d3985-9085-4be0-8c74-d95d06334584@app.fastmail.com> <3iksuovvsln3cw3xpmjd7f7xixfvwaneu4ok56fnookvyolpco@wrxxew3thgnq> <3pgnihbrp5orh4tmj45fipbfoxdwzjh6uefitdpcea2vgkarcm@d56gv3areswl> <2148a67f-bd4f-432e-aa0d-c914a4bd5e0d@app.fastmail.com> Date: Fri, 01 Dec 2023 00:13:22 +0000 From: "Jiaxun Yang" To: "Serge Semin" Cc: "Thomas Bogendoerfer" , "Arnd Bergmann" , "Andrew Morton" , "Mike Rapoport" , "Matthew Wilcox" , "Tiezhu Yang" , "Huacai Chen" , "Yinglu Yang" , "Alexey Malahov" , "Aleksandar Rikalo" , "Aleksandar Rikalo" , "Dragan Mladjenovic" , "Chao-ying Fu" , "Marc Zyngier" , "linux-mips@vger.kernel.org" , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/7] mips: dmi: Fix early remap on MIPS32 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 howler.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 (howler.vger.email [0.0.0.0]); Thu, 30 Nov 2023 16:13:56 -0800 (PST) =E5=9C=A82023=E5=B9=B411=E6=9C=8830=E6=97=A5=E5=8D=81=E4=B8=80=E6=9C=88 = =E4=B8=8B=E5=8D=887:16=EF=BC=8CSerge Semin=E5=86=99=E9=81=93=EF=BC=9A > On Tue, Nov 28, 2023 at 03:46:37PM +0000, Jiaxun Yang wrote: [...] > >> I'd say the safest option is to use CKSEG0 or TO_CAC here,=20 > > I would have agreed with you if MIPS didn't have that special > _page_cachable_default variable which is undefined for some platforms > and which might be re-defined during the boot-up process, and if > MIPS64 didn't have ioremap_prot() always mapping to the uncached > region. But IMO updating ioremap_prot() currently seems more risky > than just converting dmi_early_remap() to the uncached version > especially seeing it won't change anything. MIPS64 always have IO > remapped to the uncached region. MIPS32 won't be able to have cached > mapping until VM is available, and paging and slabs are initialized. > So on the early MIPS32 bootup stages ioremap_cache() wouldn't have > worked anyway. I really didn't get that, using CKSEG0 on 32bit system and TO_CAC on 64bit system won't hurt. Something like: #ifdef CONFIG_64BIT #define dmi_remap(x, l) (void *)TO_CAC(x) #else #define dmi_remap(x, l) (void *)CKSEG0(x) #endif Can help us avoid all the hassle. Since it always ensures we are using same CCA to access DMI tables. We can always trust Config.K0 left by firmware in this case. You may add some sanity check on 32 bit to avoid generating invalid pointer. (And perhaps implement it as ioremap_early.....)=20 Thanks --=20 - Jiaxun