git: 101e825e551a - main - arm64: Refine comment about size of struct pmap_large_md_page
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 15 Jan 2025 15:03:44 UTC
The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=101e825e551afc69a7cebb78fa6b676d38d93d2d commit 101e825e551afc69a7cebb78fa6b676d38d93d2d Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2025-01-15 15:03:12 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2025-01-15 15:03:12 +0000 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 --- sys/arm64/arm64/pmap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index fd6798668626..23eedff2e7cd 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -1547,11 +1547,11 @@ pmap_init_pv_table(void) int domain, i, j, pages; /* - * We strongly depend on the size being a power of two, so the assert - * is overzealous. However, should the struct be resized to a - * different power of two, the code below needs to be revisited. + * We depend on the size being evenly divisible into a page so + * that the pv_table array can be indexed directly while + * safely spanning multiple pages from different domains. */ - CTASSERT((sizeof(*pvd) == 64)); + CTASSERT(PAGE_SIZE % sizeof(*pvd) == 0); /* * Calculate the size of the array.