diff options
author | Wei Wang <wei.wang2@amd.com> | 2011-11-11 12:03:21 +0100 |
---|---|---|
committer | Wei Wang <wei.wang2@amd.com> | 2011-11-11 12:03:21 +0100 |
commit | 756273ab103c20be805fcbea1c3dbee6aed73e71 (patch) | |
tree | e9e7f9bd65f38a16c2375fe91d249b2e646da614 /xen/include/asm-x86/amd-iommu.h | |
parent | ce56a70bd78a43e59266d884c1398c1ede2f3b89 (diff) | |
download | xen-756273ab103c20be805fcbea1c3dbee6aed73e71.tar.gz xen-756273ab103c20be805fcbea1c3dbee6aed73e71.tar.bz2 xen-756273ab103c20be805fcbea1c3dbee6aed73e71.zip |
amd iommu: Cleanup iommu pci capabilites detection
* Define new structure to represent capability block.
* Remove unnecessary read for unused information.
* Add sanity check into get_iommu_capabilities.
* iommu capability offset is 16 bit not 8 bit, fix that.
Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
Diffstat (limited to 'xen/include/asm-x86/amd-iommu.h')
-rw-r--r-- | xen/include/asm-x86/amd-iommu.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/xen/include/asm-x86/amd-iommu.h b/xen/include/asm-x86/amd-iommu.h index 5dc97c6766..df36fe25ac 100644 --- a/xen/include/asm-x86/amd-iommu.h +++ b/xen/include/asm-x86/amd-iommu.h @@ -36,16 +36,22 @@ struct table_struct { unsigned long alloc_size; }; +typedef struct iommu_cap { + uint32_t header; /* offset 00h */ + uint32_t base_low; /* offset 04h */ + uint32_t base_hi; /* offset 08h */ + uint32_t range; /* offset 0Ch */ + uint32_t misc; /* offset 10h */ +} iommu_cap_t; + struct amd_iommu { struct list_head list; spinlock_t lock; /* protect iommu */ u16 seg; u16 bdf; - u8 cap_offset; - u8 revision; - u8 unit_id; - u8 msi_number; + u16 cap_offset; + iommu_cap_t cap; u8 pte_not_present_cached; u8 ht_tunnel_support; |