From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by mx.groups.io with SMTP id smtpd.web11.2307.1615660307413133188 for ; Sat, 13 Mar 2021 10:31:47 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=S0JL4Xvc; spf=pass (domain: linaro.org, ip: 209.85.221.44, mailfrom: ilias.apalodimas@linaro.org) Received: by mail-wr1-f44.google.com with SMTP id a18so6527972wrc.13 for ; Sat, 13 Mar 2021 10:31:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZBtLGgi8gY+h0Rbm7xA0F0M4kxD7a4vLIfrrnKkizTo=; b=S0JL4XvcAemTkWfrHLmpk6DBISou5N/FkixTmgPxgWRpbNkCEQaNnPzldXRn04cp/r Hi0ymxMtrRmG6xl0LcfXgDOTHIB1QMonsMwl+NEfD5kzZln2bWO0izxEBf+jA1F19CqF c0RbAsx0nOVbztQMPecUQkkyAdjPCPoDITXrzd7y47GxP0nF6kApEx6Tj6tOua2YpkHh gx1yhrc7jiJ/S1OmLR4XxrxFRdlCM8LoBwGwHPyDWOaqkKlCCoz6lBiJfpmcFojiYBSi mQNErKJxzCdKgyytN13VlARA8+R0yPphFDO5Q6Cur/k4gRkdp+c/OZ5tBe2gqTNWhPrU 8bfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZBtLGgi8gY+h0Rbm7xA0F0M4kxD7a4vLIfrrnKkizTo=; b=kQxusvZAS38DVCCXW0w3pS7khsr+ysEyRA5pO0nnYasgVbbafIf6a3kCzwPI3TST/k 0tpaVxnLZwNiUKLjipR3XF7ze2hWCHZNkEZgrgY2THN/pgFtItj1S2+DTMxV6s9dUOwG LCaxSCHSobINSFnlq7k6bIfdLFTHmVgcKIRr4lUGCbZ0pWZXcwWqxbRQ36i7kBjpCdvl +0P9mq0Cb0LKw3vT68drBsSNZKZG1g/nUF0Re5BJ1BG/vyO7lio954cK0lEEWO/hfTcH vncRR5yeBckWG5g7JNufwsgSmsqFiQkQa6XVpJ0NKgTcNPZFssFrubpOWsaHRHKh447I WHCg== X-Gm-Message-State: AOAM532xCecx1pFVK6m9EVr5x8lS+ncWgiBjaFd1oq58EgoHhqlslDRk IFxC/NPRE19PGqfolOBmFUPnMgyUL6E5WUrK X-Google-Smtp-Source: ABdhPJz5tLyzGh2eWJIHpUU0mFwhN32Z9RGhLG8k95/cntRM8aVQxNHi88pZeH+xrOWE0RMCigeMgg== X-Received: by 2002:a5d:65d1:: with SMTP id e17mr20441196wrw.53.1615660306026; Sat, 13 Mar 2021 10:31:46 -0800 (PST) Return-Path: Received: from apalos.home ([2a02:587:4647:e6c6:2e56:dcff:fe9a:8f06]) by smtp.gmail.com with ESMTPSA id s18sm14744164wrr.27.2021.03.13.10.31.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Mar 2021 10:31:45 -0800 (PST) From: "Ilias Apalodimas" To: devel@edk2.groups.io, sami.mujawar@arm.com, pierre.gondois@arm.com Cc: ardb+tianocore@kernel.org, sughosh.ganu@linaro.org, leif@nuviainc.com, Ilias Apalodimas Subject: [PATCH 0/3 v7] Add support for running StandaloneMm as OP-TEE TA Date: Sat, 13 Mar 2021 20:31:36 +0200 Message-Id: <20210313183139.3256104-1-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi, This is v7 of [1] Changes since V6: - Added param[in,out] in comments - Fixed an error on Maintainers entry Changes since V5: - Addressed coding style fixes from Pierre - Removed redundant checks in memory allocation and block usage - Removed unused COMPRESSION_TOOL_GUID - Renamed the files and directories following Leif's sugestion - Added Sami and myself as maintainers Changes since V4: - More coding stule fixes proposed by Sami, which Ecc or Patchcheck didn't report. - Adding missing error handling in InitializeFvAndVariableStoreHeaders(). An allocation wasn't properly checked for success Changes since V3: - Coding style fixes proposed by Sami - Fixed all reported PatchCheck errors - Added overflow checks on the base aaddress allocated for EFI variables. The size of the partition is user defined (via Pcd's) and the memory layout and allocation address depends on OP-TEE. So let's make sure we won't overflow when calculating the 3 partitions needed for FTW - Switched some PcdGet/Set32 to 64 to accomodate 64-bit addressing - Removed some duplicate entries in Platform/StMMRpmb/PlatformStandaloneMm.dsc - Added reviewed-by tags on patch 2/2 Changes since V2: - Allocate a dynamic number of pages based on the Pcd values instead of a static number - Clean up unused structs in header file - Added checks in OpTeeRpmbFvbGetBlockSize and handle NumLba=0 Changes since V1: Some enhancements made by Ilias to the Optee Rpmb driver [1] https://edk2.groups.io/g/devel/message/66483?p=,,,20,0,0,0::Created,,ilias+apalodimas,20,2,0,77703661 Ilias Apalodimas (3): Drivers/OpTeeRpmb: Add an OP-TEE backed RPMB driver StMMRpmb: Add support for building StandaloneMm image for OP-TEE Maintainers: Add maintainers for StandAloneMM and RPMB driver Drivers/OpTee/OpteeRpmbPkg/FixupPcd.c | 81 ++ Drivers/OpTee/OpteeRpmbPkg/FixupPcd.inf | 43 + Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFv.inf | 58 ++ Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c | 861 ++++++++++++++++++ Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.h | 51 ++ Maintainers.txt | 10 + .../PlatformStandaloneMmRpmb.dsc | 162 ++++ .../PlatformStandaloneMmRpmb.fdf | 111 +++ 8 files changed, 1377 insertions(+) create mode 100644 Drivers/OpTee/OpteeRpmbPkg/FixupPcd.c create mode 100644 Drivers/OpTee/OpteeRpmbPkg/FixupPcd.inf create mode 100644 Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFv.inf create mode 100644 Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c create mode 100644 Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.h create mode 100644 Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.dsc create mode 100644 Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.fdf -- 2.30.1