iommu/ipmmu-vmsa: Add helper functions for MMU "context" registers
authorOleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Mon, 20 Dec 2021 21:15:49 +0000 (23:15 +0200)
committerJulien Grall <jgrall@amazon.com>
Thu, 27 Jan 2022 12:33:30 +0000 (12:33 +0000)
commitcbba37c8a3d07ae3b17eee7e4aaadfb23cf4feec
tree42eb8ea03c48e318c76fe4bb24858ebcc59217f9
parentcf61c9378df6cdd26300d5ecabc2576aeae81c67
iommu/ipmmu-vmsa: Add helper functions for MMU "context" registers

This is a non-verbatim port of corresponding Linux upsteam commit:
16d9454f5e0447f9c19cbf350b35ed377b9f64eb

Original commit message:
 commit 16d9454f5e0447f9c19cbf350b35ed377b9f64eb
 Author: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
 Date:   Wed Nov 6 11:35:47 2019 +0900

  iommu/ipmmu-vmsa: Add helper functions for MMU "context" registers

  Since we will have changed memory mapping of the IPMMU in the future,
  This patch adds helper functions ipmmu_ctx_{reg,read,write}()
  for MMU "context" registers. No behavior change.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
**********

This is a prereq work needed to add support for S4 series easily
in the future.

Besides changes done in the original commit, we also need to update
an extra call sites which Linux driver doesn't have, but Xen driver
has such as ipmmu_ctx_write_cache(), etc.

No change in behavior.

Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Acked-by: Julien Grall <jgrall@amazon.com>
xen/drivers/passthrough/arm/ipmmu-vmsa.c