diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -2308,11 +2308,11 @@ 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. diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -1351,11 +1351,11 @@ 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.