Received: by 10.223.185.116 with SMTP id b49csp5327541wrg; Tue, 27 Feb 2018 11:18:28 -0800 (PST) X-Google-Smtp-Source: AH8x224sOwjjGtnGMGohjwE0Cdva+OZmldPmshQybRynvDxH4Lt2mSlzf7pDYknNsAY3mgVX6qgi X-Received: by 2002:a17:902:8492:: with SMTP id c18-v6mr15232623plo.40.1519759108421; Tue, 27 Feb 2018 11:18:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519759108; cv=none; d=google.com; s=arc-20160816; b=cv3iOTIDdVQw90CZjUdBuo9IKlYIHo0EoZAVPilIkdOuziSEKW3q3IreyvJ53gIIJT 0Og2BTHUiD5bKNr5PASE8DOhVajVwB9MpPrqwIIn2ymqfgr6nVRBsWKFuBPAXa2N87bj eAotAC+FKcG3UmeXwxhtbIrrVNpL6BWFLGIx4MImpWn0byWostTkc5xs23Bd1l+tS3H2 6E3k3q9ZUkdrV9eBKGUrNXW7BP8Jp8HWoZgZ2r3XEWuH53R1tg3I/Cke8tUzg5uar+Pm KReOONnezhTZ1JmcmaOHHYUXVHd42G7Tc9j5hWGD+tfrogjAlTDCJFtufpNJzJ2+D16c iiVw== 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=vpQYO4Zh5fx79ELZhf89ZlYXKU4sXDPCUasW4UBkqCM=; b=vw0s+tk2iMa2/SuZBLF9WQJBMfRnM6K+31N5xsSGdgVrdOuc4CoKFWQUOl6f0QH47S Md7Dur66y+HpQUjtF4z4ZE/YCv2hYqjE0/wWilBgccKKb/Luon2cKfEQTi7rrUPfHnB0 qvsoIyHnDSqV+4LBhAfPTP2pc2LYVvs5E3V39FcchWtkdB2I1eGFpkIOVr3DE2vm/30M vAv28Ppg0DTGFmzz2F7JjcNBWq8STQIkCnz56NnuW9/IadzkiZ+eAZLJMth9xJEQLsL8 cIS+/7GdFL0aCjKqY/OeswhO1NfN+G2qBiG54Z0o4yMB2CmgH6Fe3zxKhMPrGUvu41N1 jg7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BYRqpvHr; 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 z9-v6si779806pll.805.2018.02.27.11.18.12; Tue, 27 Feb 2018 11:18:28 -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=BYRqpvHr; 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 S1751811AbeB0TRC (ORCPT + 99 others); Tue, 27 Feb 2018 14:17:02 -0500 Received: from mail-qt0-f194.google.com ([209.85.216.194]:39381 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751658AbeB0TRA (ORCPT ); Tue, 27 Feb 2018 14:17:00 -0500 Received: by mail-qt0-f194.google.com with SMTP id f4so24607646qtj.6 for ; Tue, 27 Feb 2018 11:17:00 -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=vpQYO4Zh5fx79ELZhf89ZlYXKU4sXDPCUasW4UBkqCM=; b=BYRqpvHrflZGOb+IkOvv6Pkx+GoQA64ACPKVvvf5hwuI8eN4gRRzQqNXgJR+f7kfUj Bo2D839KxHNDdy6i2FzRmALtU6OFfudW5BNYanEN0QZBZV/JQ0sTjFZrDRxSVqYvO+0+ Urx9TKV13TepTc7rVc2OruPnVt5yJYZ0IBM5o= 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=vpQYO4Zh5fx79ELZhf89ZlYXKU4sXDPCUasW4UBkqCM=; b=oBdOW8HONMPUnOyIR+Yrm6eK/IroniWq13abAP5B3ZVIPXvfKCH/pg/93911m/4WPm n7Wk4ZC0rTzDERJZiqg4He5Ee0smw7PVIkqBWPfQfBgHDTBAXkBYYpEFSEu5xfFumoxy MWoJ5jc3V4FVLnR9+cfjQPoW5qRfRGlIzA90QaKtcpbocNiSRpJoYWAATiD80AQiD+Os msCB19DZ44qjMlaf/Lakgep2vAanQlCZ4VihuyOJXffslzTFDl0bCiwIN/enIiW1eEjN WqkcgSB8aM5ttyCOjoQRqMAr1Ys9Xt79c4ukJnz0L+fICFZQdJoyZfl88Rbp4ucj48iS 7QLA== X-Gm-Message-State: APf1xPBQP79RrRabcJfK/2VGVttIHIt9Nwh2tNkaM9CrQWP7gDR7WquA wycAac1zV9jl9XrhYKwRRpuZX8QMF+tBpry6Njk1Sw== X-Received: by 10.237.47.102 with SMTP id l93mr25686820qtd.26.1519759019996; Tue, 27 Feb 2018 11:16:59 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.104.13 with HTTP; Tue, 27 Feb 2018 11:16:59 -0800 (PST) In-Reply-To: <20180227171124.h2yjhicmlfrwr4nh@lakrids.cambridge.arm.com> References: <20180227140926.22996-1-benjamin.gaignard@st.com> <20180227171124.h2yjhicmlfrwr4nh@lakrids.cambridge.arm.com> From: Benjamin Gaignard Date: Tue, 27 Feb 2018 20:16:59 +0100 Message-ID: Subject: Re: [PATCH 0/3] STM32 Extended TrustZone Protection driver To: Mark Rutland Cc: Greg Kroah-Hartman , Rob Herring , Maxime Coquelin , Alexandre Torgue , 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-02-27 18:11 GMT+01:00 Mark Rutland : > On Tue, Feb 27, 2018 at 03:09:23PM +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 access will all be discarded. >> >> Extended TrustZone Protection driver register itself as listener of >> BUS_NOTIFY_BIND_DRIVER and check, given the device address, if the hardware block >> could be used in a Linux context. If not it returns NOTIFY_BAD to driver core >> to stop driver probing. > > Huh? > > If these devices are not usable from the non-secure side, why are they > not removed form the DT (or marked disabled)? > > In other cases, where resources are carved out for the secure side (e.g. > DRAM carveouts), that's how we handle things. > That true you can parse and disable a device a boot time but if DT doesn't exactly reflect etzpc status bits we will in trouble when try to get access to the device. Changing the DT is a software protection while etzpc is an hardware protection so we need to check it anyway. Benjamin > Mark. > >> >> NOTE: patches 2 and 3 should be applied only on >> git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32.git stm32-next >> but until this patch: https://lkml.org/lkml/2018/2/26/386 >> find it way to mailine KBuild will complain about them. >> >> Benjamin Gaignard (3): >> driver core: check notifier_call_chain return value >> dt-bindings: stm32: Add bindings for Extended TrustZone Protection >> ARM: mach-stm32: Add Extended TrustZone Protection driver >> >> .../bindings/arm/stm32/st,stm32mp1-etzpc.txt | 13 ++ >> arch/arm/mach-stm32/Kconfig | 7 + >> arch/arm/mach-stm32/Makefile | 1 + >> arch/arm/mach-stm32/stm32-etzpc.c | 252 +++++++++++++++++++++ >> drivers/base/dd.c | 9 +- >> 5 files changed, 279 insertions(+), 3 deletions(-) >> 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 >>