From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by mx.groups.io with SMTP id smtpd.web09.7331.1613151303885149936 for ; Fri, 12 Feb 2021 09:35:04 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=rYN4FNbo; spf=pass (domain: linaro.org, ip: 209.85.128.46, mailfrom: ilias.apalodimas@linaro.org) Received: by mail-wm1-f46.google.com with SMTP id l17so340421wmq.2 for ; Fri, 12 Feb 2021 09:35:03 -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=uE8heOexXb1GjmDjY52kEZAN+7vLx/F4L4fjIcr05a8=; b=rYN4FNboa9NR18JsyfMe8vkmc65l1UROEIFs6RriUIlPXUiAQH1SpEz/N6epLGpjjR daWFwGA2mmOJgr2XDFk7ghhnvCL0mwiJADbVLMKHrtwnqIP6bdMpUkbTxvtW1Wbpmkol qr2o3P6YbrZ6QpNmjhlVQLU+Ic1zdGrKbXmJ4odMb38+7hfEvipk4SG2CDLZFOdYQCMz QmbFULkkrkKLnEgwoCod5Sx8fEKyxs5+tQC/8UH6vPLOwHmZAGQegMgstVW+TP874E1I 2nQ99WCRN6Bhz3RrG9vXAGEBGiejMWFZr6Z8HFbdv1rDosVoUQrMq7AYEjKXZCtEvtJS mtRQ== 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=uE8heOexXb1GjmDjY52kEZAN+7vLx/F4L4fjIcr05a8=; b=mRcuYt8KyDD5pIK8hIGEDH7KzjaMtVCFEf2ab3e9MI6zwSFqHtONVyin/JbBlmGL6W NVZqSbxzhEOVZDdRZhkMrIp/atG1mF4FQhdaXDFN0Ec4zfkJVeojQH8YWW0r3aw3dJz5 pnaVeZaYFDxywnbobpdhC0OZiwtLOx+jaW3CXhgqlSa7kKy16g+YTAzxrOCyP99Va8L4 kPsb4ubBqVRuWw5KdAns6dSGjwBHn6Zn4XCtbYf8nBiXwLKHfGTbnqi5cs5UtsgerkpH 0DyhwWo4xA1surQDAH3+GDudF3/GS6cAG0iqK1ajM2d3p46TZDQLmaQd438tvNuvUbBW PNGA== X-Gm-Message-State: AOAM532WIadPXw0MvGwb33OCnJnIf+4o+Ebx64DNdOoNgklYVKU5VuAY uiwOPi4L14oijcG9XQznL69zdwnBKN//yv/p X-Google-Smtp-Source: ABdhPJz0SNr/ylj5OpGSHX48Ky75u+su07hqj3UxjivHWjpqbN8Xvtzix9R3bSbT+JgtYvpScoFDIw== X-Received: by 2002:a7b:ce8c:: with SMTP id q12mr3592517wmj.127.1613151302501; Fri, 12 Feb 2021 09:35:02 -0800 (PST) Return-Path: Received: from apalos.home ([2a02:587:4647:e6c6:2e56:dcff:fe9a:8f06]) by smtp.gmail.com with ESMTPSA id h13sm11535852wrv.20.2021.02.12.09.35.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Feb 2021 09:35:02 -0800 (PST) From: "Ilias Apalodimas" To: devel@edk2.groups.io, sami.mujawar@arm.com Cc: ardb+tianocore@kernel.org, sughosh.ganu@linaro.org, leif@nuviainc.com, Ilias Apalodimas Subject: [PATCH 0/2 v5] Add support for running StandaloneMm as OP-TEE TA Date: Fri, 12 Feb 2021 19:34:57 +0200 Message-Id: <20210212173459.508205-1-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi, This is v5 of [1] 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 (2): Drivers/OpTeeRpmb: Add an OP-TEE backed RPMB driver StMMRpmb: Add support for building StandaloneMm image for OP-TEE Drivers/OpTeeRpmb/FixupPcd.c | 89 ++ Drivers/OpTeeRpmb/FixupPcd.inf | 43 + Drivers/OpTeeRpmb/OpTeeRpmbFv.inf | 58 ++ Drivers/OpTeeRpmb/OpTeeRpmbFvb.c | 920 +++++++++++++++++++++ Drivers/OpTeeRpmb/OpTeeRpmbFvb.h | 52 ++ Platform/StMMRpmb/PlatformStandaloneMm.dsc | 165 ++++ Platform/StMMRpmb/PlatformStandaloneMm.fdf | 111 +++ 7 files changed, 1438 insertions(+) create mode 100644 Drivers/OpTeeRpmb/FixupPcd.c create mode 100644 Drivers/OpTeeRpmb/FixupPcd.inf create mode 100644 Drivers/OpTeeRpmb/OpTeeRpmbFv.inf create mode 100644 Drivers/OpTeeRpmb/OpTeeRpmbFvb.c create mode 100644 Drivers/OpTeeRpmb/OpTeeRpmbFvb.h create mode 100644 Platform/StMMRpmb/PlatformStandaloneMm.dsc create mode 100644 Platform/StMMRpmb/PlatformStandaloneMm.fdf -- 2.30.0