From nobody Mon May 6 00:24:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+72373+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+72373+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1614753904; cv=none; d=zohomail.com; s=zohoarc; b=Xe0oOSmFXxwuB1krEwy59nms1nHnE8DfwKiBXaD4DMgpDRjcMuIo7iSm1IKW/77naXxe1AXDzjI5Ic2b0H7sf5SWNUhMRhOTgo4xIMdXR8FJqrpjcPjLWDffupLHdt6Sa6jRhZ77xM4wIHfp2T/LtXL+kIx7YLglvOhAZ+Lmb/o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614753904; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=1mzw42RmKKb91Hy92w0OQgBWcln0RP82CJm8pY9XVNE=; b=FyPFnTexbB0GJwBiPzSJjdCe34l0Jeg95+bDz8azXqkAXleDwEkQ8JkYU+dYomX6T0QvcoCIrQVPPyAOxXP1x2F1i5P5TCh8GVIXEWark4NR/ks3lXVyEx45vP98oLOHg/G5xuAlgWHtRB89VaL+7hwdUlGV2RVsUSZVLmyE7kw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+72373+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1614753904193935.0325711125838; Tue, 2 Mar 2021 22:45:04 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id PvpRYY1788612xa2xUovzQQJ; Tue, 02 Mar 2021 22:45:03 -0800 X-Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by mx.groups.io with SMTP id smtpd.web08.3521.1614753898356724492 for ; Tue, 02 Mar 2021 22:44:58 -0800 X-Received: by mail-pl1-f179.google.com with SMTP id d8so3070353plg.10 for ; Tue, 02 Mar 2021 22:44:58 -0800 (PST) X-Gm-Message-State: pPUMxLrQd5wlW788RLKGmd5rx1787277AA= X-Google-Smtp-Source: ABdhPJytXK2YSxQrrpCIwG5MyHoA+8DWni+COG91Qpd2m5M963gnl6uBMDTtTaLPKUCJr98dGTq6tQ== X-Received: by 2002:a17:90a:950b:: with SMTP id t11mr2746205pjo.176.1614753897782; Tue, 02 Mar 2021 22:44:57 -0800 (PST) X-Received: from localhost.localdomain ([2400:2411:502:a100:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id ms21sm5809240pjb.5.2021.03.02.22.44.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 22:44:57 -0800 (PST) From: "Masahisa Kojima" To: devel@edk2.groups.io Cc: Masahisa Kojima , Ard Biesheuvel , Leif Lindholm , Graeme Gregory , Radoslaw Biernacki , Shashi Mallela Subject: [edk2-devel] [PATCH edk2-platforms v3 1/4] SbsaQemu: Build infrastructure for StandaloneMm image Date: Wed, 3 Mar 2021 15:47:44 +0900 Message-Id: <20210303064747.27312-2-masahisa.kojima@linaro.org> In-Reply-To: <20210303064747.27312-1-masahisa.kojima@linaro.org> References: <20210303064747.27312-1-masahisa.kojima@linaro.org> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,masahisa.kojima@linaro.org Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1614753903; bh=ViyZFEseLuDOeUCCljALgfUP7lMDBOr/AaDis1yFT1E=; h=Cc:Date:From:Reply-To:Subject:To; b=fLCsxEZH+cd5U/Q5GgTOhvyZJs5kKlTAqt95lLn1HWIWCof6iBPNWOXiLuHTI3SbiLq DELf9v5HqWrVKB0i2gqo8GiZcSbhfcHVRKXrRH89Vqpglzwv/AM+MpVsAnGOYxq/emnFM VnPl336dQq10mWz65mhG+aCztFRU4Vjql9k= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Add the build infrastructure for compilation of StandaloneMm image. SbsaQemu.fdf is modified to extend the FLASH0 region enough big to contain StandaloneMM image(BL32). Signed-off-by: Masahisa Kojima --- Platform/Qemu/SbsaQemu/SbsaQemuStandaloneMm.dsc | 132 ++++++++++++++++++++ Platform/Qemu/SbsaQemu/SbsaQemu.fdf | 6 +- Platform/Qemu/SbsaQemu/SbsaQemuStandaloneMm.fdf | 93 ++++++++++++++ 3 files changed, 228 insertions(+), 3 deletions(-) diff --git a/Platform/Qemu/SbsaQemu/SbsaQemuStandaloneMm.dsc b/Platform/Qem= u/SbsaQemu/SbsaQemuStandaloneMm.dsc new file mode 100644 index 000000000000..87f5ee351eaa --- /dev/null +++ b/Platform/Qemu/SbsaQemu/SbsaQemuStandaloneMm.dsc @@ -0,0 +1,132 @@ +# +# Copyright (c) 2020, Linaro Limited. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# + +##########################################################################= ###### +# +# Defines Section - statements that will be processed to create a Makefile. +# +##########################################################################= ###### +[Defines] + PLATFORM_NAME =3D SbsaQemuStandaloneMm + PLATFORM_GUID =3D A64CC0F5-7ACD-4975-BBE7-7EF6739C8668 + PLATFORM_VERSION =3D 1.0 + DSC_SPECIFICATION =3D 0x00010011 + OUTPUT_DIRECTORY =3D Build/$(PLATFORM_NAME) + SUPPORTED_ARCHITECTURES =3D AARCH64 + BUILD_TARGETS =3D DEBUG|RELEASE|NOOPT + SKUID_IDENTIFIER =3D DEFAULT + FLASH_DEFINITION =3D Platform/Qemu/SbsaQemu/SbsaQemuStanda= loneMm.fdf + DEFINE DEBUG_MESSAGE =3D TRUE + + # LzmaF86 + DEFINE COMPRESSION_TOOL_GUID =3D D42AE6BD-1352-4bfb-909A-CA72A6EAE889 + +##########################################################################= ###### +# +# Library Class section - list of all Library Classes needed by this Platf= orm. +# +##########################################################################= ###### +[LibraryClasses] + # + # Basic + # + BaseLib|MdePkg/Library/BaseLib/BaseLib.inf + BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf + DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseD= ebugPrintErrorLevelLib.inf + ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib= /PrePiExtractGuidedSectionLib.inf + FvLib|StandaloneMmPkg/Library/FvLib/FvLib.inf + HobLib|StandaloneMmPkg/Library/StandaloneMmCoreHobLib/StandaloneMmCoreHo= bLib.inf + IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf + MemLib|StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf + MemoryAllocationLib|StandaloneMmPkg/Library/StandaloneMmCoreMemoryAlloca= tionLib/StandaloneMmCoreMemoryAllocationLib.inf + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf + PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf + PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf + ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseRepor= tStatusCodeLibNull.inf + + # + # Entry point + # + StandaloneMmDriverEntryPoint|MdePkg/Library/StandaloneMmDriverEntryPoint= /StandaloneMmDriverEntryPoint.inf + + ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf + StandaloneMmMmuLib|ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmL= ib.inf + ArmSvcLib|ArmPkg/Library/ArmSvcLib/ArmSvcLib.inf + CacheMaintenanceLib|ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMainte= nanceLib.inf + PeCoffExtraActionLib|StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActi= onLib/StandaloneMmPeCoffExtraActionLib.inf + + # ARM PL011 UART Driver + PL011UartClockLib|ArmPlatformPkg/Library/PL011UartClockLib/PL011UartCloc= kLib.inf + PL011UartLib|ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.inf + SerialPortLib|ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortL= ib.inf + + StandaloneMmCoreEntryPoint|StandaloneMmPkg/Library/StandaloneMmCoreEntry= Point/StandaloneMmCoreEntryPoint.inf + + # + # It is not possible to prevent the ARM compiler for generic intrinsic f= unctions. + # This library provides the instrinsic functions generate by a given com= piler. + # And NULL mean link this library into all ARM images. + # + NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf + +[LibraryClasses.common.MM_STANDALONE] + HobLib|StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.inf + MmServicesTableLib|MdePkg/Library/StandaloneMmServicesTableLib/Standalon= eMmServicesTableLib.inf + MemoryAllocationLib|StandaloneMmPkg/Library/StandaloneMmMemoryAllocation= Lib/StandaloneMmMemoryAllocationLib.inf + +##########################################################################= ###### +# +# Pcd Section - list of all EDK II PCD Entries defined by this Platform +# +##########################################################################= ###### +[PcdsFixedAtBuild] + gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x800000CF + gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0xff + gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x0f + + ## PL011 - Serial Terminal + gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x60040000 + gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|115200 + + gEfiMdePkgTokenSpaceGuid.PcdMaximumGuidedExtractHandler|0x2 + +##########################################################################= ######################### +# +# Components Section - list of the modules and components that will be pro= cessed by compilation +# tools and the EDK II tools to generate PE32/PE32+/C= off image files. +# +# Note: The EDK II DSC file is not used to specify how compiled binary ima= ges get placed +# into firmware volume images. This section is just a list of module= s to compile from +# source into UEFI-compliant binaries. +# It is the FDF file that contains information on combining binary f= iles into firmware +# volume images, whose concept is beyond UEFI and is described in PI= specification. +# Binary modules do not need to be listed in this section, as they s= hould be +# specified in the FDF file. For example: Shell binary (Shell_Full.e= fi), FAT binary (Fat.efi), +# Logo (Logo.bmp), and etc. +# There may also be modules listed in this section that are not requ= ired in the FDF file, +# When a module listed here is excluded from FDF file, then UEFI-com= pliant binary will be +# generated for it, but the binary will not be put into any firmware= volume. +# +##########################################################################= ######################### +[Components.common] + # + # MM Core + # + StandaloneMmPkg/Core/StandaloneMmCore.inf + StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf + +##########################################################################= ######################### +# +# BuildOptions Section - Define the module specific tool chain flags that = should be used as +# the default flags for a module. These flags are a= ppended to any +# standard flags that are defined by the build proc= ess. They can be +# applied for any modules or only those modules wit= h the specific +# module style (EDK or EDKII) specified in [Compone= nts] section. +# +##########################################################################= ######################### +[BuildOptions.AARCH64] + GCC:*_*_*_DLINK_FLAGS =3D -z common-page-size=3D0x1000 -march=3Darmv8-a+= nofp diff --git a/Platform/Qemu/SbsaQemu/SbsaQemu.fdf b/Platform/Qemu/SbsaQemu/S= bsaQemu.fdf index c35e3ed44054..b61ae1891233 100644 --- a/Platform/Qemu/SbsaQemu/SbsaQemu.fdf +++ b/Platform/Qemu/SbsaQemu/SbsaQemu.fdf @@ -21,10 +21,10 @@ =20 [FD.SBSA_FLASH0] BaseAddress =3D 0x00000000 -Size =3D 0x00200000 +Size =3D 0x00400000 ErasePolarity =3D 1 BlockSize =3D 0x00001000 -NumBlocks =3D 0x200 +NumBlocks =3D 0x400 =20 ##########################################################################= ###### # @@ -47,7 +47,7 @@ [FD.SBSA_FLASH0] FILE =3D Platform/Qemu/Sbsa/bl1.bin =20 # and FIP (BL2 + BL31) -0x00008000|0x00020000 +0x00008000|0x00300000 FILE =3D Platform/Qemu/Sbsa/fip.bin =20 ##########################################################################= ###### diff --git a/Platform/Qemu/SbsaQemu/SbsaQemuStandaloneMm.fdf b/Platform/Qem= u/SbsaQemu/SbsaQemuStandaloneMm.fdf new file mode 100644 index 000000000000..a1acefcfb0a7 --- /dev/null +++ b/Platform/Qemu/SbsaQemu/SbsaQemuStandaloneMm.fdf @@ -0,0 +1,93 @@ +# +# Copyright (c) 2020, Linaro Limited. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# + +##########################################################################= ###### +# +# FD Section +# The [FD] Section is made up of the definition statements and a +# description of what goes into the Flash Device Image. Each FD section +# defines one flash "device" image. A flash device image may be one of +# the following: Removable media bootable image (like a boot floppy +# image,) an Option ROM image (that would be "flashed" into an add-in +# card,) a System "Flash" image (that would be burned into a system's +# flash) or an Update ("Capsule") image that will be used to update and +# existing system flash. +# +##########################################################################= ###### + +[FD.STANDALONE_MM] +BaseAddress =3D 0x20001000|gArmTokenSpaceGuid.PcdFdBaseAddress +Size =3D 0x00e00000|gArmTokenSpaceGuid.PcdFdSize # The size in by= tes of the device (14MiB). +ErasePolarity =3D 1 + +BlockSize =3D 0x00001000 +NumBlocks =3D 0x0e00 + +0x00000000|0x00280000 +gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize +FV =3D FVMAIN_COMPACT + +[FV.FVMAIN_COMPACT] +FvAlignment =3D 16 +ERASE_POLARITY =3D 1 +MEMORY_MAPPED =3D TRUE +STICKY_WRITE =3D TRUE +LOCK_CAP =3D TRUE +LOCK_STATUS =3D TRUE +WRITE_DISABLED_CAP =3D TRUE +WRITE_ENABLED_CAP =3D TRUE +WRITE_STATUS =3D TRUE +WRITE_LOCK_CAP =3D TRUE +WRITE_LOCK_STATUS =3D TRUE +READ_DISABLED_CAP =3D TRUE +READ_ENABLED_CAP =3D TRUE +READ_STATUS =3D TRUE +READ_LOCK_CAP =3D TRUE +READ_LOCK_STATUS =3D TRUE + + INF StandaloneMmPkg/Core/StandaloneMmCore.inf + INF StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf + +##########################################################################= ###### +# +# Rules are use with the [FV] section's module INF type to define +# how an FFS file is created for a given INF file. The following Rule are = the default +# rules for the different module type. User can add the customized rules t= o define the +# content of the FFS file. +# +##########################################################################= ###### + + +##########################################################################= ## +# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section = # +##########################################################################= ## +# +#[Rule.Common.DXE_DRIVER] +# FILE DRIVER =3D $(NAMED_GUID) { +# DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_= NAME).depex +# COMPRESS PI_STD { +# GUIDED { +# PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi +# UI STRING=3D"$(MODULE_NAME)" Optional +# VERSION STRING=3D"$(INF_VERSION)" Optional BUILD_NUM=3D$(BUILD_N= UMBER) +# } +# } +# } +# +##########################################################################= ## + +[Rule.Common.MM_CORE_STANDALONE] + FILE SEC =3D $(NAMED_GUID) RELOCS_STRIPPED FIXED { + PE32 PE32 Align =3D Auto $(INF_OUTPUT)/$(MODULE_NAME).efi + } + +[Rule.Common.MM_STANDALONE] + FILE MM_STANDALONE =3D $(NAMED_GUID) { + SMM_DEPEX SMM_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex + PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi + UI STRING=3D"$(MODULE_NAME)" Optional + VERSION STRING=3D"$(INF_VERSION)" Optional BUILD_NUM=3D$(BUILD_NUMBE= R) + } --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#72373): https://edk2.groups.io/g/devel/message/72373 Mute This Topic: https://groups.io/mt/81046683/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Mon May 6 00:24:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+72374+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+72374+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1614753902; cv=none; d=zohomail.com; s=zohoarc; b=D6Fht+emk1tDq0Rzi/ihUY2emZ0m7525RHi0+C9OultVoG7zPLMJbfALDJ+HtFieaZ3oTZBM+roRH5gurDc3KRuM46VZrUy4VBkwAE0ja5uZfaKNvrslorHhMWd1yxOx7pfNqwkh+dHuCRfGGX4ttIJWMs7E/B7YW8bdY9GLuvs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614753902; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=VUovKE5Zu3q7VkbqzS26JcQENP/e1LcW3xDKn1RDLXs=; b=mtxYwbSckuyVRC5OzwACbUkg2FzFZOXN4o96oiAEXnztCz6LKITtKjWI1i3XTkVhtJIgxEnSCSVlb/QAV/9r0RGBiuCktXSEdZrRm6XWRGqe7G0xg9Z53fGYLpCmjyjO7iCWwMXNzQYBnu/E4MeTdOVLjZd8E9P+PyQu/ektovM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+72374+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1614753902234571.229396600494; Tue, 2 Mar 2021 22:45:02 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 2PRpYY1788612xdFuSt8jf1A; Tue, 02 Mar 2021 22:45:01 -0800 X-Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by mx.groups.io with SMTP id smtpd.web09.3560.1614753901408527419 for ; Tue, 02 Mar 2021 22:45:01 -0800 X-Received: by mail-pj1-f45.google.com with SMTP id i14so3535754pjz.4 for ; Tue, 02 Mar 2021 22:45:01 -0800 (PST) X-Gm-Message-State: 3ySy1I5KgQe9bCPbJeiCB17jx1787277AA= X-Google-Smtp-Source: ABdhPJxxolm2CFhAmlJwXkSEVsOYDY4TUPesrGgKZK59hSySUnx6WtYv+9bLuhPvGkH3Rkvzw7wf0g== X-Received: by 2002:a17:90b:1213:: with SMTP id gl19mr8181497pjb.55.1614753900723; Tue, 02 Mar 2021 22:45:00 -0800 (PST) X-Received: from localhost.localdomain ([2400:2411:502:a100:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id ms21sm5809240pjb.5.2021.03.02.22.44.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 22:44:59 -0800 (PST) From: "Masahisa Kojima" To: devel@edk2.groups.io Cc: Masahisa Kojima , Ard Biesheuvel , Leif Lindholm , Graeme Gregory , Radoslaw Biernacki , Shashi Mallela Subject: [edk2-devel] [PATCH edk2-platforms v3 2/4] SbsaQemu: add MM based UEFI secure boot support Date: Wed, 3 Mar 2021 15:47:45 +0900 Message-Id: <20210303064747.27312-3-masahisa.kojima@linaro.org> In-Reply-To: <20210303064747.27312-1-masahisa.kojima@linaro.org> References: <20210303064747.27312-1-masahisa.kojima@linaro.org> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,masahisa.kojima@linaro.org Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1614753901; bh=YI9Yo7TbPe73m/BLPjjr+vEhrCfrEeJmcqsQs+4/EwY=; h=Cc:Date:From:Reply-To:Subject:To; b=v5bQzNejEfe3MpLhGN1TZ21Yb+5mbl22Gk+HAufJbH7CCr6uFs+1xLfYqOrq2cn7NCF EklwVNiGbUfw7dAphlvDPt8f+A85VMiZkxujIkrm9ErN8ip5fzThujo1PU4wI5ji2xwqK 9y6OEzVGdysqnSFhHroIJmvn8Y9w52NpqRg= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" This implements support for UEFI secure boot on SbsaQemu using the standalone MM framework. This moves all of the software handling of the UEFI authenticated variable store into the standalone MM context residing in a secure partition. Secure variable storage is located at 0x01000000 in secure NOR Flash. Non-secure shared memory between UEFI and standalone MM is allocated at the top of DRAM. DRAM size of SbsaQemu varies depends on the QEMU parameter, the non-secure shared memory base address is passed from trusted-firmware through the device tree "/reserved-memory" node. Together with "/reserved-memory" parsing implementation newly added in this commit, pre-existing "/memory" node parsing is moved to a helper function in FdtHelperLib. Signed-off-by: Masahisa Kojima --- Platform/Qemu/SbsaQemu/SbsaQemu.dsc | 25 ++++- Platform/Qemu/SbsaQemu/SbsaQemuStandaloneMm.dsc | 39 +++++++ Platform/Qemu/SbsaQemu/SbsaQemu.fdf | 81 ++++++++++= ++-- Platform/Qemu/SbsaQemu/SbsaQemuStandaloneMm.fdf | 7 +- Silicon/Qemu/SbsaQemu/Library/SbsaQemuLib/SbsaQemuLib.inf | 3 + Silicon/Qemu/SbsaQemu/Include/Library/FdtHelperLib.h | 27 +++++ Silicon/Qemu/SbsaQemu/Library/FdtHelperLib/FdtHelperLib.c | 111 ++++++++++= ++++++++++ Silicon/Qemu/SbsaQemu/Library/SbsaQemuLib/SbsaQemuMem.c | 55 +++------- 8 files changed, 294 insertions(+), 54 deletions(-) diff --git a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc b/Platform/Qemu/SbsaQemu/S= bsaQemu.dsc index c1f8a4696560..8a239bd17138 100644 --- a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc +++ b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc @@ -28,6 +28,8 @@ [Defines] =20 DEFINE DEBUG_PRINT_ERROR_LEVEL =3D 0x8000004F =20 + DEFINE SECURE_BOOT_ENABLE =3D FALSE + # # Network definition # @@ -152,12 +154,10 @@ [LibraryClasses.common] # Secure Boot dependencies # TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasure= mentLib.inf - AuthVariableLib|SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf =20 # re-use the UserPhysicalPresent() dummy implementation from the ovmf tr= ee PlatformSecureLib|OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.inf =20 - VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyL= ib.inf VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/Var= iablePolicyHelperLib.inf =20 @@ -300,6 +300,8 @@ [PcdsFeatureFlag.common] gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE =20 + gEfiMdeModulePkgTokenSpaceGuid.PcdEnableVariableRuntimeCache|FALSE + [PcdsFixedAtBuild.common] gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|1000000 gEfiMdePkgTokenSpaceGuid.PcdMaximumAsciiStringLength|1000000 @@ -551,6 +553,9 @@ [PcdsDynamicDefault.common] gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdChassisAssetTag|L"AT0000" gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdChassisSKU|L"SK0000" =20 + gArmTokenSpaceGuid.PcdMmBufferBase|0x10000000000 + gArmTokenSpaceGuid.PcdMmBufferSize|0x00200000 + ##########################################################################= ###### # # Components Section - list of all EDK II Modules needed by this Platform @@ -628,19 +633,31 @@ [Components.common] # ArmPkg/Drivers/CpuDxe/CpuDxe.inf MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf +!if $(SECURE_BOOT_ENABLE) =3D=3D FALSE + MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf { NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf + AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariabl= eLibNull.inf + VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf # don't use unaligned CopyMem () on the UEFI varstore NOR flash regi= on BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf } +!else + ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf { + + NULL|StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependen= cy.inf + } + MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf + SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDx= e.inf +!endif MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf { +!if $(SECURE_BOOT_ENABLE) =3D=3D TRUE NULL|SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificatio= nLib.inf +!endif } - SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDx= e.inf MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf - MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntim= eDxe.inf MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf diff --git a/Platform/Qemu/SbsaQemu/SbsaQemuStandaloneMm.dsc b/Platform/Qem= u/SbsaQemu/SbsaQemuStandaloneMm.dsc index 87f5ee351eaa..b80379acd1ad 100644 --- a/Platform/Qemu/SbsaQemu/SbsaQemuStandaloneMm.dsc +++ b/Platform/Qemu/SbsaQemu/SbsaQemuStandaloneMm.dsc @@ -77,6 +77,18 @@ [LibraryClasses.common.MM_STANDALONE] HobLib|StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.inf MmServicesTableLib|MdePkg/Library/StandaloneMmServicesTableLib/Standalon= eMmServicesTableLib.inf MemoryAllocationLib|StandaloneMmPkg/Library/StandaloneMmMemoryAllocation= Lib/StandaloneMmMemoryAllocationLib.inf + AuthVariableLib|SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf + BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf + IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf + NorFlashPlatformLib|Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/Sb= saQemuNorFlashLib.inf + OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf + RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf + PlatformSecureLib|SecurityPkg/Library/PlatformSecureLibNull/PlatformSecu= reLibNull.inf + SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchroniza= tionLib.inf + TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf + VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf + SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf + ArmGenericTimerCounterLib|ArmPkg/Library/ArmGenericTimerPhyCounterLib/Ar= mGenericTimerPhyCounterLib.inf =20 ##########################################################################= ###### # @@ -94,6 +106,20 @@ [PcdsFixedAtBuild] =20 gEfiMdePkgTokenSpaceGuid.PcdMaximumGuidedExtractHandler|0x2 =20 + gArmTokenSpaceGuid.PcdFdBaseAddress|0x01000000 + gArmTokenSpaceGuid.PcdFdSize|0x000C0000 + + gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000 + gEfiSecurityPkgTokenSpaceGuid.PcdUserPhysicalPresence|TRUE + gEfiMdeModulePkgTokenSpaceGuid.PcdMaxAuthVariableSize|0x2800 + + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|0x01000000 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize|0x00040000 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0x01040000 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize|0x00040000 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0x01080000 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize|0x00040000 + ##########################################################################= ######################### # # Components Section - list of the modules and components that will be pro= cessed by compilation @@ -118,6 +144,19 @@ [Components.common] # StandaloneMmPkg/Core/StandaloneMmCore.inf StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf + ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashStandaloneMm.inf + MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandalon= eMm.inf + + MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf { + + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf + NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf + NULL|MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLibStandal= oneMm.inf + # don't use unaligned CopyMem () on the UEFI varstore NOR flash regi= on + BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf + VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePol= icyLib.inf + VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib= /VariablePolicyHelperLib.inf + } =20 ##########################################################################= ######################### # diff --git a/Platform/Qemu/SbsaQemu/SbsaQemu.fdf b/Platform/Qemu/SbsaQemu/S= bsaQemu.fdf index b61ae1891233..36d09d34a374 100644 --- a/Platform/Qemu/SbsaQemu/SbsaQemu.fdf +++ b/Platform/Qemu/SbsaQemu/SbsaQemu.fdf @@ -21,10 +21,10 @@ =20 [FD.SBSA_FLASH0] BaseAddress =3D 0x00000000 -Size =3D 0x00400000 +Size =3D 0x01100000 ErasePolarity =3D 1 BlockSize =3D 0x00001000 -NumBlocks =3D 0x400 +NumBlocks =3D 0x1100 =20 ##########################################################################= ###### # @@ -50,6 +50,66 @@ [FD.SBSA_FLASH0] 0x00008000|0x00300000 FILE =3D Platform/Qemu/Sbsa/fip.bin =20 +!if $(SECURE_BOOT_ENABLE) +## Place for Secure Variables. +# Must be aligned to Flash Block size 0x40000 +0x01000000|0x00040000 +gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|gEfiMdeModule= PkgTokenSpaceGuid.PcdFlashNvStorageVariableSize +#NV_VARIABLE_STORE +DATA =3D { + ## This is the EFI_FIRMWARE_VOLUME_HEADER + # ZeroVector [] + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + # FileSystemGuid: gEfiSystemNvDataFvGuid =3D + # { 0xFFF12B8D, 0x7696, 0x4C8B, + # { 0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50 }} + 0x8D, 0x2B, 0xF1, 0xFF, 0x96, 0x76, 0x8B, 0x4C, + 0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50, + # FvLength: 0xC0000 + 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, + # Signature "_FVH" # Attributes + 0x5f, 0x46, 0x56, 0x48, 0xff, 0xfe, 0x04, 0x00, + # HeaderLength # CheckSum # ExtHeaderOffset #Reserved #Revision + 0x48, 0x00, 0x28, 0x09, 0x00, 0x00, 0x00, 0x02, + # Blockmap[0]: 0x3 Blocks * 0x40000 Bytes / Block + 0x3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, + # Blockmap[1]: End + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + ## This is the VARIABLE_STORE_HEADER + # It is compatible with SECURE_BOOT_ENABLE =3D=3D FALSE as well. + # Signature: gEfiAuthenticatedVariableGuid =3D + # { 0xaaf32c78, 0x947b, 0x439a, + # { 0xa1, 0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92 }} + 0x78, 0x2c, 0xf3, 0xaa, 0x7b, 0x94, 0x9a, 0x43, + 0xa1, 0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92, + # Size: 0x40000 (gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariabl= eSize) - + # 0x48 (size of EFI_FIRMWARE_VOLUME_HEADER) =3D 0x3ffb8 + # This can speed up the Variable Dispatch a bit. + 0xB8, 0xFF, 0x03, 0x00, + # FORMATTED: 0x5A #HEALTHY: 0xFE #Reserved: UINT16 #Reserved1: UINT32 + 0x5A, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +} + +0x01040000|0x00040000 +gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|gEfiMdeModu= lePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize +#NV_FTW_WORKING +DATA =3D { + # EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER->Signature =3D gEdkiiWorkingBl= ockSignatureGuid =3D + # { 0x9e58292b, 0x7c68, 0x497d, { 0xa0, 0xce, 0x65, 0x0, 0xfd, 0x9f, 0= x1b, 0x95 }} + 0x2b, 0x29, 0x58, 0x9e, 0x68, 0x7c, 0x7d, 0x49, + 0xa0, 0xce, 0x65, 0x0, 0xfd, 0x9f, 0x1b, 0x95, + # Crc:UINT32 #WorkingBlockValid:1, WorkingBlockInvalid:1, Res= erved + 0x5b, 0xe7, 0xc6, 0x86, 0xFE, 0xFF, 0xFF, 0xFF, + # WriteQueueSize: UINT64 + 0xE0, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 +} + +0x01080000|0x00040000 +gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|gEfiMdeModule= PkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize +#NV_FTW_SPARE +!endif + ##########################################################################= ###### # # FD Section for FLASH1 @@ -169,15 +229,25 @@ [FV.FvMain] INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf - INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.i= nf - INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf - INF SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConf= igDxe.inf INF MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRu= ntimeDxe.inf INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.i= nf INF EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf =20 + # + # Variable services + # +!if $(SECURE_BOOT_ENABLE) =3D=3D FALSE + INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf + INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.i= nf + INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf +!else + INF ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf + INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf + INF SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConf= igDxe.inf +!endif + # # Multiple Console IO support # @@ -189,7 +259,6 @@ [FV.FvMain] =20 INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf =20 # diff --git a/Platform/Qemu/SbsaQemu/SbsaQemuStandaloneMm.fdf b/Platform/Qem= u/SbsaQemu/SbsaQemuStandaloneMm.fdf index a1acefcfb0a7..dbe1555c68f2 100644 --- a/Platform/Qemu/SbsaQemu/SbsaQemuStandaloneMm.fdf +++ b/Platform/Qemu/SbsaQemu/SbsaQemuStandaloneMm.fdf @@ -19,8 +19,8 @@ ##########################################################################= ###### =20 [FD.STANDALONE_MM] -BaseAddress =3D 0x20001000|gArmTokenSpaceGuid.PcdFdBaseAddress -Size =3D 0x00e00000|gArmTokenSpaceGuid.PcdFdSize # The size in by= tes of the device (14MiB). +BaseAddress =3D 0x20002000 +Size =3D 0x00e00000 ErasePolarity =3D 1 =20 BlockSize =3D 0x00001000 @@ -49,6 +49,9 @@ [FV.FVMAIN_COMPACT] READ_LOCK_STATUS =3D TRUE =20 INF StandaloneMmPkg/Core/StandaloneMmCore.inf + INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashStandaloneMm.inf + INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStand= aloneMm.inf + INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf INF StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf =20 ##########################################################################= ###### diff --git a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuLib/SbsaQemuLib.inf b/Si= licon/Qemu/SbsaQemu/Library/SbsaQemuLib/SbsaQemuLib.inf index c067a80cc715..3cd398bcb7e7 100644 --- a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuLib/SbsaQemuLib.inf +++ b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuLib/SbsaQemuLib.inf @@ -35,11 +35,14 @@ [LibraryClasses] FdtLib MemoryAllocationLib PcdLib + FdtHelperLib =20 [Pcd] gArmTokenSpaceGuid.PcdSystemMemoryBase gArmTokenSpaceGuid.PcdSystemMemorySize gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdDeviceTreeBaseAddress + gArmTokenSpaceGuid.PcdMmBufferBase + gArmTokenSpaceGuid.PcdMmBufferSize =20 [FixedPcd] gArmTokenSpaceGuid.PcdFdBaseAddress diff --git a/Silicon/Qemu/SbsaQemu/Include/Library/FdtHelperLib.h b/Silicon= /Qemu/SbsaQemu/Include/Library/FdtHelperLib.h index ea9159857215..6b618847a0a6 100644 --- a/Silicon/Qemu/SbsaQemu/Include/Library/FdtHelperLib.h +++ b/Silicon/Qemu/SbsaQemu/Include/Library/FdtHelperLib.h @@ -33,4 +33,31 @@ FdtHelperCountCpus ( VOID ); =20 +/** + Get memory information from device tree passed by Qemu. + + @param [out] NewBase A pointer to store the memory phisical address. + @param [out] NewSize A pointer to store the memory size. + +**/ +VOID +FdtHelperGetMemInfo ( + OUT UINT64 *NewBase, + OUT UINT64 *NewSize + ); + +/** + Get reserved memory information from device tree passed by Qemu. + + @param [out] NsBufBase A pointer to store the reserved memory + phisical address. + @param [out] NsBufSize A pointer to store the reserved memory size. + +**/ +VOID +FdtHelperGetReservedMemInfo ( + OUT UINT64 *NsBufBase, + OUT UINT32 *NsBufSize + ); + #endif /* FDT_HELPER_LIB_ */ diff --git a/Silicon/Qemu/SbsaQemu/Library/FdtHelperLib/FdtHelperLib.c b/Si= licon/Qemu/SbsaQemu/Library/FdtHelperLib/FdtHelperLib.c index 7fdfb055db76..8308f71bdd34 100644 --- a/Silicon/Qemu/SbsaQemu/Library/FdtHelperLib/FdtHelperLib.c +++ b/Silicon/Qemu/SbsaQemu/Library/FdtHelperLib/FdtHelperLib.c @@ -96,3 +96,114 @@ FdtHelperCountCpus ( =20 return CpuCount; } + +/** + Get memory information from device tree passed by Qemu. + + @param [out] NewBase A pointer to store the memory phisical address. + @param [out] NewSize A pointer to store the memory size. + +**/ +VOID +FdtHelperGetMemInfo ( + OUT UINT64 *NewBase, + OUT UINT64 *NewSize + ) +{ + VOID *DeviceTreeBase; + INT32 Node, Prev; + CONST CHAR8 *Type; + CONST UINT64 *RegProp; + INT32 Len; + UINT64 CurBase; + UINT64 CurSize; + + DeviceTreeBase =3D (VOID *)(UINTN)PcdGet64 (PcdDeviceTreeBaseAddress); + ASSERT (DeviceTreeBase !=3D NULL); + + // Make sure we have a valid device tree blob + ASSERT (fdt_check_header (DeviceTreeBase) =3D=3D 0); + + // Look for the lowest memory node + for (Prev =3D 0;; Prev =3D Node) { + Node =3D fdt_next_node (DeviceTreeBase, Prev, NULL); + if (Node < 0) { + break; + } + + // Check for memory node + Type =3D fdt_getprop (DeviceTreeBase, Node, "device_type", &Len); + if (Type && AsciiStrnCmp (Type, "memory", Len) =3D=3D 0) { + // Get the 'reg' property of this node. For now, we will assume + // two 8 byte quantities for base and size, respectively. + RegProp =3D fdt_getprop (DeviceTreeBase, Node, "reg", &Len); + if (RegProp !=3D 0 && Len =3D=3D (2 * sizeof (UINT64))) { + + CurBase =3D fdt64_to_cpu (ReadUnaligned64 (RegProp)); + CurSize =3D fdt64_to_cpu (ReadUnaligned64 (RegProp + 1)); + + DEBUG ((DEBUG_INFO, "%a: System RAM @ 0x%lx - 0x%lx\n", + __FUNCTION__, CurBase, CurBase + CurSize - 1)); + + if (*NewBase > CurBase || *NewBase =3D=3D 0) { + *NewBase =3D CurBase; + *NewSize =3D CurSize; + } + } else { + DEBUG ((DEBUG_ERROR, "%a: Failed to parse FDT memory node\n", + __FUNCTION__)); + } + } + } +} + +/** + Get reserved memory information from device tree passed by Qemu. + + @param [out] NsBufBase A pointer to store the reserved memory + phisical address. + @param [out] NsBufSize A pointer to store the reserved memory size. + +**/ +VOID +FdtHelperGetReservedMemInfo ( + OUT UINT64 *NsBufBase, + OUT UINT32 *NsBufSize + ) +{ + VOID *DeviceTreeBase; + CONST UINT64 *RegProp; + INT32 ParentOffset; + INT32 Offset; + INT32 Len; + + DeviceTreeBase =3D (VOID *)(UINTN)PcdGet64 (PcdDeviceTreeBaseAddress); + ASSERT (DeviceTreeBase !=3D NULL); + + // Make sure we have a valid device tree blob + ASSERT (fdt_check_header (DeviceTreeBase) =3D=3D 0); + + ParentOffset =3D fdt_path_offset(DeviceTreeBase, "/reserved-memory"); + if (ParentOffset < 0) { + DEBUG ((DEBUG_ERROR, "%a: reserved-memory node not found\n", + __FUNCTION__)); + } + Offset =3D fdt_subnode_offset(DeviceTreeBase, ParentOffset, "ns-buf-spm-= mm"); + if (Offset < 0) { + DEBUG ((DEBUG_ERROR, "%a: ns-buf-spm-mm node not found\n", + __FUNCTION__)); + } + // Get the 'reg' property of this node. 8 byte quantities for base addre= ss + // and 4 byte quantities for size. + RegProp =3D fdt_getprop (DeviceTreeBase, Offset, "reg", &Len); + if (RegProp !=3D 0 && Len =3D=3D (sizeof (UINT64) + sizeof(UINT32))) { + *NsBufBase =3D fdt64_to_cpu (ReadUnaligned64 (RegProp)); + *NsBufSize =3D fdt32_to_cpu (ReadUnaligned32 ((UINT32 *)(RegProp + 1))= ); + + DEBUG ((DEBUG_INFO, "%a: ns buf @ 0x%lx - 0x%lx\n", + __FUNCTION__, *NsBufBase, *NsBufBase + *NsBufSize - 1)); + } else { + DEBUG ((DEBUG_ERROR, "%a: Failed to parse FDT reserved-memory node Len= %d\n", + __FUNCTION__, Len)); + } +} diff --git a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuLib/SbsaQemuMem.c b/Sili= con/Qemu/SbsaQemu/Library/SbsaQemuLib/SbsaQemuMem.c index 8c2eb0b6a028..d4c47c7fd4d6 100644 --- a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuLib/SbsaQemuMem.c +++ b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuLib/SbsaQemuMem.c @@ -13,6 +13,7 @@ #include #include #include +#include =20 // Number of Virtual Memory Map Descriptors #define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 4 @@ -23,59 +24,29 @@ SbsaQemuLibConstructor ( VOID ) { - VOID *DeviceTreeBase; - INT32 Node, Prev; - UINT64 NewBase, CurBase; - UINT64 NewSize, CurSize; - CONST CHAR8 *Type; - INT32 Len; - CONST UINT64 *RegProp; + UINT64 NewBase, NsBufBase; + UINT64 NewSize; + UINT32 NsBufSize; RETURN_STATUS PcdStatus; =20 NewBase =3D 0; NewSize =3D 0; + NsBufBase =3D 0; + NsBufSize =3D 0; =20 - DeviceTreeBase =3D (VOID *)(UINTN)PcdGet64 (PcdDeviceTreeBaseAddress); - ASSERT (DeviceTreeBase !=3D NULL); + FdtHelperGetMemInfo (&NewBase, &NewSize); =20 - // Make sure we have a valid device tree blob - ASSERT (fdt_check_header (DeviceTreeBase) =3D=3D 0); + // StandaloneMM non-secure shared buffer is allocated at the top of + // the system memory by trusted-firmware using "/reserved-memory" node. + FdtHelperGetReservedMemInfo(&NsBufBase, &NsBufSize); =20 - // Look for the lowest memory node - for (Prev =3D 0;; Prev =3D Node) { - Node =3D fdt_next_node (DeviceTreeBase, Prev, NULL); - if (Node < 0) { - break; - } - - // Check for memory node - Type =3D fdt_getprop (DeviceTreeBase, Node, "device_type", &Len); - if (Type && AsciiStrnCmp (Type, "memory", Len) =3D=3D 0) { - // Get the 'reg' property of this node. For now, we will assume - // two 8 byte quantities for base and size, respectively. - RegProp =3D fdt_getprop (DeviceTreeBase, Node, "reg", &Len); - if (RegProp !=3D 0 && Len =3D=3D (2 * sizeof (UINT64))) { - - CurBase =3D fdt64_to_cpu (ReadUnaligned64 (RegProp)); - CurSize =3D fdt64_to_cpu (ReadUnaligned64 (RegProp + 1)); - - DEBUG ((DEBUG_INFO, "%a: System RAM @ 0x%lx - 0x%lx\n", - __FUNCTION__, CurBase, CurBase + CurSize - 1)); - - if (NewBase > CurBase || NewBase =3D=3D 0) { - NewBase =3D CurBase; - NewSize =3D CurSize; - } - } else { - DEBUG ((DEBUG_ERROR, "%a: Failed to parse FDT memory node\n", - __FUNCTION__)); - } - } - } + NewSize -=3D NsBufSize; =20 // Make sure the start of DRAM matches our expectation ASSERT (FixedPcdGet64 (PcdSystemMemoryBase) =3D=3D NewBase); PcdStatus =3D PcdSet64S (PcdSystemMemorySize, NewSize); + PcdStatus =3D PcdSet64S (PcdMmBufferBase, NsBufBase); + PcdStatus =3D PcdSet64S (PcdMmBufferSize, (UINT64)NsBufSize); ASSERT_RETURN_ERROR (PcdStatus); =20 return RETURN_SUCCESS; --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#72374): https://edk2.groups.io/g/devel/message/72374 Mute This Topic: https://groups.io/mt/81046684/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Mon May 6 00:24:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+72375+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+72375+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1614753909; cv=none; d=zohomail.com; s=zohoarc; b=R/EFO8oNZKesVrdZMWkz6NOv3va45RkNfYGRaCY6GSLPNsKqgRAHxkt/1sYxmq492wTfTyLl0EfZ55lu9j5OCPAaQ2gJRekl0bxznN+96d+/eV8iWIeXKWK4LXVMkQjj2t7pQlZuGGNnD4obvoqa+FHuxLGG7y0zjQ9qBRU1gFg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614753909; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=z821Fqwc7P2/ZiWLDg2Ou466bAkZZVtgB2dn9FbaxyE=; b=Ybn3qwIMDmHFg2I9017csL9PqgqdpG9C+bYm34RytbmtWXOV6EmQutPN/ligTOkjKDQ541eakTwpZFpvL6sOfpHOj4Pri88GWToa+jsejUwMz468+s25UgJ1gLUVEr1ICVtjQjCcOv+NoByS94OBZO6LyDN8K5rgi7NiH/CXLEM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+72375+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1614753909582946.7938322494788; Tue, 2 Mar 2021 22:45:09 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id fttkYY1788612xu5K0surEPr; Tue, 02 Mar 2021 22:45:09 -0800 X-Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by mx.groups.io with SMTP id smtpd.web11.3476.1614753903839154446 for ; Tue, 02 Mar 2021 22:45:03 -0800 X-Received: by mail-pj1-f49.google.com with SMTP id i4-20020a17090a7184b02900bfb60fbc6bso2419332pjk.0 for ; Tue, 02 Mar 2021 22:45:03 -0800 (PST) X-Gm-Message-State: DXtwo7IbfA7zMY37le7jrooGx1787277AA= X-Google-Smtp-Source: ABdhPJywZq/L/U1ON8Ip//IRFvQY4RQ8LF2ouENZO34RUyb+c/7t+TYUkr3JZVKiThKGl0jdwpub6g== X-Received: by 2002:a17:90a:c257:: with SMTP id d23mr8266429pjx.102.1614753903359; Tue, 02 Mar 2021 22:45:03 -0800 (PST) X-Received: from localhost.localdomain ([2400:2411:502:a100:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id ms21sm5809240pjb.5.2021.03.02.22.45.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 22:45:02 -0800 (PST) From: "Masahisa Kojima" To: devel@edk2.groups.io Cc: Masahisa Kojima , Ard Biesheuvel , Leif Lindholm , Graeme Gregory , Radoslaw Biernacki , Shashi Mallela Subject: [edk2-devel] [PATCH edk2-platforms v3 3/4] SbsaQemu: add standalone MM build instruction Date: Wed, 3 Mar 2021 15:47:46 +0900 Message-Id: <20210303064747.27312-4-masahisa.kojima@linaro.org> In-Reply-To: <20210303064747.27312-1-masahisa.kojima@linaro.org> References: <20210303064747.27312-1-masahisa.kojima@linaro.org> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,masahisa.kojima@linaro.org Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1614753909; bh=BH7gOlLL2AN7JSLOBa9hr2C43AGxkJrplBvLhAkTjRc=; h=Cc:Date:From:Reply-To:Subject:To; b=JvumTv60Z6qzD7GAZCuLmSCIiHuCTbLOIho5uuXUP/cBp0L+SUvPz6emuSK20nNq2SK 7wwDErdvJLQbUU6TyoLeXnl6uhs0s/c5HqkBBpZR1rfYk/VQGX0/yBfgHzoUCUzZlP5J1 X13w3YISheS6SndbrfDQUdZig2QnEZqing0= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" This commit adds the standalone MM build instruction to enable UEFI secure boot. Signed-off-by: Masahisa Kojima --- Platform/Qemu/SbsaQemu/Readme.md | 35 ++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/Platform/Qemu/SbsaQemu/Readme.md b/Platform/Qemu/SbsaQemu/Read= me.md index 63786d9d0fd3..50f61b6e3bf4 100644 --- a/Platform/Qemu/SbsaQemu/Readme.md +++ b/Platform/Qemu/SbsaQemu/Readme.md @@ -104,6 +104,41 @@ Create a directory $WORKSPACE that would hold source c= ode of the components. truncate -s 256M SBSA_FLASH[01].fd ``` =20 +## Build UEFI with standalone MM based UEFI secure boot + +1. Compile standalone MM image + + ``` + cd $WORKSPACE + build -b RELEASE -a AARCH64 -t GCC5 -p edk2-platforms/Platform/Qemu/Sbsa= Qemu/SbsaQemuStandaloneMM.dsc + ``` + +2. Compile TF-A with BL32(Secure Payload) + + Detailed build instructions can be found on the following link: + https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/tree/docs/pl= at/qemu-sbsa.rst + + Then copy `bl1.bin` and `fip.bin` to the the edk2-non-osi directory: + +3. Compile EDK2 with UEFI secure boot enabled + + ``` + cd $WORKSPACE + build -b RELEASE -a AARCH64 -t GCC5 -p edk2-platforms/Platform/Qemu/Sbsa= Qemu/SbsaQemu.dsc -DSECURE_BOOT_ENABLE=3DTRUE + ``` + + Copy SBSA_FLASH0.fd and SBSA_FLASH1.fd to top $WORKSPACE directory. + Then extend the file size to match the machine flash size. + ``` + cp Build/SbsaQemu/RELEASE_GCC5/FV/SBSA_FLASH[01].fd . + truncate -s 256M SBSA_FLASH[01].fd + ``` + + To keep the UEFI variable storage after the succeeding build, use `dd` i= nstead of `cp`. + ``` + dd if=3D./Build/SbsaQemu/RELEASE_GCC5/FV/SBSA_FLASH0.fd of=3D./SBSA_FLAS= H0.fd conv=3Dnotrunc bs=3D2M count=3D8 + ``` + # Running =20 The resulting SBSA_FLASH0.fd file will contain Secure flash0 image (TF-A= code). --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#72375): https://edk2.groups.io/g/devel/message/72375 Mute This Topic: https://groups.io/mt/81046686/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Mon May 6 00:24:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+72376+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+72376+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1614753912; cv=none; d=zohomail.com; s=zohoarc; b=iptgYbrGrtg4c3Ke91OINnXPNcuEys0A6v6fdP5N40imPpmZIkTW3QrNvP+7P1pIV19ODMEGAZiGm8u8z8qoX8SbIVTQEx+Qr6CTbLi/c6TkqC07ONNEKvEQZWs5QjXrjMMI0vw8OEMjZN8QIR8yMP7CYtKvTfOfj+lfdiBgMxY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614753912; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=5nlgexCf09yRMpDvULJJEUcRU+XjpOVGq1HCPQkD+FA=; b=YLczsItBrmlqYztY5m+wzemGNa55pzNQhujReYarl7E0N3agHwcY+neLi+TQIgX+fGyRrMt1XJXHxSLKQhxgE2os+PumcHVcjPdoJBvjwElz6EMh/F0nEN6kSABVCS9j/TNHPW3+K/F/QzwYjY5v4UOHjsUsHmWy8szNVy077MA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+72376+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1614753912102421.69036102462564; Tue, 2 Mar 2021 22:45:12 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id NGWEYY1788612xOrKdV50lvf; Tue, 02 Mar 2021 22:45:11 -0800 X-Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by mx.groups.io with SMTP id smtpd.web10.3548.1614753906436779436 for ; Tue, 02 Mar 2021 22:45:06 -0800 X-Received: by mail-pj1-f53.google.com with SMTP id c19so3542247pjq.3 for ; Tue, 02 Mar 2021 22:45:06 -0800 (PST) X-Gm-Message-State: IvAqRAcdqXyOJiFvNAn1knGwx1787277AA= X-Google-Smtp-Source: ABdhPJw4tI4KDMerw8PI4vSC8q8t+6KE16gL2bLMx/jFQVc05eaEBPp5XzorOHb+vnIDX+bhrMBGHw== X-Received: by 2002:a17:90a:1b0d:: with SMTP id q13mr8343089pjq.211.1614753905965; Tue, 02 Mar 2021 22:45:05 -0800 (PST) X-Received: from localhost.localdomain ([2400:2411:502:a100:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id ms21sm5809240pjb.5.2021.03.02.22.45.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 22:45:05 -0800 (PST) From: "Masahisa Kojima" To: devel@edk2.groups.io Cc: Masahisa Kojima , Ard Biesheuvel , Leif Lindholm , Graeme Gregory , Radoslaw Biernacki , Shashi Mallela Subject: [edk2-devel] [PATCH edk2-platforms v3 4/4] SbsaQemu: fix typo Date: Wed, 3 Mar 2021 15:47:47 +0900 Message-Id: <20210303064747.27312-5-masahisa.kojima@linaro.org> In-Reply-To: <20210303064747.27312-1-masahisa.kojima@linaro.org> References: <20210303064747.27312-1-masahisa.kojima@linaro.org> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,masahisa.kojima@linaro.org Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1614753911; bh=QqWPYzd0gQB29KtdzO4VmjU8VyorCRXd7nOksdjEU0s=; h=Cc:Date:From:Reply-To:Subject:To; b=BOztj4/Yu6V+PY69P43i4yYmpJTR5X4buiCgaSoY+5a4eIzZ82CSZWHfIqcEh2wtfP3 p+M31KD+BxurzkFyVl6FKzFWkI/hdYCJDqFcWqWrlVIvNBRtML3cwGCNZkTXYKz29gdIK Zadzf8aD7eG1fbR5fyqGLSqrEFxCv5lNa/Q= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Fix typo in Readme.md Signed-off-by: Masahisa Kojima Reviewed-by: Leif Lindholm --- Platform/Qemu/SbsaQemu/Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Platform/Qemu/SbsaQemu/Readme.md b/Platform/Qemu/SbsaQemu/Read= me.md index 50f61b6e3bf4..cef98383884a 100644 --- a/Platform/Qemu/SbsaQemu/Readme.md +++ b/Platform/Qemu/SbsaQemu/Readme.md @@ -97,7 +97,7 @@ Create a directory $WORKSPACE that would hold source code= of the components. cd $WORKSPACE build -b RELEASE -a AARCH64 -t GCC5 -p edk2-platforms/Platform/Qemu/Sbsa= Qemu/SbsaQemu.dsc ``` - Copy SBSA_FLASH0.fd and SBSA_FLASH0.fd to top $WORKSPACE directory. + Copy SBSA_FLASH0.fd and SBSA_FLASH1.fd to top $WORKSPACE directory. Then extend the file size to match the machine flash size. ``` cp Build/SbsaQemu/RELEASE_GCC5/FV/SBSA_FLASH[01].fd . --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#72376): https://edk2.groups.io/g/devel/message/72376 Mute This Topic: https://groups.io/mt/81046687/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-