Received: by 10.223.185.116 with SMTP id b49csp7464900wrg; Thu, 1 Mar 2018 06:04:30 -0800 (PST) X-Google-Smtp-Source: AG47ELuEBoTOrqx3mKCd7v71vToHrmys+MhZqHJygIHYLZdPVmRXwwJaHfECJjt3jYaulJtSUFRz X-Received: by 2002:a17:902:ab8a:: with SMTP id f10-v6mr2064652plr.318.1519913070701; Thu, 01 Mar 2018 06:04:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519913070; cv=none; d=google.com; s=arc-20160816; b=qHTmW/z9czZW5DEne/ZrbiWdEkFNs6TdSpQrHyryYtZbGzLkUhDmODtyX1cQFuZCud 1N2iR2QhsocifbsKZQi3XrhHySr65c+MSYbw0ZfbBGdOf4DJgUt80Qz7mf/3dZz7uCsi JnJFF3wgxDqm+44d8ogkd+IakR5FbHT/QT6zddchDgcvd2OEJ2m7r2OHzhfqadv4qKIP c9YjWoO6nSVAap86UEmBEp6RghySuSaFio69+TIJ9Qjjuzsvrv9oNVLa0MwR4a8VDs4n uIkOCy+Qz7yferOP3eyqJnb9QbN5+RaBXfBgvyzoXH31xIM9vb56LRdUNIjeHJ/+J4Fr HcbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=ukJBu4yW1OdKOK0KClTDtoMtg0cu488dcePcgHhL0dw=; b=sD8JE1KA9ZYil3gbfysWnkPlQh7ibn9n8xq4iIcx6pbwnd+PKENE3W0P2/91vCRYu7 F1JImVRJ9By+D2rIclYgaThff4uY/t05pKVTCT3hhnHMwN+iE272De6gQPX3YY3Xll16 Tnwzo4x/mJzKiESd+t2rXl4yKx31EMi5wkOLxqtdnidf/WC+5RM++Cw3SOsl1LztlS79 V5vVZxh3ktsLTFRUabJG5OxJcaDEoHPah944E8yE3iya1VonFqSg9Rhl3/ffyy/5xjV1 NhmQ0Y3T/S+BsH8GCrYofhKgqggyEkuMVLlXJw7elmGHn8cRO38bsrA36cZdr/HXieLO MNSw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 63-v6si1661537plb.228.2018.03.01.06.03.59; Thu, 01 Mar 2018 06:04:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031121AbeCAOCt (ORCPT + 99 others); Thu, 1 Mar 2018 09:02:49 -0500 Received: from foss.arm.com ([217.140.101.70]:38914 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030922AbeCAOCs (ORCPT ); Thu, 1 Mar 2018 09:02:48 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D16351529; Thu, 1 Mar 2018 06:02:47 -0800 (PST) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DF1A43F246; Thu, 1 Mar 2018 06:02:45 -0800 (PST) Date: Thu, 1 Mar 2018 14:02:43 +0000 From: Mark Rutland To: Benjamin Gaignard Cc: robh+dt@kernel.org, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, robin.murphy@arm.com, arnd@arndb.de, loic.pallardy@st.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Benjamin Gaignard Subject: Re: [PATCH v2 0/2] STM32 Extended TrustZone Protection driver Message-ID: <20180301140243.3uamdvdcvmsxv6im@lakrids.cambridge.arm.com> References: <20180301135806.19982-1-benjamin.gaignard@st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180301135806.19982-1-benjamin.gaignard@st.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 01, 2018 at 02:58:04PM +0100, Benjamin Gaignard wrote: > On early boot stages STM32MP1 platform is able to dedicate some hardware blocks > to a secure OS running in TrustZone. > We need to avoid using those hardware blocks on non-secure context (i.e. kernel) > because read/write accesses could generate illegale access exceptions. > > Extended TrustZone Protection driver make sure that device is disabled if > non-secure world can't acces to it. > > version 2: > - do not use notifier anymore > - change status property value in device-tree if needed > - use a list of phandle instead of hard coded array As mentioned on v1, I don't think this should be done in Linux at all. If you wish to handle this dynamically, please fixup the DT *before* entering Linux. If you want a sane default in the dts file, put status = "disabled" on all nodes which the secure world might take ownership of. Thanks, Mark. > NOTE: Those patches should be applied only on > git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32.git stm32-next > until this patch: https://lkml.org/lkml/2018/2/26/386 > find it way to mainline because KBuild will complain about them. > > Benjamin Gaignard (2): > dt-bindings: stm32: Add bindings for Extended TrustZone Protection > ARM: mach-stm32: Add Extended TrustZone Protection driver > > .../bindings/arm/stm32/st,stm32mp1-etzpc.txt | 25 +++++ > arch/arm/mach-stm32/Kconfig | 7 ++ > arch/arm/mach-stm32/Makefile | 1 + > arch/arm/mach-stm32/stm32-etzpc.c | 116 +++++++++++++++++++++ > 4 files changed, 149 insertions(+) > create mode 100644 Documentation/devicetree/bindings/arm/stm32/st,stm32mp1-etzpc.txt > create mode 100644 arch/arm/mach-stm32/stm32-etzpc.c > > -- > 2.15.0 >