xen/arm: tlbflush: Rework TLB helpers
authorJulien Grall <julien.grall@arm.com>
Wed, 3 Apr 2019 22:53:23 +0000 (23:53 +0100)
committerJulien Grall <julien.grall@arm.com>
Wed, 12 Jun 2019 15:13:36 +0000 (16:13 +0100)
commit721aa1ed1bad8feb572ed2701f89b7b6d7484f89
tree1cc66fc35869a9e09d18ff3fa480f6d81ad1b92d
parentc9a82940afb2f8195625fd42c68aa6d185b54b27
xen/arm: tlbflush: Rework TLB helpers

All the TLBs helpers invalidate all the TLB entries are using the same
pattern:
    DSB SY
    TLBI ...
    DSB SY
    ISB

This pattern is following pattern recommended by the Arm Arm to ensure
visibility of updates to translation tables (see K11.5.2 in ARM DDI
0487D.b).

We have been a bit too eager in Xen and use system-wide DSBs when this
can be limited to the inner-shareable domain.

Furthermore, the first DSB can be restrict further to only store in the
inner-shareable domain. This is because the DSB is here to ensure
visibility of the update to translation table walks.

Lastly, there are a lack of documentation in most of the TLBs helper.

Rather than trying to update the helpers one by one, this patch
introduce a per-arch macro to generate the TLB helpers. This will be
easier to update the TLBs helper in the future and the documentation.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Andrii Anisov <andrii_anisov@epam.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/include/asm-arm/arm32/flushtlb.h
xen/include/asm-arm/arm64/flushtlb.h