]> xenbits.xensource.com Git - xen.git/commit
arm/p2m: Rework p2m_init()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 25 Oct 2022 09:21:11 +0000 (09:21 +0000)
committerJulien Grall <jgrall@amazon.com>
Tue, 25 Oct 2022 19:59:32 +0000 (20:59 +0100)
commitf25c377285d155d7d88cb0e4efad58f7fd8c9d4b
treef7393b6065d378f912769498b1d2d1730218125e
parent016de62747b26ead5a5c763b640fe8e205cd182b
arm/p2m: Rework p2m_init()

p2m_init() is mostly trivial initialisation, but has two fallible operations
which are on either side of the backpointer trigger for teardown to take
actions.

p2m_free_vmid() is idempotent with a failed p2m_alloc_vmid(), so rearrange
p2m_init() to perform all trivial setup, then set the backpointer, then
perform all fallible setup.

This will simplify a future bugfix which needs to add a third fallible
operation.

No practical change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
(cherry picked from commit: 3783e583319fa1ce75e414d851f0fde191a14753)
xen/arch/arm/p2m.c