Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5337435rdb; Wed, 13 Dec 2023 06:07:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IGLMAVCOMAr3n0VAc5kXuwSWwbPmfm0c62qcwJWd4CTu7N/gJbMYspCyXazKYho3IqauOcd X-Received: by 2002:a05:6a20:4a27:b0:190:ea14:8cac with SMTP id fr39-20020a056a204a2700b00190ea148cacmr5303069pzb.54.1702476447857; Wed, 13 Dec 2023 06:07:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702476447; cv=none; d=google.com; s=arc-20160816; b=CGZmhGq6DIYkzWVYYzHoy+Bk6/UJ1bSjsd/QuwL65D6Oln+wRUbakmU15PdzMpRubg fegq2G51ZlXt7SoTa8wGyR+H/bvHSGqHF9b85ShA6op7mkfdbe19NP1StwnZqFkgTwWX PcZQwdCnjuibQo2YzbiGDEJRWNMafsCIcG0Zg+xRSytWmSGMSCVpgQYnXqSy3qclDu3D gCO7v7jwsAOzGLFmtFoq05ttg7ZCB/ZgXLa+VpiyLcCgJQQPmnxGkj8LQ7X5NNhqgKj3 cRKuwIk7AjTqeNgY+SIOk+LqotOSzIQlCz8n5oaGRpsKBsOPpBzuvuOJLnAlc+nNtKC3 Iojg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=VRnEygp4Q7lGFh/1IoyfjULOkzXzuZvuh8JNhE/Dx5g=; fh=Ec5RhzHTMEEKj/X/gkLEoXglicTn4H/vwymGVTsgQvw=; b=TIAwpmBYTlSl46pSb8Fildda4zO/Lyp3FUULSPAT4ZS0f+dxvfXcopkfcsOZuSTzBP TuiU+xVV94NxX1pe/OBj49jjjksIuUVigWWl/rlRgjVO0C1peXnXlTpqTuQynKjODR/r FuDlzAssc5FaGrMKFgD525SxpCRxMa3YeGEMubmfBZnIQASPA6J5JRsMIF34nh8j279M sYeI5KPTBFxORHc1G6gjgtcwaP9WwBhiSSVH/PCGO68C5bu5/0HjC7YSMrQ66/hTvc9+ YCH8Gq2mjpgTkn/lOGOEvA62DbTB0gcPT+LXhZjR9iNqVW8lJmLn8mRpH6TUWK+dwfgF Ynxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c9zQEcvQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id z8-20020a6552c8000000b005c612569dbcsi9230616pgp.457.2023.12.13.06.07.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 06:07:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c9zQEcvQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 44AE980A07D9; Wed, 13 Dec 2023 06:07:15 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233631AbjLMOHA (ORCPT + 99 others); Wed, 13 Dec 2023 09:07:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1441830AbjLMOG5 (ORCPT ); Wed, 13 Dec 2023 09:06:57 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CC6CE3 for ; Wed, 13 Dec 2023 06:06:59 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EFC2AC433CA; Wed, 13 Dec 2023 14:06:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702476419; bh=tm2PI5P6o9KPIR9RVFv5cihdxeSVXN3uEt/yiTzKpe0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=c9zQEcvQ/I/2TrO3daFju8Q2xvsVxymZ1J7YViFzMZ22+GvhKczCBu8rrJUDo+TO1 Anc8NUN4dA8ow4LVobcs6qb1jWphf9bw+jELBUPJqudNn/xWmkIMxcrIKvu8XEBcOa WGHuZ4mBaB1rMvlvIqSSVkfP8pw0u8oJznFFXHh/0RHC1S6PyvN8OnGfzj5MLKjOEg HySg5HD2tSeAL5m4LdWat8MD42qViAcfpBu0xgVl4Hr5NLzfEv0Y0pYxVLkLYlhamB Yq4b1VHB5b6j9M45TKb0UiSQxQhkgwHVuLjWoh+MIYvXWbVA5RP95pk6+8WdFm9kYM Og9EiU/75zGdQ== Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-50c0f13ea11so7992931e87.3; Wed, 13 Dec 2023 06:06:58 -0800 (PST) X-Gm-Message-State: AOJu0YxucbavZ/Qjy1Vb5DUJJ0bNooCEMlRyYWncESP3UVIaMT1itJwG eoFJ3D54/QAFW0wqvhMXjfTn4/wgZTTOcI9qkw== X-Received: by 2002:a19:8c5b:0:b0:50d:1733:ceba with SMTP id i27-20020a198c5b000000b0050d1733cebamr3208254lfj.58.1702476417164; Wed, 13 Dec 2023 06:06:57 -0800 (PST) MIME-Version: 1.0 References: <20231119165721.9849-1-alexandru.elisei@arm.com> <20231119165721.9849-12-alexandru.elisei@arm.com> In-Reply-To: From: Rob Herring Date: Wed, 13 Dec 2023 08:06:44 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH RFC v2 11/27] arm64: mte: Reserve tag storage memory To: Alexandru Elisei 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 agentk.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 (agentk.vger.email [0.0.0.0]); Wed, 13 Dec 2023 06:07:15 -0800 (PST) On Wed, Dec 13, 2023 at 7:05=E2=80=AFAM 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=E2=80=AFAM 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=E2=80=AFAM Alexandru Elisei > > > > wrote: > > > > > > > > > > Allow the kernel to get the size and location of the MTE tag stor= age > > > > > 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 =3D "arm,mte-tag-storage"; > > > > > reg =3D <0x08 0xf8000000 0x00 0x4000000>; > > > > > block-size =3D <0x1000>; > > > > > memory =3D <&memory0>; // Associated tagged me= mory 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 CM= A. 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? Rob