Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5366423rdb; Wed, 13 Dec 2023 06:52:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IErfcg9bM1HYPGbC6lmzdGPlljDKHJCq+Z2TaNT375JPQ+cB/MfVDjDXt36MxZ5EXT825aV X-Received: by 2002:a05:6a20:daa0:b0:190:37f5:f7da with SMTP id iy32-20020a056a20daa000b0019037f5f7damr4326591pzb.59.1702479134396; Wed, 13 Dec 2023 06:52:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702479134; cv=none; d=google.com; s=arc-20160816; b=x6nNjGYdtFyreUZ305h3v6nl+Hmm7HcrBkHHLW51vgWfw2k1x930P29FPkz8TyCNw2 aPt2+KeXOX78eKCi4OTZOYBpAXL4PoUFA9odQuPwq4bhLrlnin33wYTbEiFZFEHkvHXo LTTuShIFAxbLYoeZHqZ/on07RFayvKO2mf+zUMHCZf+ITbKG1Y3FzCXjozGIf41G+Ipf kVGmNa4aoP40Bz9I+bOPycAFEAm5XolYkUttY1wxlGVRkMIJCYhl6QlL+WqfYc6mVheC 1kcIugH3tKYafD/9c+AYAe0HiuGj1jxE/QGlILm/Yk1gOKkvnxUqm7+diox4ixhGy0qi iaTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=rQVBYi3zUBKWKTpzaaV99yU2Xexf+6T8Zc+CYbDa6N8=; fh=Dxhchp7NF0DUA7FI7KVeniDzkjyix/d7ETvu1rPCCSM=; b=HZMUBXO1PUNh+u/MzPtUnOQUHaFX3p5qvNLqLXgTNjWoaBfgwaeopFcBnqZHpIsQ15 mD7sToOYdrVFjirQIhoUn8/XYu23ELIELZaeMVcvJWhahsW0iVTPEufaM8p+XZAlkbas ZGoWugF4NmuQ58TavVQ85m3pCtAFhdKtWsHCmDxfhTsssRP3SjxAi7oz/M2YrmsyNaea 7LFY3OGTqXe4Yx4dnZNO5GKoYiRLEkrNrZzo6ztdcmoR+ZXa/ZKbYq0Qd0TWB0Tkn9QC aXQrihaoykUmvdBxjEQRdGrW5/U6qaR9cbi4twcsOhj5VmMueZmRaah3BeelnDDvEMeH GNGA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id d14-20020a056a00198e00b006cbbdc31d10si8385605pfl.220.2023.12.13.06.52.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 06:52:14 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id ECEF88070667; Wed, 13 Dec 2023 06:51:34 -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 S1441946AbjLMOvU (ORCPT + 99 others); Wed, 13 Dec 2023 09:51:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1441937AbjLMOvS (ORCPT ); Wed, 13 Dec 2023 09:51:18 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B518DB9; Wed, 13 Dec 2023 06:51:23 -0800 (PST) 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 65AAEC15; Wed, 13 Dec 2023 06:52:09 -0800 (PST) Received: from raptor (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5CAFA3F738; Wed, 13 Dec 2023 06:51:18 -0800 (PST) Date: Wed, 13 Dec 2023 14:51:11 +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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,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]); Wed, 13 Dec 2023 06:51:35 -0800 (PST) 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"? 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). 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. Is there something that you feel that is not clear enough? I am more than happy to go into details. Thanks, Alex