From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 037F5C4332F for ; Wed, 13 Dec 2023 17:44:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7E6B88D004C; Wed, 13 Dec 2023 12:44:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 795B48D0049; Wed, 13 Dec 2023 12:44:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 65D208D004C; Wed, 13 Dec 2023 12:44:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 533888D0049 for ; Wed, 13 Dec 2023 12:44:57 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 20C14A1152 for ; Wed, 13 Dec 2023 17:44:57 +0000 (UTC) X-FDA: 81562520634.08.975AB88 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf07.hostedemail.com (Postfix) with ESMTP id 6131540021 for ; Wed, 13 Dec 2023 17:44:54 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf07.hostedemail.com: domain of alexandru.elisei@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=alexandru.elisei@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1702489494; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WNIN1VfvADC8DO06/MCsIct8cmMSHkN7HmY76xZfJPU=; b=66hyaZEPbzclJ5Z0DiqPUUy96QbYD4LfbXyfyIR9Nwy9LiNiGh5kqwCsae00F/3sLCdOko mSzc40oAUZ1qji2K4V5FpJEcCiEjGSo0YLRMUg5P1OZxUIvs0xUnhVTS289i7v2OyG/PI5 eYDaz2ZKVGGtdoEAYyy97BSlZNXaPxw= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf07.hostedemail.com: domain of alexandru.elisei@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=alexandru.elisei@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1702489494; a=rsa-sha256; cv=none; b=hiD4WRUfDPLXaKBGtdq0Y+wE5wuNAS1Mk8T+9nPH32B1kMJcGp743BC/1p319LPWq6GohZ 5I/NWbtC9aK0jbFvYtnFTTBWmmAWoy0CprP04znZVbmVGuS+260Pv6mUuH9IyPg36jrLS2 Ybyptcd/4jaW9OwVUWxYdfg6LCdoa5E= Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4703EC15; Wed, 13 Dec 2023 09:45:39 -0800 (PST) Received: from raptor (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 37DBF3F762; Wed, 13 Dec 2023 09:44:48 -0800 (PST) Date: Wed, 13 Dec 2023 17:44:37 +0000 From: Alexandru Elisei To: Rob Herring Cc: catalin.marinas@arm.com, will@kernel.org, oliver.upton@linux.dev, maz@kernel.org, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, arnd@arndb.de, akpm@linux-foundation.org, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, mhiramat@kernel.org, rppt@kernel.org, hughd@google.com, pcc@google.com, steven.price@arm.com, anshuman.khandual@arm.com, vincenzo.frascino@arm.com, david@redhat.com, eugenis@google.com, kcc@google.com, hyesoo.yu@samsung.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-trace-kernel@vger.kernel.org Subject: Re: [PATCH RFC v2 11/27] arm64: mte: Reserve tag storage memory Message-ID: References: <20231119165721.9849-1-alexandru.elisei@arm.com> <20231119165721.9849-12-alexandru.elisei@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspamd-Queue-Id: 6131540021 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: tz5z5amrtxdrc95xsbqqfhiqurh947br X-HE-Tag: 1702489494-453799 X-HE-Meta: U2FsdGVkX18uo0W+kW6xrdKyg89Og+RLn+B4fKzcwrndHH0Ex40QxVFXK5uwaQcJFVzYMkn8sZOpN3b5ii+DYX5Ke4C/WB4gebXzyPSMCp29eartsZkIfu9d8N4t6+wGFxNzuI2oNCjDQQ/OZcApTyeuf9dGpZhzym1t8JZpMpcP5tfUKG2OM7n3Jw5m8kVA3gSOjCQYnF36ryKC5A0s/4O6MpgsU+X461ItpsgATiISKjdbZOlFGyMF9nh6QJH5UbGaC1g7wLHwgye5GOs1hCHZBeIwSqde3jXAAuIKcSmqFJ9+eihex1KnuyjMOnOYd0jqIKM9O2VULbnPXekV0tWlCxv8C7X1PERfRi9/3JrAViTWnIHMTNGtuIu3qehcON/E67wFsPsmPZPne0bULh28f4kZq9OmDDEtKk6UqHiekJ3AtYEloj2UbJ3x3fRgeVW2kytQggw+boTX7YvOlCtBl+JW9WCadb3+7MXrEeK3WraEF4iQ4eiGd7jxx3lrBV2hozLLY/5k7REV/Lsts19BvFZQbcC1xOcSHk05IS09bX9g2eS+K3bhQ8SRmQkpApJUU44lX6EFZ8m9gzMgnPeN9S/++bSN2AJiDpNy8U4FlNsW6+E8kdxrvjkcNde9w7C9ZV9/iy1tRNSK5k1QtxwI54IEdLfyeQgOvsp7QiDw/PpBf8VeymXVnD752I2KSek+DmArhcwUQ1lD6nfA42Zr80K4Fi1w5nZuB7psZY1hLL/g0qKNPciWi1yHcpJH2OP7UbYN2VVAj0yRcv3A/yg4iEEusbbyvtamKflTlOale8KuXsXPFh8DeUA6cq5JMijYonJw6hQu8abNy7e9MoZ5ZJ0eGxgDJXctwPW8VxjXF40Dw/xfYZxdm0jR6Xr152fyqCDHxyQxM87D1C7UHaY0YIv0jtyo8+XCO71jjzWFBcUoK6EuH5KsG4pgS1SzXWqaaqmx2NVgipROC+2 3+i/6nBr gH5A4n3xmPMGl7UljokRFd33+4bZNA5TPtP85oMJMpILse3mUMdzkMRk2l5Javq2r5xkDmaHjbvryWETl8gAlWjLBgHlCDjbZgvDjzNEeAj2w1vIYj19ozf65Sgp5kMv0DxBnLh+Xv/jCZV9MPNrKhdnnHomLZpPlC5af X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Wed, Dec 13, 2023 at 11:22:17AM -0600, Rob Herring wrote: > On Wed, Dec 13, 2023 at 8:51 AM Alexandru Elisei > wrote: > > > > Hi, > > > > On Wed, Dec 13, 2023 at 08:06:44AM -0600, Rob Herring wrote: > > > On Wed, Dec 13, 2023 at 7:05 AM Alexandru Elisei > > > wrote: > > > > > > > > Hi Rob, > > > > > > > > On Tue, Dec 12, 2023 at 12:44:06PM -0600, Rob Herring wrote: > > > > > On Tue, Dec 12, 2023 at 10:38 AM Alexandru Elisei > > > > > wrote: > > > > > > > > > > > > Hi Rob, > > > > > > > > > > > > Thank you so much for the feedback, I'm not very familiar with device tree, > > > > > > and any comments are very useful. > > > > > > > > > > > > On Mon, Dec 11, 2023 at 11:29:40AM -0600, Rob Herring wrote: > > > > > > > On Sun, Nov 19, 2023 at 10:59 AM Alexandru Elisei > > > > > > > wrote: > > > > > > > > > > > > > > > > Allow the kernel to get the size and location of the MTE tag storage > > > > > > > > regions from the DTB. This memory is marked as reserved for now. > > > > > > > > > > > > > > > > The DTB node for the tag storage region is defined as: > > > > > > > > > > > > > > > > tags0: tag-storage@8f8000000 { > > > > > > > > compatible = "arm,mte-tag-storage"; > > > > > > > > reg = <0x08 0xf8000000 0x00 0x4000000>; > > > > > > > > block-size = <0x1000>; > > > > > > > > memory = <&memory0>; // Associated tagged memory node > > > > > > > > }; > > > > > > > > > > > > > > I skimmed thru the discussion some. If this memory range is within > > > > > > > main RAM, then it definitely belongs in /reserved-memory. > > > > > > > > > > > > Ok, will do that. > > > > > > > > > > > > If you don't mind, why do you say that it definitely belongs in > > > > > > reserved-memory? I'm not trying to argue otherwise, I'm curious about the > > > > > > motivation. > > > > > > > > > > Simply so that /memory nodes describe all possible memory and > > > > > /reserved-memory is just adding restrictions. It's also because > > > > > /reserved-memory is what gets handled early, and we don't need > > > > > multiple things to handle early. > > > > > > > > > > > Tag storage is not DMA and can live anywhere in memory. > > > > > > > > > > Then why put it in DT at all? The only reason CMA is there is to set > > > > > the size. It's not even clear to me we need CMA in DT either. The > > > > > reasoning long ago was the kernel didn't do a good job of moving and > > > > > reclaiming contiguous space, but that's supposed to be better now (and > > > > > most h/w figured out they need IOMMUs). > > > > > > > > > > But for tag storage you know the size as it is a function of the > > > > > memory size, right? After all, you are validating the size is correct. > > > > > I guess there is still the aspect of whether you want enable MTE or > > > > > not which could be done in a variety of ways. > > > > > > > > Oh, sorry, my bad, I should have been clearer about this. I don't want to > > > > put it in the DT as a "linux,cma" node. But I want it to be managed by CMA. > > > > > > Yes, I understand, but my point remains. Why do you need this in DT? > > > If the location doesn't matter and you can calculate the size from the > > > memory size, what else is there to add to the DT? > > > > I am afraid there has been a misunderstanding. What do you mean by > > "location doesn't matter"? > > You said: > > Tag storage is not DMA and can live anywhere in memory. > > Which I took as the kernel can figure out where to put it. But maybe > you meant the h/w platform can hard code it to be anywhere in memory? > If so, then yes, DT is needed. Ah, I see, sorry for not being clear enough, you are correct: tag storage is a hardware property, and software needs a mechanism (in this case, the dt) to discover its properties. > > > At the very least, Linux needs to know the address and size of a memory > > region to use it. The series is about using the tag storage memory for > > data. Tag storage cannot be described as a regular memory node because it > > cannot be tagged (and normal memory can). > > If the tag storage lives in the middle of memory, then it would be > described in the memory node, but removed by being in reserved-memory > node. I don't follow. Would you mind going into more details? > > > Then there's the matter of the tag storage block size (explained in this > > commit message), and also knowing the memory range for which a tag storage > > region stores the tags. This is explained in the cover letter. > > Honestly, I just forgot about that part. I totally understand, there are a lot of things to consider at the same time. Thanks, Alex