Skip to content

Commit 6617da8

Browse files
jgross1akpm00
authored andcommitted
mm: add dummy pmd_young() for architectures not having it
In order to avoid #ifdeffery add a dummy pmd_young() implementation as a fallback. This is required for the later patch "mm: introduce arch_has_hw_nonleaf_pmd_young()". Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Juergen Gross <[email protected]> Acked-by: Yu Zhao <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Sander Eikelenboom <[email protected]> Cc: Thomas Gleixner <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 95bc35f commit 6617da8

File tree

7 files changed

+13
-0
lines changed

7 files changed

+13
-0
lines changed

arch/loongarch/include/asm/pgtable.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,7 @@ static inline pmd_t pmd_mkdirty(pmd_t pmd)
482482
return pmd;
483483
}
484484

485+
#define pmd_young pmd_young
485486
static inline int pmd_young(pmd_t pmd)
486487
{
487488
return !!(pmd_val(pmd) & _PAGE_ACCESSED);

arch/mips/include/asm/pgtable.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,7 @@ static inline pmd_t pmd_mkdirty(pmd_t pmd)
622622
return pmd;
623623
}
624624

625+
#define pmd_young pmd_young
625626
static inline int pmd_young(pmd_t pmd)
626627
{
627628
return !!(pmd_val(pmd) & _PAGE_ACCESSED);

arch/riscv/include/asm/pgtable.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,7 @@ static inline int pmd_dirty(pmd_t pmd)
600600
return pte_dirty(pmd_pte(pmd));
601601
}
602602

603+
#define pmd_young pmd_young
603604
static inline int pmd_young(pmd_t pmd)
604605
{
605606
return pte_young(pmd_pte(pmd));

arch/s390/include/asm/pgtable.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,7 @@ static inline int pmd_dirty(pmd_t pmd)
763763
return (pmd_val(pmd) & _SEGMENT_ENTRY_DIRTY) != 0;
764764
}
765765

766+
#define pmd_young pmd_young
766767
static inline int pmd_young(pmd_t pmd)
767768
{
768769
return (pmd_val(pmd) & _SEGMENT_ENTRY_YOUNG) != 0;

arch/sparc/include/asm/pgtable_64.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,7 @@ static inline unsigned long pmd_dirty(pmd_t pmd)
693693
return pte_dirty(pte);
694694
}
695695

696+
#define pmd_young pmd_young
696697
static inline unsigned long pmd_young(pmd_t pmd)
697698
{
698699
pte_t pte = __pte(pmd_val(pmd));

arch/x86/include/asm/pgtable.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ static inline int pmd_dirty(pmd_t pmd)
139139
return pmd_flags(pmd) & _PAGE_DIRTY;
140140
}
141141

142+
#define pmd_young pmd_young
142143
static inline int pmd_young(pmd_t pmd)
143144
{
144145
return pmd_flags(pmd) & _PAGE_ACCESSED;

include/linux/pgtable.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,13 @@ static inline pte_t *virt_to_kpte(unsigned long vaddr)
165165
return pmd_none(*pmd) ? NULL : pte_offset_kernel(pmd, vaddr);
166166
}
167167

168+
#ifndef pmd_young
169+
static inline int pmd_young(pmd_t pmd)
170+
{
171+
return 0;
172+
}
173+
#endif
174+
168175
#ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
169176
extern int ptep_set_access_flags(struct vm_area_struct *vma,
170177
unsigned long address, pte_t *ptep,

0 commit comments

Comments
 (0)