Merge branch 'modules-next' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 14 Oct 2012 20:39:34 +0000 (13:39 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 14 Oct 2012 20:39:34 +0000 (13:39 -0700)
Pull module signing support from Rusty Russell:
 "module signing is the highlight, but it's an all-over David Howells frenzy..."

Hmm "Magrathea: Glacier signing key". Somebody has been reading too much HHGTTG.

* 'modules-next' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: (37 commits)
  X.509: Fix indefinite length element skip error handling
  X.509: Convert some printk calls to pr_devel
  asymmetric keys: fix printk format warning
  MODSIGN: Fix 32-bit overflow in X.509 certificate validity date checking
  MODSIGN: Make mrproper should remove generated files.
  MODSIGN: Use utf8 strings in signer's name in autogenerated X.509 certs
  MODSIGN: Use the same digest for the autogen key sig as for the module sig
  MODSIGN: Sign modules during the build process
  MODSIGN: Provide a script for generating a key ID from an X.509 cert
  MODSIGN: Implement module signature checking
  MODSIGN: Provide module signing public keys to the kernel
  MODSIGN: Automatically generate module signing keys if missing
  MODSIGN: Provide Kconfig options
  MODSIGN: Provide gitignore and make clean rules for extra files
  MODSIGN: Add FIPS policy
  module: signature checking hook
  X.509: Add a crypto key parser for binary (DER) X.509 certificates
  MPILIB: Provide a function to read raw data into an MPI
  X.509: Add an ASN.1 decoder
  X.509: Add simple ASN.1 grammar compiler
  ...

43 files changed:
1  2 
Documentation/kernel-parameters.txt
Makefile
arch/Kconfig
arch/alpha/Kconfig
arch/arm/Kconfig
arch/blackfin/Kconfig
arch/c6x/Kconfig
arch/cris/Kconfig
arch/cris/include/asm/Kbuild
arch/h8300/Kconfig
arch/h8300/include/asm/Kbuild
arch/ia64/Kconfig
arch/m32r/Kconfig
arch/m32r/include/asm/Kbuild
arch/m68k/Kconfig
arch/microblaze/Kconfig
arch/mips/Kconfig
arch/mips/kernel/Makefile
arch/mn10300/Kconfig
arch/parisc/Kconfig
arch/powerpc/Kconfig
arch/s390/Kconfig
arch/score/Kconfig
arch/sh/Kconfig
arch/sparc/Kconfig
arch/sparc/include/asm/Kbuild
arch/tile/Kconfig
arch/unicore32/Kconfig
arch/x86/Kconfig
arch/x86/um/Kconfig
crypto/Kconfig
crypto/Makefile
fs/cifs/cifsacl.c
init/Kconfig
kernel/Makefile
lib/Makefile
net/dns_resolver/dns_key.c
net/rxrpc/ar-key.c
scripts/Makefile.modpost
security/keys/key.c
security/keys/keyctl.c
security/keys/keyring.c
security/keys/trusted.c

@@@ -1051,14 -1051,6 +1051,14 @@@ bytes respectively. Such letter suffixe
        ihash_entries=  [KNL]
                        Set number of hash buckets for inode cache.
  
 +      ima_appraise=   [IMA] appraise integrity measurements
 +                      Format: { "off" | "enforce" | "fix" }
 +                      default: "enforce"
 +
 +      ima_appraise_tcb [IMA]
 +                      The builtin appraise policy appraises all files
 +                      owned by uid=0.
 +
        ima_audit=      [IMA]
                        Format: { "0" | "1" }
                        0 -- integrity auditing messages. (Default)
                        * nohrst, nosrst, norst: suppress hard, soft
                            and both resets.
  
 +                      * rstonce: only attempt one reset during
 +                        hot-unplug link recovery
 +
                        * dump_id: dump IDENTIFY data.
  
                        If there are multiple matching configurations changing
                        log everything. Information is printed at KERN_DEBUG
                        so loglevel=8 may also need to be specified.
  
+       module.sig_enforce
+                       [KNL] When CONFIG_MODULE_SIG is set, this means that
+                       modules without (valid) signatures will fail to load.
+                       Note that if CONFIG_MODULE_SIG_ENFORCE is set, that
+                       is always true, so this option does nothing.
        mousedev.tap_time=
                        [MOUSE] Maximum time between finger touching and
                        leaving touchpad surface for touch to be considered
                        will be autodetected by the client, and it will fall
                        back to using the idmapper.
                        To turn off this behaviour, set the value to '0'.
 +      nfs.nfs4_unique_id=
 +                      [NFS4] Specify an additional fixed unique ident-
 +                      ification string that NFSv4 clients can insert into
 +                      their nfs_client_id4 string.  This is typically a
 +                      UUID that is generated at system install time.
  
        nfs.send_implementation_id =
                        [NFSv4.1] Send client implementation identification
                        noexec=on: enable non-executable mappings (default)
                        noexec=off: disable non-executable mappings
  
 +      nosmap          [X86]
 +                      Disable SMAP (Supervisor Mode Access Prevention)
 +                      even if it is supported by processor.
 +
        nosmep          [X86]
 -                      Disable SMEP (Supervisor Mode Execution Protection)
 +                      Disable SMEP (Supervisor Mode Execution Prevention)
                        even if it is supported by processor.
  
        noexec32        [X86-64]
                        and restore using xsave. The kernel will fallback to
                        enabling legacy floating-point and sse state.
  
 +      eagerfpu=       [X86]
 +                      on      enable eager fpu restore
 +                      off     disable eager fpu restore
 +                      auto    selects the default scheme, which automatically
 +                              enables eagerfpu restore for xsaveopt.
 +
        nohlt           [BUGS=ARM,SH] Tells the kernel that the sleep(SH) or
                        wfi(ARM) instruction doesn't work correctly and not to
                        use it. This is also useful when using JTAG debugger.
        rcutree.rcu_cpu_stall_timeout= [KNL,BOOT]
                        Set timeout for RCU CPU stall warning messages.
  
 +      rcutree.jiffies_till_first_fqs= [KNL,BOOT]
 +                      Set delay from grace-period initialization to
 +                      first attempt to force quiescent states.
 +                      Units are jiffies, minimum value is zero,
 +                      and maximum value is HZ.
 +
 +      rcutree.jiffies_till_next_fqs= [KNL,BOOT]
 +                      Set delay between subsequent attempts to force
 +                      quiescent states.  Units are jiffies, minimum
 +                      value is one, and maximum value is HZ.
 +
        rcutorture.fqs_duration= [KNL,BOOT]
                        Set duration of force_quiescent_state bursts.
  
        smart2=         [HW]
                        Format: <io1>[,<io2>[,...,<io8>]]
  
 -      smp-alt-once    [X86-32,SMP] On a hotplug CPU system, only
 -                      attempt to substitute SMP alternatives once at boot.
 -
        smsc-ircc2.nopnp        [HW] Don't use PNP to discover SMC devices
        smsc-ircc2.ircc_cfg=    [HW] Device configuration I/O port
        smsc-ircc2.ircc_sir=    [HW] SIR base I/O port
diff --combined Makefile
+++ b/Makefile
@@@ -1,8 -1,8 +1,8 @@@
  VERSION = 3
  PATCHLEVEL = 6
  SUBLEVEL = 0
 -EXTRAVERSION = -rc6
 -NAME = Saber-toothed Squirrel
 +EXTRAVERSION =
 +NAME = Terrified Chipmunk
  
  # *DOCUMENTATION*
  # To see a list of typical targets execute "make help"
@@@ -350,22 -350,12 +350,22 @@@ AFLAGS_KERNEL   
  CFLAGS_GCOV   = -fprofile-arcs -ftest-coverage
  
  
 +# Use USERINCLUDE when you must reference the UAPI directories only.
 +USERINCLUDE    := \
 +              -I$(srctree)/arch/$(hdr-arch)/include/uapi \
 +              -Iarch/$(hdr-arch)/include/generated/uapi \
 +              -I$(srctree)/include/uapi \
 +              -Iinclude/generated/uapi \
 +                -include $(srctree)/include/linux/kconfig.h
 +
  # Use LINUXINCLUDE when you must reference the include/ directory.
  # Needed to be compatible with the O= option
 -LINUXINCLUDE    := -I$(srctree)/arch/$(hdr-arch)/include \
 -                   -Iarch/$(hdr-arch)/include/generated -Iinclude \
 -                   $(if $(KBUILD_SRC), -I$(srctree)/include) \
 -                   -include $(srctree)/include/linux/kconfig.h
 +LINUXINCLUDE    := \
 +              -I$(srctree)/arch/$(hdr-arch)/include \
 +              -Iarch/$(hdr-arch)/include/generated \
 +              $(if $(KBUILD_SRC), -I$(srctree)/include) \
 +              -Iinclude \
 +              $(USERINCLUDE)
  
  KBUILD_CPPFLAGS := -D__KERNEL__
  
@@@ -447,11 -437,9 +447,11 @@@ asm-generic
  # Detect when mixed targets is specified, and make a second invocation
  # of make so .config is not included in this case either (for *config).
  
 +version_h := include/generated/uapi/linux/version.h
 +
  no-dot-config-targets := clean mrproper distclean \
                         cscope gtags TAGS tags help %docs check% coccicheck \
 -                       include/linux/version.h headers_% archheaders archscripts \
 +                       $(version_h) headers_% archheaders archscripts \
                         kernelversion %src-pkg
  
  config-targets := 0
@@@ -621,11 -609,7 +621,11 @@@ KBUILD_CFLAGS    += $(call cc-option, -fe
  endif
  
  ifdef CONFIG_FUNCTION_TRACER
 -KBUILD_CFLAGS += -pg
 +ifdef CONFIG_HAVE_FENTRY
 +CC_USING_FENTRY       := $(call cc-option, -mfentry -DCC_USING_FENTRY)
 +endif
 +KBUILD_CFLAGS += -pg $(CC_USING_FENTRY)
 +KBUILD_AFLAGS += $(CC_USING_FENTRY)
  ifdef CONFIG_DYNAMIC_FTRACE
        ifdef CONFIG_HAVE_C_RECORDMCOUNT
                BUILD_C_RECORDMCOUNT := y
@@@ -664,9 -648,22 +664,9 @@@ ifeq ($(shell $(CONFIG_SHELL) $(srctree
  endif
  
  # Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments
 -# But warn user when we do so
 -warn-assign = \
 -$(warning "WARNING: Appending $$K$(1) ($(K$(1))) from $(origin K$(1)) to kernel $$$(1)")
 -
 -ifneq ($(KCPPFLAGS),)
 -        $(call warn-assign,CPPFLAGS)
 -        KBUILD_CPPFLAGS += $(KCPPFLAGS)
 -endif
 -ifneq ($(KAFLAGS),)
 -        $(call warn-assign,AFLAGS)
 -        KBUILD_AFLAGS += $(KAFLAGS)
 -endif
 -ifneq ($(KCFLAGS),)
 -        $(call warn-assign,CFLAGS)
 -        KBUILD_CFLAGS += $(KCFLAGS)
 -endif
 +KBUILD_CPPFLAGS += $(KCPPFLAGS)
 +KBUILD_AFLAGS += $(KAFLAGS)
 +KBUILD_CFLAGS += $(KCFLAGS)
  
  # Use --build-id when available.
  LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\
@@@ -808,7 -805,7 +808,7 @@@ endi
  # prepare2 creates a makefile if using a separate output directory
  prepare2: prepare3 outputmakefile asm-generic
  
 -prepare1: prepare2 include/linux/version.h include/generated/utsrelease.h \
 +prepare1: prepare2 $(version_h) include/generated/utsrelease.h \
                     include/config/auto.conf
        $(cmd_crmodverdir)
  
@@@ -841,7 -838,7 +841,7 @@@ define filechk_version.
        echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
  endef
  
 -include/linux/version.h: $(srctree)/Makefile FORCE
 +$(version_h): $(srctree)/Makefile FORCE
        $(call filechk,version.h)
  
  include/generated/utsrelease.h: include/config/kernel.release FORCE
@@@ -886,7 -883,7 +886,7 @@@ PHONY += archscript
  archscripts:
  
  PHONY += __headers
 -__headers: include/linux/version.h scripts_basic asm-generic archheaders archscripts FORCE
 +__headers: $(version_h) scripts_basic asm-generic archheaders archscripts FORCE
        $(Q)$(MAKE) $(build)=scripts build_unifdef
  
  PHONY += headers_install_all
@@@ -895,10 -892,10 +895,10 @@@ headers_install_all
  
  PHONY += headers_install
  headers_install: __headers
 -      $(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/asm/Kbuild),, \
 -      $(error Headers not exportable for the $(SRCARCH) architecture))
 -      $(Q)$(MAKE) $(hdr-inst)=include
 -      $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/asm $(hdr-dst)
 +      $(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/uapi/asm/Kbuild),, \
 +        $(error Headers not exportable for the $(SRCARCH) architecture))
 +      $(Q)$(MAKE) $(hdr-inst)=include/uapi
 +      $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst)
  
  PHONY += headers_check_all
  headers_check_all: headers_install_all
  
  PHONY += headers_check
  headers_check: headers_install
 -      $(Q)$(MAKE) $(hdr-inst)=include HDRCHECK=1
 -      $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/asm $(hdr-dst) HDRCHECK=1
 +      $(Q)$(MAKE) $(hdr-inst)=include/uapi HDRCHECK=1
 +      $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst) HDRCHECK=1
  
  # ---------------------------------------------------------------------------
  # Modules
@@@ -996,8 -993,12 +996,11 @@@ CLEAN_DIRS  += $(MODVERDIR
  # Directories & files removed with 'make mrproper'
  MRPROPER_DIRS  += include/config usr/include include/generated          \
                    arch/*/include/generated
 -MRPROPER_FILES += .config .config.old .version .old_version             \
 -                  include/linux/version.h                               \
 +MRPROPER_FILES += .config .config.old .version .old_version $(version_h) \
-                 Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS
+                 Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \
+                 signing_key.priv signing_key.x509 x509.genkey         \
+                 extra_certificates signing_key.x509.keyid             \
+                 signing_key.x509.signer
  
  # clean - Delete most, but leave enough to build external modules
  #
@@@ -1241,6 -1242,7 +1244,7 @@@ clean: $(clean-dirs
        $(call cmd,rmfiles)
        @find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \
                \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
+               -o -name '*.ko.*' \
                -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
                -o -name '*.symtypes' -o -name 'modules.order' \
                -o -name modules.builtin -o -name '.tmp_*.o.*' \
diff --combined arch/Kconfig
@@@ -222,19 -222,6 +222,19 @@@ config HAVE_PERF_EVENTS_NM
          subsystem.  Also has support for calculating CPU cycle events
          to determine how many clock cycles in a given period.
  
 +config HAVE_PERF_REGS
 +      bool
 +      help
 +        Support selective register dumps for perf events. This includes
 +        bit-mapping of each registers and a unique architecture id.
 +
 +config HAVE_PERF_USER_STACK_DUMP
 +      bool
 +      help
 +        Support user stack dumps for perf event samples. This needs
 +        access to the user stack pointer which is not unified across
 +        architectures.
 +
  config HAVE_ARCH_JUMP_LABEL
        bool
  
@@@ -271,12 -258,6 +271,12 @@@ config ARCH_WANT_OLD_COMPAT_IP
        select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
        bool
  
 +config GENERIC_KERNEL_THREAD
 +      bool
 +
 +config GENERIC_KERNEL_EXECVE
 +      bool
 +
  config HAVE_ARCH_SECCOMP_FILTER
        bool
        help
@@@ -300,26 -281,23 +300,45 @@@ config SECCOMP_FILTE
  
          See Documentation/prctl/seccomp_filter.txt for details.
  
 +config HAVE_RCU_USER_QS
 +      bool
 +      help
 +        Provide kernel entry/exit hooks necessary for userspace
 +        RCU extended quiescent state. Syscalls need to be wrapped inside
 +        rcu_user_exit()-rcu_user_enter() through the slow path using
 +        TIF_NOHZ flag. Exceptions handlers must be wrapped as well. Irqs
 +        are already protected inside rcu_irq_enter/rcu_irq_exit() but
 +        preemption or signal handling on irq exit still need to be protected.
 +
 +config HAVE_VIRT_CPU_ACCOUNTING
 +      bool
 +
 +config HAVE_IRQ_TIME_ACCOUNTING
 +      bool
 +      help
 +        Archs need to ensure they use a high enough resolution clock to
 +        support irq time accounting and then call enable_sched_clock_irqtime().
 +
 +config HAVE_ARCH_TRANSPARENT_HUGEPAGE
 +      bool
 +
+ config HAVE_MOD_ARCH_SPECIFIC
+       bool
+       help
+         The arch uses struct mod_arch_specific to store data.  Many arches
+         just need a simple module loader without arch specific data - those
+         should not enable this.
+ config MODULES_USE_ELF_RELA
+       bool
+       help
+         Modules only use ELF RELA relocations.  Modules with ELF REL
+         relocations will give an error.
+ config MODULES_USE_ELF_REL
+       bool
+       help
+         Modules only use ELF REL relocations.  Modules with ELF RELA
+         relocations will give an error.
  source "kernel/gcov/Kconfig"
diff --combined arch/alpha/Kconfig
@@@ -20,8 -20,8 +20,10 @@@ config ALPH
        select GENERIC_CMOS_UPDATE
        select GENERIC_STRNCPY_FROM_USER
        select GENERIC_STRNLEN_USER
 +      select GENERIC_KERNEL_THREAD
 +      select GENERIC_KERNEL_EXECVE
+       select HAVE_MOD_ARCH_SPECIFIC
+       select MODULES_USE_ELF_RELA
        help
          The Alpha is a 64-bit general-purpose processor designed and
          marketed by the Digital Equipment Corporation of blessed memory,
diff --combined arch/arm/Kconfig
@@@ -1,58 -1,56 +1,60 @@@
  config ARM
        bool
        default y
 +      select ARCH_BINFMT_ELF_RANDOMIZE_PIE
 +      select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
        select ARCH_HAVE_CUSTOM_GPIO_H
 -      select HAVE_AOUT
 -      select HAVE_DMA_API_DEBUG
 -      select HAVE_IDE if PCI || ISA || PCMCIA
 -      select HAVE_DMA_ATTRS
 -      select HAVE_DMA_CONTIGUOUS if MMU
 -      select HAVE_MEMBLOCK
 -      select RTC_LIB
 -      select SYS_SUPPORTS_APM_EMULATION
 +      select ARCH_WANT_IPC_PARSE_VERSION
 +      select CPU_PM if (SUSPEND || CPU_IDLE)
 +      select DCACHE_WORD_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && !CPU_BIG_ENDIAN
        select GENERIC_ATOMIC64 if (CPU_V6 || !CPU_32v6K || !AEABI)
 -      select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
 -      select HAVE_OPROFILE if (HAVE_PERF_EVENTS)
 +      select GENERIC_CLOCKEVENTS_BROADCAST if SMP
 +      select GENERIC_IRQ_PROBE
 +      select GENERIC_IRQ_SHOW
 +      select GENERIC_KERNEL_THREAD
 +      select GENERIC_KERNEL_EXECVE
 +      select GENERIC_PCI_IOMAP
 +      select GENERIC_SMP_IDLE_THREAD
 +      select GENERIC_STRNCPY_FROM_USER
 +      select GENERIC_STRNLEN_USER
 +      select HARDIRQS_SW_RESEND
 +      select HAVE_AOUT
        select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
        select HAVE_ARCH_KGDB
        select HAVE_ARCH_TRACEHOOK
 -      select HAVE_KPROBES if !XIP_KERNEL
 -      select HAVE_KRETPROBES if (HAVE_KPROBES)
 -      select HAVE_FUNCTION_TRACER if (!XIP_KERNEL)
 -      select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL)
 +      select HAVE_BPF_JIT
 +      select HAVE_C_RECORDMCOUNT
 +      select HAVE_DEBUG_KMEMLEAK
 +      select HAVE_DMA_API_DEBUG
 +      select HAVE_DMA_ATTRS
 +      select HAVE_DMA_CONTIGUOUS if MMU
        select HAVE_DYNAMIC_FTRACE if (!XIP_KERNEL)
 +      select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL)
        select HAVE_FUNCTION_GRAPH_TRACER if (!THUMB2_KERNEL)
 -      select ARCH_BINFMT_ELF_RANDOMIZE_PIE
 +      select HAVE_FUNCTION_TRACER if (!XIP_KERNEL)
        select HAVE_GENERIC_DMA_COHERENT
 +      select HAVE_GENERIC_HARDIRQS
 +      select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7))
 +      select HAVE_IDE if PCI || ISA || PCMCIA
 +      select HAVE_IRQ_WORK
        select HAVE_KERNEL_GZIP
 -      select HAVE_KERNEL_LZO
        select HAVE_KERNEL_LZMA
 +      select HAVE_KERNEL_LZO
        select HAVE_KERNEL_XZ
 -      select HAVE_IRQ_WORK
 +      select HAVE_KPROBES if !XIP_KERNEL
 +      select HAVE_KRETPROBES if (HAVE_KPROBES)
 +      select HAVE_MEMBLOCK
 +      select HAVE_OPROFILE if (HAVE_PERF_EVENTS)
        select HAVE_PERF_EVENTS
 -      select PERF_USE_VMALLOC
        select HAVE_REGS_AND_STACK_ACCESS_API
 -      select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7))
 -      select HAVE_C_RECORDMCOUNT
 -      select HAVE_GENERIC_HARDIRQS
 -      select HARDIRQS_SW_RESEND
 -      select GENERIC_IRQ_PROBE
 -      select GENERIC_IRQ_SHOW
 -      select ARCH_WANT_IPC_PARSE_VERSION
 -      select HARDIRQS_SW_RESEND
 -      select CPU_PM if (SUSPEND || CPU_IDLE)
 -      select GENERIC_PCI_IOMAP
 -      select HAVE_BPF_JIT
 -      select GENERIC_SMP_IDLE_THREAD
 +      select HAVE_SYSCALL_TRACEPOINTS
 +      select HAVE_UID16
        select KTIME_SCALAR
 -      select GENERIC_CLOCKEVENTS_BROADCAST if SMP
 -      select GENERIC_STRNCPY_FROM_USER
 -      select GENERIC_STRNLEN_USER
 -      select DCACHE_WORD_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && !CPU_BIG_ENDIAN
 +      select PERF_USE_VMALLOC
 +      select RTC_LIB
 +      select SYS_SUPPORTS_APM_EMULATION
+       select HAVE_MOD_ARCH_SPECIFIC if ARM_UNWIND
+       select MODULES_USE_ELF_REL
        help
          The ARM series is a line of low-power-consumption RISC chip designs
          licensed by ARM Ltd and targeted at embedded applications and
@@@ -68,9 -66,9 +70,9 @@@ config NEED_SG_DMA_LENGT
        bool
  
  config ARM_DMA_USE_IOMMU
 -      select NEED_SG_DMA_LENGTH
 -      select ARM_HAS_SG_CHAIN
        bool
 +      select ARM_HAS_SG_CHAIN
 +      select NEED_SG_DMA_LENGTH
  
  config HAVE_PWM
        bool
@@@ -206,13 -204,6 +208,13 @@@ config ARM_PATCH_PHYS_VIR
          this feature (eg, building a kernel for a single machine) and
          you need to shrink the kernel to the minimal size.
  
 +config NEED_MACH_GPIO_H
 +      bool
 +      help
 +        Select this when mach/gpio.h is required to provide special
 +        definitions for this platform. The need for mach/gpio.h should
 +        be avoided when possible.
 +
  config NEED_MACH_IO_H
        bool
        help
@@@ -258,148 -249,190 +260,148 @@@ config MM
  #
  choice
        prompt "ARM system type"
 -      default ARCH_VERSATILE
 +      default ARCH_MULTIPLATFORM
  
 -config ARCH_SOCFPGA
 -      bool "Altera SOCFPGA family"
 -      select ARCH_WANT_OPTIONAL_GPIOLIB
 -      select ARM_AMBA
 -      select ARM_GIC
 -      select CACHE_L2X0
 -      select CLKDEV_LOOKUP
 +config ARCH_MULTIPLATFORM
 +      bool "Allow multiple platforms to be selected"
 +      depends on MMU
 +      select ARM_PATCH_PHYS_VIRT
 +      select AUTO_ZRELADDR
        select COMMON_CLK
 -      select CPU_V7
 -      select DW_APB_TIMER
 -      select DW_APB_TIMER_OF
 -      select GENERIC_CLOCKEVENTS
 -      select GPIO_PL061 if GPIOLIB
 -      select HAVE_ARM_SCU
 +      select MULTI_IRQ_HANDLER
        select SPARSE_IRQ
        select USE_OF
 -      help
 -        This enables support for Altera SOCFPGA Cyclone V platform
  
  config ARCH_INTEGRATOR
        bool "ARM Ltd. Integrator family"
 -      select ARM_AMBA
        select ARCH_HAS_CPUFREQ
 +      select ARM_AMBA
        select COMMON_CLK
 -      select CLK_VERSATILE
 +      select COMMON_CLK_VERSATILE
 +      select GENERIC_CLOCKEVENTS
        select HAVE_TCM
        select ICST
 -      select GENERIC_CLOCKEVENTS
 +      select MULTI_IRQ_HANDLER
 +      select NEED_MACH_MEMORY_H
        select PLAT_VERSATILE
        select PLAT_VERSATILE_FPGA_IRQ
 -      select NEED_MACH_IO_H
 -      select NEED_MACH_MEMORY_H
        select SPARSE_IRQ
 -      select MULTI_IRQ_HANDLER
        help
          Support for ARM's Integrator platform.
  
  config ARCH_REALVIEW
        bool "ARM Ltd. RealView family"
 -      select ARM_AMBA
 -      select CLKDEV_LOOKUP
 -      select HAVE_MACH_CLKDEV
 -      select ICST
 -      select GENERIC_CLOCKEVENTS
        select ARCH_WANT_OPTIONAL_GPIOLIB
 -      select PLAT_VERSATILE
 -      select PLAT_VERSATILE_CLOCK
 -      select PLAT_VERSATILE_CLCD
 +      select ARM_AMBA
        select ARM_TIMER_SP804
 +      select COMMON_CLK
 +      select COMMON_CLK_VERSATILE
 +      select GENERIC_CLOCKEVENTS
        select GPIO_PL061 if GPIOLIB
 +      select ICST
        select NEED_MACH_MEMORY_H
 +      select PLAT_VERSATILE
 +      select PLAT_VERSATILE_CLCD
        help
          This enables support for ARM Ltd RealView boards.
  
  config ARCH_VERSATILE
        bool "ARM Ltd. Versatile family"
 +      select ARCH_WANT_OPTIONAL_GPIOLIB
        select ARM_AMBA
 +      select ARM_TIMER_SP804
        select ARM_VIC
        select CLKDEV_LOOKUP
 +      select GENERIC_CLOCKEVENTS
        select HAVE_MACH_CLKDEV
        select ICST
 -      select GENERIC_CLOCKEVENTS
 -      select ARCH_WANT_OPTIONAL_GPIOLIB
 -      select NEED_MACH_IO_H if PCI
        select PLAT_VERSATILE
 -      select PLAT_VERSATILE_CLOCK
        select PLAT_VERSATILE_CLCD
 +      select PLAT_VERSATILE_CLOCK
        select PLAT_VERSATILE_FPGA_IRQ
 -      select ARM_TIMER_SP804
        help
          This enables support for ARM Ltd Versatile board.
  
 -config ARCH_VEXPRESS
 -      bool "ARM Ltd. Versatile Express family"
 -      select ARCH_WANT_OPTIONAL_GPIOLIB
 -      select ARM_AMBA
 -      select ARM_TIMER_SP804
 -      select CLKDEV_LOOKUP
 -      select COMMON_CLK
 -      select GENERIC_CLOCKEVENTS
 -      select HAVE_CLK
 -      select HAVE_PATA_PLATFORM
 -      select ICST
 -      select NO_IOPORT
 -      select PLAT_VERSATILE
 -      select PLAT_VERSATILE_CLCD
 -      select REGULATOR_FIXED_VOLTAGE if REGULATOR
 -      help
 -        This enables support for the ARM Ltd Versatile Express boards.
 -
  config ARCH_AT91
        bool "Atmel AT91"
        select ARCH_REQUIRE_GPIOLIB
 -      select HAVE_CLK
        select CLKDEV_LOOKUP
 +      select HAVE_CLK
        select IRQ_DOMAIN
 +      select NEED_MACH_GPIO_H
        select NEED_MACH_IO_H if PCCARD
        help
          This enables support for systems based on Atmel
          AT91RM9200 and AT91SAM9* processors.
  
 -config ARCH_BCMRING
 -      bool "Broadcom BCMRING"
 -      depends on MMU
 -      select CPU_V6
 -      select ARM_AMBA
 -      select ARM_TIMER_SP804
 -      select CLKDEV_LOOKUP
 -      select GENERIC_CLOCKEVENTS
 -      select ARCH_WANT_OPTIONAL_GPIOLIB
 -      help
 -        Support for Broadcom's BCMRing platform.
 -
 -config ARCH_HIGHBANK
 -      bool "Calxeda Highbank-based"
 +config ARCH_BCM2835
 +      bool "Broadcom BCM2835 family"
        select ARCH_WANT_OPTIONAL_GPIOLIB
        select ARM_AMBA
 -      select ARM_GIC
 +      select ARM_ERRATA_411920
        select ARM_TIMER_SP804
 -      select CACHE_L2X0
        select CLKDEV_LOOKUP
        select COMMON_CLK
 -      select CPU_V7
 +      select CPU_V6
        select GENERIC_CLOCKEVENTS
 -      select HAVE_ARM_SCU
 -      select HAVE_SMP
 +      select MULTI_IRQ_HANDLER
        select SPARSE_IRQ
        select USE_OF
        help
 -        Support for the Calxeda Highbank SoC based boards.
 -
 -config ARCH_CLPS711X
 -      bool "Cirrus Logic CLPS711x/EP721x/EP731x-based"
 -      select CPU_ARM720T
 -      select ARCH_USES_GETTIMEOFFSET
 -      select NEED_MACH_MEMORY_H
 -      help
 -        Support for Cirrus Logic 711x/721x/731x based boards.
 +        This enables support for the Broadcom BCM2835 SoC. This SoC is
 +        use in the Raspberry Pi, and Roku 2 devices.
  
  config ARCH_CNS3XXX
        bool "Cavium Networks CNS3XXX family"
 +      select ARM_GIC
        select CPU_V6K
        select GENERIC_CLOCKEVENTS
 -      select ARM_GIC
        select MIGHT_HAVE_CACHE_L2X0
        select MIGHT_HAVE_PCI
        select PCI_DOMAINS if PCI
        help
          Support for Cavium Networks CNS3XXX platform.
  
 +config ARCH_CLPS711X
 +      bool "Cirrus Logic CLPS711x/EP721x/EP731x-based"
 +      select ARCH_USES_GETTIMEOFFSET
 +      select CLKDEV_LOOKUP
 +      select COMMON_CLK
 +      select CPU_ARM720T
 +      select NEED_MACH_MEMORY_H
 +      help
 +        Support for Cirrus Logic 711x/721x/731x based boards.
 +
  config ARCH_GEMINI
        bool "Cortina Systems Gemini"
 -      select CPU_FA526
        select ARCH_REQUIRE_GPIOLIB
        select ARCH_USES_GETTIMEOFFSET
 +      select CPU_FA526
        help
          Support for the Cortina Systems Gemini family SoCs
  
 -config ARCH_PRIMA2
 -      bool "CSR SiRFSoC PRIMA2 ARM Cortex A9 Platform"
 -      select CPU_V7
 -      select NO_IOPORT
 +config ARCH_SIRF
 +      bool "CSR SiRF"
        select ARCH_REQUIRE_GPIOLIB
 +      select COMMON_CLK
        select GENERIC_CLOCKEVENTS
 -      select CLKDEV_LOOKUP
        select GENERIC_IRQ_CHIP
        select MIGHT_HAVE_CACHE_L2X0
 +      select NO_IOPORT
        select PINCTRL
        select PINCTRL_SIRF
        select USE_OF
 -      select ZONE_DMA
        help
 -          Support for CSR SiRFSoC ARM Cortex A9 Platform
 +        Support for CSR SiRFprimaII/Marco/Polo platforms
  
  config ARCH_EBSA110
        bool "EBSA-110"
 +      select ARCH_USES_GETTIMEOFFSET
        select CPU_SA110
        select ISA
 -      select NO_IOPORT
 -      select ARCH_USES_GETTIMEOFFSET
        select NEED_MACH_IO_H
        select NEED_MACH_MEMORY_H
 +      select NO_IOPORT
        help
          This is an evaluation board for the StrongARM processor available
          from Digital. It has limited hardware on-board, including an
  
  config ARCH_EP93XX
        bool "EP93xx-based"
 -      select CPU_ARM920T
 +      select ARCH_HAS_HOLES_MEMORYMODEL
 +      select ARCH_REQUIRE_GPIOLIB
 +      select ARCH_USES_GETTIMEOFFSET
        select ARM_AMBA
        select ARM_VIC
        select CLKDEV_LOOKUP
 -      select ARCH_REQUIRE_GPIOLIB
 -      select ARCH_HAS_HOLES_MEMORYMODEL
 -      select ARCH_USES_GETTIMEOFFSET
 +      select CPU_ARM920T
        select NEED_MACH_MEMORY_H
        help
          This enables support for the Cirrus EP93xx series of CPUs.
@@@ -425,7 -458,7 +427,7 @@@ config ARCH_FOOTBRIDG
        select FOOTBRIDGE
        select GENERIC_CLOCKEVENTS
        select HAVE_IDE
 -      select NEED_MACH_IO_H
 +      select NEED_MACH_IO_H if !MMU
        select NEED_MACH_MEMORY_H
        help
          Support for systems based on the DC21285 companion chip
  
  config ARCH_MXC
        bool "Freescale MXC/iMX-based"
 -      select GENERIC_CLOCKEVENTS
        select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
 +      select GENERIC_CLOCKEVENTS
        select GENERIC_IRQ_CHIP
        select MULTI_IRQ_HANDLER
        select SPARSE_IRQ
  
  config ARCH_MXS
        bool "Freescale MXS-based"
 -      select GENERIC_CLOCKEVENTS
        select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
        select COMMON_CLK
 +      select GENERIC_CLOCKEVENTS
        select HAVE_CLK_PREPARE
 +      select MULTI_IRQ_HANDLER
        select PINCTRL
 +      select SPARSE_IRQ
        select USE_OF
        help
          Support for Freescale MXS-based family of processors
  
  config ARCH_NETX
        bool "Hilscher NetX based"
 +      select ARM_VIC
        select CLKSRC_MMIO
        select CPU_ARM926T
 -      select ARM_VIC
        select GENERIC_CLOCKEVENTS
        help
          This enables support for systems based on the Hilscher NetX Soc
  
  config ARCH_H720X
        bool "Hynix HMS720x-based"
 +      select ARCH_USES_GETTIMEOFFSET
        select CPU_ARM720T
        select ISA_DMA_API
 -      select ARCH_USES_GETTIMEOFFSET
        help
          This enables support for systems based on the Hynix HMS720x
  
  config ARCH_IOP13XX
        bool "IOP13xx-based"
        depends on MMU
 -      select CPU_XSC3
 -      select PLAT_IOP
 -      select PCI
        select ARCH_SUPPORTS_MSI
 -      select VMSPLIT_1G
 -      select NEED_MACH_IO_H
 +      select CPU_XSC3
        select NEED_MACH_MEMORY_H
        select NEED_RET_TO_USER
 +      select PCI
 +      select PLAT_IOP
 +      select VMSPLIT_1G
        help
          Support for Intel's IOP13XX (XScale) family of processors.
  
  config ARCH_IOP32X
        bool "IOP32x-based"
        depends on MMU
 +      select ARCH_REQUIRE_GPIOLIB
        select CPU_XSCALE
 -      select NEED_MACH_IO_H
 +      select NEED_MACH_GPIO_H
        select NEED_RET_TO_USER
 -      select PLAT_IOP
        select PCI
 -      select ARCH_REQUIRE_GPIOLIB
 +      select PLAT_IOP
        help
          Support for Intel's 80219 and IOP32X (XScale) family of
          processors.
  config ARCH_IOP33X
        bool "IOP33x-based"
        depends on MMU
 +      select ARCH_REQUIRE_GPIOLIB
        select CPU_XSCALE
 -      select NEED_MACH_IO_H
 +      select NEED_MACH_GPIO_H
        select NEED_RET_TO_USER
 -      select PLAT_IOP
        select PCI
 -      select ARCH_REQUIRE_GPIOLIB
 +      select PLAT_IOP
        help
          Support for Intel's IOP33X (XScale) family of processors.
  
@@@ -518,45 -550,74 +520,45 @@@ config ARCH_IXP4X
        bool "IXP4xx-based"
        depends on MMU
        select ARCH_HAS_DMA_SET_COHERENT_MASK
 +      select ARCH_REQUIRE_GPIOLIB
        select CLKSRC_MMIO
        select CPU_XSCALE
 -      select ARCH_REQUIRE_GPIOLIB
 +      select DMABOUNCE if PCI
        select GENERIC_CLOCKEVENTS
        select MIGHT_HAVE_PCI
        select NEED_MACH_IO_H
 -      select DMABOUNCE if PCI
        help
          Support for Intel's IXP4XX (XScale) family of processors.
  
 -config ARCH_MVEBU
 -      bool "Marvell SOCs with Device Tree support"
 -      select GENERIC_CLOCKEVENTS
 -      select MULTI_IRQ_HANDLER
 -      select SPARSE_IRQ
 -      select CLKSRC_MMIO
 -      select GENERIC_IRQ_CHIP
 -      select IRQ_DOMAIN
 -      select COMMON_CLK
 -      help
 -        Support for the Marvell SoC Family with device tree support
 -
  config ARCH_DOVE
        bool "Marvell Dove"
 -      select CPU_V7
 -      select PCI
        select ARCH_REQUIRE_GPIOLIB
 +      select CPU_V7
        select GENERIC_CLOCKEVENTS
 -      select NEED_MACH_IO_H
 -      select PLAT_ORION
 +      select MIGHT_HAVE_PCI
 +      select PLAT_ORION_LEGACY
 +      select USB_ARCH_HAS_EHCI
        help
          Support for the Marvell Dove SoC 88AP510
  
  config ARCH_KIRKWOOD
        bool "Marvell Kirkwood"
 -      select CPU_FEROCEON
 -      select PCI
        select ARCH_REQUIRE_GPIOLIB
 +      select CPU_FEROCEON
        select GENERIC_CLOCKEVENTS
 -      select NEED_MACH_IO_H
 -      select PLAT_ORION
 +      select PCI
 +      select PLAT_ORION_LEGACY
        help
          Support for the following Marvell Kirkwood series SoCs:
          88F6180, 88F6192 and 88F6281.
  
 -config ARCH_LPC32XX
 -      bool "NXP LPC32XX"
 -      select CLKSRC_MMIO
 -      select CPU_ARM926T
 -      select ARCH_REQUIRE_GPIOLIB
 -      select HAVE_IDE
 -      select ARM_AMBA
 -      select USB_ARCH_HAS_OHCI
 -      select CLKDEV_LOOKUP
 -      select GENERIC_CLOCKEVENTS
 -      select USE_OF
 -      select HAVE_PWM
 -      help
 -        Support for the NXP LPC32XX family of processors
 -
  config ARCH_MV78XX0
        bool "Marvell MV78xx0"
 -      select CPU_FEROCEON
 -      select PCI
        select ARCH_REQUIRE_GPIOLIB
 +      select CPU_FEROCEON
        select GENERIC_CLOCKEVENTS
 -      select NEED_MACH_IO_H
 -      select PLAT_ORION
 +      select PCI
 +      select PLAT_ORION_LEGACY
        help
          Support for the following Marvell MV78xx0 series SoCs:
          MV781x0, MV782x0.
  config ARCH_ORION5X
        bool "Marvell Orion"
        depends on MMU
 -      select CPU_FEROCEON
 -      select PCI
        select ARCH_REQUIRE_GPIOLIB
 +      select CPU_FEROCEON
        select GENERIC_CLOCKEVENTS
 -      select NEED_MACH_IO_H
 -      select PLAT_ORION
 +      select PCI
 +      select PLAT_ORION_LEGACY
        help
          Support for the following Marvell Orion 5x series SoCs:
          Orion-1 (5181), Orion-VoIP (5181L), Orion-NAS (5182),
@@@ -579,22 -641,20 +581,22 @@@ config ARCH_MM
        depends on MMU
        select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
 +      select GENERIC_ALLOCATOR
        select GENERIC_CLOCKEVENTS
        select GPIO_PXA
        select IRQ_DOMAIN
 +      select NEED_MACH_GPIO_H
        select PLAT_PXA
        select SPARSE_IRQ
 -      select GENERIC_ALLOCATOR
        help
          Support for Marvell's PXA168/PXA910(MMP) and MMP2 processor line.
  
  config ARCH_KS8695
        bool "Micrel/Kendin KS8695"
 -      select CPU_ARM922T
        select ARCH_REQUIRE_GPIOLIB
 -      select ARCH_USES_GETTIMEOFFSET
 +      select CLKSRC_MMIO
 +      select CPU_ARM922T
 +      select GENERIC_CLOCKEVENTS
        select NEED_MACH_MEMORY_H
        help
          Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based
  
  config ARCH_W90X900
        bool "Nuvoton W90X900 CPU"
 -      select CPU_ARM926T
        select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
 +      select CPU_ARM926T
        select GENERIC_CLOCKEVENTS
        help
          Support for Nuvoton (Winbond logic dept.) ARM9 processor,
          <http://www.nuvoton.com/hq/enu/ProductAndSales/ProductLines/
                ConsumerElectronicsIC/ARMMicrocontroller/ARMMicrocontroller>
  
 +config ARCH_LPC32XX
 +      bool "NXP LPC32XX"
 +      select ARCH_REQUIRE_GPIOLIB
 +      select ARM_AMBA
 +      select CLKDEV_LOOKUP
 +      select CLKSRC_MMIO
 +      select CPU_ARM926T
 +      select GENERIC_CLOCKEVENTS
 +      select HAVE_IDE
 +      select HAVE_PWM
 +      select USB_ARCH_HAS_OHCI
 +      select USE_OF
 +      help
 +        Support for the NXP LPC32XX family of processors
 +
  config ARCH_TEGRA
        bool "NVIDIA Tegra"
 +      select ARCH_HAS_CPUFREQ
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
 +      select COMMON_CLK
        select GENERIC_CLOCKEVENTS
        select GENERIC_GPIO
        select HAVE_CLK
        select HAVE_SMP
        select MIGHT_HAVE_CACHE_L2X0
 -      select NEED_MACH_IO_H if PCI
 -      select ARCH_HAS_CPUFREQ
        select USE_OF
        help
          This enables support for NVIDIA Tegra based systems (Tegra APX,
 -        Tegra 6xx and Tegra 2 series).
 -
 -config ARCH_PICOXCELL
 -      bool "Picochip picoXcell"
 -      select ARCH_REQUIRE_GPIOLIB
 -      select ARM_PATCH_PHYS_VIRT
 -      select ARM_VIC
 -      select CPU_V6K
 -      select DW_APB_TIMER
 -      select DW_APB_TIMER_OF
 -      select GENERIC_CLOCKEVENTS
 -      select GENERIC_GPIO
 -      select HAVE_TCM
 -      select NO_IOPORT
 -      select SPARSE_IRQ
 -      select USE_OF
 -      help
 -        This enables support for systems based on the Picochip picoXcell
 -        family of Femtocell devices.  The picoxcell support requires device tree
 -        for all boards.
 -
 -config ARCH_PNX4008
 -      bool "Philips Nexperia PNX4008 Mobile"
 -      select CPU_ARM926T
 -      select CLKDEV_LOOKUP
 -      select ARCH_USES_GETTIMEOFFSET
 -      help
 -        This enables support for Philips PNX4008 mobile platform.
 +        Tegra 6xx and Tegra 2 series).
  
  config ARCH_PXA
        bool "PXA2xx/PXA3xx-based"
        depends on MMU
 -      select ARCH_MTD_XIP
        select ARCH_HAS_CPUFREQ
 +      select ARCH_MTD_XIP
 +      select ARCH_REQUIRE_GPIOLIB
 +      select ARM_CPU_SUSPEND if PM
 +      select AUTO_ZRELADDR
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
 -      select ARCH_REQUIRE_GPIOLIB
        select GENERIC_CLOCKEVENTS
        select GPIO_PXA
 +      select HAVE_IDE
 +      select MULTI_IRQ_HANDLER
 +      select NEED_MACH_GPIO_H
        select PLAT_PXA
        select SPARSE_IRQ
 -      select AUTO_ZRELADDR
 -      select MULTI_IRQ_HANDLER
 -      select ARM_CPU_SUSPEND if PM
 -      select HAVE_IDE
        help
          Support for Intel/Marvell's PXA2xx/PXA3xx processor line.
  
  config ARCH_MSM
        bool "Qualcomm MSM"
 -      select HAVE_CLK
 -      select GENERIC_CLOCKEVENTS
        select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
 +      select GENERIC_CLOCKEVENTS
 +      select HAVE_CLK
        help
          Support for Qualcomm MSM/QSD based systems.  This runs on the
          apps processor of the MSM/QSD and depends on a shared memory
  
  config ARCH_SHMOBILE
        bool "Renesas SH-Mobile / R-Mobile"
 -      select HAVE_CLK
        select CLKDEV_LOOKUP
 +      select GENERIC_CLOCKEVENTS
 +      select HAVE_CLK
        select HAVE_MACH_CLKDEV
        select HAVE_SMP
 -      select GENERIC_CLOCKEVENTS
        select MIGHT_HAVE_CACHE_L2X0
 -      select NO_IOPORT
 -      select SPARSE_IRQ
        select MULTI_IRQ_HANDLER
 -      select PM_GENERIC_DOMAINS if PM
        select NEED_MACH_MEMORY_H
 +      select NO_IOPORT
 +      select PM_GENERIC_DOMAINS if PM
 +      select SPARSE_IRQ
        help
          Support for Renesas's SH-Mobile and R-Mobile ARM platforms.
  
  config ARCH_RPC
        bool "RiscPC"
        select ARCH_ACORN
 -      select FIQ
        select ARCH_MAY_HAVE_PC_FDC
 -      select HAVE_PATA_PLATFORM
 -      select ISA_DMA_API
 -      select NO_IOPORT
        select ARCH_SPARSEMEM_ENABLE
        select ARCH_USES_GETTIMEOFFSET
 +      select FIQ
        select HAVE_IDE
 +      select HAVE_PATA_PLATFORM
 +      select ISA_DMA_API
        select NEED_MACH_IO_H
        select NEED_MACH_MEMORY_H
 +      select NO_IOPORT
        help
          On the Acorn Risc-PC, Linux can support the internal IDE disk and
          CD-ROM interface, serial and parallel port, and the floppy drive.
  
  config ARCH_SA1100
        bool "SA1100-based"
 -      select CLKSRC_MMIO
 -      select CPU_SA1100
 -      select ISA
 -      select ARCH_SPARSEMEM_ENABLE
 -      select ARCH_MTD_XIP
        select ARCH_HAS_CPUFREQ
 +      select ARCH_MTD_XIP
 +      select ARCH_REQUIRE_GPIOLIB
 +      select ARCH_SPARSEMEM_ENABLE
 +      select CLKDEV_LOOKUP
 +      select CLKSRC_MMIO
        select CPU_FREQ
 +      select CPU_SA1100
        select GENERIC_CLOCKEVENTS
 -      select CLKDEV_LOOKUP
 -      select ARCH_REQUIRE_GPIOLIB
        select HAVE_IDE
 +      select ISA
 +      select NEED_MACH_GPIO_H
        select NEED_MACH_MEMORY_H
        select SPARSE_IRQ
        help
  
  config ARCH_S3C24XX
        bool "Samsung S3C24XX SoCs"
 -      select GENERIC_GPIO
        select ARCH_HAS_CPUFREQ
 -      select HAVE_CLK
 -      select CLKDEV_LOOKUP
        select ARCH_USES_GETTIMEOFFSET
 +      select CLKDEV_LOOKUP
 +      select GENERIC_GPIO
 +      select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
 -      select HAVE_S3C_RTC if RTC_CLASS
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
 +      select HAVE_S3C_RTC if RTC_CLASS
 +      select NEED_MACH_GPIO_H
        select NEED_MACH_IO_H
        help
          Samsung S3C2410, S3C2412, S3C2413, S3C2416, S3C2440, S3C2442, S3C2443
  
  config ARCH_S3C64XX
        bool "Samsung S3C64XX"
 -      select PLAT_SAMSUNG
 -      select CPU_V6
 +      select ARCH_HAS_CPUFREQ
 +      select ARCH_REQUIRE_GPIOLIB
 +      select ARCH_USES_GETTIMEOFFSET
        select ARM_VIC
 +      select CLKDEV_LOOKUP
 +      select CPU_V6
        select HAVE_CLK
 +      select HAVE_S3C2410_I2C if I2C
 +      select HAVE_S3C2410_WATCHDOG if WATCHDOG
        select HAVE_TCM
 -      select CLKDEV_LOOKUP
 +      select NEED_MACH_GPIO_H
        select NO_IOPORT
 -      select ARCH_USES_GETTIMEOFFSET
 -      select ARCH_HAS_CPUFREQ
 -      select ARCH_REQUIRE_GPIOLIB
 +      select PLAT_SAMSUNG
 +      select S3C_DEV_NAND
 +      select S3C_GPIO_TRACK
        select SAMSUNG_CLKSRC
 +      select SAMSUNG_GPIOLIB_4BIT
        select SAMSUNG_IRQ_VIC_TIMER
 -      select S3C_GPIO_TRACK
 -      select S3C_DEV_NAND
        select USB_ARCH_HAS_OHCI
 -      select SAMSUNG_GPIOLIB_4BIT
 -      select HAVE_S3C2410_I2C if I2C
 -      select HAVE_S3C2410_WATCHDOG if WATCHDOG
        help
          Samsung S3C64XX series based systems
  
  config ARCH_S5P64X0
        bool "Samsung S5P6440 S5P6450"
 -      select CPU_V6
 -      select GENERIC_GPIO
 -      select HAVE_CLK
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
 -      select HAVE_S3C2410_WATCHDOG if WATCHDOG
 +      select CPU_V6
        select GENERIC_CLOCKEVENTS
 +      select GENERIC_GPIO
 +      select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
 +      select HAVE_S3C2410_WATCHDOG if WATCHDOG
        select HAVE_S3C_RTC if RTC_CLASS
 +      select NEED_MACH_GPIO_H
        help
          Samsung S5P64X0 CPU based systems, such as the Samsung SMDK6440,
          SMDK6450.
  
  config ARCH_S5PC100
        bool "Samsung S5PC100"
 -      select GENERIC_GPIO
 -      select HAVE_CLK
 +      select ARCH_USES_GETTIMEOFFSET
        select CLKDEV_LOOKUP
        select CPU_V7
 -      select ARCH_USES_GETTIMEOFFSET
 +      select GENERIC_GPIO
 +      select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
 -      select HAVE_S3C_RTC if RTC_CLASS
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
 +      select HAVE_S3C_RTC if RTC_CLASS
 +      select NEED_MACH_GPIO_H
        help
          Samsung S5PC100 series based systems
  
  config ARCH_S5PV210
        bool "Samsung S5PV210/S5PC110"
 -      select CPU_V7
 -      select ARCH_SPARSEMEM_ENABLE
 +      select ARCH_HAS_CPUFREQ
        select ARCH_HAS_HOLES_MEMORYMODEL
 -      select GENERIC_GPIO
 -      select HAVE_CLK
 +      select ARCH_SPARSEMEM_ENABLE
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
 -      select ARCH_HAS_CPUFREQ
 +      select CPU_V7
        select GENERIC_CLOCKEVENTS
 +      select GENERIC_GPIO
 +      select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
 -      select HAVE_S3C_RTC if RTC_CLASS
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
 +      select HAVE_S3C_RTC if RTC_CLASS
 +      select NEED_MACH_GPIO_H
        select NEED_MACH_MEMORY_H
        help
          Samsung S5PV210/S5PC110 series based systems
  
  config ARCH_EXYNOS
 -      bool "SAMSUNG EXYNOS"
 -      select CPU_V7
 -      select ARCH_SPARSEMEM_ENABLE
 +      bool "Samsung EXYNOS"
 +      select ARCH_HAS_CPUFREQ
        select ARCH_HAS_HOLES_MEMORYMODEL
 -      select GENERIC_GPIO
 -      select HAVE_CLK
 +      select ARCH_SPARSEMEM_ENABLE
        select CLKDEV_LOOKUP
 -      select ARCH_HAS_CPUFREQ
 +      select CPU_V7
        select GENERIC_CLOCKEVENTS
 -      select HAVE_S3C_RTC if RTC_CLASS
 +      select GENERIC_GPIO
 +      select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
 +      select HAVE_S3C_RTC if RTC_CLASS
 +      select NEED_MACH_GPIO_H
        select NEED_MACH_MEMORY_H
        help
          Support for SAMSUNG's EXYNOS SoCs (EXYNOS4/5)
  
  config ARCH_SHARK
        bool "Shark"
 +      select ARCH_USES_GETTIMEOFFSET
        select CPU_SA110
        select ISA
        select ISA_DMA
 -      select ZONE_DMA
 -      select PCI
 -      select ARCH_USES_GETTIMEOFFSET
        select NEED_MACH_MEMORY_H
 -      select NEED_MACH_IO_H
 +      select PCI
 +      select ZONE_DMA
        help
          Support for the StrongARM based Digital DNARD machine, also known
          as "Shark" (<http://www.shark-linux.de/shark.html>).
  config ARCH_U300
        bool "ST-Ericsson U300 Series"
        depends on MMU
 -      select CLKSRC_MMIO
 -      select CPU_ARM926T
 -      select HAVE_TCM
 +      select ARCH_REQUIRE_GPIOLIB
        select ARM_AMBA
        select ARM_PATCH_PHYS_VIRT
        select ARM_VIC
 -      select GENERIC_CLOCKEVENTS
        select CLKDEV_LOOKUP
 +      select CLKSRC_MMIO
        select COMMON_CLK
 +      select CPU_ARM926T
 +      select GENERIC_CLOCKEVENTS
        select GENERIC_GPIO
 -      select ARCH_REQUIRE_GPIOLIB
 +      select HAVE_TCM
 +      select SPARSE_IRQ
        help
          Support for ST-Ericsson U300 series mobile platforms.
  
  config ARCH_U8500
        bool "ST-Ericsson U8500 Series"
        depends on MMU
 -      select CPU_V7
 +      select ARCH_HAS_CPUFREQ
 +      select ARCH_REQUIRE_GPIOLIB
        select ARM_AMBA
 -      select GENERIC_CLOCKEVENTS
        select CLKDEV_LOOKUP
 -      select ARCH_REQUIRE_GPIOLIB
 -      select ARCH_HAS_CPUFREQ
 +      select CPU_V7
 +      select GENERIC_CLOCKEVENTS
        select HAVE_SMP
        select MIGHT_HAVE_CACHE_L2X0
        help
  
  config ARCH_NOMADIK
        bool "STMicroelectronics Nomadik"
 +      select ARCH_REQUIRE_GPIOLIB
        select ARM_AMBA
        select ARM_VIC
 -      select CPU_ARM926T
        select COMMON_CLK
 +      select CPU_ARM926T
        select GENERIC_CLOCKEVENTS
 -      select PINCTRL
        select MIGHT_HAVE_CACHE_L2X0
 -      select ARCH_REQUIRE_GPIOLIB
 +      select PINCTRL
 +      select PINCTRL_STN8815
        help
          Support for the Nomadik platform by ST-Ericsson
  
 +config PLAT_SPEAR
 +      bool "ST SPEAr"
 +      select ARCH_REQUIRE_GPIOLIB
 +      select ARM_AMBA
 +      select CLKDEV_LOOKUP
 +      select CLKSRC_MMIO
 +      select COMMON_CLK
 +      select GENERIC_CLOCKEVENTS
 +      select HAVE_CLK
 +      help
 +        Support for ST's SPEAr platform (SPEAr3xx, SPEAr6xx and SPEAr13xx).
 +
  config ARCH_DAVINCI
        bool "TI DaVinci"
 -      select GENERIC_CLOCKEVENTS
 +      select ARCH_HAS_HOLES_MEMORYMODEL
        select ARCH_REQUIRE_GPIOLIB
 -      select ZONE_DMA
 -      select HAVE_IDE
        select CLKDEV_LOOKUP
        select GENERIC_ALLOCATOR
 +      select GENERIC_CLOCKEVENTS
        select GENERIC_IRQ_CHIP
 -      select ARCH_HAS_HOLES_MEMORYMODEL
 +      select HAVE_IDE
 +      select NEED_MACH_GPIO_H
 +      select ZONE_DMA
        help
          Support for TI's DaVinci platform.
  
  config ARCH_OMAP
        bool "TI OMAP"
        depends on MMU
 -      select HAVE_CLK
 -      select ARCH_REQUIRE_GPIOLIB
        select ARCH_HAS_CPUFREQ
 -      select CLKSRC_MMIO
 -      select GENERIC_CLOCKEVENTS
        select ARCH_HAS_HOLES_MEMORYMODEL
 -      help
 -        Support for TI's OMAP platform (OMAP1/2/3/4).
 -
 -config PLAT_SPEAR
 -      bool "ST SPEAr"
 -      select ARM_AMBA
        select ARCH_REQUIRE_GPIOLIB
 -      select CLKDEV_LOOKUP
 -      select COMMON_CLK
        select CLKSRC_MMIO
        select GENERIC_CLOCKEVENTS
        select HAVE_CLK
 +      select NEED_MACH_GPIO_H
        help
 -        Support for ST's SPEAr platform (SPEAr3xx, SPEAr6xx and SPEAr13xx).
 +        Support for TI's OMAP platform (OMAP1/2/3/4).
  
  config ARCH_VT8500
        bool "VIA/WonderMedia 85xx"
 -      select CPU_ARM926T
 -      select GENERIC_GPIO
        select ARCH_HAS_CPUFREQ
 -      select GENERIC_CLOCKEVENTS
        select ARCH_REQUIRE_GPIOLIB
 +      select CLKDEV_LOOKUP
 +      select COMMON_CLK
 +      select CPU_ARM926T
 +      select GENERIC_CLOCKEVENTS
 +      select GENERIC_GPIO
 +      select HAVE_CLK
 +      select USE_OF
        help
          Support for VIA/WonderMedia VT8500/WM85xx System-on-Chip.
  
  config ARCH_ZYNQ
        bool "Xilinx Zynq ARM Cortex A9 Platform"
 +      select ARM_AMBA
 +      select ARM_GIC
 +      select CLKDEV_LOOKUP
        select CPU_V7
        select GENERIC_CLOCKEVENTS
 -      select CLKDEV_LOOKUP
 -      select ARM_GIC
 -      select ARM_AMBA
        select ICST
        select MIGHT_HAVE_CACHE_L2X0
        select USE_OF
          Support for Xilinx Zynq ARM Cortex A9 Platform
  endchoice
  
 +menu "Multiple platform selection"
 +      depends on ARCH_MULTIPLATFORM
 +
 +comment "CPU Core family selection"
 +
 +config ARCH_MULTI_V4
 +      bool "ARMv4 based platforms (FA526, StrongARM)"
 +      depends on !ARCH_MULTI_V6_V7
 +      select ARCH_MULTI_V4_V5
 +
 +config ARCH_MULTI_V4T
 +      bool "ARMv4T based platforms (ARM720T, ARM920T, ...)"
 +      depends on !ARCH_MULTI_V6_V7
 +      select ARCH_MULTI_V4_V5
 +
 +config ARCH_MULTI_V5
 +      bool "ARMv5 based platforms (ARM926T, XSCALE, PJ1, ...)"
 +      depends on !ARCH_MULTI_V6_V7
 +      select ARCH_MULTI_V4_V5
 +
 +config ARCH_MULTI_V4_V5
 +      bool
 +
 +config ARCH_MULTI_V6
 +      bool "ARMv6 based platforms (ARM11, Scorpion, ...)"
 +      select ARCH_MULTI_V6_V7
 +      select CPU_V6
 +
 +config ARCH_MULTI_V7
 +      bool "ARMv7 based platforms (Cortex-A, PJ4, Krait)"
 +      default y
 +      select ARCH_MULTI_V6_V7
 +      select ARCH_VEXPRESS
 +      select CPU_V7
 +
 +config ARCH_MULTI_V6_V7
 +      bool
 +
 +config ARCH_MULTI_CPU_AUTO
 +      def_bool !(ARCH_MULTI_V4 || ARCH_MULTI_V4T || ARCH_MULTI_V6_V7)
 +      select ARCH_MULTI_V5
 +
 +endmenu
 +
  #
  # This is sorted alphabetically by mach-* pathname.  However, plat-*
  # Kconfigs may be included either alphabetically (according to the
@@@ -1020,6 -1033,8 +1022,6 @@@ source "arch/arm/mach-mvebu/Kconfig
  
  source "arch/arm/mach-at91/Kconfig"
  
 -source "arch/arm/mach-bcmring/Kconfig"
 -
  source "arch/arm/mach-clps711x/Kconfig"
  
  source "arch/arm/mach-cns3xxx/Kconfig"
@@@ -1036,8 -1051,6 +1038,8 @@@ source "arch/arm/mach-gemini/Kconfig
  
  source "arch/arm/mach-h720x/Kconfig"
  
 +source "arch/arm/mach-highbank/Kconfig"
 +
  source "arch/arm/mach-integrator/Kconfig"
  
  source "arch/arm/mach-iop32x/Kconfig"
@@@ -1073,8 -1086,6 +1075,8 @@@ source "arch/arm/mach-omap2/Kconfig
  
  source "arch/arm/mach-orion5x/Kconfig"
  
 +source "arch/arm/mach-picoxcell/Kconfig"
 +
  source "arch/arm/mach-pxa/Kconfig"
  source "arch/arm/plat-pxa/Kconfig"
  
@@@ -1087,8 -1098,6 +1089,8 @@@ source "arch/arm/mach-sa1100/Kconfig
  source "arch/arm/plat-samsung/Kconfig"
  source "arch/arm/plat-s3c24xx/Kconfig"
  
 +source "arch/arm/mach-socfpga/Kconfig"
 +
  source "arch/arm/plat-spear/Kconfig"
  
  source "arch/arm/mach-s3c24xx/Kconfig"
@@@ -1111,8 -1120,6 +1113,8 @@@ source "arch/arm/mach-exynos/Kconfig
  
  source "arch/arm/mach-shmobile/Kconfig"
  
 +source "arch/arm/mach-prima2/Kconfig"
 +
  source "arch/arm/mach-tegra/Kconfig"
  
  source "arch/arm/mach-u300/Kconfig"
@@@ -1124,6 -1131,8 +1126,6 @@@ source "arch/arm/mach-versatile/Kconfig
  source "arch/arm/mach-vexpress/Kconfig"
  source "arch/arm/plat-versatile/Kconfig"
  
 -source "arch/arm/mach-vt8500/Kconfig"
 -
  source "arch/arm/mach-w90x900/Kconfig"
  
  # Definitions to make life easier
@@@ -1137,13 -1146,9 +1139,13 @@@ config PLAT_IO
  config PLAT_ORION
        bool
        select CLKSRC_MMIO
 +      select COMMON_CLK
        select GENERIC_IRQ_CHIP
        select IRQ_DOMAIN
 -      select COMMON_CLK
 +
 +config PLAT_ORION_LEGACY
 +      bool
 +      select PLAT_ORION
  
  config PLAT_PXA
        bool
@@@ -1176,6 -1181,12 +1178,6 @@@ config XSCALE_PM
        depends on CPU_XSCALE
        default y
  
 -config CPU_HAS_PMU
 -      depends on (CPU_V6 || CPU_V6K || CPU_V7 || XSCALE_PMU) && \
 -                 (!ARCH_OMAP3 || OMAP3_EMU)
 -      default y
 -      bool
 -
  config MULTI_IRQ_HANDLER
        bool
        help
@@@ -1404,16 -1415,6 +1406,16 @@@ config PL310_ERRATA_76941
          on systems with an outer cache, the store buffer is drained
          explicitly.
  
 +config ARM_ERRATA_775420
 +       bool "ARM errata: A data cache maintenance operation which aborts, might lead to deadlock"
 +       depends on CPU_V7
 +       help
 +       This option enables the workaround for the 775420 Cortex-A9 (r2p2,
 +       r2p6,r2p8,r2p10,r3p0) erratum. In case a date cache maintenance
 +       operation aborts with MMU exception, it might cause the processor
 +       to deadlock. This workaround puts DSB before executing ISB if
 +       an abort may occur on cache maintenance.
 +
  endmenu
  
  source "arch/arm/common/Kconfig"
@@@ -1497,8 -1498,8 +1499,8 @@@ config SM
        depends on GENERIC_CLOCKEVENTS
        depends on HAVE_SMP
        depends on MMU
 -      select USE_GENERIC_SMP_HELPERS
        select HAVE_ARM_SCU if !ARCH_MSM_SCORPIONMP
 +      select USE_GENERIC_SMP_HELPERS
        help
          This enables support for systems with more than one CPU. If you have
          a system with only one CPU, like most personal computers, say N. If
@@@ -1624,7 -1625,6 +1626,7 @@@ config ARCH_NR_GPI
        default 355 if ARCH_U8500
        default 264 if MACH_H4700
        default 512 if SOC_OMAP5
 +      default 288 if ARCH_VT8500
        default 0
        help
          Maximum number of GPIOs in the system.
@@@ -1759,7 -1759,7 +1761,7 @@@ config HIGHPT
  
  config HW_PERF_EVENTS
        bool "Enable hardware performance counter support for perf events"
 -      depends on PERF_EVENTS && CPU_HAS_PMU
 +      depends on PERF_EVENTS
        default y
        help
          Enable hardware performance counter support for perf events. If
@@@ -1770,7 -1770,6 +1772,7 @@@ source "mm/Kconfig
  config FORCE_MAX_ZONEORDER
        int "Maximum zone order" if ARCH_SHMOBILE
        range 11 64 if ARCH_SHMOBILE
 +      default "12" if SOC_AM33XX
        default "9" if SA1111
        default "11"
        help
          This config option is actually maximum order plus one. For example,
          a value of 11 means that the largest free memory block is 2^10 pages.
  
 -config LEDS
 -      bool "Timer and CPU usage LEDs"
 -      depends on ARCH_CDB89712 || ARCH_EBSA110 || \
 -                 ARCH_EBSA285 || ARCH_INTEGRATOR || \
 -                 ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_NETWINDER || \
 -                 ARCH_OMAP || ARCH_P720T || ARCH_PXA_IDP || \
 -                 ARCH_SA1100 || ARCH_SHARK || ARCH_VERSATILE || \
 -                 ARCH_AT91 || ARCH_DAVINCI || \
 -                 ARCH_KS8695 || MACH_RD88F5182 || ARCH_REALVIEW
 -      help
 -        If you say Y here, the LEDs on your machine will be used
 -        to provide useful information about your current system status.
 -
 -        If you are compiling a kernel for a NetWinder or EBSA-285, you will
 -        be able to select which LEDs are active using the options below. If
 -        you are compiling a kernel for the EBSA-110 or the LART however, the
 -        red LED will simply flash regularly to indicate that the system is
 -        still functional. It is safe to say Y here if you have a CATS
 -        system, but the driver will do nothing.
 -
 -config LEDS_TIMER
 -      bool "Timer LED" if (!ARCH_CDB89712 && !ARCH_OMAP) || \
 -                          OMAP_OSK_MISTRAL || MACH_OMAP_H2 \
 -                          || MACH_OMAP_PERSEUS2
 -      depends on LEDS
 -      depends on !GENERIC_CLOCKEVENTS
 -      default y if ARCH_EBSA110
 -      help
 -        If you say Y here, one of the system LEDs (the green one on the
 -        NetWinder, the amber one on the EBSA285, or the red one on the LART)
 -        will flash regularly to indicate that the system is still
 -        operational. This is mainly useful to kernel hackers who are
 -        debugging unstable kernels.
 -
 -        The LART uses the same LED for both Timer LED and CPU usage LED
 -        functions. You may choose to use both, but the Timer LED function
 -        will overrule the CPU usage LED.
 -
 -config LEDS_CPU
 -      bool "CPU usage LED" if (!ARCH_CDB89712 && !ARCH_EBSA110 && \
 -                      !ARCH_OMAP) \
 -                      || OMAP_OSK_MISTRAL || MACH_OMAP_H2 \
 -                      || MACH_OMAP_PERSEUS2
 -      depends on LEDS
 -      help
 -        If you say Y here, the red LED will be used to give a good real
 -        time indication of CPU usage, by lighting whenever the idle task
 -        is not currently executing.
 -
 -        The LART uses the same LED for both Timer LED and CPU usage LED
 -        functions. You may choose to use both, but the Timer LED function
 -        will overrule the CPU usage LED.
 -
  config ALIGNMENT_TRAP
        bool
        depends on CPU_CP15_MMU
          configuration it is safe to say N, otherwise say Y.
  
  config UACCESS_WITH_MEMCPY
 -      bool "Use kernel mem{cpy,set}() for {copy_to,clear}_user() (EXPERIMENTAL)"
 -      depends on MMU && EXPERIMENTAL
 +      bool "Use kernel mem{cpy,set}() for {copy_to,clear}_user()"
 +      depends on MMU
        default y if CPU_FEROCEON
        help
          Implement faster copy_to_user and clear_user methods for CPU
@@@ -1841,15 -1893,11 +1843,15 @@@ config CC_STACKPROTECTO
          neutralized via a kernel panic.
          This feature requires gcc version 4.2 or above.
  
 -config DEPRECATED_PARAM_STRUCT
 -      bool "Provide old way to pass kernel parameters"
 +config XEN_DOM0
 +      def_bool y
 +      depends on XEN
 +
 +config XEN
 +      bool "Xen guest support on ARM (EXPERIMENTAL)"
 +      depends on EXPERIMENTAL && ARM && OF
        help
 -        This was deprecated in 2001 and announced to live on for 5 years.
 -        Some old boot loaders still use this way.
 +        Say Y if you want to run Linux in a Virtual Machine on Xen on ARM.
  
  endmenu
  
@@@ -1857,29 -1905,12 +1859,29 @@@ menu "Boot options
  
  config USE_OF
        bool "Flattened Device Tree support"
 +      select IRQ_DOMAIN
        select OF
        select OF_EARLY_FLATTREE
 -      select IRQ_DOMAIN
        help
          Include support for flattened device tree machine descriptions.
  
 +config ATAGS
 +      bool "Support for the traditional ATAGS boot data passing" if USE_OF
 +      default y
 +      help
 +        This is the traditional way of passing data to the kernel at boot
 +        time. If you are solely relying on the flattened device tree (or
 +        the ARM_ATAG_DTB_COMPAT option) then you may unselect this option
 +        to remove ATAGS support from your kernel binary.  If unsure,
 +        leave this to y.
 +
 +config DEPRECATED_PARAM_STRUCT
 +      bool "Provide old way to pass kernel parameters"
 +      depends on ATAGS
 +      help
 +        This was deprecated in 2001 and announced to live on for 5 years.
 +        Some old boot loaders still use this way.
 +
  # Compressed boot loader in ROM.  Yes, we really want to ask about
  # TEXT and BSS so we preserve their values in the config files.
  config ZBOOT_ROM_TEXT
@@@ -2006,7 -2037,6 +2008,7 @@@ config CMDLIN
  choice
        prompt "Kernel command line type" if CMDLINE != ""
        default CMDLINE_FROM_BOOTLOADER
 +      depends on ATAGS
  
  config CMDLINE_FROM_BOOTLOADER
        bool "Use bootloader kernel arguments if available"
@@@ -2032,7 -2062,7 +2034,7 @@@ endchoic
  
  config XIP_KERNEL
        bool "Kernel Execute-In-Place from ROM"
 -      depends on !ZBOOT_ROM && !ARM_LPAE
 +      depends on !ZBOOT_ROM && !ARM_LPAE && !ARCH_MULTIPLATFORM
        help
          Execute-In-Place allows the kernel to run from non-volatile storage
          directly addressable by the CPU, such as NOR flash. This saves RAM
@@@ -2076,7 -2106,7 +2078,7 @@@ config KEXE
  
  config ATAGS_PROC
        bool "Export atags in procfs"
 -      depends on KEXEC
 +      depends on ATAGS && KEXEC
        default y
        help
          Should the atags used to boot the kernel be exported in an "atags"
@@@ -2141,8 -2171,8 +2143,8 @@@ config CPU_FREQ_PX
        bool
        depends on CPU_FREQ && ARCH_PXA && PXA25x
        default y
 -      select CPU_FREQ_TABLE
        select CPU_FREQ_DEFAULT_GOV_USERSPACE
 +      select CPU_FREQ_TABLE
  
  config CPU_FREQ_S3C
        bool
@@@ -2285,7 -2315,7 +2287,7 @@@ menu "Power management options
  source "kernel/power/Kconfig"
  
  config ARCH_SUSPEND_POSSIBLE
 -      depends on !ARCH_S5PC100 && !ARCH_TEGRA
 +      depends on !ARCH_S5PC100
        depends on CPU_ARM920T || CPU_ARM926T || CPU_SA1100 || \
                CPU_V6 || CPU_V6K || CPU_V7 || CPU_XSC3 || CPU_XSCALE || CPU_MOHAWK
        def_bool y
diff --combined arch/blackfin/Kconfig
@@@ -33,7 -33,6 +33,7 @@@ config BLACKFI
        select HAVE_PERF_EVENTS
        select ARCH_HAVE_CUSTOM_GPIO_H
        select ARCH_WANT_OPTIONAL_GPIOLIB
 +      select HAVE_UID16
        select ARCH_WANT_IPC_PARSE_VERSION
        select HAVE_GENERIC_HARDIRQS
        select GENERIC_ATOMIC64
@@@ -43,6 -42,8 +43,8 @@@
        select HAVE_NMI_WATCHDOG if NMI_WATCHDOG
        select GENERIC_SMP_IDLE_THREAD
        select ARCH_USES_GETTIMEOFFSET if !GENERIC_CLOCKEVENTS
+       select HAVE_MOD_ARCH_SPECIFIC
+       select MODULES_USE_ELF_RELA
  
  config GENERIC_CSUM
        def_bool y
@@@ -299,7 -300,7 +301,7 @@@ config BF_REV_0_
  
  config BF_REV_0_4
        bool "0.4"
 -      depends on (BF561 || BF533 || BF532 || BF531 || BF538 || BF539)
 +      depends on (BF561 || BF533 || BF532 || BF531 || BF538 || BF539 || BF54x)
  
  config BF_REV_0_5
        bool "0.5"
diff --combined arch/c6x/Kconfig
@@@ -17,7 -17,7 +17,8 @@@ config C6
        select OF
        select OF_EARLY_FLATTREE
        select GENERIC_CLOCKEVENTS
 +      select GENERIC_KERNEL_THREAD
+       select MODULES_USE_ELF_RELA
  
  config MMU
        def_bool n
diff --combined arch/cris/Kconfig
@@@ -42,12 -42,12 +42,13 @@@ config CRI
        select HAVE_IDE
        select GENERIC_ATOMIC64
        select HAVE_GENERIC_HARDIRQS
 +      select HAVE_UID16
        select ARCH_WANT_IPC_PARSE_VERSION
        select GENERIC_IRQ_SHOW
        select GENERIC_IOMAP
        select GENERIC_SMP_IDLE_THREAD if ETRAX_ARCH_V32
        select GENERIC_CMOS_UPDATE
+       select MODULES_USE_ELF_RELA
  
  config HZ
        int
@@@ -139,6 -139,11 +140,6 @@@ config CRIS_MACH_ARTPEC
  
  endchoice
  
 -config ETRAX_VCS_SIM
 -      bool "VCS Simulator"
 -      help
 -        Setup hardware to be run in the VCS simulator.
 -
  config ETRAX_ARCH_V10
         bool
         default y if ETRAX100LX || ETRAX100LX_V2
@@@ -8,5 -8,4 +8,6 @@@ header-y += etraxgpio.
  header-y += rs485.h
  header-y += sync_serial.h
  
 +generic-y += clkdev.h
 +generic-y += exec.h
+ generic-y += module.h
diff --combined arch/h8300/Kconfig
@@@ -3,10 -3,10 +3,11 @@@ config H830
        default y
        select HAVE_IDE
        select HAVE_GENERIC_HARDIRQS
 +      select HAVE_UID16
        select ARCH_WANT_IPC_PARSE_VERSION
        select GENERIC_IRQ_SHOW
        select GENERIC_CPU_DEVICES
+       select MODULES_USE_ELF_RELA
  
  config SYMBOL_PREFIX
        string
@@@ -1,4 -1,3 +1,5 @@@
  include include/asm-generic/Kbuild.asm
  
 -generic-y     += module.h
 +generic-y += clkdev.h
 +generic-y += exec.h
++generic-y += module.h
diff --combined arch/ia64/Kconfig
@@@ -25,7 -25,6 +25,7 @@@ config IA6
        select HAVE_GENERIC_HARDIRQS
        select HAVE_MEMBLOCK
        select HAVE_MEMBLOCK_NODE_MAP
 +      select HAVE_VIRT_CPU_ACCOUNTING
        select ARCH_DISCARD_MEMBLOCK
        select GENERIC_IRQ_PROBE
        select GENERIC_PENDING_IRQ if SMP
@@@ -39,7 -38,9 +39,9 @@@
        select ARCH_TASK_STRUCT_ALLOCATOR
        select ARCH_THREAD_INFO_ALLOCATOR
        select ARCH_CLOCKSOURCE_DATA
 -      select GENERIC_TIME_VSYSCALL
 +      select GENERIC_TIME_VSYSCALL_OLD
+       select HAVE_MOD_ARCH_SPECIFIC
+       select MODULES_USE_ELF_RELA
        default y
        help
          The Itanium Processor Family is Intel's 64-bit successor to
@@@ -341,6 -342,17 +343,6 @@@ config FORCE_MAX_ZONEORDE
        default "17" if HUGETLB_PAGE
        default "11"
  
 -config VIRT_CPU_ACCOUNTING
 -      bool "Deterministic task and CPU time accounting"
 -      default n
 -      help
 -        Select this option to enable more accurate task and CPU time
 -        accounting.  This is done by reading a CPU counter on each
 -        kernel entry and exit and on transitions within the kernel
 -        between system, softirq and hardirq state, so there is a
 -        small performance impact.
 -        If in doubt, say N here.
 -
  config SMP
        bool "Symmetric multi-processing support"
        select USE_GENERIC_SMP_HELPERS
diff --combined arch/m32r/Kconfig
@@@ -8,12 -8,12 +8,13 @@@ config M32
        select HAVE_KERNEL_BZIP2
        select HAVE_KERNEL_LZMA
        select ARCH_WANT_IPC_PARSE_VERSION
 +      select HAVE_DEBUG_BUGVERBOSE
        select HAVE_GENERIC_HARDIRQS
        select GENERIC_IRQ_PROBE
        select GENERIC_IRQ_SHOW
        select GENERIC_ATOMIC64
        select ARCH_USES_GETTIMEOFFSET
+       select MODULES_USE_ELF_RELA
  
  config SBUS
        bool
@@@ -1,4 -1,3 +1,5 @@@
  include include/asm-generic/Kbuild.asm
  
 -generic-y     += module.h
 +generic-y += clkdev.h
 +generic-y += exec.h
++generic-y += module.h
diff --combined arch/m68k/Kconfig
@@@ -3,11 -3,9 +3,11 @@@ config M68
        default y
        select HAVE_IDE
        select HAVE_AOUT if MMU
 +      select HAVE_DEBUG_BUGVERBOSE
        select HAVE_GENERIC_HARDIRQS
        select GENERIC_IRQ_SHOW
        select GENERIC_ATOMIC64
 +      select HAVE_UID16
        select ARCH_HAVE_NMI_SAFE_CMPXCHG if RMW_INSNS
        select GENERIC_CPU_DEVICES
        select GENERIC_STRNCPY_FROM_USER if MMU
        select FPU if MMU
        select ARCH_WANT_IPC_PARSE_VERSION
        select ARCH_USES_GETTIMEOFFSET if MMU && !COLDFIRE
 +      select GENERIC_KERNEL_THREAD
+       select HAVE_MOD_ARCH_SPECIFIC
+       select MODULES_USE_ELF_REL
+       select MODULES_USE_ELF_RELA
  
  config RWSEM_GENERIC_SPINLOCK
        bool
diff --combined arch/microblaze/Kconfig
@@@ -16,7 -16,6 +16,7 @@@ config MICROBLAZ
        select OF
        select OF_EARLY_FLATTREE
        select ARCH_WANT_IPC_PARSE_VERSION
 +      select HAVE_DEBUG_KMEMLEAK
        select IRQ_DOMAIN
        select HAVE_GENERIC_HARDIRQS
        select GENERIC_IRQ_PROBE
@@@ -25,6 -24,7 +25,7 @@@
        select GENERIC_CPU_DEVICES
        select GENERIC_ATOMIC64
        select GENERIC_CLOCKEVENTS
+       select MODULES_USE_ELF_RELA
  
  config SWAP
        def_bool n
@@@ -244,11 -244,14 +245,11 @@@ choic
  config MICROBLAZE_4K_PAGES
        bool "4k page size"
  
 -config MICROBLAZE_8K_PAGES
 -      bool "8k page size"
 -
  config MICROBLAZE_16K_PAGES
        bool "16k page size"
  
 -config MICROBLAZE_32K_PAGES
 -      bool "32k page size"
 +config MICROBLAZE_64K_PAGES
 +      bool "64k page size"
  
  endchoice
  
diff --combined arch/mips/Kconfig
@@@ -17,7 -17,6 +17,7 @@@ config MIP
        select HAVE_FUNCTION_GRAPH_TRACER
        select HAVE_KPROBES
        select HAVE_KRETPROBES
 +      select HAVE_DEBUG_KMEMLEAK
        select ARCH_BINFMT_ELF_RANDOMIZE_PIE
        select RTC_LIB if !MACH_LOONGSON
        select GENERIC_ATOMIC64 if !64BIT
@@@ -37,6 -36,9 +37,9 @@@
        select BUILDTIME_EXTABLE_SORT
        select GENERIC_CLOCKEVENTS
        select GENERIC_CMOS_UPDATE
+       select HAVE_MOD_ARCH_SPECIFIC
+       select MODULES_USE_ELF_REL
+       select MODULES_USE_ELF_RELA if 64BIT
  
  menu "Machine selection"
  
@@@ -243,8 -245,6 +246,8 @@@ config LANTI
        select HAVE_MACH_CLKDEV
        select CLKDEV_LOOKUP
        select USE_OF
 +      select PINCTRL
 +      select PINCTRL_LANTIQ
  
  config LASAT
        bool "LASAT Networks platforms"
@@@ -323,35 -323,24 +326,35 @@@ config MIPS_MALT
          This enables support for the MIPS Technologies Malta evaluation
          board.
  
 -config MIPS_SIM
 -      bool 'MIPS simulator (MIPSsim)'
 +config MIPS_SEAD3
 +      bool "MIPS SEAD3 board"
 +      select BOOT_ELF32
 +      select BOOT_RAW
        select CEVT_R4K
        select CSRC_R4K
 +      select CPU_MIPSR2_IRQ_VI
 +      select CPU_MIPSR2_IRQ_EI
        select DMA_NONCOHERENT
 -      select SYS_HAS_EARLY_PRINTK
        select IRQ_CPU
 -      select BOOT_RAW
 +      select IRQ_GIC
 +      select MIPS_BOARDS_GEN
 +      select MIPS_CPU_SCACHE
 +      select MIPS_MSC
        select SYS_HAS_CPU_MIPS32_R1
        select SYS_HAS_CPU_MIPS32_R2
 +      select SYS_HAS_CPU_MIPS64_R1
        select SYS_HAS_EARLY_PRINTK
        select SYS_SUPPORTS_32BIT_KERNEL
 +      select SYS_SUPPORTS_64BIT_KERNEL
        select SYS_SUPPORTS_BIG_ENDIAN
 -      select SYS_SUPPORTS_MULTITHREADING
        select SYS_SUPPORTS_LITTLE_ENDIAN
 +      select SYS_SUPPORTS_SMARTMIPS
 +      select USB_ARCH_HAS_EHCI
 +      select USB_EHCI_BIG_ENDIAN_DESC
 +      select USB_EHCI_BIG_ENDIAN_MMIO
        help
 -        This option enables support for MIPS Technologies MIPSsim software
 -        emulator.
 +        This enables support for the MIPS Technologies SEAD3 evaluation
 +        board.
  
  config NEC_MARKEINS
        bool "NEC EMMA2RH Mark-eins board"
@@@ -845,7 -834,6 +848,7 @@@ config NLM_XLP_BOAR
        select ZONE_DMA if 64BIT
        select SYNC_R4K
        select SYS_HAS_EARLY_PRINTK
 +      select USE_OF
        help
          This board is based on Netlogic XLP Processor.
          Say Y here if you have a XLP based board.
@@@ -1764,6 -1752,7 +1767,6 @@@ config HARDWARE_WATCHPOINT
  menu "Kernel type"
  
  choice
 -
        prompt "Kernel code model"
        help
          You should only select this option if you have a workload that
@@@ -1894,18 -1883,6 +1897,18 @@@ config SIBYTE_DMA_PAGEOP
  config CPU_HAS_PREFETCH
        bool
  
 +config CPU_GENERIC_DUMP_TLB
 +      bool
 +      default y if !(CPU_R3000 || CPU_R6000 || CPU_R8000 || CPU_TX39XX)
 +
 +config CPU_R4K_FPU
 +      bool
 +      default y if !(CPU_R3000 || CPU_R6000 || CPU_TX39XX || CPU_CAVIUM_OCTEON)
 +
 +config CPU_R4K_CACHE_TLB
 +      bool
 +      default y if !(CPU_R3000 || CPU_R8000 || CPU_SB1 || CPU_TX39XX || CPU_CAVIUM_OCTEON)
 +
  choice
        prompt "MIPS MT options"
  
@@@ -1981,6 -1958,7 +1984,6 @@@ config SCHED_SM
  config SYS_SUPPORTS_SCHED_SMT
        bool
  
 -
  config SYS_SUPPORTS_MULTITHREADING
        bool
  
@@@ -2385,10 -2363,12 +2388,10 @@@ config SECCOM
          If unsure, say Y. Only embedded should say N here.
  
  config USE_OF
 -      bool "Flattened Device Tree support"
 +      bool
        select OF
        select OF_EARLY_FLATTREE
        select IRQ_DOMAIN
 -      help
 -        Include support for flattened device tree machine descriptions.
  
  endmenu
  
@@@ -31,14 -31,32 +31,15 @@@ obj-$(CONFIG_SYNC_R4K)             += sync-r4k.
  
  obj-$(CONFIG_STACKTRACE)      += stacktrace.o
  obj-$(CONFIG_MODULES)         += mips_ksyms.o module.o
+ obj-$(CONFIG_MODULES_USE_ELF_RELA) += module-rela.o
  
  obj-$(CONFIG_FUNCTION_TRACER) += mcount.o ftrace.o
  
 -obj-$(CONFIG_CPU_LOONGSON2)   += r4k_fpu.o r4k_switch.o
 -obj-$(CONFIG_CPU_MIPS32)      += r4k_fpu.o r4k_switch.o
 -obj-$(CONFIG_CPU_MIPS64)      += r4k_fpu.o r4k_switch.o
 +obj-$(CONFIG_CPU_R4K_FPU)     += r4k_fpu.o r4k_switch.o
  obj-$(CONFIG_CPU_R3000)               += r2300_fpu.o r2300_switch.o
 -obj-$(CONFIG_CPU_R4300)               += r4k_fpu.o r4k_switch.o
 -obj-$(CONFIG_CPU_R4X00)               += r4k_fpu.o r4k_switch.o
 -obj-$(CONFIG_CPU_R5000)               += r4k_fpu.o r4k_switch.o
  obj-$(CONFIG_CPU_R6000)               += r6000_fpu.o r4k_switch.o
 -obj-$(CONFIG_CPU_R5432)               += r4k_fpu.o r4k_switch.o
 -obj-$(CONFIG_CPU_R5500)               += r4k_fpu.o r4k_switch.o
 -obj-$(CONFIG_CPU_R8000)               += r4k_fpu.o r4k_switch.o
 -obj-$(CONFIG_CPU_RM7000)      += r4k_fpu.o r4k_switch.o
 -obj-$(CONFIG_CPU_RM9000)      += r4k_fpu.o r4k_switch.o
 -obj-$(CONFIG_CPU_NEVADA)      += r4k_fpu.o r4k_switch.o
 -obj-$(CONFIG_CPU_R10000)      += r4k_fpu.o r4k_switch.o
 -obj-$(CONFIG_CPU_SB1)         += r4k_fpu.o r4k_switch.o
  obj-$(CONFIG_CPU_TX39XX)      += r2300_fpu.o r2300_switch.o
 -obj-$(CONFIG_CPU_TX49XX)      += r4k_fpu.o r4k_switch.o
 -obj-$(CONFIG_CPU_VR41XX)      += r4k_fpu.o r4k_switch.o
  obj-$(CONFIG_CPU_CAVIUM_OCTEON)       += octeon_switch.o
 -obj-$(CONFIG_CPU_XLR)         += r4k_fpu.o r4k_switch.o
 -obj-$(CONFIG_CPU_XLP)         += r4k_fpu.o r4k_switch.o
  
  obj-$(CONFIG_SMP)             += smp.o
  obj-$(CONFIG_SMP_UP)          += smp-up.o
@@@ -87,7 -105,7 +88,7 @@@ obj-$(CONFIG_MIPS_MACHINE)   += mips_mach
  
  obj-$(CONFIG_OF)              += prom.o
  
 -CFLAGS_cpu-bugs64.o   = $(shell if $(CC) $(KBUILD_CFLAGS) -Wa,-mdaddi -c -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi)
 +CFLAGS_cpu-bugs64.o   = $(shell if $(CC) $(KBUILD_CFLAGS) -Wa,-mdaddi -c -o /dev/null -x c /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi)
  
  obj-$(CONFIG_HAVE_STD_PC_SERIAL_PORT) += 8250-platform.o
  
diff --combined arch/mn10300/Kconfig
@@@ -8,7 -8,7 +8,8 @@@ config MN1030
        select HAVE_ARCH_KGDB
        select HAVE_NMI_WATCHDOG if MN10300_WD_TIMER
        select GENERIC_CLOCKEVENTS
 +      select GENERIC_KERNEL_THREAD
+       select MODULES_USE_ELF_RELA
  
  config AM33_2
        def_bool n
diff --combined arch/parisc/Kconfig
@@@ -13,13 -13,14 +13,15 @@@ config PARIS
        select HAVE_PERF_EVENTS
        select GENERIC_ATOMIC64 if !64BIT
        select HAVE_GENERIC_HARDIRQS
 +      select BROKEN_RODATA
        select GENERIC_IRQ_PROBE
        select GENERIC_PCI_IOMAP
        select IRQ_PER_CPU
        select ARCH_HAVE_NMI_SAFE_CMPXCHG
        select GENERIC_SMP_IDLE_THREAD
        select GENERIC_STRNCPY_FROM_USER
+       select HAVE_MOD_ARCH_SPECIFIC
+       select MODULES_USE_ELF_RELA
  
        help
          The PA-RISC microprocessor is designed by Hewlett-Packard and used
diff --combined arch/powerpc/Kconfig
@@@ -99,7 -99,6 +99,7 @@@ config PP
        select HAVE_DYNAMIC_FTRACE
        select HAVE_FUNCTION_TRACER
        select HAVE_FUNCTION_GRAPH_TRACER
 +      select SYSCTL_EXCEPTION_TRACE
        select ARCH_WANT_OPTIONAL_GPIOLIB
        select HAVE_IDE
        select HAVE_IOREMAP_PROT
        select HAVE_DMA_API_DEBUG
        select USE_GENERIC_SMP_HELPERS if SMP
        select HAVE_OPROFILE
 +      select HAVE_DEBUG_KMEMLEAK
        select HAVE_SYSCALL_WRAPPERS if PPC64
        select GENERIC_ATOMIC64 if PPC32
        select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
        select ARCH_HAVE_NMI_SAFE_CMPXCHG
        select GENERIC_SMP_IDLE_THREAD
        select GENERIC_CMOS_UPDATE
 -      select GENERIC_TIME_VSYSCALL
 +      select GENERIC_TIME_VSYSCALL_OLD
        select GENERIC_CLOCKEVENTS
        select GENERIC_STRNCPY_FROM_USER
        select GENERIC_STRNLEN_USER
 +      select GENERIC_KERNEL_THREAD
+       select HAVE_MOD_ARCH_SPECIFIC
+       select MODULES_USE_ELF_RELA
  
  config EARLY_PRINTK
        bool
@@@ -218,8 -217,7 +220,8 @@@ config ARCH_HIBERNATION_POSSIBL
  config ARCH_SUSPEND_POSSIBLE
        def_bool y
        depends on ADB_PMU || PPC_EFIKA || PPC_LITE5200 || PPC_83xx || \
 -                 (PPC_85xx && !SMP) || PPC_86xx || PPC_PSERIES || 44x || 40x
 +                 (PPC_85xx && !PPC_E500MC) || PPC_86xx || PPC_PSERIES \
 +                 || 44x || 40x
  
  config PPC_DCR_NATIVE
        bool
@@@ -243,9 -241,6 +245,9 @@@ config PPC_OF_PLATFORM_PC
  config ARCH_SUPPORTS_DEBUG_PAGEALLOC
        def_bool y
  
 +config ARCH_SUPPORTS_UPROBES
 +      def_bool y
 +
  config PPC_ADV_DEBUG_REGS
        bool
        depends on 40x || BOOKE
@@@ -332,8 -327,7 +334,8 @@@ config SWIOTL
  
  config HOTPLUG_CPU
        bool "Support for enabling/disabling CPUs"
 -      depends on SMP && HOTPLUG && EXPERIMENTAL && (PPC_PSERIES || PPC_PMAC || PPC_POWERNV)
 +      depends on SMP && HOTPLUG && EXPERIMENTAL && (PPC_PSERIES || \
 +      PPC_PMAC || PPC_POWERNV || (PPC_85xx && !PPC_E500MC))
        ---help---
          Say Y here to be able to disable and re-enable individual
          CPUs at runtime on SMP machines.
@@@ -565,14 -559,6 +567,14 @@@ config SCHED_SM
          when dealing with POWER5 cpus at a cost of slightly increased
          overhead in some places. If unsure say N here.
  
 +config PPC_DENORMALISATION
 +      bool "PowerPC denormalisation exception handling"
 +      depends on PPC_BOOK3S_64
 +      default "n"
 +      ---help---
 +        Add support for handling denormalisation of single precision
 +        values.  Useful for bare metal only.  If unsure say Y here.
 +
  config CMDLINE_BOOL
        bool "Default bootloader kernel arguments"
  
diff --combined arch/s390/Kconfig
@@@ -49,13 -49,10 +49,13 @@@ config GENERIC_LOCKBREA
  config PGSTE
        def_bool y if KVM
  
 -config VIRT_CPU_ACCOUNTING
 +config ARCH_SUPPORTS_DEBUG_PAGEALLOC
        def_bool y
  
 -config ARCH_SUPPORTS_DEBUG_PAGEALLOC
 +config KEXEC
 +      def_bool y
 +
 +config AUDIT_ARCH
        def_bool y
  
  config S390
@@@ -68,7 -65,6 +68,7 @@@
        select HAVE_FTRACE_MCOUNT_RECORD
        select HAVE_C_RECORDMCOUNT
        select HAVE_SYSCALL_TRACEPOINTS
 +      select SYSCTL_EXCEPTION_TRACE
        select HAVE_DYNAMIC_FTRACE
        select HAVE_FUNCTION_GRAPH_TRACER
        select HAVE_REGS_AND_STACK_ACCESS_API
@@@ -81,7 -77,6 +81,7 @@@
        select HAVE_IRQ_WORK
        select HAVE_PERF_EVENTS
        select ARCH_HAVE_NMI_SAFE_CMPXCHG
 +      select HAVE_DEBUG_KMEMLEAK
        select HAVE_KERNEL_GZIP
        select HAVE_KERNEL_BZIP2
        select HAVE_KERNEL_LZMA
        select HAVE_KERNEL_XZ
        select HAVE_ARCH_MUTEX_CPU_RELAX
        select HAVE_ARCH_JUMP_LABEL if !MARCH_G5
 +      select HAVE_BPF_JIT if 64BIT && PACK_STACK
        select ARCH_SAVE_PAGE_KEYS if HIBERNATION
        select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
        select HAVE_MEMBLOCK
        select HAVE_MEMBLOCK_NODE_MAP
        select HAVE_CMPXCHG_LOCAL
 +      select HAVE_CMPXCHG_DOUBLE
 +      select HAVE_VIRT_CPU_ACCOUNTING
 +      select VIRT_CPU_ACCOUNTING
        select ARCH_DISCARD_MEMBLOCK
        select BUILDTIME_EXTABLE_SORT
        select ARCH_INLINE_SPIN_TRYLOCK
        select ARCH_INLINE_WRITE_UNLOCK_BH
        select ARCH_INLINE_WRITE_UNLOCK_IRQ
        select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE
 +      select HAVE_UID16 if 32BIT
        select ARCH_WANT_IPC_PARSE_VERSION
        select GENERIC_SMP_IDLE_THREAD
 -      select GENERIC_TIME_VSYSCALL
 +      select GENERIC_TIME_VSYSCALL_OLD
        select GENERIC_CLOCKEVENTS
        select KTIME_SCALAR if 32BIT
        select HAVE_ARCH_SECCOMP_FILTER
 +      select GENERIC_KERNEL_THREAD
+       select HAVE_MOD_ARCH_SPECIFIC
+       select MODULES_USE_ELF_RELA
  
  config SCHED_OMIT_FRAME_POINTER
        def_bool y
@@@ -144,79 -135,9 +146,79 @@@ source "init/Kconfig
  
  source "kernel/Kconfig.freezer"
  
 -menu "Base setup"
 +menu "Processor type and features"
 +
 +config HAVE_MARCH_Z900_FEATURES
 +      def_bool n
 +
 +config HAVE_MARCH_Z990_FEATURES
 +      def_bool n
 +      select HAVE_MARCH_Z900_FEATURES
 +
 +config HAVE_MARCH_Z9_109_FEATURES
 +      def_bool n
 +      select HAVE_MARCH_Z990_FEATURES
 +
 +config HAVE_MARCH_Z10_FEATURES
 +      def_bool n
 +      select HAVE_MARCH_Z9_109_FEATURES
 +
 +config HAVE_MARCH_Z196_FEATURES
 +      def_bool n
 +      select HAVE_MARCH_Z10_FEATURES
 +
 +choice
 +      prompt "Processor type"
 +      default MARCH_G5
 +
 +config MARCH_G5
 +      bool "System/390 model G5 and G6"
 +      depends on !64BIT
 +      help
 +        Select this to build a 31 bit kernel that works
 +        on all ESA/390 and z/Architecture machines.
  
 -comment "Processor type and features"
 +config MARCH_Z900
 +      bool "IBM zSeries model z800 and z900"
 +      select HAVE_MARCH_Z900_FEATURES if 64BIT
 +      help
 +        Select this to enable optimizations for model z800/z900 (2064 and
 +        2066 series). This will enable some optimizations that are not
 +        available on older ESA/390 (31 Bit) only CPUs.
 +
 +config MARCH_Z990
 +      bool "IBM zSeries model z890 and z990"
 +      select HAVE_MARCH_Z990_FEATURES if 64BIT
 +      help
 +        Select this to enable optimizations for model z890/z990 (2084 and
 +        2086 series). The kernel will be slightly faster but will not work
 +        on older machines.
 +
 +config MARCH_Z9_109
 +      bool "IBM System z9"
 +      select HAVE_MARCH_Z9_109_FEATURES if 64BIT
 +      help
 +        Select this to enable optimizations for IBM System z9 (2094 and
 +        2096 series). The kernel will be slightly faster but will not work
 +        on older machines.
 +
 +config MARCH_Z10
 +      bool "IBM System z10"
 +      select HAVE_MARCH_Z10_FEATURES if 64BIT
 +      help
 +        Select this to enable optimizations for IBM System z10 (2097 and
 +        2098 series). The kernel will be slightly faster but will not work
 +        on older machines.
 +
 +config MARCH_Z196
 +      bool "IBM zEnterprise 114 and 196"
 +      select HAVE_MARCH_Z196_FEATURES if 64BIT
 +      help
 +        Select this to enable optimizations for IBM zEnterprise 114 and 196
 +        (2818 and 2817 series). The kernel will be slightly faster but will
 +        not work on older machines.
 +
 +endchoice
  
  config 64BIT
        def_bool y
  config 32BIT
        def_bool y if !64BIT
  
 +config COMPAT
 +      def_bool y
 +      prompt "Kernel support for 31 bit emulation"
 +      depends on 64BIT
 +      select COMPAT_BINFMT_ELF if BINFMT_ELF
 +      select ARCH_WANT_OLD_COMPAT_IPC
 +      help
 +        Select this option if you want to enable your system kernel to
 +        handle system-calls from ELF binaries for 31 bit ESA.  This option
 +        (and some other stuff like libraries and such) is needed for
 +        executing 31 bit applications.  It is safe to say "Y".
 +
 +config SYSVIPC_COMPAT
 +      def_bool y if COMPAT && SYSVIPC
 +
 +config KEYS_COMPAT
 +      def_bool y if COMPAT && KEYS
 +
  config SMP
        def_bool y
        prompt "Symmetric multi-processing support"
@@@ -301,8 -204,6 +303,8 @@@ config SCHED_BOO
          Book scheduler support improves the CPU scheduler's decision making
          when dealing with machines that have several books.
  
 +source kernel/Kconfig.preempt
 +
  config MATHEMU
        def_bool y
        prompt "IEEE FPU emulation"
          on older ESA/390 machines. Say Y unless you know your machine doesn't
          need this.
  
 -config COMPAT
 -      def_bool y
 -      prompt "Kernel support for 31 bit emulation"
 -      depends on 64BIT
 -      select COMPAT_BINFMT_ELF if BINFMT_ELF
 -      select ARCH_WANT_OLD_COMPAT_IPC
 -      help
 -        Select this option if you want to enable your system kernel to
 -        handle system-calls from ELF binaries for 31 bit ESA.  This option
 -        (and some other stuff like libraries and such) is needed for
 -        executing 31 bit applications.  It is safe to say "Y".
 +source kernel/Kconfig.hz
  
 -config SYSVIPC_COMPAT
 -      def_bool y if COMPAT && SYSVIPC
 +endmenu
  
 -config KEYS_COMPAT
 -      def_bool y if COMPAT && KEYS
 +menu "Memory setup"
  
 -config AUDIT_ARCH
 +config ARCH_SPARSEMEM_ENABLE
        def_bool y
 +      select SPARSEMEM_VMEMMAP_ENABLE
 +      select SPARSEMEM_VMEMMAP
 +      select SPARSEMEM_STATIC if !64BIT
  
 -config HAVE_MARCH_Z900_FEATURES
 -      def_bool n
 -
 -config HAVE_MARCH_Z990_FEATURES
 -      def_bool n
 -      select HAVE_MARCH_Z900_FEATURES
 -
 -config HAVE_MARCH_Z9_109_FEATURES
 -      def_bool n
 -      select HAVE_MARCH_Z990_FEATURES
 -
 -config HAVE_MARCH_Z10_FEATURES
 -      def_bool n
 -      select HAVE_MARCH_Z9_109_FEATURES
 -
 -config HAVE_MARCH_Z196_FEATURES
 -      def_bool n
 -      select HAVE_MARCH_Z10_FEATURES
 -
 -comment "Code generation options"
 -
 -choice
 -      prompt "Processor type"
 -      default MARCH_G5
 -
 -config MARCH_G5
 -      bool "System/390 model G5 and G6"
 -      depends on !64BIT
 -      help
 -        Select this to build a 31 bit kernel that works
 -        on all ESA/390 and z/Architecture machines.
 -
 -config MARCH_Z900
 -      bool "IBM zSeries model z800 and z900"
 -      select HAVE_MARCH_Z900_FEATURES if 64BIT
 -      help
 -        Select this to enable optimizations for model z800/z900 (2064 and
 -        2066 series). This will enable some optimizations that are not
 -        available on older ESA/390 (31 Bit) only CPUs.
 +config ARCH_SPARSEMEM_DEFAULT
 +      def_bool y
  
 -config MARCH_Z990
 -      bool "IBM zSeries model z890 and z990"
 -      select HAVE_MARCH_Z990_FEATURES if 64BIT
 -      help
 -        Select this to enable optimizations for model z890/z990 (2084 and
 -        2086 series). The kernel will be slightly faster but will not work
 -        on older machines.
 +config ARCH_SELECT_MEMORY_MODEL
 +      def_bool y
  
 -config MARCH_Z9_109
 -      bool "IBM System z9"
 -      select HAVE_MARCH_Z9_109_FEATURES if 64BIT
 -      help
 -        Select this to enable optimizations for IBM System z9 (2094 and
 -        2096 series). The kernel will be slightly faster but will not work
 -        on older machines.
 +config ARCH_ENABLE_MEMORY_HOTPLUG
 +      def_bool y if SPARSEMEM
  
 -config MARCH_Z10
 -      bool "IBM System z10"
 -      select HAVE_MARCH_Z10_FEATURES if 64BIT
 -      help
 -        Select this to enable optimizations for IBM System z10 (2097 and
 -        2098 series). The kernel will be slightly faster but will not work
 -        on older machines.
 +config ARCH_ENABLE_MEMORY_HOTREMOVE
 +      def_bool y
  
 -config MARCH_Z196
 -      bool "IBM zEnterprise 114 and 196"
 -      select HAVE_MARCH_Z196_FEATURES if 64BIT
 -      help
 -        Select this to enable optimizations for IBM zEnterprise 114 and 196
 -        (2818 and 2817 series). The kernel will be slightly faster but will
 -        not work on older machines.
 +config FORCE_MAX_ZONEORDER
 +      int
 +      default "9"
  
 -endchoice
 +source "mm/Kconfig"
  
  config PACK_STACK
        def_bool y
@@@ -404,9 -370,34 +406,9 @@@ config WARN_DYNAMIC_STAC
  
          Say N if you are unsure.
  
 -comment "Kernel preemption"
 -
 -source "kernel/Kconfig.preempt"
 -
 -config ARCH_SPARSEMEM_ENABLE
 -      def_bool y
 -      select SPARSEMEM_VMEMMAP_ENABLE
 -      select SPARSEMEM_VMEMMAP
 -      select SPARSEMEM_STATIC if !64BIT
 -
 -config ARCH_SPARSEMEM_DEFAULT
 -      def_bool y
 -
 -config ARCH_SELECT_MEMORY_MODEL
 -      def_bool y
 -
 -config ARCH_ENABLE_MEMORY_HOTPLUG
 -      def_bool y if SPARSEMEM
 -
 -config ARCH_ENABLE_MEMORY_HOTREMOVE
 -      def_bool y
 -
 -config ARCH_HIBERNATION_POSSIBLE
 -      def_bool y if 64BIT
 -
 -source "mm/Kconfig"
 +endmenu
  
 -comment "I/O subsystem configuration"
 +menu "I/O subsystem"
  
  config QDIO
        def_tristate y
@@@ -437,102 -428,13 +439,102 @@@ config CHSC_SC
  
          If unsure, say N.
  
 -comment "Misc"
 +config SCM_BUS
 +      def_bool y
 +      depends on 64BIT
 +      prompt "SCM bus driver"
 +      help
 +        Bus driver for Storage Class Memory.
 +
 +config EADM_SCH
 +      def_tristate m
 +      prompt "Support for EADM subchannels"
 +      depends on SCM_BUS
 +      help
 +        This driver allows usage of EADM subchannels. EADM subchannels act
 +        as a communication vehicle for SCM increments.
 +
 +        To compile this driver as a module, choose M here: the
 +        module will be called eadm_sch.
 +
 +endmenu
 +
 +menu "Dump support"
 +
 +config CRASH_DUMP
 +      bool "kernel crash dumps"
 +      depends on 64BIT && SMP
 +      select KEXEC
 +      help
 +        Generate crash dump after being started by kexec.
 +        Crash dump kernels are loaded in the main kernel with kexec-tools
 +        into a specially reserved region and then later executed after
 +        a crash by kdump/kexec.
 +        For more details see Documentation/kdump/kdump.txt
 +
 +config ZFCPDUMP
 +      def_bool n
 +      prompt "zfcpdump support"
 +      select SMP
 +      help
 +        Select this option if you want to build an zfcpdump enabled kernel.
 +        Refer to <file:Documentation/s390/zfcpdump.txt> for more details on this.
 +
 +endmenu
 +
 +menu "Executable file formats / Emulations"
  
  source "fs/Kconfig.binfmt"
  
 -config FORCE_MAX_ZONEORDER
 -      int
 -      default "9"
 +config SECCOMP
 +      def_bool y
 +      prompt "Enable seccomp to safely compute untrusted bytecode"
 +      depends on PROC_FS
 +      help
 +        This kernel feature is useful for number crunching applications
 +        that may need to compute untrusted bytecode during their
 +        execution. By using pipes or other transports made available to
 +        the process as file descriptors supporting the read/write
 +        syscalls, it's possible to isolate those applications in
 +        their own address space using seccomp. Once seccomp is
 +        enabled via /proc/<pid>/seccomp, it cannot be disabled
 +        and the task is only allowed to execute a few safe syscalls
 +        defined by each seccomp mode.
 +
 +        If unsure, say Y.
 +
 +endmenu
 +
 +menu "Power Management"
 +
 +config ARCH_HIBERNATION_POSSIBLE
 +      def_bool y if 64BIT
 +
 +source "kernel/power/Kconfig"
 +
 +endmenu
 +
 +source "net/Kconfig"
 +
 +config PCMCIA
 +      def_bool n
 +
 +config CCW
 +      def_bool y
 +
 +source "drivers/Kconfig"
 +
 +source "fs/Kconfig"
 +
 +source "arch/s390/Kconfig.debug"
 +
 +source "security/Kconfig"
 +
 +source "crypto/Kconfig"
 +
 +source "lib/Kconfig"
 +
 +menu "Virtualization"
  
  config PFAULT
        def_bool y
          this option.
  
  config SHARED_KERNEL
 -      def_bool y
 -      prompt "VM shared kernel support"
 +      bool "VM shared kernel support"
 +      depends on !JUMP_LABEL
        help
          Select this option, if you want to share the text segment of the
          Linux kernel between different VM guests. This reduces memory
@@@ -644,6 -546,8 +646,6 @@@ config APPLDATA_NET_SU
          This can also be compiled as a module, which will be called
          appldata_net_sum.o.
  
 -source kernel/Kconfig.hz
 -
  config S390_HYPFS_FS
        def_bool y
        prompt "s390 hypervisor file system support"
          This is a virtual file system intended to provide accounting
          information in an s390 hypervisor environment.
  
 -config KEXEC
 -      def_bool n
 -      prompt "kexec system call"
 -      help
 -        kexec is a system call that implements the ability to shutdown your
 -        current kernel, and to start another kernel.  It is like a reboot
 -        but is independent of hardware/microcode support.
 -
 -config CRASH_DUMP
 -      bool "kernel crash dumps"
 -      depends on 64BIT && SMP
 -      select KEXEC
 -      help
 -        Generate crash dump after being started by kexec.
 -        Crash dump kernels are loaded in the main kernel with kexec-tools
 -        into a specially reserved region and then later executed after
 -        a crash by kdump/kexec.
 -        For more details see Documentation/kdump/kdump.txt
 -
 -config ZFCPDUMP
 -      def_bool n
 -      prompt "zfcpdump support"
 -      select SMP
 -      help
 -        Select this option if you want to build an zfcpdump enabled kernel.
 -        Refer to <file:Documentation/s390/zfcpdump.txt> for more details on this.
 +source "arch/s390/kvm/Kconfig"
  
  config S390_GUEST
        def_bool y
 -      prompt "s390 guest support for KVM (EXPERIMENTAL)"
 +      prompt "s390 support for virtio devices (EXPERIMENTAL)"
        depends on 64BIT && EXPERIMENTAL
        select VIRTUALIZATION
        select VIRTIO
 -      select VIRTIO_RING
        select VIRTIO_CONSOLE
        help
 -        Select this option if you want to run the kernel as a guest under
 -        the KVM hypervisor. This will add detection for KVM as well  as a
 -        virtio transport. If KVM is detected, the virtio console will be
 -        the default console.
 -
 -config SECCOMP
 -      def_bool y
 -      prompt "Enable seccomp to safely compute untrusted bytecode"
 -      depends on PROC_FS
 -      help
 -        This kernel feature is useful for number crunching applications
 -        that may need to compute untrusted bytecode during their
 -        execution. By using pipes or other transports made available to
 -        the process as file descriptors supporting the read/write
 -        syscalls, it's possible to isolate those applications in
 -        their own address space using seccomp. Once seccomp is
 -        enabled via /proc/<pid>/seccomp, it cannot be disabled
 -        and the task is only allowed to execute a few safe syscalls
 -        defined by each seccomp mode.
 -
 -        If unsure, say Y.
 -
 -endmenu
 +        Enabling this option adds support for virtio based paravirtual device
 +        drivers on s390.
  
 -menu "Power Management"
 -
 -source "kernel/power/Kconfig"
 +        Select this option if you want to run the kernel as a guest under
 +        the KVM hypervisor.
  
  endmenu
 -
 -source "net/Kconfig"
 -
 -config PCMCIA
 -      def_bool n
 -
 -config CCW
 -      def_bool y
 -
 -source "drivers/Kconfig"
 -
 -source "fs/Kconfig"
 -
 -source "arch/s390/Kconfig.debug"
 -
 -source "security/Kconfig"
 -
 -source "crypto/Kconfig"
 -
 -source "lib/Kconfig"
 -
 -source "arch/s390/kvm/Kconfig"
diff --combined arch/score/Kconfig
@@@ -5,12 -5,13 +5,14 @@@ config SCOR
         select HAVE_GENERIC_HARDIRQS
         select GENERIC_IRQ_SHOW
         select GENERIC_IOMAP
 +       select GENERIC_ATOMIC64
         select HAVE_MEMBLOCK
         select HAVE_MEMBLOCK_NODE_MAP
         select ARCH_DISCARD_MEMBLOCK
         select GENERIC_CPU_DEVICES
         select GENERIC_CLOCKEVENTS
+        select HAVE_MOD_ARCH_SPECIFIC
+       select MODULES_USE_ELF_REL
  
  choice
        prompt "System type"
diff --combined arch/sh/Kconfig
@@@ -13,17 -13,14 +13,17 @@@ config SUPER
        select HAVE_DMA_ATTRS
        select HAVE_IRQ_WORK
        select HAVE_PERF_EVENTS
 +      select HAVE_DEBUG_BUGVERBOSE
        select ARCH_HAVE_CUSTOM_GPIO_H
        select ARCH_HAVE_NMI_SAFE_CMPXCHG if (GUSA_RB || CPU_SH4A)
        select PERF_USE_VMALLOC
 +      select HAVE_DEBUG_KMEMLEAK
        select HAVE_KERNEL_GZIP
        select HAVE_KERNEL_BZIP2
        select HAVE_KERNEL_LZMA
        select HAVE_KERNEL_XZ
        select HAVE_KERNEL_LZO
 +      select HAVE_UID16
        select ARCH_WANT_IPC_PARSE_VERSION
        select HAVE_SYSCALL_TRACEPOINTS
        select HAVE_REGS_AND_STACK_ACCESS_API
@@@ -38,6 -35,8 +38,8 @@@
        select GENERIC_CMOS_UPDATE if SH_SH03 || SH_DREAMCAST
        select GENERIC_STRNCPY_FROM_USER
        select GENERIC_STRNLEN_USER
+       select HAVE_MOD_ARCH_SPECIFIC if DWARF_UNWINDER
+       select MODULES_USE_ELF_RELA
        help
          The SuperH is a RISC processor targeted for use in embedded systems
          and consumer electronics; it was also used in the Sega Dreamcast
diff --combined arch/sparc/Kconfig
@@@ -18,7 -18,6 +18,7 @@@ config SPAR
        select HAVE_OPROFILE
        select HAVE_ARCH_KGDB if !SMP || SPARC64
        select HAVE_ARCH_TRACEHOOK
 +      select SYSCTL_EXCEPTION_TRACE
        select ARCH_WANT_OPTIONAL_GPIOLIB
        select RTC_CLASS
        select RTC_DRV_M48T59
        select GENERIC_PCI_IOMAP
        select HAVE_NMI_WATCHDOG if SPARC64
        select HAVE_BPF_JIT
 +      select HAVE_DEBUG_BUGVERBOSE
        select GENERIC_SMP_IDLE_THREAD
        select GENERIC_CMOS_UPDATE
        select GENERIC_CLOCKEVENTS
        select GENERIC_STRNCPY_FROM_USER
        select GENERIC_STRNLEN_USER
+       select MODULES_USE_ELF_RELA
  
  config SPARC32
        def_bool !64BIT
        select GENERIC_ATOMIC64
        select CLZ_TAB
 +      select HAVE_UID16
  
  config SPARC64
        def_bool 64BIT
@@@ -62,7 -60,6 +63,7 @@@
        select HAVE_DYNAMIC_FTRACE
        select HAVE_FTRACE_MCOUNT_RECORD
        select HAVE_SYSCALL_TRACEPOINTS
 +      select HAVE_DEBUG_KMEMLEAK
        select RTC_DRV_CMOS
        select RTC_DRV_BQ4802
        select RTC_DRV_SUN4V
@@@ -230,6 -227,25 +231,6 @@@ config EARLYF
        help
          Say Y here to enable a faster early framebuffer boot console.
  
 -choice
 -      prompt "Kernel page size" if SPARC64
 -      default SPARC64_PAGE_SIZE_8KB
 -
 -config SPARC64_PAGE_SIZE_8KB
 -      bool "8KB"
 -      help
 -        This lets you select the page size of the kernel.
 -
 -        8KB and 64KB work quite well, since SPARC ELF sections
 -        provide for up to 64KB alignment.
 -
 -        If you don't know what to do, choose 8KB.
 -
 -config SPARC64_PAGE_SIZE_64KB
 -      bool "64KB"
 -
 -endchoice
 -
  config SECCOMP
        bool "Enable seccomp to safely compute untrusted bytecode"
        depends on SPARC64 && PROC_FS
@@@ -301,6 -317,23 +302,6 @@@ config GENERIC_LOCKBREA
        default y
        depends on SPARC64 && SMP && PREEMPT
  
 -choice
 -      prompt "SPARC64 Huge TLB Page Size"
 -      depends on SPARC64 && HUGETLB_PAGE
 -      default HUGETLB_PAGE_SIZE_4MB
 -
 -config HUGETLB_PAGE_SIZE_4MB
 -      bool "4MB"
 -
 -config HUGETLB_PAGE_SIZE_512K
 -      bool "512K"
 -
 -config HUGETLB_PAGE_SIZE_64K
 -      depends on !SPARC64_PAGE_SIZE_64KB
 -      bool "64K"
 -
 -endchoice
 -
  config NUMA
        bool "NUMA support"
        depends on SPARC64 && SMP
@@@ -539,7 -572,6 +540,7 @@@ config COMPA
        depends on SPARC64
        default y
        select COMPAT_BINFMT_ELF
 +      select HAVE_UID16
        select ARCH_WANT_OLD_COMPAT_IPC
  
  config SYSVIPC_COMPAT
@@@ -1,10 -1,25 +1,11 @@@
  # User exported sparc header files
 -include include/asm-generic/Kbuild.asm
  
 -header-y += apc.h
 -header-y += asi.h
 -header-y += display7seg.h
 -header-y += envctrl.h
 -header-y += fbio.h
 -header-y += jsflash.h
 -header-y += openpromio.h
 -header-y += perfctr.h
 -header-y += psrcompat.h
 -header-y += psr.h
 -header-y += pstate.h
 -header-y += traps.h
 -header-y += uctx.h
 -header-y += utrap.h
 -header-y += watchdog.h
  
 +generic-y += clkdev.h
  generic-y += div64.h
 +generic-y += exec.h
  generic-y += local64.h
  generic-y += irq_regs.h
  generic-y += local.h
+ generic-y += module.h
  generic-y += word-at-a-time.h
diff --combined arch/tile/Kconfig
@@@ -7,19 -7,17 +7,20 @@@ config TIL
        select HAVE_DMA_API_DEBUG
        select HAVE_KVM if !TILEGX
        select GENERIC_FIND_FIRST_BIT
 +      select SYSCTL_EXCEPTION_TRACE
        select USE_GENERIC_SMP_HELPERS
        select CC_OPTIMIZE_FOR_SIZE
 +      select HAVE_DEBUG_KMEMLEAK
        select HAVE_GENERIC_HARDIRQS
        select GENERIC_IRQ_PROBE
        select GENERIC_PENDING_IRQ if SMP
        select GENERIC_IRQ_SHOW
 +      select HAVE_DEBUG_BUGVERBOSE
        select HAVE_SYSCALL_WRAPPERS if TILEGX
        select SYS_HYPERVISOR
        select ARCH_HAVE_NMI_SAFE_CMPXCHG
        select GENERIC_CLOCKEVENTS
+       select MODULES_USE_ELF_RELA
  
  # FIXME: investigate whether we need/want these options.
  #     select HAVE_IOREMAP_PROT
@@@ -415,6 -413,14 +416,6 @@@ config TILE_US
  config NEED_BOUNCE_POOL
        def_bool USB_OHCI_HCD
  
 -config HOTPLUG
 -      bool "Support for hot-pluggable devices"
 -      ---help---
 -        Say Y here if you want to plug devices into your computer while
 -        the system is running, and be able to use them quickly.  In many
 -        cases, the devices can likewise be unplugged at any time too.
 -        One well-known example of this is USB.
 -
  source "drivers/pci/hotplug/Kconfig"
  
  endmenu
diff --combined arch/unicore32/Kconfig
@@@ -6,7 -6,6 +6,7 @@@ config UNICORE3
        select HAVE_DMA_ATTRS
        select HAVE_KERNEL_GZIP
        select HAVE_KERNEL_BZIP2
 +      select GENERIC_ATOMIC64
        select HAVE_KERNEL_LZO
        select HAVE_KERNEL_LZMA
        select ARCH_HAVE_CUSTOM_GPIO_H
        select GENERIC_IRQ_SHOW
        select ARCH_WANT_FRAME_POINTERS
        select GENERIC_IOMAP
+       select MODULES_USE_ELF_REL
        help
          UniCore-32 is 32-bit Instruction Set Architecture,
          including a series of low-power-consumption RISC chip
          designs licensed by PKUnity Ltd.
          Please see web page at <http://www.pkunity.com/>.
  
 -config HAVE_PWM
 -      bool
 -
  config GENERIC_GPIO
        def_bool y
  
@@@ -103,8 -106,7 +104,8 @@@ config PUV3_DB091
  
  config PUV3_NB0916
        bool "NetBook board (0916)"
 -      select HAVE_PWM
 +      select PWM
 +      select PWM_PUV3
  
  config PUV3_SMW0919
        bool "Security Mini-Workstation board (0919)"
@@@ -218,6 -220,12 +219,6 @@@ config PUV3_GPI
        select GPIO_SYSFS if EXPERIMENTAL
        default y
  
 -config PUV3_PWM
 -      tristate
 -      default BACKLIGHT_PWM
 -      help
 -        Enable support for NB0916 PWM controllers
 -
  if PUV3_NB0916
  
  menu "PKUnity NetBook-0916 Features"
diff --combined arch/x86/Kconfig
@@@ -7,14 -7,11 +7,14 @@@ config 64BI
          Say no to build a 32-bit kernel - formerly known as i386
  
  config X86_32
 -      def_bool !64BIT
 +      def_bool y
 +      depends on !64BIT
        select CLKSRC_I8253
 +      select HAVE_UID16
  
  config X86_64
 -      def_bool 64BIT
 +      def_bool y
 +      depends on 64BIT
        select X86_DEV_DMA_OPS
  
  ### Arch settings
@@@ -39,7 -36,6 +39,7 @@@ config X8
        select HAVE_KRETPROBES
        select HAVE_OPTPROBES
        select HAVE_FTRACE_MCOUNT_RECORD
 +      select HAVE_FENTRY if X86_64
        select HAVE_C_RECORDMCOUNT
        select HAVE_DYNAMIC_FTRACE
        select HAVE_FUNCTION_TRACER
@@@ -47,7 -43,6 +47,7 @@@
        select HAVE_FUNCTION_GRAPH_FP_TEST
        select HAVE_FUNCTION_TRACE_MCOUNT_TEST
        select HAVE_SYSCALL_TRACEPOINTS
 +      select SYSCTL_EXCEPTION_TRACE
        select HAVE_KVM
        select HAVE_ARCH_KGDB
        select HAVE_ARCH_TRACEHOOK
@@@ -65,9 -60,6 +65,9 @@@
        select HAVE_MIXED_BREAKPOINTS_REGS
        select PERF_EVENTS
        select HAVE_PERF_EVENTS_NMI
 +      select HAVE_PERF_REGS
 +      select HAVE_PERF_USER_STACK_DUMP
 +      select HAVE_DEBUG_KMEMLEAK
        select ANON_INODES
        select HAVE_ALIGNED_STRUCT_PAGE if SLUB && !M386
        select HAVE_CMPXCHG_LOCAL if !M386
@@@ -88,7 -80,6 +88,7 @@@
        select IRQ_FORCED_THREADING
        select USE_GENERIC_SMP_HELPERS if SMP
        select HAVE_BPF_JIT if X86_64
 +      select HAVE_ARCH_TRANSPARENT_HUGEPAGE
        select CLKEVT_I8253
        select ARCH_HAVE_NMI_SAFE_CMPXCHG
        select GENERIC_IOMAP
        select KTIME_SCALAR if X86_32
        select GENERIC_STRNCPY_FROM_USER
        select GENERIC_STRNLEN_USER
 +      select HAVE_RCU_USER_QS if X86_64
 +      select HAVE_IRQ_TIME_ACCOUNTING
 +      select GENERIC_KERNEL_THREAD
 +      select GENERIC_KERNEL_EXECVE
+       select MODULES_USE_ELF_REL if X86_32
+       select MODULES_USE_ELF_RELA if X86_64
  
  config INSTRUCTION_DECODER
 -      def_bool (KPROBES || PERF_EVENTS || UPROBES)
 +      def_bool y
 +      depends on KPROBES || PERF_EVENTS || UPROBES
  
  config OUTPUT_FORMAT
        string
@@@ -141,15 -129,13 +143,15 @@@ config SBU
        bool
  
  config NEED_DMA_MAP_STATE
 -       def_bool (X86_64 || INTEL_IOMMU || DMA_API_DEBUG)
 +      def_bool y
 +      depends on X86_64 || INTEL_IOMMU || DMA_API_DEBUG
  
  config NEED_SG_DMA_LENGTH
        def_bool y
  
  config GENERIC_ISA_DMA
 -      def_bool ISA_DMA_API
 +      def_bool y
 +      depends on ISA_DMA_API
  
  config GENERIC_BUG
        def_bool y
@@@ -166,16 -152,13 +168,16 @@@ config GENERIC_GPI
        bool
  
  config ARCH_MAY_HAVE_PC_FDC
 -      def_bool ISA_DMA_API
 +      def_bool y
 +      depends on ISA_DMA_API
  
  config RWSEM_GENERIC_SPINLOCK
 -      def_bool !X86_XADD
 +      def_bool y
 +      depends on !X86_XADD
  
  config RWSEM_XCHGADD_ALGORITHM
 -      def_bool X86_XADD
 +      def_bool y
 +      depends on X86_XADD
  
  config GENERIC_CALIBRATE_DELAY
        def_bool y
@@@ -592,18 -575,23 +594,18 @@@ config PARAVIRT_TIME_ACCOUNTIN
  
  source "arch/x86/xen/Kconfig"
  
 -config KVM_CLOCK
 -      bool "KVM paravirtualized clock"
 -      select PARAVIRT
 -      select PARAVIRT_CLOCK
 -      ---help---
 -        Turning on this option will allow you to run a paravirtualized clock
 -        when running over the KVM hypervisor. Instead of relying on a PIT
 -        (or probably other) emulation by the underlying device model, the host
 -        provides the guest with timing infrastructure such as time of day, and
 -        system time
 -
  config KVM_GUEST
 -      bool "KVM Guest support"
 +      bool "KVM Guest support (including kvmclock)"
 +      select PARAVIRT
        select PARAVIRT
 +      select PARAVIRT_CLOCK
 +      default y if PARAVIRT_GUEST
        ---help---
          This option enables various optimizations for running under the KVM
 -        hypervisor.
 +        hypervisor. It includes a paravirtualized clock, so that instead
 +        of relying on a PIT (or probably other) emulation by the
 +        underlying device model, the host provides the guest with
 +        timing infrastructure such as time of day, and system time
  
  source "arch/x86/lguest/Kconfig"
  
@@@ -760,14 -748,13 +762,14 @@@ config SWIOTL
        def_bool y if X86_64
        ---help---
          Support for software bounce buffers used on x86-64 systems
 -        which don't have a hardware IOMMU (e.g. the current generation
 -        of Intel's x86-64 CPUs). Using this PCI devices which can only
 -        access 32-bits of memory can be used on systems with more than
 -        3 GB of memory. If unsure, say Y.
 +        which don't have a hardware IOMMU. Using this PCI devices
 +        which can only access 32-bits of memory can be used on systems
 +        with more than 3 GB of memory.
 +        If unsure, say Y.
  
  config IOMMU_HELPER
 -      def_bool (CALGARY_IOMMU || GART_IOMMU || SWIOTLB || AMD_IOMMU)
 +      def_bool y
 +      depends on CALGARY_IOMMU || GART_IOMMU || SWIOTLB || AMD_IOMMU
  
  config MAXSMP
        bool "Enable Maximum number of SMP Processors and NUMA Nodes"
@@@ -811,6 -798,17 +813,6 @@@ config SCHED_M
          making when dealing with multi-core CPU chips at a cost of slightly
          increased overhead in some places. If unsure say N here.
  
 -config IRQ_TIME_ACCOUNTING
 -      bool "Fine granularity task level IRQ time accounting"
 -      default n
 -      ---help---
 -        Select this option to enable fine granularity task irq time
 -        accounting. This is done by reading a timestamp on each
 -        transitions between softirq and hardirq state, so there can be a
 -        small performance impact.
 -
 -        If in doubt, say N here.
 -
  source "kernel/Kconfig.preempt"
  
  config X86_UP_APIC
@@@ -875,7 -873,6 +877,7 @@@ config X86_REROUTE_FOR_BROKEN_BOOT_IRQ
  
  config X86_MCE
        bool "Machine Check / overheating reporting"
 +      default y
        ---help---
          Machine Check support allows the processor to notify the
          kernel if it detects a problem (e.g. overheating, data corruption).
@@@ -987,25 -984,25 +989,25 @@@ config X86_REBOOTFIXUP
          Say N otherwise.
  
  config MICROCODE
 -      tristate "/dev/cpu/microcode - microcode support"
 +      tristate "CPU microcode loading support"
        select FW_LOADER
        ---help---
 +
          If you say Y here, you will be able to update the microcode on
          certain Intel and AMD processors. The Intel support is for the
 -        IA32 family, e.g. Pentium Pro, Pentium II, Pentium III,
 -        Pentium 4, Xeon etc. The AMD support is for family 0x10 and
 -        0x11 processors, e.g. Opteron, Phenom and Turion 64 Ultra.
 -        You will obviously need the actual microcode binary data itself
 -        which is not shipped with the Linux kernel.
 +        IA32 family, e.g. Pentium Pro, Pentium II, Pentium III, Pentium 4,
 +        Xeon etc. The AMD support is for families 0x10 and later. You will
 +        obviously need the actual microcode binary data itself which is not
 +        shipped with the Linux kernel.
  
          This option selects the general module only, you need to select
          at least one vendor specific module as well.
  
 -        To compile this driver as a module, choose M here: the
 -        module will be called microcode.
 +        To compile this driver as a module, choose M here: the module
 +        will be called microcode.
  
  config MICROCODE_INTEL
 -      bool "Intel microcode patch loading support"
 +      bool "Intel microcode loading support"
        depends on MICROCODE
        default MICROCODE
        select FW_LOADER
          <http://www.urbanmyth.org/microcode/>.
  
  config MICROCODE_AMD
 -      bool "AMD microcode patch loading support"
 +      bool "AMD microcode loading support"
        depends on MICROCODE
        select FW_LOADER
        ---help---
@@@ -1164,12 -1161,10 +1166,12 @@@ config X86_PA
          consumes more pagetable space per process.
  
  config ARCH_PHYS_ADDR_T_64BIT
 -      def_bool X86_64 || X86_PAE
 +      def_bool y
 +      depends on X86_64 || X86_PAE
  
  config ARCH_DMA_ADDR_T_64BIT
 -      def_bool X86_64 || HIGHMEM64G
 +      def_bool y
 +      depends on X86_64 || HIGHMEM64G
  
  config DIRECT_GBPAGES
        bool "Enable 1GB pages for kernel pagetables" if EXPERT
@@@ -1292,8 -1287,8 +1294,8 @@@ config ARCH_SELECT_MEMORY_MODE
        depends on ARCH_SPARSEMEM_ENABLE
  
  config ARCH_MEMORY_PROBE
 -      def_bool X86_64
 -      depends on MEMORY_HOTPLUG
 +      def_bool y
 +      depends on X86_64 && MEMORY_HOTPLUG
  
  config ARCH_PROC_KCORE_TEXT
        def_bool y
@@@ -1494,17 -1489,6 +1496,17 @@@ config ARCH_RANDO
          If supported, this is a high bandwidth, cryptographically
          secure hardware random number generator.
  
 +config X86_SMAP
 +      def_bool y
 +      prompt "Supervisor Mode Access Prevention" if EXPERT
 +      ---help---
 +        Supervisor Mode Access Prevention (SMAP) is a security
 +        feature in newer Intel processors.  There is a small
 +        performance cost if this enabled and turned on; there is
 +        also a small increase in the kernel size if this is enabled.
 +
 +        If unsure, say Y.
 +
  config EFI
        bool "EFI runtime service support"
        depends on ACPI
@@@ -1993,6 -1977,7 +1995,6 @@@ config PCI_MMCONFI
  
  config PCI_CNB20LE_QUIRK
        bool "Read CNB20LE Host Bridge Windows" if EXPERT
 -      default n
        depends on PCI && EXPERIMENTAL
        help
          Read the PCI windows out of the CNB20LE host bridge. This allows
@@@ -2174,7 -2159,6 +2176,7 @@@ config IA32_EMULATIO
        bool "IA32 Emulation"
        depends on X86_64
        select COMPAT_BINFMT_ELF
 +      select HAVE_UID16
        ---help---
          Include code to run legacy 32-bit programs under a
          64-bit kernel. You should likely turn this on, unless you're
@@@ -2204,18 -2188,18 +2206,18 @@@ config COMPA
        depends on IA32_EMULATION || X86_X32
        select ARCH_WANT_OLD_COMPAT_IPC
  
 +if COMPAT
  config COMPAT_FOR_U64_ALIGNMENT
 -      def_bool COMPAT
 -      depends on X86_64
 +      def_bool y
  
  config SYSVIPC_COMPAT
        def_bool y
 -      depends on COMPAT && SYSVIPC
 +      depends on SYSVIPC
  
  config KEYS_COMPAT
 -      bool
 -      depends on COMPAT && KEYS
 -      default y
 +      def_bool y
 +      depends on KEYS
 +endif
  
  endmenu
  
diff --combined arch/x86/um/Kconfig
@@@ -13,8 -13,6 +13,8 @@@ endmen
  config UML_X86
        def_bool y
        select GENERIC_FIND_FIRST_BIT
 +      select GENERIC_KERNEL_THREAD
 +      select GENERIC_KERNEL_EXECVE
  
  config 64BIT
        bool "64-bit kernel" if SUBARCH = "x86"
  config X86_32
        def_bool !64BIT
        select HAVE_AOUT
 +      select ARCH_WANT_IPC_PARSE_VERSION
+       select MODULES_USE_ELF_REL
  
  config X86_64
        def_bool 64BIT
+       select MODULES_USE_ELF_RELA
  
  config RWSEM_XCHGADD_ALGORITHM
        def_bool X86_XADD && 64BIT
diff --combined crypto/Kconfig
@@@ -336,15 -336,6 +336,15 @@@ config CRYPTO_CRC32C_INTE
          gain performance compared with software implementation.
          Module will be crc32c-intel.
  
 +config CRYPTO_CRC32C_SPARC64
 +      tristate "CRC32c CRC algorithm (SPARC64)"
 +      depends on SPARC64
 +      select CRYPTO_HASH
 +      select CRC32
 +      help
 +        CRC32c CRC algorithm implemented using sparc64 crypto instructions,
 +        when available.
 +
  config CRYPTO_GHASH
        tristate "GHASH digest algorithm"
        select CRYPTO_GF128MUL
@@@ -363,15 -354,6 +363,15 @@@ config CRYPTO_MD
        help
          MD5 message digest algorithm (RFC1321).
  
 +config CRYPTO_MD5_SPARC64
 +      tristate "MD5 digest algorithm (SPARC64)"
 +      depends on SPARC64
 +      select CRYPTO_MD5
 +      select CRYPTO_HASH
 +      help
 +        MD5 message digest algorithm (RFC1321) implemented
 +        using sparc64 crypto instructions, when available.
 +
  config CRYPTO_MICHAEL_MIC
        tristate "Michael MIC keyed digest algorithm"
        select CRYPTO_HASH
@@@ -451,24 -433,6 +451,24 @@@ config CRYPTO_SHA1_SSSE
          using Supplemental SSE3 (SSSE3) instructions or Advanced Vector
          Extensions (AVX), when available.
  
 +config CRYPTO_SHA1_SPARC64
 +      tristate "SHA1 digest algorithm (SPARC64)"
 +      depends on SPARC64
 +      select CRYPTO_SHA1
 +      select CRYPTO_HASH
 +      help
 +        SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2) implemented
 +        using sparc64 crypto instructions, when available.
 +
 +config CRYPTO_SHA1_ARM
 +      tristate "SHA1 digest algorithm (ARM-asm)"
 +      depends on ARM
 +      select CRYPTO_SHA1
 +      select CRYPTO_HASH
 +      help
 +        SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2) implemented
 +        using optimized ARM assembler.
 +
  config CRYPTO_SHA256
        tristate "SHA224 and SHA256 digest algorithm"
        select CRYPTO_HASH
          This code also includes SHA-224, a 224 bit hash with 112 bits
          of security against collision attacks.
  
 +config CRYPTO_SHA256_SPARC64
 +      tristate "SHA224 and SHA256 digest algorithm (SPARC64)"
 +      depends on SPARC64
 +      select CRYPTO_SHA256
 +      select CRYPTO_HASH
 +      help
 +        SHA-256 secure hash standard (DFIPS 180-2) implemented
 +        using sparc64 crypto instructions, when available.
 +
  config CRYPTO_SHA512
        tristate "SHA384 and SHA512 digest algorithms"
        select CRYPTO_HASH
          This code also includes SHA-384, a 384 bit hash with 192 bits
          of security against collision attacks.
  
 +config CRYPTO_SHA512_SPARC64
 +      tristate "SHA384 and SHA512 digest algorithm (SPARC64)"
 +      depends on SPARC64
 +      select CRYPTO_SHA512
 +      select CRYPTO_HASH
 +      help
 +        SHA-512 secure hash standard (DFIPS 180-2) implemented
 +        using sparc64 crypto instructions, when available.
 +
  config CRYPTO_TGR192
        tristate "Tiger digest algorithms"
        select CRYPTO_HASH
@@@ -618,8 -564,6 +618,8 @@@ config CRYPTO_AES_NI_INTE
        select CRYPTO_CRYPTD
        select CRYPTO_ABLK_HELPER_X86
        select CRYPTO_ALGAPI
 +      select CRYPTO_LRW
 +      select CRYPTO_XTS
        help
          Use Intel AES-NI instructions for AES algorithm.
  
          ECB, CBC, LRW, PCBC, XTS. The 64 bit version has additional
          acceleration for CTR.
  
 +config CRYPTO_AES_SPARC64
 +      tristate "AES cipher algorithms (SPARC64)"
 +      depends on SPARC64
 +      select CRYPTO_CRYPTD
 +      select CRYPTO_ALGAPI
 +      help
 +        Use SPARC64 crypto opcodes for AES algorithm.
 +
 +        AES cipher algorithms (FIPS-197). AES uses the Rijndael
 +        algorithm.
 +
 +        Rijndael appears to be consistently a very good performer in
 +        both hardware and software across a wide range of computing
 +        environments regardless of its use in feedback or non-feedback
 +        modes. Its key setup time is excellent, and its key agility is
 +        good. Rijndael's very low memory requirements make it very well
 +        suited for restricted-space environments, in which it also
 +        demonstrates excellent performance. Rijndael's operations are
 +        among the easiest to defend against power and timing attacks.
 +
 +        The AES specifies three key sizes: 128, 192 and 256 bits
 +
 +        See <http://csrc.nist.gov/encryption/aes/> for more information.
 +
 +        In addition to AES cipher algorithm support, the acceleration
 +        for some popular block cipher mode is supported too, including
 +        ECB and CBC.
 +
 +config CRYPTO_AES_ARM
 +      tristate "AES cipher algorithms (ARM-asm)"
 +      depends on ARM
 +      select CRYPTO_ALGAPI
 +      select CRYPTO_AES
 +      help
 +        Use optimized AES assembler routines for ARM platforms.
 +
 +        AES cipher algorithms (FIPS-197). AES uses the Rijndael
 +        algorithm.
 +
 +        Rijndael appears to be consistently a very good performer in
 +        both hardware and software across a wide range of computing
 +        environments regardless of its use in feedback or non-feedback
 +        modes. Its key setup time is excellent, and its key agility is
 +        good. Rijndael's very low memory requirements make it very well
 +        suited for restricted-space environments, in which it also
 +        demonstrates excellent performance. Rijndael's operations are
 +        among the easiest to defend against power and timing attacks.
 +
 +        The AES specifies three key sizes: 128, 192 and 256 bits
 +
 +        See <http://csrc.nist.gov/encryption/aes/> for more information.
 +
  config CRYPTO_ANUBIS
        tristate "Anubis cipher algorithm"
        select CRYPTO_ALGAPI
@@@ -793,22 -685,6 +793,22 @@@ config CRYPTO_CAMELLIA_X86_6
          See also:
          <https://info.isl.ntt.co.jp/crypt/eng/camellia/index_s.html>
  
 +config CRYPTO_CAMELLIA_SPARC64
 +      tristate "Camellia cipher algorithm (SPARC64)"
 +      depends on SPARC64
 +      depends on CRYPTO
 +      select CRYPTO_ALGAPI
 +      help
 +        Camellia cipher algorithm module (SPARC64).
 +
 +        Camellia is a symmetric key block cipher developed jointly
 +        at NTT and Mitsubishi Electric Corporation.
 +
 +        The Camellia specifies three key sizes: 128, 192 and 256 bits.
 +
 +        See also:
 +        <https://info.isl.ntt.co.jp/crypt/eng/camellia/index_s.html>
 +
  config CRYPTO_CAST5
        tristate "CAST5 (CAST-128) cipher algorithm"
        select CRYPTO_ALGAPI
          The CAST5 encryption algorithm (synonymous with CAST-128) is
          described in RFC2144.
  
 +config CRYPTO_CAST5_AVX_X86_64
 +      tristate "CAST5 (CAST-128) cipher algorithm (x86_64/AVX)"
 +      depends on X86 && 64BIT
 +      select CRYPTO_ALGAPI
 +      select CRYPTO_CRYPTD
 +      select CRYPTO_ABLK_HELPER_X86
 +      select CRYPTO_CAST5
 +      help
 +        The CAST5 encryption algorithm (synonymous with CAST-128) is
 +        described in RFC2144.
 +
 +        This module provides the Cast5 cipher algorithm that processes
 +        sixteen blocks parallel using the AVX instruction set.
 +
  config CRYPTO_CAST6
        tristate "CAST6 (CAST-256) cipher algorithm"
        select CRYPTO_ALGAPI
          The CAST6 encryption algorithm (synonymous with CAST-256) is
          described in RFC2612.
  
 +config CRYPTO_CAST6_AVX_X86_64
 +      tristate "CAST6 (CAST-256) cipher algorithm (x86_64/AVX)"
 +      depends on X86 && 64BIT
 +      select CRYPTO_ALGAPI
 +      select CRYPTO_CRYPTD
 +      select CRYPTO_ABLK_HELPER_X86
 +      select CRYPTO_GLUE_HELPER_X86
 +      select CRYPTO_CAST6
 +      select CRYPTO_LRW
 +      select CRYPTO_XTS
 +      help
 +        The CAST6 encryption algorithm (synonymous with CAST-256) is
 +        described in RFC2612.
 +
 +        This module provides the Cast6 cipher algorithm that processes
 +        eight blocks parallel using the AVX instruction set.
 +
  config CRYPTO_DES
        tristate "DES and Triple DES EDE cipher algorithms"
        select CRYPTO_ALGAPI
        help
          DES cipher algorithm (FIPS 46-2), and Triple DES EDE (FIPS 46-3).
  
 +config CRYPTO_DES_SPARC64
 +      tristate "DES and Triple DES EDE cipher algorithms (SPARC64)"
 +      depends on SPARC64
 +      select CRYPTO_ALGAPI
 +      select CRYPTO_DES
 +      help
 +        DES cipher algorithm (FIPS 46-2), and Triple DES EDE (FIPS 46-3),
 +        optimized using SPARC64 crypto opcodes.
 +
  config CRYPTO_FCRYPT
        tristate "FCrypt cipher algorithm"
        select CRYPTO_ALGAPI
@@@ -1171,15 -1007,6 +1171,15 @@@ config CRYPTO_LZ
        select LZO_DECOMPRESS
        help
          This is the LZO algorithm.
 +
 +config CRYPTO_842
 +      tristate "842 compression algorithm"
 +      depends on CRYPTO_DEV_NX_COMPRESS
 +      # 842 uses lzo if the hardware becomes unavailable
 +      select LZO_COMPRESS
 +      select LZO_DECOMPRESS
 +      help
 +        This is the 842 algorithm.
  
  comment "Random Number Generation"
  
@@@ -1216,5 -1043,6 +1216,6 @@@ config CRYPTO_USER_API_SKCIPHE
          key cipher algorithms.
  
  source "drivers/crypto/Kconfig"
+ source crypto/asymmetric_keys/Kconfig
  
  endif # if CRYPTO
diff --combined crypto/Makefile
@@@ -68,8 -68,8 +68,8 @@@ obj-$(CONFIG_CRYPTO_TWOFISH_COMMON) += 
  obj-$(CONFIG_CRYPTO_SERPENT) += serpent_generic.o
  obj-$(CONFIG_CRYPTO_AES) += aes_generic.o
  obj-$(CONFIG_CRYPTO_CAMELLIA) += camellia_generic.o
 -obj-$(CONFIG_CRYPTO_CAST5) += cast5.o
 -obj-$(CONFIG_CRYPTO_CAST6) += cast6.o
 +obj-$(CONFIG_CRYPTO_CAST5) += cast5_generic.o
 +obj-$(CONFIG_CRYPTO_CAST6) += cast6_generic.o
  obj-$(CONFIG_CRYPTO_ARC4) += arc4.o
  obj-$(CONFIG_CRYPTO_TEA) += tea.o
  obj-$(CONFIG_CRYPTO_KHAZAD) += khazad.o
@@@ -82,7 -82,6 +82,7 @@@ obj-$(CONFIG_CRYPTO_MICHAEL_MIC) += mic
  obj-$(CONFIG_CRYPTO_CRC32C) += crc32c.o
  obj-$(CONFIG_CRYPTO_AUTHENC) += authenc.o authencesn.o
  obj-$(CONFIG_CRYPTO_LZO) += lzo.o
 +obj-$(CONFIG_CRYPTO_842) += 842.o
  obj-$(CONFIG_CRYPTO_RNG2) += rng.o
  obj-$(CONFIG_CRYPTO_RNG2) += krng.o
  obj-$(CONFIG_CRYPTO_ANSI_CPRNG) += ansi_cprng.o
@@@ -97,3 -96,4 +97,4 @@@ obj-$(CONFIG_CRYPTO_USER_API_SKCIPHER) 
  #
  obj-$(CONFIG_XOR_BLOCKS) += xor.o
  obj-$(CONFIG_ASYNC_CORE) += async_tx/
+ obj-$(CONFIG_ASYMMETRIC_KEY_TYPE) += asymmetric_keys/
diff --combined fs/cifs/cifsacl.c
@@@ -167,17 -167,17 +167,17 @@@ static struct shrinker cifs_shrinker = 
  };
  
  static int
- cifs_idmap_key_instantiate(struct key *key, const void *data, size_t datalen)
+ cifs_idmap_key_instantiate(struct key *key, struct key_preparsed_payload *prep)
  {
        char *payload;
  
-       payload = kmalloc(datalen, GFP_KERNEL);
+       payload = kmalloc(prep->datalen, GFP_KERNEL);
        if (!payload)
                return -ENOMEM;
  
-       memcpy(payload, data, datalen);
+       memcpy(payload, prep->data, prep->datalen);
        key->payload.data = payload;
-       key->datalen = datalen;
+       key->datalen = prep->datalen;
        return 0;
  }
  
@@@ -1222,7 -1222,7 +1222,7 @@@ struct cifs_ntsd *get_cifs_acl(struct c
        if (!open_file)
                return get_cifs_acl_by_path(cifs_sb, path, pacllen);
  
 -      pntsd = get_cifs_acl_by_fid(cifs_sb, open_file->netfid, pacllen);
 +      pntsd = get_cifs_acl_by_fid(cifs_sb, open_file->fid.netfid, pacllen);
        cifsFileInfo_put(open_file);
        return pntsd;
  }
diff --combined init/Kconfig
@@@ -267,106 -267,6 +267,106 @@@ config POSIX_MQUEUE_SYSCT
        depends on SYSCTL
        default y
  
 +config FHANDLE
 +      bool "open by fhandle syscalls"
 +      select EXPORTFS
 +      help
 +        If you say Y here, a user level program will be able to map
 +        file names to handle and then later use the handle for
 +        different file system operations. This is useful in implementing
 +        userspace file servers, which now track files using handles instead
 +        of names. The handle would remain the same even if file names
 +        get renamed. Enables open_by_handle_at(2) and name_to_handle_at(2)
 +        syscalls.
 +
 +config AUDIT
 +      bool "Auditing support"
 +      depends on NET
 +      help
 +        Enable auditing infrastructure that can be used with another
 +        kernel subsystem, such as SELinux (which requires this for
 +        logging of avc messages output).  Does not do system-call
 +        auditing without CONFIG_AUDITSYSCALL.
 +
 +config AUDITSYSCALL
 +      bool "Enable system-call auditing support"
 +      depends on AUDIT && (X86 || PPC || S390 || IA64 || UML || SPARC64 || SUPERH || (ARM && AEABI && !OABI_COMPAT))
 +      default y if SECURITY_SELINUX
 +      help
 +        Enable low-overhead system-call auditing infrastructure that
 +        can be used independently or with another kernel subsystem,
 +        such as SELinux.
 +
 +config AUDIT_WATCH
 +      def_bool y
 +      depends on AUDITSYSCALL
 +      select FSNOTIFY
 +
 +config AUDIT_TREE
 +      def_bool y
 +      depends on AUDITSYSCALL
 +      select FSNOTIFY
 +
 +config AUDIT_LOGINUID_IMMUTABLE
 +      bool "Make audit loginuid immutable"
 +      depends on AUDIT
 +      help
 +        The config option toggles if a task setting its loginuid requires
 +        CAP_SYS_AUDITCONTROL or if that task should require no special permissions
 +        but should instead only allow setting its loginuid if it was never
 +        previously set.  On systems which use systemd or a similar central
 +        process to restart login services this should be set to true.  On older
 +        systems in which an admin would typically have to directly stop and
 +        start processes this should be set to false.  Setting this to true allows
 +        one to drop potentially dangerous capabilites from the login tasks,
 +        but may not be backwards compatible with older init systems.
 +
 +source "kernel/irq/Kconfig"
 +source "kernel/time/Kconfig"
 +
 +menu "CPU/Task time and stats accounting"
 +
 +choice
 +      prompt "Cputime accounting"
 +      default TICK_CPU_ACCOUNTING if !PPC64
 +      default VIRT_CPU_ACCOUNTING if PPC64
 +
 +# Kind of a stub config for the pure tick based cputime accounting
 +config TICK_CPU_ACCOUNTING
 +      bool "Simple tick based cputime accounting"
 +      depends on !S390
 +      help
 +        This is the basic tick based cputime accounting that maintains
 +        statistics about user, system and idle time spent on per jiffies
 +        granularity.
 +
 +        If unsure, say Y.
 +
 +config VIRT_CPU_ACCOUNTING
 +      bool "Deterministic task and CPU time accounting"
 +      depends on HAVE_VIRT_CPU_ACCOUNTING
 +      help
 +        Select this option to enable more accurate task and CPU time
 +        accounting.  This is done by reading a CPU counter on each
 +        kernel entry and exit and on transitions within the kernel
 +        between system, softirq and hardirq state, so there is a
 +        small performance impact.  In the case of s390 or IBM POWER > 5,
 +        this also enables accounting of stolen time on logically-partitioned
 +        systems.
 +
 +config IRQ_TIME_ACCOUNTING
 +      bool "Fine granularity task level IRQ time accounting"
 +      depends on HAVE_IRQ_TIME_ACCOUNTING
 +      help
 +        Select this option to enable fine granularity task irq time
 +        accounting. This is done by reading a timestamp on each
 +        transitions between softirq and hardirq state, so there can be a
 +        small performance impact.
 +
 +        If in doubt, say N here.
 +
 +endchoice
 +
  config BSD_PROCESS_ACCT
        bool "BSD Process Accounting"
        help
@@@ -392,6 -292,18 +392,6 @@@ config BSD_PROCESS_ACCT_V
          for processing it. A preliminary version of these tools is available
          at <http://www.gnu.org/software/acct/>.
  
 -config FHANDLE
 -      bool "open by fhandle syscalls"
 -      select EXPORTFS
 -      help
 -        If you say Y here, a user level program will be able to map
 -        file names to handle and then later use the handle for
 -        different file system operations. This is useful in implementing
 -        userspace file servers, which now track files using handles instead
 -        of names. The handle would remain the same even if file names
 -        get renamed. Enables open_by_handle_at(2) and name_to_handle_at(2)
 -        syscalls.
 -
  config TASKSTATS
        bool "Export task/process statistics through netlink (EXPERIMENTAL)"
        depends on NET
@@@ -434,7 -346,50 +434,7 @@@ config TASK_IO_ACCOUNTIN
  
          Say N if unsure.
  
 -config AUDIT
 -      bool "Auditing support"
 -      depends on NET
 -      help
 -        Enable auditing infrastructure that can be used with another
 -        kernel subsystem, such as SELinux (which requires this for
 -        logging of avc messages output).  Does not do system-call
 -        auditing without CONFIG_AUDITSYSCALL.
 -
 -config AUDITSYSCALL
 -      bool "Enable system-call auditing support"
 -      depends on AUDIT && (X86 || PPC || S390 || IA64 || UML || SPARC64 || SUPERH || (ARM && AEABI && !OABI_COMPAT))
 -      default y if SECURITY_SELINUX
 -      help
 -        Enable low-overhead system-call auditing infrastructure that
 -        can be used independently or with another kernel subsystem,
 -        such as SELinux.
 -
 -config AUDIT_WATCH
 -      def_bool y
 -      depends on AUDITSYSCALL
 -      select FSNOTIFY
 -
 -config AUDIT_TREE
 -      def_bool y
 -      depends on AUDITSYSCALL
 -      select FSNOTIFY
 -
 -config AUDIT_LOGINUID_IMMUTABLE
 -      bool "Make audit loginuid immutable"
 -      depends on AUDIT
 -      help
 -        The config option toggles if a task setting its loginuid requires
 -        CAP_SYS_AUDITCONTROL or if that task should require no special permissions
 -        but should instead only allow setting its loginuid if it was never
 -        previously set.  On systems which use systemd or a similar central
 -        process to restart login services this should be set to true.  On older
 -        systems in which an admin would typically have to directly stop and
 -        start processes this should be set to false.  Setting this to true allows
 -        one to drop potentially dangerous capabilites from the login tasks,
 -        but may not be backwards compatible with older init systems.
 -
 -source "kernel/irq/Kconfig"
 -source "kernel/time/Kconfig"
 +endmenu # "CPU/Task time and stats accounting"
  
  menu "RCU Subsystem"
  
@@@ -486,36 -441,6 +486,36 @@@ config PREEMPT_RC
          This option enables preemptible-RCU code that is common between
          the TREE_PREEMPT_RCU and TINY_PREEMPT_RCU implementations.
  
 +config RCU_USER_QS
 +      bool "Consider userspace as in RCU extended quiescent state"
 +      depends on HAVE_RCU_USER_QS && SMP
 +      help
 +        This option sets hooks on kernel / userspace boundaries and
 +        puts RCU in extended quiescent state when the CPU runs in
 +        userspace. It means that when a CPU runs in userspace, it is
 +        excluded from the global RCU state machine and thus doesn't
 +        to keep the timer tick on for RCU.
 +
 +        Unless you want to hack and help the development of the full
 +        tickless feature, you shouldn't enable this option. It adds
 +        unnecessary overhead.
 +
 +        If unsure say N
 +
 +config RCU_USER_QS_FORCE
 +      bool "Force userspace extended QS by default"
 +      depends on RCU_USER_QS
 +      help
 +        Set the hooks in user/kernel boundaries by default in order to
 +        test this feature that treats userspace as an extended quiescent
 +        state until we have a real user like a full adaptive nohz option.
 +
 +        Unless you want to hack and help the development of the full
 +        tickless feature, you shouldn't enable this option. It adds
 +        unnecessary overhead.
 +
 +        If unsure say N
 +
  config RCU_FANOUT
        int "Tree-based hierarchical RCU fanout value"
        range 2 64 if 64BIT
@@@ -998,24 -923,113 +998,24 @@@ config UIDGID_CONVERTE
        bool
        default y
  
 -      # List of kernel pieces that need user namespace work
 -      # Features
 -      depends on SYSVIPC = n
 -      depends on IMA = n
 -      depends on EVM = n
 -      depends on KEYS = n
 -      depends on AUDIT = n
 -      depends on AUDITSYSCALL = n
 -      depends on TASKSTATS = n
 -      depends on TRACING = n
 -      depends on FS_POSIX_ACL = n
 -      depends on QUOTA = n
 -      depends on QUOTACTL = n
 -      depends on DEBUG_CREDENTIALS = n
 -      depends on BSD_PROCESS_ACCT = n
 -      depends on DRM = n
 -      depends on PROC_EVENTS = n
 -
        # Networking
 -      depends on NET = n
        depends on NET_9P = n
 -      depends on IPX = n
 -      depends on PHONET = n
 -      depends on NET_CLS_FLOW = n
 -      depends on NETFILTER_XT_MATCH_OWNER = n
 -      depends on NETFILTER_XT_MATCH_RECENT = n
 -      depends on NETFILTER_XT_TARGET_LOG = n
 -      depends on NETFILTER_NETLINK_LOG = n
 -      depends on INET = n
 -      depends on IPV6 = n
 -      depends on IP_SCTP = n
 -      depends on AF_RXRPC = n
 -      depends on LLC2 = n
 -      depends on NET_KEY = n
 -      depends on INET_DIAG = n
 -      depends on DNS_RESOLVER = n
 -      depends on AX25 = n
 -      depends on ATALK = n
  
        # Filesystems
 -      depends on USB_DEVICEFS = n
 -      depends on USB_GADGETFS = n
 -      depends on USB_FUNCTIONFS = n
 -      depends on DEVTMPFS = n
 -      depends on XENFS = n
 -
        depends on 9P_FS = n
 -      depends on ADFS_FS = n
 -      depends on AFFS_FS = n
        depends on AFS_FS = n
        depends on AUTOFS4_FS = n
 -      depends on BEFS_FS = n
 -      depends on BFS_FS = n
 -      depends on BTRFS_FS = n
        depends on CEPH_FS = n
        depends on CIFS = n
        depends on CODA_FS = n
 -      depends on CONFIGFS_FS = n
 -      depends on CRAMFS = n
 -      depends on DEBUG_FS = n
 -      depends on ECRYPT_FS = n
 -      depends on EFS_FS = n
 -      depends on EXOFS_FS = n
 -      depends on FAT_FS = n
        depends on FUSE_FS = n
        depends on GFS2_FS = n
 -      depends on HFS_FS = n
 -      depends on HFSPLUS_FS = n
 -      depends on HPFS_FS = n
 -      depends on HUGETLBFS = n
 -      depends on ISO9660_FS = n
 -      depends on JFFS2_FS = n
 -      depends on JFS_FS = n
 -      depends on LOGFS = n
 -      depends on MINIX_FS = n
        depends on NCP_FS = n
        depends on NFSD = n
        depends on NFS_FS = n
 -      depends on NILFS2_FS = n
 -      depends on NTFS_FS = n
        depends on OCFS2_FS = n
 -      depends on OMFS_FS = n
 -      depends on QNX4FS_FS = n
 -      depends on QNX6FS_FS = n
 -      depends on REISERFS_FS = n
 -      depends on SQUASHFS = n
 -      depends on SYSV_FS = n
 -      depends on UBIFS_FS = n
 -      depends on UDF_FS = n
 -      depends on UFS_FS = n
 -      depends on VXFS_FS = n
        depends on XFS_FS = n
  
 -      depends on !UML || HOSTFS = n
 -
 -      # The rare drivers that won't build
 -      depends on AIRO = n
 -      depends on AIRO_CS = n
 -      depends on TUN = n
 -      depends on INFINIBAND_QIB = n
 -      depends on BLK_DEV_LOOP = n
 -      depends on ANDROID_BINDER_IPC = n
 -
 -      # Security modules
 -      depends on SECURITY_TOMOYO = n
 -      depends on SECURITY_APPARMOR = n
 -
  config UIDGID_STRICT_TYPE_CHECKS
        bool "Require conversions between uid/gids and their internal representation"
        depends on UIDGID_CONVERTED
@@@ -1137,12 -1151,9 +1137,12 @@@ menuconfig EXPER
            environments which can tolerate a "non-standard" kernel.
            Only use this if you really know what you are doing.
  
 +config HAVE_UID16
 +      bool
 +
  config UID16
        bool "Enable 16-bit UID system calls" if EXPERT
 -      depends on ARM || BLACKFIN || CRIS || FRV || H8300 || X86_32 || M68K || (S390 && !64BIT) || SUPERH || SPARC32 || (SPARC64 && COMPAT) || UML || (X86_64 && IA32_EMULATION)
 +      depends on HAVE_UID16
        default y
        help
          This enables the legacy 16-bit UID syscall wrappers.
@@@ -1164,11 -1175,6 +1164,11 @@@ config SYSCTL_SYSCAL
  
          If unsure say N here.
  
 +config SYSCTL_EXCEPTION_TRACE
 +      bool
 +      help
 +        Enable support for /proc/sys/debug/exception-trace.
 +
  config KALLSYMS
         bool "Load all symbols for debugging/ksymoops" if EXPERT
         default y
@@@ -1195,7 -1201,13 +1195,7 @@@ config KALLSYMS_AL
           Say N unless you really need all symbols.
  
  config HOTPLUG
 -      bool "Support for hot-pluggable devices" if EXPERT
 -      default y
 -      help
 -        This option is provided for the case where no hotplug or uevent
 -        capabilities is wanted by the kernel.  You should only consider
 -        disabling this option for embedded systems that do not use modules, a
 -        dynamic /dev tree, or dynamic device discovery.  Just say Y.
 +      def_bool y
  
  config PRINTK
        default y
@@@ -1218,7 -1230,6 +1218,7 @@@ config BU
            Just say Y.
  
  config ELF_CORE
 +      depends on COREDUMP
        default y
        bool "Enable ELF core dumps" if EXPERT
        help
@@@ -1574,6 -1585,66 +1574,66 @@@ config MODULE_SRCVERSION_AL
          the version).  With this option, such a "srcversion" field
          will be created for all modules.  If unsure, say N.
  
+ config MODULE_SIG
+       bool "Module signature verification"
+       depends on MODULES
+       select KEYS
+       select CRYPTO
+       select ASYMMETRIC_KEY_TYPE
+       select ASYMMETRIC_PUBLIC_KEY_SUBTYPE
+       select PUBLIC_KEY_ALGO_RSA
+       select ASN1
+       select OID_REGISTRY
+       select X509_CERTIFICATE_PARSER
+       help
+         Check modules for valid signatures upon load: the signature
+         is simply appended to the module. For more information see
+         Documentation/module-signing.txt.
+         !!!WARNING!!!  If you enable this option, you MUST make sure that the
+         module DOES NOT get stripped after being signed.  This includes the
+         debuginfo strip done by some packagers (such as rpmbuild) and
+         inclusion into an initramfs that wants the module size reduced.
+ config MODULE_SIG_FORCE
+       bool "Require modules to be validly signed"
+       depends on MODULE_SIG
+       help
+         Reject unsigned modules or signed modules for which we don't have a
+         key.  Without this, such modules will simply taint the kernel.
+ choice
+       prompt "Which hash algorithm should modules be signed with?"
+       depends on MODULE_SIG
+       help
+         This determines which sort of hashing algorithm will be used during
+         signature generation.  This algorithm _must_ be built into the kernel
+         directly so that signature verification can take place.  It is not
+         possible to load a signed module containing the algorithm to check
+         the signature on that module.
+ config MODULE_SIG_SHA1
+       bool "Sign modules with SHA-1"
+       select CRYPTO_SHA1
+ config MODULE_SIG_SHA224
+       bool "Sign modules with SHA-224"
+       select CRYPTO_SHA256
+ config MODULE_SIG_SHA256
+       bool "Sign modules with SHA-256"
+       select CRYPTO_SHA256
+ config MODULE_SIG_SHA384
+       bool "Sign modules with SHA-384"
+       select CRYPTO_SHA512
+ config MODULE_SIG_SHA512
+       bool "Sign modules with SHA-512"
+       select CRYPTO_SHA512
+ endchoice
  endif # MODULES
  
  config INIT_ALL_POSSIBLE
@@@ -1601,10 -1672,12 +1661,18 @@@ config PADAT
        depends on SMP
        bool
  
 +# Can be selected by architectures with broken toolchains
 +# that get confused by correct const<->read_only section
 +# mappings
 +config BROKEN_RODATA
 +      bool
 +
+ config ASN1
+       tristate
+       help
+         Build a simple ASN.1 grammar compiler that produces a bytecode output
+         that can be interpreted by the ASN.1 stream decoder and used to
+         inform it as to what tags are to be expected in a stream and what
+         functions to call on what tags.
  source "kernel/Kconfig.locks"
diff --combined kernel/Makefile
@@@ -10,7 -10,7 +10,7 @@@ obj-y     = fork.o exec_domain.o panic.
            kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \
            hrtimer.o rwsem.o nsproxy.o srcu.o semaphore.o \
            notifier.o ksysfs.o cred.o \
 -          async.o range.o groups.o lglock.o
 +          async.o range.o groups.o lglock.o smpboot.o
  
  ifdef CONFIG_FUNCTION_TRACER
  # Do not trace debug files and internal ftrace files
@@@ -46,6 -46,7 +46,6 @@@ obj-$(CONFIG_DEBUG_RT_MUTEXES) += rtmut
  obj-$(CONFIG_RT_MUTEX_TESTER) += rtmutex-tester.o
  obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o
  obj-$(CONFIG_SMP) += smp.o
 -obj-$(CONFIG_SMP) += smpboot.o
  ifneq ($(CONFIG_SMP),y)
  obj-y += up.o
  endif
@@@ -54,6 -55,7 +54,7 @@@ obj-$(CONFIG_DEBUG_SPINLOCK) += spinloc
  obj-$(CONFIG_PROVE_LOCKING) += spinlock.o
  obj-$(CONFIG_UID16) += uid16.o
  obj-$(CONFIG_MODULES) += module.o
+ obj-$(CONFIG_MODULE_SIG) += module_signing.o modsign_pubkey.o
  obj-$(CONFIG_KALLSYMS) += kallsyms.o
  obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o
  obj-$(CONFIG_KEXEC) += kexec.o
@@@ -97,7 -99,7 +98,7 @@@ obj-$(CONFIG_COMPAT_BINFMT_ELF) += elfc
  obj-$(CONFIG_BINFMT_ELF_FDPIC) += elfcore.o
  obj-$(CONFIG_FUNCTION_TRACER) += trace/
  obj-$(CONFIG_TRACING) += trace/
 -obj-$(CONFIG_X86_DS) += trace/
 +obj-$(CONFIG_TRACE_CLOCK) += trace/
  obj-$(CONFIG_RING_BUFFER) += trace/
  obj-$(CONFIG_TRACEPOINTS) += trace/
  obj-$(CONFIG_IRQ_WORK) += irq_work.o
@@@ -130,3 -132,79 +131,79 @@@ quiet_cmd_timeconst  = TIMEC   $
  targets += timeconst.h
  $(obj)/timeconst.h: $(src)/timeconst.pl FORCE
        $(call if_changed,timeconst)
+ ifeq ($(CONFIG_MODULE_SIG),y)
+ #
+ # Pull the signing certificate and any extra certificates into the kernel
+ #
+ extra_certificates:
+       touch $@
+ kernel/modsign_pubkey.o: signing_key.x509 extra_certificates
+ ###############################################################################
+ #
+ # If module signing is requested, say by allyesconfig, but a key has not been
+ # supplied, then one will need to be generated to make sure the build does not
+ # fail and that the kernel may be used afterwards.
+ #
+ ###############################################################################
+ sign_key_with_hash :=
+ ifeq ($(CONFIG_MODULE_SIG_SHA1),y)
+ sign_key_with_hash := -sha1
+ endif
+ ifeq ($(CONFIG_MODULE_SIG_SHA224),y)
+ sign_key_with_hash := -sha224
+ endif
+ ifeq ($(CONFIG_MODULE_SIG_SHA256),y)
+ sign_key_with_hash := -sha256
+ endif
+ ifeq ($(CONFIG_MODULE_SIG_SHA384),y)
+ sign_key_with_hash := -sha384
+ endif
+ ifeq ($(CONFIG_MODULE_SIG_SHA512),y)
+ sign_key_with_hash := -sha512
+ endif
+ ifeq ($(sign_key_with_hash),)
+ $(error Could not determine digest type to use from kernel config)
+ endif
+ signing_key.priv signing_key.x509: x509.genkey
+       @echo "###"
+       @echo "### Now generating an X.509 key pair to be used for signing modules."
+       @echo "###"
+       @echo "### If this takes a long time, you might wish to run rngd in the"
+       @echo "### background to keep the supply of entropy topped up.  It"
+       @echo "### needs to be run as root, and should use a hardware random"
+       @echo "### number generator if one is available, eg:"
+       @echo "###"
+       @echo "###     rngd -r /dev/hwrandom"
+       @echo "###"
+       openssl req -new -nodes -utf8 $(sign_key_with_hash) -days 36500 -batch \
+               -x509 -config x509.genkey \
+               -outform DER -out signing_key.x509 \
+               -keyout signing_key.priv
+       @echo "###"
+       @echo "### Key pair generated."
+       @echo "###"
+ x509.genkey:
+       @echo Generating X.509 key generation config
+       @echo  >x509.genkey "[ req ]"
+       @echo >>x509.genkey "default_bits = 4096"
+       @echo >>x509.genkey "distinguished_name = req_distinguished_name"
+       @echo >>x509.genkey "prompt = no"
+       @echo >>x509.genkey "string_mask = utf8only"
+       @echo >>x509.genkey "x509_extensions = myexts"
+       @echo >>x509.genkey
+       @echo >>x509.genkey "[ req_distinguished_name ]"
+       @echo >>x509.genkey "O = Magrathea"
+       @echo >>x509.genkey "CN = Glacier signing key"
+       @echo >>x509.genkey "emailAddress = slartibartfast@magrathea.h2g2"
+       @echo >>x509.genkey
+       @echo >>x509.genkey "[ myexts ]"
+       @echo >>x509.genkey "basicConstraints=critical,CA:FALSE"
+       @echo >>x509.genkey "keyUsage=digitalSignature"
+       @echo >>x509.genkey "subjectKeyIdentifier=hash"
+       @echo >>x509.genkey "authorityKeyIdentifier=keyid"
+ endif
diff --combined lib/Makefile
@@@ -9,7 -9,7 +9,7 @@@ endi
  
  lib-y := ctype.o string.o vsprintf.o cmdline.o \
         rbtree.o radix-tree.o dump_stack.o timerqueue.o\
 -       idr.o int_sqrt.o extable.o prio_tree.o \
 +       idr.o int_sqrt.o extable.o \
         sha1.o md5.o irq_regs.o reciprocal_div.o argv_split.o \
         proportions.o flex_proportions.o prio_heap.o ratelimit.o show_mem.o \
         is_single_threaded.o plist.o decompress.o
@@@ -140,11 -140,8 +140,13 @@@ $(foreach file, $(libfdt_files), 
        $(eval CFLAGS_$(file) = -I$(src)/../scripts/dtc/libfdt))
  lib-$(CONFIG_LIBFDT) += $(libfdt_files)
  
 +obj-$(CONFIG_RBTREE_TEST) += rbtree_test.o
 +obj-$(CONFIG_INTERVAL_TREE_TEST) += interval_tree_test.o
 +
 +interval_tree_test-objs := interval_tree_test_main.o interval_tree.o
 +
+ obj-$(CONFIG_ASN1) += asn1_decoder.o
  hostprogs-y   := gen_crc32table
  clean-files   := crc32table.h
  
@@@ -155,3 -152,19 +157,19 @@@ quiet_cmd_crc32 = GEN     $
  
  $(obj)/crc32table.h: $(obj)/gen_crc32table
        $(call cmd,crc32)
+ #
+ # Build a fast OID lookip registry from include/linux/oid_registry.h
+ #
+ obj-$(CONFIG_OID_REGISTRY) += oid_registry.o
+ $(obj)/oid_registry.c: $(obj)/oid_registry_data.c
+ $(obj)/oid_registry_data.c: $(srctree)/include/linux/oid_registry.h \
+                           $(src)/build_OID_registry
+       $(call cmd,build_OID_registry)
+ quiet_cmd_build_OID_registry = GEN     $@
+       cmd_build_OID_registry = perl $(srctree)/$(src)/build_OID_registry $< $@
+ clean-files   += oid_registry_data.c
@@@ -59,13 -59,13 +59,13 @@@ const struct cred *dns_resolver_cache
   *        "ip1,ip2,...#foo=bar"
   */
  static int
- dns_resolver_instantiate(struct key *key, const void *_data, size_t datalen)
+ dns_resolver_instantiate(struct key *key, struct key_preparsed_payload *prep)
  {
        struct user_key_payload *upayload;
        unsigned long derrno;
        int ret;
-       size_t result_len = 0;
-       const char *data = _data, *end, *opt;
+       size_t datalen = prep->datalen, result_len = 0;
+       const char *data = prep->data, *end, *opt;
  
        kenter("%%%d,%s,'%*.*s',%zu",
               key->serial, key->description,
@@@ -259,8 -259,7 +259,8 @@@ static int __init init_dns_resolver(voi
        if (!cred)
                return -ENOMEM;
  
 -      keyring = key_alloc(&key_type_keyring, ".dns_resolver", 0, 0, cred,
 +      keyring = key_alloc(&key_type_keyring, ".dns_resolver",
 +                          GLOBAL_ROOT_UID, GLOBAL_ROOT_GID, cred,
                            (KEY_POS_ALL & ~KEY_POS_SETATTR) |
                            KEY_USR_VIEW | KEY_USR_READ,
                            KEY_ALLOC_NOT_IN_QUOTA);
diff --combined net/rxrpc/ar-key.c
@@@ -26,8 -26,8 +26,8 @@@
  #include "ar-internal.h"
  
  static int rxrpc_vet_description_s(const char *);
- static int rxrpc_instantiate(struct key *, const void *, size_t);
- static int rxrpc_instantiate_s(struct key *, const void *, size_t);
+ static int rxrpc_instantiate(struct key *, struct key_preparsed_payload *);
+ static int rxrpc_instantiate_s(struct key *, struct key_preparsed_payload *);
  static void rxrpc_destroy(struct key *);
  static void rxrpc_destroy_s(struct key *);
  static void rxrpc_describe(const struct key *, struct seq_file *);
@@@ -678,7 -678,7 +678,7 @@@ error
   *
   * if no data is provided, then a no-security key is made
   */
- static int rxrpc_instantiate(struct key *key, const void *data, size_t datalen)
+ static int rxrpc_instantiate(struct key *key, struct key_preparsed_payload *prep)
  {
        const struct rxrpc_key_data_v1 *v1;
        struct rxrpc_key_token *token, **pp;
        u32 kver;
        int ret;
  
-       _enter("{%x},,%zu", key_serial(key), datalen);
+       _enter("{%x},,%zu", key_serial(key), prep->datalen);
  
        /* handle a no-security key */
-       if (!data && datalen == 0)
+       if (!prep->data && prep->datalen == 0)
                return 0;
  
        /* determine if the XDR payload format is being used */
-       if (datalen > 7 * 4) {
-               ret = rxrpc_instantiate_xdr(key, data, datalen);
+       if (prep->datalen > 7 * 4) {
+               ret = rxrpc_instantiate_xdr(key, prep->data, prep->datalen);
                if (ret != -EPROTO)
                        return ret;
        }
  
        /* get the key interface version number */
        ret = -EINVAL;
-       if (datalen <= 4 || !data)
+       if (prep->datalen <= 4 || !prep->data)
                goto error;
-       memcpy(&kver, data, sizeof(kver));
-       data += sizeof(kver);
-       datalen -= sizeof(kver);
+       memcpy(&kver, prep->data, sizeof(kver));
+       prep->data += sizeof(kver);
+       prep->datalen -= sizeof(kver);
  
        _debug("KEY I/F VERSION: %u", kver);
  
  
        /* deal with a version 1 key */
        ret = -EINVAL;
-       if (datalen < sizeof(*v1))
+       if (prep->datalen < sizeof(*v1))
                goto error;
  
-       v1 = data;
-       if (datalen != sizeof(*v1) + v1->ticket_length)
+       v1 = prep->data;
+       if (prep->datalen != sizeof(*v1) + v1->ticket_length)
                goto error;
  
        _debug("SCIX: %u", v1->security_index);
@@@ -784,17 -784,17 +784,17 @@@ error
   * instantiate a server secret key
   * data should be a pointer to the 8-byte secret key
   */
- static int rxrpc_instantiate_s(struct key *key, const void *data,
-                              size_t datalen)
+ static int rxrpc_instantiate_s(struct key *key,
+                              struct key_preparsed_payload *prep)
  {
        struct crypto_blkcipher *ci;
  
-       _enter("{%x},,%zu", key_serial(key), datalen);
+       _enter("{%x},,%zu", key_serial(key), prep->datalen);
  
-       if (datalen != 8)
+       if (prep->datalen != 8)
                return -EINVAL;
  
-       memcpy(&key->type_data, data, 8);
+       memcpy(&key->type_data, prep->data, 8);
  
        ci = crypto_alloc_blkcipher("pcbc(des)", 0, CRYPTO_ALG_ASYNC);
        if (IS_ERR(ci)) {
                return PTR_ERR(ci);
        }
  
-       if (crypto_blkcipher_setkey(ci, data, 8) < 0)
+       if (crypto_blkcipher_setkey(ci, prep->data, 8) < 0)
                BUG();
  
        key->payload.data = ci;
@@@ -948,8 -948,7 +948,8 @@@ int rxrpc_get_server_data_key(struct rx
  
        _enter("");
  
 -      key = key_alloc(&key_type_rxrpc, "x", 0, 0, cred, 0,
 +      key = key_alloc(&key_type_rxrpc, "x",
 +                      GLOBAL_ROOT_UID, GLOBAL_ROOT_GID, cred, 0,
                        KEY_ALLOC_NOT_IN_QUOTA);
        if (IS_ERR(key)) {
                _leave(" = -ENOMEM [alloc %ld]", PTR_ERR(key));
@@@ -995,8 -994,7 +995,8 @@@ struct key *rxrpc_get_null_key(const ch
        struct key *key;
        int ret;
  
 -      key = key_alloc(&key_type_rxrpc, keyname, 0, 0, cred,
 +      key = key_alloc(&key_type_rxrpc, keyname,
 +                      GLOBAL_ROOT_UID, GLOBAL_ROOT_GID, cred,
                        KEY_POS_SEARCH, KEY_ALLOC_NOT_IN_QUOTA);
        if (IS_ERR(key))
                return key;
diff --combined scripts/Makefile.modpost
@@@ -14,7 -14,8 +14,8 @@@
  # 3)  create one <module>.mod.c file pr. module
  # 4)  create one Module.symvers file with CRC for all exported symbols
  # 5) compile all <module>.mod.c files
- # 6) final link of the module to a <module.ko> file
+ # 6) final link of the module to a <module.ko> (or <module.unsigned>) file
+ # 7) signs the modules to a <module.ko> file
  
  # Step 3 is used to place certain information in the module's ELF
  # section, including information such as:
@@@ -32,6 -33,8 +33,8 @@@
  # Step 4 is solely used to allow module versioning in external modules,
  # where the CRC of each module is retrieved from the Module.symvers file.
  
+ # Step 7 is dependent on CONFIG_MODULE_SIG being enabled.
  # KBUILD_MODPOST_WARN can be set to avoid error out in case of undefined
  # symbols in the final module linking stage
  # KBUILD_MODPOST_NOFINAL can be set to skip the final link of modules.
@@@ -60,7 -63,7 +63,7 @@@ kernelsymfile := $(objtree)/Module.symv
  modulesymfile := $(firstword $(KBUILD_EXTMOD))/Module.symvers
  
  # Step 1), find all modules listed in $(MODVERDIR)/
 -__modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
 +__modules := $(sort $(shell grep -h '\.ko$$' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
  modules   := $(patsubst %.o,%.ko, $(wildcard $(__modules:.ko=.o)))
  
  # Stop after building .o files if NOFINAL is set. Makes compile tests quicker
@@@ -116,6 -119,7 +119,7 @@@ $(modules:.ko=.mod.o): %.mod.o: %.mod.
  targets += $(modules:.ko=.mod.o)
  
  # Step 6), final link of the modules
+ ifneq ($(CONFIG_MODULE_SIG),y)
  quiet_cmd_ld_ko_o = LD [M]  $@
        cmd_ld_ko_o = $(LD) -r $(LDFLAGS)                                 \
                               $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \
@@@ -125,7 -129,78 +129,78 @@@ $(modules): %.ko :%.o %.mod.o FORC
        $(call if_changed,ld_ko_o)
  
  targets += $(modules)
+ else
+ quiet_cmd_ld_ko_unsigned_o = LD [M]  $@
+       cmd_ld_ko_unsigned_o =                                          \
+               $(LD) -r $(LDFLAGS)                                     \
+                        $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE)     \
+                        -o $@ $(filter-out FORCE,$^)                   \
+               $(if $(AFTER_LINK),; $(AFTER_LINK))
+ $(modules:.ko=.ko.unsigned): %.ko.unsigned :%.o %.mod.o FORCE
+       $(call if_changed,ld_ko_unsigned_o)
+ targets += $(modules:.ko=.ko.unsigned)
+ # Step 7), sign the modules
+ MODSECKEY = ./signing_key.priv
+ MODPUBKEY = ./signing_key.x509
+ ifeq ($(wildcard $(MODSECKEY))+$(wildcard $(MODPUBKEY)),$(MODSECKEY)+$(MODPUBKEY))
+ ifeq ($(KBUILD_SRC),)
+       # no O= is being used
+       SCRIPTS_DIR := scripts
+ else
+       SCRIPTS_DIR := $(KBUILD_SRC)/scripts
+ endif
+ SIGN_MODULES := 1
+ else
+ SIGN_MODULES := 0
+ endif
+ # only sign if it's an in-tree module
+ ifneq ($(KBUILD_EXTMOD),)
+ SIGN_MODULES := 0
+ endif
  
+ # We strip the module as best we can - note that using both strip and eu-strip
+ # results in a smaller module than using either alone.
+ EU_STRIP = $(shell which eu-strip || echo true)
+ quiet_cmd_sign_ko_stripped_ko_unsigned = STRIP [M] $@
+       cmd_sign_ko_stripped_ko_unsigned = \
+               cp $< $@ && \
+               strip -x -g $@ && \
+               $(EU_STRIP) $@
+ ifeq ($(SIGN_MODULES),1)
+ quiet_cmd_genkeyid = GENKEYID $@
+       cmd_genkeyid = \
+               perl $(SCRIPTS_DIR)/x509keyid $< $<.signer $<.keyid
+ %.signer %.keyid: %
+       $(call if_changed,genkeyid)
+ KEYRING_DEP := $(MODSECKEY) $(MODPUBKEY) $(MODPUBKEY).signer $(MODPUBKEY).keyid
+ quiet_cmd_sign_ko_ko_stripped = SIGN [M] $@
+       cmd_sign_ko_ko_stripped = \
+               sh $(SCRIPTS_DIR)/sign-file $(MODSECKEY) $(MODPUBKEY) $< $@
+ else
+ KEYRING_DEP :=
+ quiet_cmd_sign_ko_ko_unsigned = NO SIGN [M] $@
+       cmd_sign_ko_ko_unsigned = \
+               cp $< $@
+ endif
+ $(modules): %.ko :%.ko.stripped $(KEYRING_DEP) FORCE
+       $(call if_changed,sign_ko_ko_stripped)
+ $(patsubst %.ko,%.ko.stripped,$(modules)): %.ko.stripped :%.ko.unsigned FORCE
+       $(call if_changed,sign_ko_stripped_ko_unsigned)
+ targets += $(modules)
+ endif
  
  # Add FORCE to the prequisites of a target to force it to be always rebuilt.
  # ---------------------------------------------------------------------------
diff --combined security/keys/key.c
@@@ -18,6 -18,7 +18,6 @@@
  #include <linux/workqueue.h>
  #include <linux/random.h>
  #include <linux/err.h>
 -#include <linux/user_namespace.h>
  #include "internal.h"
  
  struct kmem_cache *key_jar;
@@@ -51,7 -52,7 +51,7 @@@ void __key_check(const struct key *key
   * Get the key quota record for a user, allocating a new record if one doesn't
   * already exist.
   */
 -struct key_user *key_user_lookup(uid_t uid, struct user_namespace *user_ns)
 +struct key_user *key_user_lookup(kuid_t uid)
  {
        struct key_user *candidate = NULL, *user;
        struct rb_node *parent = NULL;
@@@ -66,9 -67,13 +66,9 @@@ try_again
                parent = *p;
                user = rb_entry(parent, struct key_user, node);
  
 -              if (uid < user->uid)
 +              if (uid_lt(uid, user->uid))
                        p = &(*p)->rb_left;
 -              else if (uid > user->uid)
 -                      p = &(*p)->rb_right;
 -              else if (user_ns < user->user_ns)
 -                      p = &(*p)->rb_left;
 -              else if (user_ns > user->user_ns)
 +              else if (uid_gt(uid, user->uid))
                        p = &(*p)->rb_right;
                else
                        goto found;
        atomic_set(&candidate->nkeys, 0);
        atomic_set(&candidate->nikeys, 0);
        candidate->uid = uid;
 -      candidate->user_ns = get_user_ns(user_ns);
        candidate->qnkeys = 0;
        candidate->qnbytes = 0;
        spin_lock_init(&candidate->lock);
@@@ -125,6 -131,7 +125,6 @@@ void key_user_put(struct key_user *user
        if (atomic_dec_and_lock(&user->usage, &key_user_lock)) {
                rb_erase(&user->node, &key_user_tree);
                spin_unlock(&key_user_lock);
 -              put_user_ns(user->user_ns);
  
                kfree(user);
        }
@@@ -222,7 -229,7 +222,7 @@@ serial_exists
   * key_alloc() calls don't race with module unloading.
   */
  struct key *key_alloc(struct key_type *type, const char *desc,
 -                    uid_t uid, gid_t gid, const struct cred *cred,
 +                    kuid_t uid, kgid_t gid, const struct cred *cred,
                      key_perm_t perm, unsigned long flags)
  {
        struct key_user *user = NULL;
        quotalen = desclen + type->def_datalen;
  
        /* get hold of the key tracking for this user */
 -      user = key_user_lookup(uid, cred->user_ns);
 +      user = key_user_lookup(uid);
        if (!user)
                goto no_memory_1;
  
        /* check that the user's quota permits allocation of another key and
         * its description */
        if (!(flags & KEY_ALLOC_NOT_IN_QUOTA)) {
 -              unsigned maxkeys = (uid == 0) ?
 +              unsigned maxkeys = uid_eq(uid, GLOBAL_ROOT_UID) ?
                        key_quota_root_maxkeys : key_quota_maxkeys;
 -              unsigned maxbytes = (uid == 0) ?
 +              unsigned maxbytes = uid_eq(uid, GLOBAL_ROOT_UID) ?
                        key_quota_root_maxbytes : key_quota_maxbytes;
  
                spin_lock(&user->lock);
@@@ -373,7 -380,7 +373,7 @@@ int key_payload_reserve(struct key *key
  
        /* contemplate the quota adjustment */
        if (delta != 0 && test_bit(KEY_FLAG_IN_QUOTA, &key->flags)) {
 -              unsigned maxbytes = (key->user->uid == 0) ?
 +              unsigned maxbytes = uid_eq(key->user->uid, GLOBAL_ROOT_UID) ?
                        key_quota_root_maxbytes : key_quota_maxbytes;
  
                spin_lock(&key->user->lock);
@@@ -405,8 -412,7 +405,7 @@@ EXPORT_SYMBOL(key_payload_reserve)
   * key_construction_mutex.
   */
  static int __key_instantiate_and_link(struct key *key,
-                                     const void *data,
-                                     size_t datalen,
+                                     struct key_preparsed_payload *prep,
                                      struct key *keyring,
                                      struct key *authkey,
                                      unsigned long *_prealloc)
        /* can't instantiate twice */
        if (!test_bit(KEY_FLAG_INSTANTIATED, &key->flags)) {
                /* instantiate the key */
-               ret = key->type->instantiate(key, data, datalen);
+               ret = key->type->instantiate(key, prep);
  
                if (ret == 0) {
                        /* mark the key as being instantiated */
@@@ -475,22 -481,37 +474,37 @@@ int key_instantiate_and_link(struct ke
                             struct key *keyring,
                             struct key *authkey)
  {
+       struct key_preparsed_payload prep;
        unsigned long prealloc;
        int ret;
  
+       memset(&prep, 0, sizeof(prep));
+       prep.data = data;
+       prep.datalen = datalen;
+       prep.quotalen = key->type->def_datalen;
+       if (key->type->preparse) {
+               ret = key->type->preparse(&prep);
+               if (ret < 0)
+                       goto error;
+       }
        if (keyring) {
                ret = __key_link_begin(keyring, key->type, key->description,
                                       &prealloc);
                if (ret < 0)
-                       return ret;
+                       goto error_free_preparse;
        }
  
-       ret = __key_instantiate_and_link(key, data, datalen, keyring, authkey,
+       ret = __key_instantiate_and_link(key, &prep, keyring, authkey,
                                         &prealloc);
  
        if (keyring)
                __key_link_end(keyring, key->type, prealloc);
  
+ error_free_preparse:
+       if (key->type->preparse)
+               key->type->free_preparse(&prep);
+ error:
        return ret;
  }
  
@@@ -591,7 -612,7 +605,7 @@@ void key_put(struct key *key
                key_check(key);
  
                if (atomic_dec_and_test(&key->usage))
 -                      queue_work(system_nrt_wq, &key_gc_work);
 +                      schedule_work(&key_gc_work);
        }
  }
  EXPORT_SYMBOL(key_put);
@@@ -699,7 -720,7 +713,7 @@@ void key_type_put(struct key_type *ktyp
   * if we get an error.
   */
  static inline key_ref_t __key_update(key_ref_t key_ref,
-                                    const void *payload, size_t plen)
+                                    struct key_preparsed_payload *prep)
  {
        struct key *key = key_ref_to_ptr(key_ref);
        int ret;
  
        down_write(&key->sem);
  
-       ret = key->type->update(key, payload, plen);
+       ret = key->type->update(key, prep);
        if (ret == 0)
                /* updating a negative key instantiates it */
                clear_bit(KEY_FLAG_NEGATIVE, &key->flags);
@@@ -767,6 -788,7 +781,7 @@@ key_ref_t key_create_or_update(key_ref_
                               unsigned long flags)
  {
        unsigned long prealloc;
+       struct key_preparsed_payload prep;
        const struct cred *cred = current_cred();
        struct key_type *ktype;
        struct key *keyring, *key = NULL;
        }
  
        key_ref = ERR_PTR(-EINVAL);
-       if (!ktype->match || !ktype->instantiate)
-               goto error_2;
+       if (!ktype->match || !ktype->instantiate ||
+           (!description && !ktype->preparse))
+               goto error_put_type;
  
        keyring = key_ref_to_ptr(keyring_ref);
  
  
        key_ref = ERR_PTR(-ENOTDIR);
        if (keyring->type != &key_type_keyring)
-               goto error_2;
+               goto error_put_type;
+       memset(&prep, 0, sizeof(prep));
+       prep.data = payload;
+       prep.datalen = plen;
+       prep.quotalen = ktype->def_datalen;
+       if (ktype->preparse) {
+               ret = ktype->preparse(&prep);
+               if (ret < 0) {
+                       key_ref = ERR_PTR(ret);
+                       goto error_put_type;
+               }
+               if (!description)
+                       description = prep.description;
+               key_ref = ERR_PTR(-EINVAL);
+               if (!description)
+                       goto error_free_prep;
+       }
  
        ret = __key_link_begin(keyring, ktype, description, &prealloc);
-       if (ret < 0)
-               goto error_2;
+       if (ret < 0) {
+               key_ref = ERR_PTR(ret);
+               goto error_free_prep;
+       }
  
        /* if we're going to allocate a new key, we're going to have
         * to modify the keyring */
        ret = key_permission(keyring_ref, KEY_WRITE);
        if (ret < 0) {
                key_ref = ERR_PTR(ret);
-               goto error_3;
+               goto error_link_end;
        }
  
        /* if it's possible to update this type of key, search for an existing
                        perm, flags);
        if (IS_ERR(key)) {
                key_ref = ERR_CAST(key);
-               goto error_3;
+               goto error_link_end;
        }
  
        /* instantiate it and link it into the target keyring */
-       ret = __key_instantiate_and_link(key, payload, plen, keyring, NULL,
-                                        &prealloc);
+       ret = __key_instantiate_and_link(key, &prep, keyring, NULL, &prealloc);
        if (ret < 0) {
                key_put(key);
                key_ref = ERR_PTR(ret);
-               goto error_3;
+               goto error_link_end;
        }
  
        key_ref = make_key_ref(key, is_key_possessed(keyring_ref));
  
 error_3:
error_link_end:
        __key_link_end(keyring, ktype, prealloc);
-  error_2:
+ error_free_prep:
+       if (ktype->preparse)
+               ktype->free_preparse(&prep);
+ error_put_type:
        key_type_put(ktype);
 error:
+ error:
        return key_ref;
  
   found_matching_key:
         * - we can drop the locks first as we have the key pinned
         */
        __key_link_end(keyring, ktype, prealloc);
-       key_type_put(ktype);
  
-       key_ref = __key_update(key_ref, payload, plen);
-       goto error;
+       key_ref = __key_update(key_ref, &prep);
+       goto error_free_prep;
  }
  EXPORT_SYMBOL(key_create_or_update);
  
   */
  int key_update(key_ref_t key_ref, const void *payload, size_t plen)
  {
+       struct key_preparsed_payload prep;
        struct key *key = key_ref_to_ptr(key_ref);
        int ret;
  
  
        /* attempt to update it if supported */
        ret = -EOPNOTSUPP;
-       if (key->type->update) {
-               down_write(&key->sem);
-               ret = key->type->update(key, payload, plen);
-               if (ret == 0)
-                       /* updating a negative key instantiates it */
-                       clear_bit(KEY_FLAG_NEGATIVE, &key->flags);
+       if (!key->type->update)
+               goto error;
  
-               up_write(&key->sem);
+       memset(&prep, 0, sizeof(prep));
+       prep.data = payload;
+       prep.datalen = plen;
+       prep.quotalen = key->type->def_datalen;
+       if (key->type->preparse) {
+               ret = key->type->preparse(&prep);
+               if (ret < 0)
+                       goto error;
        }
  
-  error:
+       down_write(&key->sem);
+       ret = key->type->update(key, &prep);
+       if (ret == 0)
+               /* updating a negative key instantiates it */
+               clear_bit(KEY_FLAG_NEGATIVE, &key->flags);
+       up_write(&key->sem);
+       if (key->type->preparse)
+               key->type->free_preparse(&prep);
+ error:
        return ret;
  }
  EXPORT_SYMBOL(key_update);
diff --combined security/keys/keyctl.c
@@@ -46,6 -46,9 +46,9 @@@ static int key_get_type_from_user(char 
   * Extract the description of a new key from userspace and either add it as a
   * new key to the specified keyring or update a matching key in that keyring.
   *
+  * If the description is NULL or an empty string, the key type is asked to
+  * generate one from the payload.
+  *
   * The keyring must be writable so that we can attach the key to it.
   *
   * If successful, the new key's serial number is returned, otherwise an error
@@@ -72,10 -75,17 +75,17 @@@ SYSCALL_DEFINE5(add_key, const char __u
        if (ret < 0)
                goto error;
  
-       description = strndup_user(_description, PAGE_SIZE);
-       if (IS_ERR(description)) {
-               ret = PTR_ERR(description);
-               goto error;
+       description = NULL;
+       if (_description) {
+               description = strndup_user(_description, PAGE_SIZE);
+               if (IS_ERR(description)) {
+                       ret = PTR_ERR(description);
+                       goto error;
+               }
+               if (!*description) {
+                       kfree(description);
+                       description = NULL;
+               }
        }
  
        /* pull the payload in if one was supplied */
@@@ -569,8 -579,8 +579,8 @@@ okay
        ret = snprintf(tmpbuf, PAGE_SIZE - 1,
                       "%s;%d;%d;%08x;%s",
                       key->type->name,
 -                     key->uid,
 -                     key->gid,
 +                     from_kuid_munged(current_user_ns(), key->uid),
 +                     from_kgid_munged(current_user_ns(), key->gid),
                       key->perm,
                       key->description ?: "");
  
@@@ -766,25 -776,15 +776,25 @@@ error
   *
   * If successful, 0 will be returned.
   */
 -long keyctl_chown_key(key_serial_t id, uid_t uid, gid_t gid)
 +long keyctl_chown_key(key_serial_t id, uid_t user, gid_t group)
  {
        struct key_user *newowner, *zapowner = NULL;
        struct key *key;
        key_ref_t key_ref;
        long ret;
 +      kuid_t uid;
 +      kgid_t gid;
 +
 +      uid = make_kuid(current_user_ns(), user);
 +      gid = make_kgid(current_user_ns(), group);
 +      ret = -EINVAL;
 +      if ((user != (uid_t) -1) && !uid_valid(uid))
 +              goto error;
 +      if ((group != (gid_t) -1) && !gid_valid(gid))
 +              goto error;
  
        ret = 0;
 -      if (uid == (uid_t) -1 && gid == (gid_t) -1)
 +      if (user == (uid_t) -1 && group == (gid_t) -1)
                goto error;
  
        key_ref = lookup_user_key(id, KEY_LOOKUP_CREATE | KEY_LOOKUP_PARTIAL,
  
        if (!capable(CAP_SYS_ADMIN)) {
                /* only the sysadmin can chown a key to some other UID */
 -              if (uid != (uid_t) -1 && key->uid != uid)
 +              if (user != (uid_t) -1 && !uid_eq(key->uid, uid))
                        goto error_put;
  
                /* only the sysadmin can set the key's GID to a group other
                 * than one of those that the current process subscribes to */
 -              if (gid != (gid_t) -1 && gid != key->gid && !in_group_p(gid))
 +              if (group != (gid_t) -1 && !gid_eq(gid, key->gid) && !in_group_p(gid))
                        goto error_put;
        }
  
        /* change the UID */
 -      if (uid != (uid_t) -1 && uid != key->uid) {
 +      if (user != (uid_t) -1 && !uid_eq(uid, key->uid)) {
                ret = -ENOMEM;
 -              newowner = key_user_lookup(uid, current_user_ns());
 +              newowner = key_user_lookup(uid);
                if (!newowner)
                        goto error_put;
  
                /* transfer the quota burden to the new user */
                if (test_bit(KEY_FLAG_IN_QUOTA, &key->flags)) {
 -                      unsigned maxkeys = (uid == 0) ?
 +                      unsigned maxkeys = uid_eq(uid, GLOBAL_ROOT_UID) ?
                                key_quota_root_maxkeys : key_quota_maxkeys;
 -                      unsigned maxbytes = (uid == 0) ?
 +                      unsigned maxbytes = uid_eq(uid, GLOBAL_ROOT_UID) ?
                                key_quota_root_maxbytes : key_quota_maxbytes;
  
                        spin_lock(&newowner->lock);
        }
  
        /* change the GID */
 -      if (gid != (gid_t) -1)
 +      if (group != (gid_t) -1)
                key->gid = gid;
  
        ret = 0;
@@@ -907,7 -907,7 +917,7 @@@ long keyctl_setperm_key(key_serial_t id
        down_write(&key->sem);
  
        /* if we're not the sysadmin, we can only change a key that we own */
 -      if (capable(CAP_SYS_ADMIN) || key->uid == current_fsuid()) {
 +      if (capable(CAP_SYS_ADMIN) || uid_eq(key->uid, current_fsuid())) {
                key->perm = perm;
                ret = 0;
        }
@@@ -1496,6 -1496,7 +1506,6 @@@ long keyctl_session_to_parent(void
        oldwork = NULL;
        parent = me->real_parent;
  
 -      task_lock(parent);
        /* the parent mustn't be init and mustn't be a kernel thread */
        if (parent->pid <= 1 || !parent->mm)
                goto unlock;
  
        /* the parent must have the same effective ownership and mustn't be
         * SUID/SGID */
 -      if (pcred->uid  != mycred->euid ||
 -          pcred->euid != mycred->euid ||
 -          pcred->suid != mycred->euid ||
 -          pcred->gid  != mycred->egid ||
 -          pcred->egid != mycred->egid ||
 -          pcred->sgid != mycred->egid)
 +      if (!uid_eq(pcred->uid,  mycred->euid) ||
 +          !uid_eq(pcred->euid, mycred->euid) ||
 +          !uid_eq(pcred->suid, mycred->euid) ||
 +          !gid_eq(pcred->gid,  mycred->egid) ||
 +          !gid_eq(pcred->egid, mycred->egid) ||
 +          !gid_eq(pcred->sgid, mycred->egid))
                goto unlock;
  
        /* the keyrings must have the same UID */
        if ((pcred->tgcred->session_keyring &&
 -           pcred->tgcred->session_keyring->uid != mycred->euid) ||
 -          mycred->tgcred->session_keyring->uid != mycred->euid)
 +           !uid_eq(pcred->tgcred->session_keyring->uid, mycred->euid)) ||
 +          !uid_eq(mycred->tgcred->session_keyring->uid, mycred->euid))
                goto unlock;
  
        /* cancel an already pending keyring replacement */
        if (!ret)
                newwork = NULL;
  unlock:
 -      task_unlock(parent);
        write_unlock_irq(&tasklist_lock);
        rcu_read_unlock();
        if (oldwork)
diff --combined security/keys/keyring.c
@@@ -66,7 -66,7 +66,7 @@@ static inline unsigned keyring_hash(con
   * operations.
   */
  static int keyring_instantiate(struct key *keyring,
-                              const void *data, size_t datalen);
+                              struct key_preparsed_payload *prep);
  static int keyring_match(const struct key *keyring, const void *criterion);
  static void keyring_revoke(struct key *keyring);
  static void keyring_destroy(struct key *keyring);
@@@ -121,12 -121,12 +121,12 @@@ static void keyring_publish_name(struc
   * Returns 0 on success, -EINVAL if given any data.
   */
  static int keyring_instantiate(struct key *keyring,
-                              const void *data, size_t datalen)
+                              struct key_preparsed_payload *prep)
  {
        int ret;
  
        ret = -EINVAL;
-       if (datalen == 0) {
+       if (prep->datalen == 0) {
                /* make the keyring available by name if it has one */
                keyring_publish_name(keyring);
                ret = 0;
@@@ -256,7 -256,7 +256,7 @@@ error
  /*
   * Allocate a keyring and link into the destination keyring.
   */
 -struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid,
 +struct key *keyring_alloc(const char *description, kuid_t uid, kgid_t gid,
                          const struct cred *cred, unsigned long flags,
                          struct key *dest)
  {
@@@ -612,7 -612,7 +612,7 @@@ struct key *find_keyring_by_name(const 
                                    &keyring_name_hash[bucket],
                                    type_data.link
                                    ) {
 -                      if (keyring->user->user_ns != current_user_ns())
 +                      if (!kuid_has_mapping(current_user_ns(), keyring->user->uid))
                                continue;
  
                        if (test_bit(KEY_FLAG_REVOKED, &keyring->flags))
diff --combined security/keys/trusted.c
@@@ -368,6 -368,38 +368,6 @@@ static int trusted_tpm_send(const u32 c
        return rc;
  }
  
 -/*
 - * get a random value from TPM
 - */
 -static int tpm_get_random(struct tpm_buf *tb, unsigned char *buf, uint32_t len)
 -{
 -      int ret;
 -
 -      INIT_BUF(tb);
 -      store16(tb, TPM_TAG_RQU_COMMAND);
 -      store32(tb, TPM_GETRANDOM_SIZE);
 -      store32(tb, TPM_ORD_GETRANDOM);
 -      store32(tb, len);
 -      ret = trusted_tpm_send(TPM_ANY_NUM, tb->data, sizeof tb->data);
 -      if (!ret)
 -              memcpy(buf, tb->data + TPM_GETRANDOM_SIZE, len);
 -      return ret;
 -}
 -
 -static int my_get_random(unsigned char *buf, int len)
 -{
 -      struct tpm_buf *tb;
 -      int ret;
 -
 -      tb = kmalloc(sizeof *tb, GFP_KERNEL);
 -      if (!tb)
 -              return -ENOMEM;
 -      ret = tpm_get_random(tb, buf, len);
 -
 -      kfree(tb);
 -      return ret;
 -}
 -
  /*
   * Lock a trusted key, by extending a selected PCR.
   *
@@@ -381,8 -413,8 +381,8 @@@ static int pcrlock(const int pcrnum
  
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;
 -      ret = my_get_random(hash, SHA1_DIGEST_SIZE);
 -      if (ret < 0)
 +      ret = tpm_get_random(TPM_ANY_NUM, hash, SHA1_DIGEST_SIZE);
 +      if (ret != SHA1_DIGEST_SIZE)
                return ret;
        return tpm_pcr_extend(TPM_ANY_NUM, pcrnum, hash) ? -EINVAL : 0;
  }
@@@ -397,8 -429,8 +397,8 @@@ static int osap(struct tpm_buf *tb, str
        unsigned char ononce[TPM_NONCE_SIZE];
        int ret;
  
 -      ret = tpm_get_random(tb, ononce, TPM_NONCE_SIZE);
 -      if (ret < 0)
 +      ret = tpm_get_random(TPM_ANY_NUM, ononce, TPM_NONCE_SIZE);
 +      if (ret != TPM_NONCE_SIZE)
                return ret;
  
        INIT_BUF(tb);
@@@ -492,8 -524,8 +492,8 @@@ static int tpm_seal(struct tpm_buf *tb
        if (ret < 0)
                goto out;
  
 -      ret = tpm_get_random(tb, td->nonceodd, TPM_NONCE_SIZE);
 -      if (ret < 0)
 +      ret = tpm_get_random(TPM_ANY_NUM, td->nonceodd, TPM_NONCE_SIZE);
 +      if (ret != TPM_NONCE_SIZE)
                goto out;
        ordinal = htonl(TPM_ORD_SEAL);
        datsize = htonl(datalen);
@@@ -602,8 -634,8 +602,8 @@@ static int tpm_unseal(struct tpm_buf *t
  
        ordinal = htonl(TPM_ORD_UNSEAL);
        keyhndl = htonl(SRKHANDLE);
 -      ret = tpm_get_random(tb, nonceodd, TPM_NONCE_SIZE);
 -      if (ret < 0) {
 +      ret = tpm_get_random(TPM_ANY_NUM, nonceodd, TPM_NONCE_SIZE);
 +      if (ret != TPM_NONCE_SIZE) {
                pr_info("trusted_key: tpm_get_random failed (%d)\n", ret);
                return ret;
        }
@@@ -895,23 -927,23 +895,24 @@@ static struct trusted_key_payload *trus
   *
   * On success, return 0. Otherwise return errno.
   */
- static int trusted_instantiate(struct key *key, const void *data,
-                              size_t datalen)
+ static int trusted_instantiate(struct key *key,
+                              struct key_preparsed_payload *prep)
  {
        struct trusted_key_payload *payload = NULL;
        struct trusted_key_options *options = NULL;
+       size_t datalen = prep->datalen;
        char *datablob;
        int ret = 0;
        int key_cmd;
 +      size_t key_len;
  
-       if (datalen <= 0 || datalen > 32767 || !data)
+       if (datalen <= 0 || datalen > 32767 || !prep->data)
                return -EINVAL;
  
        datablob = kmalloc(datalen + 1, GFP_KERNEL);
        if (!datablob)
                return -ENOMEM;
-       memcpy(datablob, data, datalen);
+       memcpy(datablob, prep->data, datalen);
        datablob[datalen] = '\0';
  
        options = trusted_options_alloc();
                        pr_info("trusted_key: key_unseal failed (%d)\n", ret);
                break;
        case Opt_new:
 -              ret = my_get_random(payload->key, payload->key_len);
 -              if (ret < 0) {
 +              key_len = payload->key_len;
 +              ret = tpm_get_random(TPM_ANY_NUM, payload->key, key_len);
 +              if (ret != key_len) {
                        pr_info("trusted_key: key_create failed (%d)\n", ret);
                        goto out;
                }
@@@ -981,17 -1012,18 +982,18 @@@ static void trusted_rcu_free(struct rcu
  /*
   * trusted_update - reseal an existing key with new PCR values
   */
- static int trusted_update(struct key *key, const void *data, size_t datalen)
+ static int trusted_update(struct key *key, struct key_preparsed_payload *prep)
  {
        struct trusted_key_payload *p = key->payload.data;
        struct trusted_key_payload *new_p;
        struct trusted_key_options *new_o;
+       size_t datalen = prep->datalen;
        char *datablob;
        int ret = 0;
  
        if (!p->migratable)
                return -EPERM;
-       if (datalen <= 0 || datalen > 32767 || !data)
+       if (datalen <= 0 || datalen > 32767 || !prep->data)
                return -EINVAL;
  
        datablob = kmalloc(datalen + 1, GFP_KERNEL);
                goto out;
        }
  
-       memcpy(datablob, data, datalen);
+       memcpy(datablob, prep->data, datalen);
        datablob[datalen] = '\0';
        ret = datablob_parse(datablob, new_p, new_o);
        if (ret != Opt_update) {