git: 8d1ea089800a - stable/13 - Support EFIRT on arm64 with a non 4k page size

From: Andrew Turner <andrew_at_FreeBSD.org>
Date: Tue, 19 Apr 2022 10:05:30 UTC
The branch stable/13 has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=8d1ea089800a1fc61d18d75d6a7f46c94fa7626d

commit 8d1ea089800a1fc61d18d75d6a7f46c94fa7626d
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2022-03-23 15:18:30 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2022-04-19 09:18:02 +0000

    Support EFIRT on arm64 with a non 4k page size
    
    When the page size the kernel is built for is not the same as
    EFI_PAGE_SIZE we need to increment the page index at a faster rate.
    
    Add this adjustment to the arm64 EFIRT support in preperation for
    experimental 16k PAGE_SIZE support.
    
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit 863f3220d09716ea2e570fadc6b19dcb6e4c2191)
---
 sys/arm64/arm64/efirt_machdep.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/arm64/arm64/efirt_machdep.c b/sys/arm64/arm64/efirt_machdep.c
index cd4e5d7bae00..717b6cc86e17 100644
--- a/sys/arm64/arm64/efirt_machdep.c
+++ b/sys/arm64/arm64/efirt_machdep.c
@@ -221,8 +221,8 @@ efi_create_1t1_map(struct efi_md *map, int ndesc, int descsz)
 			l3_attr |= ATTR_S1_XN;
 
 		VM_OBJECT_WLOCK(obj_1t1_pt);
-		for (va = p->md_phys, idx = 0; idx < p->md_pages; idx++,
-		    va += PAGE_SIZE) {
+		for (va = p->md_phys, idx = 0; idx < p->md_pages;
+		    idx += (PAGE_SIZE / EFI_PAGE_SIZE), va += PAGE_SIZE) {
 			l3 = efi_1t1_l3(va);
 			*l3 = va | l3_attr;
 		}