Skip to content

Commit cfc5bbc

Browse files
kvaneeshtorvalds
authored andcommitted
mm/debug_vm_pgtable/ppc64: avoid setting top bits in radom value
ppc64 use bit 62 to indicate a pte entry (_PAGE_PTE). Avoid setting that bit in random value. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com> Cc: Christophe Leroy <christophe.leroy@csgroup.eu> Cc: Michael Ellerman <mpe@ellerman.id.au> Link: https://lkml.kernel.org/r/20200902114222.181353-4-aneesh.kumar@linux.ibm.com Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 379c926 commit cfc5bbc

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

‎mm/debug_vm_pgtable.c‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,17 @@
4444
* entry type. But these bits might affect the ability to clear entries with
4545
* pxx_clear() because of how dynamic page table folding works on s390. So
4646
* while loading up the entries do not change the lower 4 bits. It does not
47-
* have affect any other platform.
47+
* have affect any other platform. Also avoid the 62nd bit on ppc64 that is
48+
* used to mark a pte entry.
4849
*/
49-
#define S390_MASK_BITS 4
50-
#define RANDOM_ORVALUE GENMASK(BITS_PER_LONG - 1, S390_MASK_BITS)
50+
#define S390_SKIP_MASK GENMASK(3, 0)
51+
#if __BITS_PER_LONG == 64
52+
#define PPC64_SKIP_MASK GENMASK(62, 62)
53+
#else
54+
#define PPC64_SKIP_MASK 0x0
55+
#endif
56+
#define ARCH_SKIP_MASK (S390_SKIP_MASK | PPC64_SKIP_MASK)
57+
#define RANDOM_ORVALUE (GENMASK(BITS_PER_LONG - 1, 0) & ~ARCH_SKIP_MASK)
5158
#define RANDOM_NZVALUE GENMASK(7, 0)
5259

5360
static void __init pte_basic_tests(unsigned long pfn, pgprot_t prot)

0 commit comments

Comments
 (0)