]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iommu/amd: Make amd_iommu_make_clear_dte() non-static inline
authorSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Thu, 15 Jan 2026 06:08:04 +0000 (06:08 +0000)
committerJoerg Roedel <joerg.roedel@amd.com>
Sun, 18 Jan 2026 09:56:11 +0000 (10:56 +0100)
This will be reused in a new nested.c file for nested translation.

Also, remove unused function parameter ptr.

Reviewed-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
drivers/iommu/amd/amd_iommu.h
drivers/iommu/amd/iommu.c

index b742ef1adb352bce7fbb611040ff7a9b038a141a..8eb5e98570798425a0e4eacf1cd619583edad228 100644 (file)
@@ -190,4 +190,12 @@ void amd_iommu_domain_set_pgtable(struct protection_domain *domain,
 struct dev_table_entry *get_dev_table(struct amd_iommu *iommu);
 struct iommu_dev_data *search_dev_data(struct amd_iommu *iommu, u16 devid);
 
+static inline void
+amd_iommu_make_clear_dte(struct iommu_dev_data *dev_data, struct dev_table_entry *new)
+{
+       /* All existing DTE must have V bit set */
+       new->data128[0] = DTE_FLAG_V;
+       new->data128[1] = 0;
+}
+
 #endif /* AMD_IOMMU_H */
index e3d9215244eac9913e9c1ddf58248157c03cd628..ae26fbe090237d69a296574541f05ab4a6b55019 100644 (file)
@@ -2015,14 +2015,6 @@ int amd_iommu_clear_gcr3(struct iommu_dev_data *dev_data, ioasid_t pasid)
        return ret;
 }
 
-static void make_clear_dte(struct iommu_dev_data *dev_data, struct dev_table_entry *ptr,
-                          struct dev_table_entry *new)
-{
-       /* All existing DTE must have V bit set */
-       new->data128[0] = DTE_FLAG_V;
-       new->data128[1] = 0;
-}
-
 /*
  * Note:
  * The old value for GCR3 table and GPT have been cleared from caller.
@@ -2072,7 +2064,7 @@ static void set_dte_entry(struct amd_iommu *iommu,
        struct dev_table_entry *dte = &get_dev_table(iommu)[dev_data->devid];
        struct pt_iommu_amdv1_hw_info pt_info;
 
-       make_clear_dte(dev_data, dte, &new);
+       amd_iommu_make_clear_dte(dev_data, &new);
 
        if (gcr3_info && gcr3_info->gcr3_tbl)
                domid = dev_data->gcr3_info.domid;
@@ -2153,9 +2145,8 @@ static void set_dte_entry(struct amd_iommu *iommu,
 static void clear_dte_entry(struct amd_iommu *iommu, struct iommu_dev_data *dev_data)
 {
        struct dev_table_entry new = {};
-       struct dev_table_entry *dte = &get_dev_table(iommu)[dev_data->devid];
 
-       make_clear_dte(dev_data, dte, &new);
+       amd_iommu_make_clear_dte(dev_data, &new);
        update_dte256(iommu, dev_data, &new);
 }