Probably a known bug that cannot be fixed for compatibility reasons:
EFI_BOOT_SCRIPT_INFORMATION_OPCODE takes two arguments, "InformationLength" and
"Information". According to the PI spec, Information is a pointer pointing to
runtime memory or ACPI NVS, and the BootScript record will store the pointer
(ie. not the data pointed-to).
However the implementation in
BootScriptWriteInformation()
MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveState.c
and in the underlying library function
S3BootScriptSaveInformation()
MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
dereference the pointer when the opcode is added, and the pointed-to data is
copied into the script.
This is no problem per se, it's just not what the spec says. The spec would
need something like:
diff --git a/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
b/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
index c087dd9..655496f 100644
--- a/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
+++ b/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
@@ -1449,14 +1449,14 @@ RETURN_STATUS
EFIAPI
S3BootScriptSaveInformation (
IN UINT32 InformationLength,
- IN VOID *Information
+ IN EFI_PHYSICAL_ADDRESS Information
)
{
UINT8 Length;
UINT8 *Script;
EFI_BOOT_SCRIPT_INFORMATION ScriptInformation;
- Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_INFORMATION) + InformationLength);
+ Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_INFORMATION) + sizeof
Information);
Script = S3BootScriptGetEntryAddAddress (Length);
if (Script == NULL) {
@@ -1472,7 +1472,7 @@ S3BootScriptSaveInformation (
ScriptInformation.InformationLength = InformationLength;
CopyMem ((VOID*)Script, (VOID*)&ScriptInformation, sizeof
(EFI_BOOT_SCRIPT_INFORMATION));
- CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_INFORMATION)), (VOID *)
Information, (UINTN) InformationLength);
+ CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_INFORMATION)),
&Information, sizeof Information);
SyncBootScript (Script);
diff --git a/MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveState.c
b/MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveState.c
index 60cd9b1..70e206f 100644
--- a/MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveState.c
+++ b/MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveState.c
@@ -418,7 +418,7 @@ BootScriptWriteInformation (
InformationLength = VA_ARG (Marker, UINT32);
Information = VA_ARG (Marker, EFI_PHYSICAL_ADDRESS);
- return S3BootScriptSaveInformation (InformationLength,
(VOID*)(UINTN)Information);
+ return S3BootScriptSaveInformation (InformationLength, Information);
}
/**
Internal function to add IO poll opcode node to the table
The replay code would need the corresponding change.
The current code also limits the size of the information to less than 255
bytes, and makes the InformationLength argument redundant.
Thanks
Laszlo
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel