On Tue, 08 Sep 2026 12:07:09 +0100,
Fuad Tabba [off-list ref] wrote:
Hi folks,
The per-CPU EL2 stacks are initialised as host-owned after pKVM init.
fix_host_ownership() walks only the linear-map alias of each memblock
region, and the stacks, mapped in the private VA range for their guard
pages, have none.
Patch 1 is the fix, and it needs none of the other three. Patch 4 adds
the check that would have caught it and would catch similar instances
in the future: once the transfer is done, walk the private VA range and
fail init unless every valid leaf is hyp-owned, or is hyp text mapped
without write access.
Patch 2 is a fix in its own right, but to a different bug.
fix_host_ownership_walker() matches hyp text on its stage-1 permissions,
and that test hasn't matched on a non-hVHE host since 7.0, so hyp text
is donated there rather than left read-only. Nothing crashes, but the
instruction dump on hyp panic reads a page the host can't access, so
the Code: line comes out as question marks. It matches by physical
address instead, which is what patch 4 needs too. Patch 3 splits the
start of the range from the allocation cursor, with no functional
change, so patch 4 knows where the range begins.
Reviewed-by: Marc Zyngier <maz@kernel.org>
M.
--
Without deviation from the norm, progress is not possible.