@@ -1124,7 +1124,7 @@ static inline u64 build_inv_address(u64 address, size_t size)
11241124}
11251125
11261126static void build_inv_iommu_pages (struct iommu_cmd * cmd , u64 address ,
1127- size_t size , u16 domid , int pde )
1127+ size_t size , u16 domid )
11281128{
11291129 u64 inv_address = build_inv_address (address , size );
11301130
@@ -1133,8 +1133,8 @@ static void build_inv_iommu_pages(struct iommu_cmd *cmd, u64 address,
11331133 cmd -> data [2 ] = lower_32_bits (inv_address );
11341134 cmd -> data [3 ] = upper_32_bits (inv_address );
11351135 CMD_SET_TYPE (cmd , CMD_INV_IOMMU_PAGES );
1136- if ( pde ) /* PDE bit - we want to flush everything, not only the PTEs */
1137- cmd -> data [2 ] |= CMD_INV_IOMMU_PAGES_PDE_MASK ;
1136+ /* PDE bit - we want to flush everything, not only the PTEs */
1137+ cmd -> data [2 ] |= CMD_INV_IOMMU_PAGES_PDE_MASK ;
11381138}
11391139
11401140static void build_inv_iotlb_pages (struct iommu_cmd * cmd , u16 devid , int qdep ,
@@ -1341,7 +1341,7 @@ static void amd_iommu_flush_tlb_all(struct amd_iommu *iommu)
13411341 for (dom_id = 0 ; dom_id <= last_bdf ; ++ dom_id ) {
13421342 struct iommu_cmd cmd ;
13431343 build_inv_iommu_pages (& cmd , 0 , CMD_INV_IOMMU_ALL_PAGES_ADDRESS ,
1344- dom_id , 1 );
1344+ dom_id );
13451345 iommu_queue_command (iommu , & cmd );
13461346 }
13471347
@@ -1352,8 +1352,7 @@ static void amd_iommu_flush_tlb_domid(struct amd_iommu *iommu, u32 dom_id)
13521352{
13531353 struct iommu_cmd cmd ;
13541354
1355- build_inv_iommu_pages (& cmd , 0 , CMD_INV_IOMMU_ALL_PAGES_ADDRESS ,
1356- dom_id , 1 );
1355+ build_inv_iommu_pages (& cmd , 0 , CMD_INV_IOMMU_ALL_PAGES_ADDRESS , dom_id );
13571356 iommu_queue_command (iommu , & cmd );
13581357
13591358 iommu_completion_wait (iommu );
@@ -1476,13 +1475,13 @@ static int device_flush_dte(struct iommu_dev_data *dev_data)
14761475 * page. Otherwise it flushes the whole TLB of the IOMMU.
14771476 */
14781477static void __domain_flush_pages (struct protection_domain * domain ,
1479- u64 address , size_t size , int pde )
1478+ u64 address , size_t size )
14801479{
14811480 struct iommu_dev_data * dev_data ;
14821481 struct iommu_cmd cmd ;
14831482 int ret = 0 , i ;
14841483
1485- build_inv_iommu_pages (& cmd , address , size , domain -> id , pde );
1484+ build_inv_iommu_pages (& cmd , address , size , domain -> id );
14861485
14871486 for (i = 0 ; i < amd_iommu_get_num_iommus (); ++ i ) {
14881487 if (!domain -> dev_iommu [i ])
@@ -1507,10 +1506,10 @@ static void __domain_flush_pages(struct protection_domain *domain,
15071506}
15081507
15091508static void domain_flush_pages (struct protection_domain * domain ,
1510- u64 address , size_t size , int pde )
1509+ u64 address , size_t size )
15111510{
15121511 if (likely (!amd_iommu_np_cache )) {
1513- __domain_flush_pages (domain , address , size , pde );
1512+ __domain_flush_pages (domain , address , size );
15141513 return ;
15151514 }
15161515
@@ -1543,7 +1542,7 @@ static void domain_flush_pages(struct protection_domain *domain,
15431542
15441543 flush_size = 1ul << min_alignment ;
15451544
1546- __domain_flush_pages (domain , address , flush_size , pde );
1545+ __domain_flush_pages (domain , address , flush_size );
15471546 address += flush_size ;
15481547 size -= flush_size ;
15491548 }
@@ -1552,7 +1551,7 @@ static void domain_flush_pages(struct protection_domain *domain,
15521551/* Flush the whole IO/TLB for a given protection domain - including PDE */
15531552void amd_iommu_domain_flush_tlb_pde (struct protection_domain * domain )
15541553{
1555- domain_flush_pages (domain , 0 , CMD_INV_IOMMU_ALL_PAGES_ADDRESS , 1 );
1554+ domain_flush_pages (domain , 0 , CMD_INV_IOMMU_ALL_PAGES_ADDRESS );
15561555}
15571556
15581557void amd_iommu_domain_flush_complete (struct protection_domain * domain )
@@ -1579,7 +1578,7 @@ static void domain_flush_np_cache(struct protection_domain *domain,
15791578 unsigned long flags ;
15801579
15811580 spin_lock_irqsave (& domain -> lock , flags );
1582- domain_flush_pages (domain , iova , size , 1 );
1581+ domain_flush_pages (domain , iova , size );
15831582 amd_iommu_domain_flush_complete (domain );
15841583 spin_unlock_irqrestore (& domain -> lock , flags );
15851584 }
@@ -2591,7 +2590,7 @@ static void amd_iommu_iotlb_sync(struct iommu_domain *domain,
25912590 unsigned long flags ;
25922591
25932592 spin_lock_irqsave (& dom -> lock , flags );
2594- domain_flush_pages (dom , gather -> start , gather -> end - gather -> start + 1 , 1 );
2593+ domain_flush_pages (dom , gather -> start , gather -> end - gather -> start + 1 );
25952594 amd_iommu_domain_flush_complete (dom );
25962595 spin_unlock_irqrestore (& dom -> lock , flags );
25972596}
0 commit comments