Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2787661lqp; Mon, 25 Mar 2024 09:12:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXBkZnbIx/a8KRQ6r+qoB7RXy1sh13Ly9F1d2XScJXQVU79qsiBsnB8gpJVFGAcNk3J2YBAOP1g/QPH5+0TR2N5wwcNVeDFWwZPrYMREg== X-Google-Smtp-Source: AGHT+IHku7O05oLB0fLT1VNOOo/t9kLN9xR7qKO5crf/BF4+5W/ETU0ywVuHZBQMRHlMMNKlSgs7 X-Received: by 2002:a05:6a00:178a:b0:6e9:2051:9dfe with SMTP id s10-20020a056a00178a00b006e920519dfemr7719621pfg.21.1711383123144; Mon, 25 Mar 2024 09:12:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711383123; cv=pass; d=google.com; s=arc-20160816; b=ht3KrLLqj9OTFYiZMSVOrCOgGDSOPmM/LaIAFKlbpBX1t0LJtmbbCVLNTAEG7oiLKX wEHPQHLX/3qm2h2h6TCbfBkb6awrrauXmNe8w4Q9aAYRNzHdz3WKlakCjh89IhilPTE4 o+yK83SPBy9iUT66r5Y8bQbH36tWjwG9bagOeX87BgLYRyQlZ9fbCqH9VTL+j5gvCHF8 +6oxm3ZCzI09z/+zvOUbVPFsmrOd8uOwJ3JkCF4l31LIo9kVOLPrBeDJ5Oyv8strNy0v 384kSY+6Bs51gm1Sr+s8+WYTL5//qMLO83w/vjEM/aMnGaAVErVcL4c62OBa4pyfpUMI pUzA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=JG8wnrlFMeZwWAB6TB0PCQOCN+02Du45xpH27xy/Kbw=; fh=2WHdc/zF3RAysiOTJ//f66c5sGMQLQCMHJKS0yRMEpQ=; b=oOkOid/tUTZ/GMryXJLasFboSDUz4siq01s2pICh7OuARNgF6z/2c8S92MPaW44dlA SvkXLYp9ha0TNEfEYkUJOI168/f9p1XNexJTwYjdzqG3GXfWTDXn617Pv2QRr2mqFmlw VZRfL9lYfGxbPSCxgnshnw+dd1pSkRQP7jKSgSqPlmjX5hCGYy2N368wEPiQu3CrN7ws ZTdAjExuoEsWw3NSVptCL90FVXLHgxKqccycUqwddMVxlvmQMCkhlZnDMDkt9lsUlOdk fKIXI2gtNAhzAJ2v5RBZM2UD0goDcPzcdHcvLXU8RrB9RMwD5YLFnD5agaIFEaHK4/ar MrQQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lnAARSOF; 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-117152-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117152-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id y10-20020a63fa0a000000b005d81b96abb9si7892441pgh.888.2024.03.25.09.12.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 09:12:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-117152-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lnAARSOF; 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-117152-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117152-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 392CC342866 for ; Mon, 25 Mar 2024 15:58:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AEAA7126F1C; Mon, 25 Mar 2024 13:34:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="lnAARSOF" Received: from mail-yb1-f172.google.com (mail-yb1-f172.google.com [209.85.219.172]) (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 0E1CC55C33 for ; Mon, 25 Mar 2024 13:34:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711373666; cv=none; b=nN6/YZLJcLQZ2LGbp/hfDmBJXbK54YEnTdja/qvXxAvGQH49ezZX0vDQzE7M0x+1DCW/yTE/nzanlBvlXgMefQJedeWz25nlnN1HrWLA0eheCsyFn9CXN6to7fNV4z9aEV4e3w3ojEw5E+AFMlsB0NEIvGp1vpva21u0XdB2Nk8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711373666; c=relaxed/simple; bh=U8S5xHgu1M1P3ABOpjoG8UEpFEvNAqSI8jHcJvmVJ24=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=afvA/8bN4PqMKTiUmlxvUZjXpsxDWHL/Ow4m4BO5JgneyE0d0qQhkj+wTMG5iqnzqWHNGcGvWrl6+oCl5vpIvtUfdb62yXatgVjhvvl9NNgPt6IXsN3CzAlSLS13pAG1LhCasImjcFr213P6+eDzHIYDTTMHtH/tbe34Phm2s7Y= 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=lnAARSOF; arc=none smtp.client-ip=209.85.219.172 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-yb1-f172.google.com with SMTP id 3f1490d57ef6-dcd9e34430cso4417003276.1 for ; Mon, 25 Mar 2024 06:34:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711373664; x=1711978464; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=JG8wnrlFMeZwWAB6TB0PCQOCN+02Du45xpH27xy/Kbw=; b=lnAARSOFUe1MBb/2u24EAH/0NiWCj82Lq0D2Xvnw4LAITiEQODcS2SyCoEL9vo2Quu Bozb09dvLjNsdtZEQi7rt7IFsKEhIvMFoqMSazfiELvADlKvxII4uxdI9tgK2mTx6x3/ kD8PofCxevVIsk3oDUbO37NPnut6wCpVuQOuvRZcsnFfomAO5/wi0mVcmi6hpzVZ0EaE Gr1EDN2fauaog9woJrGArM5A8D13Pd1/GXoST76Bk27lGVTgbmW6PHzK6MGNcwPYBlkJ J8b7RtM6Srzxb6+qwYi6exh89+WvhOiO1FtTNsYqDo6WpcDeEE9n77ztN5MQkO8gcbFL oxog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711373664; x=1711978464; h=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=JG8wnrlFMeZwWAB6TB0PCQOCN+02Du45xpH27xy/Kbw=; b=nD5iwH3l78enOEl5+bjgU3vYG8ij+Vy4MNU+/wG5Zi5I46YuBU9YxgIro5giRm2QJq epRdDBNZ2nFJFKe1ZrB2L+Tz+MNkE8dpMplwzP1FFrR0j2j5RweYKq1HTYGG3lkzB+vk b1kJfs6OmyT/n0/OVgk/xCSjvQBPLFOIg18HB1Y1ceRm7IFuz94zA+X4/eXe4Nap60Ug WNIR55oBlpz/AGE3svhc20/AM7aHBNswp0UMSlXSRtmElb8SzTbhsg5TwGulVGZiXoDZ cutb2sgTd6MB6UDx212oovrvY5unQfLGacqVBIyGb3GmJ7786GHVYF3sSQ6bOy5drUCG Vbog== X-Forwarded-Encrypted: i=1; AJvYcCWH6NrJWPJk0Q1cKKw1vKfpl7HyGxVcODrrpllvyoQIYM0fcJYCoG6w4leHcptBGBlYkNFOP4qGm26MtS/OSF/a0XQ4pVMHrgOJIg1N X-Gm-Message-State: AOJu0YwURUjGkl8hDRYHrXYnwTx01XXQUIjOA6doZ9Aa0E1Md9Y9waQJ t9pbWN05+tL9LZdNUg4Q5X7HEsCCvHO6umY1ZafI/TenTArxR6OsupznW6NCLVdf1sKx2qbL5hd tGNDF+WXb2+owN+wb0ro5qEE4KP7RSnaqHUPSufGzu7UBs2IyNEM= X-Received: by 2002:a25:2646:0:b0:dcb:e82c:f7f with SMTP id m67-20020a252646000000b00dcbe82c0f7fmr5340785ybm.12.1711373664074; Mon, 25 Mar 2024 06:34:24 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240227153132.2611499-1-jens.wiklander@linaro.org> <20240227153132.2611499-2-jens.wiklander@linaro.org> In-Reply-To: From: Ulf Hansson Date: Mon, 25 Mar 2024 14:33:48 +0100 Message-ID: Subject: Re: [PATCH v3 1/3] rpmb: add Replay Protected Memory Block (RPMB) subsystem To: "Winkler, Tomas" Cc: Avri Altman , Jens Wiklander , "linux-kernel@vger.kernel.org" , "linux-mmc@vger.kernel.org" , "op-tee@lists.trustedfirmware.org" , Shyam Saini , Jerome Forissier , Sumit Garg , Ilias Apalodimas , Bart Van Assche , Randy Dunlap , Ard Biesheuvel , Arnd Bergmann , Greg Kroah-Hartman , =?UTF-8?B?QWxleCBCZW5uw6ll?= Content-Type: text/plain; charset="UTF-8" On Mon, 25 Mar 2024 at 09:23, Winkler, Tomas wrote: > > > > > > +struct rpmb_frame { > > > > + u8 stuff[196]; > > > > + u8 key_mac[32]; > > > > + u8 data[256]; > > > > + u8 nonce[16]; > > > > + __be32 write_counter; > > > > + __be16 addr; > > > > + __be16 block_count; > > > > + __be16 result; > > > > + __be16 req_resp; > > > > +} __packed; > > > > > > I haven't looked at the NVME or the UFS spec in detail. Although, I > > > assume the above frame makes sense for those types of > > interfaces/protocols too? > > The rpmb implementation in ufs, has drifted apart from eMMC. E.g. in > > UFS4.0: > > - the frame is different - see struct ufs_arpmb_meta in > > include/uapi/scsi/scsi_bsg_ufs.h, > > - Additional extended header was added, > > - the frame size is no longer 512Bytes (256Bytes meta info + 256Bytes data) > > but 4k, > > - there are 9 rpmb operations instead of 7, > > - The atomicity requirement of the command sequence was waved, And > > probably more differences that I forgot. > > This is why it is better to designated this as an eMMC-only implementation? > > As I wrote previously the original implementation has already resolved protocol differences > (NVMe have also different byte ordering) for closed usecase of storing data (not the configuration) > I believe the whole point here is to let TEE driver to store the data, regardless of the technology. Yes, I also agree. It makes sense to have a generic way to manage RPMB partitions, even if there are some specific parts that must be managed differently based on the underlying technology. That said, I tend to think that we actually want the UFS and NVMe implementation being included in the $subject series too. To get the complete picture. Otherwise, we may just end up having to redesign a lot of things, if we just start with eMMC. > In addition I might be wrong but I don't see much value in eMMC as the UFS and NVMe are currently leading technologies. Even if UFS and NVMe have been taking over some of the earlier eMMC product segments, I think it's too soon to declare eMMC dead. :-) Moreover, we also have older platforms that we want to get supported upstream and allowing them to move away from downstream-hacks, is also a very good reason to add eMMC support. > Thanks > Tomas > Kind regards Uffe