Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp233442rdb; Thu, 21 Dec 2023 07:45:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IFKr+vD7T+4+EuaC8KxVneaLVYbJ7S+1kZZ2lq/+oYi1EmwQLsBPAx/3nq3DbAdvm9kod6p X-Received: by 2002:a05:6e02:1c0d:b0:35f:af72:1d9b with SMTP id l13-20020a056e021c0d00b0035faf721d9bmr9729173ilh.127.1703173522109; Thu, 21 Dec 2023 07:45:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703173522; cv=none; d=google.com; s=arc-20160816; b=myLiBlCENubRC1lbh1+NTtSRXEqVueU3OnIEr6NCvWoJhlJRAaGo15kSRzQERzCIa+ 0IGxY7BzFUoiWwfLGy098Wz2qg+29R4aIgOxoGAQMduEYWWd9sRTlhgLZFrqJ/8nMTpp phklUqJhW+Ie7EsrU9PEed0PZSi25CAP7YZXfkWQjpjTTVMiGgWfcNALpFTS54fskUFw 6XVUOXzlFtpjYFE5Z9PQs6x/0KtFFObzJdFhPZISllxvdhq1FhUluTKXPxuUNIIx+6Np knzqqyorzpYDk5SSCZBU3b+ZwBqbSc6m7yQXRIni6voiqTovPA1BfRMZFdt3WXJNbsw+ R2pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=kuo4iKGUc1KQFaBXVZ+DLhTK5NNADvC821iTCwAHJEk=; fh=osVu7nxqSV0Dm5sEHWN74Vi3u7YTtAzK49lonxRMdYI=; b=lKJ4APFLdg1xeSjA4DUZKjS07NNSfU/pYK4n+3NEbqeaBUScJt2VKFikdoUwf1PWqo LmNPcN8kulPY1hrqoS4QBVBrCOtw76rmzPJ6oUUoKm7whECc2waua2gH/e2FR29Hkxke Tj/EEWgxPCJsq1/AO5BVSJqZ4z3REAoA2eU3NROphpBfny65L+2peGulC5ZAP1O2FL1+ jGn2PBiKdL0SDJiHXXZCxJn8j72v7qF9PoMZLYhLnJM26MHZYJJPRdUwpEVTPhorCzis knCBgBIF7se2giwOK5i4ASAQTASUohMjRlFQ5Z9NpIUHZVMLzMN+398zBvysR4vc99i3 bP2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-8695-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8695-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id c34-20020a630d22000000b005b8a295f016si1807324pgl.64.2023.12.21.07.45.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 07:45:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8695-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-8695-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8695-linux.lists.archive=gmail.com@vger.kernel.org" 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 08593281EC2 for ; Thu, 21 Dec 2023 15:45:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2DAA7627E0; Thu, 21 Dec 2023 15:42:51 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from elvis.franken.de (elvis.franken.de [193.175.24.41]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 21BDD55E5F; Thu, 21 Dec 2023 15:42:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alpha.franken.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alpha.franken.de Received: from uucp by elvis.franken.de with local-rmail (Exim 3.36 #1) id 1rGLC9-0002qk-00; Thu, 21 Dec 2023 16:42:45 +0100 Received: by alpha.franken.de (Postfix, from userid 1000) id E556EC028A; Thu, 21 Dec 2023 16:42:30 +0100 (CET) Date: Thu, 21 Dec 2023 16:42:30 +0100 From: Thomas Bogendoerfer To: Jiaxun Yang Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, gregory.clement@bootlin.com, vladimir.kondratiev@intel.com Subject: Re: [PATCH v2 02/10] MIPS: spaces: Define a couple of handy macros Message-ID: References: <20231027221106.405666-1-jiaxun.yang@flygoat.com> <20231027221106.405666-3-jiaxun.yang@flygoat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231027221106.405666-3-jiaxun.yang@flygoat.com> On Fri, Oct 27, 2023 at 11:10:58PM +0100, Jiaxun Yang wrote: > KSEGX_SIZE is defined to size of each KSEG segment. > > TO_CAC and TO_UNCAC are brought to 32bit builds as well, > TO_PHYS remains to be 64bit only as we want people to > use __pa to avoid mixup compat address space. the problem here is, that in the 64bit case the macros work on every address while in 32bit only the first 512MB address space is covered. So there is a reason to not expose TO_CAC/TO_UNCAC for 32bit. Which leaves the problem how to handle all the CKSEG[01]ADDR() cases nicer for 64bit... I'd prefer an extra macro/inline function which handles 32bit and 64bit accordingly. Not sure about the name for it, but maybe something like CKSEG[01]ADDR_OR_64BIT() That would at least make clear (to me) this thing is special and might return a XPHYS uncached address. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]