Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2049176lqb; Mon, 27 May 2024 06:24:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVW1gOk1Sgkrw6XtL/j6rOiOpJZuL+hj01tyQf2SxqWnXA7/ZijsoIXR9fC/AJXeI710xRpy7NI+jpAWF11OSzqnz2RS5Bn6iJSI+M1Eg== X-Google-Smtp-Source: AGHT+IGt9O4omWYzvN91VFLTQiFqeJF1k2jywLr24xKEVM0AUW1yAGeSi6s09UsfGD/cpSg3hNuI X-Received: by 2002:a05:6512:544:b0:529:b632:ae4e with SMTP id 2adb3069b0e04-529b632af8bmr446103e87.2.1716816282782; Mon, 27 May 2024 06:24:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716816282; cv=pass; d=google.com; s=arc-20160816; b=GRuGNg7GFxddad+tq04JIYnrjz8ua553eRkhosJIcYAYPvJwp7iPxDnOZG6PSgbcJC pH4Jsg/7Ksu5zAJgZz0S/ZzRir3G0WtXQJPQp8/ZNDbUGcb5alH4AbYjvZfNzKz3LDe0 qITsf5WSfNCVOfHUkYG+q0bEUgM1D01kl18BrkeCzOadAKF9cUF/4yaIRB9eq8VgkTca FI+qY93zEyu739cHExtkefLMG2ehOPxz28WmFOTJhUv4X6uCCAa8jLB5Uo5iNZEf+2+k fjKIFSNjG7+TBasZUDRktA3mS/1GFyStzuRP3h4L6PRYeCUIXRNribJ8SnwjO3oyg867 OBZw== 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=lHrHZEEV9e4XfK4jWbKD94symQTEPPz3n5O2dV/Sklk=; fh=GMM0/KkBNy/jx/Yr/z5tdgYRSu3CG/Mc/YHdu/zCGKI=; b=UnxioYKa7ah0t4SJUQ9H2T9VHYVhULouAQn4SjWsSY3NRn3Sjm6FvurxLJdBB9Bfnp qHmUEysl+d6zKdRb3Q4SCKmObrhKcE9S/EfcFnN+SEG6Qg8gEX+JAnUZdXPhlxFqP8zL 48bUUIHKyzJ2TzHgRjm+SvAgN+hBDn+zC8EXn1ybgSGc9lLxVFBW8nrDjkAtbYHwY0Yi MkTtnerkEc6ozisfCdKPfMn0tVynNvjiptZsgmdkxbUnoqc/cOQ+NuRSqXza7ab7cMj1 rHxrmrZIwvjEkHS2EoKAuytLTKTEiXOA9EI6Jr1ImFRXtBPtNM/Fch/EiXC2uGd0QBXF b2aQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T2ka2B0X; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-190681-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190681-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a626cd94f07si390215766b.833.2024.05.27.06.24.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 06:24:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-190681-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T2ka2B0X; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-190681-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190681-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 33F351F2232B for ; Mon, 27 May 2024 13:24:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 197AF15EFC4; Mon, 27 May 2024 13:24:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="T2ka2B0X" Received: from mail-oo1-f47.google.com (mail-oo1-f47.google.com [209.85.161.47]) (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 BC59D15EFA4 for ; Mon, 27 May 2024 13:24:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716816256; cv=none; b=NtW2qKJeb+C4As6sr3jthEUi5u+0LkhNqPz5eh4Q+5mtgM7jB0YeTLnlpHFgye8DzewXUrEOkwWDyhpy4R+r8ulfQpYxs0gtsZJ2MSiO/zS9D1yeaOHLBKsGgblPR4qa6veWVL68gIYSgrehWU8X62uQ4Yp/fnsGL7YIppveVj8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716816256; c=relaxed/simple; bh=BeMqoH5GvSpJ1d9avTl/slNkeZp+MwMFavChpJnITDU=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=CDFC4otrL3E4HhO2m0cFwqFpbpf6HVX+Cesfc6yAUt9sD4DUBkKhuOJeQ0m38PnaKoiXuZBzfStbRoDxz4uu49y3bBERMO/K4o2q+OtmWOHRPtGRW8K21nDdJPeBnulGdNaxKx8jg9nYiYaKWrI805I27LvgoO/4upLUuStjfWk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=T2ka2B0X; arc=none smtp.client-ip=209.85.161.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oo1-f47.google.com with SMTP id 006d021491bc7-5b2e93fddafso2498838eaf.0 for ; Mon, 27 May 2024 06:24:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716816254; x=1717421054; 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=lHrHZEEV9e4XfK4jWbKD94symQTEPPz3n5O2dV/Sklk=; b=T2ka2B0XNH2fbhlUlOYkda/4neCoJZnbbZitc6m2ZLtd/9pHRrwSP5AXzGL2pqiZui NStIEqWW+UKuI1tdydtCzwy4fGB/LxPUVEsk+6JfF3VYJLD4vj05k0oEorsOdMcgZoTw 2KIX1pAoeedXHOiQE8ShwbF23Hg9JWNV4mKNoG9ebr6lEaM5OkbBjeYfN0vzb3Xxk3xY V2jBTzejhOXwz7F+sLI2OZP5uyQAdAezFdIdvJKzOGBcROpRxNQQepBXOLBHx4Ihg0wq +qezH8fip8RBP7wMT+psPhmgu98ERMHqU559NGw6y7xt2ZSi4Z+WHLGx5ZRybQxTiO3i S56w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716816254; x=1717421054; 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=lHrHZEEV9e4XfK4jWbKD94symQTEPPz3n5O2dV/Sklk=; b=VpaoIaMDokcSYhRtzhS0vO/RpvY19he9bHeIpRuRDxTSYsGySMp/mJ3rYCcDk6JhCa SSre17CoOGM9s3MoklsQgN1MdKZCOyzXBHljq4oR7Uf0XNbg5T14FmrlMX1iiNJefC13 /K9/dUgLXwwoRmsIcycEFOa0IgN4YMByPljuaFGCI0P+d6Gn3Qaiyz7xnUErVjSYnYtF F0b2dYxOYTiJSNYr2CLNa1yIwXIUBkr7EK2h3BCjhr2Q+b9xNabvYuHe4h3P5B0Cd/pr I8Uwpvf6NgRKZONofzMK+ShITPaWfq2d2FXPRg8KHw0fqmNDe9JTtUbFTTaOZopR7HdR 9u2w== X-Gm-Message-State: AOJu0YyPHeQZ7mAczD7x2eLRHW+zn6kRLZIjaLEMIRQIDs9Bce8zY5WO 9JJWCsNvhdGsBZ7avnTeYRUSwROyfCHKUt6M8iPPnRaiX9yjK8YFoHnaypiEZEJhZFFcTwgrSvJ b6LzLzBunS/iQxB4olmSe1BjEtQC/9R+7c5qWeg== X-Received: by 2002:a05:6820:22aa:b0:5b9:89d9:c5ef with SMTP id 006d021491bc7-5b989d9c96amr2849706eaf.0.1716816253777; Mon, 27 May 2024 06:24:13 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240527121340.3931987-1-jens.wiklander@linaro.org> <20240527121340.3931987-5-jens.wiklander@linaro.org> In-Reply-To: From: Jens Wiklander Date: Mon, 27 May 2024 15:24:01 +0200 Message-ID: Subject: Re: [PATCH v7 4/4] optee: probe RPMB device using RPMB subsystem To: Jerome Forissier Cc: linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, op-tee@lists.trustedfirmware.org, Shyam Saini , Ulf Hansson , Linus Walleij , Sumit Garg , Ilias Apalodimas , Bart Van Assche , Randy Dunlap , Ard Biesheuvel , Arnd Bergmann , Greg Kroah-Hartman , Manuel Traut , Mikko Rapeli Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, May 27, 2024 at 3:00=E2=80=AFPM Jerome Forissier wrote: > > On 5/27/24 14:13, Jens Wiklander wrote: > > Adds support in the OP-TEE drivers (both SMC and FF-A ABIs) to probe an= d > > use an RPMB device via the RPMB subsystem instead of passing the RPMB > > frames via tee-supplicant in user space. A fallback mechanism is kept t= o > > route RPMB frames via tee-supplicant if the RPMB subsystem isn't > > available. > > > > The OP-TEE RPC ABI is extended to support iterating over all RPMB > > devices until one is found with the expected RPMB key already > > programmed. > > > > Signed-off-by: Jens Wiklander > > Tested-by: Manuel Traut > > --- > > Documentation/ABI/testing/sysfs-class-tee | 15 ++ > > MAINTAINERS | 1 + > > drivers/tee/optee/core.c | 96 +++++++++++- > > drivers/tee/optee/device.c | 7 + > > drivers/tee/optee/ffa_abi.c | 14 ++ > > drivers/tee/optee/optee_ffa.h | 2 + > > drivers/tee/optee/optee_private.h | 26 +++- > > drivers/tee/optee/optee_rpc_cmd.h | 35 +++++ > > drivers/tee/optee/optee_smc.h | 2 + > > drivers/tee/optee/rpc.c | 177 ++++++++++++++++++++++ > > drivers/tee/optee/smc_abi.c | 14 ++ > > 11 files changed, 387 insertions(+), 2 deletions(-) > > create mode 100644 Documentation/ABI/testing/sysfs-class-tee > > > > diff --git a/Documentation/ABI/testing/sysfs-class-tee b/Documentation/= ABI/testing/sysfs-class-tee > > new file mode 100644 > > index 000000000000..c9144d16003e > > --- /dev/null > > +++ b/Documentation/ABI/testing/sysfs-class-tee > > @@ -0,0 +1,15 @@ > > +What: /sys/class/tee/tee{,priv}X/rpmb_routing_model > > Wouldn't /sys/class/tee/teeX/rpmb_routing_model be good enough? Doesn't the routing model concern tee-supplicant more than a TEE client? Then it might make more sense to have /sys/class/tee/teeprivX/rpmb_routing_model only. Keeping it for both devices representing the same internal struct optee makes it easier to find. Anyway, I don't mind removing one. Mikko, what do you prefer? Cheers, Jens