File tree Expand file tree Collapse file tree 5 files changed +11
-26
lines changed Expand file tree Collapse file tree 5 files changed +11
-26
lines changed Original file line number Diff line number Diff line change @@ -493,14 +493,13 @@ struct q_inval {
493
493
494
494
/* Page Request Queue depth */
495
495
#define PRQ_ORDER 4
496
- #define PRQ_RING_MASK ((0x1000 << PRQ_ORDER) - 0x20)
497
- #define PRQ_DEPTH ((0x1000 << PRQ_ORDER) >> 5)
496
+ #define PRQ_SIZE (SZ_4K << PRQ_ORDER)
497
+ #define PRQ_RING_MASK (PRQ_SIZE - 0x20)
498
+ #define PRQ_DEPTH (PRQ_SIZE >> 5)
498
499
499
500
struct dmar_pci_notify_info ;
500
501
501
502
#ifdef CONFIG_IRQ_REMAP
502
- /* 1MB - maximum possible interrupt remapping table size */
503
- #define INTR_REMAP_PAGE_ORDER 8
504
503
#define INTR_REMAP_TABLE_REG_SIZE 0xf
505
504
#define INTR_REMAP_TABLE_REG_SIZE_MASK 0xf
506
505
Original file line number Diff line number Diff line change @@ -530,11 +530,11 @@ static int intel_setup_irq_remapping(struct intel_iommu *iommu)
530
530
if (!ir_table )
531
531
return - ENOMEM ;
532
532
533
- ir_table_base = iommu_alloc_pages_node (iommu -> node , GFP_KERNEL ,
534
- INTR_REMAP_PAGE_ORDER );
533
+ /* 1MB - maximum possible interrupt remapping table size */
534
+ ir_table_base =
535
+ iommu_alloc_pages_node_sz (iommu -> node , GFP_KERNEL , SZ_1M );
535
536
if (!ir_table_base ) {
536
- pr_err ("IR%d: failed to allocate pages of order %d\n" ,
537
- iommu -> seq_id , INTR_REMAP_PAGE_ORDER );
537
+ pr_err ("IR%d: failed to allocate 1M of pages\n" , iommu -> seq_id );
538
538
goto out_free_table ;
539
539
}
540
540
Original file line number Diff line number Diff line change @@ -60,7 +60,8 @@ int intel_pasid_alloc_table(struct device *dev)
60
60
61
61
size = max_pasid >> (PASID_PDE_SHIFT - 3 );
62
62
order = size ? get_order (size ) : 0 ;
63
- dir = iommu_alloc_pages_node (info -> iommu -> node , GFP_KERNEL , order );
63
+ dir = iommu_alloc_pages_node_sz (info -> iommu -> node , GFP_KERNEL ,
64
+ 1 << (order + PAGE_SHIFT ));
64
65
if (!dir ) {
65
66
kfree (pasid_table );
66
67
return - ENOMEM ;
Original file line number Diff line number Diff line change @@ -290,7 +290,8 @@ int intel_iommu_enable_prq(struct intel_iommu *iommu)
290
290
struct iopf_queue * iopfq ;
291
291
int irq , ret ;
292
292
293
- iommu -> prq = iommu_alloc_pages_node (iommu -> node , GFP_KERNEL , PRQ_ORDER );
293
+ iommu -> prq =
294
+ iommu_alloc_pages_node_sz (iommu -> node , GFP_KERNEL , PRQ_SIZE );
294
295
if (!iommu -> prq ) {
295
296
pr_warn ("IOMMU: %s: Failed to allocate page request queue\n" ,
296
297
iommu -> name );
Original file line number Diff line number Diff line change @@ -84,22 +84,6 @@ static inline bool iommu_pages_list_empty(struct iommu_pages_list *list)
84
84
return list_empty (& list -> pages );
85
85
}
86
86
87
- /**
88
- * iommu_alloc_pages_node - Allocate a zeroed page of a given order from
89
- * specific NUMA node
90
- * @nid: memory NUMA node id
91
- * @gfp: buddy allocator flags
92
- * @order: page order
93
- *
94
- * Returns the virtual address of the allocated page.
95
- * Prefer to use iommu_alloc_pages_node_lg2()
96
- */
97
- static inline void * iommu_alloc_pages_node (int nid , gfp_t gfp ,
98
- unsigned int order )
99
- {
100
- return iommu_alloc_pages_node_sz (nid , gfp , 1 << (order + PAGE_SHIFT ));
101
- }
102
-
103
87
/**
104
88
* iommu_alloc_pages_sz - Allocate a zeroed page of a given size from
105
89
* specific NUMA node
You can’t perform that action at this time.
0 commit comments