aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2009-05-12 04:56:44 -0400
committerJoerg Roedel <joerg.roedel@amd.com>2009-05-28 12:12:52 -0400
commitc3239567a20e90e3026ac5453d5267506ef7b030 (patch)
tree403aea58ec7d0e4d0f1233c4b4d472885ffe738d /arch/x86/include
parent41fb454ebe6024f5c1e3b3cbc0abc0da762e7b51 (diff)
amd-iommu: introduce aperture_range structure
This is a preperation for extended address allocator. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'arch/x86/include')
-rw-r--r--arch/x86/include/asm/amd_iommu_types.h32
1 files changed, 22 insertions, 10 deletions
diff --git a/arch/x86/include/asm/amd_iommu_types.h b/arch/x86/include/asm/amd_iommu_types.h
index 95c8cd9d22b5..4c64c9bc6839 100644
--- a/arch/x86/include/asm/amd_iommu_types.h
+++ b/arch/x86/include/asm/amd_iommu_types.h
@@ -195,6 +195,8 @@
195#define PD_DEFAULT_MASK (1UL << 1) /* domain is a default dma_ops 195#define PD_DEFAULT_MASK (1UL << 1) /* domain is a default dma_ops
196 domain for an IOMMU */ 196 domain for an IOMMU */
197 197
198#define APERTURE_RANGE_SIZE (128 * 1024 * 1024)
199
198/* 200/*
199 * This structure contains generic data for IOMMU protection domains 201 * This structure contains generic data for IOMMU protection domains
200 * independent of their use. 202 * independent of their use.
@@ -210,6 +212,24 @@ struct protection_domain {
210}; 212};
211 213
212/* 214/*
215 * For dynamic growth the aperture size is split into ranges of 128MB of
216 * DMA address space each. This struct represents one such range.
217 */
218struct aperture_range {
219
220 /* address allocation bitmap */
221 unsigned long *bitmap;
222
223 /*
224 * Array of PTE pages for the aperture. In this array we save all the
225 * leaf pages of the domain page table used for the aperture. This way
226 * we don't need to walk the page table to find a specific PTE. We can
227 * just calculate its address in constant time.
228 */
229 u64 *pte_pages[64];
230};
231
232/*
213 * Data container for a dma_ops specific protection domain 233 * Data container for a dma_ops specific protection domain
214 */ 234 */
215struct dma_ops_domain { 235struct dma_ops_domain {
@@ -224,16 +244,8 @@ struct dma_ops_domain {
224 /* address we start to search for free addresses */ 244 /* address we start to search for free addresses */
225 unsigned long next_bit; 245 unsigned long next_bit;
226 246
227 /* address allocation bitmap */ 247 /* address space relevant data */
228 unsigned long *bitmap; 248 struct aperture_range aperture;
229
230 /*
231 * Array of PTE pages for the aperture. In this array we save all the
232 * leaf pages of the domain page table used for the aperture. This way
233 * we don't need to walk the page table to find a specific PTE. We can
234 * just calculate its address in constant time.
235 */
236 u64 **pte_pages;
237 249
238 /* This will be set to true when TLB needs to be flushed */ 250 /* This will be set to true when TLB needs to be flushed */
239 bool need_flush; 251 bool need_flush;