+#ifdef __x86_64__This check is correct, but it misses some cases. It'd be worth going
+ TEST_ASSERT(get_page_stats(X86_PAGE_SIZE_4K) != 0,
+ "4K page is zero");
+ if (p->backing_src == VM_MEM_SRC_ANONYMOUS_THP)
+ TEST_ASSERT(get_page_stats(X86_PAGE_SIZE_2M) != 0,
+ "2M page is zero");
+ if (p->backing_src == VM_MEM_SRC_ANONYMOUS_HUGETLB_1GB)
+ TEST_ASSERT(get_page_stats(X86_PAGE_SIZE_1G) != 0,
+ "1G page is zero");
+#endif
back to ensure that all relevant backing src types are handled here.
For example, this misses VM_MEM_SRC_ANONYMOUS_HUGETLB_2MB.
We could also be more precise by asserting that the counts are at
least some value or total to some value. THP introduces some flakiness
but one way or another the mapping counts at this point should total
up to account for the expected size of guest memory.