arm64: Reduce PT size estimation complexity

count_required_pts()'s complexity is pretty terrible if mappings
are not using the largest possible block size (due to some other
requirement such as tracking dirty pages, for example).

Let's switch to a method that follows the pattern established with
the add_map() helper, and make it almost instantaneous instead of
taking a crazy amount of time if 2MB mappings are in use instead of
1GB.

Bug: 217161634
Signed-off-by: Marc Zyngier <maz@kernel.org>
Change-Id: I473fc866f0948767c354d26a99d22a78e0e58645
1 file changed