iommu/amd: Re-define amd_iommu_domain_encode_pgtable as inline
authorSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Tue, 15 Dec 2020 07:36:53 +0000 (01:36 -0600)
committerJoerg Roedel <jroedel@suse.de>
Wed, 27 Jan 2021 12:04:05 +0000 (13:04 +0100)
Move the function to header file to allow inclusion in other files.

Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Link: https://lore.kernel.org/r/20201215073705.123786-2-suravee.suthikulpanit@amd.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd/amd_iommu.h
drivers/iommu/amd/iommu.c

index 6b8cbdf7171407bfbe8f6114cf7cc40a8b02b897..0817bc732d1ad77109dd72df525f9495c535b2bf 100644 (file)
@@ -102,6 +102,19 @@ static inline void *iommu_phys_to_virt(unsigned long paddr)
        return phys_to_virt(__sme_clr(paddr));
 }
 
+static inline
+void amd_iommu_domain_set_pt_root(struct protection_domain *domain, u64 root)
+{
+       atomic64_set(&domain->pt_root, root);
+}
+
+static inline
+void amd_iommu_domain_clr_pt_root(struct protection_domain *domain)
+{
+       amd_iommu_domain_set_pt_root(domain, 0);
+}
+
+
 extern bool translation_pre_enabled(struct amd_iommu *iommu);
 extern bool amd_iommu_is_attach_deferred(struct iommu_domain *domain,
                                         struct device *dev);
index f0adbc48fd17954085033bec1e53c740c3040066..3485f8b60d7a395020b407b455000747db5e8402 100644 (file)
@@ -160,16 +160,6 @@ static void amd_iommu_domain_get_pgtable(struct protection_domain *domain,
        pgtable->mode = pt_root & 7; /* lowest 3 bits encode pgtable mode */
 }
 
-static void amd_iommu_domain_set_pt_root(struct protection_domain *domain, u64 root)
-{
-       atomic64_set(&domain->pt_root, root);
-}
-
-static void amd_iommu_domain_clr_pt_root(struct protection_domain *domain)
-{
-       amd_iommu_domain_set_pt_root(domain, 0);
-}
-
 static void amd_iommu_domain_set_pgtable(struct protection_domain *domain,
                                         u64 *root, int mode)
 {