[edk2-devel] [PATCH 0/2] ArmPlatformPkg/NorFlashDxe: implement standalone MM version

Masahisa Kojima posted 2 patches 3 years, 3 months ago
Failed in applying to current master (apply log)
.../Drivers/NorFlashDxe/NorFlashDxe.inf       |    5 +-
...rFlashDxe.inf => NorFlashStandaloneMm.inf} |   40 +-
.../NorFlashDxe/{NorFlashDxe.h => NorFlash.h} |   86 +-
.../NorFlashDxe/{NorFlashDxe.c => NorFlash.c} |  372 +-----
.../Drivers/NorFlashDxe/NorFlashBlockIoDxe.c  |    2 +-
.../Drivers/NorFlashDxe/NorFlashDxe.c         | 1066 ++---------------
.../{NorFlashFvbDxe.c => NorFlashFvb.c}       |  107 +-
.../NorFlashDxe/NorFlashStandaloneMm.c        |  364 ++++++
8 files changed, 573 insertions(+), 1469 deletions(-)
copy ArmPlatformPkg/Drivers/NorFlashDxe/{NorFlashDxe.inf => NorFlashStandaloneMm.inf} (59%)
rename ArmPlatformPkg/Drivers/NorFlashDxe/{NorFlashDxe.h => NorFlash.h} (85%)
copy ArmPlatformPkg/Drivers/NorFlashDxe/{NorFlashDxe.c => NorFlash.c} (71%)
rename ArmPlatformPkg/Drivers/NorFlashDxe/{NorFlashFvbDxe.c => NorFlashFvb.c} (85%)
create mode 100644 ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashStandaloneMm.c
[edk2-devel] [PATCH 0/2] ArmPlatformPkg/NorFlashDxe: implement standalone MM version
Posted by Masahisa Kojima 3 years, 3 months ago
To support secure variable storage on the aarch64 SBSA-QEMU platform,
this patch series implement the NOR Flash driver for standalone MM.

What have been tested:
For DXE driver, uefi variable storage works fine on the ArmVirtQemu platform.
For Standalone MM driver, uefi secure variable storage works fine
on the SBSA-QEMU platform.
Note that SBSA-QEMU secure variable storage handling is not yet upstreamed,
because it needs this standalone MM NOR Flash driver.

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>

Masahisa Kojima (2):
  ArmPlatformPkg/NorFlashDxe: factor out DXE specific pieces
  ArmPlatformPkg/NorFlashDxe: implement standalone MM version

 .../Drivers/NorFlashDxe/NorFlashDxe.inf       |    5 +-
 ...rFlashDxe.inf => NorFlashStandaloneMm.inf} |   40 +-
 .../NorFlashDxe/{NorFlashDxe.h => NorFlash.h} |   86 +-
 .../NorFlashDxe/{NorFlashDxe.c => NorFlash.c} |  372 +-----
 .../Drivers/NorFlashDxe/NorFlashBlockIoDxe.c  |    2 +-
 .../Drivers/NorFlashDxe/NorFlashDxe.c         | 1066 ++---------------
 .../{NorFlashFvbDxe.c => NorFlashFvb.c}       |  107 +-
 .../NorFlashDxe/NorFlashStandaloneMm.c        |  364 ++++++
 8 files changed, 573 insertions(+), 1469 deletions(-)
 copy ArmPlatformPkg/Drivers/NorFlashDxe/{NorFlashDxe.inf => NorFlashStandaloneMm.inf} (59%)
 rename ArmPlatformPkg/Drivers/NorFlashDxe/{NorFlashDxe.h => NorFlash.h} (85%)
 copy ArmPlatformPkg/Drivers/NorFlashDxe/{NorFlashDxe.c => NorFlash.c} (71%)
 rename ArmPlatformPkg/Drivers/NorFlashDxe/{NorFlashFvbDxe.c => NorFlashFvb.c} (85%)
 create mode 100644 ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashStandaloneMm.c

-- 
2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#69177): https://edk2.groups.io/g/devel/message/69177
Mute This Topic: https://groups.io/mt/79058286/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH 0/2] ArmPlatformPkg/NorFlashDxe: implement standalone MM version
Posted by Ard Biesheuvel 3 years, 2 months ago
On 12/18/20 11:05 AM, Masahisa Kojima wrote:
> To support secure variable storage on the aarch64 SBSA-QEMU platform,
> this patch series implement the NOR Flash driver for standalone MM.
> 
> What have been tested:
> For DXE driver, uefi variable storage works fine on the ArmVirtQemu platform.
> For Standalone MM driver, uefi secure variable storage works fine
> on the SBSA-QEMU platform.
> Note that SBSA-QEMU secure variable storage handling is not yet upstreamed,
> because it needs this standalone MM NOR Flash driver.
> 
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
> Cc: Sami Mujawar <sami.mujawar@arm.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
> 
> Masahisa Kojima (2):
>   ArmPlatformPkg/NorFlashDxe: factor out DXE specific pieces
>   ArmPlatformPkg/NorFlashDxe: implement standalone MM version
> 

Thanks Masahisa. This looks fine to me.

I have taken the liberty of adding the hunk below so the driver can be
built for testing purposes from ArmPlatformPkg.dsc. I also needed to
replace some instances of EFI_D_ERROR with DEBUG_ERROR to placate
PatchCheck.

For the series,

Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>

Merged as #1285




index b92ef712be87..88fe1247c03b 100644
--- a/ArmPlatformPkg/ArmPlatformPkg.dsc
+++ b/ArmPlatformPkg/ArmPlatformPkg.dsc
@@ -90,6 +90,12 @@ [LibraryClasses.common.SEC]

MemoryAllocationLib|EmbeddedPkg/Library/PrePiMemoryAllocationLib/PrePiMemoryAllocationLib.inf

PrePiHobListPointerLib|ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointerLib.inf

+[LibraryClasses.AARCH64.MM_STANDALONE]
+  HobLib|StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.inf
+
MemoryAllocationLib|StandaloneMmPkg/Library/StandaloneMmMemoryAllocationLib/StandaloneMmMemoryAllocationLib.inf
+
MmServicesTableLib|MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.inf
+
StandaloneMmDriverEntryPoint|MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.inf
+
 [Components.common]
   ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.inf
   ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
@@ -122,3 +128,6 @@ [Components.common]
   ArmPlatformPkg/PrePi/PeiUniCore.inf

   ArmPlatformPkg/Library/ArmMaliDp/ArmMaliDp.inf
+
+[Components.AARCH64]
+  ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashStandaloneMm.inf



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#69622): https://edk2.groups.io/g/devel/message/69622
Mute This Topic: https://groups.io/mt/79058286/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-