Skip to contentSkip to conversation

x86/mm: Drop unneeded __always_inline for p4d page table helpers

PATCH Superseded Kirill A. Shutemov 2 participants 3 messages Jun 25, 2018 – Jun 26, 2018 x86

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/mm: Drop unneeded __always_inline for p4d page table helpers

This reverts commits 1ea66554d3b09ce09c42e6a871899c84a276bb39 and 046c0dbec0238c25b7526c26c9a9687664229ce2.

p4d_offset(), native_set_p4d() and native_p4d_clear() were marked __always_inline in attempt to move __pgtable_l5_enabled into __initdata section.

It was required as KASAN initialization code is a user of USE_EARLY_PGTABLE_L5, so all pgtable_l5_enabled() translated to __pgtable_l5_enabled there. This includes pgtable_l5_enabled() called from inline p4d helpers.

If compiler would decided to not inline these p4d helpers, but leave them standalone, we end up with section mismatch.

We don't need __always_inline here anymore. __pgtable_l5_enabled moved back to be __ro_after_init. See commit

51be13351517 ("Revert "x86/mm: Mark __pgtable_l5_enabled __initdata"")

---
 arch/x86/include/asm/pgtable.h    | 2 +-
 arch/x86/include/asm/pgtable_64.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
arch/x86/include/asm/pgtable.h +1 -1
index 99ecde23c3ec..5715647fc4fe 100644
@@ -898,7 +898,7 @@ static inline unsigned long pgd_page_vaddr(pgd_t pgd)
 #define pgd_page(pgd)	pfn_to_page(pgd_pfn(pgd))
 
 /* to find an entry in a page-table-directory. */
-static __always_inline p4d_t *p4d_offset(pgd_t *pgd, unsigned long address)
+static inline p4d_t *p4d_offset(pgd_t *pgd, unsigned long address)
 {
 	if (!pgtable_l5_enabled())
 		return (p4d_t *)pgd;
arch/x86/include/asm/pgtable_64.h +2 -2
index 0fdcd21dadbd..3c5385f9a88f 100644
@@ -216,7 +216,7 @@ static inline pgd_t pti_set_user_pgd(pgd_t *pgdp, pgd_t pgd)
 }
 #endif
 
-static __always_inline void native_set_p4d(p4d_t *p4dp, p4d_t p4d)
+static inline void native_set_p4d(p4d_t *p4dp, p4d_t p4d)
 {
 	pgd_t pgd;
 
@@ -230,7 +230,7 @@ static __always_inline void native_set_p4d(p4d_t *p4dp, p4d_t p4d)
 	*p4dp = native_make_p4d(native_pgd_val(pgd));
 }
 
-static __always_inline void native_p4d_clear(p4d_t *p4d)
+static inline void native_p4d_clear(p4d_t *p4d)
 {
 	native_set_p4d(p4d, native_make_p4d(0));
 }
Signature · 1 line
2.18.0
#1 lore raw
Quoted 2 lines · Kirill A. Shutemov

This reverts commits 1ea66554d3b09ce09c42e6a871899c84a276bb39 and 046c0dbec0238c25b7526c26c9a9687664229ce2.

Could you please write out these commits explicitly and both with title, with one commit per line, like you did here:

Quoted 1 line

51be13351517 ("Revert "x86/mm: Mark __pgtable_l5_enabled __initdata"")

?

Thanks,

Ingo

#2 lore raw
Quoted 6 lines · Ingo Molnar
Quoted 2 lines · Kirill A. Shutemov

This reverts commits 1ea66554d3b09ce09c42e6a871899c84a276bb39 and 046c0dbec0238c25b7526c26c9a9687664229ce2.

Quoted 6 lines

Could you please write out these commits explicitly and both with title, with one commit per line, like you did here:

Quoted 1 line

51be13351517 ("Revert "x86/mm: Mark __pgtable_l5_enabled __initdata"")

?

Okay.

I've tried to mimic commit message produced by `git revert'.

Signature · 1 line
 Kirill A. Shutemov