Skip to content

Commit 6a3d5fd

Browse files
jgunthorpejoergroedel
authored andcommitted
iommupt: Make pt_feature() always_inline
gcc 8.5 on powerpc does not automatically inline these functions even though they evaluate to constants in key cases. Since the constant propagation is essential for some code elimination and built-time checks this causes a build failure: ERROR: modpost: "__pt_no_sw_bit" [drivers/iommu/generic_pt/fmt/iommu_amdv1.ko] undefined! Caused by this: if (pts_feature(&pts, PT_FEAT_DMA_INCOHERENT) && !pt_test_sw_bit_acquire(&pts, SW_BIT_CACHE_FLUSH_DONE)) flush_writes_item(&pts); Where pts_feature() evaluates to a constant false. Mark them as __always_inline to force it to evaluate to a constant and trigger the code elimination. Fixes: 7c5b184 ("genpt: Generic Page Table base API") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202512230720.9y9DtWIo-lkp@intel.com/ Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
1 parent 7adfd68 commit 6a3d5fd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/iommu/generic_pt/pt_defs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ static inline bool pt_table_install32(struct pt_state *pts, u32 table_entry)
202202

203203
#define PT_SUPPORTED_FEATURE(feature_nr) (PT_SUPPORTED_FEATURES & BIT(feature_nr))
204204

205-
static inline bool pt_feature(const struct pt_common *common,
205+
static __always_inline bool pt_feature(const struct pt_common *common,
206206
unsigned int feature_nr)
207207
{
208208
if (PT_FORCE_ENABLED_FEATURES & BIT(feature_nr))
@@ -212,7 +212,7 @@ static inline bool pt_feature(const struct pt_common *common,
212212
return common->features & BIT(feature_nr);
213213
}
214214

215-
static inline bool pts_feature(const struct pt_state *pts,
215+
static __always_inline bool pts_feature(const struct pt_state *pts,
216216
unsigned int feature_nr)
217217
{
218218
return pt_feature(pts->range->common, feature_nr);

0 commit comments

Comments
 (0)