xen/arm32: head: Introduce macros to create table and mapping entry
authorJulien Grall <julien.grall@arm.com>
Mon, 12 Aug 2019 15:30:25 +0000 (16:30 +0100)
committerJulien Grall <julien.grall@arm.com>
Thu, 26 Sep 2019 15:03:39 +0000 (16:03 +0100)
commit23dfe48d101adde8f7c61ba03d9738a47b2dc50e
tree82488e07cfcb5d6660ca73fcc5181d2160d29121
parente14d26424bc1fb90913d830b4f8c6b4afc7c8c1b
xen/arm32: head: Introduce macros to create table and mapping entry

At the moment, any update to the boot-pages are open-coded. This is
making more difficult to understand the logic of a function as each
update roughly requires 6 instructions.

To ease the readability, two new macros are introduced:
    - create_table_entry: Create a page-table entry in a given table.
    This can work at any level.
    - create_mapping_entry: Create a mapping entry in a given table.
    None of the users will require to map at any other level than 3rd
    (i.e page granularity). So the macro is only supporting 3rd level
    mapping.

Unlike arm64, there are no easy way to have a PC relative address within
the range -/+4GB. In order to have the possibility to use the macro in
context with MMU on/off, the user needs to tell the state of the MMU.

Lastly, take the opportunity to replace open-coded version in
setup_fixmap() by the two new macros. The ones in create_page_tables()
will be replaced in a follow-up patch.

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