Received: by 10.223.185.116 with SMTP id b49csp7480105wrg; Thu, 1 Mar 2018 06:16:25 -0800 (PST) X-Google-Smtp-Source: AG47ELsl+jxOYPhmqQN8dEYqt94W4L/Xmd/vh55KSHMiQlG4UPacGmByuKGnBvwe8W2x01hFFrdI X-Received: by 10.167.130.193 with SMTP id f1mr2060690pfn.241.1519913785784; Thu, 01 Mar 2018 06:16:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519913785; cv=none; d=google.com; s=arc-20160816; b=hqlEljV1nSZw28A7ep1XC+sHbhBPcl58omX8zwuPs4L01wVm9J30XcIQu/OjX4cCz0 Lv12K06h4ycCXvjhuAqCyW2Kz0XhvMiGFoV8cWAV7RKZN3juqZz3JQ+MPRNNPAmSc+Mj K4g2V5EHqTpfZOaUXeIXz/awd9bb1AqolJb9NSm3hYPhfp//WIVHzbeIZoKoM/n1VuIF IrNKos7+hTkWMaLIUdQ4ws/08+UvQdXkpBcpLS5/GK0IxBFeCvl6Py+EMOdKa4ay3j5q i14a6zObC+UgxPZITVcwt9tupdG6jqpdfz7oaq+XsixA1GGsUB9dJiCFRmZKb8Bwgca4 ObpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=GNkypjwoR8Xm93zcS01po6FYtJpjdPMcMUzIJTY77t0=; b=e7M0nY4nmAy4bJBlf4GRIS62rCj7wQ0lI80/XPlmYjyovOlBXP9nZ1F0YqnLlD8cIk oFmwxn3LV+HLuVKpxK9+RrckHhjJQWg7m2B4wh4BucoOkf25soF/cAeRCb2k3VbBQvgR DZ7z1fSE7Yv3w2GmhFdcTgmCSK8b4szJ7p0+K6ybc9wucxuNOjWmmHi9F1vwB+rRHqmj 1yyt24z5b5E/ABe8eY/zzX5qLAnoZJZpy3xoJyqKx3yJ2K8cgqPSKVueNDpIgA+zA5JT cTDRwccFcGwx57CPZkoEBGwBbqraYK2CElNh0Z9667mqVvNkw7eW3QZ+SQnt39Vzgvmf qerw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z4LPcohT; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r13-v6si3258556plj.141.2018.03.01.06.16.09; Thu, 01 Mar 2018 06:16:25 -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; dkim=pass header.i=@linaro.org header.s=google header.b=Z4LPcohT; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031239AbeCAOPK (ORCPT + 99 others); Thu, 1 Mar 2018 09:15:10 -0500 Received: from mail-qk0-f195.google.com ([209.85.220.195]:40503 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031211AbeCAOPH (ORCPT ); Thu, 1 Mar 2018 09:15:07 -0500 Received: by mail-qk0-f195.google.com with SMTP id o25so7651560qkl.7 for ; Thu, 01 Mar 2018 06:15:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=GNkypjwoR8Xm93zcS01po6FYtJpjdPMcMUzIJTY77t0=; b=Z4LPcohTZHoSwGBaUBLZNga1VaThohADEO7HeLoPR/kPA/ncUZpnDqr7Dk4qrjdudj cfBatEvSXvOPMn7baNU0NXIKTfKNjVqN9z05OvOnJvj79xRiaDsVKJ8X69lVABxRRAp8 6H5/Uy8i8Bph3xEFDmT4y3vf0f7t8Yf41Pd50= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=GNkypjwoR8Xm93zcS01po6FYtJpjdPMcMUzIJTY77t0=; b=IRkblX63WvMXJP5d6/sesxViAs+9prhqofeVTVlqF1zYmmKb7mTIUNwrB4DvexHFYn IV9YAIt8t5mHw4aE3uyORXW5UzyXIJuiYkTR7br/WZQx2P0QAeej+9VuWkrndiYtQ8lx kf0KRgyqjnLLxK+Q87MqKYLHsK4Tfyo6iW+EHai+mWpLWtuHZzhOLiqAHYSfF6px9o36 JKILt7J8Mi1re2xNLzQ7jfTuDjNGfsmkXA5lO+RKQXj7JRa2LXtpD3Y7Pxvk38ekrCHp JLdMqSr4HbQX4RP+x7c4oWkL/OQlXZVxaCayjHqf90vO4okzMavPy06VaJkxMcP+oBfA J0IA== X-Gm-Message-State: AElRT7FeKIX2r2xVylt0Ug3Z6Rxcab14JRNoaQOtycCuPWpEVMiLfjOp YSAbHzX0V5AW71ii//o4PHinbhTKlT6s/IvyzxjYRQ== X-Received: by 10.55.79.78 with SMTP id d75mr2843479qkb.20.1519913707137; Thu, 01 Mar 2018 06:15:07 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.104.13 with HTTP; Thu, 1 Mar 2018 06:15:06 -0800 (PST) In-Reply-To: <20180301140243.3uamdvdcvmsxv6im@lakrids.cambridge.arm.com> References: <20180301135806.19982-1-benjamin.gaignard@st.com> <20180301140243.3uamdvdcvmsxv6im@lakrids.cambridge.arm.com> From: Benjamin Gaignard Date: Thu, 1 Mar 2018 15:15:06 +0100 Message-ID: Subject: Re: [PATCH v2 0/2] STM32 Extended TrustZone Protection driver To: Mark Rutland Cc: Rob Herring , Maxime Coquelin , Alexandre Torgue , Robin Murphy , Arnd Bergmann , Loic PALLARDY , devicetree@vger.kernel.org, Linux ARM , Linux Kernel Mailing List , Benjamin Gaignard Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-03-01 15:02 GMT+01:00 Mark Rutland : > 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. That is the case, nodes are disabled by ealier boot stages before entering in Linux but, since mistakes and/or errors are always possible, fixup the DT to avoid illegal access exceptions make sense for me. Benjamin > > 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 >>