]> xenbits.xensource.com Git - xen.git/commit
xen/arm: guest_walk: Only generate necessary offsets/masks
authorJulien Grall <jgrall@amazon.com>
Sun, 18 Apr 2021 18:11:15 +0000 (19:11 +0100)
committerJulien Grall <jgrall@amazon.com>
Sun, 18 Apr 2021 18:11:15 +0000 (19:11 +0100)
commit05031fa87357fad155f659cfc2dcce6614834684
treeabd6767bbbf3cbf2604bcc97906062953a90355e
parent8d1ca2ac8d5763e72350b4f1ff34ae3276d99e4a
xen/arm: guest_walk: Only generate necessary offsets/masks

At the moment, we are computing offsets/masks for each level and
granularity. This is a bit of waste given that we only need to
know the offsets/masks for the granularity used by the guest.

All the LPAE information can easily be inferred with just the
page shift for a given granularity and the level.

So rather than providing a set of helpers per granularity, we can
provide a single set that takes the granularity and the level in
parameters.

With the new helpers in place, we can rework guest_walk_ld() to
only compute necessary information.

Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Tested-by: Bertrand Marquish <bertrand.marquis@arm.com>
xen/arch/arm/guest_walk.c
xen/include/asm-arm/lpae.h