Skip to content

Commit d175ee9

Browse files
chleroyzx2c4
authored andcommitted
mm: Define VM_DROPPABLE for powerpc/32
Commit 9651fce ("mm: add MAP_DROPPABLE for designating always lazily freeable mappings") only adds VM_DROPPABLE for 64 bits architectures. In order to also use the getrandom vDSO implementation on powerpc/32, use VM_ARCH_1 for VM_DROPPABLE on powerpc/32. This is possible because VM_ARCH_1 is used for VM_SAO on powerpc and VM_SAO is only for powerpc/64. It is used in combination with PROT_SAO in some parts of code that are restricted to CONFIG_PPC64 through #ifdefs, it is therefore possible to define VM_SAO for CONFIG_PPC64 only. Signed-off-by: Christophe Leroy <[email protected]> Acked-by: Michael Ellerman <[email protected]> Signed-off-by: Jason A. Donenfeld <[email protected]>
1 parent c730493 commit d175ee9

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

fs/proc/task_mmu.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -987,8 +987,10 @@ static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma)
987987
#ifdef CONFIG_X86_USER_SHADOW_STACK
988988
[ilog2(VM_SHADOW_STACK)] = "ss",
989989
#endif
990-
#ifdef CONFIG_64BIT
990+
#if defined(CONFIG_64BIT) || defined(CONFIG_PPC32)
991991
[ilog2(VM_DROPPABLE)] = "dp",
992+
#endif
993+
#ifdef CONFIG_64BIT
992994
[ilog2(VM_SEALED)] = "sl",
993995
#endif
994996
};

include/linux/mm.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ extern unsigned int kobjsize(const void *objp);
359359

360360
#if defined(CONFIG_X86)
361361
# define VM_PAT VM_ARCH_1 /* PAT reserves whole VMA at once (x86) */
362-
#elif defined(CONFIG_PPC)
362+
#elif defined(CONFIG_PPC64)
363363
# define VM_SAO VM_ARCH_1 /* Strong Access Ordering (powerpc) */
364364
#elif defined(CONFIG_PARISC)
365365
# define VM_GROWSUP VM_ARCH_1
@@ -409,6 +409,8 @@ extern unsigned int kobjsize(const void *objp);
409409
#ifdef CONFIG_64BIT
410410
#define VM_DROPPABLE_BIT 40
411411
#define VM_DROPPABLE BIT(VM_DROPPABLE_BIT)
412+
#elif defined(CONFIG_PPC32)
413+
#define VM_DROPPABLE VM_ARCH_1
412414
#else
413415
#define VM_DROPPABLE VM_NONE
414416
#endif

include/trace/events/mmflags.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ IF_HAVE_PG_ARCH_X(arch_3)
143143

144144
#if defined(CONFIG_X86)
145145
#define __VM_ARCH_SPECIFIC_1 {VM_PAT, "pat" }
146-
#elif defined(CONFIG_PPC)
146+
#elif defined(CONFIG_PPC64)
147147
#define __VM_ARCH_SPECIFIC_1 {VM_SAO, "sao" }
148148
#elif defined(CONFIG_PARISC)
149149
#define __VM_ARCH_SPECIFIC_1 {VM_GROWSUP, "growsup" }
@@ -165,7 +165,7 @@ IF_HAVE_PG_ARCH_X(arch_3)
165165
# define IF_HAVE_UFFD_MINOR(flag, name)
166166
#endif
167167

168-
#ifdef CONFIG_64BIT
168+
#if defined(CONFIG_64BIT) || defined(CONFIG_PPC32)
169169
# define IF_HAVE_VM_DROPPABLE(flag, name) {flag, name},
170170
#else
171171
# define IF_HAVE_VM_DROPPABLE(flag, name)

0 commit comments

Comments
 (0)