Sparc
Please pull to get these two bug fixes:
1) Fix boots with gcc-4.9 compiled sparc64 kernels.
2) Add missing __get_user_pages_fast() on sparc64 to fix hangs on futexes used in transparent hugepage areas.
It's really idiotic to have a weak symbolled fallback that just returns zero, and causes this kind of bug. There should be no backup implementation and the link should fail if the architecture fails to provide __get_user_pages_fast() and supports transparent hugepages.
Thanks.
The following changes since commit 61ed53deb1c6a4386d8710dbbfcee8779c381931:
Merge tag 'ntb-3.18' of git://github.com/jonmason/ntb (2014-10-19 12:58:22 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc.git master
for you to fetch changes up to 06090e8ed89ea2113a236befb41f71d51f100e60:
sparc64: Implement __get_user_pages_fast(). (2014-10-24 09:59:02 -0700)
----------------------------------------------------------------
David S. Miller (2):
sparc64: Fix register corruption in top-most kernel stack frame during boot.
sparc64: Implement __get_user_pages_fast().
arch/sparc/include/asm/oplib_64.h | 3 ++- arch/sparc/include/asm/setup.h | 2 ++ arch/sparc/kernel/entry.h | 3 --- arch/sparc/kernel/head_64.S | 40 ++++------------------------------------ arch/sparc/kernel/hvtramp.S | 1 - arch/sparc/kernel/setup_64.c | 28 ++++++++++++++++++++-------- arch/sparc/kernel/trampoline_64.S | 12 +++++++----- arch/sparc/mm/gup.c | 30 ++++++++++++++++++++++++++++++ arch/sparc/prom/cif.S | 5 ++--- arch/sparc/prom/init_64.c | 6 +++--- arch/sparc/prom/p1275.c | 2 -- 11 files changed, 70 insertions(+), 62 deletions(-)
Quoted 6 lines · David Miller
It's really idiotic to have a weak symbolled fallback that just returns zero, and causes this kind of bug. There should be no backup implementation and the link should fail if the architecture fails to provide
__get_user_pages_fast()and supports transparent hugepages.
Agreed. I think the weak fallback is for the "no hugepages support" case, but that does sound very annoying and fragile.
Linus
Quoted 11 lines · On Fri, 24 Oct 2014 12:47:48 -0700 Linus Torvalds…
Quoted 6 lines · David Miller
It's really idiotic to have a weak symbolled fallback that just returns zero, and causes this kind of bug. There should be no backup implementation and the link should fail if the architecture fails to provide
__get_user_pages_fast()and supports transparent hugepages.Agreed. I think the weak fallback is for the "no hugepages support" case, but that does sound very annoying and fragile.
Yup. I'm thinking the get_user_pages_fast() and __get_user_pages_fast() in mm/util.c should be made non-weak and moved to mm/nommu.c.
With that change, MMU architctures will need to either define CONFIG_HAVE_GENERIC_RCU_GUP or implement their own versions.
Perhaps sparc should be defining CONFIG_HAVE_GENERIC_RCU_GUP.
We really should switch x86 to the generic version - from a quick read it looks like it will work without needing any changes.
Steve, thoughts?
From: Andrew Morton <[email protected]>
Date: Mon, 27 Oct 2014 14:09:38 -0700
Quoted 6 lines
Perhaps sparc should be defining
CONFIG_HAVE_GENERIC_RCU_GUP.We really should switch x86 to the generic version - from a quick read it looks like it will work without needing any changes.
Steve, thoughts?
We need to add the necessary hooks to the generic code so that x86 doesn't so specualtive gets and instead do direct increments, otherwise it's a performance regression, and then sparc can make use of that as well.
Quoted 8 lines · David Miller
From: Andrew Morton <[email protected]>
Date: Mon, 27 Oct 2014 14:09:38 -0700Quoted 5 lines
Perhaps sparc should be defining
CONFIG_HAVE_GENERIC_RCU_GUP.We really should switch x86 to the generic version - from a quick read it looks like it will work without needing any changes.
Quoted 6 lines
Quoted 1 line
Steve, thoughts?
We need to add the necessary hooks to the generic code so that x86 doesn't so specualtive gets and instead do direct increments, otherwise it's a performance regression, and then sparc can make use of that as well.
Agreed, I think x86 may require a helper to read 64-bit ptes (as it can't do that atomically). Also I think there's some subtlety in the way access_ok works that should be checked.
The overall structure of the code looks the same to me, and I think it would be beneficial to extend then use the generic version for x86.
Cheers,
Signature · 1 line
Steve