git: 57e47ae514b6 - main - Include the EFI Runtime Code in the DMAP

From: Andrew Turner <andrew_at_FreeBSD.org>
Date: Sun, 10 Apr 2022 08:56:18 UTC
The branch main has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=57e47ae514b6ab605298b4595e0219048f59ab7a

commit 57e47ae514b6ab605298b4595e0219048f59ab7a
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2022-04-09 20:17:43 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2022-04-10 08:41:54 +0000

    Include the EFI Runtime Code in the DMAP
    
    Some UEFI implementations place the system table in a runtime code
    memory region. Include it in the DMAP so we can read it later.
    
    Reviewed by:    kevans
    Differential Revision: https://reviews.freebsd.org/D34861
---
 sys/arm64/arm64/machdep.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c
index b673a38ee385..4568f3752938 100644
--- a/sys/arm64/arm64/machdep.c
+++ b/sys/arm64/arm64/machdep.c
@@ -486,6 +486,12 @@ add_efi_map_entry(struct efi_md *p)
 {
 
 	switch (p->md_type) {
+	case EFI_MD_TYPE_RT_CODE:
+		/*
+		 * Some UEFI implementations put the system table in the
+		 * runtime code section. Include it in the DMAP, but will
+		 * be excluded from phys_avail later.
+		 */
 	case EFI_MD_TYPE_RT_DATA:
 		/*
 		 * Runtime data will be excluded after the DMAP