xen/arm: p2m: Introduce p2m_is_valid and use it
authorJulien Grall <julien.grall@arm.com>
Wed, 21 Feb 2018 14:18:42 +0000 (14:18 +0000)
committerJulien Grall <julien.grall@arm.com>
Wed, 12 Dec 2018 15:49:47 +0000 (15:49 +0000)
commit2a654d312914218782e4e3fc359ff20fe62f7b60
tree5b1320db80e89987e7a58403961e174f16b01d60
parent202784f2d2d4033a0f19930804c9d4ef824fdd16
xen/arm: p2m: Introduce p2m_is_valid and use it

The LPAE format allows to store information in an entry even with the
valid bit unset. In a follow-up patch, we will take advantage of this
feature to re-purpose the valid bit for generating a translation fault
even if an entry contains valid information.

So we need a different way to know whether an entry contains valid
information. It is possible to use the information hold in the p2m_type
to know for that purpose. Indeed all entries containing valid
information will have a valid p2m type (i.e p2m_type != p2m_invalid).

This patch introduces a new helper p2m_is_valid, which implements that
idea, and replace most of lpae_is_valid call with the new helper. The ones
remaining are for TLBs handling and entries accounting.

With the renaming there are 2 others changes required:
    - Generate table entry with a valid p2m type
    - Detect new mapping for proper stats accounting

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/p2m.c