File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -493,14 +493,13 @@ struct q_inval {
493493
494494/* Page Request Queue depth */
495495#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)
498499
499500struct dmar_pci_notify_info ;
500501
501502#ifdef CONFIG_IRQ_REMAP
502- /* 1MB - maximum possible interrupt remapping table size */
503- #define INTR_REMAP_PAGE_ORDER 8
504503#define INTR_REMAP_TABLE_REG_SIZE 0xf
505504#define INTR_REMAP_TABLE_REG_SIZE_MASK 0xf
506505
Original file line number Diff line number Diff line change @@ -530,11 +530,11 @@ static int intel_setup_irq_remapping(struct intel_iommu *iommu)
530530 if (!ir_table )
531531 return - ENOMEM ;
532532
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 );
535536 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 );
538538 goto out_free_table ;
539539 }
540540
Original file line number Diff line number Diff line change @@ -60,7 +60,8 @@ int intel_pasid_alloc_table(struct device *dev)
6060
6161 size = max_pasid >> (PASID_PDE_SHIFT - 3 );
6262 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 ));
6465 if (!dir ) {
6566 kfree (pasid_table );
6667 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)
290290 struct iopf_queue * iopfq ;
291291 int irq , ret ;
292292
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 );
294295 if (!iommu -> prq ) {
295296 pr_warn ("IOMMU: %s: Failed to allocate page request queue\n" ,
296297 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)
8484 return list_empty (& list -> pages );
8585}
8686
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-
10387/**
10488 * iommu_alloc_pages_sz - Allocate a zeroed page of a given size from
10589 * specific NUMA node
You can’t perform that action at this time.
0 commit comments