Skip to content

xen/arm: find the extended regions when booted with ACPI - #2

Draft
azenla wants to merge 1 commit into
azenla/base/6.18.50from
azenla/fix/arm64-xen-extended-regions
Draft

azenla wants to merge 1 commit into
azenla/base/6.18.50from
azenla/fix/arm64-xen-extended-regions

Conversation

@azenla

@azenla azenla commented Sep 15, 2026

Copy link
Copy Markdown
Member

arch_xen_unpopulated_init() gives up immediately on a domain that is using ACPI, so xen_alloc_unpopulated_pages() has no address space to hand out and falls back to ballooning the domain's own memory out instead. On arm64 that fallback grows the balloon through memory hotplug, and add_memory_resource() picks a range from iomem_resource with nothing to say whether it is safe to map. When it is not, arch_add_memory() walks into

BUG_ON(!pgattr_change_is_safe(...))

in alloc_init_cont_pte(), and creating a guest takes dom0 down with it.

The regions are not actually missing. Xen publishes them in the hypervisor node of the device tree it hands over whichever way the machine is described, and dt_scan_depth1_nodes() has already read that node during early boot -- it is how the tree was judged empty enough to use ACPI in the first place. What is missing is a reader: the tree is never unflattened when ACPI is in use, so of_find_compatible_node() below has nothing to walk.

Read them from the flat tree in that case. The device tree path is unchanged.

arch_xen_unpopulated_init() gives up immediately on a domain that is using
ACPI, so xen_alloc_unpopulated_pages() has no address space to hand out and
falls back to ballooning the domain's own memory out instead.  On arm64 that
fallback grows the balloon through memory hotplug, and add_memory_resource()
picks a range from iomem_resource with nothing to say whether it is safe to
map.  When it is not, arch_add_memory() walks into

	BUG_ON(!pgattr_change_is_safe(...))

in alloc_init_cont_pte(), and creating a guest takes dom0 down with it.

The regions are not actually missing.  Xen publishes them in the hypervisor
node of the device tree it hands over whichever way the machine is described,
and dt_scan_depth1_nodes() has already read that node during early boot -- it
is how the tree was judged empty enough to use ACPI in the first place.  What
is missing is a reader: the tree is never unflattened when ACPI is in use, so
of_find_compatible_node() below has nothing to walk.

Read them from the flat tree in that case.  The device tree path is unchanged.

Signed-off-by: Alex Zenla <alex@edera.dev>
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