Date   

Re: UefiPayloadPkg: assert error in PciHostBridgeDxe

King Sumo
 

For anyone having this issue,the below patch detects the error in PciHostBridge aperture, from 9elements github repository: https://github.com/9elements/edk2-1/commit/6be829a631e3e0e7f6043c88cfef33f9a0588298
 
also available in system76 repo: https://github.com/system76/edk2.git
 
commit cf6caab535e84e5d3b3f1462d7ad57c7a914a5b8
Author: Patrick Rudolph <patrick.rudolph@...>
Date: Mon Oct 12 07:55:44 2020 -0600
 
UefiPayloadPkg/Library/PciHostBridgeLib: Add warning for coreboot/EDK2 incompability
 
EDK2 expects PCI bars to be continously be allocated without "gaps" of reserverd
memory in between.
coreboot places PCI bars anyware in the PCI MMIO space, interleaved with MMCONF
and reserved I/O MMIO space.
 
Warn about this behaviour and refuse to add the BAR to the PCI aperature as it would
cause the PciHostBridgeDxe fo fail.
 
Signed-off-by: Patrick Rudolph <patrick.rudolph@...>


Re: [edk2-platforms][PATCH 3/4] Drivers/OpTee: address cast build warning issue in 32b mode

Sami Mujawar
 

Hi Etienn,

Thank you for this patch.

These changes look good to me.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

Regards,

Sami Mujawar

On 10/05/2021 08:53 AM, Etienne Carriere wrote:
Use (UINTN) cast to cast physical or virtual address values to the
pointer size before casting from/to a pointer value.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
---
Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c | 21 +++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c b/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c
index 6eb19bed0e..83c2750368 100644
--- a/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c
+++ b/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c
@@ -305,7 +305,8 @@ OpTeeRpmbFvbRead (
}
}

- Base = (VOID *)Instance->MemBaseAddress + (Lba * Instance->BlockSize) + Offset;
+ Base = (VOID *)(UINTN)Instance->MemBaseAddress + (Lba * Instance->BlockSize) +
+ Offset;
// We could read the data from the RPMB instead of memory
// The 2 copies should already be identical
// Copy from memory image
@@ -387,7 +388,8 @@ OpTeeRpmbFvbWrite (
return Status;
}
}
- Base = (VOID *)Instance->MemBaseAddress + Lba * Instance->BlockSize + Offset;
+ Base = (VOID *)(UINTN)Instance->MemBaseAddress + (Lba * Instance->BlockSize) +
+ Offset;
Status = ReadWriteRpmb (
SP_SVC_RPMB_WRITE,
(UINTN)Buffer,
@@ -477,7 +479,8 @@ OpTeeRpmbFvbErase (
return EFI_INVALID_PARAMETER;
}
NumBytes = NumLba * Instance->BlockSize;
- Base = (VOID *)Instance->MemBaseAddress + Start * Instance->BlockSize;
+ Base = (VOID *)(UINTN)Instance->MemBaseAddress +
+ (Start * Instance->BlockSize);
Buf = AllocatePool (NumLba * Instance->BlockSize);
if (Buf == NULL) {
return EFI_DEVICE_ERROR;
@@ -689,7 +692,7 @@ InitializeFvAndVariableStoreHeaders (
goto Exit;
}
// Install the combined header in memory
- CopyMem ((VOID*)Instance->MemBaseAddress, Headers, HeadersLength);
+ CopyMem ((VOID*)(UINTN)Instance->MemBaseAddress, Headers, HeadersLength);

Exit:
FreePool (Headers);
@@ -747,14 +750,18 @@ FvbInitialize (
// Read the file from disk and copy it to memory
ReadEntireFlash (Instance);

- FwVolHeader = (EFI_FIRMWARE_VOLUME_HEADER *)Instance->MemBaseAddress;
+ FwVolHeader = (EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)Instance->MemBaseAddress;
Status = ValidateFvHeader (FwVolHeader);
if (EFI_ERROR (Status)) {
// There is no valid header, so time to install one.
DEBUG ((DEBUG_INFO, "%a: The FVB Header is not valid.\n", __FUNCTION__));

// Reset memory
- SetMem64 ((VOID *)Instance->MemBaseAddress, Instance->NBlocks * Instance->BlockSize, ~0UL);
+ SetMem64 (
+ (VOID *)(UINTN)Instance->MemBaseAddress,
+ Instance->NBlocks * Instance->BlockSize,
+ ~0UL
+ );
DEBUG ((DEBUG_INFO, "%a: Erasing Flash.\n", __FUNCTION__));
Status = ReadWriteRpmb (
SP_SVC_RPMB_WRITE,
@@ -827,7 +834,7 @@ OpTeeRpmbFvbInit (
mInstance.FvbProtocol.Write = OpTeeRpmbFvbWrite;
mInstance.FvbProtocol.Read = OpTeeRpmbFvbRead;

- mInstance.MemBaseAddress = (EFI_PHYSICAL_ADDRESS)Addr;
+ mInstance.MemBaseAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)Addr;
mInstance.Signature = FLASH_SIGNATURE;
mInstance.Initialize = FvbInitialize;
mInstance.BlockSize = EFI_PAGE_SIZE;
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


Re: [edk2-platforms][PATCH 4/4] Platform/StandaloneMm: build StandaloneMmRpmb for 32bit architectures

Sami Mujawar
 

Hi Etienn,

Thank you for this patch.

Please find my feedback inline marked [SAMI] .

With those fixed.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

Regards,

Sami Mujawar
On 10/05/2021 08:53 AM, Etienne Carriere wrote:
Build PlatformStandaloneMmRpmb for ARM architecture (32bit arm machine).
The generated image targets an execution environment similar to AArch64
StMM secure partition in OP-TEE but in 32bit mode.

GCC flag -fno-stack-protector
added. The stack protection code bring
GOT dependencies we prefer avoid when StMM runs in OP-TEE.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
---
Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.dsc | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.dsc b/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.dsc
index cb3f1ddf52..996d4e4ba9 100644
--- a/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.dsc
+++ b/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.dsc
@@ -16,7 +16,7 @@
PLATFORM_VERSION = 1.0
DSC_SPECIFICATION = 0x0001001C
OUTPUT_DIRECTORY = Build/$(PLATFORM_NAME)
- SUPPORTED_ARCHITECTURES = AARCH64
+ SUPPORTED_ARCHITECTURES = ARM|AARCH64
BUILD_TARGETS = DEBUG|RELEASE|NOOPT
SKUID_IDENTIFIER = DEFAULT
FLASH_DEFINITION = Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.fdf
@@ -68,6 +68,12 @@
#
NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+[LibraryClasses.ARM]
+ ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
+ NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
[SAMI] I think BaseStackCheckLib.inf can be moved to the [LibraryClasses] section, right?
[/SAMI]
+ NULL|ArmPkg/Library/ArmSvcLib/ArmSvcLib.inf
[SAMI] ArmSvcLib.inf is already present in the [LibraryClasses] section.
[/SAMI]
+ RegisterFilterLib|MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf
[SAMI] I think 'MdePkg/MdeLibs.dsc.inc' can be included instead, right after the [Defines] section.
This will also fix the build failure for AARCH64.
[/SAMI]
+
[LibraryClasses.common.MM_STANDALONE]
HobLib|StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.inf
MmServicesTableLib|MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.inf
@@ -160,3 +166,7 @@
[BuildOptions.AARCH64]
GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000 -march=armv8-a+nofp
GCC:*_*_*_CC_FLAGS = -mstrict-align
+
+[BuildOptions.ARM]
+GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000 -march=armv7-a
+GCC:*_*_*_CC_FLAGS = -fno-stack-protector


Re: [edk2-platforms][PATCH 2/4] Drivers/OpTee: Add Aarch32 SVC IDs for 32bit Arm targets

Sami Mujawar
 

Hi Etienne,

I have some minor suggestion marked inline as [SAMI].

With that addressed.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

Regards,

Sami Mujawar

On 10/05/2021 08:53 AM, Etienne Carriere wrote:
Add SMCCC function IDs for RPMB read/write service on 32bit architectures.
Define generic SP_SVC_RPMB_READ/SP_SVC_RPMB_WRITE IDs for native target
architecture (32b or 64b).

Changes OpTeeRpmbFvb.c to use architecture agnostic macro
ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ for 32b and 64b support.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
---
Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c | 2 +-
Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.h | 16 ++++++++++++++--
2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c b/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c
index 5197c95abd..6eb19bed0e 100644
--- a/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c
+++ b/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c
@@ -68,7 +68,7 @@ ReadWriteRpmb (
ZeroMem (&SvcArgs, sizeof (SvcArgs));
- SvcArgs.Arg0 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH64;
+ SvcArgs.Arg0 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ;
SvcArgs.Arg1 = mStorageId;
SvcArgs.Arg2 = 0;
SvcArgs.Arg3 = SvcAct;
diff --git a/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.h b/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.h
index c17fc287ef..bf4a39b9db 100644
--- a/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.h
+++ b/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.h
@@ -13,8 +13,20 @@
contract between OP-TEE and EDK2.
For more details check core/arch/arm/include/kernel/stmm_sp.h in OP-TEE
**/
-#define SP_SVC_RPMB_READ 0xC4000066
-#define SP_SVC_RPMB_WRITE 0xC4000067
+#define SP_SVC_RPMB_READ_64 0xC4000066
+#define SP_SVC_RPMB_WRITE_64 0xC4000067
+
+#define SP_SVC_RPMB_READ_32 0x84000066
+#define SP_SVC_RPMB_WRITE_32 0x84000067
[SAMI] Is it possible to change the _64 and _32 postfixes to AARCH64 and AARCH32 appropriately, please?
[/SAMI]
+
+#ifdef MDE_CPU_AARCH64
+#define SP_SVC_RPMB_READ SP_SVC_RPMB_READ_64
+#define SP_SVC_RPMB_WRITE SP_SVC_RPMB_WRITE_64
+#endif
+#ifdef MDE_CPU_ARM
+#define SP_SVC_RPMB_READ SP_SVC_RPMB_READ_32
+#define SP_SVC_RPMB_WRITE SP_SVC_RPMB_WRITE_32
+#endif
#define FLASH_SIGNATURE SIGNATURE_32 ('r', 'p', 'm', 'b')
#define INSTANCE_FROM_FVB_THIS(a) CR (a, MEM_INSTANCE, FvbProtocol, \


Re: [edk2-platforms][PATCH 1/4] sync with edk2 where StandaloneMmCpu moved to AArch64/ parent directory

Sami Mujawar
 

Hi Etienne,

Thank you for this patch.

I would have prefered this patch split in 3 parts (for SgiPkg, Socionext and Platform/StandaloneMm). In either case the changes look good to me.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

Regards,

Sami Mujawar

On 10/05/2021 08:53 AM, Etienne Carriere wrote:
Synchronize with edk2 package where StandaloneMmCpu component has moved
from StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf
to StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Sughosh Ganu <sughosh.ganu@linaro.org>
Cc: Thomas Abraham <thomas.abraham@arm.com>
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
---
Platform/ARM/SgiPkg/PlatformStandaloneMm.dsc | 2 +-
Platform/ARM/SgiPkg/PlatformStandaloneMm.fdf | 2 +-
Platform/Socionext/DeveloperBox/DeveloperBoxMm.dsc | 2 +-
Platform/Socionext/DeveloperBox/DeveloperBoxMm.fdf | 2 +-
Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.dsc | 2 +-
Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.fdf | 3 ++-
6 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/Platform/ARM/SgiPkg/PlatformStandaloneMm.dsc b/Platform/ARM/SgiPkg/PlatformStandaloneMm.dsc
index e281d54909..1e0af23711 100644
--- a/Platform/ARM/SgiPkg/PlatformStandaloneMm.dsc
+++ b/Platform/ARM/SgiPkg/PlatformStandaloneMm.dsc
@@ -122,7 +122,7 @@
StandaloneMmPkg/Core/StandaloneMmCore.inf
[Components.AARCH64]
- StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf
+ StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf
###################################################################################################
#
diff --git a/Platform/ARM/SgiPkg/PlatformStandaloneMm.fdf b/Platform/ARM/SgiPkg/PlatformStandaloneMm.fdf
index 5a0772cd85..96b4272dd6 100644
--- a/Platform/ARM/SgiPkg/PlatformStandaloneMm.fdf
+++ b/Platform/ARM/SgiPkg/PlatformStandaloneMm.fdf
@@ -49,7 +49,7 @@ READ_LOCK_CAP = TRUE
READ_LOCK_STATUS = TRUE
INF StandaloneMmPkg/Core/StandaloneMmCore.inf
- INF StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf
+ INF StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf
################################################################################
#
diff --git a/Platform/Socionext/DeveloperBox/DeveloperBoxMm.dsc b/Platform/Socionext/DeveloperBox/DeveloperBoxMm.dsc
index e078de4bbb..b5524f87a6 100644
--- a/Platform/Socionext/DeveloperBox/DeveloperBoxMm.dsc
+++ b/Platform/Socionext/DeveloperBox/DeveloperBoxMm.dsc
@@ -80,7 +80,7 @@
gEfiMdePkgTokenSpaceGuid.PcdMaximumGuidedExtractHandler|0x2
}
- StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf
+ StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf
Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/Fip006StandaloneMm.inf
MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.inf
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf {
diff --git a/Platform/Socionext/DeveloperBox/DeveloperBoxMm.fdf b/Platform/Socionext/DeveloperBox/DeveloperBoxMm.fdf
index 33de03c8e7..89453477c9 100644
--- a/Platform/Socionext/DeveloperBox/DeveloperBoxMm.fdf
+++ b/Platform/Socionext/DeveloperBox/DeveloperBoxMm.fdf
@@ -111,7 +111,7 @@ READ_LOCK_STATUS = TRUE
INF Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/Fip006StandaloneMm.inf
INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.inf
INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf
- INF StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf
+ INF StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf
################################################################################
#
diff --git a/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.dsc b/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.dsc
index f99a47ebf6..cb3f1ddf52 100644
--- a/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.dsc
+++ b/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.dsc
@@ -133,7 +133,7 @@
#
Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFv.inf
StandaloneMmPkg/Core/StandaloneMmCore.inf
- StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf
+ StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf
MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.inf {
<LibraryClasses>
NULL|Drivers/OpTee/OpteeRpmbPkg/FixupPcd.inf
diff --git a/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.fdf b/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.fdf
index e175dc7b2d..c4295a3e63 100644
--- a/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.fdf
+++ b/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.fdf
@@ -68,7 +68,8 @@ READ_LOCK_STATUS = TRUE
INF Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFv.inf
INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.inf
INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf
- INF StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf
+ INF StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf
+
################################################################################
#
# Rules are use with the [FV] section's module INF type to define


Re: [PATCH 5/5] StandaloneMmPkg: build for 32bit arm machines

Etienne Carriere
 

Hello Sami,

Thanks for the comments.
I'll address them in v2 if this series.

Regards,
Etienne


On Tue, 11 May 2021 at 21:18, Sami Mujawar <sami.mujawar@arm.com> wrote:

Hi Etienne,

Thank you for this patch.

I am getting build errors in VariableMmDependency.inf when building for
ARM. Not sure if you are getting these or it is my development
environment (I am building on a Windows Host PC). Can you let me know
which AArch32 GCC compiler you are using, please?
I am using gcc 9.2 cross toolchain prebuilt by Arm
(arm-linux-none-gnueabihf, 19dec2019) from:
https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a/downloads



Apart from this, there are some minor comments that I have marked inline
as [SAMI].

With those addressed.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

Regards,

Sami Mujawar

On 04/05/2021 04:20 PM, Etienne Carriere wrote:
This change allows to build StandaloneMmPkg components for 32bit Arm
StandaloneMm firmware.

This change mainly moves AArch64/ source files to Arm/ side directory
for several components: StandaloneMmCpu, StandaloneMmCoreEntryPoint
and StandaloneMmMemLib. The source file is built for both 32b and 64b
Arm targets.

Cc: Achin Gupta <achin.gupta@arm.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Sughosh Ganu <sughosh.ganu@linaro.org>
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
---
StandaloneMmPkg/Core/StandaloneMmCore.inf | 2 +-
StandaloneMmPkg/Drivers/StandaloneMmCpu/{AArch64 => }/EventHandle.c | 12 ++++++++++--
StandaloneMmPkg/Drivers/StandaloneMmCpu/{AArch64 => }/StandaloneMmCpu.c | 2 +-
StandaloneMmPkg/Drivers/StandaloneMmCpu/{AArch64 => }/StandaloneMmCpu.h | 0
StandaloneMmPkg/Drivers/StandaloneMmCpu/{AArch64 => }/StandaloneMmCpu.inf | 0
StandaloneMmPkg/Include/Library/{AArch64 => Arm}/StandaloneMmCoreEntryPoint.h | 0
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/{AArch64 => Arm}/CreateHobList.c | 2 +-
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/{AArch64 => Arm}/SetPermissions.c | 2 +-
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/{AArch64 => Arm}/StandaloneMmCoreEntryPoint.c | 16 ++++++++--------
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf | 14 +++++++-------
StandaloneMmPkg/Library/StandaloneMmCoreHobLib/{AArch64 => Arm}/StandaloneMmCoreHobLib.c | 0
StandaloneMmPkg/Library/StandaloneMmCoreHobLib/{AArch64 => Arm}/StandaloneMmCoreHobLibInternal.c | 0
StandaloneMmPkg/Library/StandaloneMmCoreHobLib/StandaloneMmCoreHobLib.inf | 8 ++++----
StandaloneMmPkg/Library/StandaloneMmMemLib/{AArch64/StandaloneMmMemLibInternal.c => ArmStandaloneMmMemLibInternal.c} | 9 ++++++++-
StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf | 6 +++---
StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf | 2 +-
StandaloneMmPkg/StandaloneMmPkg.dsc | 8 ++++----
17 files changed, 49 insertions(+), 34 deletions(-)

diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.inf b/StandaloneMmPkg/Core/StandaloneMmCore.inf
index 87bf6e9440..56042b7b39 100644
--- a/StandaloneMmPkg/Core/StandaloneMmCore.inf
+++ b/StandaloneMmPkg/Core/StandaloneMmCore.inf
@@ -17,7 +17,7 @@
PI_SPECIFICATION_VERSION = 0x00010032
ENTRY_POINT = StandaloneMmMain

-# VALID_ARCHITECTURES = IA32 X64 AARCH64
+# VALID_ARCHITECTURES = IA32 X64 AARCH64 ARM

[Sources]
StandaloneMmCore.c
diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c b/StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c
similarity index 92%
rename from StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c
rename to StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c
index 63fbe26642..2d7fd81133 100644
--- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c
+++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c
@@ -2,6 +2,7 @@

Copyright (c) 2016 HP Development Company, L.P.
Copyright (c) 2016 - 2021, Arm Limited. All rights reserved.
+ Copyright (c) 2021, Linaro Limited

SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -27,6 +28,13 @@

#include "StandaloneMmCpu.h"

+#ifdef MDE_CPU_AARCH64
+#define ARM_SMC_ID_MM_COMMUNICATE ARM_SMC_ID_MM_COMMUNICATE_AARCH64
+#endif
+#ifdef MDE_CPU_ARM
+#define ARM_SMC_ID_MM_COMMUNICATE ARM_SMC_ID_MM_COMMUNICATE_AARCH32
+#endif
[SAMI] Should this definition be in
ArmPkg\Include\IndustryStandard\ArmStdSmc.h?
I can see Patch 2/5 uses the above define in
ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c.
That would make sense, yes. I'll update in v2.

[/SAMI]
+
EFI_STATUS
EFIAPI
MmFoundationEntryRegister (
@@ -92,8 +100,8 @@ PiMmStandaloneArmTfCpuDriverEntry (
// receipt of a synchronous MM request. Use the Event ID to distinguish
// between synchronous and asynchronous events.
//
- if ((ARM_SMC_ID_MM_COMMUNICATE_AARCH64 != EventId) &&
- (ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH64 != EventId)) {
+ if ((ARM_SMC_ID_MM_COMMUNICATE != EventId) &&
+ (ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ != EventId)) {
DEBUG ((DEBUG_INFO, "UnRecognized Event - 0x%x\n", EventId));
return EFI_INVALID_PARAMETER;
}
diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c
similarity index 96%
rename from StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c
rename to StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c
index d4590bcd19..10097f792f 100644
--- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c
+++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c
@@ -10,7 +10,7 @@

#include <Base.h>
#include <Pi/PiMmCis.h>
-#include <Library/AArch64/StandaloneMmCoreEntryPoint.h>
+#include <Library/Arm/StandaloneMmCoreEntryPoint.h>
#include <Library/DebugLib.h>
#include <Library/ArmSvcLib.h>
#include <Library/ArmLib.h>
diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.h b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h
similarity index 100%
rename from StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.h
rename to StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h
diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf
similarity index 100%
rename from StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf
rename to StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf
diff --git a/StandaloneMmPkg/Include/Library/AArch64/StandaloneMmCoreEntryPoint.h b/StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h
similarity index 100%
rename from StandaloneMmPkg/Include/Library/AArch64/StandaloneMmCoreEntryPoint.h
rename to StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h
diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/CreateHobList.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList.c
similarity index 97%
rename from StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/CreateHobList.c
rename to StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList.c
index 4d4cf3d5ff..85f8194687 100644
--- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/CreateHobList.c
+++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList.c
@@ -14,7 +14,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Guid/MmramMemoryReserve.h>
#include <Guid/MpInformation.h>

-#include <Library/AArch64/StandaloneMmCoreEntryPoint.h>
+#include <Library/Arm/StandaloneMmCoreEntryPoint.h>
#include <Library/ArmMmuLib.h>
#include <Library/ArmSvcLib.h>
#include <Library/DebugLib.h>
diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/SetPermissions.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c
similarity index 96%
rename from StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/SetPermissions.c
rename to StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c
index 4a380df4a6..cd4b90823e 100644
--- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/SetPermissions.c
+++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c
@@ -14,7 +14,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Guid/MmramMemoryReserve.h>
#include <Guid/MpInformation.h>

-#include <Library/AArch64/StandaloneMmCoreEntryPoint.h>
+#include <Library/Arm/StandaloneMmCoreEntryPoint.h>
#include <Library/ArmMmuLib.h>
#include <Library/ArmSvcLib.h>
#include <Library/DebugLib.h>
diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c
similarity index 94%
rename from StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c
rename to StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c
index b445d6942e..e199e81bbd 100644
--- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c
+++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c
@@ -10,7 +10,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent

#include <PiMm.h>

-#include <Library/AArch64/StandaloneMmCoreEntryPoint.h>
+#include <Library/Arm/StandaloneMmCoreEntryPoint.h>

#include <PiPei.h>
#include <Guid/MmramMemoryReserve.h>
@@ -182,13 +182,13 @@ DelegatedEventLoop (
}

if (FfaEnabled) {
- EventCompleteSvcArgs->Arg0 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP_AARCH64;
+ EventCompleteSvcArgs->Arg0 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP;
EventCompleteSvcArgs->Arg1 = 0;
EventCompleteSvcArgs->Arg2 = 0;
- EventCompleteSvcArgs->Arg3 = ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64;
+ EventCompleteSvcArgs->Arg3 = ARM_SVC_ID_SP_EVENT_COMPLETE;
EventCompleteSvcArgs->Arg4 = SvcStatus;
} else {
- EventCompleteSvcArgs->Arg0 = ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64;
+ EventCompleteSvcArgs->Arg0 = ARM_SVC_ID_SP_EVENT_COMPLETE;
EventCompleteSvcArgs->Arg1 = SvcStatus;
}
}
@@ -273,13 +273,13 @@ InitArmSvcArgs (
)
{
if (FeaturePcdGet (PcdFfaEnable)) {
- InitMmFoundationSvcArgs->Arg0 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP_AARCH64;
+ InitMmFoundationSvcArgs->Arg0 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP;
InitMmFoundationSvcArgs->Arg1 = 0;
InitMmFoundationSvcArgs->Arg2 = 0;
- InitMmFoundationSvcArgs->Arg3 = ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64;
+ InitMmFoundationSvcArgs->Arg3 = ARM_SVC_ID_SP_EVENT_COMPLETE;
InitMmFoundationSvcArgs->Arg4 = *Ret;
} else {
- InitMmFoundationSvcArgs->Arg0 = ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64;
+ InitMmFoundationSvcArgs->Arg0 = ARM_SVC_ID_SP_EVENT_COMPLETE;
InitMmFoundationSvcArgs->Arg1 = *Ret;
}
}
@@ -395,7 +395,7 @@ _ModuleEntryPoint (
//
ProcessModuleEntryPointList (HobStart);

- DEBUG ((DEBUG_INFO, "Shared Cpu Driver EP 0x%lx\n", (UINT64) CpuDriverEntryPoint));
+ DEBUG ((DEBUG_INFO, "Shared Cpu Driver EP %p\n", (void *) CpuDriverEntryPoint));
[SAMI] void * should be changed to VOID*
ok

[/SAMI]

finish:
if (Status == RETURN_UNSUPPORTED) {
diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
index 4fa426f58e..1762586cfa 100644
--- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
+++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
@@ -21,10 +21,10 @@
# VALID_ARCHITECTURES = IA32 X64 IPF EBC (EBC is for build only)
#

-[Sources.AARCH64]
- AArch64/StandaloneMmCoreEntryPoint.c
- AArch64/SetPermissions.c
- AArch64/CreateHobList.c
+[Sources.AARCH64, Sources.ARM]
+ Arm/StandaloneMmCoreEntryPoint.c
+ Arm/SetPermissions.c
+ Arm/CreateHobList.c

[Sources.X64]
X64/StandaloneMmCoreEntryPoint.c
@@ -34,14 +34,14 @@
MdeModulePkg/MdeModulePkg.dec
StandaloneMmPkg/StandaloneMmPkg.dec

-[Packages.AARCH64]
+[Packages.ARM, Packages.AARCH64]
ArmPkg/ArmPkg.dec

[LibraryClasses]
BaseLib
DebugLib

-[LibraryClasses.AARCH64]
+[LibraryClasses.ARM, LibraryClasses.AARCH64]
StandaloneMmMmuLib
ArmSvcLib

@@ -51,7 +51,7 @@
gEfiStandaloneMmNonSecureBufferGuid
gEfiArmTfCpuDriverEpDescriptorGuid

-[FeaturePcd.AARCH64]
+[FeaturePcd.ARM, FeaturePcd.AARCH64]
gArmTokenSpaceGuid.PcdFfaEnable

[BuildOptions]
diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/AArch64/StandaloneMmCoreHobLib.c b/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/Arm/StandaloneMmCoreHobLib.c
similarity index 100%
rename from StandaloneMmPkg/Library/StandaloneMmCoreHobLib/AArch64/StandaloneMmCoreHobLib.c
rename to StandaloneMmPkg/Library/StandaloneMmCoreHobLib/Arm/StandaloneMmCoreHobLib.c
diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/AArch64/StandaloneMmCoreHobLibInternal.c b/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/Arm/StandaloneMmCoreHobLibInternal.c
similarity index 100%
rename from StandaloneMmPkg/Library/StandaloneMmCoreHobLib/AArch64/StandaloneMmCoreHobLibInternal.c
rename to StandaloneMmPkg/Library/StandaloneMmCoreHobLib/Arm/StandaloneMmCoreHobLibInternal.c
diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/StandaloneMmCoreHobLib.inf b/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/StandaloneMmCoreHobLib.inf
index a2559920e8..34ed536480 100644
--- a/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/StandaloneMmCoreHobLib.inf
+++ b/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/StandaloneMmCoreHobLib.inf
@@ -22,7 +22,7 @@
LIBRARY_CLASS = HobLib|MM_CORE_STANDALONE

#
-# VALID_ARCHITECTURES = X64 AARCH64
+# VALID_ARCHITECTURES = X64 AARCH64 ARM
#
[Sources.common]
Common.c
@@ -30,9 +30,9 @@
[Sources.X64]
X64/StandaloneMmCoreHobLib.c

-[Sources.AARCH64]
- AArch64/StandaloneMmCoreHobLib.c
- AArch64/StandaloneMmCoreHobLibInternal.c
+[Sources.AARCH64, Sources.ARM]
+ Arm/StandaloneMmCoreHobLib.c
+ Arm/StandaloneMmCoreHobLibInternal.c

[Packages]
MdePkg/MdePkg.dec
diff --git a/StandaloneMmPkg/Library/StandaloneMmMemLib/AArch64/StandaloneMmMemLibInternal.c b/StandaloneMmPkg/Library/StandaloneMmMemLib/ArmStandaloneMmMemLibInternal.c
similarity index 86%
rename from StandaloneMmPkg/Library/StandaloneMmMemLib/AArch64/StandaloneMmMemLibInternal.c
rename to StandaloneMmPkg/Library/StandaloneMmMemLib/ArmStandaloneMmMemLibInternal.c
index 4124959e04..fa7df46413 100644
--- a/StandaloneMmPkg/Library/StandaloneMmMemLib/AArch64/StandaloneMmMemLibInternal.c
+++ b/StandaloneMmPkg/Library/StandaloneMmMemLib/ArmStandaloneMmMemLibInternal.c
@@ -20,6 +20,13 @@
//
extern EFI_PHYSICAL_ADDRESS mMmMemLibInternalMaximumSupportAddress;

+#ifdef MDE_CPU_AARCH64
+#define ARM_PHYSICAL_ADDRESS_BITS 36
+#endif
+#ifdef MDE_CPU_ARM
+#define ARM_PHYSICAL_ADDRESS_BITS 32
+#endif
+
/**
Calculate and save the maximum support address.

@@ -31,7 +38,7 @@ MmMemLibInternalCalculateMaximumSupportAddress (
{
UINT8 PhysicalAddressBits;

- PhysicalAddressBits = 36;
+ PhysicalAddressBits = ARM_PHYSICAL_ADDRESS_BITS;

//
// Save the maximum support address in one global variable
diff --git a/StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf b/StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf
index 062b0d7a11..b29d97a746 100644
--- a/StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf
+++ b/StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf
@@ -28,7 +28,7 @@
#
# The following information is for reference only and not required by the build tools.
#
-# VALID_ARCHITECTURES = IA32 X64 AARCH64
+# VALID_ARCHITECTURES = IA32 X64 AARCH64 ARM
#

[Sources.Common]
@@ -37,8 +37,8 @@
[Sources.IA32, Sources.X64]
X86StandaloneMmMemLibInternal.c

-[Sources.AARCH64]
- AArch64/StandaloneMmMemLibInternal.c
+[Sources.AARCH64, Sources.ARM]
+ ArmStandaloneMmMemLibInternal.c

[Packages]
MdePkg/MdePkg.dec
diff --git a/StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf b/StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf
index a2a059c5d6..ffb2a6d083 100644
--- a/StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf
+++ b/StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf
@@ -20,7 +20,7 @@
#
# The following information is for reference only and not required by the build tools.
#
-# VALID_ARCHITECTURES = AARCH64
+# VALID_ARCHITECTURES = AARCH64|ARM
#
#

diff --git a/StandaloneMmPkg/StandaloneMmPkg.dsc b/StandaloneMmPkg/StandaloneMmPkg.dsc
index 0c45df95e2..01bfbe8cc5 100644
--- a/StandaloneMmPkg/StandaloneMmPkg.dsc
+++ b/StandaloneMmPkg/StandaloneMmPkg.dsc
@@ -20,7 +20,7 @@
PLATFORM_VERSION = 1.0
DSC_SPECIFICATION = 0x00010011
OUTPUT_DIRECTORY = Build/StandaloneMm
- SUPPORTED_ARCHITECTURES = AARCH64|X64
+ SUPPORTED_ARCHITECTURES = AARCH64|X64|ARM
BUILD_TARGETS = DEBUG|RELEASE
SKUID_IDENTIFIER = DEFAULT

@@ -60,7 +60,7 @@
StandaloneMmDriverEntryPoint|MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.inf
VariableMmDependency|StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf

-[LibraryClasses.AARCH64]
+[LibraryClasses.AARCH64, LibraryClasses.ARM]
ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
StandaloneMmMmuLib|ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf
ArmSvcLib|ArmPkg/Library/ArmSvcLib/ArmSvcLib.inf
@@ -118,7 +118,7 @@
StandaloneMmPkg/Library/StandaloneMmMemoryAllocationLib/StandaloneMmMemoryAllocationLib.inf
StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf

-[Components.AARCH64]
+[Components.AARCH64, Components.ARM]
StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf
[SAMI] I think this should be
StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf.
ouch, right. thanks.

[/SAMI]
StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf

@@ -131,7 +131,7 @@
# module style (EDK or EDKII) specified in [Components] section.
#
###################################################################################################
-[BuildOptions.AARCH64]
+[BuildOptions.AARCH64, BuildOptions.ARM]
GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000 -march=armv8-a+nofp -mstrict-align
GCC:*_*_*_CC_FLAGS = -mstrict-align


Re: [PATCH edk2-test 1/1] uefi-sct/SctPkg: IHV: type mismatch in Simple Network test

Sunny Wang
 

Looks good to me. I'm just curious if we would run into a similar problem with using Print() in MdePkg\Library\UefiLib\UefiLibPrint.c or ShellPrintEx() in ShellPkg\Library\UefiShellLib\UefiShellLib.c. If not, we may need to improve SctPrint().

Reviewed-by: Sunny Wang <sunny.wang@arm.com>

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Heinrich Schuchardt via groups.io
Sent: Monday, March 22, 2021 7:36 PM
To: EDK II Development <devel@edk2.groups.io>
Cc: Eric Jin <eric.jin@intel.com>; G Edhaya Chandran <Edhaya.Chandran@arm.com>; Barton Gao <gaojie@byosoft.com.cn>; Arvin Chen <arvinx.chen@intel.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; Heinrich Schuchardt <xypron.glpk@gmx.de>
Subject: [edk2-devel] [PATCH edk2-test 1/1] uefi-sct/SctPkg: IHV: type mismatch in Simple Network test

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3257

SctPrint() requires that %x and %d refers to an UINTN parameter.

SimpleNetworkBBTestFunction.c tries to print INT32 using %x, %d without converting to UINTN resulting in corrupted output like:

SimpleNetworkBBTestFunction.c:891:
Status - Unsupported, Filter - AAAA00000000

Mode->ReceiveFilterSetting has only 32 bit. The true value is 0.

Convert the parameters to UINTN.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
.../SimpleNetworkBBTestFunction.c | 50 +++++++++----------
1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c
index ca15df6303f6..06ad3163ef6b 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxT
+++ est/SimpleNetworkBBTestFunction.c
@@ -775,7 +775,7 @@ BBTestReceiveFilterFunctionTest (
__FILE__,
(UINTN)__LINE__,
Status,
- SnpInterface->Mode->ReceiveFilterSetting
+ (UINTN)SnpInterface->Mode->ReceiveFilterSetting
);

// Check point A. Enable Specified bit.
@@ -797,7 +797,7 @@ BBTestReceiveFilterFunctionTest (
__FILE__,
(UINTN)__LINE__,
Status,
- SnpInterface->Mode->ReceiveFilterSetting
+ (UINTN)SnpInterface->Mode->ReceiveFilterSetting
);

// Check point C. Enable and Disable Specified bit together.
@@ -819,7 +819,7 @@ BBTestReceiveFilterFunctionTest (
__FILE__,
(UINTN)__LINE__,
Status,
- SnpInterface->Mode->ReceiveFilterSetting
+ (UINTN)SnpInterface->Mode->ReceiveFilterSetting
);
}

@@ -856,12 +856,12 @@ BBTestReceiveFilterFunctionTest (
__FILE__,
(UINTN)__LINE__,
Status,
- SnpInterface->Mode->ReceiveFilterSetting,
- SnpInterface->Mode->ReceiveFilterMask,
- SnpInterface->Mode->MCastFilterCount,
- SnpInterface->Mode->MCastFilter[0].Addr[0],
- SnpInterface->Mode->MCastFilter[0].Addr[5],
- SnpInterface->Mode->MCastFilter[1].Addr[0]
+ (UINTN)SnpInterface->Mode->ReceiveFilterSetting,
+ (UINTN)SnpInterface->Mode->ReceiveFilterMask,
+ (UINTN)SnpInterface->Mode->MCastFilterCount,
+ (UINTN)SnpInterface->Mode->MCastFilter[0].Addr[0],
+ (UINTN)SnpInterface->Mode->MCastFilter[0].Addr[5],
+ (UINTN)SnpInterface->Mode->MCastFilter[1].Addr[0]
);
}

@@ -889,13 +889,13 @@ BBTestReceiveFilterFunctionTest (
__FILE__,
(UINTN)__LINE__,
Status,
- SnpInterface->Mode->ReceiveFilterSetting,
- SnpInterface->Mode->ReceiveFilterMask,
- SnpInterface->Mode->MCastFilterCount,
- Mode.MCastFilterCount,
- SnpInterface->Mode->MCastFilter[0].Addr[0],
- SnpInterface->Mode->MCastFilter[0].Addr[5],
- SnpInterface->Mode->MCastFilter[1].Addr[0]
+ (UINTN)SnpInterface->Mode->ReceiveFilterSetting,
+ (UINTN)SnpInterface->Mode->ReceiveFilterMask,
+ (UINTN)SnpInterface->Mode->MCastFilterCount,
+ (UINTN)Mode.MCastFilterCount,
+ (UINTN)SnpInterface->Mode->MCastFilter[0].Addr[0],
+ (UINTN)SnpInterface->Mode->MCastFilter[0].Addr[5],
+ (UINTN)SnpInterface->Mode->MCastFilter[1].Addr[0]
);
//
// Restore SNP State
@@ -1358,12 +1358,12 @@ BBTestMCastIpToMacFunctionTest (
__FILE__,
(UINTN)__LINE__,
Status,
- MAC1.Addr[0],
- MAC1.Addr[1],
- MAC1.Addr[2],
- MAC1.Addr[3],
- MAC1.Addr[4],
- MAC1.Addr[5]
+ (UINTN)MAC1.Addr[0],
+ (UINTN)MAC1.Addr[1],
+ (UINTN)MAC1.Addr[2],
+ (UINTN)MAC1.Addr[3],
+ (UINTN)MAC1.Addr[4],
+ (UINTN)MAC1.Addr[5]
);

//
@@ -1510,8 +1510,8 @@ BBTestNVDataFunctionTest (
__FILE__,
(UINTN)__LINE__,
Status,
- SnpInterface->Mode->NvRamSize,
- SnpInterface->Mode->NvRamAccessSize
+ (UINTN)SnpInterface->Mode->NvRamSize,
+ (UINTN)SnpInterface->Mode->NvRamAccessSize
);
}

@@ -1919,7 +1919,7 @@ BBTestGetStatusFunctionTest (
(UINTN)__LINE__,
Status,
Status1,
- InterruptStatus
+ (UINTN)InterruptStatus
);
}

--
2.30.2



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#73139): https://edk2.groups.io/g/devel/message/73139
Mute This Topic: https://groups.io/mt/81521738/5985097
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [Sunny.Wang@arm.com] -=-=-=-=-=-=


IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


Re: [PATCH edk2-test 1/1] uefi-sct/SctPkg: type mismatch in Simple Network test

Sunny Wang
 

Looks good to me. I'm just curious if we would run into a similar problem with using Print() in MdePkg\Library\UefiLib\UefiLibPrint.c or ShellPrintEx() in ShellPkg\Library\UefiShellLib\UefiShellLib.c. If not, we may need to improve SctPrint().

Reviewed-by: Sunny Wang <sunny.wang@arm.com>

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Heinrich Schuchardt via groups.io
Sent: Tuesday, March 30, 2021 11:04 PM
To: EDK II Development <devel@edk2.groups.io>
Cc: Eric Jin <eric.jin@intel.com>; G Edhaya Chandran <Edhaya.Chandran@arm.com>; Barton Gao <gaojie@byosoft.com.cn>; Arvin Chen <arvinx.chen@intel.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; Heinrich Schuchardt <xypron.glpk@gmx.de>
Subject: [edk2-devel] [PATCH edk2-test 1/1] uefi-sct/SctPkg: type mismatch in Simple Network test

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3257

SctPrint() requires that %x and %d refers to an UINTN parameter.

SimpleNetworkBBTestFunction.c tries to print INT32 using %x, %d without converting to UINTN resulting in corrupted output like:

SimpleNetworkBBTestFunction.c:891:
Status - Unsupported, Filter - AAAA00000000

Mode->ReceiveFilterSetting has only 32 bit. The true value is 0.

Convert the parameters to UINTN.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
.../SimpleNetworkBBTestFunction.c | 52 +++++++++----------
1 file changed, 26 insertions(+), 26 deletions(-)

diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c
index 8767e68e92d4..5fc01aadd96a 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxT
+++ est/SimpleNetworkBBTestFunction.c
@@ -775,7 +775,7 @@ BBTestReceiveFilterFunctionTest (
__FILE__,
(UINTN)__LINE__,
Status,
- SnpInterface->Mode->ReceiveFilterSetting
+ (UINTN)SnpInterface->Mode->ReceiveFilterSetting
);

// Check point A. Enable Specified bit.
@@ -797,7 +797,7 @@ BBTestReceiveFilterFunctionTest (
__FILE__,
(UINTN)__LINE__,
Status,
- SnpInterface->Mode->ReceiveFilterSetting
+ (UINTN)SnpInterface->Mode->ReceiveFilterSetting
);

// Check point C. Enable and Disable Specified bit together.
@@ -819,7 +819,7 @@ BBTestReceiveFilterFunctionTest (
__FILE__,
(UINTN)__LINE__,
Status,
- SnpInterface->Mode->ReceiveFilterSetting
+ (UINTN)SnpInterface->Mode->ReceiveFilterSetting
);
}

@@ -856,12 +856,12 @@ BBTestReceiveFilterFunctionTest (
__FILE__,
(UINTN)__LINE__,
Status,
- SnpInterface->Mode->ReceiveFilterSetting,
- SnpInterface->Mode->ReceiveFilterMask,
- SnpInterface->Mode->MCastFilterCount,
- SnpInterface->Mode->MCastFilter[0].Addr[0],
- SnpInterface->Mode->MCastFilter[0].Addr[5],
- SnpInterface->Mode->MCastFilter[1].Addr[0]
+ (UINTN)SnpInterface->Mode->ReceiveFilterSetting,
+ (UINTN)SnpInterface->Mode->ReceiveFilterMask,
+ (UINTN)SnpInterface->Mode->MCastFilterCount,
+ (UINTN)SnpInterface->Mode->MCastFilter[0].Addr[0],
+ (UINTN)SnpInterface->Mode->MCastFilter[0].Addr[5],
+ (UINTN)SnpInterface->Mode->MCastFilter[1].Addr[0]
);
}

@@ -885,17 +885,17 @@ BBTestReceiveFilterFunctionTest (
AssertionType,
gSimpleNetworkBBTestFunctionAssertionGuid012,
L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke ReceiveFilters() to reset multicast receive filters list and verify interface correctness within test case",
- L"%a:%d:Status - %r, Filter - %x, Mask - %x,Count - %d(%d), Address - %x, %x, %x",
+ L"%a:%d:Status - %r, Filter - %x, Mask - %x, Count -
+ %d(%d), Address - %x, %x, %x",
__FILE__,
(UINTN)__LINE__,
Status,
- SnpInterface->Mode->ReceiveFilterSetting,
- SnpInterface->Mode->ReceiveFilterMask,
- SnpInterface->Mode->MCastFilterCount,
- Mode.MCastFilterCount,
- SnpInterface->Mode->MCastFilter[0].Addr[0],
- SnpInterface->Mode->MCastFilter[0].Addr[5],
- SnpInterface->Mode->MCastFilter[1].Addr[0]
+ (UINTN)SnpInterface->Mode->ReceiveFilterSetting,
+ (UINTN)SnpInterface->Mode->ReceiveFilterMask,
+ (UINTN)SnpInterface->Mode->MCastFilterCount,
+ (UINTN)Mode.MCastFilterCount,
+ (UINTN)SnpInterface->Mode->MCastFilter[0].Addr[0],
+ (UINTN)SnpInterface->Mode->MCastFilter[0].Addr[5],
+ (UINTN)SnpInterface->Mode->MCastFilter[1].Addr[0]
);
//
// Restore SNP State
@@ -1358,12 +1358,12 @@ BBTestMCastIpToMacFunctionTest (
__FILE__,
(UINTN)__LINE__,
Status,
- MAC1.Addr[0],
- MAC1.Addr[1],
- MAC1.Addr[2],
- MAC1.Addr[3],
- MAC1.Addr[4],
- MAC1.Addr[5]
+ (UINTN)MAC1.Addr[0],
+ (UINTN)MAC1.Addr[1],
+ (UINTN)MAC1.Addr[2],
+ (UINTN)MAC1.Addr[3],
+ (UINTN)MAC1.Addr[4],
+ (UINTN)MAC1.Addr[5]
);

//
@@ -1510,8 +1510,8 @@ BBTestNVDataFunctionTest (
__FILE__,
(UINTN)__LINE__,
Status,
- SnpInterface->Mode->NvRamSize,
- SnpInterface->Mode->NvRamAccessSize
+ (UINTN)SnpInterface->Mode->NvRamSize,
+ (UINTN)SnpInterface->Mode->NvRamAccessSize
);
}

@@ -1919,7 +1919,7 @@ BBTestGetStatusFunctionTest (
(UINTN)__LINE__,
Status,
Status1,
- InterruptStatus
+ (UINTN)InterruptStatus
);
}

--
2.30.2



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#73534): https://edk2.groups.io/g/devel/message/73534
Mute This Topic: https://groups.io/mt/81724187/5985097
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [Sunny.Wang@arm.com] -=-=-=-=-=-=


IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


Re: [PATCH edk2-test 1/1] uefi-sct/SctPkg: IHV: type mismatch in SimpleTextOut test

Sunny Wang
 

Thanks for checking my comment, Heinrich.
I was thinking that this may be a mistake made in the very beginning because there may be no possibility to have a negative value in the members (like MaxMode) in SIMPLE_TEXT_OUTPUT_MODE structure. However, you made a good point about the compatibility issue. I agree that it is not worth further checking and making change for EFI_SIMPLE_TEXT_OUTPUT_MODE data structure, so you change is good enough!

Best Regards,
Sunny Wang

-----Original Message-----
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
Sent: Monday, May 10, 2021 6:30 PM
To: Sunny Wang <Sunny.Wang@arm.com>; devel@edk2.groups.io
Cc: Eric Jin <eric.jin@intel.com>; G Edhaya Chandran <Edhaya.Chandran@arm.com>; Barton Gao <gaojie@byosoft.com.cn>; Arvin Chen <arvinx.chen@intel.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Subject: Re: [edk2-devel] [PATCH edk2-test 1/1] uefi-sct/SctPkg: IHV: type mismatch in SimpleTextOut test

On 5/10/21 11:24 AM, Sunny Wang wrote:
Looks good. However, I'm thinking about if this is a UEFI specification issue. It looks like we should change the parameter type in EFI_SIMPLE_TEXT_OUTPUT_MODE data structure instead of doing typecasting.
Morevover, we may also need to check the files below:
- uefi-sct\SctPkg\TestCase\UEFI\EFI\Protocol\SimpleTextOut\BlackBoxTest\SimpleTextOutBBTestConformance_efi.c
- uefi-sct\SctPkg\TestCase\UEFI\EFI\Protocol\SimpleTextOut\BlackBoxTest\SimpleTextOutBBTestConformance_uefi.c
- uefi-sct\SctPkg\TestCase\UEFI\EFI\Protocol\SimpleTextOut\BlackBoxTest\SimpleTextOutBBTestFunction_efi.c
-
uefi-sct\SctPkg\TestCase\UEFI\IHV\Protocol\SimpleTextOut\BlackBoxTest\
SimpleTextOutBBTestConformance_uefi.c

Reviewed-by: Sunny Wang <sunny.wang@arm.com>
Thank you for reviewing.

I had a look into the UEFI spec 2.9:

Structure SIMPLE_TEXT_OUTPUT_MODE is defined with Mode and MaxMode as INT32.

EDK II uses the structure name EFI_SIMPLE_TEXT_OUTPUT_MODE instead of SIMPLE_TEXT_OUTPUT_MODE.

Changing the component types in SIMPLE_TEXT_OUTPUT_MODE would break forward and backward compatibility of UEFI applications. I see no value in such a change.

Best regards

Heinrich


Best Regards,
Sunny Wang

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
Heinrich Schuchardt via groups.io
Sent: Tuesday, March 30, 2021 11:09 PM
To: EDK II Development <devel@edk2.groups.io>
Cc: Eric Jin <eric.jin@intel.com>; G Edhaya Chandran
<Edhaya.Chandran@arm.com>; Barton Gao <gaojie@byosoft.com.cn>; Arvin
Chen <arvinx.chen@intel.com>; Samer El-Haj-Mahmoud
<Samer.El-Haj-Mahmoud@arm.com>; Heinrich Schuchardt
<xypron.glpk@gmx.de>; G Edhaya Chandran <Edhaya.Chandran@arm.com>
Subject: [edk2-devel] [PATCH edk2-test 1/1] uefi-sct/SctPkg: IHV: type
mismatch in SimpleTextOut test

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3253

SctPrint() requires that %d refers to an UINTN parameter.

SimpleTextOutBBTestFunction_uefi.c has a lot of
StandardLib->RecordAssertion() calls where an INT32 is passed
as argument for a '%d' print code.

This leads to incorrect output like:

MaxMode=-549755813885,

-549755813885 is 0x0xFFFFFF8000000003. So MaxMode actually is an INT32 with value 3 in this example.

Convert the parameters to UINTN.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: G Edhaya Chandran<edhaya.chandran@arm.com>
---
.../SimpleTextOutBBTestFunction_uefi.c | 624 +++++++++---------
1 file changed, 312 insertions(+), 312 deletions(-)

diff --git
a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleTextOut/BlackBoxTes
t/SimpleTextOutBBTestFunction_uefi.c
b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleTextOut/BlackBoxTes
t/SimpleTextOutBBTestFunction_uefi.c
index 2bc9bcdb51f9..a833498c2816 100644
---
a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleTextOut/BlackBoxTes
t/SimpleTextOutBBTestFunction_uefi.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleTextOut/BlackBo
+++ xT est/SimpleTextOutBBTestFunction_uefi.c
@@ -176,12 +176,12 @@ BBTestResetFunctionManualTest (
L" Expected:Cursor Position(%d x %d), MaxMode=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->MaxMode,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.MaxMode
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.MaxMode
);

//
@@ -272,12 +272,12 @@ BBTestResetFunctionManualTest (
L" Expected:Cursor Position(%d x %d), MaxMode=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->MaxMode,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.MaxMode
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.MaxMode
);

//
@@ -505,12 +505,12 @@ BBTestResetFunctionAutoTest (
L"Expected:Cursor Position(%d x %d), MaxMode=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->MaxMode,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.MaxMode
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.MaxMode
);

//
@@ -582,12 +582,12 @@ BBTestResetFunctionAutoTest (
L" Expected:Cursor Position(%d x %d), MaxMode=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->MaxMode,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.MaxMode
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.MaxMode
);

//
@@ -850,18 +850,18 @@ BBTestOutputStringFunctionAutoTest (
L" Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d, Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

//
@@ -987,18 +987,18 @@ BBTestOutputStringFunctionAutoTest (
L" Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d, Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

//
@@ -1094,18 +1094,18 @@ BBTestOutputStringFunctionAutoTest (
L" Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d, Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

//
@@ -1217,18 +1217,18 @@ BBTestOutputStringFunctionAutoTest (
L" Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d, Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

//
@@ -1469,18 +1469,18 @@ BBTestOutputStringFunctionManualTest (
L" Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d, Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

//
@@ -1626,18 +1626,18 @@ BBTestOutputStringFunctionManualTest (
L" Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d, Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

//
@@ -1754,18 +1754,18 @@ BBTestOutputStringFunctionManualTest (
L" Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d, Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

//
@@ -1897,18 +1897,18 @@ BBTestOutputStringFunctionManualTest (
L" Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d, Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

//
@@ -2240,18 +2240,18 @@ BBTestTestStringFunctionAutoTest (
L" Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d, Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

//
@@ -2433,18 +2433,18 @@ BBTestQueryModeFunctionAutoTest (
__FILE__,
(UINTN)__LINE__,
Index,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

if ( EFI_UNSUPPORTED == Status && 1 == Index ) { @@ -2720,18 +2720,18 @@ BBTestSetModeFunctionManualTest (
__FILE__,
(UINTN)__LINE__,
Index,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

//
@@ -2968,18 +2968,18 @@ BBTestSetModeFunctionAutoTest (
__FILE__,
(UINTN)__LINE__,
Index,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

//
@@ -3193,18 +3193,18 @@ BBTestSetAttributeFunctionManualTest (
L" Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d, Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);
Result = FALSE;
}
@@ -3451,18 +3451,18 @@ BBTestSetAttributeFunctionAutoTest (
L" Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d, Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);
Result = FALSE;
}
@@ -3653,18 +3653,18 @@ BBTestClearScreenFunctionManualTest (
L" Expected: Cursor Position(%d x %d), Mode=%d, MaxMode=%d, Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

//
@@ -3896,18 +3896,18 @@ BBTestClearScreenFunctionAutoTest (
L"Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d, Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

//
@@ -4143,18 +4143,18 @@ BBTestSetCursorPositionFunctionManualTest (
L"Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d, Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);
Result = FALSE;
}
@@ -4434,18 +4434,18 @@ BBTestSetCursorPositionFunctionAutoTest (
L"Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d, Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);
Result = FALSE;
}
@@ -4669,18 +4669,18 @@ BBTestEnableCursorFunctionManualTest (
L"Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d, Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

//
@@ -4739,18 +4739,18 @@ BBTestEnableCursorFunctionManualTest (
L"Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d, Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);
} else {
//
@@ -4803,18 +4803,18 @@ BBTestEnableCursorFunctionManualTest (
L"Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d, Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

//
@@ -4888,18 +4888,18 @@ BBTestEnableCursorFunctionManualTest (
L"Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d, Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);
} else {
//
@@ -5128,18 +5128,18 @@ BBTestEnableCursorFunctionAutoTest (
L"Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d, Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

AssertionType = EFI_TEST_ASSERTION_PASSED; @@ -5212,18 +5212,18 @@ BBTestEnableCursorFunctionAutoTest (
L" Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d, Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);


--
2.30.2



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#73535):
https://edk2.groups.io/g/devel/message/73535
Mute This Topic: https://groups.io/mt/81724304/5985097
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [Sunny.Wang@arm.com]
-=-=-=-=-=-=


IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


Re: [PATCH edk2-test 1/1] uefi-sct/SctPkg: type mismatch in Simple Network test

G Edhaya Chandran
 

On Sun, May 9, 2021 at 10:40 PM, Samer El-Haj-Mahmoud wrote:
Reviewed-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@...> 

Upstreamed by commit-id : https://github.com/tianocore/edk2-test/commit/3c9b20bee2d8610b9a88acb5ae7f9255b0140a67


Re: [PATCH edk2-test 1/1] uefi-sct/SctPkg: IHV: type mismatch in SimpleTextOut test

G Edhaya Chandran
 

Hi Sunny,

Do you have any further comments on this change?
If not, can we upstream the change?

With Warm Regards,
Edhay

-----Original Message-----
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
Sent: 10 May 2021 16:00
To: Sunny Wang <Sunny.Wang@arm.com>; devel@edk2.groups.io
Cc: Eric Jin <eric.jin@intel.com>; G Edhaya Chandran
<Edhaya.Chandran@arm.com>; Barton Gao <gaojie@byosoft.com.cn>; Arvin
Chen <arvinx.chen@intel.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-
Mahmoud@arm.com>
Subject: Re: [edk2-devel] [PATCH edk2-test 1/1] uefi-sct/SctPkg: IHV: type
mismatch in SimpleTextOut test

On 5/10/21 11:24 AM, Sunny Wang wrote:
Looks good. However, I'm thinking about if this is a UEFI specification issue. It
looks like we should change the parameter type in
EFI_SIMPLE_TEXT_OUTPUT_MODE data structure instead of doing typecasting.
Morevover, we may also need to check the files below:
- uefi-
sct\SctPkg\TestCase\UEFI\EFI\Protocol\SimpleTextOut\BlackBoxTest\SimpleTex
tOutBBTestConformance_efi.c
- uefi-
sct\SctPkg\TestCase\UEFI\EFI\Protocol\SimpleTextOut\BlackBoxTest\SimpleTex
tOutBBTestConformance_uefi.c
- uefi-
sct\SctPkg\TestCase\UEFI\EFI\Protocol\SimpleTextOut\BlackBoxTest\SimpleTex
tOutBBTestFunction_efi.c
-
uefi-sct\SctPkg\TestCase\UEFI\IHV\Protocol\SimpleTextOut\BlackBoxTest\
SimpleTextOutBBTestConformance_uefi.c

Reviewed-by: Sunny Wang <sunny.wang@arm.com>
Thank you for reviewing.

I had a look into the UEFI spec 2.9:

Structure SIMPLE_TEXT_OUTPUT_MODE is defined with Mode and MaxMode
as INT32.

EDK II uses the structure name EFI_SIMPLE_TEXT_OUTPUT_MODE instead of
SIMPLE_TEXT_OUTPUT_MODE.

Changing the component types in SIMPLE_TEXT_OUTPUT_MODE would break
forward and backward compatibility of UEFI applications. I see no value in such
a change.

Best regards

Heinrich


Best Regards,
Sunny Wang

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
Heinrich Schuchardt via groups.io
Sent: Tuesday, March 30, 2021 11:09 PM
To: EDK II Development <devel@edk2.groups.io>
Cc: Eric Jin <eric.jin@intel.com>; G Edhaya Chandran
<Edhaya.Chandran@arm.com>; Barton Gao <gaojie@byosoft.com.cn>; Arvin
Chen <arvinx.chen@intel.com>; Samer El-Haj-Mahmoud
<Samer.El-Haj-Mahmoud@arm.com>; Heinrich Schuchardt
<xypron.glpk@gmx.de>; G Edhaya Chandran <Edhaya.Chandran@arm.com>
Subject: [edk2-devel] [PATCH edk2-test 1/1] uefi-sct/SctPkg: IHV: type
mismatch in SimpleTextOut test

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3253

SctPrint() requires that %d refers to an UINTN parameter.

SimpleTextOutBBTestFunction_uefi.c has a lot of
StandardLib->RecordAssertion() calls where an INT32 is passed
as argument for a '%d' print code.

This leads to incorrect output like:

MaxMode=-549755813885,

-549755813885 is 0x0xFFFFFF8000000003. So MaxMode actually is an INT32
with value 3 in this example.

Convert the parameters to UINTN.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: G Edhaya Chandran<edhaya.chandran@arm.com>
---
.../SimpleTextOutBBTestFunction_uefi.c | 624 +++++++++---------
1 file changed, 312 insertions(+), 312 deletions(-)

diff --git
a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleTextOut/BlackBoxTes
t/SimpleTextOutBBTestFunction_uefi.c
b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleTextOut/BlackBoxTes
t/SimpleTextOutBBTestFunction_uefi.c
index 2bc9bcdb51f9..a833498c2816 100644
---
a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleTextOut/BlackBoxTes
t/SimpleTextOutBBTestFunction_uefi.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleTextOut/BlackBo
+++ xT est/SimpleTextOutBBTestFunction_uefi.c
@@ -176,12 +176,12 @@ BBTestResetFunctionManualTest (
L" Expected:Cursor Position(%d x %d), MaxMode=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->MaxMode,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.MaxMode
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.MaxMode
);

//
@@ -272,12 +272,12 @@ BBTestResetFunctionManualTest (
L" Expected:Cursor Position(%d x %d), MaxMode=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->MaxMode,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.MaxMode
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.MaxMode
);

//
@@ -505,12 +505,12 @@ BBTestResetFunctionAutoTest (
L"Expected:Cursor Position(%d x %d), MaxMode=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->MaxMode,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.MaxMode
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.MaxMode
);

//
@@ -582,12 +582,12 @@ BBTestResetFunctionAutoTest (
L" Expected:Cursor Position(%d x %d), MaxMode=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->MaxMode,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.MaxMode
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.MaxMode
);

//
@@ -850,18 +850,18 @@ BBTestOutputStringFunctionAutoTest (
L" Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d,
Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

//
@@ -987,18 +987,18 @@ BBTestOutputStringFunctionAutoTest (
L" Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d,
Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

//
@@ -1094,18 +1094,18 @@ BBTestOutputStringFunctionAutoTest (
L" Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d,
Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

//
@@ -1217,18 +1217,18 @@ BBTestOutputStringFunctionAutoTest (
L" Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d,
Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

//
@@ -1469,18 +1469,18 @@ BBTestOutputStringFunctionManualTest (
L" Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d,
Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

//
@@ -1626,18 +1626,18 @@ BBTestOutputStringFunctionManualTest (
L" Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d,
Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

//
@@ -1754,18 +1754,18 @@ BBTestOutputStringFunctionManualTest (
L" Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d,
Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

//
@@ -1897,18 +1897,18 @@ BBTestOutputStringFunctionManualTest (
L" Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d,
Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

//
@@ -2240,18 +2240,18 @@ BBTestTestStringFunctionAutoTest (
L" Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d,
Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

//
@@ -2433,18 +2433,18 @@ BBTestQueryModeFunctionAutoTest (
__FILE__,
(UINTN)__LINE__,
Index,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

if ( EFI_UNSUPPORTED == Status && 1 == Index ) { @@ -2720,18 +2720,18
@@ BBTestSetModeFunctionManualTest (
__FILE__,
(UINTN)__LINE__,
Index,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

//
@@ -2968,18 +2968,18 @@ BBTestSetModeFunctionAutoTest (
__FILE__,
(UINTN)__LINE__,
Index,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

//
@@ -3193,18 +3193,18 @@ BBTestSetAttributeFunctionManualTest (
L" Expected:Cursor Position(%d x %d), Mode=%d,
MaxMode=%d, Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);
Result = FALSE;
}
@@ -3451,18 +3451,18 @@ BBTestSetAttributeFunctionAutoTest (
L" Expected:Cursor Position(%d x %d), Mode=%d,
MaxMode=%d, Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);
Result = FALSE;
}
@@ -3653,18 +3653,18 @@ BBTestClearScreenFunctionManualTest (
L" Expected: Cursor Position(%d x %d), Mode=%d, MaxMode=%d,
Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

//
@@ -3896,18 +3896,18 @@ BBTestClearScreenFunctionAutoTest (
L"Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d,
Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

//
@@ -4143,18 +4143,18 @@ BBTestSetCursorPositionFunctionManualTest (
L"Expected:Cursor Position(%d x %d), Mode=%d,
MaxMode=%d, Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);
Result = FALSE;
}
@@ -4434,18 +4434,18 @@ BBTestSetCursorPositionFunctionAutoTest (
L"Expected:Cursor Position(%d x %d), Mode=%d,
MaxMode=%d, Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);
Result = FALSE;
}
@@ -4669,18 +4669,18 @@ BBTestEnableCursorFunctionManualTest (
L"Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d,
Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

//
@@ -4739,18 +4739,18 @@ BBTestEnableCursorFunctionManualTest (
L"Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d,
Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);
} else {
//
@@ -4803,18 +4803,18 @@ BBTestEnableCursorFunctionManualTest (
L"Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d,
Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

//
@@ -4888,18 +4888,18 @@ BBTestEnableCursorFunctionManualTest (
L"Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d,
Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);
} else {
//
@@ -5128,18 +5128,18 @@ BBTestEnableCursorFunctionAutoTest (
L"Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d,
Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);

AssertionType = EFI_TEST_ASSERTION_PASSED; @@ -5212,18 +5212,18
@@ BBTestEnableCursorFunctionAutoTest (
L" Expected:Cursor Position(%d x %d), Mode=%d, MaxMode=%d,
Attribute=%d, CursorVisible=%d.",
__FILE__,
(UINTN)__LINE__,
- SimpleOut->Mode->CursorColumn,
- SimpleOut->Mode->CursorRow,
- SimpleOut->Mode->Mode,
- SimpleOut->Mode->MaxMode,
- SimpleOut->Mode->Attribute,
- SimpleOut->Mode->CursorVisible,
- ModeExpected.CursorColumn,
- ModeExpected.CursorRow,
- ModeExpected.Mode,
- ModeExpected.MaxMode,
- ModeExpected.Attribute,
- ModeExpected.CursorVisible
+ (UINTN)SimpleOut->Mode->CursorColumn,
+ (UINTN)SimpleOut->Mode->CursorRow,
+ (UINTN)SimpleOut->Mode->Mode,
+ (UINTN)SimpleOut->Mode->MaxMode,
+ (UINTN)SimpleOut->Mode->Attribute,
+ (UINTN)SimpleOut->Mode->CursorVisible,
+ (UINTN)ModeExpected.CursorColumn,
+ (UINTN)ModeExpected.CursorRow,
+ (UINTN)ModeExpected.Mode,
+ (UINTN)ModeExpected.MaxMode,
+ (UINTN)ModeExpected.Attribute,
+ (UINTN)ModeExpected.CursorVisible
);


--
2.30.2



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#73535):
https://edk2.groups.io/g/devel/message/73535
Mute This Topic: https://groups.io/mt/81724304/5985097
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [Sunny.Wang@arm.com]
-=-=-=-=-=-=


IMPORTANT NOTICE: The contents of this email and any attachments are
confidential and may also be privileged. If you are not the intended recipient,
please notify the sender immediately and do not disclose the contents to any
other person, use it for any purpose, or store or copy the information in any
medium. Thank you.
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


Re: [Patch V3] MdeModulePkg: Retrive boot manager menu from any fv

Ni, Ray
 

Reviewed-by: Ray Ni <ray.ni@intel.com>

-----Original Message-----
From: Liu, Zhiguang <zhiguang.liu@intel.com>
Sent: Tuesday, May 11, 2021 10:32 AM
To: devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@intel.com>; Wu, Hao A <hao.a.wu@intel.com>;
Gao, Zhichao <zhichao.gao@intel.com>; Ni, Ray <ray.ni@intel.com>
Subject: [Patch V3] MdeModulePkg: Retrive boot manager menu from any fv

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3384

Currently, UefiBootManagerLib has the below assumption:
Assume the BootManagerMenuFile is in the same FV as the module links to
this library.
It has some limitation now, so remove the assumption.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
---
MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
index 6cc34d29c0..bef41ae102 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
@@ -2,7 +2,7 @@
Library functions which relates with booting.



Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.

-Copyright (c) 2011 - 2020, Intel Corporation. All rights reserved.<BR>

+Copyright (c) 2011 - 2021, Intel Corporation. All rights reserved.<BR>

(C) Copyright 2015-2021 Hewlett Packard Enterprise Development LP<BR>

SPDX-License-Identifier: BSD-2-Clause-Patent



@@ -2385,7 +2385,8 @@ EfiBootManagerRefreshAllBootOption (
This function is called to get or create the boot option for the Boot Manager
Menu.



The Boot Manager Menu is shown after successfully booting a boot option.

- Assume the BootManagerMenuFile is in the same FV as the module links to
this library.

+ This function will first try to search the BootManagerMenuFile is in the
same FV as

+ the module links to this library. If fails, it will search in all FVs.



@param BootOption Return the boot option of the Boot Manager Menu



@@ -2437,7 +2438,7 @@ BmRegisterBootManagerMenu (


if (DevicePath == NULL) {

Data = NULL;

- Status = GetSectionFromFv (

+ Status = GetSectionFromAnyFv (

PcdGetPtr (PcdBootManagerMenuFile),

EFI_SECTION_PE32,

0,

@@ -2455,7 +2456,7 @@ BmRegisterBootManagerMenu (
//

// Get BootManagerMenu application's description from EFI User
Interface Section.

//

- Status = GetSectionFromFv (

+ Status = GetSectionFromAnyFv (

PcdGetPtr (PcdBootManagerMenuFile),

EFI_SECTION_USER_INTERFACE,

0,

--
2.30.0.windows.2


[PATCH] UefiCpuPkg/PiSmmCpu: Remove hardcode 48 address size limitation

Ni, Ray
 

5-level paging can be enabled on CPU which supports up to 52 physical
address size. But when the feature was enabled, the 48 address size
limit was not removed and the 5-level paging testing didn't access
address >=3D 2^48. So the issue wasn't detected until recently an
address >=3D 2^48 is accessed.

Change-Id: Iaedc73be318d4b4122071efc3ba6e967a4b58fc3
Signed-off-by: Ray Ni <ray.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
---
UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c b/UefiCpuPkg/PiSmmCpuDxe=
Smm/MpService.c
index fd6583f9d1..89143810b6 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
@@ -1887,11 +1887,13 @@ InitializeMpServiceData (
IN UINTN ShadowStackSize=0D
)=0D
{=0D
- UINT32 Cr3;=0D
- UINTN Index;=0D
- UINT8 *GdtTssTables;=0D
- UINTN GdtTableStepSize;=0D
- CPUID_VERSION_INFO_EDX RegEdx;=0D
+ UINT32 Cr3;=0D
+ UINTN Index;=0D
+ UINT8 *GdtTssTables;=0D
+ UINTN GdtTableStepSize;=0D
+ CPUID_VERSION_INFO_EDX RegEdx;=0D
+ UINT32 MaxExtendedFunction;=0D
+ CPUID_VIR_PHY_ADDRESS_SIZE_EAX VirPhyAddressSize;=0D
=0D
//=0D
// Determine if this CPU supports machine check=0D
@@ -1918,9 +1920,17 @@ InitializeMpServiceData (
// Initialize physical address mask=0D
// NOTE: Physical memory above virtual address limit is not supported !!=
!=0D
//=0D
- AsmCpuid (0x80000008, (UINT32*)&Index, NULL, NULL, NULL);=0D
- gPhyMask =3D LShiftU64 (1, (UINT8)Index) - 1;=0D
- gPhyMask &=3D (1ull << 48) - EFI_PAGE_SIZE;=0D
+ AsmCpuid (CPUID_EXTENDED_FUNCTION, &MaxExtendedFunction, NULL, NULL, NUL=
L);=0D
+ if (MaxExtendedFunction >=3D CPUID_VIR_PHY_ADDRESS_SIZE) {=0D
+ AsmCpuid (CPUID_VIR_PHY_ADDRESS_SIZE, &VirPhyAddressSize.Uint32, NULL,=
NULL, NULL);=0D
+ } else {=0D
+ VirPhyAddressSize.Bits.PhysicalAddressBits =3D 36;=0D
+ }=0D
+ gPhyMask =3D LShiftU64 (1, VirPhyAddressSize.Bits.PhysicalAddressBits) =
- 1;=0D
+ //=0D
+ // Clear the low 12 bits=0D
+ //=0D
+ gPhyMask &=3D 0xfffffffffffff000ULL;=0D
=0D
//=0D
// Create page tables=0D
--=20
2.31.1.windows.1


Re: [PATCH v5 1/7] IntelSiliconPkg/ReportCpuHobLib: Add ReportCpuHobLib

Chaganty, Rangasai V
 

Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>

-----Original Message-----
From: Chuang, SofiaX <sofiax.chuang@intel.com>
Sent: Monday, May 10, 2021 12:54 PM
To: devel@edk2.groups.io
Cc: Chuang, SofiaX <sofiax.chuang@intel.com>; Ni, Ray <ray.ni@intel.com>; Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>
Subject: [edk2-devel][PATCH v5 1/7] IntelSiliconPkg/ReportCpuHobLib: Add ReportCpuHobLib

From: SofiaX Chuang <sofiax.chuang@intel.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3298

Add ReportCpuHobLib

Signed-off-by: SofiaX Chuang <sofiax.chuang@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
---
.../Include/Library/ReportCpuHobLib.h | 27 +++++++++++++
.../Intel/IntelSiliconPkg/IntelSiliconPkg.dec | 6 ++- .../Intel/IntelSiliconPkg/IntelSiliconPkg.dsc | 1 + .../Library/ReportCpuHobLib/ReportCpuHobLib.c | 39 +++++++++++++++++++
.../ReportCpuHobLib/ReportCpuHobLib.inf | 26 +++++++++++++
5 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 Silicon/Intel/IntelSiliconPkg/Include/Library/ReportCpuHobLib.h
create mode 100644 Silicon/Intel/IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib.c
create mode 100644 Silicon/Intel/IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib.inf

diff --git a/Silicon/Intel/IntelSiliconPkg/Include/Library/ReportCpuHobLib.h b/Silicon/Intel/IntelSiliconPkg/Include/Library/ReportCpuHobLib.h
new file mode 100644
index 0000000000..106ab3d436
--- /dev/null
+++ b/Silicon/Intel/IntelSiliconPkg/Include/Library/ReportCpuHobLib.h
@@ -0,0 +1,27 @@
+/** @file++ Report CPU HOB library++ This library report the CPU HOB
+with Physical Address bits.++Copyright (c) 2021, Intel Corporation. All
+rights reserved.<BR>+SPDX-License-Identifier:
+BSD-2-Clause-Patent++**/++#ifndef _REPORT_CPU_HOB_LIB_H_+#define
+_REPORT_CPU_HOB_LIB_H_++#include <BaseTypes.h>++/**+ Build a HOB for
+the CPU.+**/+VOID+EFIAPI+ReportCpuHob (+ VOID+ );++#endif+diff --git
+a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
+b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
index 4a2cbca5c1..2461ab8e06 100644
--- a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
+++ b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
@@ -3,7 +3,7 @@
# # This package provides common open source Intel silicon modules. #-# Copyright (c) 2016 - 2020, Intel Corporation. All rights reserved.<BR>+# Copyright (c) 2016 - 2021, Intel Corporation. All rights reserved.<BR> # SPDX-License-Identifier: BSD-2-Clause-Patent # ##@@ -42,6 +42,10 @@
# AslUpdateLib|Include/Library/AslUpdateLib.h + ## @libraryclass Provides services to report CPU hob+ #+ ReportCpuHobLib|Include/Library/ReportCpuHobLib.h+ [Guids] ## GUID for Package token space # {A9F8D54E-1107-4F0A-ADD0-4587E7A4A735}diff --git a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc
index 5e0de7e19a..1092371d84 100644
--- a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc
+++ b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc
@@ -93,6 +93,7 @@
IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFirmwareBootMediaLib.inf IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFirmwareBootMediaLib.inf IntelSiliconPkg/Library/DxeAslUpdateLib/DxeAslUpdateLib.inf+ IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib.inf [BuildOptions] *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACESdiff --git a/Silicon/Intel/IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib.c b/Silicon/Intel/IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib.c
new file mode 100644
index 0000000000..3f67b477d2
--- /dev/null
+++ b/Silicon/Intel/IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHob
+++ Lib.c
@@ -0,0 +1,39 @@
+/** @file+ Source code file for Report CPU HOB library.++Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>+SPDX-License-Identifier: BSD-2-Clause-Patent++**/++#include <PiPei.h>+#include <Library/BaseLib.h>+#include <Library/HobLib.h>+#include <Register/Intel/Cpuid.h>+++/**+ Build a HOB for the CPU.+**/+VOID+EFIAPI+ReportCpuHob (+ VOID+ )+{+ UINT8 PhysicalAddressBits;+ CPUID_VIR_PHY_ADDRESS_SIZE_EAX AddressSizeEax;++ AsmCpuid (CPUID_VIR_PHY_ADDRESS_SIZE, &AddressSizeEax.Uint32, NULL, NULL, NULL);+ if (AddressSizeEax.Uint32 >= CPUID_VIR_PHY_ADDRESS_SIZE) {+ AsmCpuid (CPUID_VIR_PHY_ADDRESS_SIZE, &AddressSizeEax.Uint32, NULL, NULL, NULL);+ PhysicalAddressBits = AddressSizeEax.Bits.PhysicalAddressBits;+ } else {+ PhysicalAddressBits = 36;+ }++ ///+ /// Create a CPU hand-off information+ ///+ BuildCpuHob (PhysicalAddressBits, 16);+}diff --git a/Silicon/Intel/IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib.inf b/Silicon/Intel/IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib.inf
new file mode 100644
index 0000000000..1d2d6b4151
--- /dev/null
+++ b/Silicon/Intel/IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHob
+++ Lib.inf
@@ -0,0 +1,26 @@
+### @file+# Component information file for the Report CPU HOB library.+#+# Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>+#+# SPDX-License-Identifier: BSD-2-Clause-Patent+#+###++[Defines]+ INF_VERSION = 0x00010005+ BASE_NAME = ReportCpuHobLib+ FILE_GUID = 0A1C9D6B-44BE-4FD7-A4A2-D0E68D436848+ VERSION_STRING = 1.0+ MODULE_TYPE = PEIM+ LIBRARY_CLASS = ReportCpuHobLib++[LibraryClasses]+ BaseLib+ HobLib++[Packages]+ MdePkg/MdePkg.dec++[Sources]+ ReportCpuHobLib.c--
2.27.0


Re: [PATCH v5 1/7] IntelSiliconPkg/ReportCpuHobLib: Add ReportCpuHobLib

Ni, Ray
 

Reviewed-by: Ray Ni <ray.ni@intel.com>

-----Original Message-----
From: Chuang, SofiaX <sofiax.chuang@intel.com>
Sent: Tuesday, May 11, 2021 3:54 AM
To: devel@edk2.groups.io
Cc: Chuang, SofiaX <sofiax.chuang@intel.com>; Ni, Ray <ray.ni@intel.com>; Chaganty, Rangasai V
<rangasai.v.chaganty@intel.com>
Subject: [edk2-devel][PATCH v5 1/7] IntelSiliconPkg/ReportCpuHobLib: Add ReportCpuHobLib

From: SofiaX Chuang <sofiax.chuang@intel.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3298

Add ReportCpuHobLib

Signed-off-by: SofiaX Chuang <sofiax.chuang@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
---
.../Include/Library/ReportCpuHobLib.h | 27 +++++++++++++
.../Intel/IntelSiliconPkg/IntelSiliconPkg.dec | 6 ++-
.../Intel/IntelSiliconPkg/IntelSiliconPkg.dsc | 1 +
.../Library/ReportCpuHobLib/ReportCpuHobLib.c | 39 +++++++++++++++++++
.../ReportCpuHobLib/ReportCpuHobLib.inf | 26 +++++++++++++
5 files changed, 98 insertions(+), 1 deletion(-)
create mode 100644 Silicon/Intel/IntelSiliconPkg/Include/Library/ReportCpuHobLib.h
create mode 100644 Silicon/Intel/IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib.c
create mode 100644 Silicon/Intel/IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib.inf

diff --git a/Silicon/Intel/IntelSiliconPkg/Include/Library/ReportCpuHobLib.h
b/Silicon/Intel/IntelSiliconPkg/Include/Library/ReportCpuHobLib.h
new file mode 100644
index 0000000000..106ab3d436
--- /dev/null
+++ b/Silicon/Intel/IntelSiliconPkg/Include/Library/ReportCpuHobLib.h
@@ -0,0 +1,27 @@
+/** @file

+

+ Report CPU HOB library

+

+ This library report the CPU HOB with Physical Address bits.

+

+Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+SPDX-License-Identifier: BSD-2-Clause-Patent

+

+**/

+

+#ifndef _REPORT_CPU_HOB_LIB_H_

+#define _REPORT_CPU_HOB_LIB_H_

+

+#include <BaseTypes.h>

+

+/**

+ Build a HOB for the CPU.

+**/

+VOID

+EFIAPI

+ReportCpuHob (

+ VOID

+ );

+

+#endif

+

diff --git a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
index 4a2cbca5c1..2461ab8e06 100644
--- a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
+++ b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
@@ -3,7 +3,7 @@
#

# This package provides common open source Intel silicon modules.

#

-# Copyright (c) 2016 - 2020, Intel Corporation. All rights reserved.<BR>

+# Copyright (c) 2016 - 2021, Intel Corporation. All rights reserved.<BR>

# SPDX-License-Identifier: BSD-2-Clause-Patent

#

##

@@ -42,6 +42,10 @@
#

AslUpdateLib|Include/Library/AslUpdateLib.h



+ ## @libraryclass Provides services to report CPU hob

+ #

+ ReportCpuHobLib|Include/Library/ReportCpuHobLib.h

+

[Guids]

## GUID for Package token space

# {A9F8D54E-1107-4F0A-ADD0-4587E7A4A735}

diff --git a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc
index 5e0de7e19a..1092371d84 100644
--- a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc
+++ b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc
@@ -93,6 +93,7 @@
IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFirmwareBootMediaLib.inf

IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFirmwareBootMediaLib.inf

IntelSiliconPkg/Library/DxeAslUpdateLib/DxeAslUpdateLib.inf

+ IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib.inf



[BuildOptions]

*_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES

diff --git a/Silicon/Intel/IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib.c
b/Silicon/Intel/IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib.c
new file mode 100644
index 0000000000..3f67b477d2
--- /dev/null
+++ b/Silicon/Intel/IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib.c
@@ -0,0 +1,39 @@
+/** @file

+ Source code file for Report CPU HOB library.

+

+Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+SPDX-License-Identifier: BSD-2-Clause-Patent

+

+**/

+

+#include <PiPei.h>

+#include <Library/BaseLib.h>

+#include <Library/HobLib.h>

+#include <Register/Intel/Cpuid.h>

+

+

+/**

+ Build a HOB for the CPU.

+**/

+VOID

+EFIAPI

+ReportCpuHob (

+ VOID

+ )

+{

+ UINT8 PhysicalAddressBits;

+ CPUID_VIR_PHY_ADDRESS_SIZE_EAX AddressSizeEax;

+

+ AsmCpuid (CPUID_VIR_PHY_ADDRESS_SIZE, &AddressSizeEax.Uint32, NULL, NULL, NULL);

+ if (AddressSizeEax.Uint32 >= CPUID_VIR_PHY_ADDRESS_SIZE) {

+ AsmCpuid (CPUID_VIR_PHY_ADDRESS_SIZE, &AddressSizeEax.Uint32, NULL, NULL, NULL);

+ PhysicalAddressBits = AddressSizeEax.Bits.PhysicalAddressBits;

+ } else {

+ PhysicalAddressBits = 36;

+ }

+

+ ///

+ /// Create a CPU hand-off information

+ ///

+ BuildCpuHob (PhysicalAddressBits, 16);

+}

diff --git a/Silicon/Intel/IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib.inf
b/Silicon/Intel/IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib.inf
new file mode 100644
index 0000000000..1d2d6b4151
--- /dev/null
+++ b/Silicon/Intel/IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib.inf
@@ -0,0 +1,26 @@
+### @file

+# Component information file for the Report CPU HOB library.

+#

+# Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+#

+# SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+###

+

+[Defines]

+ INF_VERSION = 0x00010005

+ BASE_NAME = ReportCpuHobLib

+ FILE_GUID = 0A1C9D6B-44BE-4FD7-A4A2-D0E68D436848

+ VERSION_STRING = 1.0

+ MODULE_TYPE = PEIM

+ LIBRARY_CLASS = ReportCpuHobLib

+

+[LibraryClasses]

+ BaseLib

+ HobLib

+

+[Packages]

+ MdePkg/MdePkg.dec

+

+[Sources]

+ ReportCpuHobLib.c

--
2.27.0


TianoCore Bug Triage - APAC / NAMO - Tue, 05/11/2021 6:30pm-7:30pm #cal-reminder

devel@edk2.groups.io Calendar <devel@...>
 

Reminder: TianoCore Bug Triage - APAC / NAMO

When: Tuesday, 11 May 2021, 6:30pm to 7:30pm, (GMT-07:00) America/Los Angeles

Where:https://teams.microsoft.com/l/meetup-join/19%3ameeting_ZjQ3OTViZGUtYTM5ZS00MDBmLWFkNDYtYTg1ZTA1YTFhY2U3%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%220d960867-aa36-403f-8446-f96a6cce5fa4%22%7d

View Event

Organizer: Liming Gao gaoliming@...

Description:

TianoCore Bug Triage - APAC / NAMO

Hosted by Liming Gao

 

________________________________________________________________________________

Microsoft Teams meeting

Join on your computer or mobile app

Click here to join the meeting

Join with a video conferencing device

teams@...

Video Conference ID: 116 716 903 4

Alternate VTC dialing instructions

Learn More | Meeting options

________________________________________________________________________________

 


Re: [PATCH v5 7/7] CometlakeOpenBoard: Move ReportCpuHob library path

Chaganty, Rangasai V
 

Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>

-----Original Message-----
From: Chuang, SofiaX <sofiax.chuang@intel.com>
Sent: Monday, May 10, 2021 12:55 PM
To: devel@edk2.groups.io
Cc: Chuang, SofiaX <sofiax.chuang@intel.com>; Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Kethi Reddy, Deepika <deepika.kethi.reddy@intel.com>; Esakkithevar, Kathappan <kathappan.esakkithevar@intel.com>
Subject: [edk2-devel][PATCH v5 7/7] CometlakeOpenBoard: Move ReportCpuHob library path

From: SofiaX Chuang <sofiax.chuang@intel.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3298

Move ReportCpuHob library from MinPlatformPkg to IntelSiliconPkg.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
Cc: Deepika Kethi Reddy <deepika.kethi.reddy@intel.com>
Cc: Kathappan Esakkithevar <kathappan.esakkithevar@intel.com>
---
.../CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.dsc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.dsc b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.dsc
index 6de834565a..44a1bd54d6 100644
--- a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.dsc
+++ b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.dsc
@@ -1,7 +1,7 @@
## @file

# The main build description file for the CometlakeURvp board.

#

-# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>

+# Copyright (c) 2020 - 2021, Intel Corporation. All rights reserved.<BR>

#

# SPDX-License-Identifier: BSD-2-Clause-Patent

#

@@ -161,6 +161,7 @@
# Silicon Initialization Package

#######################################

SiliconInitLib|$(PLATFORM_SI_PACKAGE)/Library/PeiSiliconInitLib/PeiSiliconInitLib.inf

+ ReportCpuHobLib|IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib.inf



#######################################

# Platform Package

@@ -173,7 +174,6 @@
TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib/PeiTestPointCheckLib.inf

!endif

SetCacheMtrrLib|$(PLATFORM_PACKAGE)/Library/SetCacheMtrrLib/SetCacheMtrrLibNull.inf

- ReportCpuHobLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/ReportCpuHobLib/ReportCpuHobLib.inf



#######################################

# Board Package

--
2.27.0


Re: [PATCH v5 2/7] TigerlakeOpenBoard: Move ReportCpuHob library path

Chaganty, Rangasai V
 

Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>

-----Original Message-----
From: Chuang, SofiaX <sofiax.chuang@intel.com>
Sent: Monday, May 10, 2021 12:54 PM
To: devel@edk2.groups.io
Cc: Chuang, SofiaX <sofiax.chuang@intel.com>; Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Luo, Heng <heng.luo@intel.com>
Subject: [edk2-devel][PATCH v5 2/7] TigerlakeOpenBoard: Move ReportCpuHob library path

From: SofiaX Chuang <sofiax.chuang@intel.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3298

Move ReportCpuHob library from MinPlatformPkg to IntelSiliconPkg.

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Heng Luo <heng.luo@intel.com>
---
.../Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
index a4265a839c..1adf634034 100644
--- a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
@@ -89,7 +89,6 @@


PciSegmentLib|$(PLATFORM_SI_PACKAGE)/Library/BasePciSegmentMultiSegLibPci/BasePciSegmentMultiSegLibPci.inf

PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf

- ReportCpuHobLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/ReportCpuHobLib/ReportCpuHobLib.inf



#

# Silicon Init Package

@@ -115,6 +114,7 @@
#

# Silicon Init Package

#

+ ReportCpuHobLib|IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib.inf

!include $(PLATFORM_SI_PACKAGE)/SiPkgPeiLib.dsc



#

--
2.27.0


Re: [PATCH v2] BaseTools: Add support for version 3 of FMP Image Header structure

Bob Feng
 

I created the PR https://github.com/tianocore/edk2/pull/1637 for merge.

 

Thanks,

Bob

 

From: Kinney, Michael D <michael.d.kinney@...>
Sent: Tuesday, May 11, 2021 11:09 PM
To: Sughosh Ganu <sughosh.ganu@...>; Feng, Bob C <bob.c.feng@...>; Liming Gao <gaoliming@...>; Chen, Christine <yuwei.chen@...>; Kinney, Michael D <michael.d.kinney@...>
Cc: devel@edk2.groups.io
Subject: RE: [edk2-devel] [PATCH v2] BaseTools: Add support for version 3 of FMP Image Header structure

 

Hi Sughosh,

 

Thanks for the reminder.  

 

We need to wait for one of the BaseTools maintainers to provide an Rb for the V2 version of this patch, then we will be able to merge.

 

Thanks,

 

Mike

 

From: Sughosh Ganu <sughosh.ganu@...>
Sent: Tuesday, May 11, 2021 3:21 AM
To: Kinney, Michael D <michael.d.kinney@...>; Feng, Bob C <bob.c.feng@...>; Liming Gao <gaoliming@...>; Chen, Christine <yuwei.chen@...>
Cc: devel@edk2.groups.io
Subject: Re: [edk2-devel] [PATCH v2] BaseTools: Add support for version 3 of FMP Image Header structure

 

hi,

Can this patch be merged. Thanks.

 

-sughosh

 

On Mon, 26 Apr 2021 at 21:27, Kinney, Michael D <michael.d.kinney@...> wrote:

Reviewed-by: Michael D Kinney <michael.d.kinney@...>

Mike

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Sughosh Ganu
> Sent: Friday, April 23, 2021 4:29 AM
> To: devel@edk2.groups.io
> Cc: Michal Simek <michal.simek@...>; Sughosh Ganu <sughosh.ganu@...>
> Subject: [edk2-devel] [PATCH v2] BaseTools: Add support for version 3 of FMP Image Header structure
>
> Add support for the ImageCapsuleSupport field, introduced in version 3
> of the EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER structure. This
> structure member is used to indicate if the corresponding payload has
> support for authentication and dependency.
>
> Signed-off-by: Sughosh Ganu <sughosh.ganu@...>
> ---
>
> Changes since v1:
> - Reword the patch header to get rid of the PatchCheck warning
> - Make passing of ImageCapsuleSupport parameter to the AddPayload
>   function as an optional parameter to maintain backward compatibility
> - Declare the values of CAPSULE_SUPPORT_DEPENDENCY and
>   CAPSULE_SUPPORT_AUTHENTICATION in the FmpCapsuleHeaderClass and use
>   those in the GenerateCapsule script
>
>  .../Source/Python/Capsule/GenerateCapsule.py  |  5 +++-
>  .../Common/Uefi/Capsule/FmpCapsuleHeader.py   | 28 +++++++++++++------
>  2 files changed, 24 insertions(+), 9 deletions(-)
>
> diff --git a/BaseTools/Source/Python/Capsule/GenerateCapsule.py b/BaseTools/Source/Python/Capsule/GenerateCapsule.py
> index a8de988253..b8039db878 100644
> --- a/BaseTools/Source/Python/Capsule/GenerateCapsule.py
> +++ b/BaseTools/Source/Python/Capsule/GenerateCapsule.py
> @@ -561,6 +561,7 @@ if __name__ == '__main__':
>                  print ('GenerateCapsule: error:' + str(Msg))
>                  sys.exit (1)
>          for SinglePayloadDescriptor in PayloadDescriptorList:
> +            ImageCapsuleSupport = 0x0000000000000000
>              Result = SinglePayloadDescriptor.Payload
>              try:
>                  FmpPayloadHeader.FwVersion              = SinglePayloadDescriptor.FwVersion
> @@ -575,6 +576,7 @@ if __name__ == '__main__':
>              if SinglePayloadDescriptor.UseDependency:
>                  CapsuleDependency.Payload = Result
>                  CapsuleDependency.DepexExp = SinglePayloadDescriptor.DepexExp
> +                ImageCapsuleSupport        |= FmpCapsuleHeader.CAPSULE_SUPPORT_DEPENDENCY
>                  Result = CapsuleDependency.Encode ()
>                  if args.Verbose:
>                      CapsuleDependency.DumpInfo ()
> @@ -607,13 +609,14 @@ if __name__ == '__main__':
>                      FmpAuthHeader.MonotonicCount = SinglePayloadDescriptor.MonotonicCount
>                      FmpAuthHeader.CertData       = CertData
>                      FmpAuthHeader.Payload        = Result
> +                    ImageCapsuleSupport          |= FmpCapsuleHeader.CAPSULE_SUPPORT_AUTHENTICATION
>                      Result = FmpAuthHeader.Encode ()
>                      if args.Verbose:
>                          FmpAuthHeader.DumpInfo ()
>                  except:
>                      print ('GenerateCapsule: error: can not encode FMP Auth Header')
>                      sys.exit (1)
> -            FmpCapsuleHeader.AddPayload (SinglePayloadDescriptor.Guid, Result, HardwareInstance =
> SinglePayloadDescriptor.HardwareInstance, UpdateImageIndex = SinglePayloadDescriptor.UpdateImageIndex)
> +            FmpCapsuleHeader.AddPayload (SinglePayloadDescriptor.Guid, Result, HardwareInstance =
> SinglePayloadDescriptor.HardwareInstance, UpdateImageIndex = SinglePayloadDescriptor.UpdateImageIndex, CapsuleSupport =
> ImageCapsuleSupport)
>          try:
>              for EmbeddedDriver in EmbeddedDriverDescriptorList:
>                  FmpCapsuleHeader.AddEmbeddedDriver(EmbeddedDriver)
> diff --git a/BaseTools/Source/Python/Common/Uefi/Capsule/FmpCapsuleHeader.py
> b/BaseTools/Source/Python/Common/Uefi/Capsule/FmpCapsuleHeader.py
> index 91d24919c4..8abb449c6f 100644
> --- a/BaseTools/Source/Python/Common/Uefi/Capsule/FmpCapsuleHeader.py
> +++ b/BaseTools/Source/Python/Common/Uefi/Capsule/FmpCapsuleHeader.py
> @@ -47,14 +47,19 @@ class FmpCapsuleImageHeaderClass (object):
>      #   /// therefore can be modified without changing the Auth data.
>      #   ///
>      #   UINT64   UpdateHardwareInstance;
> +    #
> +    #   ///
> +    #   /// Bits which indicate authentication and depex information for the image that follows this structure
> +    #   ///
> +    #   UINT64   ImageCapsuleSupport
>      # } EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER;
>      #
> -    #  #define EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER_INIT_VERSION 0x00000002
> +    #  #define EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER_INIT_VERSION 0x00000003
>
> -    _StructFormat = '<I16sB3BIIQ'
> +    _StructFormat = '<I16sB3BIIQQ'
>      _StructSize   = struct.calcsize (_StructFormat)
>
> -    EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER_INIT_VERSION = 0x00000002
> +    EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER_INIT_VERSION = 0x00000003
>
>      def __init__ (self):
>          self._Valid                 = False
> @@ -64,6 +69,7 @@ class FmpCapsuleImageHeaderClass (object):
>          self.UpdateImageSize        = 0
>          self.UpdateVendorCodeSize   = 0
>          self.UpdateHardwareInstance = 0x0000000000000000
> +        self.ImageCapsuleSupport    = 0x0000000000000000
>          self.Payload                = b''
>          self.VendorCodeBytes        = b''
>
> @@ -78,7 +84,8 @@ class FmpCapsuleImageHeaderClass (object):
>                                           0,0,0,
>                                           self.UpdateImageSize,
>                                           self.UpdateVendorCodeSize,
> -                                         self.UpdateHardwareInstance
> +                                         self.UpdateHardwareInstance,
> +                                         self.ImageCapsuleSupport
>                                           )
>          self._Valid = True
>          return FmpCapsuleImageHeader + self.Payload + self.VendorCodeBytes
> @@ -86,7 +93,7 @@ class FmpCapsuleImageHeaderClass (object):
>      def Decode (self, Buffer):
>          if len (Buffer) < self._StructSize:
>              raise ValueError
> -        (Version, UpdateImageTypeId, UpdateImageIndex, r0, r1, r2, UpdateImageSize, UpdateVendorCodeSize,
> UpdateHardwareInstance) = \
> +        (Version, UpdateImageTypeId, UpdateImageIndex, r0, r1, r2, UpdateImageSize, UpdateVendorCodeSize,
> UpdateHardwareInstance, ImageCapsuleSupport) = \
>              struct.unpack (
>                       self._StructFormat,
>                       Buffer[0:self._StructSize]
> @@ -105,6 +112,7 @@ class FmpCapsuleImageHeaderClass (object):
>          self.UpdateImageSize        = UpdateImageSize
>          self.UpdateVendorCodeSize   = UpdateVendorCodeSize
>          self.UpdateHardwareInstance = UpdateHardwareInstance
> +        self.ImageCapsuleSupport    = ImageCapsuleSupport
>          self.Payload                = Buffer[self._StructSize:self._StructSize + UpdateImageSize]
>          self.VendorCodeBytes        = Buffer[self._StructSize + UpdateImageSize:]
>          self._Valid                 = True
> @@ -119,6 +127,7 @@ class FmpCapsuleImageHeaderClass (object):
>          print ('EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER.UpdateImageSize        = {UpdateImageSize:08X}'.format
> (UpdateImageSize = self.UpdateImageSize))
>          print ('EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER.UpdateVendorCodeSize   = {UpdateVendorCodeSize:08X}'.format
> (UpdateVendorCodeSize = self.UpdateVendorCodeSize))
>          print ('EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER.UpdateHardwareInstance =
> {UpdateHardwareInstance:016X}'.format (UpdateHardwareInstance = self.UpdateHardwareInstance))
> +        print ('EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER.ImageCapsuleSupport    = {ImageCapsuleSupport:016X}'.format
> (ImageCapsuleSupport = self.ImageCapsuleSupport))
>          print ('sizeof (Payload)                                                    = {Size:08X}'.format (Size = len
> (self.Payload)))
>          print ('sizeof (VendorCodeBytes)                                            = {Size:08X}'.format (Size = len
> (self.VendorCodeBytes)))
>
> @@ -153,6 +162,8 @@ class FmpCapsuleHeaderClass (object):
>      _ItemOffsetSize   = struct.calcsize (_ItemOffsetFormat)
>
>      EFI_FIRMWARE_MANAGEMENT_CAPSULE_HEADER_INIT_VERSION = 0x00000001
> +    CAPSULE_SUPPORT_AUTHENTICATION = 0x0000000000000001
> +    CAPSULE_SUPPORT_DEPENDENCY     = 0x0000000000000002
>
>      def __init__ (self):
>          self._Valid                     = False
> @@ -172,8 +183,8 @@ class FmpCapsuleHeaderClass (object):
>              raise ValueError
>          return self._EmbeddedDriverList[Index]
>
> -    def AddPayload (self, UpdateImageTypeId, Payload = b'', VendorCodeBytes = b'', HardwareInstance = 0, UpdateImageIndex
> = 1):
> -        self._PayloadList.append ((UpdateImageTypeId, Payload, VendorCodeBytes, HardwareInstance, UpdateImageIndex))
> +    def AddPayload (self, UpdateImageTypeId, Payload = b'', VendorCodeBytes = b'', HardwareInstance = 0, UpdateImageIndex
> = 1, CapsuleSupport = 0):
> +        self._PayloadList.append ((UpdateImageTypeId, Payload, VendorCodeBytes, HardwareInstance, UpdateImageIndex,
> CapsuleSupport))
>
>      def GetFmpCapsuleImageHeader (self, Index):
>          if Index >= len (self._FmpCapsuleImageHeaderList):
> @@ -198,13 +209,14 @@ class FmpCapsuleHeaderClass (object):
>              self._ItemOffsetList.append (Offset)
>              Offset = Offset + len (EmbeddedDriver)
>          Index = 1
> -        for (UpdateImageTypeId, Payload, VendorCodeBytes, HardwareInstance, UpdateImageIndex) in self._PayloadList:
> +        for (UpdateImageTypeId, Payload, VendorCodeBytes, HardwareInstance, UpdateImageIndex, CapsuleSupport) in
> self._PayloadList:
>              FmpCapsuleImageHeader = FmpCapsuleImageHeaderClass ()
>              FmpCapsuleImageHeader.UpdateImageTypeId      = UpdateImageTypeId
>              FmpCapsuleImageHeader.UpdateImageIndex       = UpdateImageIndex
>              FmpCapsuleImageHeader.Payload                = Payload
>              FmpCapsuleImageHeader.VendorCodeBytes        = VendorCodeBytes
>              FmpCapsuleImageHeader.UpdateHardwareInstance = HardwareInstance
> +            FmpCapsuleImageHeader.ImageCapsuleSupport    = CapsuleSupport
>              FmpCapsuleImage = FmpCapsuleImageHeader.Encode ()
>              FmpCapsuleData = FmpCapsuleData + FmpCapsuleImage
>
> --
> 2.17.1
>
>
>
>
>


Re: [PATCH v2] BaseTools: Add support for version 3 of FMP Image Header structure

Bob Feng
 

This patch is good to me.
Reviewed-by: Bob Feng <bob.c.feng@intel.com>


Thanks,
Bob

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Sughosh Ganu
Sent: Thursday, April 22, 2021 3:51 PM
To: devel@edk2.groups.io
Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Feng, Bob C <bob.c.feng@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Chen, Christine <yuwei.chen@intel.com>; Sughosh Ganu <sughosh.ganu@linaro.org>
Subject: [edk2-devel] [PATCH v2] BaseTools: Add support for version 3 of FMP Image Header structure

Add support for the ImageCapsuleSupport field, introduced in version 3 of the EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER structure. This structure member is used to indicate if the corresponding payload has support for authentication and dependency.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
---

Changes since v1:
- Reword the patch header to get rid of the PatchCheck warning
- Make passing of ImageCapsuleSupport parameter to the AddPayload
function as an optional parameter to maintain backward compatibility
- Declare the values of CAPSULE_SUPPORT_DEPENDENCY and
CAPSULE_SUPPORT_AUTHENTICATION in the FmpCapsuleHeaderClass and use
those in the GenerateCapsule script

.../Source/Python/Capsule/GenerateCapsule.py | 5 +++-
.../Common/Uefi/Capsule/FmpCapsuleHeader.py | 28 +++++++++++++------
2 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/BaseTools/Source/Python/Capsule/GenerateCapsule.py b/BaseTools/Source/Python/Capsule/GenerateCapsule.py
index a8de988253..b8039db878 100644
--- a/BaseTools/Source/Python/Capsule/GenerateCapsule.py
+++ b/BaseTools/Source/Python/Capsule/GenerateCapsule.py
@@ -561,6 +561,7 @@ if __name__ == '__main__':
print ('GenerateCapsule: error:' + str(Msg))
sys.exit (1)
for SinglePayloadDescriptor in PayloadDescriptorList:
+ ImageCapsuleSupport = 0x0000000000000000
Result = SinglePayloadDescriptor.Payload
try:
FmpPayloadHeader.FwVersion = SinglePayloadDescriptor.FwVersion
@@ -575,6 +576,7 @@ if __name__ == '__main__':
if SinglePayloadDescriptor.UseDependency:
CapsuleDependency.Payload = Result
CapsuleDependency.DepexExp = SinglePayloadDescriptor.DepexExp
+ ImageCapsuleSupport |= FmpCapsuleHeader.CAPSULE_SUPPORT_DEPENDENCY
Result = CapsuleDependency.Encode ()
if args.Verbose:
CapsuleDependency.DumpInfo () @@ -607,13 +609,14 @@ if __name__ == '__main__':
FmpAuthHeader.MonotonicCount = SinglePayloadDescriptor.MonotonicCount
FmpAuthHeader.CertData = CertData
FmpAuthHeader.Payload = Result
+ ImageCapsuleSupport |= FmpCapsuleHeader.CAPSULE_SUPPORT_AUTHENTICATION
Result = FmpAuthHeader.Encode ()
if args.Verbose:
FmpAuthHeader.DumpInfo ()
except:
print ('GenerateCapsule: error: can not encode FMP Auth Header')
sys.exit (1)
- FmpCapsuleHeader.AddPayload (SinglePayloadDescriptor.Guid, Result, HardwareInstance = SinglePayloadDescriptor.HardwareInstance, UpdateImageIndex = SinglePayloadDescriptor.UpdateImageIndex)
+ FmpCapsuleHeader.AddPayload (SinglePayloadDescriptor.Guid,
+ Result, HardwareInstance = SinglePayloadDescriptor.HardwareInstance,
+ UpdateImageIndex = SinglePayloadDescriptor.UpdateImageIndex,
+ CapsuleSupport = ImageCapsuleSupport)
try:
for EmbeddedDriver in EmbeddedDriverDescriptorList:
FmpCapsuleHeader.AddEmbeddedDriver(EmbeddedDriver)
diff --git a/BaseTools/Source/Python/Common/Uefi/Capsule/FmpCapsuleHeader.py b/BaseTools/Source/Python/Common/Uefi/Capsule/FmpCapsuleHeader.py
index 91d24919c4..8abb449c6f 100644
--- a/BaseTools/Source/Python/Common/Uefi/Capsule/FmpCapsuleHeader.py
+++ b/BaseTools/Source/Python/Common/Uefi/Capsule/FmpCapsuleHeader.py
@@ -47,14 +47,19 @@ class FmpCapsuleImageHeaderClass (object):
# /// therefore can be modified without changing the Auth data.
# ///
# UINT64 UpdateHardwareInstance;
+ #
+ # ///
+ # /// Bits which indicate authentication and depex information for the image that follows this structure
+ # ///
+ # UINT64 ImageCapsuleSupport
# } EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER;
#
- # #define EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER_INIT_VERSION 0x00000002
+ # #define
+ EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER_INIT_VERSION 0x00000003

- _StructFormat = '<I16sB3BIIQ'
+ _StructFormat = '<I16sB3BIIQQ'
_StructSize = struct.calcsize (_StructFormat)

- EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER_INIT_VERSION = 0x00000002
+ EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER_INIT_VERSION =
+ 0x00000003

def __init__ (self):
self._Valid = False
@@ -64,6 +69,7 @@ class FmpCapsuleImageHeaderClass (object):
self.UpdateImageSize = 0
self.UpdateVendorCodeSize = 0
self.UpdateHardwareInstance = 0x0000000000000000
+ self.ImageCapsuleSupport = 0x0000000000000000
self.Payload = b''
self.VendorCodeBytes = b''

@@ -78,7 +84,8 @@ class FmpCapsuleImageHeaderClass (object):
0,0,0,
self.UpdateImageSize,
self.UpdateVendorCodeSize,
- self.UpdateHardwareInstance
+ self.UpdateHardwareInstance,
+ self.ImageCapsuleSupport
)
self._Valid = True
return FmpCapsuleImageHeader + self.Payload + self.VendorCodeBytes @@ -86,7 +93,7 @@ class FmpCapsuleImageHeaderClass (object):
def Decode (self, Buffer):
if len (Buffer) < self._StructSize:
raise ValueError
- (Version, UpdateImageTypeId, UpdateImageIndex, r0, r1, r2, UpdateImageSize, UpdateVendorCodeSize, UpdateHardwareInstance) = \
+ (Version, UpdateImageTypeId, UpdateImageIndex, r0, r1, r2,
+ UpdateImageSize, UpdateVendorCodeSize, UpdateHardwareInstance,
+ ImageCapsuleSupport) = \
struct.unpack (
self._StructFormat,
Buffer[0:self._StructSize] @@ -105,6 +112,7 @@ class FmpCapsuleImageHeaderClass (object):
self.UpdateImageSize = UpdateImageSize
self.UpdateVendorCodeSize = UpdateVendorCodeSize
self.UpdateHardwareInstance = UpdateHardwareInstance
+ self.ImageCapsuleSupport = ImageCapsuleSupport
self.Payload = Buffer[self._StructSize:self._StructSize + UpdateImageSize]
self.VendorCodeBytes = Buffer[self._StructSize + UpdateImageSize:]
self._Valid = True
@@ -119,6 +127,7 @@ class FmpCapsuleImageHeaderClass (object):
print ('EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER.UpdateImageSize = {UpdateImageSize:08X}'.format (UpdateImageSize = self.UpdateImageSize))
print ('EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER.UpdateVendorCodeSize = {UpdateVendorCodeSize:08X}'.format (UpdateVendorCodeSize = self.UpdateVendorCodeSize))
print ('EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER.UpdateHardwareInstance = {UpdateHardwareInstance:016X}'.format (UpdateHardwareInstance = self.UpdateHardwareInstance))
+ print ('EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER.ImageCapsuleSupport = {ImageCapsuleSupport:016X}'.format (ImageCapsuleSupport = self.ImageCapsuleSupport))
print ('sizeof (Payload) = {Size:08X}'.format (Size = len (self.Payload)))
print ('sizeof (VendorCodeBytes) = {Size:08X}'.format (Size = len (self.VendorCodeBytes)))

@@ -153,6 +162,8 @@ class FmpCapsuleHeaderClass (object):
_ItemOffsetSize = struct.calcsize (_ItemOffsetFormat)

EFI_FIRMWARE_MANAGEMENT_CAPSULE_HEADER_INIT_VERSION = 0x00000001
+ CAPSULE_SUPPORT_AUTHENTICATION = 0x0000000000000001
+ CAPSULE_SUPPORT_DEPENDENCY = 0x0000000000000002

def __init__ (self):
self._Valid = False
@@ -172,8 +183,8 @@ class FmpCapsuleHeaderClass (object):
raise ValueError
return self._EmbeddedDriverList[Index]

- def AddPayload (self, UpdateImageTypeId, Payload = b'', VendorCodeBytes = b'', HardwareInstance = 0, UpdateImageIndex = 1):
- self._PayloadList.append ((UpdateImageTypeId, Payload, VendorCodeBytes, HardwareInstance, UpdateImageIndex))
+ def AddPayload (self, UpdateImageTypeId, Payload = b'', VendorCodeBytes = b'', HardwareInstance = 0, UpdateImageIndex = 1, CapsuleSupport = 0):
+ self._PayloadList.append ((UpdateImageTypeId, Payload,
+ VendorCodeBytes, HardwareInstance, UpdateImageIndex, CapsuleSupport))

def GetFmpCapsuleImageHeader (self, Index):
if Index >= len (self._FmpCapsuleImageHeaderList):
@@ -198,13 +209,14 @@ class FmpCapsuleHeaderClass (object):
self._ItemOffsetList.append (Offset)
Offset = Offset + len (EmbeddedDriver)
Index = 1
- for (UpdateImageTypeId, Payload, VendorCodeBytes, HardwareInstance, UpdateImageIndex) in self._PayloadList:
+ for (UpdateImageTypeId, Payload, VendorCodeBytes, HardwareInstance, UpdateImageIndex, CapsuleSupport) in self._PayloadList:
FmpCapsuleImageHeader = FmpCapsuleImageHeaderClass ()
FmpCapsuleImageHeader.UpdateImageTypeId = UpdateImageTypeId
FmpCapsuleImageHeader.UpdateImageIndex = UpdateImageIndex
FmpCapsuleImageHeader.Payload = Payload
FmpCapsuleImageHeader.VendorCodeBytes = VendorCodeBytes
FmpCapsuleImageHeader.UpdateHardwareInstance = HardwareInstance
+ FmpCapsuleImageHeader.ImageCapsuleSupport = CapsuleSupport
FmpCapsuleImage = FmpCapsuleImageHeader.Encode ()
FmpCapsuleData = FmpCapsuleData + FmpCapsuleImage

--
2.17.1

14861 - 14880 of 89854