Skip to content

Commit 101e825

Browse files
committed
arm64: Refine comment about size of struct pmap_large_md_page
pmap_init_pv_table does not assume a specific size of 64. It does assume a size that evenly divides the size of a page since it inserts pages from different domains into the kva backing the global pv_table array. Reviewed by: imp, markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D48455
1 parent 5c341fe commit 101e825

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sys/arm64/arm64/pmap.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -1547,11 +1547,11 @@ pmap_init_pv_table(void)
15471547
int domain, i, j, pages;
15481548

15491549
/*
1550-
* We strongly depend on the size being a power of two, so the assert
1551-
* is overzealous. However, should the struct be resized to a
1552-
* different power of two, the code below needs to be revisited.
1550+
* We depend on the size being evenly divisible into a page so
1551+
* that the pv_table array can be indexed directly while
1552+
* safely spanning multiple pages from different domains.
15531553
*/
1554-
CTASSERT((sizeof(*pvd) == 64));
1554+
CTASSERT(PAGE_SIZE % sizeof(*pvd) == 0);
15551555

15561556
/*
15571557
* Calculate the size of the array.

0 commit comments

Comments
 (0)