Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2879238lqp; Mon, 25 Mar 2024 11:47:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUif8smKZHfwvgk29Dt1ReWM06pxTveXK/0N7A7vCwqBurYEC7IJdZfq0bZEw3A17Jo2Z30Dul43izuwhqWjXjBzyGuuAfhQbtfRs2u+Q== X-Google-Smtp-Source: AGHT+IHynzYUDTNTqRMyMJkZ3Ux09aK3+HX43qwrilUkqcBtBPwlo1ryPaaT1Dh3aemF8xYFPzHP X-Received: by 2002:a17:903:2693:b0:1e0:b0d:5b7d with SMTP id jf19-20020a170903269300b001e00b0d5b7dmr681329plb.36.1711392478062; Mon, 25 Mar 2024 11:47:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711392478; cv=pass; d=google.com; s=arc-20160816; b=OpqWdKcl9AcfmJIhDdozop7hs1tt4XbY+bMTqYnAAj2cJGSDy4sVEV2gwE2GlA3SIk ZC3izESc7pJw/a2j9ZEyjaGNg9UIJ4E6Y+md+NNjXh0KrYyqV6LN+Fk4wzlP3fDSsxQH 9NK7Mdh08yi+6dsHQ7kZzU0u+3uqprhtpg6q5fwbpSjRNuAodpqadKtckwMN+PRpSTAU Qz0jrmT2zRDzbyzzhOiT/42gdyT0MbJcWpJPkBvUiovBiIdofR10xWp/gxB4DH+bd/Os AGkyp+ZoMeBy36Jl2H2CmOWYvxB/8dYjBtaxKO745iJea+QYymvrAjd/K4smx1DrnnC4 x2DQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=aj12qcWxwHOSiW5ip0+Q6r8HCwXXVgYZqcmXwDmc6a0=; fh=Bs9ae+9Ev94PNOz5bNGAY7jKXeK/ct+FSk+uV1v10zA=; b=f7yob8eSipUgPa0aIPAVS69rbvhhHvGArITB/lo6mHylkRdXetJZohNsN239Fw63FX wgmB6W3X1qh2rYpXNnMF8+IulqBAUgRWPVBHlwZNnXvw7n7L3rqVsk09Pa0dzMPERKO6 k46H8TwRDGgD3VczDr984qRrsViRAyiPyeIZas1KvFauXflHmx2JTuB2X0DzFc9BCamA IJhS7ydavSg7QZqDDUcb1T7x2w6YvhJLB4QB0v35wCrYneZH1ACov1GzwuQ9hwliITZZ SiBwItwu0GmpU48w0VmGNoQ8jl/k0zRsSqEzwP5Iq6890KDLYoqOOxJwjUG1OUyryzCU /odw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=lbC9nKs2; arc=pass (i=1 dkim=pass dkdomain=bgdev-pl.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-116797-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116797-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id o16-20020a170902d4d000b001dffd7ee0aasi5867297plg.359.2024.03.25.11.47.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 11:47:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-116797-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=lbC9nKs2; arc=pass (i=1 dkim=pass dkdomain=bgdev-pl.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-116797-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116797-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 2FD382C3648 for ; Mon, 25 Mar 2024 14:16:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D81F12836B; Mon, 25 Mar 2024 10:47:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="lbC9nKs2" Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8D53F19F523 for ; Mon, 25 Mar 2024 10:08:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711361295; cv=none; b=RgtU7qsBM1iYF3sAi+OIMwZBL66ZQjnv4TJAHEzygfOl1yXdhq8GnDDMiywYG/w3nQEVH94dKKOvafsrRzhpDMau8y5ZSoeTe8yyndr1OCybKyGtR8TFI26fg7eePVdGvJHth0TTZ9YxOX6zTTc/T7lkvvVWx2kfVDw/R/bL2SA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711361295; c=relaxed/simple; bh=aj12qcWxwHOSiW5ip0+Q6r8HCwXXVgYZqcmXwDmc6a0=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Bty2qlAd574vgi3Z5EcOmTy76fKBQ8QA72PdRZxBJBi0M1/m5gB0bsefkwMlcb7TZcNeQgT7fO/lY0flcMEJcut2DSDDofwFcEWDT6kBypUZe/xWg9BqJvOG1Z57nqVDrzELfzghq26blxc1GsX5S9Yiz9VlOt3zafAEK8XMEkQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=lbC9nKs2; arc=none smtp.client-ip=209.85.167.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-513dc9d6938so5211919e87.2 for ; Mon, 25 Mar 2024 03:08:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1711361292; x=1711966092; 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=aj12qcWxwHOSiW5ip0+Q6r8HCwXXVgYZqcmXwDmc6a0=; b=lbC9nKs27h5vbZyk2ozArc1COjHhnZCpbml9EUiMxVGntXUuzJ9C6moWhn8OTHWChN ESI55WR4+mqGvfC8kJTMIhP05wx+fuXXiWnJR+mKR2SswXCdXvvF1Ndkt2WQykUsGzlv wfneF1MZ3SbpRBriIKsDw9MLlI8obEquBNjTgUtCRN/6a1Y86R55GpRXhIFXKa95LdMy 710WP69IOOn/ryhFNhMWhR4HGL8jo8JYSo+zCsUzwaxes1zUfdVRFgSvKKMsIam06b6x TbtLUlpg2l3/qLExCJjJM0ei8ilfyV12aWp7eZJr8VOQInjhVA4OqIwPVai59ZLhM1DM N5Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711361292; x=1711966092; 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=aj12qcWxwHOSiW5ip0+Q6r8HCwXXVgYZqcmXwDmc6a0=; b=KFY2ZlIelR4b/w1hdvgUnM89Zl+3WogdUGC81DjWuaXcIHgI9kh2M5YblCxoL2hrBB C4NTGIWseoFsAKXGbuNtkb4w+pidvz1Und1kdmWXieJlqYfN2zaGurwEOy978C6hYWTx ZEXmJc+oUablYklIqJpEvOGv82durStWabeqTFqWFAgd6vAQICMSXHTbqwwiniiHcyis 0WlLQ6Xq8pWi8JtNmjJGpNtomv/qwUGdEN9lBZJ/4lQm83Yo08cXgWec1PF259XBI9OS sjzrTS3DBZkFzT7mnsPI5hiSZN1iKe1jq90bg4bM6byM7m4ATtimA83S0QP+fOYWaS/A OEiw== X-Forwarded-Encrypted: i=1; AJvYcCU++PfB0jRLKQM6CaMcqq6gcl7OdWtqGSt86MgpuPlDSZYU5OUzwCW9uvCo00rD5WdcjMBxkImFgthza8Wafu9nXt+yJRcOSHjs1lOt X-Gm-Message-State: AOJu0Yy5yCg2649Mv9m9Vx+wSIpGbJuqB3pnydR2qquAAp4W7xBPQozw HWbWLWy550ZOfd+/6mqMItq+LfoeYBk5JnmkS9sMEooBZgJFgQtuKm3iEvg7hY9kEXdGevEJPqB AHeRKXb2KiUAP7YEoe7+PsXanRm85eY0Ew9Iq6A== X-Received: by 2002:a2e:a0c5:0:b0:2d6:87ab:2543 with SMTP id f5-20020a2ea0c5000000b002d687ab2543mr3735612ljm.30.1711361291815; Mon, 25 Mar 2024 03:08:11 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240325100359.17001-1-brgl@bgdev.pl> In-Reply-To: <20240325100359.17001-1-brgl@bgdev.pl> From: Bartosz Golaszewski Date: Mon, 25 Mar 2024 11:08:00 +0100 Message-ID: Subject: Re: [PATCH v9 00/13] firmware: qcom: qseecom: convert to using the TZ allocator To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Elliot Berman , Krzysztof Kozlowski , Guru Das Srinagesh , Andrew Halaney , Maximilian Luz , Alex Elder , Srini Kandagatla , Arnd Bergmann Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@quicinc.com, Bartosz Golaszewski Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 25, 2024 at 11:04=E2=80=AFAM Bartosz Golaszewski wrote: > > From: Bartosz Golaszewski > > SCM calls that take memory buffers as arguments require that they be > page-aligned, physically continuous and non-cachable. The same > requirements apply to the buffer used to pass additional arguments to SCM > calls that take more than 4. > > To that end drivers typically use dma_alloc_coherent() to allocate memory > of suitable format which is slow and inefficient space-wise. > > SHM Bridge is a safety mechanism that - once enabled - will only allow > passing buffers to the TrustZone that have been explicitly marked as > shared. It improves the overall system safety with SCM calls and is > required by the upcoming scminvoke functionality. > > The end goal of this series is to enable SHM bridge support for those > architectures that support it but to that end we first need to unify the > way memory for SCM calls is allocated. This in itself is beneficial as > the current approach of using dma_alloc_coherent() in most places is quit= e > slow. > > First let's add a new TZ Memory allocator that allows users to create > dynamic memory pools of format suitable for sharing with the TrustZone. > Make it ready for implementing multiple build-time modes. > > Convert all relevant drivers to using it. Add separate pools for SCM core > and for qseecom. > > Finally add support for SHM bridge and make it the default mode of > operation with the generic allocator as fallback for the platforms that > don't support SHM bridge. > > Tested on db410c, RB5, sm8550-qrd. Previous iteration tested also on > sa8775p-ride and lenovo X13s (please do retest on those platforms if you > can). > The Subject should have been "firmware: qcom: implement support for and enable SHM bridge", sorry for the mixup. Bartosz