From 6670b74f94dca9dcdcfdcabc370527c735bb152d Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Thu, 11 Mar 2021 21:08:09 +0100 Subject: [PATCH 1/4] MdeModulePkg/Guid: introduce FVB_ADDRESS_LIST Introduce a new GUIDed HOB. The GUIDed HOB contains a 64-bit physical address (FVB_ADDRESS_LIST_PTR), pointing to FVB_ADDRESS_LIST. FVB_ADDRESS_LIST itself lives in reserved memory, and drivers can populate it with up to 16 FVB-related addresses (64-bit words). This will be used to stash the original (physical) and converted (virtual) addresses of some FVB member functions, for guest memory dumping and debugging purposes. Signed-off-by: Laszlo Ersek --- MdeModulePkg/MdeModulePkg.dec | 3 ++ MdeModulePkg/Include/Guid/FvbAddressList.h | 45 ++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index f1144144be14..a67f4e8eb92c 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -400,14 +400,17 @@ [Guids] ## GUID indicates the capsule is to store Capsule On Disk file names. gEdkiiCapsuleOnDiskNameGuid = { 0x98c80a4f, 0xe16b, 0x4d11, { 0x93, 0x9a, 0xab, 0xe5, 0x61, 0x26, 0x3, 0x30 } } ## Include/Guid/MigratedFvInfo.h gEdkiiMigratedFvInfoGuid = { 0xc1ab12f7, 0x74aa, 0x408d, { 0xa2, 0xf4, 0xc6, 0xce, 0xfd, 0x17, 0x98, 0x71 } } + ## Include/Guid/FvbAddressList.h + gEdkiiFvbAddressListGuid = { 0xaa87bf00, 0x7f76, 0x4e32, { 0xb3, 0x92, 0x86, 0xa1, 0x3e, 0x37, 0x33, 0x11 } } + [Ppis] ## Include/Ppi/AtaController.h gPeiAtaControllerPpiGuid = { 0xa45e60d1, 0xc719, 0x44aa, { 0xb0, 0x7a, 0xaa, 0x77, 0x7f, 0x85, 0x90, 0x6d }} ## Include/Ppi/UsbHostController.h gPeiUsbHostControllerPpiGuid = { 0x652B38A9, 0x77F4, 0x453F, { 0x89, 0xD5, 0xE7, 0xBD, 0xC3, 0x52, 0xFC, 0x53 }} diff --git a/MdeModulePkg/Include/Guid/FvbAddressList.h b/MdeModulePkg/Include/Guid/FvbAddressList.h new file mode 100644 index 000000000000..92aa781383f5 --- /dev/null +++ b/MdeModulePkg/Include/Guid/FvbAddressList.h @@ -0,0 +1,45 @@ +/** @file + Stash FVB-related addresses in a reserved memory structure, pointed-to by a + pointer living in a GUID-ed HOB. + + Copyright (C) 2021 Red Hat, Inc. + + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef FVB_ADDRESS_LIST_H_ +#define FVB_ADDRESS_LIST_H_ + +#define EDKII_FVB_ADDRESS_LIST_GUID \ + { \ + 0xaa87bf00, \ + 0x7f76, \ + 0x4e32, \ + { 0xb3, 0x92, 0x86, 0xa1, 0x3e, 0x37, 0x33, 0x11 } \ + } + +#define FVB_ADDRESS_LIST_SIGNATURE \ + SIGNATURE_64 ('F', 'V', 'B', 'A', 'D', 'R', 'L', 'S') + +typedef struct { + UINT64 OwnerSignature; + UINT64 Address; +} FVB_ADDRESS_LIST_ENTRY; + +// +// lives in reserved memory +// +typedef struct { + UINT64 Signature; + FVB_ADDRESS_LIST_ENTRY Entry[16]; + UINT32 Next; +} FVB_ADDRESS_LIST; + +// +// HOB contents: a pointer to FVB_ADDRESS_LIST +// +typedef UINT64 FVB_ADDRESS_LIST_PTR; + +extern EFI_GUID gEdkiiFvbAddressListGuid; + +#endif // FVB_ADDRESS_LIST_H_ -- 2.19.1.3.g30247aa5d201