All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] futex: fix shared futex operations on nommu
@ 2016-04-26  1:03 Rich Felker
  2016-04-26  9:55 ` Sebastian Andrzej Siewior
  2016-04-27 13:43 ` Thomas Gleixner
  0 siblings, 2 replies; 8+ messages in thread
From: Rich Felker @ 2016-04-26  1:03 UTC (permalink / raw)
  To: linux-kernel
  Cc: Thomas Gleixner, Davidlohr Bueso, Ingo Molnar, Andrew Morton,
	Darren Hart, Mel Gorman, Sebastian Andrzej Siewior,
	Kirill A. Shutemov, Greg Ungerer, Geert Uytterhoeven,
	Yoshinori Sato

The shared get_futex_key code does not work on nommu, but is not
needed anyway because it's impossible for a given backing to have
multiple distinct virtual addresses on nommu. Simply disable these
code paths by refraining from setting FLAG_SHARED when CONFIG_MMU is
not enabled.

Signed-off-by: Rich Felker <dalias@libc.org>
---
 kernel/futex.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/futex.c b/kernel/futex.c
index a5d2e74..ed6f475 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -3131,8 +3131,10 @@ long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout,
 	int cmd = op & FUTEX_CMD_MASK;
 	unsigned int flags = 0;
 
+#ifdef CONFIG_MMU
 	if (!(op & FUTEX_PRIVATE_FLAG))
 		flags |= FLAGS_SHARED;
+#endif
 
 	if (op & FUTEX_CLOCK_REALTIME) {
 		flags |= FLAGS_CLOCKRT;
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-04-27 13:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-26  1:03 [PATCH] futex: fix shared futex operations on nommu Rich Felker
2016-04-26  9:55 ` Sebastian Andrzej Siewior
2016-04-26 15:53   ` Rich Felker
2016-04-26 16:11     ` Sebastian Andrzej Siewior
2016-04-26 16:27       ` Rich Felker
2016-04-26 22:27         ` Andrew Morton
2016-04-26 22:31           ` Rich Felker
2016-04-27 13:43 ` Thomas Gleixner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.