]> xenbits.xensource.com Git - xen.git/commit
amd-iommu: use a bitfield for DTE
authorPaul Durrant <paul.durrant@citrix.com>
Wed, 3 Apr 2019 13:16:08 +0000 (15:16 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 3 Apr 2019 13:16:08 +0000 (15:16 +0200)
commit3a7947b69011fa5439ebb5e746aaa4452ef1c2d5
tree2c2be4b3add2f2d2013dc6353099e2492123093a
parent516c36bcb4916271777e3b5e8b8a43ab4464166d
amd-iommu: use a bitfield for DTE

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_dte) and uses this
structure in all DTE manipulation, resulting in much more readable and
compact code.

NOTE: This patch also includes some clean-up of get_dma_requestor_id() to
      change the types of the arguments from u16 to uint16_t.

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