xen/arm: mm: Avoid flushing the TLBs when mapping are inserted
authorJulien Grall <jgrall@amazon.com>
Fri, 20 May 2022 12:09:24 +0000 (13:09 +0100)
committerJulien Grall <jgrall@amazon.com>
Wed, 8 Jun 2022 10:04:53 +0000 (11:04 +0100)
commit07d11f63d03ee919038e707e6618846cf4e6df0f
treea12ef3ce1bf89cda977aa60b0abdaa69fd64c5e8
parentd1459136f39546950c19a640834b0205ca71a84c
xen/arm: mm: Avoid flushing the TLBs when mapping are inserted

Currently, the function xen_pt_update() will flush the TLBs even when
the mappings are inserted. This is a bit wasteful because we don't
allow mapping replacement. Even if we were, the flush would need to
happen earlier because mapping replacement should use Break-Before-Make
when updating the entry.

A single call to xen_pt_update() can perform a single action. IOW, it
is not possible to, for instance, mix inserting and removing mappings.
Therefore, we can use `flags` to determine what action is performed.

This change will be particularly help to limit the impact of switching
boot time mapping to use xen_pt_update().

Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
Tested-by: Luca Fancellu <luca.fancellu@arm.com>
xen/arch/arm/mm.c