summaryrefslogtreecommitdiff
path: root/memattrs.c
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2025-02-20 14:44:10 -0500
committerPeter Jones <pjones@redhat.com>2025-02-24 15:58:16 -0500
commit9269e9b0aa15ae9832f7eba6c5eeef0c5e1f4edb (patch)
treeb279f2af0682fc90877858f86404ddb2533a1855 /memattrs.c
parentc41b1f066b9f279b70d933095f277eddbd7c6433 (diff)
downloadefi-boot-shim-9269e9b0aa15ae9832f7eba6c5eeef0c5e1f4edb.tar.gz
efi-boot-shim-9269e9b0aa15ae9832f7eba6c5eeef0c5e1f4edb.zip
Add DXE Services information to HSI
This adds three more entries to our HSI data: has-dxe-services-table: technically only tells us if UEFI's LocateProtocol will give us a DXE services table, but practically also tells us if the machine is implementing DXE in any way. has-get-memory-space-descriptor: tells us if DXE->GetMemorySpaceDescriptor is populated has-set-memory-space-descriptor: tells us if DXE->SetMemorySpaceDescriptor is populated Signed-off-by: Peter Jones <pjones@redhat.com>
Diffstat (limited to 'memattrs.c')
-rw-r--r--memattrs.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/memattrs.c b/memattrs.c
index a2c1777c..f502805f 100644
--- a/memattrs.c
+++ b/memattrs.c
@@ -50,7 +50,7 @@ get_dxe_services_table(EFI_DXE_SERVICES_TABLE **dstp)
static EFI_DXE_SERVICES_TABLE *dst = NULL;
if (dst == NULL) {
- dprint(L"Looking for configuration table " LGUID_FMT L"\n", GUID_ARGS(gEfiDxeServicesTableGuid));
+ dprint(L"Looking for configuration table " LGUID_FMT L"\n", GUID_ARGS(gEfiDxeServicesTableGuid));
for (UINTN i = 0; i < ST->NumberOfTableEntries; i++) {
EFI_CONFIGURATION_TABLE *ct = &ST->ConfigurationTable[i];
@@ -408,6 +408,7 @@ get_hsi_mem_info(void)
uint64_t attrs = 0;
uint32_t *tmp_alloc;
EFI_MEMORY_ATTRIBUTE_PROTOCOL *efiproto = NULL;
+ EFI_DXE_SERVICES_TABLE *dst = NULL;
get_efi_mem_attr_protocol(&efiproto);
if (efiproto) {
@@ -415,7 +416,18 @@ get_hsi_mem_info(void)
dprint(L"Setting HSI to 0x%lx\n", hsi_status);
}
- if (!(hsi_status & SHIM_HSI_STATUS_HASMAP)) {
+ get_dxe_services_table(&dst);
+ if (dst) {
+ hsi_status |= SHIM_HSI_STATUS_HASDST;
+ if (dst->GetMemorySpaceDescriptor)
+ hsi_status |= SHIM_HSI_STATUS_HASDSTGMSD;
+ if (dst->SetMemorySpaceAttributes)
+ hsi_status |= SHIM_HSI_STATUS_HASDSTSMSA;
+ }
+
+ if (!(hsi_status & SHIM_HSI_STATUS_HASMAP) &&
+ !(hsi_status & SHIM_HSI_STATUS_HASDSTGMSD &&
+ hsi_status & SHIM_HSI_STATUS_HASDSTSMSA)) {
dprint(L"No memory protocol, not testing further\n");
return;
}