amd-iommu: use a bitfield for PTE/PDE
authorPaul Durrant <paul.durrant@citrix.com>
Wed, 3 Apr 2019 13:15:29 +0000 (15:15 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 3 Apr 2019 13:15:29 +0000 (15:15 +0200)
commit516c36bcb4916271777e3b5e8b8a43ab4464166d
tree4c7339e5c647eabc818691f89ff2c4ca7df67a61
parentd59e4dadba52b40c4a5f07f18039b42323469672
amd-iommu: use a bitfield for PTE/PDE

The current use of get/set_field_from/in_reg_u32() is both inefficient and
requires some ugly casting.

This patch defines a new bitfield structure (amd_iommu_pte) and uses this
structure in all PTE/PDE manipulation, resulting in much more readable
and compact code.

NOTE: This commit also fixes one malformed comment in
      set_iommu_pte_present().

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Acked-by: Brian Woods <brian.woods@amd.com>
xen/drivers/passthrough/amd/iommu_map.c
xen/drivers/passthrough/amd/pci_amd_iommu.c
xen/include/asm-x86/hvm/svm/amd-iommu-defs.h
xen/include/asm-x86/hvm/svm/amd-iommu-proto.h