Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2939178rdb; Wed, 15 Nov 2023 15:35:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IHNx9HALLTblu3Btcqq8RRsDTmjdsRak9peVXcsXsALk1IO8hpBdHOFGD9WjEql8+YiC4TP X-Received: by 2002:a62:b40e:0:b0:6bf:5131:884a with SMTP id h14-20020a62b40e000000b006bf5131884amr14035408pfn.6.1700091330318; Wed, 15 Nov 2023 15:35:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700091330; cv=none; d=google.com; s=arc-20160816; b=s5LYR7HB7HQx5DhXOivvNmJqjoLMxxLlV61YIhp+PCdF4CtQchJ8zkKpY/5POK1uZ7 LofEwuTbLjQ3JYsZuRdGlEQL8Al1bVGnPfXePqEucT8rsIVb6hvZs7sC6T2rBFCi+GiB Re8b+fZsih7X4IT6LOvWI5Fq26r52gTGD2rPD/rvzOBh/BTesLVjVkSEgSznEatAKCnI xKcsneG4qrJHijNPGLWj4QsfZ1sCxuJx68tIGaH3wmCD4l/Kb17L42LzF+QmEYLQQoFE 4lyMZWEqJnFuuiKE0xMSBbZmq8Fa4W5qlbJacB9sXr+c0iCEnKGpcPkgx4uqEwxA7DWE Rhmw== 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=oek2kHOiJKwuGradh8KZUYYGEhpdoKxKkCGLT/Ex0Qs=; fh=tnFwodsc0BWdTEhZ8o4aZ51K9EHD+CFA2blGSLvO0/Q=; b=Pg4zuEU83af+3fZ3G+FpuABRQQv8h/zNJcZTNG22Akh4ceas7IN7CsySL6f5ZszmFL Jrwg4H//tCqUvxDAzAcP54LhOebsG/pUy1FH9JvIEiPz6Mz+CWo5PPieb7RQIaVaKXVT 83zgu7d0Dp/DwJ+i26bbjguQ3mJLj8Am/JXQ3RzOD50BJtZNzt2hR82dt19YTLjdbyO1 pS3BQjQVklir6eR3l+Q5qUgXFd9tcCHP6lSga7nosakglluNnQ2CAmioUZQAWaRtHiDq IJDjs9H54OCsIq+UYNQ4oamQ3WVPynDj3p0bhtTfOGYt/3aVVd6K/TejcWJA70+5HYXX zmZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=D5UwbWOr; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id f11-20020a056a0022cb00b006be1c26af7dsi11009814pfj.236.2023.11.15.15.35.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 15:35:30 -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; dkim=pass header.i=@google.com header.s=20230601 header.b=D5UwbWOr; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 3B13B81067B3; Wed, 15 Nov 2023 15:35:28 -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 S229801AbjKOXf1 (ORCPT + 99 others); Wed, 15 Nov 2023 18:35:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229679AbjKOXf0 (ORCPT ); Wed, 15 Nov 2023 18:35:26 -0500 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6B5E198 for ; Wed, 15 Nov 2023 15:35:21 -0800 (PST) Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1cc79f73e58so25375ad.1 for ; Wed, 15 Nov 2023 15:35:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1700091321; x=1700696121; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=oek2kHOiJKwuGradh8KZUYYGEhpdoKxKkCGLT/Ex0Qs=; b=D5UwbWOre6mj6XRjaEoB2nZnaWO/F1Q+EyvIp57SEaS9BsFabaLlUIXIB3OPu9GNqk FNP+c+6rxmf7xP7e39SlzF9rAoH+Q8wQjh4xvyKp5msWXRzFOKao7N3Yk4ccSMgum78g XAq8HZtnRPnQuPOC2eXYgJmw49J8/lpljstexDm4aE6SAP19shdRjuBVJGZwFAC26C1m 2scMo3r2CxBSJH6sXBGso2PvOzwU47ADhtrQrXWU7XJqqCaZHp2m4C+ws4UlHZ1smbRE ouuuXNrrS2gNfvN+7eFI3QqUMDYCG4Q+/0tOcZi5bGtAYhqO63ncaAV1EgtK2Jju41Op LMQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700091321; x=1700696121; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oek2kHOiJKwuGradh8KZUYYGEhpdoKxKkCGLT/Ex0Qs=; b=FBmgSn4HsxqeGKaxNsi5VC8VJNjvbkjWnR/lsGHgSfqRITjz/b6PFMLTjrvLLjmg36 tn2+sZzh/pkqKPubdmDCQa75HNue62MCE8rQ3dUjiD1fqO1GDrk2REFC1aJ+8/a3szdl 0Fp6HZ0nb0gJ31NF+lQ7sLRm4rup+fC4Xwo/9GBNUaefWrCuABCL0hWA8Ywt8NLVe/P7 xVCt7AmJSaX6EImYyPXthuE5iYCwJ0Ic76EfuitjXRMYAjv+E2w12UTjRDDQxaq6TO1a 1l29I557wph83YaVUz+VQvpmhvE72qUpDgoz7di7xNf4MpMJkCxYtLipFSGi5pLaAmg1 4BHQ== X-Gm-Message-State: AOJu0Yz7C3lN7tyV27wsZNxDfkwO2yOhkjml+G6D6fuGrg7ULgk8I9BW 1iQ7szfpY977qQN0/RKgJUBqo2fR40hpjEmBOR+5 X-Received: by 2002:a17:902:f684:b0:1cd:fbc7:271f with SMTP id l4-20020a170902f68400b001cdfbc7271fmr66903plg.20.1700091320785; Wed, 15 Nov 2023 15:35:20 -0800 (PST) MIME-Version: 1.0 References: <20231111111559.8218-1-yong.wu@mediatek.com> <20231111111559.8218-7-yong.wu@mediatek.com> <0ccee72f-98ac-4a08-9253-9c22dad4d95a@linaro.org> <5d7b2458b8d1896ce575f4ed2d413f4e8eeb92b4.camel@mediatek.com> <3daaa2aa-61d4-40db-b36d-cd825a340d2b@arm.com> In-Reply-To: <3daaa2aa-61d4-40db-b36d-cd825a340d2b@arm.com> From: Jeffrey Kardatzke Date: Wed, 15 Nov 2023 15:35:09 -0800 Message-ID: Subject: Re: [PATCH v2 6/8] dt-bindings: reserved-memory: Add secure CMA reserved memory range To: Robin Murphy Cc: =?UTF-8?B?WW9uZyBXdSAo5ZC05YuHKQ==?= , "matthias.bgg@gmail.com" , "christian.koenig@amd.com" , "krzysztof.kozlowski@linaro.org" , "robh+dt@kernel.org" , "sumit.semwal@linaro.org" , "linux-kernel@vger.kernel.org" , "linux-mediatek@lists.infradead.org" , "jstultz@google.com" , "nicolas@ndufresne.ca" , "linaro-mm-sig@lists.linaro.org" , "linux-media@vger.kernel.org" , "devicetree@vger.kernel.org" , =?UTF-8?B?SmlhbmppYW8gWmVuZyAo5pu+5YGl5aejKQ==?= , =?UTF-8?B?S3VvaG9uZyBXYW5nICjnjovlnIvptLsp?= , "quic_vjitta@quicinc.com" , "ckoenig.leichtzumerken@gmail.com" , "conor+dt@kernel.org" , "Brian.Starkey@arm.com" , "benjamin.gaignard@collabora.com" , "tjmercier@google.com" , "krzysztof.kozlowski+dt@linaro.org" , "dri-devel@lists.freedesktop.org" , "linux-arm-kernel@lists.infradead.org" , "joakim.bech@linaro.org" , "angelogioacchino.delregno@collabora.com" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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, 15 Nov 2023 15:35:28 -0800 (PST) May I suggest the following for the device tree binding? (I'm not very familiar w/ device trees, so apologies for any oversights, but trying to process the feedback here and help move Mediatek along). This should align with my other suggestions for having an MTK specific portion to their secure heap implementation; which also means there should be an MTK specific device tree binding. # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2 --- $id: http://devicetree.org/schemas/reserved-memory/mediatek,dynamic-secure-= region.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# title: Mediatek Dynamic Reserved Region description: A memory region that can dynamically transition as a whole between secure and non-secure states. This memory will be protected by OP-TEE when allocations are active and unprotected otherwise. maintainers: - Yong Wu allOf: - $ref: reserved-memory.yaml properties: compatible: const: mediatek,dynamic-secure-region required: - compatible - reg - reusable unevaluatedProperties: false examples: - | reserved-memory { #address-cells =3D <1>; #size-cells =3D <1>; ranges; reserved-memory@80000000 { compatible =3D "mediatek,dynamic-secure-region"; reusable; reg =3D <0x80000000 0x18000000>; }; }; On Tue, Nov 14, 2023 at 5:18=E2=80=AFAM Robin Murphy = wrote: > > On 13/11/2023 6:37 am, Yong Wu (=E5=90=B4=E5=8B=87) wrote: > [...] > >>> +properties: > >>> + compatible: > >>> + const: secure_cma_region > >> > >> Still wrong compatible. Look at other bindings - there is nowhere > >> underscore. Look at other reserved memory bindings especially. > >> > >> Also, CMA is a Linux thingy, so either not suitable for bindings at > >> all, > >> or you need Linux specific compatible. I don't quite get why do you > >> evennot > >> put CMA there - adding Linux specific stuff will get obvious > >> pushback... > > > > Thanks. I will change to: secure-region. Is this ok? > > No, the previous discussion went off in entirely the wrong direction. To > reiterate, the point of the binding is not to describe the expected > usage of the thing nor the general concept of the thing, but to describe > the actual thing itself. There are any number of different ways software > may interact with a "secure region", so that is meaningless as a > compatible. It needs to describe *this* secure memory interface offered > by *this* TEE, so that software knows that to use it requires making > those particular SiP calls with that particular UUID etc. > > Thanks, > Robin.