Skip to content

tools/testing: test the Xen unpopulated allocator in userspace - #65

Draft
alexandermerritt wants to merge 1 commit into
edera/mainlinefrom
alexm/xen-dom0-unbacked-runs-ranges2
Draft

alexandermerritt wants to merge 1 commit into
edera/mainlinefrom
alexm/xen-dom0-unbacked-runs-ranges2

Conversation

@alexandermerritt

@alexandermerritt alexandermerritt commented Oct 29, 2026 •

Copy link
Copy Markdown

Tests for #63

This PR has test code for what we have in Linux that isn't tested anywhere else except what could be done by an e2e test. So I am parking it here.

The unpopulated allocator runs only in a Xen guest, and mostly at
boot.  Its hard cases depend on where the boot-time address space
lies: a node that changes inside a 2 MiB block, a region that does
not start or end on a block, a region with no whole block in it.  A
VM cannot choose that layout, and a mistake there does not fail
where it is made: a pfn is handed out twice or lost, and a mapping
or the balloon finds out long after.

Build drivers/xen/unpopulated-alloc.c, as it is in the tree, against
a fake memory map of four nodes, and check after every step that
each pfn the allocator was given is free in exactly one place or
held by a caller.  Build with AddressSanitizer and UBSan, as the
memblock and radix-tree tests do, so that a read or write past the
memory map also fails.
@alexandermerritt alexandermerritt self-assigned this Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant