]> git.ipfire.org Git - people/arne_f/ipfire-3.x.git/commitdiff
kernel: Update to 3.1.5.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 18 Dec 2011 13:09:49 +0000 (14:09 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 18 Dec 2011 13:09:49 +0000 (14:09 +0100)
Add bridge patches from Vitalii.

kernel/kernel.nm
kernel/patches/grsecurity-2.2.2-3.1.5-201112101853.patch [moved from kernel/patches/grsecurity-2.2.2-3.1.3-201111262001.patch with 81% similarity]
kernel/patches/linux-3.1-bridge-master-device-stuck-in-no-carrier-state-forever-when-in-user-stp-mode.patch [new file with mode: 0644]
kernel/patches/linux-3.1-bridge-push-blocking-slaves-to-forwarding-when-turning-stp-off.patch.off [new file with mode: 0644]

index d6ec034d1b4e9432892ecba90f2eb2ff13e9a4e7..1b8a47d4d59f9c0bd3ac9aa687cda21824259b89 100644 (file)
@@ -4,8 +4,8 @@
 ###############################################################################
 
 name       = kernel
-version    = 3.1.4
-release    = 3
+version    = 3.1.5
+release    = 1
 thisapp    = linux-%{version}
 
 maintainer = Michael Tremer <michael.tremer@ipfire.org>
@@ -37,6 +37,7 @@ build
        requires
                binutils-devel
                elfutils-devel
+               gcc-plugin-devel
                gettext
                module-init-tools
                ncurses-devel
@@ -48,7 +49,7 @@ build
 
        tools_cpupower_requires
                newt-devel
-               pcituils-devel
+               pciutils-devel
                slang-devel
        end
 
@@ -441,6 +442,8 @@ packages
                        !/lib/modules
                        !/usr/include
                        !/usr/src
+                       !/usr/src/debug
+                       !/usr/lib/debug
                end
        end
 end
similarity index 81%
rename from kernel/patches/grsecurity-2.2.2-3.1.3-201111262001.patch
rename to kernel/patches/grsecurity-2.2.2-3.1.5-201112101853.patch
index 2cd8ff113ae6a9c12ea3198c1ebebd3378c4ad86..67dea054b37ff74d726909bf957a1144ae082d1f 100644 (file)
@@ -1,7 +1,373 @@
-diff -urNp linux-3.1.3/arch/alpha/include/asm/elf.h linux-3.1.3/arch/alpha/include/asm/elf.h
---- linux-3.1.3/arch/alpha/include/asm/elf.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/alpha/include/asm/elf.h   2011-11-16 18:39:07.000000000 -0500
-@@ -90,6 +90,13 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_N
+diff --git a/Documentation/dontdiff b/Documentation/dontdiff
+index dfa6fc6..0095943 100644
+--- a/Documentation/dontdiff
++++ b/Documentation/dontdiff
+@@ -5,6 +5,7 @@
+ *.cis
+ *.cpio
+ *.csp
++*.dbg
+ *.dsp
+ *.dvi
+ *.elf
+@@ -14,6 +15,7 @@
+ *.gcov
+ *.gen.S
+ *.gif
++*.gmo
+ *.grep
+ *.grp
+ *.gz
+@@ -48,9 +50,11 @@
+ *.tab.h
+ *.tex
+ *.ver
++*.vim
+ *.xml
+ *.xz
+ *_MODULES
++*_reg_safe.h
+ *_vga16.c
+ *~
+ \#*#
+@@ -70,6 +74,7 @@ Kerntypes
+ Module.markers
+ Module.symvers
+ PENDING
++PERF*
+ SCCS
+ System.map*
+ TAGS
+@@ -93,19 +98,24 @@ bounds.h
+ bsetup
+ btfixupprep
+ build
++builtin-policy.h
+ bvmlinux
+ bzImage*
+ capability_names.h
+ capflags.c
+ classlist.h*
++clut_vga16.c
++common-cmds.h
+ comp*.log
+ compile.h*
+ conf
+ config
+ config-*
+ config_data.h*
++config.c
+ config.mak
+ config.mak.autogen
++config.tmp
+ conmakehash
+ consolemap_deftbl.c*
+ cpustr.h
+@@ -119,6 +129,7 @@ dslm
+ elf2ecoff
+ elfconfig.h*
+ evergreen_reg_safe.h
++exception_policy.conf
+ fixdep
+ flask.h
+ fore200e_mkfirm
+@@ -126,12 +137,15 @@ fore200e_pca_fw.c*
+ gconf
+ gconf.glade.h
+ gen-devlist
++gen-kdb_cmds.c
+ gen_crc32table
+ gen_init_cpio
+ generated
+ genheaders
+ genksyms
+ *_gray256.c
++hash
++hid-example
+ hpet_example
+ hugepage-mmap
+ hugepage-shm
+@@ -146,7 +160,7 @@ int32.c
+ int4.c
+ int8.c
+ kallsyms
+-kconfig
++kern_constants.h
+ keywords.c
+ ksym.c*
+ ksym.h*
+@@ -154,7 +168,6 @@ kxgettext
+ lkc_defs.h
+ lex.c
+ lex.*.c
+-linux
+ logo_*.c
+ logo_*_clut224.c
+ logo_*_mono.c
+@@ -166,14 +179,15 @@ machtypes.h
+ map
+ map_hugetlb
+ maui_boot.h
+-media
+ mconf
++mdp
+ miboot*
+ mk_elfconfig
+ mkboot
+ mkbugboot
+ mkcpustr
+ mkdep
++mkpiggy
+ mkprep
+ mkregtable
+ mktables
+@@ -209,6 +223,7 @@ r300_reg_safe.h
+ r420_reg_safe.h
+ r600_reg_safe.h
+ recordmcount
++regdb.c
+ relocs
+ rlim_names.h
+ rn50_reg_safe.h
+@@ -219,6 +234,7 @@ setup
+ setup.bin
+ setup.elf
+ sImage
++slabinfo
+ sm_tbl*
+ split-include
+ syscalltab.h
+@@ -229,6 +245,7 @@ tftpboot.img
+ timeconst.h
+ times.h*
+ trix_boot.h
++user_constants.h
+ utsrelease.h*
+ vdso-syms.lds
+ vdso.lds
+@@ -246,7 +263,9 @@ vmlinux
+ vmlinux-*
+ vmlinux.aout
+ vmlinux.bin.all
++vmlinux.bin.bz2
+ vmlinux.lds
++vmlinux.relocs
+ vmlinuz
+ voffset.h
+ vsyscall.lds
+@@ -254,9 +273,11 @@ vsyscall_32.lds
+ wanxlfw.inc
+ uImage
+ unifdef
++utsrelease.h
+ wakeup.bin
+ wakeup.elf
+ wakeup.lds
+ zImage*
+ zconf.hash.c
++zconf.lex.c
+ zoffset.h
+diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
+index d6e6724..a024ce8 100644
+--- a/Documentation/kernel-parameters.txt
++++ b/Documentation/kernel-parameters.txt
+@@ -1898,6 +1898,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
+                       the specified number of seconds.  This is to be used if
+                       your oopses keep scrolling off the screen.
++      pax_nouderef    [X86] disables UDEREF.  Most likely needed under certain
++                      virtualization environments that don't cope well with the
++                      expand down segment used by UDEREF on X86-32 or the frequent
++                      page table updates on X86-64.
++
++      pax_softmode=   0/1 to disable/enable PaX softmode on boot already.
++
+       pcbit=          [HW,ISDN]
+       pcd.            [PARIDE]
+diff --git a/Makefile b/Makefile
+index 94ab2ad..1e4a6e8 100644
+--- a/Makefile
++++ b/Makefile
+@@ -245,8 +245,9 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
+ HOSTCC       = gcc
+ HOSTCXX      = g++
+-HOSTCFLAGS   = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer
+-HOSTCXXFLAGS = -O2
++HOSTCFLAGS   = -Wall -W -Wmissing-prototypes -Wstrict-prototypes -Wno-unused-parameter -Wno-missing-field-initializers -O2 -fomit-frame-pointer -fno-delete-null-pointer-checks
++HOSTCLFAGS  += $(call cc-option, -Wno-empty-body)
++HOSTCXXFLAGS = -O2 -Wall -W -fno-delete-null-pointer-checks
+ # Decide whether to build built-in, modular, or both.
+ # Normally, just do built-in.
+@@ -407,8 +408,8 @@ export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn --exc
+ # Rules shared between *config targets and build targets
+ # Basic helpers built in scripts/
+-PHONY += scripts_basic
+-scripts_basic:
++PHONY += scripts_basic gcc-plugins
++scripts_basic: gcc-plugins
+       $(Q)$(MAKE) $(build)=scripts/basic
+       $(Q)rm -f .tmp_quiet_recordmcount
+@@ -564,6 +565,42 @@ else
+ KBUILD_CFLAGS += -O2
+ endif
++ifndef DISABLE_PAX_PLUGINS
++ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-plugin.sh "$(HOSTCC)" "$(CC)"), y)
++ifndef DISABLE_PAX_CONSTIFY_PLUGIN
++CONSTIFY_PLUGIN := -fplugin=$(objtree)/tools/gcc/constify_plugin.so -DCONSTIFY_PLUGIN
++endif
++ifdef CONFIG_PAX_MEMORY_STACKLEAK
++STACKLEAK_PLUGIN := -fplugin=$(objtree)/tools/gcc/stackleak_plugin.so -DSTACKLEAK_PLUGIN
++STACKLEAK_PLUGIN += -fplugin-arg-stackleak_plugin-track-lowest-sp=100
++endif
++ifdef CONFIG_KALLOCSTAT_PLUGIN
++KALLOCSTAT_PLUGIN := -fplugin=$(objtree)/tools/gcc/kallocstat_plugin.so
++endif
++ifdef CONFIG_PAX_KERNEXEC_PLUGIN
++KERNEXEC_PLUGIN := -fplugin=$(objtree)/tools/gcc/kernexec_plugin.so
++KERNEXEC_PLUGIN += -fplugin-arg-kernexec_plugin-method=$(CONFIG_PAX_KERNEXEC_PLUGIN_METHOD)
++endif
++ifdef CONFIG_CHECKER_PLUGIN
++ifeq ($(call cc-ifversion, -ge, 0406, y), y)
++CHECKER_PLUGIN := -fplugin=$(objtree)/tools/gcc/checker_plugin.so -DCHECKER_PLUGIN
++endif
++endif
++GCC_PLUGINS := $(CONSTIFY_PLUGIN) $(STACKLEAK_PLUGIN) $(KALLOCSTAT_PLUGIN) $(KERNEXEC_PLUGIN) $(CHECKER_PLUGIN)
++export CONSTIFY_PLUGIN STACKLEAK_PLUGIN KERNEXEC_PLUGIN CHECKER_PLUGIN
++gcc-plugins:
++      $(Q)$(MAKE) $(build)=tools/gcc
++else
++gcc-plugins:
++ifeq ($(call cc-ifversion, -ge, 0405, y), y)
++      $(error Your gcc installation does not support plugins.  If the necessary headers for plugin support are missing, they should be installed.  On Debian, apt-get install gcc-<ver>-plugin-dev.  If you choose to ignore this error and lessen the improvements provided by this patch, re-run make with the DISABLE_PAX_PLUGINS=y argument.))
++else
++      $(Q)echo "warning, your gcc version does not support plugins, you should upgrade it to gcc 4.5 at least"
++endif
++      $(Q)echo "PAX_MEMORY_STACKLEAK and other features will be less secure"
++endif
++endif
++
+ include $(srctree)/arch/$(SRCARCH)/Makefile
+ ifneq ($(CONFIG_FRAME_WARN),0)
+@@ -708,7 +745,7 @@ export mod_strip_cmd
+ ifeq ($(KBUILD_EXTMOD),)
+-core-y                += kernel/ mm/ fs/ ipc/ security/ crypto/ block/
++core-y                += kernel/ mm/ fs/ ipc/ security/ crypto/ block/ grsecurity/
+ vmlinux-dirs  := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
+                    $(core-y) $(core-m) $(drivers-y) $(drivers-m) \
+@@ -932,6 +969,7 @@ vmlinux.o: $(modpost-init) $(vmlinux-main) FORCE
+ # The actual objects are generated when descending, 
+ # make sure no implicit rule kicks in
++$(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): KBUILD_CFLAGS += $(GCC_PLUGINS)
+ $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ;
+ # Handle descending into subdirectories listed in $(vmlinux-dirs)
+@@ -941,7 +979,7 @@ $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ;
+ # Error messages still appears in the original language
+ PHONY += $(vmlinux-dirs)
+-$(vmlinux-dirs): prepare scripts
++$(vmlinux-dirs): gcc-plugins prepare scripts
+       $(Q)$(MAKE) $(build)=$@
+ # Store (new) KERNELRELASE string in include/config/kernel.release
+@@ -986,6 +1024,7 @@ prepare0: archprepare FORCE
+       $(Q)$(MAKE) $(build)=. missing-syscalls
+ # All the preparing..
++prepare: KBUILD_CFLAGS := $(filter-out $(GCC_PLUGINS),$(KBUILD_CFLAGS))
+ prepare: prepare0
+ # Generate some files
+@@ -1087,6 +1126,7 @@ all: modules
+ #     using awk while concatenating to the final file.
+ PHONY += modules
++modules: KBUILD_CFLAGS += $(GCC_PLUGINS)
+ modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin
+       $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order
+       @$(kecho) '  Building modules, stage 2.';
+@@ -1102,7 +1142,7 @@ modules.builtin: $(vmlinux-dirs:%=%/modules.builtin)
+ # Target to prepare building external modules
+ PHONY += modules_prepare
+-modules_prepare: prepare scripts
++modules_prepare: gcc-plugins prepare scripts
+ # Target to install modules
+ PHONY += modules_install
+@@ -1198,7 +1238,7 @@ distclean: mrproper
+       @find $(srctree) $(RCS_FIND_IGNORE) \
+               \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
+               -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
+-              -o -name '.*.rej' -o -size 0 \
++              -o -name '.*.rej' -o -name '*.so' -o -size 0 \
+               -o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \
+               -type f -print | xargs rm -f
+@@ -1360,6 +1400,7 @@ PHONY += $(module-dirs) modules
+ $(module-dirs): crmodverdir $(objtree)/Module.symvers
+       $(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@)
++modules: KBUILD_CFLAGS += $(GCC_PLUGINS)
+ modules: $(module-dirs)
+       @$(kecho) '  Building modules, stage 2.';
+       $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
+@@ -1486,17 +1527,19 @@ else
+         target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@))
+ endif
+-%.s: %.c prepare scripts FORCE
++%.s: KBUILD_CFLAGS += $(GCC_PLUGINS)
++%.s: %.c gcc-plugins prepare scripts FORCE
+       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
+ %.i: %.c prepare scripts FORCE
+       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
+-%.o: %.c prepare scripts FORCE
++%.o: KBUILD_CFLAGS += $(GCC_PLUGINS)
++%.o: %.c gcc-plugins prepare scripts FORCE
+       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
+ %.lst: %.c prepare scripts FORCE
+       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
+-%.s: %.S prepare scripts FORCE
++%.s: %.S gcc-plugins prepare scripts FORCE
+       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
+-%.o: %.S prepare scripts FORCE
++%.o: %.S gcc-plugins prepare scripts FORCE
+       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
+ %.symtypes: %.c prepare scripts FORCE
+       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
+@@ -1506,11 +1549,13 @@ endif
+       $(cmd_crmodverdir)
+       $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
+       $(build)=$(build-dir)
+-%/: prepare scripts FORCE
++%/: KBUILD_CFLAGS += $(GCC_PLUGINS)
++%/: gcc-plugins prepare scripts FORCE
+       $(cmd_crmodverdir)
+       $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
+       $(build)=$(build-dir)
+-%.ko: prepare scripts FORCE
++%.ko: KBUILD_CFLAGS += $(GCC_PLUGINS)
++%.ko: gcc-plugins prepare scripts FORCE
+       $(cmd_crmodverdir)
+       $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1)   \
+       $(build)=$(build-dir) $(@:.ko=.o)
+diff --git a/arch/alpha/include/asm/elf.h b/arch/alpha/include/asm/elf.h
+index da5449e..7418343 100644
+--- a/arch/alpha/include/asm/elf.h
++++ b/arch/alpha/include/asm/elf.h
+@@ -90,6 +90,13 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
  
  #define ELF_ET_DYN_BASE               (TASK_UNMAPPED_BASE + 0x1000000)
  
@@ -15,9 +381,10 @@ diff -urNp linux-3.1.3/arch/alpha/include/asm/elf.h linux-3.1.3/arch/alpha/inclu
  /* $0 is set by ld.so to a pointer to a function which might be 
     registered using atexit.  This provides a mean for the dynamic
     linker to call DT_FINI functions for shared libraries that have
-diff -urNp linux-3.1.3/arch/alpha/include/asm/pgtable.h linux-3.1.3/arch/alpha/include/asm/pgtable.h
---- linux-3.1.3/arch/alpha/include/asm/pgtable.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/alpha/include/asm/pgtable.h       2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/alpha/include/asm/pgtable.h b/arch/alpha/include/asm/pgtable.h
+index de98a73..bd4f1f8 100644
+--- a/arch/alpha/include/asm/pgtable.h
++++ b/arch/alpha/include/asm/pgtable.h
 @@ -101,6 +101,17 @@ struct vm_area_struct;
  #define PAGE_SHARED   __pgprot(_PAGE_VALID | __ACCESS_BITS)
  #define PAGE_COPY     __pgprot(_PAGE_VALID | __ACCESS_BITS | _PAGE_FOW)
@@ -36,10 +403,11 @@ diff -urNp linux-3.1.3/arch/alpha/include/asm/pgtable.h linux-3.1.3/arch/alpha/i
  #define PAGE_KERNEL   __pgprot(_PAGE_VALID | _PAGE_ASM | _PAGE_KRE | _PAGE_KWE)
  
  #define _PAGE_NORMAL(x) __pgprot(_PAGE_VALID | __ACCESS_BITS | (x))
-diff -urNp linux-3.1.3/arch/alpha/kernel/module.c linux-3.1.3/arch/alpha/kernel/module.c
---- linux-3.1.3/arch/alpha/kernel/module.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/alpha/kernel/module.c     2011-11-16 18:39:07.000000000 -0500
-@@ -160,7 +160,7 @@ apply_relocate_add(Elf64_Shdr *sechdrs, 
+diff --git a/arch/alpha/kernel/module.c b/arch/alpha/kernel/module.c
+index 2fd00b7..cfd5069 100644
+--- a/arch/alpha/kernel/module.c
++++ b/arch/alpha/kernel/module.c
+@@ -160,7 +160,7 @@ apply_relocate_add(Elf64_Shdr *sechdrs, const char *strtab,
  
        /* The small sections were sorted to the end of the segment.
           The following should definitely cover them.  */
@@ -48,10 +416,11 @@ diff -urNp linux-3.1.3/arch/alpha/kernel/module.c linux-3.1.3/arch/alpha/kernel/
        got = sechdrs[me->arch.gotsecindex].sh_addr;
  
        for (i = 0; i < n; i++) {
-diff -urNp linux-3.1.3/arch/alpha/kernel/osf_sys.c linux-3.1.3/arch/alpha/kernel/osf_sys.c
---- linux-3.1.3/arch/alpha/kernel/osf_sys.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/alpha/kernel/osf_sys.c    2011-11-16 18:39:07.000000000 -0500
-@@ -1147,7 +1147,7 @@ arch_get_unmapped_area_1(unsigned long a
+diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
+index 01e8715..be0e80f 100644
+--- a/arch/alpha/kernel/osf_sys.c
++++ b/arch/alpha/kernel/osf_sys.c
+@@ -1147,7 +1147,7 @@ arch_get_unmapped_area_1(unsigned long addr, unsigned long len,
                /* At this point:  (!vma || addr < vma->vm_end). */
                if (limit - len < addr)
                        return -ENOMEM;
@@ -60,7 +429,7 @@ diff -urNp linux-3.1.3/arch/alpha/kernel/osf_sys.c linux-3.1.3/arch/alpha/kernel
                        return addr;
                addr = vma->vm_end;
                vma = vma->vm_next;
-@@ -1183,6 +1183,10 @@ arch_get_unmapped_area(struct file *filp
+@@ -1183,6 +1183,10 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
           merely specific addresses, but regions of memory -- perhaps
           this feature should be incorporated into all ports?  */
  
@@ -71,7 +440,7 @@ diff -urNp linux-3.1.3/arch/alpha/kernel/osf_sys.c linux-3.1.3/arch/alpha/kernel
        if (addr) {
                addr = arch_get_unmapped_area_1 (PAGE_ALIGN(addr), len, limit);
                if (addr != (unsigned long) -ENOMEM)
-@@ -1190,8 +1194,8 @@ arch_get_unmapped_area(struct file *filp
+@@ -1190,8 +1194,8 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
        }
  
        /* Next, try allocating at TASK_UNMAPPED_BASE.  */
@@ -82,10 +451,11 @@ diff -urNp linux-3.1.3/arch/alpha/kernel/osf_sys.c linux-3.1.3/arch/alpha/kernel
        if (addr != (unsigned long) -ENOMEM)
                return addr;
  
-diff -urNp linux-3.1.3/arch/alpha/mm/fault.c linux-3.1.3/arch/alpha/mm/fault.c
---- linux-3.1.3/arch/alpha/mm/fault.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/alpha/mm/fault.c  2011-11-16 18:39:07.000000000 -0500
-@@ -54,6 +54,124 @@ __load_new_mm_context(struct mm_struct *
+diff --git a/arch/alpha/mm/fault.c b/arch/alpha/mm/fault.c
+index fadd5f8..904e73a 100644
+--- a/arch/alpha/mm/fault.c
++++ b/arch/alpha/mm/fault.c
+@@ -54,6 +54,124 @@ __load_new_mm_context(struct mm_struct *next_mm)
        __reload_thread(pcb);
  }
  
@@ -210,7 +580,7 @@ diff -urNp linux-3.1.3/arch/alpha/mm/fault.c linux-3.1.3/arch/alpha/mm/fault.c
  
  /*
   * This routine handles page faults.  It determines the address,
-@@ -131,8 +249,29 @@ do_page_fault(unsigned long address, uns
+@@ -131,8 +249,29 @@ do_page_fault(unsigned long address, unsigned long mmcsr,
   good_area:
        si_code = SEGV_ACCERR;
        if (cause < 0) {
@@ -241,10 +611,30 @@ diff -urNp linux-3.1.3/arch/alpha/mm/fault.c linux-3.1.3/arch/alpha/mm/fault.c
        } else if (!cause) {
                /* Allow reads even for write-only mappings */
                if (!(vma->vm_flags & (VM_READ | VM_WRITE)))
-diff -urNp linux-3.1.3/arch/arm/include/asm/elf.h linux-3.1.3/arch/arm/include/asm/elf.h
---- linux-3.1.3/arch/arm/include/asm/elf.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/arm/include/asm/elf.h     2011-11-16 18:39:07.000000000 -0500
-@@ -116,7 +116,14 @@ int dump_task_regs(struct task_struct *t
+diff --git a/arch/arm/include/asm/atomic.h b/arch/arm/include/asm/atomic.h
+index 86976d0..8a57797 100644
+--- a/arch/arm/include/asm/atomic.h
++++ b/arch/arm/include/asm/atomic.h
+@@ -239,6 +239,14 @@ typedef struct {
+       u64 __aligned(8) counter;
+ } atomic64_t;
++#ifdef CONFIG_PAX_REFCOUNT
++typedef struct {
++      u64 __aligned(8) counter;
++} atomic64_unchecked_t;
++#else
++typedef atomic64_t atomic64_unchecked_t;
++#endif
++
+ #define ATOMIC64_INIT(i) { (i) }
+ static inline u64 atomic64_read(atomic64_t *v)
+diff --git a/arch/arm/include/asm/elf.h b/arch/arm/include/asm/elf.h
+index 0e9ce8d..6ef1e03 100644
+--- a/arch/arm/include/asm/elf.h
++++ b/arch/arm/include/asm/elf.h
+@@ -116,7 +116,14 @@ int dump_task_regs(struct task_struct *t, elf_gregset_t *elfregs);
     the loader.  We need to make sure that it is out of the way of the program
     that it will "exec", and that there is sufficient room for the brk.  */
  
@@ -260,7 +650,7 @@ diff -urNp linux-3.1.3/arch/arm/include/asm/elf.h linux-3.1.3/arch/arm/include/a
  
  /* When the program starts, a1 contains a pointer to a function to be 
     registered with atexit, as per the SVR4 ABI.  A value of 0 means we 
-@@ -126,10 +133,6 @@ int dump_task_regs(struct task_struct *t
+@@ -126,10 +133,6 @@ int dump_task_regs(struct task_struct *t, elf_gregset_t *elfregs);
  extern void elf_set_personality(const struct elf32_hdr *);
  #define SET_PERSONALITY(ex)   elf_set_personality(&(ex))
  
@@ -271,9 +661,10 @@ diff -urNp linux-3.1.3/arch/arm/include/asm/elf.h linux-3.1.3/arch/arm/include/a
  extern int vectors_user_mapping(void);
  #define arch_setup_additional_pages(bprm, uses_interp) vectors_user_mapping()
  #define ARCH_HAS_SETUP_ADDITIONAL_PAGES
-diff -urNp linux-3.1.3/arch/arm/include/asm/kmap_types.h linux-3.1.3/arch/arm/include/asm/kmap_types.h
---- linux-3.1.3/arch/arm/include/asm/kmap_types.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/arm/include/asm/kmap_types.h      2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/arm/include/asm/kmap_types.h b/arch/arm/include/asm/kmap_types.h
+index e51b1e8..32a3113 100644
+--- a/arch/arm/include/asm/kmap_types.h
++++ b/arch/arm/include/asm/kmap_types.h
 @@ -21,6 +21,7 @@ enum km_type {
        KM_L1_CACHE,
        KM_L2_CACHE,
@@ -282,9 +673,10 @@ diff -urNp linux-3.1.3/arch/arm/include/asm/kmap_types.h linux-3.1.3/arch/arm/in
        KM_TYPE_NR
  };
  
-diff -urNp linux-3.1.3/arch/arm/include/asm/uaccess.h linux-3.1.3/arch/arm/include/asm/uaccess.h
---- linux-3.1.3/arch/arm/include/asm/uaccess.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/arm/include/asm/uaccess.h 2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h
+index b293616..96310e5 100644
+--- a/arch/arm/include/asm/uaccess.h
++++ b/arch/arm/include/asm/uaccess.h
 @@ -22,6 +22,8 @@
  #define VERIFY_READ 0
  #define VERIFY_WRITE 1
@@ -320,7 +712,7 @@ diff -urNp linux-3.1.3/arch/arm/include/asm/uaccess.h linux-3.1.3/arch/arm/inclu
  extern unsigned long __must_check __copy_to_user_std(void __user *to, const void *from, unsigned long n);
  extern unsigned long __must_check __clear_user(void __user *addr, unsigned long n);
  extern unsigned long __must_check __clear_user_std(void __user *addr, unsigned long n);
-@@ -403,6 +420,9 @@ extern unsigned long __must_check __strn
+@@ -403,6 +420,9 @@ extern unsigned long __must_check __strnlen_user(const char __user *s, long n);
  
  static inline unsigned long __must_check copy_from_user(void *to, const void __user *from, unsigned long n)
  {
@@ -330,7 +722,7 @@ diff -urNp linux-3.1.3/arch/arm/include/asm/uaccess.h linux-3.1.3/arch/arm/inclu
        if (access_ok(VERIFY_READ, from, n))
                n = __copy_from_user(to, from, n);
        else /* security hole - plug it */
-@@ -412,6 +432,9 @@ static inline unsigned long __must_check
+@@ -412,6 +432,9 @@ static inline unsigned long __must_check copy_from_user(void *to, const void __u
  
  static inline unsigned long __must_check copy_to_user(void __user *to, const void *from, unsigned long n)
  {
@@ -340,9 +732,10 @@ diff -urNp linux-3.1.3/arch/arm/include/asm/uaccess.h linux-3.1.3/arch/arm/inclu
        if (access_ok(VERIFY_WRITE, to, n))
                n = __copy_to_user(to, from, n);
        return n;
-diff -urNp linux-3.1.3/arch/arm/kernel/armksyms.c linux-3.1.3/arch/arm/kernel/armksyms.c
---- linux-3.1.3/arch/arm/kernel/armksyms.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/arm/kernel/armksyms.c     2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c
+index aeef960..2966009 100644
+--- a/arch/arm/kernel/armksyms.c
++++ b/arch/arm/kernel/armksyms.c
 @@ -98,8 +98,8 @@ EXPORT_SYMBOL(__strncpy_from_user);
  #ifdef CONFIG_MMU
  EXPORT_SYMBOL(copy_page);
@@ -354,9 +747,10 @@ diff -urNp linux-3.1.3/arch/arm/kernel/armksyms.c linux-3.1.3/arch/arm/kernel/ar
  EXPORT_SYMBOL(__clear_user);
  
  EXPORT_SYMBOL(__get_user_1);
-diff -urNp linux-3.1.3/arch/arm/kernel/process.c linux-3.1.3/arch/arm/kernel/process.c
---- linux-3.1.3/arch/arm/kernel/process.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/arm/kernel/process.c      2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
+index c9d11ea..5078081 100644
+--- a/arch/arm/kernel/process.c
++++ b/arch/arm/kernel/process.c
 @@ -28,7 +28,6 @@
  #include <linux/tick.h>
  #include <linux/utsname.h>
@@ -365,7 +759,7 @@ diff -urNp linux-3.1.3/arch/arm/kernel/process.c linux-3.1.3/arch/arm/kernel/pro
  #include <linux/hw_breakpoint.h>
  #include <linux/cpuidle.h>
  
-@@ -481,12 +480,6 @@ unsigned long get_wchan(struct task_stru
+@@ -484,12 +483,6 @@ unsigned long get_wchan(struct task_struct *p)
        return 0;
  }
  
@@ -378,10 +772,11 @@ diff -urNp linux-3.1.3/arch/arm/kernel/process.c linux-3.1.3/arch/arm/kernel/pro
  #ifdef CONFIG_MMU
  /*
   * The vectors page is always readable from user space for the
-diff -urNp linux-3.1.3/arch/arm/kernel/traps.c linux-3.1.3/arch/arm/kernel/traps.c
---- linux-3.1.3/arch/arm/kernel/traps.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/arm/kernel/traps.c        2011-11-16 18:40:08.000000000 -0500
-@@ -257,6 +257,8 @@ static int __die(const char *str, int er
+diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
+index bc9f9da..c75d826 100644
+--- a/arch/arm/kernel/traps.c
++++ b/arch/arm/kernel/traps.c
+@@ -257,6 +257,8 @@ static int __die(const char *str, int err, struct thread_info *thread, struct pt
  
  static DEFINE_SPINLOCK(die_lock);
  
@@ -390,7 +785,7 @@ diff -urNp linux-3.1.3/arch/arm/kernel/traps.c linux-3.1.3/arch/arm/kernel/traps
  /*
   * This function is protected against re-entrancy.
   */
-@@ -284,6 +286,9 @@ void die(const char *str, struct pt_regs
+@@ -284,6 +286,9 @@ void die(const char *str, struct pt_regs *regs, int err)
                panic("Fatal exception in interrupt");
        if (panic_on_oops)
                panic("Fatal exception");
@@ -400,9 +795,10 @@ diff -urNp linux-3.1.3/arch/arm/kernel/traps.c linux-3.1.3/arch/arm/kernel/traps
        if (ret != NOTIFY_STOP)
                do_exit(SIGSEGV);
  }
-diff -urNp linux-3.1.3/arch/arm/lib/copy_from_user.S linux-3.1.3/arch/arm/lib/copy_from_user.S
---- linux-3.1.3/arch/arm/lib/copy_from_user.S  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/arm/lib/copy_from_user.S  2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/arm/lib/copy_from_user.S b/arch/arm/lib/copy_from_user.S
+index 66a477a..bee61d3 100644
+--- a/arch/arm/lib/copy_from_user.S
++++ b/arch/arm/lib/copy_from_user.S
 @@ -16,7 +16,7 @@
  /*
   * Prototype:
@@ -426,9 +822,10 @@ diff -urNp linux-3.1.3/arch/arm/lib/copy_from_user.S linux-3.1.3/arch/arm/lib/co
  
        .pushsection .fixup,"ax"
        .align 0
-diff -urNp linux-3.1.3/arch/arm/lib/copy_to_user.S linux-3.1.3/arch/arm/lib/copy_to_user.S
---- linux-3.1.3/arch/arm/lib/copy_to_user.S    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/arm/lib/copy_to_user.S    2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/arm/lib/copy_to_user.S b/arch/arm/lib/copy_to_user.S
+index d066df6..df28194 100644
+--- a/arch/arm/lib/copy_to_user.S
++++ b/arch/arm/lib/copy_to_user.S
 @@ -16,7 +16,7 @@
  /*
   * Prototype:
@@ -452,9 +849,10 @@ diff -urNp linux-3.1.3/arch/arm/lib/copy_to_user.S linux-3.1.3/arch/arm/lib/copy
  ENDPROC(__copy_to_user_std)
  
        .pushsection .fixup,"ax"
-diff -urNp linux-3.1.3/arch/arm/lib/uaccess.S linux-3.1.3/arch/arm/lib/uaccess.S
---- linux-3.1.3/arch/arm/lib/uaccess.S 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/arm/lib/uaccess.S 2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/arm/lib/uaccess.S b/arch/arm/lib/uaccess.S
+index d0ece2a..5ae2f39 100644
+--- a/arch/arm/lib/uaccess.S
++++ b/arch/arm/lib/uaccess.S
 @@ -20,7 +20,7 @@
  
  #define PAGE_SHIFT 12
@@ -464,7 +862,7 @@ diff -urNp linux-3.1.3/arch/arm/lib/uaccess.S linux-3.1.3/arch/arm/lib/uaccess.S
   * Purpose  : copy a block to user memory from kernel memory
   * Params   : to   - user memory
   *          : from - kernel memory
-@@ -40,7 +40,7 @@ USER(                T(strgtb) r3, [r0], #1)                 @ May f
+@@ -40,7 +40,7 @@ USER(                T(strgtb) r3, [r0], #1)                 @ May fault
                sub     r2, r2, ip
                b       .Lc2u_dest_aligned
  
@@ -473,7 +871,7 @@ diff -urNp linux-3.1.3/arch/arm/lib/uaccess.S linux-3.1.3/arch/arm/lib/uaccess.S
                stmfd   sp!, {r2, r4 - r7, lr}
                cmp     r2, #4
                blt     .Lc2u_not_enough
-@@ -278,14 +278,14 @@ USER(            T(strgeb) r3, [r0], #1)                 @ May f
+@@ -278,14 +278,14 @@ USER(            T(strgeb) r3, [r0], #1)                 @ May fault
                ldrgtb  r3, [r1], #0
  USER(         T(strgtb) r3, [r0], #1)                 @ May fault
                b       .Lc2u_finished
@@ -490,7 +888,7 @@ diff -urNp linux-3.1.3/arch/arm/lib/uaccess.S linux-3.1.3/arch/arm/lib/uaccess.S
   * Purpose  : copy a block from user memory to kernel memory
   * Params   : to   - kernel memory
   *          : from - user memory
-@@ -304,7 +304,7 @@ USER(              T(ldrgtb) r3, [r1], #1)                 @ May f
+@@ -304,7 +304,7 @@ USER(              T(ldrgtb) r3, [r1], #1)                 @ May fault
                sub     r2, r2, ip
                b       .Lcfu_dest_aligned
  
@@ -499,7 +897,7 @@ diff -urNp linux-3.1.3/arch/arm/lib/uaccess.S linux-3.1.3/arch/arm/lib/uaccess.S
                stmfd   sp!, {r0, r2, r4 - r7, lr}
                cmp     r2, #4
                blt     .Lcfu_not_enough
-@@ -544,7 +544,7 @@ USER(              T(ldrgeb) r3, [r1], #1)                 @ May f
+@@ -544,7 +544,7 @@ USER(              T(ldrgeb) r3, [r1], #1)                 @ May fault
  USER(         T(ldrgtb) r3, [r1], #1)                 @ May fault
                strgtb  r3, [r0], #1
                b       .Lcfu_finished
@@ -508,9 +906,10 @@ diff -urNp linux-3.1.3/arch/arm/lib/uaccess.S linux-3.1.3/arch/arm/lib/uaccess.S
  
                .pushsection .fixup,"ax"
                .align  0
-diff -urNp linux-3.1.3/arch/arm/lib/uaccess_with_memcpy.c linux-3.1.3/arch/arm/lib/uaccess_with_memcpy.c
---- linux-3.1.3/arch/arm/lib/uaccess_with_memcpy.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/arm/lib/uaccess_with_memcpy.c     2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/arm/lib/uaccess_with_memcpy.c b/arch/arm/lib/uaccess_with_memcpy.c
+index 8b9b136..70d5100 100644
+--- a/arch/arm/lib/uaccess_with_memcpy.c
++++ b/arch/arm/lib/uaccess_with_memcpy.c
 @@ -103,7 +103,7 @@ out:
  }
  
@@ -520,10 +919,11 @@ diff -urNp linux-3.1.3/arch/arm/lib/uaccess_with_memcpy.c linux-3.1.3/arch/arm/l
  {
        /*
         * This test is stubbed out of the main function above to keep
-diff -urNp linux-3.1.3/arch/arm/mach-ux500/mbox-db5500.c linux-3.1.3/arch/arm/mach-ux500/mbox-db5500.c
---- linux-3.1.3/arch/arm/mach-ux500/mbox-db5500.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/arm/mach-ux500/mbox-db5500.c      2011-11-16 18:40:08.000000000 -0500
-@@ -168,7 +168,7 @@ static ssize_t mbox_read_fifo(struct dev
+diff --git a/arch/arm/mach-ux500/mbox-db5500.c b/arch/arm/mach-ux500/mbox-db5500.c
+index 2b2d51c..0127490 100644
+--- a/arch/arm/mach-ux500/mbox-db5500.c
++++ b/arch/arm/mach-ux500/mbox-db5500.c
+@@ -168,7 +168,7 @@ static ssize_t mbox_read_fifo(struct device *dev,
        return sprintf(buf, "0x%X\n", mbox_value);
  }
  
@@ -532,10 +932,11 @@ diff -urNp linux-3.1.3/arch/arm/mach-ux500/mbox-db5500.c linux-3.1.3/arch/arm/ma
  
  static int mbox_show(struct seq_file *s, void *data)
  {
-diff -urNp linux-3.1.3/arch/arm/mm/fault.c linux-3.1.3/arch/arm/mm/fault.c
---- linux-3.1.3/arch/arm/mm/fault.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/arm/mm/fault.c    2011-11-16 18:39:07.000000000 -0500
-@@ -182,6 +182,13 @@ __do_user_fault(struct task_struct *tsk,
+diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
+index 3b5ea68..42fc9af 100644
+--- a/arch/arm/mm/fault.c
++++ b/arch/arm/mm/fault.c
+@@ -182,6 +182,13 @@ __do_user_fault(struct task_struct *tsk, unsigned long addr,
        }
  #endif
  
@@ -549,7 +950,7 @@ diff -urNp linux-3.1.3/arch/arm/mm/fault.c linux-3.1.3/arch/arm/mm/fault.c
        tsk->thread.address = addr;
        tsk->thread.error_code = fsr;
        tsk->thread.trap_no = 14;
-@@ -383,6 +390,33 @@ do_page_fault(unsigned long addr, unsign
+@@ -383,6 +390,33 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
  }
  #endif                                        /* CONFIG_MMU */
  
@@ -583,10 +984,11 @@ diff -urNp linux-3.1.3/arch/arm/mm/fault.c linux-3.1.3/arch/arm/mm/fault.c
  /*
   * First Level Translation Fault Handler
   *
-diff -urNp linux-3.1.3/arch/arm/mm/mmap.c linux-3.1.3/arch/arm/mm/mmap.c
---- linux-3.1.3/arch/arm/mm/mmap.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/arm/mm/mmap.c     2011-11-16 18:39:07.000000000 -0500
-@@ -65,6 +65,10 @@ arch_get_unmapped_area(struct file *filp
+diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c
+index 74be05f..f605b8c 100644
+--- a/arch/arm/mm/mmap.c
++++ b/arch/arm/mm/mmap.c
+@@ -65,6 +65,10 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
        if (len > TASK_SIZE)
                return -ENOMEM;
  
@@ -597,7 +999,7 @@ diff -urNp linux-3.1.3/arch/arm/mm/mmap.c linux-3.1.3/arch/arm/mm/mmap.c
        if (addr) {
                if (do_align)
                        addr = COLOUR_ALIGN(addr, pgoff);
-@@ -72,15 +76,14 @@ arch_get_unmapped_area(struct file *filp
+@@ -72,15 +76,14 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
                        addr = PAGE_ALIGN(addr);
  
                vma = find_vma(mm, addr);
@@ -635,10 +1037,11 @@ diff -urNp linux-3.1.3/arch/arm/mm/mmap.c linux-3.1.3/arch/arm/mm/mmap.c
                        /*
                         * Remember the place where we stopped the search:
                         */
-diff -urNp linux-3.1.3/arch/avr32/include/asm/elf.h linux-3.1.3/arch/avr32/include/asm/elf.h
---- linux-3.1.3/arch/avr32/include/asm/elf.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/avr32/include/asm/elf.h   2011-11-16 18:39:07.000000000 -0500
-@@ -84,8 +84,14 @@ typedef struct user_fpu_struct elf_fpreg
+diff --git a/arch/avr32/include/asm/elf.h b/arch/avr32/include/asm/elf.h
+index 3b3159b..425ea94 100644
+--- a/arch/avr32/include/asm/elf.h
++++ b/arch/avr32/include/asm/elf.h
+@@ -84,8 +84,14 @@ typedef struct user_fpu_struct elf_fpregset_t;
     the loader.  We need to make sure that it is out of the way of the program
     that it will "exec", and that there is sufficient room for the brk.  */
  
@@ -654,9 +1057,10 @@ diff -urNp linux-3.1.3/arch/avr32/include/asm/elf.h linux-3.1.3/arch/avr32/inclu
  
  /* This yields a mask that user programs can use to figure out what
     instruction set this CPU supports.  This could be done in user space,
-diff -urNp linux-3.1.3/arch/avr32/include/asm/kmap_types.h linux-3.1.3/arch/avr32/include/asm/kmap_types.h
---- linux-3.1.3/arch/avr32/include/asm/kmap_types.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/avr32/include/asm/kmap_types.h    2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/avr32/include/asm/kmap_types.h b/arch/avr32/include/asm/kmap_types.h
+index b7f5c68..556135c 100644
+--- a/arch/avr32/include/asm/kmap_types.h
++++ b/arch/avr32/include/asm/kmap_types.h
 @@ -22,7 +22,8 @@ D(10)        KM_IRQ0,
  D(11) KM_IRQ1,
  D(12) KM_SOFTIRQ0,
@@ -667,10 +1071,11 @@ diff -urNp linux-3.1.3/arch/avr32/include/asm/kmap_types.h linux-3.1.3/arch/avr3
  };
  
  #undef D
-diff -urNp linux-3.1.3/arch/avr32/mm/fault.c linux-3.1.3/arch/avr32/mm/fault.c
---- linux-3.1.3/arch/avr32/mm/fault.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/avr32/mm/fault.c  2011-11-16 18:39:07.000000000 -0500
-@@ -41,6 +41,23 @@ static inline int notify_page_fault(stru
+diff --git a/arch/avr32/mm/fault.c b/arch/avr32/mm/fault.c
+index f7040a1..db9f300 100644
+--- a/arch/avr32/mm/fault.c
++++ b/arch/avr32/mm/fault.c
+@@ -41,6 +41,23 @@ static inline int notify_page_fault(struct pt_regs *regs, int trap)
  
  int exception_trace = 1;
  
@@ -711,9 +1116,10 @@ diff -urNp linux-3.1.3/arch/avr32/mm/fault.c linux-3.1.3/arch/avr32/mm/fault.c
                if (exception_trace && printk_ratelimit())
                        printk("%s%s[%d]: segfault at %08lx pc %08lx "
                               "sp %08lx ecr %lu\n",
-diff -urNp linux-3.1.3/arch/frv/include/asm/kmap_types.h linux-3.1.3/arch/frv/include/asm/kmap_types.h
---- linux-3.1.3/arch/frv/include/asm/kmap_types.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/frv/include/asm/kmap_types.h      2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/frv/include/asm/kmap_types.h b/arch/frv/include/asm/kmap_types.h
+index f8e16b2..c73ff79 100644
+--- a/arch/frv/include/asm/kmap_types.h
++++ b/arch/frv/include/asm/kmap_types.h
 @@ -23,6 +23,7 @@ enum km_type {
        KM_IRQ1,
        KM_SOFTIRQ0,
@@ -722,10 +1128,11 @@ diff -urNp linux-3.1.3/arch/frv/include/asm/kmap_types.h linux-3.1.3/arch/frv/in
        KM_TYPE_NR
  };
  
-diff -urNp linux-3.1.3/arch/frv/mm/elf-fdpic.c linux-3.1.3/arch/frv/mm/elf-fdpic.c
---- linux-3.1.3/arch/frv/mm/elf-fdpic.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/frv/mm/elf-fdpic.c        2011-11-16 18:39:07.000000000 -0500
-@@ -73,8 +73,7 @@ unsigned long arch_get_unmapped_area(str
+diff --git a/arch/frv/mm/elf-fdpic.c b/arch/frv/mm/elf-fdpic.c
+index 385fd30..6c3d97e 100644
+--- a/arch/frv/mm/elf-fdpic.c
++++ b/arch/frv/mm/elf-fdpic.c
+@@ -73,8 +73,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi
        if (addr) {
                addr = PAGE_ALIGN(addr);
                vma = find_vma(current->mm, addr);
@@ -735,7 +1142,7 @@ diff -urNp linux-3.1.3/arch/frv/mm/elf-fdpic.c linux-3.1.3/arch/frv/mm/elf-fdpic
                        goto success;
        }
  
-@@ -89,7 +88,7 @@ unsigned long arch_get_unmapped_area(str
+@@ -89,7 +88,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi
                        for (; vma; vma = vma->vm_next) {
                                if (addr > limit)
                                        break;
@@ -744,7 +1151,7 @@ diff -urNp linux-3.1.3/arch/frv/mm/elf-fdpic.c linux-3.1.3/arch/frv/mm/elf-fdpic
                                        goto success;
                                addr = vma->vm_end;
                        }
-@@ -104,7 +103,7 @@ unsigned long arch_get_unmapped_area(str
+@@ -104,7 +103,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi
                for (; vma; vma = vma->vm_next) {
                        if (addr > limit)
                                break;
@@ -753,9 +1160,10 @@ diff -urNp linux-3.1.3/arch/frv/mm/elf-fdpic.c linux-3.1.3/arch/frv/mm/elf-fdpic
                                goto success;
                        addr = vma->vm_end;
                }
-diff -urNp linux-3.1.3/arch/ia64/include/asm/elf.h linux-3.1.3/arch/ia64/include/asm/elf.h
---- linux-3.1.3/arch/ia64/include/asm/elf.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/ia64/include/asm/elf.h    2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/ia64/include/asm/elf.h b/arch/ia64/include/asm/elf.h
+index b5298eb..67c6e62 100644
+--- a/arch/ia64/include/asm/elf.h
++++ b/arch/ia64/include/asm/elf.h
 @@ -42,6 +42,13 @@
   */
  #define ELF_ET_DYN_BASE               (TASK_UNMAPPED_BASE + 0x800000000UL)
@@ -770,9 +1178,10 @@ diff -urNp linux-3.1.3/arch/ia64/include/asm/elf.h linux-3.1.3/arch/ia64/include
  #define PT_IA_64_UNWIND               0x70000001
  
  /* IA-64 relocations: */
-diff -urNp linux-3.1.3/arch/ia64/include/asm/pgtable.h linux-3.1.3/arch/ia64/include/asm/pgtable.h
---- linux-3.1.3/arch/ia64/include/asm/pgtable.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/ia64/include/asm/pgtable.h        2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/ia64/include/asm/pgtable.h b/arch/ia64/include/asm/pgtable.h
+index 1a97af3..7529d31 100644
+--- a/arch/ia64/include/asm/pgtable.h
++++ b/arch/ia64/include/asm/pgtable.h
 @@ -12,7 +12,7 @@
   *    David Mosberger-Tang <davidm@hpl.hp.com>
   */
@@ -800,10 +1209,11 @@ diff -urNp linux-3.1.3/arch/ia64/include/asm/pgtable.h linux-3.1.3/arch/ia64/inc
  #define PAGE_GATE     __pgprot(__ACCESS_BITS | _PAGE_PL_0 | _PAGE_AR_X_RX)
  #define PAGE_KERNEL   __pgprot(__DIRTY_BITS  | _PAGE_PL_0 | _PAGE_AR_RWX)
  #define PAGE_KERNELRX __pgprot(__ACCESS_BITS | _PAGE_PL_0 | _PAGE_AR_RX)
-diff -urNp linux-3.1.3/arch/ia64/include/asm/spinlock.h linux-3.1.3/arch/ia64/include/asm/spinlock.h
---- linux-3.1.3/arch/ia64/include/asm/spinlock.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/ia64/include/asm/spinlock.h       2011-11-16 18:39:07.000000000 -0500
-@@ -72,7 +72,7 @@ static __always_inline void __ticket_spi
+diff --git a/arch/ia64/include/asm/spinlock.h b/arch/ia64/include/asm/spinlock.h
+index b77768d..e0795eb 100644
+--- a/arch/ia64/include/asm/spinlock.h
++++ b/arch/ia64/include/asm/spinlock.h
+@@ -72,7 +72,7 @@ static __always_inline void __ticket_spin_unlock(arch_spinlock_t *lock)
        unsigned short  *p = (unsigned short *)&lock->lock + 1, tmp;
  
        asm volatile ("ld2.bias %0=[%1]" : "=r"(tmp) : "r"(p));
@@ -812,10 +1222,11 @@ diff -urNp linux-3.1.3/arch/ia64/include/asm/spinlock.h linux-3.1.3/arch/ia64/in
  }
  
  static __always_inline void __ticket_spin_unlock_wait(arch_spinlock_t *lock)
-diff -urNp linux-3.1.3/arch/ia64/include/asm/uaccess.h linux-3.1.3/arch/ia64/include/asm/uaccess.h
---- linux-3.1.3/arch/ia64/include/asm/uaccess.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/ia64/include/asm/uaccess.h        2011-11-16 18:39:07.000000000 -0500
-@@ -257,7 +257,7 @@ __copy_from_user (void *to, const void _
+diff --git a/arch/ia64/include/asm/uaccess.h b/arch/ia64/include/asm/uaccess.h
+index 449c8c0..432a3d2 100644
+--- a/arch/ia64/include/asm/uaccess.h
++++ b/arch/ia64/include/asm/uaccess.h
+@@ -257,7 +257,7 @@ __copy_from_user (void *to, const void __user *from, unsigned long count)
        const void *__cu_from = (from);                                                 \
        long __cu_len = (n);                                                            \
                                                                                        \
@@ -824,7 +1235,7 @@ diff -urNp linux-3.1.3/arch/ia64/include/asm/uaccess.h linux-3.1.3/arch/ia64/inc
                __cu_len = __copy_user(__cu_to, (__force void __user *) __cu_from, __cu_len);   \
        __cu_len;                                                                       \
  })
-@@ -269,7 +269,7 @@ __copy_from_user (void *to, const void _
+@@ -269,7 +269,7 @@ __copy_from_user (void *to, const void __user *from, unsigned long count)
        long __cu_len = (n);                                                            \
                                                                                        \
        __chk_user_ptr(__cu_from);                                                      \
@@ -833,9 +1244,10 @@ diff -urNp linux-3.1.3/arch/ia64/include/asm/uaccess.h linux-3.1.3/arch/ia64/inc
                __cu_len = __copy_user((__force void __user *) __cu_to, __cu_from, __cu_len);   \
        __cu_len;                                                                       \
  })
-diff -urNp linux-3.1.3/arch/ia64/kernel/module.c linux-3.1.3/arch/ia64/kernel/module.c
---- linux-3.1.3/arch/ia64/kernel/module.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/ia64/kernel/module.c      2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/ia64/kernel/module.c b/arch/ia64/kernel/module.c
+index 24603be..948052d 100644
+--- a/arch/ia64/kernel/module.c
++++ b/arch/ia64/kernel/module.c
 @@ -307,8 +307,7 @@ plt_target (struct plt_entry *plt)
  void
  module_free (struct module *mod, void *module_region)
@@ -846,7 +1258,7 @@ diff -urNp linux-3.1.3/arch/ia64/kernel/module.c linux-3.1.3/arch/ia64/kernel/mo
                unw_remove_unwind_table(mod->arch.init_unw_table);
                mod->arch.init_unw_table = NULL;
        }
-@@ -494,15 +493,39 @@ module_frob_arch_sections (Elf_Ehdr *ehd
+@@ -494,15 +493,39 @@ module_frob_arch_sections (Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, char *secstrings,
  }
  
  static inline int
@@ -888,7 +1300,7 @@ diff -urNp linux-3.1.3/arch/ia64/kernel/module.c linux-3.1.3/arch/ia64/kernel/mo
  }
  
  static inline int
-@@ -685,7 +708,14 @@ do_reloc (struct module *mod, uint8_t r_
+@@ -685,7 +708,14 @@ do_reloc (struct module *mod, uint8_t r_type, Elf64_Sym *sym, uint64_t addend,
                break;
  
              case RV_BDREL:
@@ -904,7 +1316,7 @@ diff -urNp linux-3.1.3/arch/ia64/kernel/module.c linux-3.1.3/arch/ia64/kernel/mo
                break;
  
              case RV_LTV:
-@@ -820,15 +850,15 @@ apply_relocate_add (Elf64_Shdr *sechdrs,
+@@ -820,15 +850,15 @@ apply_relocate_add (Elf64_Shdr *sechdrs, const char *strtab, unsigned int symind
                 *     addresses have been selected...
                 */
                uint64_t gp;
@@ -924,10 +1336,11 @@ diff -urNp linux-3.1.3/arch/ia64/kernel/module.c linux-3.1.3/arch/ia64/kernel/mo
                mod->arch.gp = gp;
                DEBUGP("%s: placing gp at 0x%lx\n", __func__, gp);
        }
-diff -urNp linux-3.1.3/arch/ia64/kernel/sys_ia64.c linux-3.1.3/arch/ia64/kernel/sys_ia64.c
---- linux-3.1.3/arch/ia64/kernel/sys_ia64.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/ia64/kernel/sys_ia64.c    2011-11-16 18:39:07.000000000 -0500
-@@ -43,6 +43,13 @@ arch_get_unmapped_area (struct file *fil
+diff --git a/arch/ia64/kernel/sys_ia64.c b/arch/ia64/kernel/sys_ia64.c
+index 609d500..7dde2a8 100644
+--- a/arch/ia64/kernel/sys_ia64.c
++++ b/arch/ia64/kernel/sys_ia64.c
+@@ -43,6 +43,13 @@ arch_get_unmapped_area (struct file *filp, unsigned long addr, unsigned long len
        if (REGION_NUMBER(addr) == RGN_HPAGE)
                addr = 0;
  #endif
@@ -941,7 +1354,7 @@ diff -urNp linux-3.1.3/arch/ia64/kernel/sys_ia64.c linux-3.1.3/arch/ia64/kernel/
        if (!addr)
                addr = mm->free_area_cache;
  
-@@ -61,14 +68,14 @@ arch_get_unmapped_area (struct file *fil
+@@ -61,14 +68,14 @@ arch_get_unmapped_area (struct file *filp, unsigned long addr, unsigned long len
        for (vma = find_vma(mm, addr); ; vma = vma->vm_next) {
                /* At this point:  (!vma || addr < vma->vm_end). */
                if (TASK_SIZE - len < addr || RGN_MAP_LIMIT - len < REGION_OFFSET(addr)) {
@@ -959,9 +1372,10 @@ diff -urNp linux-3.1.3/arch/ia64/kernel/sys_ia64.c linux-3.1.3/arch/ia64/kernel/
                        /* Remember the address where we stopped this search:  */
                        mm->free_area_cache = addr + len;
                        return addr;
-diff -urNp linux-3.1.3/arch/ia64/kernel/vmlinux.lds.S linux-3.1.3/arch/ia64/kernel/vmlinux.lds.S
---- linux-3.1.3/arch/ia64/kernel/vmlinux.lds.S 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/ia64/kernel/vmlinux.lds.S 2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S
+index 53c0ba0..2accdde 100644
+--- a/arch/ia64/kernel/vmlinux.lds.S
++++ b/arch/ia64/kernel/vmlinux.lds.S
 @@ -199,7 +199,7 @@ SECTIONS {
        /* Per-cpu data: */
        . = ALIGN(PERCPU_PAGE_SIZE);
@@ -971,10 +1385,11 @@ diff -urNp linux-3.1.3/arch/ia64/kernel/vmlinux.lds.S linux-3.1.3/arch/ia64/kern
        /*
         * ensure percpu data fits
         * into percpu page size
-diff -urNp linux-3.1.3/arch/ia64/mm/fault.c linux-3.1.3/arch/ia64/mm/fault.c
---- linux-3.1.3/arch/ia64/mm/fault.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/ia64/mm/fault.c   2011-11-16 18:39:07.000000000 -0500
-@@ -73,6 +73,23 @@ mapped_kernel_page_is_present (unsigned 
+diff --git a/arch/ia64/mm/fault.c b/arch/ia64/mm/fault.c
+index 20b3593..1ce77f0 100644
+--- a/arch/ia64/mm/fault.c
++++ b/arch/ia64/mm/fault.c
+@@ -73,6 +73,23 @@ mapped_kernel_page_is_present (unsigned long address)
        return pte_present(pte);
  }
  
@@ -998,7 +1413,7 @@ diff -urNp linux-3.1.3/arch/ia64/mm/fault.c linux-3.1.3/arch/ia64/mm/fault.c
  void __kprobes
  ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *regs)
  {
-@@ -146,9 +163,23 @@ ia64_do_page_fault (unsigned long addres
+@@ -146,9 +163,23 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re
        mask = (  (((isr >> IA64_ISR_X_BIT) & 1UL) << VM_EXEC_BIT)
                | (((isr >> IA64_ISR_W_BIT) & 1UL) << VM_WRITE_BIT));
  
@@ -1023,10 +1438,11 @@ diff -urNp linux-3.1.3/arch/ia64/mm/fault.c linux-3.1.3/arch/ia64/mm/fault.c
        /*
         * If for any reason at all we couldn't handle the fault, make
         * sure we exit gracefully rather than endlessly redo the
-diff -urNp linux-3.1.3/arch/ia64/mm/hugetlbpage.c linux-3.1.3/arch/ia64/mm/hugetlbpage.c
---- linux-3.1.3/arch/ia64/mm/hugetlbpage.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/ia64/mm/hugetlbpage.c     2011-11-16 18:39:07.000000000 -0500
-@@ -171,7 +171,7 @@ unsigned long hugetlb_get_unmapped_area(
+diff --git a/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c
+index 5ca674b..e0e1b70 100644
+--- a/arch/ia64/mm/hugetlbpage.c
++++ b/arch/ia64/mm/hugetlbpage.c
+@@ -171,7 +171,7 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, u
                /* At this point:  (!vmm || addr < vmm->vm_end). */
                if (REGION_OFFSET(addr) + len > RGN_MAP_LIMIT)
                        return -ENOMEM;
@@ -1035,9 +1451,10 @@ diff -urNp linux-3.1.3/arch/ia64/mm/hugetlbpage.c linux-3.1.3/arch/ia64/mm/huget
                        return addr;
                addr = ALIGN(vmm->vm_end, HPAGE_SIZE);
        }
-diff -urNp linux-3.1.3/arch/ia64/mm/init.c linux-3.1.3/arch/ia64/mm/init.c
---- linux-3.1.3/arch/ia64/mm/init.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/ia64/mm/init.c    2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
+index 00cb0e2..2ad8024 100644
+--- a/arch/ia64/mm/init.c
++++ b/arch/ia64/mm/init.c
 @@ -120,6 +120,19 @@ ia64_init_addr_space (void)
                vma->vm_start = current->thread.rbs_bot & PAGE_MASK;
                vma->vm_end = vma->vm_start + PAGE_SIZE;
@@ -1058,9 +1475,10 @@ diff -urNp linux-3.1.3/arch/ia64/mm/init.c linux-3.1.3/arch/ia64/mm/init.c
                vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
                down_write(&current->mm->mmap_sem);
                if (insert_vm_struct(current->mm, vma)) {
-diff -urNp linux-3.1.3/arch/m32r/lib/usercopy.c linux-3.1.3/arch/m32r/lib/usercopy.c
---- linux-3.1.3/arch/m32r/lib/usercopy.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/m32r/lib/usercopy.c       2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/m32r/lib/usercopy.c b/arch/m32r/lib/usercopy.c
+index 82abd15..d95ae5d 100644
+--- a/arch/m32r/lib/usercopy.c
++++ b/arch/m32r/lib/usercopy.c
 @@ -14,6 +14,9 @@
  unsigned long
  __generic_copy_to_user(void __user *to, const void *from, unsigned long n)
@@ -1071,7 +1489,7 @@ diff -urNp linux-3.1.3/arch/m32r/lib/usercopy.c linux-3.1.3/arch/m32r/lib/userco
        prefetch(from);
        if (access_ok(VERIFY_WRITE, to, n))
                __copy_user(to,from,n);
-@@ -23,6 +26,9 @@ __generic_copy_to_user(void __user *to, 
+@@ -23,6 +26,9 @@ __generic_copy_to_user(void __user *to, const void *from, unsigned long n)
  unsigned long
  __generic_copy_from_user(void *to, const void __user *from, unsigned long n)
  {
@@ -1081,9 +1499,10 @@ diff -urNp linux-3.1.3/arch/m32r/lib/usercopy.c linux-3.1.3/arch/m32r/lib/userco
        prefetchw(to);
        if (access_ok(VERIFY_READ, from, n))
                __copy_user_zeroing(to,from,n);
-diff -urNp linux-3.1.3/arch/mips/include/asm/elf.h linux-3.1.3/arch/mips/include/asm/elf.h
---- linux-3.1.3/arch/mips/include/asm/elf.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/mips/include/asm/elf.h    2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/mips/include/asm/elf.h b/arch/mips/include/asm/elf.h
+index 455c0ac..ad65fbe 100644
+--- a/arch/mips/include/asm/elf.h
++++ b/arch/mips/include/asm/elf.h
 @@ -372,13 +372,16 @@ extern const char *__elf_platform;
  #define ELF_ET_DYN_BASE         (TASK_SIZE / 3 * 2)
  #endif
@@ -1105,10 +1524,11 @@ diff -urNp linux-3.1.3/arch/mips/include/asm/elf.h linux-3.1.3/arch/mips/include
 -#define arch_randomize_brk arch_randomize_brk
 -
  #endif /* _ASM_ELF_H */
-diff -urNp linux-3.1.3/arch/mips/include/asm/page.h linux-3.1.3/arch/mips/include/asm/page.h
---- linux-3.1.3/arch/mips/include/asm/page.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/mips/include/asm/page.h   2011-11-16 18:39:07.000000000 -0500
-@@ -93,7 +93,7 @@ extern void copy_user_highpage(struct pa
+diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
+index e59cd1a..8e329d6 100644
+--- a/arch/mips/include/asm/page.h
++++ b/arch/mips/include/asm/page.h
+@@ -93,7 +93,7 @@ extern void copy_user_highpage(struct page *to, struct page *from,
    #ifdef CONFIG_CPU_MIPS32
      typedef struct { unsigned long pte_low, pte_high; } pte_t;
      #define pte_val(x)    ((x).pte_low | ((unsigned long long)(x).pte_high << 32))
@@ -1117,9 +1537,10 @@ diff -urNp linux-3.1.3/arch/mips/include/asm/page.h linux-3.1.3/arch/mips/includ
    #else
       typedef struct { unsigned long long pte; } pte_t;
       #define pte_val(x)       ((x).pte)
-diff -urNp linux-3.1.3/arch/mips/include/asm/system.h linux-3.1.3/arch/mips/include/asm/system.h
---- linux-3.1.3/arch/mips/include/asm/system.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/mips/include/asm/system.h 2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/mips/include/asm/system.h b/arch/mips/include/asm/system.h
+index 6018c80..7c37203 100644
+--- a/arch/mips/include/asm/system.h
++++ b/arch/mips/include/asm/system.h
 @@ -230,6 +230,6 @@ extern void per_cpu_trap_init(void);
   */
  #define __ARCH_WANT_UNLOCKED_CTXSW
@@ -1128,10 +1549,11 @@ diff -urNp linux-3.1.3/arch/mips/include/asm/system.h linux-3.1.3/arch/mips/incl
 +#define arch_align_stack(x) ((x) & ~0xfUL)
  
  #endif /* _ASM_SYSTEM_H */
-diff -urNp linux-3.1.3/arch/mips/kernel/binfmt_elfn32.c linux-3.1.3/arch/mips/kernel/binfmt_elfn32.c
---- linux-3.1.3/arch/mips/kernel/binfmt_elfn32.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/mips/kernel/binfmt_elfn32.c       2011-11-16 18:39:07.000000000 -0500
-@@ -50,6 +50,13 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_N
+diff --git a/arch/mips/kernel/binfmt_elfn32.c b/arch/mips/kernel/binfmt_elfn32.c
+index 9fdd8bc..4bd7f1a 100644
+--- a/arch/mips/kernel/binfmt_elfn32.c
++++ b/arch/mips/kernel/binfmt_elfn32.c
+@@ -50,6 +50,13 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
  #undef ELF_ET_DYN_BASE
  #define ELF_ET_DYN_BASE         (TASK32_SIZE / 3 * 2)
  
@@ -1145,10 +1567,11 @@ diff -urNp linux-3.1.3/arch/mips/kernel/binfmt_elfn32.c linux-3.1.3/arch/mips/ke
  #include <asm/processor.h>
  #include <linux/module.h>
  #include <linux/elfcore.h>
-diff -urNp linux-3.1.3/arch/mips/kernel/binfmt_elfo32.c linux-3.1.3/arch/mips/kernel/binfmt_elfo32.c
---- linux-3.1.3/arch/mips/kernel/binfmt_elfo32.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/mips/kernel/binfmt_elfo32.c       2011-11-16 18:39:07.000000000 -0500
-@@ -52,6 +52,13 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_N
+diff --git a/arch/mips/kernel/binfmt_elfo32.c b/arch/mips/kernel/binfmt_elfo32.c
+index ff44823..97f8906 100644
+--- a/arch/mips/kernel/binfmt_elfo32.c
++++ b/arch/mips/kernel/binfmt_elfo32.c
+@@ -52,6 +52,13 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
  #undef ELF_ET_DYN_BASE
  #define ELF_ET_DYN_BASE         (TASK32_SIZE / 3 * 2)
  
@@ -1162,10 +1585,11 @@ diff -urNp linux-3.1.3/arch/mips/kernel/binfmt_elfo32.c linux-3.1.3/arch/mips/ke
  #include <asm/processor.h>
  
  /*
-diff -urNp linux-3.1.3/arch/mips/kernel/process.c linux-3.1.3/arch/mips/kernel/process.c
---- linux-3.1.3/arch/mips/kernel/process.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/mips/kernel/process.c     2011-11-16 18:39:07.000000000 -0500
-@@ -481,15 +481,3 @@ unsigned long get_wchan(struct task_stru
+diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
+index b30cb25..454c0a9 100644
+--- a/arch/mips/kernel/process.c
++++ b/arch/mips/kernel/process.c
+@@ -481,15 +481,3 @@ unsigned long get_wchan(struct task_struct *task)
  out:
        return pc;
  }
@@ -1181,9 +1605,10 @@ diff -urNp linux-3.1.3/arch/mips/kernel/process.c linux-3.1.3/arch/mips/kernel/p
 -
 -      return sp & ALMASK;
 -}
-diff -urNp linux-3.1.3/arch/mips/mm/fault.c linux-3.1.3/arch/mips/mm/fault.c
---- linux-3.1.3/arch/mips/mm/fault.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/mips/mm/fault.c   2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c
+index 937cf33..adb39bb 100644
+--- a/arch/mips/mm/fault.c
++++ b/arch/mips/mm/fault.c
 @@ -28,6 +28,23 @@
  #include <asm/highmem.h>              /* For VMALLOC_END */
  #include <linux/kdebug.h>
@@ -1208,10 +1633,11 @@ diff -urNp linux-3.1.3/arch/mips/mm/fault.c linux-3.1.3/arch/mips/mm/fault.c
  /*
   * This routine handles page faults.  It determines the address,
   * and the problem, and then passes it off to one of the appropriate
-diff -urNp linux-3.1.3/arch/mips/mm/mmap.c linux-3.1.3/arch/mips/mm/mmap.c
---- linux-3.1.3/arch/mips/mm/mmap.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/mips/mm/mmap.c    2011-11-16 18:39:07.000000000 -0500
-@@ -95,6 +95,11 @@ static unsigned long arch_get_unmapped_a
+diff --git a/arch/mips/mm/mmap.c b/arch/mips/mm/mmap.c
+index 302d779..7d35bf8 100644
+--- a/arch/mips/mm/mmap.c
++++ b/arch/mips/mm/mmap.c
+@@ -95,6 +95,11 @@ static unsigned long arch_get_unmapped_area_common(struct file *filp,
                do_color_align = 1;
  
        /* requesting a specific address */
@@ -1223,7 +1649,7 @@ diff -urNp linux-3.1.3/arch/mips/mm/mmap.c linux-3.1.3/arch/mips/mm/mmap.c
        if (addr) {
                if (do_color_align)
                        addr = COLOUR_ALIGN(addr, pgoff);
-@@ -102,8 +107,7 @@ static unsigned long arch_get_unmapped_a
+@@ -102,8 +107,7 @@ static unsigned long arch_get_unmapped_area_common(struct file *filp,
                        addr = PAGE_ALIGN(addr);
  
                vma = find_vma(mm, addr);
@@ -1233,7 +1659,7 @@ diff -urNp linux-3.1.3/arch/mips/mm/mmap.c linux-3.1.3/arch/mips/mm/mmap.c
                        return addr;
        }
  
-@@ -118,7 +122,7 @@ static unsigned long arch_get_unmapped_a
+@@ -118,7 +122,7 @@ static unsigned long arch_get_unmapped_area_common(struct file *filp,
                        /* At this point:  (!vma || addr < vma->vm_end). */
                        if (TASK_SIZE - len < addr)
                                return -ENOMEM;
@@ -1242,7 +1668,7 @@ diff -urNp linux-3.1.3/arch/mips/mm/mmap.c linux-3.1.3/arch/mips/mm/mmap.c
                                return addr;
                        addr = vma->vm_end;
                        if (do_color_align)
-@@ -145,7 +149,7 @@ static unsigned long arch_get_unmapped_a
+@@ -145,7 +149,7 @@ static unsigned long arch_get_unmapped_area_common(struct file *filp,
                /* make sure it can fit in the remaining address space */
                if (likely(addr > len)) {
                        vma = find_vma(mm, addr - len);
@@ -1251,7 +1677,7 @@ diff -urNp linux-3.1.3/arch/mips/mm/mmap.c linux-3.1.3/arch/mips/mm/mmap.c
                                /* cache the address as a hint for next time */
                                return mm->free_area_cache = addr - len;
                        }
-@@ -165,7 +169,7 @@ static unsigned long arch_get_unmapped_a
+@@ -165,7 +169,7 @@ static unsigned long arch_get_unmapped_area_common(struct file *filp,
                         * return with success:
                         */
                        vma = find_vma(mm, addr);
@@ -1260,7 +1686,7 @@ diff -urNp linux-3.1.3/arch/mips/mm/mmap.c linux-3.1.3/arch/mips/mm/mmap.c
                                /* cache the address as a hint for next time */
                                return mm->free_area_cache = addr;
                        }
-@@ -242,30 +246,3 @@ void arch_pick_mmap_layout(struct mm_str
+@@ -242,30 +246,3 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
                mm->unmap_area = arch_unmap_area_topdown;
        }
  }
@@ -1291,10 +1717,11 @@ diff -urNp linux-3.1.3/arch/mips/mm/mmap.c linux-3.1.3/arch/mips/mm/mmap.c
 -
 -      return ret;
 -}
-diff -urNp linux-3.1.3/arch/parisc/include/asm/elf.h linux-3.1.3/arch/parisc/include/asm/elf.h
---- linux-3.1.3/arch/parisc/include/asm/elf.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/parisc/include/asm/elf.h  2011-11-16 18:39:07.000000000 -0500
-@@ -342,6 +342,13 @@ struct pt_regs;   /* forward declaration..
+diff --git a/arch/parisc/include/asm/elf.h b/arch/parisc/include/asm/elf.h
+index 19f6cb1..6c78cf2 100644
+--- a/arch/parisc/include/asm/elf.h
++++ b/arch/parisc/include/asm/elf.h
+@@ -342,6 +342,13 @@ struct pt_regs;   /* forward declaration... */
  
  #define ELF_ET_DYN_BASE         (TASK_UNMAPPED_BASE + 0x01000000)
  
@@ -1308,9 +1735,10 @@ diff -urNp linux-3.1.3/arch/parisc/include/asm/elf.h linux-3.1.3/arch/parisc/inc
  /* This yields a mask that user programs can use to figure out what
     instruction set this CPU supports.  This could be done in user space,
     but it's not easy, and we've already done it here.  */
-diff -urNp linux-3.1.3/arch/parisc/include/asm/pgtable.h linux-3.1.3/arch/parisc/include/asm/pgtable.h
---- linux-3.1.3/arch/parisc/include/asm/pgtable.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/parisc/include/asm/pgtable.h      2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/parisc/include/asm/pgtable.h b/arch/parisc/include/asm/pgtable.h
+index 22dadeb..f6c2be4 100644
+--- a/arch/parisc/include/asm/pgtable.h
++++ b/arch/parisc/include/asm/pgtable.h
 @@ -210,6 +210,17 @@ struct vm_area_struct;
  #define PAGE_EXECREAD   __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_READ | _PAGE_EXEC |_PAGE_ACCESSED)
  #define PAGE_COPY       PAGE_EXECREAD
@@ -1329,9 +1757,10 @@ diff -urNp linux-3.1.3/arch/parisc/include/asm/pgtable.h linux-3.1.3/arch/parisc
  #define PAGE_KERNEL   __pgprot(_PAGE_KERNEL)
  #define PAGE_KERNEL_EXEC      __pgprot(_PAGE_KERNEL_EXEC)
  #define PAGE_KERNEL_RWX       __pgprot(_PAGE_KERNEL_RWX)
-diff -urNp linux-3.1.3/arch/parisc/kernel/module.c linux-3.1.3/arch/parisc/kernel/module.c
---- linux-3.1.3/arch/parisc/kernel/module.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/parisc/kernel/module.c    2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c
+index 5e34ccf..672bc9c 100644
+--- a/arch/parisc/kernel/module.c
++++ b/arch/parisc/kernel/module.c
 @@ -98,16 +98,38 @@
  
  /* three functions to determine where in the module core
@@ -1375,28 +1804,27 @@ diff -urNp linux-3.1.3/arch/parisc/kernel/module.c linux-3.1.3/arch/parisc/kerne
  }
  
  static inline int in_local(struct module *me, void *loc)
-@@ -373,13 +395,13 @@ int module_frob_arch_sections(CONST Elf_
+@@ -373,13 +395,13 @@ int module_frob_arch_sections(CONST Elf_Ehdr *hdr,
        }
  
        /* align things a bit */
 -      me->core_size = ALIGN(me->core_size, 16);
 -      me->arch.got_offset = me->core_size;
 -      me->core_size += gots * sizeof(struct got_entry);
--
--      me->core_size = ALIGN(me->core_size, 16);
--      me->arch.fdesc_offset = me->core_size;
--      me->core_size += fdescs * sizeof(Elf_Fdesc);
 +      me->core_size_rw = ALIGN(me->core_size_rw, 16);
 +      me->arch.got_offset = me->core_size_rw;
 +      me->core_size_rw += gots * sizeof(struct got_entry);
-+
+-      me->core_size = ALIGN(me->core_size, 16);
+-      me->arch.fdesc_offset = me->core_size;
+-      me->core_size += fdescs * sizeof(Elf_Fdesc);
 +      me->core_size_rw = ALIGN(me->core_size_rw, 16);
 +      me->arch.fdesc_offset = me->core_size_rw;
 +      me->core_size_rw += fdescs * sizeof(Elf_Fdesc);
  
        me->arch.got_max = gots;
        me->arch.fdesc_max = fdescs;
-@@ -397,7 +419,7 @@ static Elf64_Word get_got(struct module 
+@@ -397,7 +419,7 @@ static Elf64_Word get_got(struct module *me, unsigned long value, long addend)
  
        BUG_ON(value == 0);
  
@@ -1405,7 +1833,7 @@ diff -urNp linux-3.1.3/arch/parisc/kernel/module.c linux-3.1.3/arch/parisc/kerne
        for (i = 0; got[i].addr; i++)
                if (got[i].addr == value)
                        goto out;
-@@ -415,7 +437,7 @@ static Elf64_Word get_got(struct module 
+@@ -415,7 +437,7 @@ static Elf64_Word get_got(struct module *me, unsigned long value, long addend)
  #ifdef CONFIG_64BIT
  static Elf_Addr get_fdesc(struct module *me, unsigned long value)
  {
@@ -1414,7 +1842,7 @@ diff -urNp linux-3.1.3/arch/parisc/kernel/module.c linux-3.1.3/arch/parisc/kerne
  
        if (!value) {
                printk(KERN_ERR "%s: zero OPD requested!\n", me->name);
-@@ -433,7 +455,7 @@ static Elf_Addr get_fdesc(struct module 
+@@ -433,7 +455,7 @@ static Elf_Addr get_fdesc(struct module *me, unsigned long value)
  
        /* Create new one */
        fdesc->addr = value;
@@ -1432,10 +1860,11 @@ diff -urNp linux-3.1.3/arch/parisc/kernel/module.c linux-3.1.3/arch/parisc/kerne
  
        DEBUGP("register_unwind_table(), sect = %d at 0x%p - 0x%p (gp=0x%lx)\n",
               me->arch.unwind_section, table, end, gp);
-diff -urNp linux-3.1.3/arch/parisc/kernel/sys_parisc.c linux-3.1.3/arch/parisc/kernel/sys_parisc.c
---- linux-3.1.3/arch/parisc/kernel/sys_parisc.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/parisc/kernel/sys_parisc.c        2011-11-16 18:39:07.000000000 -0500
-@@ -43,7 +43,7 @@ static unsigned long get_unshared_area(u
+diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c
+index c9b9322..02d8940 100644
+--- a/arch/parisc/kernel/sys_parisc.c
++++ b/arch/parisc/kernel/sys_parisc.c
+@@ -43,7 +43,7 @@ static unsigned long get_unshared_area(unsigned long addr, unsigned long len)
                /* At this point:  (!vma || addr < vma->vm_end). */
                if (TASK_SIZE - len < addr)
                        return -ENOMEM;
@@ -1444,7 +1873,7 @@ diff -urNp linux-3.1.3/arch/parisc/kernel/sys_parisc.c linux-3.1.3/arch/parisc/k
                        return addr;
                addr = vma->vm_end;
        }
-@@ -79,7 +79,7 @@ static unsigned long get_shared_area(str
+@@ -79,7 +79,7 @@ static unsigned long get_shared_area(struct address_space *mapping,
                /* At this point:  (!vma || addr < vma->vm_end). */
                if (TASK_SIZE - len < addr)
                        return -ENOMEM;
@@ -1453,7 +1882,7 @@ diff -urNp linux-3.1.3/arch/parisc/kernel/sys_parisc.c linux-3.1.3/arch/parisc/k
                        return addr;
                addr = DCACHE_ALIGN(vma->vm_end - offset) + offset;
                if (addr < vma->vm_end) /* handle wraparound */
-@@ -98,7 +98,7 @@ unsigned long arch_get_unmapped_area(str
+@@ -98,7 +98,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
        if (flags & MAP_FIXED)
                return addr;
        if (!addr)
@@ -1462,10 +1891,11 @@ diff -urNp linux-3.1.3/arch/parisc/kernel/sys_parisc.c linux-3.1.3/arch/parisc/k
  
        if (filp) {
                addr = get_shared_area(filp->f_mapping, addr, len, pgoff);
-diff -urNp linux-3.1.3/arch/parisc/kernel/traps.c linux-3.1.3/arch/parisc/kernel/traps.c
---- linux-3.1.3/arch/parisc/kernel/traps.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/parisc/kernel/traps.c     2011-11-16 18:39:07.000000000 -0500
-@@ -733,9 +733,7 @@ void notrace handle_interruption(int cod
+diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c
+index f19e660..414fe24 100644
+--- a/arch/parisc/kernel/traps.c
++++ b/arch/parisc/kernel/traps.c
+@@ -733,9 +733,7 @@ void notrace handle_interruption(int code, struct pt_regs *regs)
  
                        down_read(&current->mm->mmap_sem);
                        vma = find_vma(current->mm,regs->iaoq[0]);
@@ -1476,9 +1906,10 @@ diff -urNp linux-3.1.3/arch/parisc/kernel/traps.c linux-3.1.3/arch/parisc/kernel
                                fault_address = regs->iaoq[0];
                                fault_space = regs->iasq[0];
  
-diff -urNp linux-3.1.3/arch/parisc/mm/fault.c linux-3.1.3/arch/parisc/mm/fault.c
---- linux-3.1.3/arch/parisc/mm/fault.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/parisc/mm/fault.c 2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c
+index 18162ce..94de376 100644
+--- a/arch/parisc/mm/fault.c
++++ b/arch/parisc/mm/fault.c
 @@ -15,6 +15,7 @@
  #include <linux/sched.h>
  #include <linux/interrupt.h>
@@ -1487,7 +1918,7 @@ diff -urNp linux-3.1.3/arch/parisc/mm/fault.c linux-3.1.3/arch/parisc/mm/fault.c
  
  #include <asm/uaccess.h>
  #include <asm/traps.h>
-@@ -52,7 +53,7 @@ DEFINE_PER_CPU(struct exception_data, ex
+@@ -52,7 +53,7 @@ DEFINE_PER_CPU(struct exception_data, exception_data);
  static unsigned long
  parisc_acctyp(unsigned long code, unsigned int inst)
  {
@@ -1496,7 +1927,7 @@ diff -urNp linux-3.1.3/arch/parisc/mm/fault.c linux-3.1.3/arch/parisc/mm/fault.c
            return VM_EXEC;
  
        switch (inst & 0xf0000000) {
-@@ -138,6 +139,116 @@ parisc_acctyp(unsigned long code, unsign
+@@ -138,6 +139,116 @@ parisc_acctyp(unsigned long code, unsigned int inst)
                        }
  #endif
  
@@ -1648,10 +2079,11 @@ diff -urNp linux-3.1.3/arch/parisc/mm/fault.c linux-3.1.3/arch/parisc/mm/fault.c
  
        /*
         * If for any reason at all we couldn't handle the fault, make
-diff -urNp linux-3.1.3/arch/powerpc/include/asm/elf.h linux-3.1.3/arch/powerpc/include/asm/elf.h
---- linux-3.1.3/arch/powerpc/include/asm/elf.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/powerpc/include/asm/elf.h 2011-11-16 18:39:07.000000000 -0500
-@@ -178,8 +178,19 @@ typedef elf_fpreg_t elf_vsrreghalf_t32[E
+diff --git a/arch/powerpc/include/asm/elf.h b/arch/powerpc/include/asm/elf.h
+index 3bf9cca..e7457d0 100644
+--- a/arch/powerpc/include/asm/elf.h
++++ b/arch/powerpc/include/asm/elf.h
+@@ -178,8 +178,19 @@ typedef elf_fpreg_t elf_vsrreghalf_t32[ELF_NVSRHALFREG];
     the loader.  We need to make sure that it is out of the way of the program
     that it will "exec", and that there is sufficient room for the brk.  */
  
@@ -1673,7 +2105,7 @@ diff -urNp linux-3.1.3/arch/powerpc/include/asm/elf.h linux-3.1.3/arch/powerpc/i
  
  /*
   * Our registers are always unsigned longs, whether we're a 32 bit
-@@ -274,9 +285,6 @@ extern int arch_setup_additional_pages(s
+@@ -274,9 +285,6 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm,
        (0x7ff >> (PAGE_SHIFT - 12)) : \
        (0x3ffff >> (PAGE_SHIFT - 12)))
  
@@ -1683,9 +2115,10 @@ diff -urNp linux-3.1.3/arch/powerpc/include/asm/elf.h linux-3.1.3/arch/powerpc/i
  #endif /* __KERNEL__ */
  
  /*
-diff -urNp linux-3.1.3/arch/powerpc/include/asm/kmap_types.h linux-3.1.3/arch/powerpc/include/asm/kmap_types.h
---- linux-3.1.3/arch/powerpc/include/asm/kmap_types.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/powerpc/include/asm/kmap_types.h  2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/powerpc/include/asm/kmap_types.h b/arch/powerpc/include/asm/kmap_types.h
+index bca8fdc..61e9580 100644
+--- a/arch/powerpc/include/asm/kmap_types.h
++++ b/arch/powerpc/include/asm/kmap_types.h
 @@ -27,6 +27,7 @@ enum km_type {
        KM_PPC_SYNC_PAGE,
        KM_PPC_SYNC_ICACHE,
@@ -1694,10 +2127,11 @@ diff -urNp linux-3.1.3/arch/powerpc/include/asm/kmap_types.h linux-3.1.3/arch/po
        KM_TYPE_NR
  };
  
-diff -urNp linux-3.1.3/arch/powerpc/include/asm/mman.h linux-3.1.3/arch/powerpc/include/asm/mman.h
---- linux-3.1.3/arch/powerpc/include/asm/mman.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/powerpc/include/asm/mman.h        2011-11-16 18:39:07.000000000 -0500
-@@ -44,7 +44,7 @@ static inline unsigned long arch_calc_vm
+diff --git a/arch/powerpc/include/asm/mman.h b/arch/powerpc/include/asm/mman.h
+index d4a7f64..451de1c 100644
+--- a/arch/powerpc/include/asm/mman.h
++++ b/arch/powerpc/include/asm/mman.h
+@@ -44,7 +44,7 @@ static inline unsigned long arch_calc_vm_prot_bits(unsigned long prot)
  }
  #define arch_calc_vm_prot_bits(prot) arch_calc_vm_prot_bits(prot)
  
@@ -1706,33 +2140,10 @@ diff -urNp linux-3.1.3/arch/powerpc/include/asm/mman.h linux-3.1.3/arch/powerpc/
  {
        return (vm_flags & VM_SAO) ? __pgprot(_PAGE_SAO) : __pgprot(0);
  }
-diff -urNp linux-3.1.3/arch/powerpc/include/asm/page_64.h linux-3.1.3/arch/powerpc/include/asm/page_64.h
---- linux-3.1.3/arch/powerpc/include/asm/page_64.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/powerpc/include/asm/page_64.h     2011-11-16 18:39:07.000000000 -0500
-@@ -155,15 +155,18 @@ do {                                             \
-  * stack by default, so in the absence of a PT_GNU_STACK program header
-  * we turn execute permission off.
-  */
--#define VM_STACK_DEFAULT_FLAGS32      (VM_READ | VM_WRITE | VM_EXEC | \
--                                       VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
-+#define VM_STACK_DEFAULT_FLAGS32 \
-+      (((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0) | \
-+       VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
- #define VM_STACK_DEFAULT_FLAGS64      (VM_READ | VM_WRITE | \
-                                        VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
-+#ifndef CONFIG_PAX_PAGEEXEC
- #define VM_STACK_DEFAULT_FLAGS \
-       (is_32bit_task() ? \
-        VM_STACK_DEFAULT_FLAGS32 : VM_STACK_DEFAULT_FLAGS64)
-+#endif
- #include <asm-generic/getorder.h>
-diff -urNp linux-3.1.3/arch/powerpc/include/asm/page.h linux-3.1.3/arch/powerpc/include/asm/page.h
---- linux-3.1.3/arch/powerpc/include/asm/page.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/powerpc/include/asm/page.h        2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
+index 2cd664e..1d2e8a7 100644
+--- a/arch/powerpc/include/asm/page.h
++++ b/arch/powerpc/include/asm/page.h
 @@ -129,8 +129,9 @@ extern phys_addr_t kernstart_addr;
   * and needs to be executable.  This means the whole heap ends
   * up being executable.
@@ -1755,9 +2166,35 @@ diff -urNp linux-3.1.3/arch/powerpc/include/asm/page.h linux-3.1.3/arch/powerpc/
  #ifndef __ASSEMBLY__
  
  #undef STRICT_MM_TYPECHECKS
-diff -urNp linux-3.1.3/arch/powerpc/include/asm/pgtable.h linux-3.1.3/arch/powerpc/include/asm/pgtable.h
---- linux-3.1.3/arch/powerpc/include/asm/pgtable.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/powerpc/include/asm/pgtable.h     2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/powerpc/include/asm/page_64.h b/arch/powerpc/include/asm/page_64.h
+index 9356262..ea96148 100644
+--- a/arch/powerpc/include/asm/page_64.h
++++ b/arch/powerpc/include/asm/page_64.h
+@@ -155,15 +155,18 @@ do {                                             \
+  * stack by default, so in the absence of a PT_GNU_STACK program header
+  * we turn execute permission off.
+  */
+-#define VM_STACK_DEFAULT_FLAGS32      (VM_READ | VM_WRITE | VM_EXEC | \
+-                                       VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
++#define VM_STACK_DEFAULT_FLAGS32 \
++      (((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0) | \
++       VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
+ #define VM_STACK_DEFAULT_FLAGS64      (VM_READ | VM_WRITE | \
+                                        VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
++#ifndef CONFIG_PAX_PAGEEXEC
+ #define VM_STACK_DEFAULT_FLAGS \
+       (is_32bit_task() ? \
+        VM_STACK_DEFAULT_FLAGS32 : VM_STACK_DEFAULT_FLAGS64)
++#endif
+ #include <asm-generic/getorder.h>
+diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h
+index 88b0bd9..e32bc67 100644
+--- a/arch/powerpc/include/asm/pgtable.h
++++ b/arch/powerpc/include/asm/pgtable.h
 @@ -2,6 +2,7 @@
  #define _ASM_POWERPC_PGTABLE_H
  #ifdef __KERNEL__
@@ -1766,9 +2203,10 @@ diff -urNp linux-3.1.3/arch/powerpc/include/asm/pgtable.h linux-3.1.3/arch/power
  #ifndef __ASSEMBLY__
  #include <asm/processor.h>            /* For TASK_SIZE */
  #include <asm/mmu.h>
-diff -urNp linux-3.1.3/arch/powerpc/include/asm/pte-hash32.h linux-3.1.3/arch/powerpc/include/asm/pte-hash32.h
---- linux-3.1.3/arch/powerpc/include/asm/pte-hash32.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/powerpc/include/asm/pte-hash32.h  2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/powerpc/include/asm/pte-hash32.h b/arch/powerpc/include/asm/pte-hash32.h
+index 4aad413..85d86bf 100644
+--- a/arch/powerpc/include/asm/pte-hash32.h
++++ b/arch/powerpc/include/asm/pte-hash32.h
 @@ -21,6 +21,7 @@
  #define _PAGE_FILE    0x004   /* when !present: nonlinear file mapping */
  #define _PAGE_USER    0x004   /* usermode access allowed */
@@ -1777,9 +2215,10 @@ diff -urNp linux-3.1.3/arch/powerpc/include/asm/pte-hash32.h linux-3.1.3/arch/po
  #define _PAGE_COHERENT        0x010   /* M: enforce memory coherence (SMP systems) */
  #define _PAGE_NO_CACHE        0x020   /* I: cache inhibit */
  #define _PAGE_WRITETHRU       0x040   /* W: cache write-through */
-diff -urNp linux-3.1.3/arch/powerpc/include/asm/reg.h linux-3.1.3/arch/powerpc/include/asm/reg.h
---- linux-3.1.3/arch/powerpc/include/asm/reg.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/powerpc/include/asm/reg.h 2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
+index 559da19..7e5835c 100644
+--- a/arch/powerpc/include/asm/reg.h
++++ b/arch/powerpc/include/asm/reg.h
 @@ -212,6 +212,7 @@
  #define SPRN_DBCR     0x136   /* e300 Data Breakpoint Control Reg */
  #define SPRN_DSISR    0x012   /* Data Storage Interrupt Status Register */
@@ -1788,10 +2227,11 @@ diff -urNp linux-3.1.3/arch/powerpc/include/asm/reg.h linux-3.1.3/arch/powerpc/i
  #define   DSISR_PROTFAULT     0x08000000      /* protection fault */
  #define   DSISR_ISSTORE               0x02000000      /* access was a store */
  #define   DSISR_DABRMATCH     0x00400000      /* hit data breakpoint */
-diff -urNp linux-3.1.3/arch/powerpc/include/asm/system.h linux-3.1.3/arch/powerpc/include/asm/system.h
---- linux-3.1.3/arch/powerpc/include/asm/system.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/powerpc/include/asm/system.h      2011-11-16 18:39:07.000000000 -0500
-@@ -530,7 +530,7 @@ __cmpxchg_local(volatile void *ptr, unsi
+diff --git a/arch/powerpc/include/asm/system.h b/arch/powerpc/include/asm/system.h
+index e30a13d..2b7d994 100644
+--- a/arch/powerpc/include/asm/system.h
++++ b/arch/powerpc/include/asm/system.h
+@@ -530,7 +530,7 @@ __cmpxchg_local(volatile void *ptr, unsigned long old, unsigned long new,
  #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
  #endif
  
@@ -1800,9 +2240,10 @@ diff -urNp linux-3.1.3/arch/powerpc/include/asm/system.h linux-3.1.3/arch/powerp
  
  /* Used in very early kernel initialization. */
  extern unsigned long reloc_offset(void);
-diff -urNp linux-3.1.3/arch/powerpc/include/asm/uaccess.h linux-3.1.3/arch/powerpc/include/asm/uaccess.h
---- linux-3.1.3/arch/powerpc/include/asm/uaccess.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/powerpc/include/asm/uaccess.h     2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/powerpc/include/asm/uaccess.h b/arch/powerpc/include/asm/uaccess.h
+index bd0fb84..a42a14b 100644
+--- a/arch/powerpc/include/asm/uaccess.h
++++ b/arch/powerpc/include/asm/uaccess.h
 @@ -13,6 +13,8 @@
  #define VERIFY_READ   0
  #define VERIFY_WRITE  1
@@ -1865,7 +2306,7 @@ diff -urNp linux-3.1.3/arch/powerpc/include/asm/uaccess.h linux-3.1.3/arch/power
  static inline unsigned long __copy_from_user_inatomic(void *to,
                const void __user *from, unsigned long n)
  {
-@@ -396,6 +352,10 @@ static inline unsigned long __copy_from_
+@@ -396,6 +352,10 @@ static inline unsigned long __copy_from_user_inatomic(void *to,
                if (ret == 0)
                        return 0;
        }
@@ -1876,7 +2317,7 @@ diff -urNp linux-3.1.3/arch/powerpc/include/asm/uaccess.h linux-3.1.3/arch/power
        return __copy_tofrom_user((__force void __user *)to, from, n);
  }
  
-@@ -422,6 +382,10 @@ static inline unsigned long __copy_to_us
+@@ -422,6 +382,10 @@ static inline unsigned long __copy_to_user_inatomic(void __user *to,
                if (ret == 0)
                        return 0;
        }
@@ -1887,7 +2328,7 @@ diff -urNp linux-3.1.3/arch/powerpc/include/asm/uaccess.h linux-3.1.3/arch/power
        return __copy_tofrom_user(to, (__force const void __user *)from, n);
  }
  
-@@ -439,6 +403,92 @@ static inline unsigned long __copy_to_us
+@@ -439,6 +403,92 @@ static inline unsigned long __copy_to_user(void __user *to,
        return __copy_to_user_inatomic(to, from, size);
  }
  
@@ -1980,9 +2421,10 @@ diff -urNp linux-3.1.3/arch/powerpc/include/asm/uaccess.h linux-3.1.3/arch/power
  extern unsigned long __clear_user(void __user *addr, unsigned long size);
  
  static inline unsigned long clear_user(void __user *addr, unsigned long size)
-diff -urNp linux-3.1.3/arch/powerpc/kernel/exceptions-64e.S linux-3.1.3/arch/powerpc/kernel/exceptions-64e.S
---- linux-3.1.3/arch/powerpc/kernel/exceptions-64e.S   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/powerpc/kernel/exceptions-64e.S   2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S
+index 429983c..7af363b 100644
+--- a/arch/powerpc/kernel/exceptions-64e.S
++++ b/arch/powerpc/kernel/exceptions-64e.S
 @@ -587,6 +587,7 @@ storage_fault_common:
        std     r14,_DAR(r1)
        std     r15,_DSISR(r1)
@@ -2001,9 +2443,10 @@ diff -urNp linux-3.1.3/arch/powerpc/kernel/exceptions-64e.S linux-3.1.3/arch/pow
        addi    r3,r1,STACK_FRAME_OVERHEAD
        ld      r4,_DAR(r1)
        bl      .bad_page_fault
-diff -urNp linux-3.1.3/arch/powerpc/kernel/exceptions-64s.S linux-3.1.3/arch/powerpc/kernel/exceptions-64s.S
---- linux-3.1.3/arch/powerpc/kernel/exceptions-64s.S   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/powerpc/kernel/exceptions-64s.S   2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
+index 41b02c7..05e76fb 100644
+--- a/arch/powerpc/kernel/exceptions-64s.S
++++ b/arch/powerpc/kernel/exceptions-64s.S
 @@ -1014,10 +1014,10 @@ handle_page_fault:
  11:   ld      r4,_DAR(r1)
        ld      r5,_DSISR(r1)
@@ -2016,10 +2459,11 @@ diff -urNp linux-3.1.3/arch/powerpc/kernel/exceptions-64s.S linux-3.1.3/arch/pow
        mr      r5,r3
        addi    r3,r1,STACK_FRAME_OVERHEAD
        lwz     r4,_DAR(r1)
-diff -urNp linux-3.1.3/arch/powerpc/kernel/module_32.c linux-3.1.3/arch/powerpc/kernel/module_32.c
---- linux-3.1.3/arch/powerpc/kernel/module_32.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/powerpc/kernel/module_32.c        2011-11-16 18:39:07.000000000 -0500
-@@ -162,7 +162,7 @@ int module_frob_arch_sections(Elf32_Ehdr
+diff --git a/arch/powerpc/kernel/module_32.c b/arch/powerpc/kernel/module_32.c
+index 0b6d796..d760ddb 100644
+--- a/arch/powerpc/kernel/module_32.c
++++ b/arch/powerpc/kernel/module_32.c
+@@ -162,7 +162,7 @@ int module_frob_arch_sections(Elf32_Ehdr *hdr,
                        me->arch.core_plt_section = i;
        }
        if (!me->arch.core_plt_section || !me->arch.init_plt_section) {
@@ -2028,7 +2472,7 @@ diff -urNp linux-3.1.3/arch/powerpc/kernel/module_32.c linux-3.1.3/arch/powerpc/
                return -ENOEXEC;
        }
  
-@@ -192,11 +192,16 @@ static uint32_t do_plt_call(void *locati
+@@ -192,11 +192,16 @@ static uint32_t do_plt_call(void *location,
  
        DEBUGP("Doing plt for call to 0x%x at 0x%x\n", val, (unsigned int)location);
        /* Init, or core PLT? */
@@ -2048,9 +2492,10 @@ diff -urNp linux-3.1.3/arch/powerpc/kernel/module_32.c linux-3.1.3/arch/powerpc/
  
        /* Find this entry, or if that fails, the next avail. entry */
        while (entry->jump[0]) {
-diff -urNp linux-3.1.3/arch/powerpc/kernel/process.c linux-3.1.3/arch/powerpc/kernel/process.c
---- linux-3.1.3/arch/powerpc/kernel/process.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/powerpc/kernel/process.c  2011-11-16 18:40:08.000000000 -0500
+diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
+index 8f53954..a704ad6 100644
+--- a/arch/powerpc/kernel/process.c
++++ b/arch/powerpc/kernel/process.c
 @@ -682,8 +682,8 @@ void show_regs(struct pt_regs * regs)
         * Lookup NIP late so we have the best change of getting the
         * above info out without failing
@@ -2062,7 +2507,7 @@ diff -urNp linux-3.1.3/arch/powerpc/kernel/process.c linux-3.1.3/arch/powerpc/ke
  #endif
        show_stack(current, (unsigned long *) regs->gpr[1]);
        if (!user_mode(regs))
-@@ -1187,10 +1187,10 @@ void show_stack(struct task_struct *tsk,
+@@ -1187,10 +1187,10 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
                newsp = stack[0];
                ip = stack[STACK_FRAME_LR_SAVE];
                if (!firstframe || ip != lr) {
@@ -2075,7 +2520,7 @@ diff -urNp linux-3.1.3/arch/powerpc/kernel/process.c linux-3.1.3/arch/powerpc/ke
                                       (void *)current->ret_stack[curr_frame].ret);
                                curr_frame--;
                        }
-@@ -1210,7 +1210,7 @@ void show_stack(struct task_struct *tsk,
+@@ -1210,7 +1210,7 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
                        struct pt_regs *regs = (struct pt_regs *)
                                (sp + STACK_FRAME_OVERHEAD);
                        lr = regs->link;
@@ -2143,10 +2588,11 @@ diff -urNp linux-3.1.3/arch/powerpc/kernel/process.c linux-3.1.3/arch/powerpc/ke
 -
 -      return ret;
 -}
-diff -urNp linux-3.1.3/arch/powerpc/kernel/signal_32.c linux-3.1.3/arch/powerpc/kernel/signal_32.c
---- linux-3.1.3/arch/powerpc/kernel/signal_32.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/powerpc/kernel/signal_32.c        2011-11-16 18:39:07.000000000 -0500
-@@ -859,7 +859,7 @@ int handle_rt_signal32(unsigned long sig
+diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
+index 78b76dc..7f232ef 100644
+--- a/arch/powerpc/kernel/signal_32.c
++++ b/arch/powerpc/kernel/signal_32.c
+@@ -859,7 +859,7 @@ int handle_rt_signal32(unsigned long sig, struct k_sigaction *ka,
        /* Save user registers on the stack */
        frame = &rt_sf->uc.uc_mcontext;
        addr = frame;
@@ -2155,10 +2601,11 @@ diff -urNp linux-3.1.3/arch/powerpc/kernel/signal_32.c linux-3.1.3/arch/powerpc/
                if (save_user_regs(regs, frame, 0, 1))
                        goto badframe;
                regs->link = current->mm->context.vdso_base + vdso32_rt_sigtramp;
-diff -urNp linux-3.1.3/arch/powerpc/kernel/signal_64.c linux-3.1.3/arch/powerpc/kernel/signal_64.c
---- linux-3.1.3/arch/powerpc/kernel/signal_64.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/powerpc/kernel/signal_64.c        2011-11-16 18:39:07.000000000 -0500
-@@ -430,7 +430,7 @@ int handle_rt_signal64(int signr, struct
+diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
+index e91c736..742ec06 100644
+--- a/arch/powerpc/kernel/signal_64.c
++++ b/arch/powerpc/kernel/signal_64.c
+@@ -430,7 +430,7 @@ int handle_rt_signal64(int signr, struct k_sigaction *ka, siginfo_t *info,
        current->thread.fpscr.val = 0;
  
        /* Set up to return from userspace. */
@@ -2167,9 +2614,10 @@ diff -urNp linux-3.1.3/arch/powerpc/kernel/signal_64.c linux-3.1.3/arch/powerpc/
                regs->link = current->mm->context.vdso_base + vdso64_rt_sigtramp;
        } else {
                err |= setup_trampoline(__NR_rt_sigreturn, &frame->tramp[0]);
-diff -urNp linux-3.1.3/arch/powerpc/kernel/traps.c linux-3.1.3/arch/powerpc/kernel/traps.c
---- linux-3.1.3/arch/powerpc/kernel/traps.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/powerpc/kernel/traps.c    2011-11-16 18:40:08.000000000 -0500
+diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
+index f19d977..8ac286e 100644
+--- a/arch/powerpc/kernel/traps.c
++++ b/arch/powerpc/kernel/traps.c
 @@ -98,6 +98,8 @@ static void pmac_backlight_unblank(void)
  static inline void pmac_backlight_unblank(void) { }
  #endif
@@ -2179,7 +2627,7 @@ diff -urNp linux-3.1.3/arch/powerpc/kernel/traps.c linux-3.1.3/arch/powerpc/kern
  int die(const char *str, struct pt_regs *regs, long err)
  {
        static struct {
-@@ -171,6 +173,8 @@ int die(const char *str, struct pt_regs 
+@@ -171,6 +173,8 @@ int die(const char *str, struct pt_regs *regs, long err)
        if (panic_on_oops)
                panic("Fatal exception");
  
@@ -2188,9 +2636,10 @@ diff -urNp linux-3.1.3/arch/powerpc/kernel/traps.c linux-3.1.3/arch/powerpc/kern
        oops_exit();
        do_exit(err);
  
-diff -urNp linux-3.1.3/arch/powerpc/kernel/vdso.c linux-3.1.3/arch/powerpc/kernel/vdso.c
---- linux-3.1.3/arch/powerpc/kernel/vdso.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/powerpc/kernel/vdso.c     2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c
+index 142ab10..236e61a 100644
+--- a/arch/powerpc/kernel/vdso.c
++++ b/arch/powerpc/kernel/vdso.c
 @@ -36,6 +36,7 @@
  #include <asm/firmware.h>
  #include <asm/vdso.h>
@@ -2199,7 +2648,7 @@ diff -urNp linux-3.1.3/arch/powerpc/kernel/vdso.c linux-3.1.3/arch/powerpc/kerne
  
  #include "setup.h"
  
-@@ -220,7 +221,7 @@ int arch_setup_additional_pages(struct l
+@@ -220,7 +221,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
        vdso_base = VDSO32_MBASE;
  #endif
  
@@ -2208,7 +2657,7 @@ diff -urNp linux-3.1.3/arch/powerpc/kernel/vdso.c linux-3.1.3/arch/powerpc/kerne
  
        /* vDSO has a problem and was disabled, just don't "enable" it for the
         * process
-@@ -240,7 +241,7 @@ int arch_setup_additional_pages(struct l
+@@ -240,7 +241,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
        vdso_base = get_unmapped_area(NULL, vdso_base,
                                      (vdso_pages << PAGE_SHIFT) +
                                      ((VDSO_ALIGNMENT - 1) & PAGE_MASK),
@@ -2217,9 +2666,10 @@ diff -urNp linux-3.1.3/arch/powerpc/kernel/vdso.c linux-3.1.3/arch/powerpc/kerne
        if (IS_ERR_VALUE(vdso_base)) {
                rc = vdso_base;
                goto fail_mmapsem;
-diff -urNp linux-3.1.3/arch/powerpc/lib/usercopy_64.c linux-3.1.3/arch/powerpc/lib/usercopy_64.c
---- linux-3.1.3/arch/powerpc/lib/usercopy_64.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/powerpc/lib/usercopy_64.c 2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/powerpc/lib/usercopy_64.c b/arch/powerpc/lib/usercopy_64.c
+index 5eea6f3..5d10396 100644
+--- a/arch/powerpc/lib/usercopy_64.c
++++ b/arch/powerpc/lib/usercopy_64.c
 @@ -9,22 +9,6 @@
  #include <linux/module.h>
  #include <asm/uaccess.h>
@@ -2243,7 +2693,7 @@ diff -urNp linux-3.1.3/arch/powerpc/lib/usercopy_64.c linux-3.1.3/arch/powerpc/l
  unsigned long copy_in_user(void __user *to, const void __user *from,
                           unsigned long n)
  {
-@@ -35,7 +19,5 @@ unsigned long copy_in_user(void __user *
+@@ -35,7 +19,5 @@ unsigned long copy_in_user(void __user *to, const void __user *from,
        return n;
  }
  
@@ -2251,9 +2701,10 @@ diff -urNp linux-3.1.3/arch/powerpc/lib/usercopy_64.c linux-3.1.3/arch/powerpc/l
 -EXPORT_SYMBOL(copy_to_user);
  EXPORT_SYMBOL(copy_in_user);
  
-diff -urNp linux-3.1.3/arch/powerpc/mm/fault.c linux-3.1.3/arch/powerpc/mm/fault.c
---- linux-3.1.3/arch/powerpc/mm/fault.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/powerpc/mm/fault.c        2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
+index 5efe8c9..db9ceef 100644
+--- a/arch/powerpc/mm/fault.c
++++ b/arch/powerpc/mm/fault.c
 @@ -32,6 +32,10 @@
  #include <linux/perf_event.h>
  #include <linux/magic.h>
@@ -2273,7 +2724,7 @@ diff -urNp linux-3.1.3/arch/powerpc/mm/fault.c linux-3.1.3/arch/powerpc/mm/fault
  
  #ifdef CONFIG_KPROBES
  static inline int notify_page_fault(struct pt_regs *regs)
-@@ -66,6 +71,33 @@ static inline int notify_page_fault(stru
+@@ -66,6 +71,33 @@ static inline int notify_page_fault(struct pt_regs *regs)
  }
  #endif
  
@@ -2307,7 +2758,7 @@ diff -urNp linux-3.1.3/arch/powerpc/mm/fault.c linux-3.1.3/arch/powerpc/mm/fault
  /*
   * Check whether the instruction at regs->nip is a store using
   * an update addressing form which will update r1.
-@@ -136,7 +168,7 @@ int __kprobes do_page_fault(struct pt_re
+@@ -136,7 +168,7 @@ int __kprobes do_page_fault(struct pt_regs *regs, unsigned long address,
         * indicate errors in DSISR but can validly be set in SRR1.
         */
        if (trap == 0x400)
@@ -2358,10 +2809,11 @@ diff -urNp linux-3.1.3/arch/powerpc/mm/fault.c linux-3.1.3/arch/powerpc/mm/fault
                _exception(SIGSEGV, regs, code, address);
                return 0;
        }
-diff -urNp linux-3.1.3/arch/powerpc/mm/mmap_64.c linux-3.1.3/arch/powerpc/mm/mmap_64.c
---- linux-3.1.3/arch/powerpc/mm/mmap_64.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/powerpc/mm/mmap_64.c      2011-11-16 18:39:07.000000000 -0500
-@@ -99,10 +99,22 @@ void arch_pick_mmap_layout(struct mm_str
+diff --git a/arch/powerpc/mm/mmap_64.c b/arch/powerpc/mm/mmap_64.c
+index 5a783d8..c23e14b 100644
+--- a/arch/powerpc/mm/mmap_64.c
++++ b/arch/powerpc/mm/mmap_64.c
+@@ -99,10 +99,22 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
         */
        if (mmap_is_legacy()) {
                mm->mmap_base = TASK_UNMAPPED_BASE;
@@ -2384,10 +2836,11 @@ diff -urNp linux-3.1.3/arch/powerpc/mm/mmap_64.c linux-3.1.3/arch/powerpc/mm/mma
                mm->get_unmapped_area = arch_get_unmapped_area_topdown;
                mm->unmap_area = arch_unmap_area_topdown;
        }
-diff -urNp linux-3.1.3/arch/powerpc/mm/slice.c linux-3.1.3/arch/powerpc/mm/slice.c
---- linux-3.1.3/arch/powerpc/mm/slice.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/powerpc/mm/slice.c        2011-11-16 18:39:07.000000000 -0500
-@@ -98,7 +98,7 @@ static int slice_area_is_free(struct mm_
+diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
+index ba51948..23009d9 100644
+--- a/arch/powerpc/mm/slice.c
++++ b/arch/powerpc/mm/slice.c
+@@ -98,7 +98,7 @@ static int slice_area_is_free(struct mm_struct *mm, unsigned long addr,
        if ((mm->task_size - len) < addr)
                return 0;
        vma = find_vma(mm, addr);
@@ -2405,7 +2858,7 @@ diff -urNp linux-3.1.3/arch/powerpc/mm/slice.c linux-3.1.3/arch/powerpc/mm/slice
                        /*
                         * Remember the place where we stopped the search:
                         */
-@@ -313,10 +313,14 @@ static unsigned long slice_find_area_top
+@@ -313,10 +313,14 @@ static unsigned long slice_find_area_topdown(struct mm_struct *mm,
                }
        }
  
@@ -2423,7 +2876,7 @@ diff -urNp linux-3.1.3/arch/powerpc/mm/slice.c linux-3.1.3/arch/powerpc/mm/slice
  
                /* Check for hit with different page size */
                mask = slice_range_to_mask(addr, len);
-@@ -336,7 +340,7 @@ static unsigned long slice_find_area_top
+@@ -336,7 +340,7 @@ static unsigned long slice_find_area_topdown(struct mm_struct *mm,
                 * return with success:
                 */
                vma = find_vma(mm, addr);
@@ -2432,7 +2885,7 @@ diff -urNp linux-3.1.3/arch/powerpc/mm/slice.c linux-3.1.3/arch/powerpc/mm/slice
                        /* remember the address as a hint for next time */
                        if (use_cache)
                                mm->free_area_cache = addr;
-@@ -348,7 +352,7 @@ static unsigned long slice_find_area_top
+@@ -348,7 +352,7 @@ static unsigned long slice_find_area_topdown(struct mm_struct *mm,
                        mm->cached_hole_size = vma->vm_start - addr;
  
                /* try just below the current vma->vm_start */
@@ -2441,7 +2894,7 @@ diff -urNp linux-3.1.3/arch/powerpc/mm/slice.c linux-3.1.3/arch/powerpc/mm/slice
        }
  
        /*
-@@ -426,6 +430,11 @@ unsigned long slice_get_unmapped_area(un
+@@ -426,6 +430,11 @@ unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len,
        if (fixed && addr > (mm->task_size - len))
                return -EINVAL;
  
@@ -2453,9 +2906,10 @@ diff -urNp linux-3.1.3/arch/powerpc/mm/slice.c linux-3.1.3/arch/powerpc/mm/slice
        /* If hint, make sure it matches our alignment restrictions */
        if (!fixed && addr) {
                addr = _ALIGN_UP(addr, 1ul << pshift);
-diff -urNp linux-3.1.3/arch/s390/include/asm/elf.h linux-3.1.3/arch/s390/include/asm/elf.h
---- linux-3.1.3/arch/s390/include/asm/elf.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/s390/include/asm/elf.h    2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/s390/include/asm/elf.h b/arch/s390/include/asm/elf.h
+index 547f1a6..3fff354 100644
+--- a/arch/s390/include/asm/elf.h
++++ b/arch/s390/include/asm/elf.h
 @@ -162,8 +162,14 @@ extern unsigned int vdso_enabled;
     the loader.  We need to make sure that it is out of the way of the program
     that it will "exec", and that there is sufficient room for the brk.  */
@@ -2481,10 +2935,11 @@ diff -urNp linux-3.1.3/arch/s390/include/asm/elf.h linux-3.1.3/arch/s390/include
 -#define arch_randomize_brk arch_randomize_brk
 -
  #endif
-diff -urNp linux-3.1.3/arch/s390/include/asm/system.h linux-3.1.3/arch/s390/include/asm/system.h
---- linux-3.1.3/arch/s390/include/asm/system.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/s390/include/asm/system.h 2011-11-16 18:39:07.000000000 -0500
-@@ -256,7 +256,7 @@ extern void (*_machine_restart)(char *co
+diff --git a/arch/s390/include/asm/system.h b/arch/s390/include/asm/system.h
+index 6582f69..b69906f 100644
+--- a/arch/s390/include/asm/system.h
++++ b/arch/s390/include/asm/system.h
+@@ -256,7 +256,7 @@ extern void (*_machine_restart)(char *command);
  extern void (*_machine_halt)(void);
  extern void (*_machine_power_off)(void);
  
@@ -2493,9 +2948,10 @@ diff -urNp linux-3.1.3/arch/s390/include/asm/system.h linux-3.1.3/arch/s390/incl
  
  static inline int tprot(unsigned long addr)
  {
-diff -urNp linux-3.1.3/arch/s390/include/asm/uaccess.h linux-3.1.3/arch/s390/include/asm/uaccess.h
---- linux-3.1.3/arch/s390/include/asm/uaccess.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/s390/include/asm/uaccess.h        2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/s390/include/asm/uaccess.h b/arch/s390/include/asm/uaccess.h
+index 2b23885..e136e31 100644
+--- a/arch/s390/include/asm/uaccess.h
++++ b/arch/s390/include/asm/uaccess.h
 @@ -235,6 +235,10 @@ static inline unsigned long __must_check
  copy_to_user(void __user *to, const void *from, unsigned long n)
  {
@@ -2507,7 +2963,7 @@ diff -urNp linux-3.1.3/arch/s390/include/asm/uaccess.h linux-3.1.3/arch/s390/inc
        if (access_ok(VERIFY_WRITE, to, n))
                n = __copy_to_user(to, from, n);
        return n;
-@@ -260,6 +264,9 @@ copy_to_user(void __user *to, const void
+@@ -260,6 +264,9 @@ copy_to_user(void __user *to, const void *from, unsigned long n)
  static inline unsigned long __must_check
  __copy_from_user(void *to, const void __user *from, unsigned long n)
  {
@@ -2517,7 +2973,7 @@ diff -urNp linux-3.1.3/arch/s390/include/asm/uaccess.h linux-3.1.3/arch/s390/inc
        if (__builtin_constant_p(n) && (n <= 256))
                return uaccess.copy_from_user_small(n, from, to);
        else
-@@ -294,6 +301,10 @@ copy_from_user(void *to, const void __us
+@@ -294,6 +301,10 @@ copy_from_user(void *to, const void __user *from, unsigned long n)
        unsigned int sz = __compiletime_object_size(to);
  
        might_fault();
@@ -2528,10 +2984,11 @@ diff -urNp linux-3.1.3/arch/s390/include/asm/uaccess.h linux-3.1.3/arch/s390/inc
        if (unlikely(sz != -1 && sz < n)) {
                copy_from_user_overflow();
                return n;
-diff -urNp linux-3.1.3/arch/s390/kernel/module.c linux-3.1.3/arch/s390/kernel/module.c
---- linux-3.1.3/arch/s390/kernel/module.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/s390/kernel/module.c      2011-11-16 18:39:07.000000000 -0500
-@@ -161,11 +161,11 @@ module_frob_arch_sections(Elf_Ehdr *hdr,
+diff --git a/arch/s390/kernel/module.c b/arch/s390/kernel/module.c
+index dfcb343..eda788a 100644
+--- a/arch/s390/kernel/module.c
++++ b/arch/s390/kernel/module.c
+@@ -161,11 +161,11 @@ module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
  
        /* Increase core size by size of got & plt and set start
           offsets for got and plt. */
@@ -2548,7 +3005,7 @@ diff -urNp linux-3.1.3/arch/s390/kernel/module.c linux-3.1.3/arch/s390/kernel/mo
        return 0;
  }
  
-@@ -242,7 +242,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base
+@@ -242,7 +242,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
                if (info->got_initialized == 0) {
                        Elf_Addr *gotent;
  
@@ -2557,7 +3014,7 @@ diff -urNp linux-3.1.3/arch/s390/kernel/module.c linux-3.1.3/arch/s390/kernel/mo
                                info->got_offset;
                        *gotent = val;
                        info->got_initialized = 1;
-@@ -266,7 +266,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base
+@@ -266,7 +266,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
                else if (r_type == R_390_GOTENT ||
                         r_type == R_390_GOTPLTENT)
                        *(unsigned int *) loc =
@@ -2566,7 +3023,7 @@ diff -urNp linux-3.1.3/arch/s390/kernel/module.c linux-3.1.3/arch/s390/kernel/mo
                else if (r_type == R_390_GOT64 ||
                         r_type == R_390_GOTPLT64)
                        *(unsigned long *) loc = val;
-@@ -280,7 +280,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base
+@@ -280,7 +280,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
        case R_390_PLTOFF64:    /* 16 bit offset from GOT to PLT. */
                if (info->plt_initialized == 0) {
                        unsigned int *ip;
@@ -2575,7 +3032,7 @@ diff -urNp linux-3.1.3/arch/s390/kernel/module.c linux-3.1.3/arch/s390/kernel/mo
                                info->plt_offset;
  #ifndef CONFIG_64BIT
                        ip[0] = 0x0d105810; /* basr 1,0; l 1,6(1); br 1 */
-@@ -305,7 +305,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base
+@@ -305,7 +305,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
                               val - loc + 0xffffUL < 0x1ffffeUL) ||
                              (r_type == R_390_PLT32DBL &&
                               val - loc + 0xffffffffULL < 0x1fffffffeULL)))
@@ -2584,7 +3041,7 @@ diff -urNp linux-3.1.3/arch/s390/kernel/module.c linux-3.1.3/arch/s390/kernel/mo
                                        me->arch.plt_offset +
                                        info->plt_offset;
                        val += rela->r_addend - loc;
-@@ -327,7 +327,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base
+@@ -327,7 +327,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
        case R_390_GOTOFF32:    /* 32 bit offset to GOT.  */
        case R_390_GOTOFF64:    /* 64 bit offset to GOT. */
                val = val + rela->r_addend -
@@ -2593,7 +3050,7 @@ diff -urNp linux-3.1.3/arch/s390/kernel/module.c linux-3.1.3/arch/s390/kernel/mo
                if (r_type == R_390_GOTOFF16)
                        *(unsigned short *) loc = val;
                else if (r_type == R_390_GOTOFF32)
-@@ -337,7 +337,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base
+@@ -337,7 +337,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
                break;
        case R_390_GOTPC:       /* 32 bit PC relative offset to GOT. */
        case R_390_GOTPCDBL:    /* 32 bit PC rel. off. to GOT shifted by 1. */
@@ -2602,10 +3059,11 @@ diff -urNp linux-3.1.3/arch/s390/kernel/module.c linux-3.1.3/arch/s390/kernel/mo
                        rela->r_addend - loc;
                if (r_type == R_390_GOTPC)
                        *(unsigned int *) loc = val;
-diff -urNp linux-3.1.3/arch/s390/kernel/process.c linux-3.1.3/arch/s390/kernel/process.c
---- linux-3.1.3/arch/s390/kernel/process.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/s390/kernel/process.c     2011-11-16 18:39:07.000000000 -0500
-@@ -319,39 +319,3 @@ unsigned long get_wchan(struct task_stru
+diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
+index 541a750..8739853 100644
+--- a/arch/s390/kernel/process.c
++++ b/arch/s390/kernel/process.c
+@@ -319,39 +319,3 @@ unsigned long get_wchan(struct task_struct *p)
        }
        return 0;
  }
@@ -2645,10 +3103,11 @@ diff -urNp linux-3.1.3/arch/s390/kernel/process.c linux-3.1.3/arch/s390/kernel/p
 -              return base;
 -      return ret;
 -}
-diff -urNp linux-3.1.3/arch/s390/kernel/setup.c linux-3.1.3/arch/s390/kernel/setup.c
---- linux-3.1.3/arch/s390/kernel/setup.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/s390/kernel/setup.c       2011-11-16 18:39:07.000000000 -0500
-@@ -271,7 +271,7 @@ static int __init early_parse_mem(char *
+diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
+index 7b371c3..ad06cf1 100644
+--- a/arch/s390/kernel/setup.c
++++ b/arch/s390/kernel/setup.c
+@@ -271,7 +271,7 @@ static int __init early_parse_mem(char *p)
  }
  early_param("mem", early_parse_mem);
  
@@ -2657,10 +3116,11 @@ diff -urNp linux-3.1.3/arch/s390/kernel/setup.c linux-3.1.3/arch/s390/kernel/set
  EXPORT_SYMBOL_GPL(user_mode);
  
  static int set_amode_and_uaccess(unsigned long user_amode,
-diff -urNp linux-3.1.3/arch/s390/mm/mmap.c linux-3.1.3/arch/s390/mm/mmap.c
---- linux-3.1.3/arch/s390/mm/mmap.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/s390/mm/mmap.c    2011-11-16 18:39:07.000000000 -0500
-@@ -91,10 +91,22 @@ void arch_pick_mmap_layout(struct mm_str
+diff --git a/arch/s390/mm/mmap.c b/arch/s390/mm/mmap.c
+index c9a9f7f..60d0315 100644
+--- a/arch/s390/mm/mmap.c
++++ b/arch/s390/mm/mmap.c
+@@ -91,10 +91,22 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
         */
        if (mmap_is_legacy()) {
                mm->mmap_base = TASK_UNMAPPED_BASE;
@@ -2683,7 +3143,7 @@ diff -urNp linux-3.1.3/arch/s390/mm/mmap.c linux-3.1.3/arch/s390/mm/mmap.c
                mm->get_unmapped_area = arch_get_unmapped_area_topdown;
                mm->unmap_area = arch_unmap_area_topdown;
        }
-@@ -166,10 +178,22 @@ void arch_pick_mmap_layout(struct mm_str
+@@ -166,10 +178,22 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
         */
        if (mmap_is_legacy()) {
                mm->mmap_base = TASK_UNMAPPED_BASE;
@@ -2706,9 +3166,10 @@ diff -urNp linux-3.1.3/arch/s390/mm/mmap.c linux-3.1.3/arch/s390/mm/mmap.c
                mm->get_unmapped_area = s390_get_unmapped_area_topdown;
                mm->unmap_area = arch_unmap_area_topdown;
        }
-diff -urNp linux-3.1.3/arch/score/include/asm/system.h linux-3.1.3/arch/score/include/asm/system.h
---- linux-3.1.3/arch/score/include/asm/system.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/score/include/asm/system.h        2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/score/include/asm/system.h b/arch/score/include/asm/system.h
+index 589d5c7..669e274 100644
+--- a/arch/score/include/asm/system.h
++++ b/arch/score/include/asm/system.h
 @@ -17,7 +17,7 @@ do {                                                         \
  #define finish_arch_switch(prev)      do {} while (0)
  
@@ -2718,10 +3179,11 @@ diff -urNp linux-3.1.3/arch/score/include/asm/system.h linux-3.1.3/arch/score/in
  
  #define mb()          barrier()
  #define rmb()         barrier()
-diff -urNp linux-3.1.3/arch/score/kernel/process.c linux-3.1.3/arch/score/kernel/process.c
---- linux-3.1.3/arch/score/kernel/process.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/score/kernel/process.c    2011-11-16 18:39:07.000000000 -0500
-@@ -161,8 +161,3 @@ unsigned long get_wchan(struct task_stru
+diff --git a/arch/score/kernel/process.c b/arch/score/kernel/process.c
+index 25d0803..d6c8e36 100644
+--- a/arch/score/kernel/process.c
++++ b/arch/score/kernel/process.c
+@@ -161,8 +161,3 @@ unsigned long get_wchan(struct task_struct *task)
  
        return task_pt_regs(task)->cp0_epc;
  }
@@ -2730,10 +3192,11 @@ diff -urNp linux-3.1.3/arch/score/kernel/process.c linux-3.1.3/arch/score/kernel
 -{
 -      return sp;
 -}
-diff -urNp linux-3.1.3/arch/sh/mm/mmap.c linux-3.1.3/arch/sh/mm/mmap.c
---- linux-3.1.3/arch/sh/mm/mmap.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/sh/mm/mmap.c      2011-11-16 18:39:07.000000000 -0500
-@@ -74,8 +74,7 @@ unsigned long arch_get_unmapped_area(str
+diff --git a/arch/sh/mm/mmap.c b/arch/sh/mm/mmap.c
+index afeb710..d1d1289 100644
+--- a/arch/sh/mm/mmap.c
++++ b/arch/sh/mm/mmap.c
+@@ -74,8 +74,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
                        addr = PAGE_ALIGN(addr);
  
                vma = find_vma(mm, addr);
@@ -2752,7 +3215,7 @@ diff -urNp linux-3.1.3/arch/sh/mm/mmap.c linux-3.1.3/arch/sh/mm/mmap.c
                        /*
                         * Remember the place where we stopped the search:
                         */
-@@ -157,8 +156,7 @@ arch_get_unmapped_area_topdown(struct fi
+@@ -157,8 +156,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
                        addr = PAGE_ALIGN(addr);
  
                vma = find_vma(mm, addr);
@@ -2762,7 +3225,7 @@ diff -urNp linux-3.1.3/arch/sh/mm/mmap.c linux-3.1.3/arch/sh/mm/mmap.c
                        return addr;
        }
  
-@@ -179,7 +177,7 @@ arch_get_unmapped_area_topdown(struct fi
+@@ -179,7 +177,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
        /* make sure it can fit in the remaining address space */
        if (likely(addr > len)) {
                vma = find_vma(mm, addr-len);
@@ -2771,7 +3234,7 @@ diff -urNp linux-3.1.3/arch/sh/mm/mmap.c linux-3.1.3/arch/sh/mm/mmap.c
                        /* remember the address as a hint for next time */
                        return (mm->free_area_cache = addr-len);
                }
-@@ -188,18 +186,18 @@ arch_get_unmapped_area_topdown(struct fi
+@@ -188,18 +186,18 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
        if (unlikely(mm->mmap_base < len))
                goto bottomup;
  
@@ -2794,7 +3257,7 @@ diff -urNp linux-3.1.3/arch/sh/mm/mmap.c linux-3.1.3/arch/sh/mm/mmap.c
                        /* remember the address as a hint for next time */
                        return (mm->free_area_cache = addr);
                }
-@@ -209,10 +207,8 @@ arch_get_unmapped_area_topdown(struct fi
+@@ -209,10 +207,8 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
                        mm->cached_hole_size = vma->vm_start - addr;
  
                /* try just below the current vma->vm_start */
@@ -2807,9 +3270,23 @@ diff -urNp linux-3.1.3/arch/sh/mm/mmap.c linux-3.1.3/arch/sh/mm/mmap.c
  
  bottomup:
        /*
-diff -urNp linux-3.1.3/arch/sparc/include/asm/atomic_64.h linux-3.1.3/arch/sparc/include/asm/atomic_64.h
---- linux-3.1.3/arch/sparc/include/asm/atomic_64.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/sparc/include/asm/atomic_64.h     2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/sparc/Makefile b/arch/sparc/Makefile
+index ad1fb5d..fc5315b 100644
+--- a/arch/sparc/Makefile
++++ b/arch/sparc/Makefile
+@@ -75,7 +75,7 @@ drivers-$(CONFIG_OPROFILE)   += arch/sparc/oprofile/
+ # Export what is needed by arch/sparc/boot/Makefile
+ export VMLINUX_INIT VMLINUX_MAIN
+ VMLINUX_INIT := $(head-y) $(init-y)
+-VMLINUX_MAIN := $(core-y) kernel/ mm/ fs/ ipc/ security/ crypto/ block/
++VMLINUX_MAIN := $(core-y) kernel/ mm/ fs/ ipc/ security/ crypto/ block/ grsecurity/
+ VMLINUX_MAIN += $(patsubst %/, %/lib.a, $(libs-y)) $(libs-y)
+ VMLINUX_MAIN += $(drivers-y) $(net-y)
+diff --git a/arch/sparc/include/asm/atomic_64.h b/arch/sparc/include/asm/atomic_64.h
+index 9f421df..b81fc12 100644
+--- a/arch/sparc/include/asm/atomic_64.h
++++ b/arch/sparc/include/asm/atomic_64.h
 @@ -14,18 +14,40 @@
  #define ATOMIC64_INIT(i)      { (i) }
  
@@ -2851,7 +3328,7 @@ diff -urNp linux-3.1.3/arch/sparc/include/asm/atomic_64.h linux-3.1.3/arch/sparc
  extern int atomic_sub_ret(int, atomic_t *);
  extern long atomic64_sub_ret(long, atomic64_t *);
  
-@@ -33,13 +55,29 @@ extern long atomic64_sub_ret(long, atomi
+@@ -33,13 +55,29 @@ extern long atomic64_sub_ret(long, atomic64_t *);
  #define atomic64_dec_return(v) atomic64_sub_ret(1, v)
  
  #define atomic_inc_return(v) atomic_add_ret(1, v)
@@ -2881,7 +3358,7 @@ diff -urNp linux-3.1.3/arch/sparc/include/asm/atomic_64.h linux-3.1.3/arch/sparc
  
  /*
   * atomic_inc_and_test - increment and test
-@@ -50,6 +88,10 @@ extern long atomic64_sub_ret(long, atomi
+@@ -50,6 +88,10 @@ extern long atomic64_sub_ret(long, atomic64_t *);
   * other cases.
   */
  #define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
@@ -2892,7 +3369,7 @@ diff -urNp linux-3.1.3/arch/sparc/include/asm/atomic_64.h linux-3.1.3/arch/sparc
  #define atomic64_inc_and_test(v) (atomic64_inc_return(v) == 0)
  
  #define atomic_sub_and_test(i, v) (atomic_sub_ret(i, v) == 0)
-@@ -59,25 +101,60 @@ extern long atomic64_sub_ret(long, atomi
+@@ -59,25 +101,60 @@ extern long atomic64_sub_ret(long, atomic64_t *);
  #define atomic64_dec_and_test(v) (atomic64_sub_ret(1, v) == 0)
  
  #define atomic_inc(v) atomic_add(1, v)
@@ -2956,7 +3433,7 @@ diff -urNp linux-3.1.3/arch/sparc/include/asm/atomic_64.h linux-3.1.3/arch/sparc
                if (likely(old == c))
                        break;
                c = old;
-@@ -89,20 +166,35 @@ static inline int __atomic_add_unless(at
+@@ -89,20 +166,35 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u)
  #define atomic64_cmpxchg(v, o, n) \
        ((__typeof__((v)->counter))cmpxchg(&((v)->counter), (o), (n)))
  #define atomic64_xchg(v, new) (xchg(&((v)->counter), new))
@@ -2996,9 +3473,10 @@ diff -urNp linux-3.1.3/arch/sparc/include/asm/atomic_64.h linux-3.1.3/arch/sparc
  }
  
  #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)
-diff -urNp linux-3.1.3/arch/sparc/include/asm/cache.h linux-3.1.3/arch/sparc/include/asm/cache.h
---- linux-3.1.3/arch/sparc/include/asm/cache.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/sparc/include/asm/cache.h 2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/sparc/include/asm/cache.h b/arch/sparc/include/asm/cache.h
+index 69358b5..17b4745 100644
+--- a/arch/sparc/include/asm/cache.h
++++ b/arch/sparc/include/asm/cache.h
 @@ -10,7 +10,7 @@
  #define ARCH_SLAB_MINALIGN    __alignof__(unsigned long long)
  
@@ -3008,9 +3486,10 @@ diff -urNp linux-3.1.3/arch/sparc/include/asm/cache.h linux-3.1.3/arch/sparc/inc
  
  #ifdef CONFIG_SPARC32
  #define SMP_CACHE_BYTES_SHIFT 5
-diff -urNp linux-3.1.3/arch/sparc/include/asm/elf_32.h linux-3.1.3/arch/sparc/include/asm/elf_32.h
---- linux-3.1.3/arch/sparc/include/asm/elf_32.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/sparc/include/asm/elf_32.h        2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/sparc/include/asm/elf_32.h b/arch/sparc/include/asm/elf_32.h
+index 4269ca6..e3da77f 100644
+--- a/arch/sparc/include/asm/elf_32.h
++++ b/arch/sparc/include/asm/elf_32.h
 @@ -114,6 +114,13 @@ typedef struct {
  
  #define ELF_ET_DYN_BASE         (TASK_UNMAPPED_BASE)
@@ -3025,9 +3504,10 @@ diff -urNp linux-3.1.3/arch/sparc/include/asm/elf_32.h linux-3.1.3/arch/sparc/in
  /* This yields a mask that user programs can use to figure out what
     instruction set this cpu supports.  This can NOT be done in userspace
     on Sparc.  */
-diff -urNp linux-3.1.3/arch/sparc/include/asm/elf_64.h linux-3.1.3/arch/sparc/include/asm/elf_64.h
---- linux-3.1.3/arch/sparc/include/asm/elf_64.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/sparc/include/asm/elf_64.h        2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/sparc/include/asm/elf_64.h b/arch/sparc/include/asm/elf_64.h
+index 7df8b7f..4946269 100644
+--- a/arch/sparc/include/asm/elf_64.h
++++ b/arch/sparc/include/asm/elf_64.h
 @@ -180,6 +180,13 @@ typedef struct {
  #define ELF_ET_DYN_BASE               0x0000010000000000UL
  #define COMPAT_ELF_ET_DYN_BASE        0x0000000070000000UL
@@ -3042,9 +3522,10 @@ diff -urNp linux-3.1.3/arch/sparc/include/asm/elf_64.h linux-3.1.3/arch/sparc/in
  extern unsigned long sparc64_elf_hwcap;
  #define ELF_HWCAP     sparc64_elf_hwcap
  
-diff -urNp linux-3.1.3/arch/sparc/include/asm/pgtable_32.h linux-3.1.3/arch/sparc/include/asm/pgtable_32.h
---- linux-3.1.3/arch/sparc/include/asm/pgtable_32.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/sparc/include/asm/pgtable_32.h    2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/sparc/include/asm/pgtable_32.h b/arch/sparc/include/asm/pgtable_32.h
+index 5b31a8e..1d92567 100644
+--- a/arch/sparc/include/asm/pgtable_32.h
++++ b/arch/sparc/include/asm/pgtable_32.h
 @@ -45,6 +45,13 @@ BTFIXUPDEF_SIMM13(user_ptrs_per_pgd)
  BTFIXUPDEF_INT(page_none)
  BTFIXUPDEF_INT(page_copy)
@@ -3076,9 +3557,10 @@ diff -urNp linux-3.1.3/arch/sparc/include/asm/pgtable_32.h linux-3.1.3/arch/spar
  extern unsigned long page_kernel;
  
  #ifdef MODULE
-diff -urNp linux-3.1.3/arch/sparc/include/asm/pgtsrmmu.h linux-3.1.3/arch/sparc/include/asm/pgtsrmmu.h
---- linux-3.1.3/arch/sparc/include/asm/pgtsrmmu.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/sparc/include/asm/pgtsrmmu.h      2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/sparc/include/asm/pgtsrmmu.h b/arch/sparc/include/asm/pgtsrmmu.h
+index f6ae2b2..b03ffc7 100644
+--- a/arch/sparc/include/asm/pgtsrmmu.h
++++ b/arch/sparc/include/asm/pgtsrmmu.h
 @@ -115,6 +115,13 @@
                                    SRMMU_EXEC | SRMMU_REF)
  #define SRMMU_PAGE_RDONLY  __pgprot(SRMMU_VALID | SRMMU_CACHE | \
@@ -3093,10 +3575,11 @@ diff -urNp linux-3.1.3/arch/sparc/include/asm/pgtsrmmu.h linux-3.1.3/arch/sparc/
  #define SRMMU_PAGE_KERNEL  __pgprot(SRMMU_VALID | SRMMU_CACHE | SRMMU_PRIV | \
                                    SRMMU_DIRTY | SRMMU_REF)
  
-diff -urNp linux-3.1.3/arch/sparc/include/asm/spinlock_64.h linux-3.1.3/arch/sparc/include/asm/spinlock_64.h
---- linux-3.1.3/arch/sparc/include/asm/spinlock_64.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/sparc/include/asm/spinlock_64.h   2011-11-16 18:39:07.000000000 -0500
-@@ -92,14 +92,19 @@ static inline void arch_spin_lock_flags(
+diff --git a/arch/sparc/include/asm/spinlock_64.h b/arch/sparc/include/asm/spinlock_64.h
+index 9689176..63c18ea 100644
+--- a/arch/sparc/include/asm/spinlock_64.h
++++ b/arch/sparc/include/asm/spinlock_64.h
+@@ -92,14 +92,19 @@ static inline void arch_spin_lock_flags(arch_spinlock_t *lock, unsigned long fla
  
  /* Multi-reader locks, these are much saner than the 32-bit Sparc ones... */
  
@@ -3118,7 +3601,7 @@ diff -urNp linux-3.1.3/arch/sparc/include/asm/spinlock_64.h linux-3.1.3/arch/spa
  "     cas             [%2], %0, %1\n"
  "     cmp             %0, %1\n"
  "     bne,pn          %%icc, 1b\n"
-@@ -112,10 +117,10 @@ static void inline arch_read_lock(arch_r
+@@ -112,10 +117,10 @@ static void inline arch_read_lock(arch_rwlock_t *lock)
  "     .previous"
        : "=&r" (tmp1), "=&r" (tmp2)
        : "r" (lock)
@@ -3131,7 +3614,7 @@ diff -urNp linux-3.1.3/arch/sparc/include/asm/spinlock_64.h linux-3.1.3/arch/spa
  {
        int tmp1, tmp2;
  
-@@ -123,7 +128,12 @@ static int inline arch_read_trylock(arch
+@@ -123,7 +128,12 @@ static int inline arch_read_trylock(arch_rwlock_t *lock)
  "1:   ldsw            [%2], %0\n"
  "     brlz,a,pn       %0, 2f\n"
  "      mov            0, %0\n"
@@ -3145,7 +3628,7 @@ diff -urNp linux-3.1.3/arch/sparc/include/asm/spinlock_64.h linux-3.1.3/arch/spa
  "     cas             [%2], %0, %1\n"
  "     cmp             %0, %1\n"
  "     bne,pn          %%icc, 1b\n"
-@@ -136,13 +146,18 @@ static int inline arch_read_trylock(arch
+@@ -136,13 +146,18 @@ static int inline arch_read_trylock(arch_rwlock_t *lock)
        return tmp1;
  }
  
@@ -3166,7 +3649,7 @@ diff -urNp linux-3.1.3/arch/sparc/include/asm/spinlock_64.h linux-3.1.3/arch/spa
  "     cas     [%2], %0, %1\n"
  "     cmp     %0, %1\n"
  "     bne,pn  %%xcc, 1b\n"
-@@ -152,7 +167,7 @@ static void inline arch_read_unlock(arch
+@@ -152,7 +167,7 @@ static void inline arch_read_unlock(arch_rwlock_t *lock)
        : "memory");
  }
  
@@ -3175,7 +3658,7 @@ diff -urNp linux-3.1.3/arch/sparc/include/asm/spinlock_64.h linux-3.1.3/arch/spa
  {
        unsigned long mask, tmp1, tmp2;
  
-@@ -177,7 +192,7 @@ static void inline arch_write_lock(arch_
+@@ -177,7 +192,7 @@ static void inline arch_write_lock(arch_rwlock_t *lock)
        : "memory");
  }
  
@@ -3184,7 +3667,7 @@ diff -urNp linux-3.1.3/arch/sparc/include/asm/spinlock_64.h linux-3.1.3/arch/spa
  {
        __asm__ __volatile__(
  "     stw             %%g0, [%0]"
-@@ -186,7 +201,7 @@ static void inline arch_write_unlock(arc
+@@ -186,7 +201,7 @@ static void inline arch_write_unlock(arch_rwlock_t *lock)
        : "memory");
  }
  
@@ -3193,9 +3676,10 @@ diff -urNp linux-3.1.3/arch/sparc/include/asm/spinlock_64.h linux-3.1.3/arch/spa
  {
        unsigned long mask, tmp1, tmp2, result;
  
-diff -urNp linux-3.1.3/arch/sparc/include/asm/thread_info_32.h linux-3.1.3/arch/sparc/include/asm/thread_info_32.h
---- linux-3.1.3/arch/sparc/include/asm/thread_info_32.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/sparc/include/asm/thread_info_32.h        2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/sparc/include/asm/thread_info_32.h b/arch/sparc/include/asm/thread_info_32.h
+index fa57532..e1a4c53 100644
+--- a/arch/sparc/include/asm/thread_info_32.h
++++ b/arch/sparc/include/asm/thread_info_32.h
 @@ -50,6 +50,8 @@ struct thread_info {
        unsigned long           w_saved;
  
@@ -3205,9 +3689,10 @@ diff -urNp linux-3.1.3/arch/sparc/include/asm/thread_info_32.h linux-3.1.3/arch/
  };
  
  /*
-diff -urNp linux-3.1.3/arch/sparc/include/asm/thread_info_64.h linux-3.1.3/arch/sparc/include/asm/thread_info_64.h
---- linux-3.1.3/arch/sparc/include/asm/thread_info_64.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/sparc/include/asm/thread_info_64.h        2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/sparc/include/asm/thread_info_64.h b/arch/sparc/include/asm/thread_info_64.h
+index 60d86be..952dea1 100644
+--- a/arch/sparc/include/asm/thread_info_64.h
++++ b/arch/sparc/include/asm/thread_info_64.h
 @@ -63,6 +63,8 @@ struct thread_info {
        struct pt_regs          *kern_una_regs;
        unsigned int            kern_una_insn;
@@ -3217,10 +3702,29 @@ diff -urNp linux-3.1.3/arch/sparc/include/asm/thread_info_64.h linux-3.1.3/arch/
        unsigned long           fpregs[0] __attribute__ ((aligned(64)));
  };
  
-diff -urNp linux-3.1.3/arch/sparc/include/asm/uaccess_32.h linux-3.1.3/arch/sparc/include/asm/uaccess_32.h
---- linux-3.1.3/arch/sparc/include/asm/uaccess_32.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/sparc/include/asm/uaccess_32.h    2011-11-16 18:39:07.000000000 -0500
-@@ -249,27 +249,46 @@ extern unsigned long __copy_user(void __
+diff --git a/arch/sparc/include/asm/uaccess.h b/arch/sparc/include/asm/uaccess.h
+index e88fbe5..96b0ce5 100644
+--- a/arch/sparc/include/asm/uaccess.h
++++ b/arch/sparc/include/asm/uaccess.h
+@@ -1,5 +1,13 @@
+ #ifndef ___ASM_SPARC_UACCESS_H
+ #define ___ASM_SPARC_UACCESS_H
++
++#ifdef __KERNEL__
++#ifndef __ASSEMBLY__
++#include <linux/types.h>
++extern void check_object_size(const void *ptr, unsigned long n, bool to);
++#endif
++#endif
++
+ #if defined(__sparc__) && defined(__arch64__)
+ #include <asm/uaccess_64.h>
+ #else
+diff --git a/arch/sparc/include/asm/uaccess_32.h b/arch/sparc/include/asm/uaccess_32.h
+index 8303ac4..07f333d 100644
+--- a/arch/sparc/include/asm/uaccess_32.h
++++ b/arch/sparc/include/asm/uaccess_32.h
+@@ -249,27 +249,46 @@ extern unsigned long __copy_user(void __user *to, const void __user *from, unsig
  
  static inline unsigned long copy_to_user(void __user *to, const void *from, unsigned long n)
  {
@@ -3271,9 +3775,10 @@ diff -urNp linux-3.1.3/arch/sparc/include/asm/uaccess_32.h linux-3.1.3/arch/spar
        return __copy_user((__force void __user *) to, from, n);
  }
  
-diff -urNp linux-3.1.3/arch/sparc/include/asm/uaccess_64.h linux-3.1.3/arch/sparc/include/asm/uaccess_64.h
---- linux-3.1.3/arch/sparc/include/asm/uaccess_64.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/sparc/include/asm/uaccess_64.h    2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/sparc/include/asm/uaccess_64.h b/arch/sparc/include/asm/uaccess_64.h
+index 3e1449f..5293a0e 100644
+--- a/arch/sparc/include/asm/uaccess_64.h
++++ b/arch/sparc/include/asm/uaccess_64.h
 @@ -10,6 +10,7 @@
  #include <linux/compiler.h>
  #include <linux/string.h>
@@ -3282,7 +3787,7 @@ diff -urNp linux-3.1.3/arch/sparc/include/asm/uaccess_64.h linux-3.1.3/arch/spar
  #include <asm/asi.h>
  #include <asm/system.h>
  #include <asm/spitfire.h>
-@@ -213,8 +214,15 @@ extern unsigned long copy_from_user_fixu
+@@ -213,8 +214,15 @@ extern unsigned long copy_from_user_fixup(void *to, const void __user *from,
  static inline unsigned long __must_check
  copy_from_user(void *to, const void __user *from, unsigned long size)
  {
@@ -3299,43 +3804,27 @@ diff -urNp linux-3.1.3/arch/sparc/include/asm/uaccess_64.h linux-3.1.3/arch/spar
        if (unlikely(ret))
                ret = copy_from_user_fixup(to, from, size);
  
-@@ -230,8 +238,15 @@ extern unsigned long copy_to_user_fixup(
+@@ -230,8 +238,15 @@ extern unsigned long copy_to_user_fixup(void __user *to, const void *from,
  static inline unsigned long __must_check
  copy_to_user(void __user *to, const void *from, unsigned long size)
  {
 -      unsigned long ret = ___copy_to_user(to, from, size);
 +      unsigned long ret;
-+
 +      if ((long)size < 0 || size > INT_MAX)
 +              return size;
 +
 +      if (!__builtin_constant_p(size))
 +              check_object_size(from, size, true);
++
 +      ret = ___copy_to_user(to, from, size);
        if (unlikely(ret))
                ret = copy_to_user_fixup(to, from, size);
        return ret;
-diff -urNp linux-3.1.3/arch/sparc/include/asm/uaccess.h linux-3.1.3/arch/sparc/include/asm/uaccess.h
---- linux-3.1.3/arch/sparc/include/asm/uaccess.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/sparc/include/asm/uaccess.h       2011-11-16 18:39:07.000000000 -0500
-@@ -1,5 +1,13 @@
- #ifndef ___ASM_SPARC_UACCESS_H
- #define ___ASM_SPARC_UACCESS_H
-+
-+#ifdef __KERNEL__
-+#ifndef __ASSEMBLY__
-+#include <linux/types.h>
-+extern void check_object_size(const void *ptr, unsigned long n, bool to);
-+#endif
-+#endif
-+
- #if defined(__sparc__) && defined(__arch64__)
- #include <asm/uaccess_64.h>
- #else
-diff -urNp linux-3.1.3/arch/sparc/kernel/Makefile linux-3.1.3/arch/sparc/kernel/Makefile
---- linux-3.1.3/arch/sparc/kernel/Makefile     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/sparc/kernel/Makefile     2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/sparc/kernel/Makefile b/arch/sparc/kernel/Makefile
+index cb85458..e063f17 100644
+--- a/arch/sparc/kernel/Makefile
++++ b/arch/sparc/kernel/Makefile
 @@ -3,7 +3,7 @@
  #
  
@@ -3345,9 +3834,10 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/Makefile linux-3.1.3/arch/sparc/kernel/
  
  extra-y     := head_$(BITS).o
  extra-y     += init_task.o
-diff -urNp linux-3.1.3/arch/sparc/kernel/process_32.c linux-3.1.3/arch/sparc/kernel/process_32.c
---- linux-3.1.3/arch/sparc/kernel/process_32.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/sparc/kernel/process_32.c 2011-11-16 18:40:08.000000000 -0500
+diff --git a/arch/sparc/kernel/process_32.c b/arch/sparc/kernel/process_32.c
+index f793742..4d880af 100644
+--- a/arch/sparc/kernel/process_32.c
++++ b/arch/sparc/kernel/process_32.c
 @@ -204,7 +204,7 @@ void __show_backtrace(unsigned long fp)
                       rw->ins[4], rw->ins[5],
                       rw->ins[6],
@@ -3374,7 +3864,7 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/process_32.c linux-3.1.3/arch/sparc/ker
  
        printk("%%L: %08lx %08lx  %08lx %08lx  %08lx %08lx  %08lx %08lx\n",
               rw->locals[0], rw->locals[1], rw->locals[2], rw->locals[3],
-@@ -313,7 +313,7 @@ void show_stack(struct task_struct *tsk,
+@@ -313,7 +313,7 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp)
                rw = (struct reg_window32 *) fp;
                pc = rw->ins[7];
                printk("[%08lx : ", pc);
@@ -3383,10 +3873,11 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/process_32.c linux-3.1.3/arch/sparc/ker
                fp = rw->ins[6];
        } while (++count < 16);
        printk("\n");
-diff -urNp linux-3.1.3/arch/sparc/kernel/process_64.c linux-3.1.3/arch/sparc/kernel/process_64.c
---- linux-3.1.3/arch/sparc/kernel/process_64.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/sparc/kernel/process_64.c 2011-11-16 18:40:08.000000000 -0500
-@@ -180,14 +180,14 @@ static void show_regwindow(struct pt_reg
+diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c
+index d959cd0..7b42812 100644
+--- a/arch/sparc/kernel/process_64.c
++++ b/arch/sparc/kernel/process_64.c
+@@ -180,14 +180,14 @@ static void show_regwindow(struct pt_regs *regs)
        printk("i4: %016lx i5: %016lx i6: %016lx i7: %016lx\n",
               rwk->ins[4], rwk->ins[5], rwk->ins[6], rwk->ins[7]);
        if (regs->tstate & TSTATE_PRIV)
@@ -3412,7 +3903,7 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/process_64.c linux-3.1.3/arch/sparc/ker
        show_regwindow(regs);
        show_stack(current, (unsigned long *) regs->u_regs[UREG_FP]);
  }
-@@ -285,7 +285,7 @@ void arch_trigger_all_cpu_backtrace(void
+@@ -285,7 +285,7 @@ void arch_trigger_all_cpu_backtrace(void)
                       ((tp && tp->task) ? tp->task->pid : -1));
  
                if (gp->tstate & TSTATE_PRIV) {
@@ -3421,10 +3912,11 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/process_64.c linux-3.1.3/arch/sparc/ker
                               (void *) gp->tpc,
                               (void *) gp->o7,
                               (void *) gp->i7,
-diff -urNp linux-3.1.3/arch/sparc/kernel/sys_sparc_32.c linux-3.1.3/arch/sparc/kernel/sys_sparc_32.c
---- linux-3.1.3/arch/sparc/kernel/sys_sparc_32.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/sparc/kernel/sys_sparc_32.c       2011-11-16 18:39:07.000000000 -0500
-@@ -56,7 +56,7 @@ unsigned long arch_get_unmapped_area(str
+diff --git a/arch/sparc/kernel/sys_sparc_32.c b/arch/sparc/kernel/sys_sparc_32.c
+index 42b282f..28ce9f2 100644
+--- a/arch/sparc/kernel/sys_sparc_32.c
++++ b/arch/sparc/kernel/sys_sparc_32.c
+@@ -56,7 +56,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi
        if (ARCH_SUN4C && len > 0x20000000)
                return -ENOMEM;
        if (!addr)
@@ -3433,7 +3925,7 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/sys_sparc_32.c linux-3.1.3/arch/sparc/k
  
        if (flags & MAP_SHARED)
                addr = COLOUR_ALIGN(addr);
-@@ -71,7 +71,7 @@ unsigned long arch_get_unmapped_area(str
+@@ -71,7 +71,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi
                }
                if (TASK_SIZE - PAGE_SIZE - len < addr)
                        return -ENOMEM;
@@ -3442,10 +3934,11 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/sys_sparc_32.c linux-3.1.3/arch/sparc/k
                        return addr;
                addr = vmm->vm_end;
                if (flags & MAP_SHARED)
-diff -urNp linux-3.1.3/arch/sparc/kernel/sys_sparc_64.c linux-3.1.3/arch/sparc/kernel/sys_sparc_64.c
---- linux-3.1.3/arch/sparc/kernel/sys_sparc_64.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/sparc/kernel/sys_sparc_64.c       2011-11-16 18:39:07.000000000 -0500
-@@ -124,7 +124,7 @@ unsigned long arch_get_unmapped_area(str
+diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c
+index 908b47a..aa9e584 100644
+--- a/arch/sparc/kernel/sys_sparc_64.c
++++ b/arch/sparc/kernel/sys_sparc_64.c
+@@ -124,7 +124,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi
                /* We do not accept a shared mapping if it would violate
                 * cache aliasing constraints.
                 */
@@ -3454,7 +3947,7 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/sys_sparc_64.c linux-3.1.3/arch/sparc/k
                    ((addr - (pgoff << PAGE_SHIFT)) & (SHMLBA - 1)))
                        return -EINVAL;
                return addr;
-@@ -139,6 +139,10 @@ unsigned long arch_get_unmapped_area(str
+@@ -139,6 +139,10 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi
        if (filp || (flags & MAP_SHARED))
                do_color_align = 1;
  
@@ -3465,7 +3958,7 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/sys_sparc_64.c linux-3.1.3/arch/sparc/k
        if (addr) {
                if (do_color_align)
                        addr = COLOUR_ALIGN(addr, pgoff);
-@@ -146,15 +150,14 @@ unsigned long arch_get_unmapped_area(str
+@@ -146,15 +150,14 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi
                        addr = PAGE_ALIGN(addr);
  
                vma = find_vma(mm, addr);
@@ -3502,7 +3995,7 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/sys_sparc_64.c linux-3.1.3/arch/sparc/k
                        /*
                         * Remember the place where we stopped the search:
                         */
-@@ -215,7 +218,7 @@ arch_get_unmapped_area_topdown(struct fi
+@@ -215,7 +218,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
                /* We do not accept a shared mapping if it would violate
                 * cache aliasing constraints.
                 */
@@ -3511,7 +4004,7 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/sys_sparc_64.c linux-3.1.3/arch/sparc/k
                    ((addr - (pgoff << PAGE_SHIFT)) & (SHMLBA - 1)))
                        return -EINVAL;
                return addr;
-@@ -236,8 +239,7 @@ arch_get_unmapped_area_topdown(struct fi
+@@ -236,8 +239,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
                        addr = PAGE_ALIGN(addr);
  
                vma = find_vma(mm, addr);
@@ -3521,7 +4014,7 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/sys_sparc_64.c linux-3.1.3/arch/sparc/k
                        return addr;
        }
  
-@@ -258,7 +260,7 @@ arch_get_unmapped_area_topdown(struct fi
+@@ -258,7 +260,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
        /* make sure it can fit in the remaining address space */
        if (likely(addr > len)) {
                vma = find_vma(mm, addr-len);
@@ -3530,7 +4023,7 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/sys_sparc_64.c linux-3.1.3/arch/sparc/k
                        /* remember the address as a hint for next time */
                        return (mm->free_area_cache = addr-len);
                }
-@@ -267,18 +269,18 @@ arch_get_unmapped_area_topdown(struct fi
+@@ -267,18 +269,18 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
        if (unlikely(mm->mmap_base < len))
                goto bottomup;
  
@@ -3553,7 +4046,7 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/sys_sparc_64.c linux-3.1.3/arch/sparc/k
                        /* remember the address as a hint for next time */
                        return (mm->free_area_cache = addr);
                }
-@@ -288,10 +290,8 @@ arch_get_unmapped_area_topdown(struct fi
+@@ -288,10 +290,8 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
                        mm->cached_hole_size = vma->vm_start - addr;
  
                /* try just below the current vma->vm_start */
@@ -3566,7 +4059,7 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/sys_sparc_64.c linux-3.1.3/arch/sparc/k
  
  bottomup:
        /*
-@@ -390,6 +390,12 @@ void arch_pick_mmap_layout(struct mm_str
+@@ -390,6 +390,12 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
            gap == RLIM_INFINITY ||
            sysctl_legacy_va_layout) {
                mm->mmap_base = TASK_UNMAPPED_BASE + random_factor;
@@ -3579,7 +4072,7 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/sys_sparc_64.c linux-3.1.3/arch/sparc/k
                mm->get_unmapped_area = arch_get_unmapped_area;
                mm->unmap_area = arch_unmap_area;
        } else {
-@@ -402,6 +408,12 @@ void arch_pick_mmap_layout(struct mm_str
+@@ -402,6 +408,12 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
                        gap = (task_size / 6 * 5);
  
                mm->mmap_base = PAGE_ALIGN(task_size - gap - random_factor);
@@ -3592,10 +4085,11 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/sys_sparc_64.c linux-3.1.3/arch/sparc/k
                mm->get_unmapped_area = arch_get_unmapped_area_topdown;
                mm->unmap_area = arch_unmap_area_topdown;
        }
-diff -urNp linux-3.1.3/arch/sparc/kernel/traps_32.c linux-3.1.3/arch/sparc/kernel/traps_32.c
---- linux-3.1.3/arch/sparc/kernel/traps_32.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/sparc/kernel/traps_32.c   2011-11-16 18:40:08.000000000 -0500
-@@ -44,6 +44,8 @@ static void instruction_dump(unsigned lo
+diff --git a/arch/sparc/kernel/traps_32.c b/arch/sparc/kernel/traps_32.c
+index c0490c7..84959d1 100644
+--- a/arch/sparc/kernel/traps_32.c
++++ b/arch/sparc/kernel/traps_32.c
+@@ -44,6 +44,8 @@ static void instruction_dump(unsigned long *pc)
  #define __SAVE __asm__ __volatile__("save %sp, -0x40, %sp\n\t")
  #define __RESTORE __asm__ __volatile__("restore %g0, %g0, %g0\n\t")
  
@@ -3604,7 +4098,7 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/traps_32.c linux-3.1.3/arch/sparc/kerne
  void die_if_kernel(char *str, struct pt_regs *regs)
  {
        static int die_counter;
-@@ -76,15 +78,17 @@ void die_if_kernel(char *str, struct pt_
+@@ -76,15 +78,17 @@ void die_if_kernel(char *str, struct pt_regs *regs)
                      count++ < 30                              &&
                        (((unsigned long) rw) >= PAGE_OFFSET)   &&
                      !(((unsigned long) rw) & 0x7)) {
@@ -3624,10 +4118,11 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/traps_32.c linux-3.1.3/arch/sparc/kerne
        do_exit(SIGSEGV);
  }
  
-diff -urNp linux-3.1.3/arch/sparc/kernel/traps_64.c linux-3.1.3/arch/sparc/kernel/traps_64.c
---- linux-3.1.3/arch/sparc/kernel/traps_64.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/sparc/kernel/traps_64.c   2011-11-16 18:40:08.000000000 -0500
-@@ -75,7 +75,7 @@ static void dump_tl1_traplog(struct tl1_
+diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c
+index 0cbdaa4..438e4c9 100644
+--- a/arch/sparc/kernel/traps_64.c
++++ b/arch/sparc/kernel/traps_64.c
+@@ -75,7 +75,7 @@ static void dump_tl1_traplog(struct tl1_traplog *p)
                       i + 1,
                       p->trapstack[i].tstate, p->trapstack[i].tpc,
                       p->trapstack[i].tnpc, p->trapstack[i].tt);
@@ -3636,7 +4131,7 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/traps_64.c linux-3.1.3/arch/sparc/kerne
        }
  }
  
-@@ -95,6 +95,12 @@ void bad_trap(struct pt_regs *regs, long
+@@ -95,6 +95,12 @@ void bad_trap(struct pt_regs *regs, long lvl)
  
        lvl -= 0x100;
        if (regs->tstate & TSTATE_PRIV) {
@@ -3649,7 +4144,7 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/traps_64.c linux-3.1.3/arch/sparc/kerne
                sprintf(buffer, "Kernel bad sw trap %lx", lvl);
                die_if_kernel(buffer, regs);
        }
-@@ -113,11 +119,16 @@ void bad_trap(struct pt_regs *regs, long
+@@ -113,11 +119,16 @@ void bad_trap(struct pt_regs *regs, long lvl)
  void bad_trap_tl1(struct pt_regs *regs, long lvl)
  {
        char buffer[32];
@@ -3667,7 +4162,7 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/traps_64.c linux-3.1.3/arch/sparc/kerne
        dump_tl1_traplog((struct tl1_traplog *)(regs + 1));
  
        sprintf (buffer, "Bad trap %lx at tl>0", lvl);
-@@ -1141,7 +1152,7 @@ static void cheetah_log_errors(struct pt
+@@ -1141,7 +1152,7 @@ static void cheetah_log_errors(struct pt_regs *regs, struct cheetah_err_info *in
               regs->tpc, regs->tnpc, regs->u_regs[UREG_I7], regs->tstate);
        printk("%s" "ERROR(%d): ",
               (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id());
@@ -3676,7 +4171,7 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/traps_64.c linux-3.1.3/arch/sparc/kerne
        printk("%s" "ERROR(%d): M_SYND(%lx),  E_SYND(%lx)%s%s\n",
               (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(),
               (afsr & CHAFSR_M_SYNDROME) >> CHAFSR_M_SYNDROME_SHIFT,
-@@ -1748,7 +1759,7 @@ void cheetah_plus_parity_error(int type,
+@@ -1748,7 +1759,7 @@ void cheetah_plus_parity_error(int type, struct pt_regs *regs)
                       smp_processor_id(),
                       (type & 0x1) ? 'I' : 'D',
                       regs->tpc);
@@ -3685,7 +4180,7 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/traps_64.c linux-3.1.3/arch/sparc/kerne
                panic("Irrecoverable Cheetah+ parity error.");
        }
  
-@@ -1756,7 +1767,7 @@ void cheetah_plus_parity_error(int type,
+@@ -1756,7 +1767,7 @@ void cheetah_plus_parity_error(int type, struct pt_regs *regs)
               smp_processor_id(),
               (type & 0x1) ? 'I' : 'D',
               regs->tpc);
@@ -3694,7 +4189,7 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/traps_64.c linux-3.1.3/arch/sparc/kerne
  }
  
  struct sun4v_error_entry {
-@@ -1963,9 +1974,9 @@ void sun4v_itlb_error_report(struct pt_r
+@@ -1963,9 +1974,9 @@ void sun4v_itlb_error_report(struct pt_regs *regs, int tl)
  
        printk(KERN_EMERG "SUN4V-ITLB: Error at TPC[%lx], tl %d\n",
               regs->tpc, tl);
@@ -3706,7 +4201,7 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/traps_64.c linux-3.1.3/arch/sparc/kerne
               (void *) regs->u_regs[UREG_I7]);
        printk(KERN_EMERG "SUN4V-ITLB: vaddr[%lx] ctx[%lx] "
               "pte[%lx] error[%lx]\n",
-@@ -1987,9 +1998,9 @@ void sun4v_dtlb_error_report(struct pt_r
+@@ -1987,9 +1998,9 @@ void sun4v_dtlb_error_report(struct pt_regs *regs, int tl)
  
        printk(KERN_EMERG "SUN4V-DTLB: Error at TPC[%lx], tl %d\n",
               regs->tpc, tl);
@@ -3718,7 +4213,7 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/traps_64.c linux-3.1.3/arch/sparc/kerne
               (void *) regs->u_regs[UREG_I7]);
        printk(KERN_EMERG "SUN4V-DTLB: vaddr[%lx] ctx[%lx] "
               "pte[%lx] error[%lx]\n",
-@@ -2195,13 +2206,13 @@ void show_stack(struct task_struct *tsk,
+@@ -2195,13 +2206,13 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp)
                        fp = (unsigned long)sf->fp + STACK_BIAS;
                }
  
@@ -3734,7 +4229,7 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/traps_64.c linux-3.1.3/arch/sparc/kerne
                                graph++;
                        }
                }
-@@ -2226,6 +2237,8 @@ static inline struct reg_window *kernel_
+@@ -2226,6 +2237,8 @@ static inline struct reg_window *kernel_stack_up(struct reg_window *rw)
        return (struct reg_window *) (fp + STACK_BIAS);
  }
  
@@ -3743,7 +4238,7 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/traps_64.c linux-3.1.3/arch/sparc/kerne
  void die_if_kernel(char *str, struct pt_regs *regs)
  {
        static int die_counter;
-@@ -2254,7 +2267,7 @@ void die_if_kernel(char *str, struct pt_
+@@ -2254,7 +2267,7 @@ void die_if_kernel(char *str, struct pt_regs *regs)
                while (rw &&
                       count++ < 30 &&
                       kstack_valid(tp, (unsigned long) rw)) {
@@ -3752,7 +4247,7 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/traps_64.c linux-3.1.3/arch/sparc/kerne
                               (void *) rw->ins[7]);
  
                        rw = kernel_stack_up(rw);
-@@ -2267,8 +2280,10 @@ void die_if_kernel(char *str, struct pt_
+@@ -2267,8 +2280,10 @@ void die_if_kernel(char *str, struct pt_regs *regs)
                }
                user_instruction_dump ((unsigned int __user *) regs->tpc);
        }
@@ -3764,10 +4259,11 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/traps_64.c linux-3.1.3/arch/sparc/kerne
        do_exit(SIGSEGV);
  }
  EXPORT_SYMBOL(die_if_kernel);
-diff -urNp linux-3.1.3/arch/sparc/kernel/unaligned_64.c linux-3.1.3/arch/sparc/kernel/unaligned_64.c
---- linux-3.1.3/arch/sparc/kernel/unaligned_64.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/sparc/kernel/unaligned_64.c       2011-11-16 18:40:08.000000000 -0500
-@@ -279,7 +279,7 @@ static void log_unaligned(struct pt_regs
+diff --git a/arch/sparc/kernel/unaligned_64.c b/arch/sparc/kernel/unaligned_64.c
+index 76e4ac1..78f8bb1 100644
+--- a/arch/sparc/kernel/unaligned_64.c
++++ b/arch/sparc/kernel/unaligned_64.c
+@@ -279,7 +279,7 @@ static void log_unaligned(struct pt_regs *regs)
        static DEFINE_RATELIMIT_STATE(ratelimit, 5 * HZ, 5);
  
        if (__ratelimit(&ratelimit)) {
@@ -3776,9 +4272,23 @@ diff -urNp linux-3.1.3/arch/sparc/kernel/unaligned_64.c linux-3.1.3/arch/sparc/k
                       regs->tpc, (void *) regs->tpc);
        }
  }
-diff -urNp linux-3.1.3/arch/sparc/lib/atomic_64.S linux-3.1.3/arch/sparc/lib/atomic_64.S
---- linux-3.1.3/arch/sparc/lib/atomic_64.S     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/sparc/lib/atomic_64.S     2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/sparc/lib/Makefile b/arch/sparc/lib/Makefile
+index a3fc437..fea9957 100644
+--- a/arch/sparc/lib/Makefile
++++ b/arch/sparc/lib/Makefile
+@@ -2,7 +2,7 @@
+ #
+ asflags-y := -ansi -DST_DIV0=0x02
+-ccflags-y := -Werror
++#ccflags-y := -Werror
+ lib-$(CONFIG_SPARC32) += mul.o rem.o sdiv.o udiv.o umul.o urem.o ashrdi3.o
+ lib-$(CONFIG_SPARC32) += memcpy.o memset.o
+diff --git a/arch/sparc/lib/atomic_64.S b/arch/sparc/lib/atomic_64.S
+index 59186e0..f747d7a 100644
+--- a/arch/sparc/lib/atomic_64.S
++++ b/arch/sparc/lib/atomic_64.S
 @@ -18,7 +18,12 @@
  atomic_add: /* %o0 = increment, %o1 = atomic_ptr */
        BACKOFF_SETUP(%o2)
@@ -3793,7 +4303,7 @@ diff -urNp linux-3.1.3/arch/sparc/lib/atomic_64.S linux-3.1.3/arch/sparc/lib/ato
        cas     [%o1], %g1, %g7
        cmp     %g1, %g7
        bne,pn  %icc, BACKOFF_LABEL(2f, 1b)
-@@ -28,12 +33,32 @@ atomic_add: /* %o0 = increment, %o1 = at
+@@ -28,12 +33,32 @@ atomic_add: /* %o0 = increment, %o1 = atomic_ptr */
  2:    BACKOFF_SPIN(%o2, %o3, 1b)
        .size   atomic_add, .-atomic_add
  
@@ -3827,7 +4337,7 @@ diff -urNp linux-3.1.3/arch/sparc/lib/atomic_64.S linux-3.1.3/arch/sparc/lib/ato
        cas     [%o1], %g1, %g7
        cmp     %g1, %g7
        bne,pn  %icc, BACKOFF_LABEL(2f, 1b)
-@@ -43,12 +68,32 @@ atomic_sub: /* %o0 = decrement, %o1 = at
+@@ -43,12 +68,32 @@ atomic_sub: /* %o0 = decrement, %o1 = atomic_ptr */
  2:    BACKOFF_SPIN(%o2, %o3, 1b)
        .size   atomic_sub, .-atomic_sub
  
@@ -3861,7 +4371,7 @@ diff -urNp linux-3.1.3/arch/sparc/lib/atomic_64.S linux-3.1.3/arch/sparc/lib/ato
        cas     [%o1], %g1, %g7
        cmp     %g1, %g7
        bne,pn  %icc, BACKOFF_LABEL(2f, 1b)
-@@ -58,12 +103,33 @@ atomic_add_ret: /* %o0 = increment, %o1 
+@@ -58,12 +103,33 @@ atomic_add_ret: /* %o0 = increment, %o1 = atomic_ptr */
  2:    BACKOFF_SPIN(%o2, %o3, 1b)
        .size   atomic_add_ret, .-atomic_add_ret
  
@@ -3896,7 +4406,7 @@ diff -urNp linux-3.1.3/arch/sparc/lib/atomic_64.S linux-3.1.3/arch/sparc/lib/ato
        cas     [%o1], %g1, %g7
        cmp     %g1, %g7
        bne,pn  %icc, BACKOFF_LABEL(2f, 1b)
-@@ -78,7 +144,12 @@ atomic_sub_ret: /* %o0 = decrement, %o1 
+@@ -78,7 +144,12 @@ atomic_sub_ret: /* %o0 = decrement, %o1 = atomic_ptr */
  atomic64_add: /* %o0 = increment, %o1 = atomic_ptr */
        BACKOFF_SETUP(%o2)
  1:    ldx     [%o1], %g1
@@ -3910,7 +4420,7 @@ diff -urNp linux-3.1.3/arch/sparc/lib/atomic_64.S linux-3.1.3/arch/sparc/lib/ato
        casx    [%o1], %g1, %g7
        cmp     %g1, %g7
        bne,pn  %xcc, BACKOFF_LABEL(2f, 1b)
-@@ -88,12 +159,32 @@ atomic64_add: /* %o0 = increment, %o1 = 
+@@ -88,12 +159,32 @@ atomic64_add: /* %o0 = increment, %o1 = atomic_ptr */
  2:    BACKOFF_SPIN(%o2, %o3, 1b)
        .size   atomic64_add, .-atomic64_add
  
@@ -3944,7 +4454,7 @@ diff -urNp linux-3.1.3/arch/sparc/lib/atomic_64.S linux-3.1.3/arch/sparc/lib/ato
        casx    [%o1], %g1, %g7
        cmp     %g1, %g7
        bne,pn  %xcc, BACKOFF_LABEL(2f, 1b)
-@@ -103,12 +194,32 @@ atomic64_sub: /* %o0 = decrement, %o1 = 
+@@ -103,12 +194,32 @@ atomic64_sub: /* %o0 = decrement, %o1 = atomic_ptr */
  2:    BACKOFF_SPIN(%o2, %o3, 1b)
        .size   atomic64_sub, .-atomic64_sub
  
@@ -3978,7 +4488,7 @@ diff -urNp linux-3.1.3/arch/sparc/lib/atomic_64.S linux-3.1.3/arch/sparc/lib/ato
        casx    [%o1], %g1, %g7
        cmp     %g1, %g7
        bne,pn  %xcc, BACKOFF_LABEL(2f, 1b)
-@@ -118,12 +229,33 @@ atomic64_add_ret: /* %o0 = increment, %o
+@@ -118,12 +229,33 @@ atomic64_add_ret: /* %o0 = increment, %o1 = atomic_ptr */
  2:    BACKOFF_SPIN(%o2, %o3, 1b)
        .size   atomic64_add_ret, .-atomic64_add_ret
  
@@ -4013,9 +4523,10 @@ diff -urNp linux-3.1.3/arch/sparc/lib/atomic_64.S linux-3.1.3/arch/sparc/lib/ato
        casx    [%o1], %g1, %g7
        cmp     %g1, %g7
        bne,pn  %xcc, BACKOFF_LABEL(2f, 1b)
-diff -urNp linux-3.1.3/arch/sparc/lib/ksyms.c linux-3.1.3/arch/sparc/lib/ksyms.c
---- linux-3.1.3/arch/sparc/lib/ksyms.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/sparc/lib/ksyms.c 2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/sparc/lib/ksyms.c b/arch/sparc/lib/ksyms.c
+index 1b30bb3..b4a16c7 100644
+--- a/arch/sparc/lib/ksyms.c
++++ b/arch/sparc/lib/ksyms.c
 @@ -142,12 +142,18 @@ EXPORT_SYMBOL(__downgrade_write);
  
  /* Atomic counter implementation. */
@@ -4035,33 +4546,23 @@ diff -urNp linux-3.1.3/arch/sparc/lib/ksyms.c linux-3.1.3/arch/sparc/lib/ksyms.c
  EXPORT_SYMBOL(atomic64_sub_ret);
  
  /* Atomic bit operations. */
-diff -urNp linux-3.1.3/arch/sparc/lib/Makefile linux-3.1.3/arch/sparc/lib/Makefile
---- linux-3.1.3/arch/sparc/lib/Makefile        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/sparc/lib/Makefile        2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/sparc/mm/Makefile b/arch/sparc/mm/Makefile
+index e3cda21..a68e4cb 100644
+--- a/arch/sparc/mm/Makefile
++++ b/arch/sparc/mm/Makefile
 @@ -2,7 +2,7 @@
  #
  
- asflags-y := -ansi -DST_DIV0=0x02
+ asflags-y := -ansi
 -ccflags-y := -Werror
 +#ccflags-y := -Werror
  
- lib-$(CONFIG_SPARC32) += mul.o rem.o sdiv.o udiv.o umul.o urem.o ashrdi3.o
- lib-$(CONFIG_SPARC32) += memcpy.o memset.o
-diff -urNp linux-3.1.3/arch/sparc/Makefile linux-3.1.3/arch/sparc/Makefile
---- linux-3.1.3/arch/sparc/Makefile    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/sparc/Makefile    2011-11-16 18:40:08.000000000 -0500
-@@ -75,7 +75,7 @@ drivers-$(CONFIG_OPROFILE)   += arch/sparc
- # Export what is needed by arch/sparc/boot/Makefile
- export VMLINUX_INIT VMLINUX_MAIN
- VMLINUX_INIT := $(head-y) $(init-y)
--VMLINUX_MAIN := $(core-y) kernel/ mm/ fs/ ipc/ security/ crypto/ block/
-+VMLINUX_MAIN := $(core-y) kernel/ mm/ fs/ ipc/ security/ crypto/ block/ grsecurity/
- VMLINUX_MAIN += $(patsubst %/, %/lib.a, $(libs-y)) $(libs-y)
- VMLINUX_MAIN += $(drivers-y) $(net-y)
-diff -urNp linux-3.1.3/arch/sparc/mm/fault_32.c linux-3.1.3/arch/sparc/mm/fault_32.c
---- linux-3.1.3/arch/sparc/mm/fault_32.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/sparc/mm/fault_32.c       2011-11-16 18:39:07.000000000 -0500
+ obj-$(CONFIG_SPARC64)   += ultra.o tlb.o tsb.o gup.o
+ obj-y                   += fault_$(BITS).o
+diff --git a/arch/sparc/mm/fault_32.c b/arch/sparc/mm/fault_32.c
+index aa1c1b1..f93e28f 100644
+--- a/arch/sparc/mm/fault_32.c
++++ b/arch/sparc/mm/fault_32.c
 @@ -22,6 +22,9 @@
  #include <linux/interrupt.h>
  #include <linux/module.h>
@@ -4072,7 +4573,7 @@ diff -urNp linux-3.1.3/arch/sparc/mm/fault_32.c linux-3.1.3/arch/sparc/mm/fault_
  
  #include <asm/system.h>
  #include <asm/page.h>
-@@ -209,6 +212,268 @@ static unsigned long compute_si_addr(str
+@@ -209,6 +212,268 @@ static unsigned long compute_si_addr(struct pt_regs *regs, int text_fault)
        return safe_compute_effective_address(regs, insn);
  }
  
@@ -4366,9 +4867,10 @@ diff -urNp linux-3.1.3/arch/sparc/mm/fault_32.c linux-3.1.3/arch/sparc/mm/fault_
                /* Allow reads even for write-only mappings */
                if(!(vma->vm_flags & (VM_READ | VM_EXEC)))
                        goto bad_area;
-diff -urNp linux-3.1.3/arch/sparc/mm/fault_64.c linux-3.1.3/arch/sparc/mm/fault_64.c
---- linux-3.1.3/arch/sparc/mm/fault_64.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/sparc/mm/fault_64.c       2011-11-16 18:40:08.000000000 -0500
+diff --git a/arch/sparc/mm/fault_64.c b/arch/sparc/mm/fault_64.c
+index 504c062..6fcb9c6 100644
+--- a/arch/sparc/mm/fault_64.c
++++ b/arch/sparc/mm/fault_64.c
 @@ -21,6 +21,9 @@
  #include <linux/kprobes.h>
  #include <linux/kdebug.h>
@@ -4379,7 +4881,7 @@ diff -urNp linux-3.1.3/arch/sparc/mm/fault_64.c linux-3.1.3/arch/sparc/mm/fault_
  
  #include <asm/page.h>
  #include <asm/pgtable.h>
-@@ -74,7 +77,7 @@ static void __kprobes bad_kernel_pc(stru
+@@ -74,7 +77,7 @@ static void __kprobes bad_kernel_pc(struct pt_regs *regs, unsigned long vaddr)
        printk(KERN_CRIT "OOPS: Bogus kernel PC [%016lx] in fault handler\n",
               regs->tpc);
        printk(KERN_CRIT "OOPS: RPC [%016lx]\n", regs->u_regs[15]);
@@ -4388,7 +4890,7 @@ diff -urNp linux-3.1.3/arch/sparc/mm/fault_64.c linux-3.1.3/arch/sparc/mm/fault_
        printk(KERN_CRIT "OOPS: Fault was to vaddr[%lx]\n", vaddr);
        dump_stack();
        unhandled_fault(regs->tpc, current, regs);
-@@ -272,6 +275,457 @@ static void noinline __kprobes bogus_32b
+@@ -272,6 +275,457 @@ static void noinline __kprobes bogus_32bit_fault_address(struct pt_regs *regs,
        show_regs(regs);
  }
  
@@ -4846,7 +5348,7 @@ diff -urNp linux-3.1.3/arch/sparc/mm/fault_64.c linux-3.1.3/arch/sparc/mm/fault_
  asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs)
  {
        struct mm_struct *mm = current->mm;
-@@ -340,6 +794,29 @@ asmlinkage void __kprobes do_sparc64_fau
+@@ -340,6 +794,29 @@ asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs)
        if (!vma)
                goto bad_area;
  
@@ -4876,9 +5378,10 @@ diff -urNp linux-3.1.3/arch/sparc/mm/fault_64.c linux-3.1.3/arch/sparc/mm/fault_
        /* Pure DTLB misses do not tell us whether the fault causing
         * load/store/atomic was a write or not, it only says that there
         * was no match.  So in such a case we (carefully) read the
-diff -urNp linux-3.1.3/arch/sparc/mm/hugetlbpage.c linux-3.1.3/arch/sparc/mm/hugetlbpage.c
---- linux-3.1.3/arch/sparc/mm/hugetlbpage.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/sparc/mm/hugetlbpage.c    2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/sparc/mm/hugetlbpage.c b/arch/sparc/mm/hugetlbpage.c
+index f4e9764..5682724 100644
+--- a/arch/sparc/mm/hugetlbpage.c
++++ b/arch/sparc/mm/hugetlbpage.c
 @@ -68,7 +68,7 @@ full_search:
                        }
                        return -ENOMEM;
@@ -4888,7 +5391,7 @@ diff -urNp linux-3.1.3/arch/sparc/mm/hugetlbpage.c linux-3.1.3/arch/sparc/mm/hug
                        /*
                         * Remember the place where we stopped the search:
                         */
-@@ -107,7 +107,7 @@ hugetlb_get_unmapped_area_topdown(struct
+@@ -107,7 +107,7 @@ hugetlb_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
        /* make sure it can fit in the remaining address space */
        if (likely(addr > len)) {
                vma = find_vma(mm, addr-len);
@@ -4897,7 +5400,7 @@ diff -urNp linux-3.1.3/arch/sparc/mm/hugetlbpage.c linux-3.1.3/arch/sparc/mm/hug
                        /* remember the address as a hint for next time */
                        return (mm->free_area_cache = addr-len);
                }
-@@ -116,16 +116,17 @@ hugetlb_get_unmapped_area_topdown(struct
+@@ -116,16 +116,17 @@ hugetlb_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
        if (unlikely(mm->mmap_base < len))
                goto bottomup;
  
@@ -4917,7 +5420,7 @@ diff -urNp linux-3.1.3/arch/sparc/mm/hugetlbpage.c linux-3.1.3/arch/sparc/mm/hug
                        /* remember the address as a hint for next time */
                        return (mm->free_area_cache = addr);
                }
-@@ -135,8 +136,8 @@ hugetlb_get_unmapped_area_topdown(struct
+@@ -135,8 +136,8 @@ hugetlb_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
                        mm->cached_hole_size = vma->vm_start - addr;
  
                /* try just below the current vma->vm_start */
@@ -4928,7 +5431,7 @@ diff -urNp linux-3.1.3/arch/sparc/mm/hugetlbpage.c linux-3.1.3/arch/sparc/mm/hug
  
  bottomup:
        /*
-@@ -182,8 +183,7 @@ hugetlb_get_unmapped_area(struct file *f
+@@ -182,8 +183,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
        if (addr) {
                addr = ALIGN(addr, HPAGE_SIZE);
                vma = find_vma(mm, addr);
@@ -4938,9 +5441,10 @@ diff -urNp linux-3.1.3/arch/sparc/mm/hugetlbpage.c linux-3.1.3/arch/sparc/mm/hug
                        return addr;
        }
        if (mm->get_unmapped_area == arch_get_unmapped_area)
-diff -urNp linux-3.1.3/arch/sparc/mm/init_32.c linux-3.1.3/arch/sparc/mm/init_32.c
---- linux-3.1.3/arch/sparc/mm/init_32.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/sparc/mm/init_32.c        2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/sparc/mm/init_32.c b/arch/sparc/mm/init_32.c
+index 7b00de6..78239f4 100644
+--- a/arch/sparc/mm/init_32.c
++++ b/arch/sparc/mm/init_32.c
 @@ -316,6 +316,9 @@ extern void device_scan(void);
  pgprot_t PAGE_SHARED __read_mostly;
  EXPORT_SYMBOL(PAGE_SHARED);
@@ -4975,21 +5479,10 @@ diff -urNp linux-3.1.3/arch/sparc/mm/init_32.c linux-3.1.3/arch/sparc/mm/init_32
        protection_map[12] = PAGE_READONLY;
        protection_map[13] = PAGE_READONLY;
        protection_map[14] = PAGE_SHARED;
-diff -urNp linux-3.1.3/arch/sparc/mm/Makefile linux-3.1.3/arch/sparc/mm/Makefile
---- linux-3.1.3/arch/sparc/mm/Makefile 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/sparc/mm/Makefile 2011-11-16 18:39:07.000000000 -0500
-@@ -2,7 +2,7 @@
- #
- asflags-y := -ansi
--ccflags-y := -Werror
-+#ccflags-y := -Werror
- obj-$(CONFIG_SPARC64)   += ultra.o tlb.o tsb.o gup.o
- obj-y                   += fault_$(BITS).o
-diff -urNp linux-3.1.3/arch/sparc/mm/srmmu.c linux-3.1.3/arch/sparc/mm/srmmu.c
---- linux-3.1.3/arch/sparc/mm/srmmu.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/sparc/mm/srmmu.c  2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
+index cbef74e..c38fead 100644
+--- a/arch/sparc/mm/srmmu.c
++++ b/arch/sparc/mm/srmmu.c
 @@ -2200,6 +2200,13 @@ void __init ld_mmu_srmmu(void)
        PAGE_SHARED = pgprot_val(SRMMU_PAGE_SHARED);
        BTFIXUPSET_INT(page_copy, pgprot_val(SRMMU_PAGE_COPY));
@@ -5004,9 +5497,25 @@ diff -urNp linux-3.1.3/arch/sparc/mm/srmmu.c linux-3.1.3/arch/sparc/mm/srmmu.c
        BTFIXUPSET_INT(page_kernel, pgprot_val(SRMMU_PAGE_KERNEL));
        page_kernel = pgprot_val(SRMMU_PAGE_KERNEL);
  
-diff -urNp linux-3.1.3/arch/um/include/asm/kmap_types.h linux-3.1.3/arch/um/include/asm/kmap_types.h
---- linux-3.1.3/arch/um/include/asm/kmap_types.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/um/include/asm/kmap_types.h       2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/um/Makefile b/arch/um/Makefile
+index c0f712c..3a5c4c9 100644
+--- a/arch/um/Makefile
++++ b/arch/um/Makefile
+@@ -49,6 +49,10 @@ USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -D__KERNEL__,,\
+       $(patsubst -I%,,$(KBUILD_CFLAGS)))) $(ARCH_INCLUDE) $(MODE_INCLUDE) \
+       $(filter -I%,$(CFLAGS)) -D_FILE_OFFSET_BITS=64
++ifdef CONSTIFY_PLUGIN
++USER_CFLAGS   += $(CONSTIFY_PLUGIN) -fplugin-arg-constify_plugin-no-constify
++endif
++
+ include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH)
+ #This will adjust *FLAGS accordingly to the platform.
+diff --git a/arch/um/include/asm/kmap_types.h b/arch/um/include/asm/kmap_types.h
+index 6c03acd..a5e0215 100644
+--- a/arch/um/include/asm/kmap_types.h
++++ b/arch/um/include/asm/kmap_types.h
 @@ -23,6 +23,7 @@ enum km_type {
        KM_IRQ1,
        KM_SOFTIRQ0,
@@ -5015,9 +5524,10 @@ diff -urNp linux-3.1.3/arch/um/include/asm/kmap_types.h linux-3.1.3/arch/um/incl
        KM_TYPE_NR
  };
  
-diff -urNp linux-3.1.3/arch/um/include/asm/page.h linux-3.1.3/arch/um/include/asm/page.h
---- linux-3.1.3/arch/um/include/asm/page.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/um/include/asm/page.h     2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/um/include/asm/page.h b/arch/um/include/asm/page.h
+index 4cc9b6c..02e5029 100644
+--- a/arch/um/include/asm/page.h
++++ b/arch/um/include/asm/page.h
 @@ -14,6 +14,9 @@
  #define PAGE_SIZE     (_AC(1, UL) << PAGE_SHIFT)
  #define PAGE_MASK     (~(PAGE_SIZE-1))
@@ -5028,9 +5538,10 @@ diff -urNp linux-3.1.3/arch/um/include/asm/page.h linux-3.1.3/arch/um/include/as
  #ifndef __ASSEMBLY__
  
  struct page;
-diff -urNp linux-3.1.3/arch/um/kernel/process.c linux-3.1.3/arch/um/kernel/process.c
---- linux-3.1.3/arch/um/kernel/process.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/um/kernel/process.c       2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
+index 21c1ae7..4640aaa 100644
+--- a/arch/um/kernel/process.c
++++ b/arch/um/kernel/process.c
 @@ -404,22 +404,6 @@ int singlestepping(void * t)
        return 2;
  }
@@ -5054,23 +5565,10 @@ diff -urNp linux-3.1.3/arch/um/kernel/process.c linux-3.1.3/arch/um/kernel/proce
  unsigned long get_wchan(struct task_struct *p)
  {
        unsigned long stack_page, sp, ip;
-diff -urNp linux-3.1.3/arch/um/Makefile linux-3.1.3/arch/um/Makefile
---- linux-3.1.3/arch/um/Makefile       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/um/Makefile       2011-11-16 18:39:07.000000000 -0500
-@@ -49,6 +49,10 @@ USER_CFLAGS = $(patsubst $(KERNEL_DEFINE
-       $(patsubst -I%,,$(KBUILD_CFLAGS)))) $(ARCH_INCLUDE) $(MODE_INCLUDE) \
-       $(filter -I%,$(CFLAGS)) -D_FILE_OFFSET_BITS=64
-+ifdef CONSTIFY_PLUGIN
-+USER_CFLAGS   += $(CONSTIFY_PLUGIN) -fplugin-arg-constify_plugin-no-constify
-+endif
-+
- include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH)
- #This will adjust *FLAGS accordingly to the platform.
-diff -urNp linux-3.1.3/arch/um/sys-i386/shared/sysdep/system.h linux-3.1.3/arch/um/sys-i386/shared/sysdep/system.h
---- linux-3.1.3/arch/um/sys-i386/shared/sysdep/system.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/um/sys-i386/shared/sysdep/system.h        2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/um/sys-i386/shared/sysdep/system.h b/arch/um/sys-i386/shared/sysdep/system.h
+index d1b93c4..ae1b7fd 100644
+--- a/arch/um/sys-i386/shared/sysdep/system.h
++++ b/arch/um/sys-i386/shared/sysdep/system.h
 @@ -17,7 +17,7 @@
  # define AT_VECTOR_SIZE_ARCH 1
  #endif
@@ -5080,9 +5578,10 @@ diff -urNp linux-3.1.3/arch/um/sys-i386/shared/sysdep/system.h linux-3.1.3/arch/
  
  void default_idle(void);
  
-diff -urNp linux-3.1.3/arch/um/sys-i386/syscalls.c linux-3.1.3/arch/um/sys-i386/syscalls.c
---- linux-3.1.3/arch/um/sys-i386/syscalls.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/um/sys-i386/syscalls.c    2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/um/sys-i386/syscalls.c b/arch/um/sys-i386/syscalls.c
+index 70ca357..728d1cc 100644
+--- a/arch/um/sys-i386/syscalls.c
++++ b/arch/um/sys-i386/syscalls.c
 @@ -11,6 +11,21 @@
  #include "asm/uaccess.h"
  #include "asm/unistd.h"
@@ -5105,9 +5604,10 @@ diff -urNp linux-3.1.3/arch/um/sys-i386/syscalls.c linux-3.1.3/arch/um/sys-i386/
  /*
   * The prototype on i386 is:
   *
-diff -urNp linux-3.1.3/arch/um/sys-x86_64/shared/sysdep/system.h linux-3.1.3/arch/um/sys-x86_64/shared/sysdep/system.h
---- linux-3.1.3/arch/um/sys-x86_64/shared/sysdep/system.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/um/sys-x86_64/shared/sysdep/system.h      2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/um/sys-x86_64/shared/sysdep/system.h b/arch/um/sys-x86_64/shared/sysdep/system.h
+index d1b93c4..ae1b7fd 100644
+--- a/arch/um/sys-x86_64/shared/sysdep/system.h
++++ b/arch/um/sys-x86_64/shared/sysdep/system.h
 @@ -17,7 +17,7 @@
  # define AT_VECTOR_SIZE_ARCH 1
  #endif
@@ -5117,10 +5617,179 @@ diff -urNp linux-3.1.3/arch/um/sys-x86_64/shared/sysdep/system.h linux-3.1.3/arc
  
  void default_idle(void);
  
-diff -urNp linux-3.1.3/arch/x86/boot/bitops.h linux-3.1.3/arch/x86/boot/bitops.h
---- linux-3.1.3/arch/x86/boot/bitops.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/boot/bitops.h 2011-11-16 18:39:07.000000000 -0500
-@@ -26,7 +26,7 @@ static inline int variable_test_bit(int 
+diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
+index 6a47bb2..dc9a868 100644
+--- a/arch/x86/Kconfig
++++ b/arch/x86/Kconfig
+@@ -236,7 +236,7 @@ config X86_HT
+ config X86_32_LAZY_GS
+       def_bool y
+-      depends on X86_32 && !CC_STACKPROTECTOR
++      depends on X86_32 && !CC_STACKPROTECTOR && !PAX_MEMORY_UDEREF
+ config ARCH_HWEIGHT_CFLAGS
+       string
+@@ -1019,7 +1019,7 @@ choice
+ config NOHIGHMEM
+       bool "off"
+-      depends on !X86_NUMAQ
++      depends on !X86_NUMAQ && !(PAX_PAGEEXEC && PAX_ENABLE_PAE)
+       ---help---
+         Linux can use up to 64 Gigabytes of physical memory on x86 systems.
+         However, the address space of 32-bit x86 processors is only 4
+@@ -1056,7 +1056,7 @@ config NOHIGHMEM
+ config HIGHMEM4G
+       bool "4GB"
+-      depends on !X86_NUMAQ
++      depends on !X86_NUMAQ && !(PAX_PAGEEXEC && PAX_ENABLE_PAE)
+       ---help---
+         Select this if you have a 32-bit processor and between 1 and 4
+         gigabytes of physical RAM.
+@@ -1110,7 +1110,7 @@ config PAGE_OFFSET
+       hex
+       default 0xB0000000 if VMSPLIT_3G_OPT
+       default 0x80000000 if VMSPLIT_2G
+-      default 0x78000000 if VMSPLIT_2G_OPT
++      default 0x70000000 if VMSPLIT_2G_OPT
+       default 0x40000000 if VMSPLIT_1G
+       default 0xC0000000
+       depends on X86_32
+@@ -1484,6 +1484,7 @@ config SECCOMP
+ config CC_STACKPROTECTOR
+       bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)"
++      depends on X86_64 || !PAX_MEMORY_UDEREF
+       ---help---
+         This option turns on the -fstack-protector GCC feature. This
+         feature puts, at the beginning of functions, a canary value on
+@@ -1541,6 +1542,7 @@ config KEXEC_JUMP
+ config PHYSICAL_START
+       hex "Physical address where the kernel is loaded" if (EXPERT || CRASH_DUMP)
+       default "0x1000000"
++      range 0x400000 0x40000000
+       ---help---
+         This gives the physical address where the kernel is loaded.
+@@ -1604,6 +1606,7 @@ config X86_NEED_RELOCS
+ config PHYSICAL_ALIGN
+       hex "Alignment value to which kernel should be aligned" if X86_32
+       default "0x1000000"
++      range 0x400000 0x1000000 if PAX_KERNEXEC
+       range 0x2000 0x1000000
+       ---help---
+         This value puts the alignment restrictions on physical address
+@@ -1635,9 +1638,10 @@ config HOTPLUG_CPU
+         Say N if you want to disable CPU hotplug.
+ config COMPAT_VDSO
+-      def_bool y
++      def_bool n
+       prompt "Compat VDSO support"
+       depends on X86_32 || IA32_EMULATION
++      depends on !PAX_NOEXEC && !PAX_MEMORY_UDEREF
+       ---help---
+         Map the 32-bit VDSO to the predictable old-style address too.
+diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
+index e3ca7e0..b30b28a 100644
+--- a/arch/x86/Kconfig.cpu
++++ b/arch/x86/Kconfig.cpu
+@@ -341,7 +341,7 @@ config X86_PPRO_FENCE
+ config X86_F00F_BUG
+       def_bool y
+-      depends on M586MMX || M586TSC || M586 || M486 || M386
++      depends on (M586MMX || M586TSC || M586 || M486 || M386) && !PAX_KERNEXEC
+ config X86_INVD_BUG
+       def_bool y
+@@ -365,7 +365,7 @@ config X86_POPAD_OK
+ config X86_ALIGNMENT_16
+       def_bool y
+-      depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || MELAN || MK6 || M586MMX || M586TSC || M586 || M486 || MVIAC3_2 || MGEODEGX1
++      depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || X86_ELAN || MK8 || MK7 || MK6 || MCORE2 || MPENTIUM4 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || M486 || MVIAC3_2 || MGEODEGX1
+ config X86_INTEL_USERCOPY
+       def_bool y
+@@ -411,7 +411,7 @@ config X86_CMPXCHG64
+ # generates cmov.
+ config X86_CMOV
+       def_bool y
+-      depends on (MK8 || MK7 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || X86_64 || MATOM || MGEODE_LX)
++      depends on (MK8 || MK7 || MCORE2 || MPSC || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || X86_64 || MATOM || MGEODE_LX)
+ config X86_MINIMUM_CPU_FAMILY
+       int
+diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug
+index c0f8a5c..6404f61 100644
+--- a/arch/x86/Kconfig.debug
++++ b/arch/x86/Kconfig.debug
+@@ -81,7 +81,7 @@ config X86_PTDUMP
+ config DEBUG_RODATA
+       bool "Write protect kernel read-only data structures"
+       default y
+-      depends on DEBUG_KERNEL
++      depends on DEBUG_KERNEL && BROKEN
+       ---help---
+         Mark the kernel read-only data as write-protected in the pagetables,
+         in order to catch accidental (and incorrect) writes to such const
+@@ -99,7 +99,7 @@ config DEBUG_RODATA_TEST
+ config DEBUG_SET_MODULE_RONX
+       bool "Set loadable kernel module data as NX and text as RO"
+-      depends on MODULES
++      depends on MODULES && BROKEN
+       ---help---
+         This option helps catch unintended modifications to loadable
+         kernel module's text and read-only data. It also prevents execution
+diff --git a/arch/x86/Makefile b/arch/x86/Makefile
+index b02e509..2631e48 100644
+--- a/arch/x86/Makefile
++++ b/arch/x86/Makefile
+@@ -46,6 +46,7 @@ else
+         UTS_MACHINE := x86_64
+         CHECKFLAGS += -D__x86_64__ -m64
++        biarch := $(call cc-option,-m64)
+         KBUILD_AFLAGS += -m64
+         KBUILD_CFLAGS += -m64
+@@ -195,3 +196,12 @@ define archhelp
+   echo  '                  FDARGS="..."  arguments for the booted kernel'
+   echo  '                  FDINITRD=file initrd for the booted kernel'
+ endef
++
++define OLD_LD
++
++*** ${VERSION}.${PATCHLEVEL} PaX kernels no longer build correctly with old versions of binutils.
++*** Please upgrade your binutils to 2.18 or newer
++endef
++
++archprepare:
++      $(if $(LDFLAGS_BUILD_ID),,$(error $(OLD_LD)))
+diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile
+index 95365a8..52f857b 100644
+--- a/arch/x86/boot/Makefile
++++ b/arch/x86/boot/Makefile
+@@ -63,6 +63,9 @@ KBUILD_CFLAGS        := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \
+                  $(call cc-option, -fno-stack-protector) \
+                  $(call cc-option, -mpreferred-stack-boundary=2)
+ KBUILD_CFLAGS += $(call cc-option, -m32)
++ifdef CONSTIFY_PLUGIN
++KBUILD_CFLAGS += $(CONSTIFY_PLUGIN) -fplugin-arg-constify_plugin-no-constify
++endif
+ KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
+ GCOV_PROFILE := n
+diff --git a/arch/x86/boot/bitops.h b/arch/x86/boot/bitops.h
+index 878e4b9..20537ab 100644
+--- a/arch/x86/boot/bitops.h
++++ b/arch/x86/boot/bitops.h
+@@ -26,7 +26,7 @@ static inline int variable_test_bit(int nr, const void *addr)
        u8 v;
        const u32 *p = (const u32 *)addr;
  
@@ -5129,7 +5798,7 @@ diff -urNp linux-3.1.3/arch/x86/boot/bitops.h linux-3.1.3/arch/x86/boot/bitops.h
        return v;
  }
  
-@@ -37,7 +37,7 @@ static inline int variable_test_bit(int 
+@@ -37,7 +37,7 @@ static inline int variable_test_bit(int nr, const void *addr)
  
  static inline void set_bit(int nr, void *addr)
  {
@@ -5138,9 +5807,10 @@ diff -urNp linux-3.1.3/arch/x86/boot/bitops.h linux-3.1.3/arch/x86/boot/bitops.h
  }
  
  #endif /* BOOT_BITOPS_H */
-diff -urNp linux-3.1.3/arch/x86/boot/boot.h linux-3.1.3/arch/x86/boot/boot.h
---- linux-3.1.3/arch/x86/boot/boot.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/boot/boot.h   2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/boot/boot.h b/arch/x86/boot/boot.h
+index c7093bd..d4247ffe0 100644
+--- a/arch/x86/boot/boot.h
++++ b/arch/x86/boot/boot.h
 @@ -85,7 +85,7 @@ static inline void io_delay(void)
  static inline u16 ds(void)
  {
@@ -5150,7 +5820,7 @@ diff -urNp linux-3.1.3/arch/x86/boot/boot.h linux-3.1.3/arch/x86/boot/boot.h
        return seg;
  }
  
-@@ -181,7 +181,7 @@ static inline void wrgs32(u32 v, addr_t 
+@@ -181,7 +181,7 @@ static inline void wrgs32(u32 v, addr_t addr)
  static inline int memcmp(const void *s1, const void *s2, size_t len)
  {
        u8 diff;
@@ -5159,9 +5829,24 @@ diff -urNp linux-3.1.3/arch/x86/boot/boot.h linux-3.1.3/arch/x86/boot/boot.h
            : "=qm" (diff), "+D" (s1), "+S" (s2), "+c" (len));
        return diff;
  }
-diff -urNp linux-3.1.3/arch/x86/boot/compressed/head_32.S linux-3.1.3/arch/x86/boot/compressed/head_32.S
---- linux-3.1.3/arch/x86/boot/compressed/head_32.S     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/boot/compressed/head_32.S     2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
+index 09664ef..edc5d03 100644
+--- a/arch/x86/boot/compressed/Makefile
++++ b/arch/x86/boot/compressed/Makefile
+@@ -14,6 +14,9 @@ cflags-$(CONFIG_X86_64) := -mcmodel=small
+ KBUILD_CFLAGS += $(cflags-y)
+ KBUILD_CFLAGS += $(call cc-option,-ffreestanding)
+ KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
++ifdef CONSTIFY_PLUGIN
++KBUILD_CFLAGS += $(CONSTIFY_PLUGIN) -fplugin-arg-constify_plugin-no-constify
++endif
+ KBUILD_AFLAGS  := $(KBUILD_CFLAGS) -D__ASSEMBLY__
+ GCOV_PROFILE := n
+diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S
+index 67a655a..b924059 100644
+--- a/arch/x86/boot/compressed/head_32.S
++++ b/arch/x86/boot/compressed/head_32.S
 @@ -76,7 +76,7 @@ ENTRY(startup_32)
        notl    %eax
        andl    %eax, %ebx
@@ -5190,9 +5875,10 @@ diff -urNp linux-3.1.3/arch/x86/boot/compressed/head_32.S linux-3.1.3/arch/x86/b
        addl    %ebx, -__PAGE_OFFSET(%ebx, %ecx)
        jmp     1b
  2:
-diff -urNp linux-3.1.3/arch/x86/boot/compressed/head_64.S linux-3.1.3/arch/x86/boot/compressed/head_64.S
---- linux-3.1.3/arch/x86/boot/compressed/head_64.S     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/boot/compressed/head_64.S     2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
+index 35af09d..99c9676 100644
+--- a/arch/x86/boot/compressed/head_64.S
++++ b/arch/x86/boot/compressed/head_64.S
 @@ -91,7 +91,7 @@ ENTRY(startup_32)
        notl    %eax
        andl    %eax, %ebx
@@ -5211,22 +5897,10 @@ diff -urNp linux-3.1.3/arch/x86/boot/compressed/head_64.S linux-3.1.3/arch/x86/b
  #endif
  
        /* Target address to relocate to for decompression */
-diff -urNp linux-3.1.3/arch/x86/boot/compressed/Makefile linux-3.1.3/arch/x86/boot/compressed/Makefile
---- linux-3.1.3/arch/x86/boot/compressed/Makefile      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/boot/compressed/Makefile      2011-11-16 18:39:07.000000000 -0500
-@@ -14,6 +14,9 @@ cflags-$(CONFIG_X86_64) := -mcmodel=smal
- KBUILD_CFLAGS += $(cflags-y)
- KBUILD_CFLAGS += $(call cc-option,-ffreestanding)
- KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
-+ifdef CONSTIFY_PLUGIN
-+KBUILD_CFLAGS += $(CONSTIFY_PLUGIN) -fplugin-arg-constify_plugin-no-constify
-+endif
- KBUILD_AFLAGS  := $(KBUILD_CFLAGS) -D__ASSEMBLY__
- GCOV_PROFILE := n
-diff -urNp linux-3.1.3/arch/x86/boot/compressed/misc.c linux-3.1.3/arch/x86/boot/compressed/misc.c
---- linux-3.1.3/arch/x86/boot/compressed/misc.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/boot/compressed/misc.c        2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
+index 3a19d04..7c1d55a 100644
+--- a/arch/x86/boot/compressed/misc.c
++++ b/arch/x86/boot/compressed/misc.c
 @@ -310,7 +310,7 @@ static void parse_elf(void *output)
                case PT_LOAD:
  #ifdef CONFIG_RELOCATABLE
@@ -5236,7 +5910,7 @@ diff -urNp linux-3.1.3/arch/x86/boot/compressed/misc.c linux-3.1.3/arch/x86/boot
  #else
                        dest = (void *)(phdr->p_paddr);
  #endif
-@@ -363,7 +363,7 @@ asmlinkage void decompress_kernel(void *
+@@ -363,7 +363,7 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap,
                error("Destination address too large");
  #endif
  #ifndef CONFIG_RELOCATABLE
@@ -5245,9 +5919,10 @@ diff -urNp linux-3.1.3/arch/x86/boot/compressed/misc.c linux-3.1.3/arch/x86/boot
                error("Wrong destination address");
  #endif
  
-diff -urNp linux-3.1.3/arch/x86/boot/compressed/relocs.c linux-3.1.3/arch/x86/boot/compressed/relocs.c
---- linux-3.1.3/arch/x86/boot/compressed/relocs.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/boot/compressed/relocs.c      2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/boot/compressed/relocs.c b/arch/x86/boot/compressed/relocs.c
+index 89bbf4e..869908e 100644
+--- a/arch/x86/boot/compressed/relocs.c
++++ b/arch/x86/boot/compressed/relocs.c
 @@ -13,8 +13,11 @@
  
  static void die(char *fmt, ...);
@@ -5400,7 +6075,7 @@ diff -urNp linux-3.1.3/arch/x86/boot/compressed/relocs.c linux-3.1.3/arch/x86/bo
                struct section *sec = &secs[i];
  
                if (sec->shdr.sh_type != SHT_REL) {
-@@ -530,6 +574,22 @@ static void walk_relocs(void (*visit)(El
+@@ -530,6 +574,22 @@ static void walk_relocs(void (*visit)(Elf32_Rel *rel, Elf32_Sym *sym))
                            !is_rel_reloc(sym_name(sym_strtab, sym))) {
                                continue;
                        }
@@ -5423,7 +6098,7 @@ diff -urNp linux-3.1.3/arch/x86/boot/compressed/relocs.c linux-3.1.3/arch/x86/bo
                        switch (r_type) {
                        case R_386_NONE:
                        case R_386_PC32:
-@@ -571,7 +631,7 @@ static int cmp_relocs(const void *va, co
+@@ -571,7 +631,7 @@ static int cmp_relocs(const void *va, const void *vb)
  
  static void emit_relocs(int as_text)
  {
@@ -5440,9 +6115,10 @@ diff -urNp linux-3.1.3/arch/x86/boot/compressed/relocs.c linux-3.1.3/arch/x86/bo
        read_shdrs(fp);
        read_strtabs(fp);
        read_symtabs(fp);
-diff -urNp linux-3.1.3/arch/x86/boot/cpucheck.c linux-3.1.3/arch/x86/boot/cpucheck.c
---- linux-3.1.3/arch/x86/boot/cpucheck.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/boot/cpucheck.c       2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/boot/cpucheck.c b/arch/x86/boot/cpucheck.c
+index 4d3ff03..e4972ff 100644
+--- a/arch/x86/boot/cpucheck.c
++++ b/arch/x86/boot/cpucheck.c
 @@ -74,7 +74,7 @@ static int has_fpu(void)
        u16 fcw = -1, fsw = -1;
        u32 cr0;
@@ -5497,7 +6173,7 @@ diff -urNp linux-3.1.3/arch/x86/boot/cpucheck.c linux-3.1.3/arch/x86/boot/cpuche
                            : "+a" (eax),
                              "=c" (cpu.flags[6]),
                              "=d" (cpu.flags[1])
-@@ -203,9 +203,9 @@ int check_cpu(int *cpu_level_ptr, int *r
+@@ -203,9 +203,9 @@ int check_cpu(int *cpu_level_ptr, int *req_level_ptr, u32 **err_flags_ptr)
                u32 ecx = MSR_K7_HWCR;
                u32 eax, edx;
  
@@ -5509,7 +6185,7 @@ diff -urNp linux-3.1.3/arch/x86/boot/cpucheck.c linux-3.1.3/arch/x86/boot/cpuche
  
                get_flags();    /* Make sure it really did something */
                err = check_flags();
-@@ -218,9 +218,9 @@ int check_cpu(int *cpu_level_ptr, int *r
+@@ -218,9 +218,9 @@ int check_cpu(int *cpu_level_ptr, int *req_level_ptr, u32 **err_flags_ptr)
                u32 ecx = MSR_VIA_FCR;
                u32 eax, edx;
  
@@ -5521,7 +6197,7 @@ diff -urNp linux-3.1.3/arch/x86/boot/cpucheck.c linux-3.1.3/arch/x86/boot/cpuche
  
                set_bit(X86_FEATURE_CX8, cpu.flags);
                err = check_flags();
-@@ -231,12 +231,12 @@ int check_cpu(int *cpu_level_ptr, int *r
+@@ -231,12 +231,12 @@ int check_cpu(int *cpu_level_ptr, int *req_level_ptr, u32 **err_flags_ptr)
                u32 eax, edx;
                u32 level = 1;
  
@@ -5538,10 +6214,11 @@ diff -urNp linux-3.1.3/arch/x86/boot/cpucheck.c linux-3.1.3/arch/x86/boot/cpuche
  
                err = check_flags();
        }
-diff -urNp linux-3.1.3/arch/x86/boot/header.S linux-3.1.3/arch/x86/boot/header.S
---- linux-3.1.3/arch/x86/boot/header.S 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/boot/header.S 2011-11-16 18:39:07.000000000 -0500
-@@ -224,7 +224,7 @@ setup_data:                .quad 0                 # 64-bit physical
+diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S
+index 93e689f..504ba09 100644
+--- a/arch/x86/boot/header.S
++++ b/arch/x86/boot/header.S
+@@ -224,7 +224,7 @@ setup_data:                .quad 0                 # 64-bit physical pointer to
                                                # single linked list of
                                                # struct setup_data
  
@@ -5550,22 +6227,10 @@ diff -urNp linux-3.1.3/arch/x86/boot/header.S linux-3.1.3/arch/x86/boot/header.S
  
  #define ZO_INIT_SIZE  (ZO__end - ZO_startup_32 + ZO_z_extract_offset)
  #define VO_INIT_SIZE  (VO__end - VO__text)
-diff -urNp linux-3.1.3/arch/x86/boot/Makefile linux-3.1.3/arch/x86/boot/Makefile
---- linux-3.1.3/arch/x86/boot/Makefile 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/boot/Makefile 2011-11-16 18:39:07.000000000 -0500
-@@ -63,6 +63,9 @@ KBUILD_CFLAGS        := $(LINUXINCLUDE) -g -Os 
-                  $(call cc-option, -fno-stack-protector) \
-                  $(call cc-option, -mpreferred-stack-boundary=2)
- KBUILD_CFLAGS += $(call cc-option, -m32)
-+ifdef CONSTIFY_PLUGIN
-+KBUILD_CFLAGS += $(CONSTIFY_PLUGIN) -fplugin-arg-constify_plugin-no-constify
-+endif
- KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
- GCOV_PROFILE := n
-diff -urNp linux-3.1.3/arch/x86/boot/memory.c linux-3.1.3/arch/x86/boot/memory.c
---- linux-3.1.3/arch/x86/boot/memory.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/boot/memory.c 2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/boot/memory.c b/arch/x86/boot/memory.c
+index db75d07..8e6d0af 100644
+--- a/arch/x86/boot/memory.c
++++ b/arch/x86/boot/memory.c
 @@ -19,7 +19,7 @@
  
  static int detect_memory_e820(void)
@@ -5575,9 +6240,22 @@ diff -urNp linux-3.1.3/arch/x86/boot/memory.c linux-3.1.3/arch/x86/boot/memory.c
        struct biosregs ireg, oreg;
        struct e820entry *desc = boot_params.e820_map;
        static struct e820entry buf; /* static so it is zeroed */
-diff -urNp linux-3.1.3/arch/x86/boot/video.c linux-3.1.3/arch/x86/boot/video.c
---- linux-3.1.3/arch/x86/boot/video.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/boot/video.c  2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/boot/video-vesa.c b/arch/x86/boot/video-vesa.c
+index 11e8c6e..fdbb1ed 100644
+--- a/arch/x86/boot/video-vesa.c
++++ b/arch/x86/boot/video-vesa.c
+@@ -200,6 +200,7 @@ static void vesa_store_pm_info(void)
+       boot_params.screen_info.vesapm_seg = oreg.es;
+       boot_params.screen_info.vesapm_off = oreg.di;
++      boot_params.screen_info.vesapm_size = oreg.cx;
+ }
+ /*
+diff --git a/arch/x86/boot/video.c b/arch/x86/boot/video.c
+index 43eda28..5ab5fdb 100644
+--- a/arch/x86/boot/video.c
++++ b/arch/x86/boot/video.c
 @@ -96,7 +96,7 @@ static void store_mode_params(void)
  static unsigned int get_entry(void)
  {
@@ -5587,20 +6265,10 @@ diff -urNp linux-3.1.3/arch/x86/boot/video.c linux-3.1.3/arch/x86/boot/video.c
        int key;
        unsigned int v;
  
-diff -urNp linux-3.1.3/arch/x86/boot/video-vesa.c linux-3.1.3/arch/x86/boot/video-vesa.c
---- linux-3.1.3/arch/x86/boot/video-vesa.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/boot/video-vesa.c     2011-11-16 18:39:07.000000000 -0500
-@@ -200,6 +200,7 @@ static void vesa_store_pm_info(void)
-       boot_params.screen_info.vesapm_seg = oreg.es;
-       boot_params.screen_info.vesapm_off = oreg.di;
-+      boot_params.screen_info.vesapm_size = oreg.cx;
- }
- /*
-diff -urNp linux-3.1.3/arch/x86/crypto/aes-x86_64-asm_64.S linux-3.1.3/arch/x86/crypto/aes-x86_64-asm_64.S
---- linux-3.1.3/arch/x86/crypto/aes-x86_64-asm_64.S    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/crypto/aes-x86_64-asm_64.S    2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/crypto/aes-x86_64-asm_64.S b/arch/x86/crypto/aes-x86_64-asm_64.S
+index 5b577d5..3c1fed4 100644
+--- a/arch/x86/crypto/aes-x86_64-asm_64.S
++++ b/arch/x86/crypto/aes-x86_64-asm_64.S
 @@ -8,6 +8,8 @@
   * including this sentence is retained in full.
   */
@@ -5614,14 +6282,205 @@ diff -urNp linux-3.1.3/arch/x86/crypto/aes-x86_64-asm_64.S linux-3.1.3/arch/x86/
        je      B192;                   \
        leaq    32(r9),r9;
  
-+#define ret   pax_force_retaddr; ret
++#define ret   pax_force_retaddr 0, 1; ret
 +
  #define epilogue(r1,r2,r3,r4,r5,r6,r7,r8,r9) \
        movq    r1,r2;                  \
        movq    r3,r4;                  \
-diff -urNp linux-3.1.3/arch/x86/crypto/salsa20-x86_64-asm_64.S linux-3.1.3/arch/x86/crypto/salsa20-x86_64-asm_64.S
---- linux-3.1.3/arch/x86/crypto/salsa20-x86_64-asm_64.S        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/crypto/salsa20-x86_64-asm_64.S        2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/crypto/aesni-intel_asm.S b/arch/x86/crypto/aesni-intel_asm.S
+index be6d9e3..21fbbca 100644
+--- a/arch/x86/crypto/aesni-intel_asm.S
++++ b/arch/x86/crypto/aesni-intel_asm.S
+@@ -31,6 +31,7 @@
+ #include <linux/linkage.h>
+ #include <asm/inst.h>
++#include <asm/alternative-asm.h>
+ #ifdef __x86_64__
+ .data
+@@ -1436,7 +1437,9 @@ _return_T_done_decrypt:
+       pop     %r14
+       pop     %r13
+       pop     %r12
++      pax_force_retaddr 0, 1
+       ret
++ENDPROC(aesni_gcm_dec)
+ /*****************************************************************************
+@@ -1699,7 +1702,9 @@ _return_T_done_encrypt:
+       pop     %r14
+       pop     %r13
+       pop     %r12
++      pax_force_retaddr 0, 1
+       ret
++ENDPROC(aesni_gcm_enc)
+ #endif
+@@ -1714,6 +1719,7 @@ _key_expansion_256a:
+       pxor %xmm1, %xmm0
+       movaps %xmm0, (TKEYP)
+       add $0x10, TKEYP
++      pax_force_retaddr_bts
+       ret
+ .align 4
+@@ -1738,6 +1744,7 @@ _key_expansion_192a:
+       shufps $0b01001110, %xmm2, %xmm1
+       movaps %xmm1, 0x10(TKEYP)
+       add $0x20, TKEYP
++      pax_force_retaddr_bts
+       ret
+ .align 4
+@@ -1757,6 +1764,7 @@ _key_expansion_192b:
+       movaps %xmm0, (TKEYP)
+       add $0x10, TKEYP
++      pax_force_retaddr_bts
+       ret
+ .align 4
+@@ -1769,6 +1777,7 @@ _key_expansion_256b:
+       pxor %xmm1, %xmm2
+       movaps %xmm2, (TKEYP)
+       add $0x10, TKEYP
++      pax_force_retaddr_bts
+       ret
+ /*
+@@ -1881,7 +1890,9 @@ ENTRY(aesni_set_key)
+ #ifndef __x86_64__
+       popl KEYP
+ #endif
++      pax_force_retaddr 0, 1
+       ret
++ENDPROC(aesni_set_key)
+ /*
+  * void aesni_enc(struct crypto_aes_ctx *ctx, u8 *dst, const u8 *src)
+@@ -1902,7 +1913,9 @@ ENTRY(aesni_enc)
+       popl KLEN
+       popl KEYP
+ #endif
++      pax_force_retaddr 0, 1
+       ret
++ENDPROC(aesni_enc)
+ /*
+  * _aesni_enc1:               internal ABI
+@@ -1959,6 +1972,7 @@ _aesni_enc1:
+       AESENC KEY STATE
+       movaps 0x70(TKEYP), KEY
+       AESENCLAST KEY STATE
++      pax_force_retaddr_bts
+       ret
+ /*
+@@ -2067,6 +2081,7 @@ _aesni_enc4:
+       AESENCLAST KEY STATE2
+       AESENCLAST KEY STATE3
+       AESENCLAST KEY STATE4
++      pax_force_retaddr_bts
+       ret
+ /*
+@@ -2089,7 +2104,9 @@ ENTRY(aesni_dec)
+       popl KLEN
+       popl KEYP
+ #endif
++      pax_force_retaddr 0, 1
+       ret
++ENDPROC(aesni_dec)
+ /*
+  * _aesni_dec1:               internal ABI
+@@ -2146,6 +2163,7 @@ _aesni_dec1:
+       AESDEC KEY STATE
+       movaps 0x70(TKEYP), KEY
+       AESDECLAST KEY STATE
++      pax_force_retaddr_bts
+       ret
+ /*
+@@ -2254,6 +2272,7 @@ _aesni_dec4:
+       AESDECLAST KEY STATE2
+       AESDECLAST KEY STATE3
+       AESDECLAST KEY STATE4
++      pax_force_retaddr_bts
+       ret
+ /*
+@@ -2311,7 +2330,9 @@ ENTRY(aesni_ecb_enc)
+       popl KEYP
+       popl LEN
+ #endif
++      pax_force_retaddr 0, 1
+       ret
++ENDPROC(aesni_ecb_enc)
+ /*
+  * void aesni_ecb_dec(struct crypto_aes_ctx *ctx, const u8 *dst, u8 *src,
+@@ -2369,7 +2390,9 @@ ENTRY(aesni_ecb_dec)
+       popl KEYP
+       popl LEN
+ #endif
++      pax_force_retaddr 0, 1
+       ret
++ENDPROC(aesni_ecb_dec)
+ /*
+  * void aesni_cbc_enc(struct crypto_aes_ctx *ctx, const u8 *dst, u8 *src,
+@@ -2410,7 +2433,9 @@ ENTRY(aesni_cbc_enc)
+       popl LEN
+       popl IVP
+ #endif
++      pax_force_retaddr 0, 1
+       ret
++ENDPROC(aesni_cbc_enc)
+ /*
+  * void aesni_cbc_dec(struct crypto_aes_ctx *ctx, const u8 *dst, u8 *src,
+@@ -2498,7 +2523,9 @@ ENTRY(aesni_cbc_dec)
+       popl LEN
+       popl IVP
+ #endif
++      pax_force_retaddr 0, 1
+       ret
++ENDPROC(aesni_cbc_dec)
+ #ifdef __x86_64__
+ .align 16
+@@ -2524,6 +2551,7 @@ _aesni_inc_init:
+       mov $1, TCTR_LOW
+       MOVQ_R64_XMM TCTR_LOW INC
+       MOVQ_R64_XMM CTR TCTR_LOW
++      pax_force_retaddr_bts
+       ret
+ /*
+@@ -2552,6 +2580,7 @@ _aesni_inc:
+ .Linc_low:
+       movaps CTR, IV
+       PSHUFB_XMM BSWAP_MASK IV
++      pax_force_retaddr_bts
+       ret
+ /*
+@@ -2612,5 +2641,7 @@ ENTRY(aesni_ctr_enc)
+ .Lctr_enc_ret:
+       movups IV, (IVP)
+ .Lctr_enc_just_ret:
++      pax_force_retaddr 0, 1
+       ret
++ENDPROC(aesni_ctr_enc)
+ #endif
+diff --git a/arch/x86/crypto/salsa20-x86_64-asm_64.S b/arch/x86/crypto/salsa20-x86_64-asm_64.S
+index 6214a9b..1f4fc9a 100644
+--- a/arch/x86/crypto/salsa20-x86_64-asm_64.S
++++ b/arch/x86/crypto/salsa20-x86_64-asm_64.S
 @@ -1,3 +1,5 @@
 +#include <asm/alternative-asm.h>
 +
@@ -5632,7 +6491,7 @@ diff -urNp linux-3.1.3/arch/x86/crypto/salsa20-x86_64-asm_64.S linux-3.1.3/arch/
        add     %r11,%rsp
        mov     %rdi,%rax
        mov     %rsi,%rdx
-+      pax_force_retaddr
++      pax_force_retaddr 0, 1
        ret
  #   bytesatleast65:
  ._bytesatleast65:
@@ -5650,9 +6509,10 @@ diff -urNp linux-3.1.3/arch/x86/crypto/salsa20-x86_64-asm_64.S linux-3.1.3/arch/
        mov     %rsi,%rdx
 +      pax_force_retaddr
        ret
-diff -urNp linux-3.1.3/arch/x86/crypto/twofish-x86_64-asm_64.S linux-3.1.3/arch/x86/crypto/twofish-x86_64-asm_64.S
---- linux-3.1.3/arch/x86/crypto/twofish-x86_64-asm_64.S        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/crypto/twofish-x86_64-asm_64.S        2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/crypto/twofish-x86_64-asm_64.S b/arch/x86/crypto/twofish-x86_64-asm_64.S
+index 573aa10..b73ad89 100644
+--- a/arch/x86/crypto/twofish-x86_64-asm_64.S
++++ b/arch/x86/crypto/twofish-x86_64-asm_64.S
 @@ -21,6 +21,7 @@
  .text
  
@@ -5665,7 +6525,7 @@ diff -urNp linux-3.1.3/arch/x86/crypto/twofish-x86_64-asm_64.S linux-3.1.3/arch/
  
        popq    R1
        movq    $1,%rax
-+      pax_force_retaddr
++      pax_force_retaddr 0, 1
        ret
  
  twofish_dec_blk:
@@ -5673,12 +6533,13 @@ diff -urNp linux-3.1.3/arch/x86/crypto/twofish-x86_64-asm_64.S linux-3.1.3/arch/
  
        popq    R1
        movq    $1,%rax
-+      pax_force_retaddr
++      pax_force_retaddr 0, 1
        ret
-diff -urNp linux-3.1.3/arch/x86/ia32/ia32_aout.c linux-3.1.3/arch/x86/ia32/ia32_aout.c
---- linux-3.1.3/arch/x86/ia32/ia32_aout.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/ia32/ia32_aout.c      2011-11-16 18:40:08.000000000 -0500
-@@ -162,6 +162,8 @@ static int aout_core_dump(long signr, st
+diff --git a/arch/x86/ia32/ia32_aout.c b/arch/x86/ia32/ia32_aout.c
+index fd84387..0b4af7d 100644
+--- a/arch/x86/ia32/ia32_aout.c
++++ b/arch/x86/ia32/ia32_aout.c
+@@ -162,6 +162,8 @@ static int aout_core_dump(long signr, struct pt_regs *regs, struct file *file,
        unsigned long dump_start, dump_size;
        struct user32 dump;
  
@@ -5687,199 +6548,11 @@ diff -urNp linux-3.1.3/arch/x86/ia32/ia32_aout.c linux-3.1.3/arch/x86/ia32/ia32_
        fs = get_fs();
        set_fs(KERNEL_DS);
        has_dumped = 1;
-diff -urNp linux-3.1.3/arch/x86/ia32/ia32entry.S linux-3.1.3/arch/x86/ia32/ia32entry.S
---- linux-3.1.3/arch/x86/ia32/ia32entry.S      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/ia32/ia32entry.S      2011-11-17 18:27:57.000000000 -0500
-@@ -13,7 +13,9 @@
- #include <asm/thread_info.h>  
- #include <asm/segment.h>
- #include <asm/irqflags.h>
-+#include <asm/pgtable.h>
- #include <linux/linkage.h>
-+#include <asm/alternative-asm.h>
- /* Avoid __ASSEMBLER__'ifying <linux/audit.h> just for this.  */
- #include <linux/elf-em.h>
-@@ -95,6 +97,29 @@ ENTRY(native_irq_enable_sysexit)
- ENDPROC(native_irq_enable_sysexit)
- #endif
-+      .macro pax_enter_kernel_user
-+#ifdef CONFIG_PAX_MEMORY_UDEREF
-+      call pax_enter_kernel_user
-+#endif
-+      .endm
-+
-+      .macro pax_exit_kernel_user
-+#ifdef CONFIG_PAX_MEMORY_UDEREF
-+      call pax_exit_kernel_user
-+#endif
-+#ifdef CONFIG_PAX_RANDKSTACK
-+      pushq %rax
-+      call pax_randomize_kstack
-+      popq %rax
-+#endif
-+      .endm
-+
-+.macro pax_erase_kstack
-+#ifdef CONFIG_PAX_MEMORY_STACKLEAK
-+      call pax_erase_kstack
-+#endif
-+.endm
-+
- /*
-  * 32bit SYSENTER instruction entry.
-  *
-@@ -121,7 +146,7 @@ ENTRY(ia32_sysenter_target)
-       CFI_REGISTER    rsp,rbp
-       SWAPGS_UNSAFE_STACK
-       movq    PER_CPU_VAR(kernel_stack), %rsp
--      addq    $(KERNEL_STACK_OFFSET),%rsp
-+      pax_enter_kernel_user
-       /*
-        * No need to follow this irqs on/off section: the syscall
-        * disabled irqs, here we enable it straight after entry:
-@@ -134,7 +159,8 @@ ENTRY(ia32_sysenter_target)
-       CFI_REL_OFFSET rsp,0
-       pushfq_cfi
-       /*CFI_REL_OFFSET rflags,0*/
--      movl    8*3-THREAD_SIZE+TI_sysenter_return(%rsp), %r10d
-+      GET_THREAD_INFO(%r10)
-+      movl    TI_sysenter_return(%r10), %r10d
-       CFI_REGISTER rip,r10
-       pushq_cfi $__USER32_CS
-       /*CFI_REL_OFFSET cs,0*/
-@@ -146,6 +172,12 @@ ENTRY(ia32_sysenter_target)
-       SAVE_ARGS 0,1,0
-       /* no need to do an access_ok check here because rbp has been
-          32bit zero extended */ 
-+
-+#ifdef CONFIG_PAX_MEMORY_UDEREF
-+      mov $PAX_USER_SHADOW_BASE,%r10
-+      add %r10,%rbp
-+#endif
-+
- 1:    movl    (%rbp),%ebp
-       .section __ex_table,"a"
-       .quad 1b,ia32_badarg
-@@ -168,6 +200,8 @@ sysenter_dispatch:
-       testl   $_TIF_ALLWORK_MASK,TI_flags(%r10)
-       jnz     sysexit_audit
- sysexit_from_sys_call:
-+      pax_exit_kernel_user
-+      pax_erase_kstack
-       andl    $~TS_COMPAT,TI_status(%r10)
-       /* clear IF, that popfq doesn't enable interrupts early */
-       andl  $~0x200,EFLAGS-R11(%rsp) 
-@@ -194,6 +228,9 @@ sysexit_from_sys_call:
-       movl %eax,%esi                  /* 2nd arg: syscall number */
-       movl $AUDIT_ARCH_I386,%edi      /* 1st arg: audit arch */
-       call audit_syscall_entry
-+
-+      pax_erase_kstack
-+
-       movl RAX-ARGOFFSET(%rsp),%eax   /* reload syscall number */
-       cmpq $(IA32_NR_syscalls-1),%rax
-       ja ia32_badsys
-@@ -246,6 +283,9 @@ sysenter_tracesys:
-       movq    $-ENOSYS,RAX(%rsp)/* ptrace can change this for a bad syscall */
-       movq    %rsp,%rdi        /* &pt_regs -> arg1 */
-       call    syscall_trace_enter
-+
-+      pax_erase_kstack
-+
-       LOAD_ARGS32 ARGOFFSET  /* reload args from stack in case ptrace changed it */
-       RESTORE_REST
-       cmpq    $(IA32_NR_syscalls-1),%rax
-@@ -277,19 +317,24 @@ ENDPROC(ia32_sysenter_target)
- ENTRY(ia32_cstar_target)
-       CFI_STARTPROC32 simple
-       CFI_SIGNAL_FRAME
--      CFI_DEF_CFA     rsp,KERNEL_STACK_OFFSET
-+      CFI_DEF_CFA     rsp,0
-       CFI_REGISTER    rip,rcx
-       /*CFI_REGISTER  rflags,r11*/
-       SWAPGS_UNSAFE_STACK
-       movl    %esp,%r8d
-       CFI_REGISTER    rsp,r8
-       movq    PER_CPU_VAR(kernel_stack),%rsp
-+
-+#ifdef CONFIG_PAX_MEMORY_UDEREF
-+      pax_enter_kernel_user
-+#endif
-+
-       /*
-        * No need to follow this irqs on/off section: the syscall
-        * disabled irqs and here we enable it straight after entry:
-        */
-       ENABLE_INTERRUPTS(CLBR_NONE)
--      SAVE_ARGS 8,0,0
-+      SAVE_ARGS 8*6,0,0
-       movl    %eax,%eax       /* zero extension */
-       movq    %rax,ORIG_RAX-ARGOFFSET(%rsp)
-       movq    %rcx,RIP-ARGOFFSET(%rsp)
-@@ -305,6 +350,12 @@ ENTRY(ia32_cstar_target)
-       /* no need to do an access_ok check here because r8 has been
-          32bit zero extended */ 
-       /* hardware stack frame is complete now */      
-+
-+#ifdef CONFIG_PAX_MEMORY_UDEREF
-+      mov $PAX_USER_SHADOW_BASE,%r10
-+      add %r10,%r8
-+#endif
-+
- 1:    movl    (%r8),%r9d
-       .section __ex_table,"a"
-       .quad 1b,ia32_badarg
-@@ -327,6 +378,8 @@ cstar_dispatch:
-       testl $_TIF_ALLWORK_MASK,TI_flags(%r10)
-       jnz sysretl_audit
- sysretl_from_sys_call:
-+      pax_exit_kernel_user
-+      pax_erase_kstack
-       andl $~TS_COMPAT,TI_status(%r10)
-       RESTORE_ARGS 0,-ARG_SKIP,0,0,0
-       movl RIP-ARGOFFSET(%rsp),%ecx
-@@ -364,6 +417,9 @@ cstar_tracesys:
-       movq $-ENOSYS,RAX(%rsp) /* ptrace can change this for a bad syscall */
-       movq %rsp,%rdi        /* &pt_regs -> arg1 */
-       call syscall_trace_enter
-+
-+      pax_erase_kstack
-+
-       LOAD_ARGS32 ARGOFFSET, 1  /* reload args from stack in case ptrace changed it */
-       RESTORE_REST
-       xchgl %ebp,%r9d
-@@ -409,6 +465,7 @@ ENTRY(ia32_syscall)
-       CFI_REL_OFFSET  rip,RIP-RIP
-       PARAVIRT_ADJUST_EXCEPTION_FRAME
-       SWAPGS
-+      pax_enter_kernel_user
-       /*
-        * No need to follow this irqs on/off section: the syscall
-        * disabled irqs and here we enable it straight after entry:
-@@ -441,6 +498,9 @@ ia32_tracesys:                      
-       movq $-ENOSYS,RAX(%rsp) /* ptrace can change this for a bad syscall */
-       movq %rsp,%rdi        /* &pt_regs -> arg1 */
-       call syscall_trace_enter
-+
-+      pax_erase_kstack
-+
-       LOAD_ARGS32 ARGOFFSET  /* reload args from stack in case ptrace changed it */
-       RESTORE_REST
-       cmpq $(IA32_NR_syscalls-1),%rax
-@@ -455,6 +515,7 @@ ia32_badsys:
- quiet_ni_syscall:
-       movq $-ENOSYS,%rax
-+      pax_force_retaddr
-       ret
-       CFI_ENDPROC
-       
-diff -urNp linux-3.1.3/arch/x86/ia32/ia32_signal.c linux-3.1.3/arch/x86/ia32/ia32_signal.c
---- linux-3.1.3/arch/x86/ia32/ia32_signal.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/ia32/ia32_signal.c    2011-11-16 18:39:07.000000000 -0500
-@@ -169,7 +169,7 @@ asmlinkage long sys32_sigaltstack(const 
+diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c
+index 6557769..ef6ae89 100644
+--- a/arch/x86/ia32/ia32_signal.c
++++ b/arch/x86/ia32/ia32_signal.c
+@@ -169,7 +169,7 @@ asmlinkage long sys32_sigaltstack(const stack_ia32_t __user *uss_ptr,
        }
        seg = get_fs();
        set_fs(KERNEL_DS);
@@ -5888,7 +6561,7 @@ diff -urNp linux-3.1.3/arch/x86/ia32/ia32_signal.c linux-3.1.3/arch/x86/ia32/ia3
        set_fs(seg);
        if (ret >= 0 && uoss_ptr)  {
                if (!access_ok(VERIFY_WRITE, uoss_ptr, sizeof(stack_ia32_t)))
-@@ -370,7 +370,7 @@ static int ia32_setup_sigcontext(struct 
+@@ -370,7 +370,7 @@ static int ia32_setup_sigcontext(struct sigcontext_ia32 __user *sc,
   */
  static void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
                                 size_t frame_size,
@@ -5897,7 +6570,7 @@ diff -urNp linux-3.1.3/arch/x86/ia32/ia32_signal.c linux-3.1.3/arch/x86/ia32/ia3
  {
        unsigned long sp;
  
-@@ -391,7 +391,7 @@ static void __user *get_sigframe(struct 
+@@ -391,7 +391,7 @@ static void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
  
        if (used_math()) {
                sp = sp - sig_xstate_ia32_size;
@@ -5906,7 +6579,7 @@ diff -urNp linux-3.1.3/arch/x86/ia32/ia32_signal.c linux-3.1.3/arch/x86/ia32/ia3
                if (save_i387_xstate_ia32(*fpstate) < 0)
                        return (void __user *) -1L;
        }
-@@ -399,7 +399,7 @@ static void __user *get_sigframe(struct 
+@@ -399,7 +399,7 @@ static void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
        sp -= frame_size;
        /* Align the stack pointer according to the i386 ABI,
         * i.e. so that on function entry ((sp + 4) & 15) == 0. */
@@ -5915,7 +6588,7 @@ diff -urNp linux-3.1.3/arch/x86/ia32/ia32_signal.c linux-3.1.3/arch/x86/ia32/ia3
        return (void __user *) sp;
  }
  
-@@ -457,7 +457,7 @@ int ia32_setup_frame(int sig, struct k_s
+@@ -457,7 +457,7 @@ int ia32_setup_frame(int sig, struct k_sigaction *ka,
                 * These are actually not used anymore, but left because some
                 * gdb versions depend on them as a marker.
                 */
@@ -5924,7 +6597,7 @@ diff -urNp linux-3.1.3/arch/x86/ia32/ia32_signal.c linux-3.1.3/arch/x86/ia32/ia3
        } put_user_catch(err);
  
        if (err)
-@@ -499,7 +499,7 @@ int ia32_setup_rt_frame(int sig, struct 
+@@ -499,7 +499,7 @@ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
                0xb8,
                __NR_ia32_rt_sigreturn,
                0x80cd,
@@ -5933,7 +6606,7 @@ diff -urNp linux-3.1.3/arch/x86/ia32/ia32_signal.c linux-3.1.3/arch/x86/ia32/ia3
        };
  
        frame = get_sigframe(ka, regs, sizeof(*frame), &fpstate);
-@@ -529,16 +529,18 @@ int ia32_setup_rt_frame(int sig, struct 
+@@ -529,16 +529,18 @@ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
  
                if (ka->sa.sa_flags & SA_RESTORER)
                        restorer = ka->sa.sa_restorer;
@@ -5955,10 +6628,318 @@ diff -urNp linux-3.1.3/arch/x86/ia32/ia32_signal.c linux-3.1.3/arch/x86/ia32/ia3
        } put_user_catch(err);
  
        if (err)
-diff -urNp linux-3.1.3/arch/x86/ia32/sys_ia32.c linux-3.1.3/arch/x86/ia32/sys_ia32.c
---- linux-3.1.3/arch/x86/ia32/sys_ia32.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/ia32/sys_ia32.c       2011-11-16 18:39:07.000000000 -0500
-@@ -69,8 +69,8 @@ asmlinkage long sys32_ftruncate64(unsign
+diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S
+index 54edb207..9335b5f 100644
+--- a/arch/x86/ia32/ia32entry.S
++++ b/arch/x86/ia32/ia32entry.S
+@@ -13,7 +13,9 @@
+ #include <asm/thread_info.h>  
+ #include <asm/segment.h>
+ #include <asm/irqflags.h>
++#include <asm/pgtable.h>
+ #include <linux/linkage.h>
++#include <asm/alternative-asm.h>
+ /* Avoid __ASSEMBLER__'ifying <linux/audit.h> just for this.  */
+ #include <linux/elf-em.h>
+@@ -95,6 +97,30 @@ ENTRY(native_irq_enable_sysexit)
+ ENDPROC(native_irq_enable_sysexit)
+ #endif
++      .macro pax_enter_kernel_user
++      pax_set_fptr_mask
++#ifdef CONFIG_PAX_MEMORY_UDEREF
++      call pax_enter_kernel_user
++#endif
++      .endm
++
++      .macro pax_exit_kernel_user
++#ifdef CONFIG_PAX_MEMORY_UDEREF
++      call pax_exit_kernel_user
++#endif
++#ifdef CONFIG_PAX_RANDKSTACK
++      pushq %rax
++      call pax_randomize_kstack
++      popq %rax
++#endif
++      .endm
++
++.macro pax_erase_kstack
++#ifdef CONFIG_PAX_MEMORY_STACKLEAK
++      call pax_erase_kstack
++#endif
++.endm
++
+ /*
+  * 32bit SYSENTER instruction entry.
+  *
+@@ -121,12 +147,6 @@ ENTRY(ia32_sysenter_target)
+       CFI_REGISTER    rsp,rbp
+       SWAPGS_UNSAFE_STACK
+       movq    PER_CPU_VAR(kernel_stack), %rsp
+-      addq    $(KERNEL_STACK_OFFSET),%rsp
+-      /*
+-       * No need to follow this irqs on/off section: the syscall
+-       * disabled irqs, here we enable it straight after entry:
+-       */
+-      ENABLE_INTERRUPTS(CLBR_NONE)
+       movl    %ebp,%ebp               /* zero extension */
+       pushq_cfi $__USER32_DS
+       /*CFI_REL_OFFSET ss,0*/
+@@ -134,25 +154,38 @@ ENTRY(ia32_sysenter_target)
+       CFI_REL_OFFSET rsp,0
+       pushfq_cfi
+       /*CFI_REL_OFFSET rflags,0*/
+-      movl    8*3-THREAD_SIZE+TI_sysenter_return(%rsp), %r10d
+-      CFI_REGISTER rip,r10
++      GET_THREAD_INFO(%r11)
++      movl    TI_sysenter_return(%r11), %r11d
++      CFI_REGISTER rip,r11
+       pushq_cfi $__USER32_CS
+       /*CFI_REL_OFFSET cs,0*/
+       movl    %eax, %eax
+-      pushq_cfi %r10
++      pushq_cfi %r11
+       CFI_REL_OFFSET rip,0
+       pushq_cfi %rax
+       cld
+       SAVE_ARGS 0,1,0
++      pax_enter_kernel_user
++      /*
++       * No need to follow this irqs on/off section: the syscall
++       * disabled irqs, here we enable it straight after entry:
++       */
++      ENABLE_INTERRUPTS(CLBR_NONE)
+       /* no need to do an access_ok check here because rbp has been
+          32bit zero extended */ 
++
++#ifdef CONFIG_PAX_MEMORY_UDEREF
++      mov $PAX_USER_SHADOW_BASE,%r11
++      add %r11,%rbp
++#endif
++
+ 1:    movl    (%rbp),%ebp
+       .section __ex_table,"a"
+       .quad 1b,ia32_badarg
+       .previous       
+-      GET_THREAD_INFO(%r10)
+-      orl    $TS_COMPAT,TI_status(%r10)
+-      testl  $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10)
++      GET_THREAD_INFO(%r11)
++      orl    $TS_COMPAT,TI_status(%r11)
++      testl  $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r11)
+       CFI_REMEMBER_STATE
+       jnz  sysenter_tracesys
+       cmpq    $(IA32_NR_syscalls-1),%rax
+@@ -162,13 +195,15 @@ sysenter_do_call:
+ sysenter_dispatch:
+       call    *ia32_sys_call_table(,%rax,8)
+       movq    %rax,RAX-ARGOFFSET(%rsp)
+-      GET_THREAD_INFO(%r10)
++      GET_THREAD_INFO(%r11)
+       DISABLE_INTERRUPTS(CLBR_NONE)
+       TRACE_IRQS_OFF
+-      testl   $_TIF_ALLWORK_MASK,TI_flags(%r10)
++      testl   $_TIF_ALLWORK_MASK,TI_flags(%r11)
+       jnz     sysexit_audit
+ sysexit_from_sys_call:
+-      andl    $~TS_COMPAT,TI_status(%r10)
++      pax_exit_kernel_user
++      pax_erase_kstack
++      andl    $~TS_COMPAT,TI_status(%r11)
+       /* clear IF, that popfq doesn't enable interrupts early */
+       andl  $~0x200,EFLAGS-R11(%rsp) 
+       movl    RIP-R11(%rsp),%edx              /* User %eip */
+@@ -194,6 +229,9 @@ sysexit_from_sys_call:
+       movl %eax,%esi                  /* 2nd arg: syscall number */
+       movl $AUDIT_ARCH_I386,%edi      /* 1st arg: audit arch */
+       call audit_syscall_entry
++
++      pax_erase_kstack
++
+       movl RAX-ARGOFFSET(%rsp),%eax   /* reload syscall number */
+       cmpq $(IA32_NR_syscalls-1),%rax
+       ja ia32_badsys
+@@ -205,7 +243,7 @@ sysexit_from_sys_call:
+       .endm
+       .macro auditsys_exit exit
+-      testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10)
++      testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),TI_flags(%r11)
+       jnz ia32_ret_from_sys_call
+       TRACE_IRQS_ON
+       sti
+@@ -215,12 +253,12 @@ sysexit_from_sys_call:
+       movzbl %al,%edi         /* zero-extend that into %edi */
+       inc %edi /* first arg, 0->1(AUDITSC_SUCCESS), 1->2(AUDITSC_FAILURE) */
+       call audit_syscall_exit
+-      GET_THREAD_INFO(%r10)
++      GET_THREAD_INFO(%r11)
+       movl RAX-ARGOFFSET(%rsp),%eax   /* reload syscall return value */
+       movl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),%edi
+       cli
+       TRACE_IRQS_OFF
+-      testl %edi,TI_flags(%r10)
++      testl %edi,TI_flags(%r11)
+       jz \exit
+       CLEAR_RREGS -ARGOFFSET
+       jmp int_with_check
+@@ -238,7 +276,7 @@ sysexit_audit:
+ sysenter_tracesys:
+ #ifdef CONFIG_AUDITSYSCALL
+-      testl   $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10)
++      testl   $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags(%r11)
+       jz      sysenter_auditsys
+ #endif
+       SAVE_REST
+@@ -246,6 +284,9 @@ sysenter_tracesys:
+       movq    $-ENOSYS,RAX(%rsp)/* ptrace can change this for a bad syscall */
+       movq    %rsp,%rdi        /* &pt_regs -> arg1 */
+       call    syscall_trace_enter
++
++      pax_erase_kstack
++
+       LOAD_ARGS32 ARGOFFSET  /* reload args from stack in case ptrace changed it */
+       RESTORE_REST
+       cmpq    $(IA32_NR_syscalls-1),%rax
+@@ -277,19 +318,20 @@ ENDPROC(ia32_sysenter_target)
+ ENTRY(ia32_cstar_target)
+       CFI_STARTPROC32 simple
+       CFI_SIGNAL_FRAME
+-      CFI_DEF_CFA     rsp,KERNEL_STACK_OFFSET
++      CFI_DEF_CFA     rsp,0
+       CFI_REGISTER    rip,rcx
+       /*CFI_REGISTER  rflags,r11*/
+       SWAPGS_UNSAFE_STACK
+       movl    %esp,%r8d
+       CFI_REGISTER    rsp,r8
+       movq    PER_CPU_VAR(kernel_stack),%rsp
++      SAVE_ARGS 8*6,0,0
++      pax_enter_kernel_user
+       /*
+        * No need to follow this irqs on/off section: the syscall
+        * disabled irqs and here we enable it straight after entry:
+        */
+       ENABLE_INTERRUPTS(CLBR_NONE)
+-      SAVE_ARGS 8,0,0
+       movl    %eax,%eax       /* zero extension */
+       movq    %rax,ORIG_RAX-ARGOFFSET(%rsp)
+       movq    %rcx,RIP-ARGOFFSET(%rsp)
+@@ -305,13 +347,19 @@ ENTRY(ia32_cstar_target)
+       /* no need to do an access_ok check here because r8 has been
+          32bit zero extended */ 
+       /* hardware stack frame is complete now */      
++
++#ifdef CONFIG_PAX_MEMORY_UDEREF
++      mov $PAX_USER_SHADOW_BASE,%r11
++      add %r11,%r8
++#endif
++
+ 1:    movl    (%r8),%r9d
+       .section __ex_table,"a"
+       .quad 1b,ia32_badarg
+       .previous       
+-      GET_THREAD_INFO(%r10)
+-      orl   $TS_COMPAT,TI_status(%r10)
+-      testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10)
++      GET_THREAD_INFO(%r11)
++      orl   $TS_COMPAT,TI_status(%r11)
++      testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r11)
+       CFI_REMEMBER_STATE
+       jnz   cstar_tracesys
+       cmpq $IA32_NR_syscalls-1,%rax
+@@ -321,13 +369,15 @@ cstar_do_call:
+ cstar_dispatch:
+       call *ia32_sys_call_table(,%rax,8)
+       movq %rax,RAX-ARGOFFSET(%rsp)
+-      GET_THREAD_INFO(%r10)
++      GET_THREAD_INFO(%r11)
+       DISABLE_INTERRUPTS(CLBR_NONE)
+       TRACE_IRQS_OFF
+-      testl $_TIF_ALLWORK_MASK,TI_flags(%r10)
++      testl $_TIF_ALLWORK_MASK,TI_flags(%r11)
+       jnz sysretl_audit
+ sysretl_from_sys_call:
+-      andl $~TS_COMPAT,TI_status(%r10)
++      pax_exit_kernel_user
++      pax_erase_kstack
++      andl $~TS_COMPAT,TI_status(%r11)
+       RESTORE_ARGS 0,-ARG_SKIP,0,0,0
+       movl RIP-ARGOFFSET(%rsp),%ecx
+       CFI_REGISTER rip,rcx
+@@ -355,7 +405,7 @@ sysretl_audit:
+ cstar_tracesys:
+ #ifdef CONFIG_AUDITSYSCALL
+-      testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10)
++      testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags(%r11)
+       jz cstar_auditsys
+ #endif
+       xchgl %r9d,%ebp
+@@ -364,6 +414,9 @@ cstar_tracesys:
+       movq $-ENOSYS,RAX(%rsp) /* ptrace can change this for a bad syscall */
+       movq %rsp,%rdi        /* &pt_regs -> arg1 */
+       call syscall_trace_enter
++
++      pax_erase_kstack
++
+       LOAD_ARGS32 ARGOFFSET, 1  /* reload args from stack in case ptrace changed it */
+       RESTORE_REST
+       xchgl %ebp,%r9d
+@@ -409,20 +462,21 @@ ENTRY(ia32_syscall)
+       CFI_REL_OFFSET  rip,RIP-RIP
+       PARAVIRT_ADJUST_EXCEPTION_FRAME
+       SWAPGS
+-      /*
+-       * No need to follow this irqs on/off section: the syscall
+-       * disabled irqs and here we enable it straight after entry:
+-       */
+-      ENABLE_INTERRUPTS(CLBR_NONE)
+       movl %eax,%eax
+       pushq_cfi %rax
+       cld
+       /* note the registers are not zero extended to the sf.
+          this could be a problem. */
+       SAVE_ARGS 0,1,0
+-      GET_THREAD_INFO(%r10)
+-      orl   $TS_COMPAT,TI_status(%r10)
+-      testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10)
++      pax_enter_kernel_user
++      /*
++       * No need to follow this irqs on/off section: the syscall
++       * disabled irqs and here we enable it straight after entry:
++       */
++      ENABLE_INTERRUPTS(CLBR_NONE)
++      GET_THREAD_INFO(%r11)
++      orl   $TS_COMPAT,TI_status(%r11)
++      testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r11)
+       jnz ia32_tracesys
+       cmpq $(IA32_NR_syscalls-1),%rax
+       ja ia32_badsys
+@@ -441,6 +495,9 @@ ia32_tracesys:
+       movq $-ENOSYS,RAX(%rsp) /* ptrace can change this for a bad syscall */
+       movq %rsp,%rdi        /* &pt_regs -> arg1 */
+       call syscall_trace_enter
++
++      pax_erase_kstack
++
+       LOAD_ARGS32 ARGOFFSET  /* reload args from stack in case ptrace changed it */
+       RESTORE_REST
+       cmpq $(IA32_NR_syscalls-1),%rax
+@@ -455,6 +512,7 @@ ia32_badsys:
+ quiet_ni_syscall:
+       movq $-ENOSYS,%rax
++      pax_force_retaddr
+       ret
+       CFI_ENDPROC
+       
+diff --git a/arch/x86/ia32/sys_ia32.c b/arch/x86/ia32/sys_ia32.c
+index f6f5c53..b358b28 100644
+--- a/arch/x86/ia32/sys_ia32.c
++++ b/arch/x86/ia32/sys_ia32.c
+@@ -69,8 +69,8 @@ asmlinkage long sys32_ftruncate64(unsigned int fd, unsigned long offset_low,
   */
  static int cp_stat64(struct stat64 __user *ubuf, struct kstat *stat)
  {
@@ -5969,7 +6950,7 @@ diff -urNp linux-3.1.3/arch/x86/ia32/sys_ia32.c linux-3.1.3/arch/x86/ia32/sys_ia
        SET_UID(uid, stat->uid);
        SET_GID(gid, stat->gid);
        if (!access_ok(VERIFY_WRITE, ubuf, sizeof(struct stat64)) ||
-@@ -308,8 +308,8 @@ asmlinkage long sys32_rt_sigprocmask(int
+@@ -308,8 +308,8 @@ asmlinkage long sys32_rt_sigprocmask(int how, compat_sigset_t __user *set,
        }
        set_fs(KERNEL_DS);
        ret = sys_rt_sigprocmask(how,
@@ -5980,7 +6961,7 @@ diff -urNp linux-3.1.3/arch/x86/ia32/sys_ia32.c linux-3.1.3/arch/x86/ia32/sys_ia
                                 sigsetsize);
        set_fs(old_fs);
        if (ret)
-@@ -332,7 +332,7 @@ asmlinkage long sys32_alarm(unsigned int
+@@ -332,7 +332,7 @@ asmlinkage long sys32_alarm(unsigned int seconds)
        return alarm_setitimer(seconds);
  }
  
@@ -5989,7 +6970,7 @@ diff -urNp linux-3.1.3/arch/x86/ia32/sys_ia32.c linux-3.1.3/arch/x86/ia32/sys_ia
                              int options)
  {
        return compat_sys_wait4(pid, stat_addr, options, NULL);
-@@ -353,7 +353,7 @@ asmlinkage long sys32_sched_rr_get_inter
+@@ -353,7 +353,7 @@ asmlinkage long sys32_sched_rr_get_interval(compat_pid_t pid,
        mm_segment_t old_fs = get_fs();
  
        set_fs(KERNEL_DS);
@@ -5998,7 +6979,7 @@ diff -urNp linux-3.1.3/arch/x86/ia32/sys_ia32.c linux-3.1.3/arch/x86/ia32/sys_ia
        set_fs(old_fs);
        if (put_compat_timespec(&t, interval))
                return -EFAULT;
-@@ -369,7 +369,7 @@ asmlinkage long sys32_rt_sigpending(comp
+@@ -369,7 +369,7 @@ asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *set,
        mm_segment_t old_fs = get_fs();
  
        set_fs(KERNEL_DS);
@@ -6007,7 +6988,7 @@ diff -urNp linux-3.1.3/arch/x86/ia32/sys_ia32.c linux-3.1.3/arch/x86/ia32/sys_ia
        set_fs(old_fs);
        if (!ret) {
                switch (_NSIG_WORDS) {
-@@ -394,7 +394,7 @@ asmlinkage long sys32_rt_sigqueueinfo(in
+@@ -394,7 +394,7 @@ asmlinkage long sys32_rt_sigqueueinfo(int pid, int sig,
        if (copy_siginfo_from_user32(&info, uinfo))
                return -EFAULT;
        set_fs(KERNEL_DS);
@@ -6016,7 +6997,7 @@ diff -urNp linux-3.1.3/arch/x86/ia32/sys_ia32.c linux-3.1.3/arch/x86/ia32/sys_ia
        set_fs(old_fs);
        return ret;
  }
-@@ -439,7 +439,7 @@ asmlinkage long sys32_sendfile(int out_f
+@@ -439,7 +439,7 @@ asmlinkage long sys32_sendfile(int out_fd, int in_fd,
                return -EFAULT;
  
        set_fs(KERNEL_DS);
@@ -6025,34 +7006,61 @@ diff -urNp linux-3.1.3/arch/x86/ia32/sys_ia32.c linux-3.1.3/arch/x86/ia32/sys_ia
                           count);
        set_fs(old_fs);
  
-diff -urNp linux-3.1.3/arch/x86/include/asm/alternative-asm.h linux-3.1.3/arch/x86/include/asm/alternative-asm.h
---- linux-3.1.3/arch/x86/include/asm/alternative-asm.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/alternative-asm.h 2011-11-16 18:39:07.000000000 -0500
-@@ -15,6 +15,20 @@
+diff --git a/arch/x86/include/asm/alternative-asm.h b/arch/x86/include/asm/alternative-asm.h
+index 091508b..0ee32ec 100644
+--- a/arch/x86/include/asm/alternative-asm.h
++++ b/arch/x86/include/asm/alternative-asm.h
+@@ -15,6 +15,45 @@
        .endm
  #endif
  
 +#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      .macro pax_force_retaddr rip=0
++      .macro pax_force_retaddr_bts rip=0
++      btsq $63,\rip(%rsp)
++      .endm
++#ifdef CONFIG_PAX_KERNEXEC_PLUGIN_METHOD_BTS
++      .macro pax_force_retaddr rip=0, reload=0
 +      btsq $63,\rip(%rsp)
 +      .endm
 +      .macro pax_force_fptr ptr
 +      btsq $63,\ptr
 +      .endm
++      .macro pax_set_fptr_mask
++      .endm
++#endif
++#ifdef CONFIG_PAX_KERNEXEC_PLUGIN_METHOD_OR
++      .macro pax_force_retaddr rip=0, reload=0
++      .if \reload
++      pax_set_fptr_mask
++      .endif
++      orq %r10,\rip(%rsp)
++      .endm
++      .macro pax_force_fptr ptr
++      orq %r10,\ptr
++      .endm
++      .macro pax_set_fptr_mask
++      movabs $0x8000000000000000,%r10
++      .endm
++#endif
 +#else
-+      .macro pax_force_retaddr rip=0
++      .macro pax_force_retaddr rip=0, reload=0
 +      .endm
 +      .macro pax_force_fptr ptr
 +      .endm
++      .macro pax_force_retaddr_bts rip=0
++      .endm
++      .macro pax_set_fptr_mask
++      .endm
 +#endif
 +
  .macro altinstruction_entry orig alt feature orig_len alt_len
        .long \orig - .
        .long \alt - .
-diff -urNp linux-3.1.3/arch/x86/include/asm/alternative.h linux-3.1.3/arch/x86/include/asm/alternative.h
---- linux-3.1.3/arch/x86/include/asm/alternative.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/alternative.h     2011-11-16 18:39:07.000000000 -0500
-@@ -89,7 +89,7 @@ static inline int alternatives_text_rese
+diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h
+index 37ad100..7d47faa 100644
+--- a/arch/x86/include/asm/alternative.h
++++ b/arch/x86/include/asm/alternative.h
+@@ -89,7 +89,7 @@ static inline int alternatives_text_reserved(void *start, void *end)
        ".section .discard,\"aw\",@progbits\n"                          \
        "        .byte 0xff + (664f-663f) - (662b-661b)\n" /* rlen <= slen */   \
        ".previous\n"                                                   \
@@ -6061,10 +7069,11 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/alternative.h linux-3.1.3/arch/x86/i
        "663:\n\t" newinstr "\n664:\n"          /* replacement     */   \
        ".previous"
  
-diff -urNp linux-3.1.3/arch/x86/include/asm/apic.h linux-3.1.3/arch/x86/include/asm/apic.h
---- linux-3.1.3/arch/x86/include/asm/apic.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/apic.h    2011-11-16 18:39:07.000000000 -0500
-@@ -45,7 +45,7 @@ static inline void generic_apic_probe(vo
+diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
+index 9b7273c..e9fcc24 100644
+--- a/arch/x86/include/asm/apic.h
++++ b/arch/x86/include/asm/apic.h
+@@ -45,7 +45,7 @@ static inline void generic_apic_probe(void)
  
  #ifdef CONFIG_X86_LOCAL_APIC
  
@@ -6073,10 +7082,11 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/apic.h linux-3.1.3/arch/x86/include/
  extern int local_apic_timer_c2_ok;
  
  extern int disable_apic;
-diff -urNp linux-3.1.3/arch/x86/include/asm/apm.h linux-3.1.3/arch/x86/include/asm/apm.h
---- linux-3.1.3/arch/x86/include/asm/apm.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/apm.h     2011-11-16 18:39:07.000000000 -0500
-@@ -34,7 +34,7 @@ static inline void apm_bios_call_asm(u32
+diff --git a/arch/x86/include/asm/apm.h b/arch/x86/include/asm/apm.h
+index 20370c6..a2eb9b0 100644
+--- a/arch/x86/include/asm/apm.h
++++ b/arch/x86/include/asm/apm.h
+@@ -34,7 +34,7 @@ static inline void apm_bios_call_asm(u32 func, u32 ebx_in, u32 ecx_in,
        __asm__ __volatile__(APM_DO_ZERO_SEGS
                "pushl %%edi\n\t"
                "pushl %%ebp\n\t"
@@ -6085,7 +7095,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/apm.h linux-3.1.3/arch/x86/include/a
                "setc %%al\n\t"
                "popl %%ebp\n\t"
                "popl %%edi\n\t"
-@@ -58,7 +58,7 @@ static inline u8 apm_bios_call_simple_as
+@@ -58,7 +58,7 @@ static inline u8 apm_bios_call_simple_asm(u32 func, u32 ebx_in,
        __asm__ __volatile__(APM_DO_ZERO_SEGS
                "pushl %%edi\n\t"
                "pushl %%ebp\n\t"
@@ -6094,401 +7104,269 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/apm.h linux-3.1.3/arch/x86/include/a
                "setc %%bl\n\t"
                "popl %%ebp\n\t"
                "popl %%edi\n\t"
-diff -urNp linux-3.1.3/arch/x86/include/asm/atomic64_32.h linux-3.1.3/arch/x86/include/asm/atomic64_32.h
---- linux-3.1.3/arch/x86/include/asm/atomic64_32.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/atomic64_32.h     2011-11-16 18:39:07.000000000 -0500
-@@ -12,6 +12,14 @@ typedef struct {
-       u64 __aligned(8) counter;
- } atomic64_t;
-+#ifdef CONFIG_PAX_REFCOUNT
-+typedef struct {
-+      u64 __aligned(8) counter;
-+} atomic64_unchecked_t;
-+#else
-+typedef atomic64_t atomic64_unchecked_t;
-+#endif
-+
- #define ATOMIC64_INIT(val)    { (val) }
- #ifdef CONFIG_X86_CMPXCHG64
-@@ -38,6 +46,21 @@ static inline long long atomic64_cmpxchg
- }
- /**
-+ * atomic64_cmpxchg_unchecked - cmpxchg atomic64 variable
-+ * @p: pointer to type atomic64_unchecked_t
-+ * @o: expected value
-+ * @n: new value
-+ *
-+ * Atomically sets @v to @n if it was equal to @o and returns
-+ * the old value.
-+ */
-+
-+static inline long long atomic64_cmpxchg_unchecked(atomic64_unchecked_t *v, long long o, long long n)
-+{
-+      return cmpxchg64(&v->counter, o, n);
-+}
-+
-+/**
-  * atomic64_xchg - xchg atomic64 variable
-  * @v: pointer to type atomic64_t
-  * @n: value to assign
-@@ -77,6 +100,24 @@ static inline void atomic64_set(atomic64
- }
- /**
-+ * atomic64_set_unchecked - set atomic64 variable
-+ * @v: pointer to type atomic64_unchecked_t
-+ * @n: value to assign
-+ *
-+ * Atomically sets the value of @v to @n.
-+ */
-+static inline void atomic64_set_unchecked(atomic64_unchecked_t *v, long long i)
-+{
-+      unsigned high = (unsigned)(i >> 32);
-+      unsigned low = (unsigned)i;
-+      asm volatile(ATOMIC64_ALTERNATIVE(set)
-+                   : "+b" (low), "+c" (high)
-+                   : "S" (v)
-+                   : "eax", "edx", "memory"
-+                   );
-+}
-+
-+/**
-  * atomic64_read - read atomic64 variable
-  * @v: pointer to type atomic64_t
-  *
-@@ -93,6 +134,22 @@ static inline long long atomic64_read(at
-  }
- /**
-+ * atomic64_read_unchecked - read atomic64 variable
-+ * @v: pointer to type atomic64_unchecked_t
-+ *
-+ * Atomically reads the value of @v and returns it.
-+ */
-+static inline long long atomic64_read_unchecked(atomic64_unchecked_t *v)
-+{
-+      long long r;
-+      asm volatile(ATOMIC64_ALTERNATIVE(read_unchecked)
-+                   : "=A" (r), "+c" (v)
-+                   : : "memory"
-+                   );
-+      return r;
-+ }
-+
-+/**
-  * atomic64_add_return - add and return
-  * @i: integer value to add
-  * @v: pointer to type atomic64_t
-@@ -108,6 +165,22 @@ static inline long long atomic64_add_ret
-       return i;
- }
-+/**
-+ * atomic64_add_return_unchecked - add and return
-+ * @i: integer value to add
-+ * @v: pointer to type atomic64_unchecked_t
-+ *
-+ * Atomically adds @i to @v and returns @i + *@v
-+ */
-+static inline long long atomic64_add_return_unchecked(long long i, atomic64_unchecked_t *v)
-+{
-+      asm volatile(ATOMIC64_ALTERNATIVE(add_return_unchecked)
-+                   : "+A" (i), "+c" (v)
-+                   : : "memory"
-+                   );
-+      return i;
-+}
-+
- /*
-  * Other variants with different arithmetic operators:
-  */
-@@ -131,6 +204,17 @@ static inline long long atomic64_inc_ret
-       return a;
- }
-+static inline long long atomic64_inc_return_unchecked(atomic64_unchecked_t *v)
-+{
-+      long long a;
-+      asm volatile(ATOMIC64_ALTERNATIVE(inc_return_unchecked)
-+                   : "=A" (a)
-+                   : "S" (v)
-+                   : "memory", "ecx"
-+                   );
-+      return a;
-+}
-+
- static inline long long atomic64_dec_return(atomic64_t *v)
- {
-       long long a;
-@@ -159,6 +243,22 @@ static inline long long atomic64_add(lon
- }
- /**
-+ * atomic64_add_unchecked - add integer to atomic64 variable
-+ * @i: integer value to add
-+ * @v: pointer to type atomic64_unchecked_t
-+ *
-+ * Atomically adds @i to @v.
-+ */
-+static inline long long atomic64_add_unchecked(long long i, atomic64_unchecked_t *v)
-+{
-+      asm volatile(ATOMIC64_ALTERNATIVE_(add_unchecked, add_return_unchecked)
-+                   : "+A" (i), "+c" (v)
-+                   : : "memory"
-+                   );
-+      return i;
-+}
-+
-+/**
-  * atomic64_sub - subtract the atomic64 variable
-  * @i: integer value to subtract
-  * @v: pointer to type atomic64_t
-diff -urNp linux-3.1.3/arch/x86/include/asm/atomic64_64.h linux-3.1.3/arch/x86/include/asm/atomic64_64.h
---- linux-3.1.3/arch/x86/include/asm/atomic64_64.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/atomic64_64.h     2011-11-16 18:39:07.000000000 -0500
-@@ -18,7 +18,19 @@
+diff --git a/arch/x86/include/asm/atomic.h b/arch/x86/include/asm/atomic.h
+index 10572e3..2618d91 100644
+--- a/arch/x86/include/asm/atomic.h
++++ b/arch/x86/include/asm/atomic.h
+@@ -22,7 +22,18 @@
   */
- static inline long atomic64_read(const atomic64_t *v)
+ static inline int atomic_read(const atomic_t *v)
  {
--      return (*(volatile long *)&(v)->counter);
-+      return (*(volatile const long *)&(v)->counter);
+-      return (*(volatile int *)&(v)->counter);
++      return (*(volatile const int *)&(v)->counter);
 +}
 +
 +/**
-+ * atomic64_read_unchecked - read atomic64 variable
-+ * @v: pointer of type atomic64_unchecked_t
++ * atomic_read_unchecked - read atomic variable
++ * @v: pointer of type atomic_unchecked_t
 + *
 + * Atomically reads the value of @v.
-+ * Doesn't imply a read memory barrier.
 + */
-+static inline long atomic64_read_unchecked(const atomic64_unchecked_t *v)
++static inline int atomic_read_unchecked(const atomic_unchecked_t *v)
 +{
-+      return (*(volatile const long *)&(v)->counter);
++      return (*(volatile const int *)&(v)->counter);
  }
  
  /**
-@@ -34,6 +46,18 @@ static inline void atomic64_set(atomic64
+@@ -38,6 +49,18 @@ static inline void atomic_set(atomic_t *v, int i)
  }
  
  /**
-+ * atomic64_set_unchecked - set atomic64 variable
-+ * @v: pointer to type atomic64_unchecked_t
++ * atomic_set_unchecked - set atomic variable
++ * @v: pointer of type atomic_unchecked_t
 + * @i: required value
 + *
 + * Atomically sets the value of @v to @i.
 + */
-+static inline void atomic64_set_unchecked(atomic64_unchecked_t *v, long i)
++static inline void atomic_set_unchecked(atomic_unchecked_t *v, int i)
 +{
 +      v->counter = i;
 +}
 +
 +/**
-  * atomic64_add - add integer to atomic64 variable
+  * atomic_add - add integer to atomic variable
   * @i: integer value to add
-  * @v: pointer to type atomic64_t
-@@ -42,6 +66,28 @@ static inline void atomic64_set(atomic64
+  * @v: pointer of type atomic_t
+@@ -46,7 +69,29 @@ static inline void atomic_set(atomic_t *v, int i)
   */
- static inline void atomic64_add(long i, atomic64_t *v)
+ static inline void atomic_add(int i, atomic_t *v)
  {
-+      asm volatile(LOCK_PREFIX "addq %1,%0\n"
+-      asm volatile(LOCK_PREFIX "addl %1,%0"
++      asm volatile(LOCK_PREFIX "addl %1,%0\n"
 +
 +#ifdef CONFIG_PAX_REFCOUNT
 +                   "jno 0f\n"
-+                   LOCK_PREFIX "subq %1,%0\n"
++                   LOCK_PREFIX "subl %1,%0\n"
 +                   "int $4\n0:\n"
 +                   _ASM_EXTABLE(0b, 0b)
 +#endif
 +
-+                   : "=m" (v->counter)
-+                   : "er" (i), "m" (v->counter));
++                   : "+m" (v->counter)
++                   : "ir" (i));
 +}
 +
 +/**
-+ * atomic64_add_unchecked - add integer to atomic64 variable
++ * atomic_add_unchecked - add integer to atomic variable
 + * @i: integer value to add
-+ * @v: pointer to type atomic64_unchecked_t
++ * @v: pointer of type atomic_unchecked_t
 + *
 + * Atomically adds @i to @v.
 + */
-+static inline void atomic64_add_unchecked(long i, atomic64_unchecked_t *v)
++static inline void atomic_add_unchecked(int i, atomic_unchecked_t *v)
 +{
-       asm volatile(LOCK_PREFIX "addq %1,%0"
-                    : "=m" (v->counter)
-                    : "er" (i), "m" (v->counter));
-@@ -56,7 +102,29 @@ static inline void atomic64_add(long i, 
++      asm volatile(LOCK_PREFIX "addl %1,%0\n"
+                    : "+m" (v->counter)
+                    : "ir" (i));
+ }
+@@ -60,7 +105,29 @@ static inline void atomic_add(int i, atomic_t *v)
   */
- static inline void atomic64_sub(long i, atomic64_t *v)
+ static inline void atomic_sub(int i, atomic_t *v)
  {
--      asm volatile(LOCK_PREFIX "subq %1,%0"
-+      asm volatile(LOCK_PREFIX "subq %1,%0\n"
+-      asm volatile(LOCK_PREFIX "subl %1,%0"
++      asm volatile(LOCK_PREFIX "subl %1,%0\n"
 +
 +#ifdef CONFIG_PAX_REFCOUNT
 +                   "jno 0f\n"
-+                   LOCK_PREFIX "addq %1,%0\n"
++                   LOCK_PREFIX "addl %1,%0\n"
 +                   "int $4\n0:\n"
 +                   _ASM_EXTABLE(0b, 0b)
 +#endif
 +
-+                   : "=m" (v->counter)
-+                   : "er" (i), "m" (v->counter));
++                   : "+m" (v->counter)
++                   : "ir" (i));
 +}
 +
 +/**
-+ * atomic64_sub_unchecked - subtract the atomic64 variable
++ * atomic_sub_unchecked - subtract integer from atomic variable
 + * @i: integer value to subtract
-+ * @v: pointer to type atomic64_unchecked_t
++ * @v: pointer of type atomic_unchecked_t
 + *
 + * Atomically subtracts @i from @v.
 + */
-+static inline void atomic64_sub_unchecked(long i, atomic64_unchecked_t *v)
++static inline void atomic_sub_unchecked(int i, atomic_unchecked_t *v)
 +{
-+      asm volatile(LOCK_PREFIX "subq %1,%0\n"
-                    : "=m" (v->counter)
-                    : "er" (i), "m" (v->counter));
++      asm volatile(LOCK_PREFIX "subl %1,%0\n"
+                    : "+m" (v->counter)
+                    : "ir" (i));
  }
-@@ -74,7 +142,16 @@ static inline int atomic64_sub_and_test(
+@@ -78,7 +145,16 @@ static inline int atomic_sub_and_test(int i, atomic_t *v)
  {
        unsigned char c;
  
--      asm volatile(LOCK_PREFIX "subq %2,%0; sete %1"
-+      asm volatile(LOCK_PREFIX "subq %2,%0\n"
+-      asm volatile(LOCK_PREFIX "subl %2,%0; sete %1"
++      asm volatile(LOCK_PREFIX "subl %2,%0\n"
 +
 +#ifdef CONFIG_PAX_REFCOUNT
 +                   "jno 0f\n"
-+                   LOCK_PREFIX "addq %2,%0\n"
++                   LOCK_PREFIX "addl %2,%0\n"
 +                   "int $4\n0:\n"
 +                   _ASM_EXTABLE(0b, 0b)
 +#endif
 +
 +                   "sete %1\n"
-                    : "=m" (v->counter), "=qm" (c)
-                    : "er" (i), "m" (v->counter) : "memory");
+                    : "+m" (v->counter), "=qm" (c)
+                    : "ir" (i) : "memory");
        return c;
-@@ -88,6 +165,27 @@ static inline int atomic64_sub_and_test(
+@@ -92,7 +168,27 @@ static inline int atomic_sub_and_test(int i, atomic_t *v)
   */
- static inline void atomic64_inc(atomic64_t *v)
+ static inline void atomic_inc(atomic_t *v)
  {
-+      asm volatile(LOCK_PREFIX "incq %0\n"
+-      asm volatile(LOCK_PREFIX "incl %0"
++      asm volatile(LOCK_PREFIX "incl %0\n"
 +
 +#ifdef CONFIG_PAX_REFCOUNT
 +                   "jno 0f\n"
-+                   LOCK_PREFIX "decq %0\n"
++                   LOCK_PREFIX "decl %0\n"
 +                   "int $4\n0:\n"
 +                   _ASM_EXTABLE(0b, 0b)
 +#endif
 +
-+                   : "=m" (v->counter)
-+                   : "m" (v->counter));
++                   : "+m" (v->counter));
 +}
 +
 +/**
-+ * atomic64_inc_unchecked - increment atomic64 variable
-+ * @v: pointer to type atomic64_unchecked_t
++ * atomic_inc_unchecked - increment atomic variable
++ * @v: pointer of type atomic_unchecked_t
 + *
 + * Atomically increments @v by 1.
 + */
-+static inline void atomic64_inc_unchecked(atomic64_unchecked_t *v)
++static inline void atomic_inc_unchecked(atomic_unchecked_t *v)
 +{
-       asm volatile(LOCK_PREFIX "incq %0"
-                    : "=m" (v->counter)
-                    : "m" (v->counter));
-@@ -101,7 +199,28 @@ static inline void atomic64_inc(atomic64
++      asm volatile(LOCK_PREFIX "incl %0\n"
+                    : "+m" (v->counter));
+ }
+@@ -104,7 +200,27 @@ static inline void atomic_inc(atomic_t *v)
   */
- static inline void atomic64_dec(atomic64_t *v)
+ static inline void atomic_dec(atomic_t *v)
  {
--      asm volatile(LOCK_PREFIX "decq %0"
-+      asm volatile(LOCK_PREFIX "decq %0\n"
+-      asm volatile(LOCK_PREFIX "decl %0"
++      asm volatile(LOCK_PREFIX "decl %0\n"
 +
 +#ifdef CONFIG_PAX_REFCOUNT
 +                   "jno 0f\n"
-+                   LOCK_PREFIX "incq %0\n"
++                   LOCK_PREFIX "incl %0\n"
 +                   "int $4\n0:\n"
 +                   _ASM_EXTABLE(0b, 0b)
 +#endif
 +
-+                   : "=m" (v->counter)
-+                   : "m" (v->counter));
++                   : "+m" (v->counter));
 +}
 +
 +/**
-+ * atomic64_dec_unchecked - decrement atomic64 variable
-+ * @v: pointer to type atomic64_t
++ * atomic_dec_unchecked - decrement atomic variable
++ * @v: pointer of type atomic_unchecked_t
 + *
 + * Atomically decrements @v by 1.
 + */
-+static inline void atomic64_dec_unchecked(atomic64_unchecked_t *v)
++static inline void atomic_dec_unchecked(atomic_unchecked_t *v)
 +{
-+      asm volatile(LOCK_PREFIX "decq %0\n"
-                    : "=m" (v->counter)
-                    : "m" (v->counter));
++      asm volatile(LOCK_PREFIX "decl %0\n"
+                    : "+m" (v->counter));
  }
-@@ -118,7 +237,16 @@ static inline int atomic64_dec_and_test(
+@@ -120,7 +236,16 @@ static inline int atomic_dec_and_test(atomic_t *v)
  {
        unsigned char c;
  
--      asm volatile(LOCK_PREFIX "decq %0; sete %1"
-+      asm volatile(LOCK_PREFIX "decq %0\n"
+-      asm volatile(LOCK_PREFIX "decl %0; sete %1"
++      asm volatile(LOCK_PREFIX "decl %0\n"
 +
 +#ifdef CONFIG_PAX_REFCOUNT
 +                   "jno 0f\n"
-+                   LOCK_PREFIX "incq %0\n"
++                   LOCK_PREFIX "incl %0\n"
 +                   "int $4\n0:\n"
 +                   _ASM_EXTABLE(0b, 0b)
 +#endif
 +
 +                   "sete %1\n"
-                    : "=m" (v->counter), "=qm" (c)
-                    : "m" (v->counter) : "memory");
+                    : "+m" (v->counter), "=qm" (c)
+                    : : "memory");
        return c != 0;
-@@ -136,7 +264,16 @@ static inline int atomic64_inc_and_test(
+@@ -138,7 +263,35 @@ static inline int atomic_inc_and_test(atomic_t *v)
  {
        unsigned char c;
  
--      asm volatile(LOCK_PREFIX "incq %0; sete %1"
-+      asm volatile(LOCK_PREFIX "incq %0\n"
+-      asm volatile(LOCK_PREFIX "incl %0; sete %1"
++      asm volatile(LOCK_PREFIX "incl %0\n"
 +
 +#ifdef CONFIG_PAX_REFCOUNT
 +                   "jno 0f\n"
-+                   LOCK_PREFIX "decq %0\n"
++                   LOCK_PREFIX "decl %0\n"
 +                   "int $4\n0:\n"
 +                   _ASM_EXTABLE(0b, 0b)
 +#endif
 +
 +                   "sete %1\n"
-                    : "=m" (v->counter), "=qm" (c)
-                    : "m" (v->counter) : "memory");
++                   : "+m" (v->counter), "=qm" (c)
++                   : : "memory");
++      return c != 0;
++}
++
++/**
++ * atomic_inc_and_test_unchecked - increment and test
++ * @v: pointer of type atomic_unchecked_t
++ *
++ * Atomically increments @v by 1
++ * and returns true if the result is zero, or false for all
++ * other cases.
++ */
++static inline int atomic_inc_and_test_unchecked(atomic_unchecked_t *v)
++{
++      unsigned char c;
++
++      asm volatile(LOCK_PREFIX "incl %0\n"
++                   "sete %1\n"
+                    : "+m" (v->counter), "=qm" (c)
+                    : : "memory");
        return c != 0;
-@@ -155,7 +292,16 @@ static inline int atomic64_add_negative(
+@@ -157,7 +310,16 @@ static inline int atomic_add_negative(int i, atomic_t *v)
  {
        unsigned char c;
  
--      asm volatile(LOCK_PREFIX "addq %2,%0; sets %1"
-+      asm volatile(LOCK_PREFIX "addq %2,%0\n"
+-      asm volatile(LOCK_PREFIX "addl %2,%0; sets %1"
++      asm volatile(LOCK_PREFIX "addl %2,%0\n"
 +
 +#ifdef CONFIG_PAX_REFCOUNT
 +                   "jno 0f\n"
-+                   LOCK_PREFIX "subq %2,%0\n"
++                   LOCK_PREFIX "subl %2,%0\n"
 +                   "int $4\n0:\n"
 +                   _ASM_EXTABLE(0b, 0b)
 +#endif
 +
 +                   "sets %1\n"
-                    : "=m" (v->counter), "=qm" (c)
-                    : "er" (i), "m" (v->counter) : "memory");
+                    : "+m" (v->counter), "=qm" (c)
+                    : "ir" (i) : "memory");
        return c;
-@@ -171,7 +317,31 @@ static inline int atomic64_add_negative(
- static inline long atomic64_add_return(long i, atomic64_t *v)
- {
-       long __i = i;
--      asm volatile(LOCK_PREFIX "xaddq %0, %1;"
-+      asm volatile(LOCK_PREFIX "xaddq %0, %1\n"
+@@ -180,6 +342,46 @@ static inline int atomic_add_return(int i, atomic_t *v)
+ #endif
+       /* Modern 486+ processor */
+       __i = i;
++      asm volatile(LOCK_PREFIX "xaddl %0, %1\n"
 +
 +#ifdef CONFIG_PAX_REFCOUNT
 +                   "jno 0f\n"
-+                   "movq %0, %1\n"
++                   "movl %0, %1\n"
 +                   "int $4\n0:\n"
 +                   _ASM_EXTABLE(0b, 0b)
 +#endif
@@ -6496,63 +7374,88 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/atomic64_64.h linux-3.1.3/arch/x86/i
 +                   : "+r" (i), "+m" (v->counter)
 +                   : : "memory");
 +      return i + __i;
++
++#ifdef CONFIG_M386
++no_xadd: /* Legacy 386 processor */
++      local_irq_save(flags);
++      __i = atomic_read(v);
++      atomic_set(v, i + __i);
++      local_irq_restore(flags);
++      return i + __i;
++#endif
 +}
 +
 +/**
-+ * atomic64_add_return_unchecked - add and return
++ * atomic_add_return_unchecked - add integer and return
++ * @v: pointer of type atomic_unchecked_t
 + * @i: integer value to add
-+ * @v: pointer to type atomic64_unchecked_t
 + *
 + * Atomically adds @i to @v and returns @i + @v
 + */
-+static inline long atomic64_add_return_unchecked(long i, atomic64_unchecked_t *v)
++static inline int atomic_add_return_unchecked(int i, atomic_unchecked_t *v)
 +{
-+      long __i = i;
-+      asm volatile(LOCK_PREFIX "xaddq %0, %1"
++      int __i;
++#ifdef CONFIG_M386
++      unsigned long flags;
++      if (unlikely(boot_cpu_data.x86 <= 3))
++              goto no_xadd;
++#endif
++      /* Modern 486+ processor */
++      __i = i;
+       asm volatile(LOCK_PREFIX "xaddl %0, %1"
                     : "+r" (i), "+m" (v->counter)
                     : : "memory");
-       return i + __i;
-@@ -183,6 +353,10 @@ static inline long atomic64_sub_return(l
+@@ -208,6 +410,10 @@ static inline int atomic_sub_return(int i, atomic_t *v)
  }
  
- #define atomic64_inc_return(v)  (atomic64_add_return(1, (v)))
-+static inline long atomic64_inc_return_unchecked(atomic64_unchecked_t *v)
+ #define atomic_inc_return(v)  (atomic_add_return(1, v))
++static inline int atomic_inc_return_unchecked(atomic_unchecked_t *v)
 +{
-+      return atomic64_add_return_unchecked(1, v);
++      return atomic_add_return_unchecked(1, v);
 +}
- #define atomic64_dec_return(v)  (atomic64_sub_return(1, (v)))
+ #define atomic_dec_return(v)  (atomic_sub_return(1, v))
  
- static inline long atomic64_cmpxchg(atomic64_t *v, long old, long new)
-@@ -190,6 +364,11 @@ static inline long atomic64_cmpxchg(atom
+ static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
+@@ -215,11 +421,21 @@ static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
        return cmpxchg(&v->counter, old, new);
  }
  
-+static inline long atomic64_cmpxchg_unchecked(atomic64_unchecked_t *v, long old, long new)
++static inline int atomic_cmpxchg_unchecked(atomic_unchecked_t *v, int old, int new)
 +{
 +      return cmpxchg(&v->counter, old, new);
 +}
 +
- static inline long atomic64_xchg(atomic64_t *v, long new)
+ static inline int atomic_xchg(atomic_t *v, int new)
  {
        return xchg(&v->counter, new);
-@@ -206,17 +385,30 @@ static inline long atomic64_xchg(atomic6
+ }
++static inline int atomic_xchg_unchecked(atomic_unchecked_t *v, int new)
++{
++      return xchg(&v->counter, new);
++}
++
+ /**
+  * __atomic_add_unless - add unless the number is already a given value
+  * @v: pointer of type atomic_t
+@@ -231,12 +447,25 @@ static inline int atomic_xchg(atomic_t *v, int new)
   */
- static inline int atomic64_add_unless(atomic64_t *v, long a, long u)
+ static inline int __atomic_add_unless(atomic_t *v, int a, int u)
  {
--      long c, old;
-+      long c, old, new;
-       c = atomic64_read(v);
+-      int c, old;
++      int c, old, new;
+       c = atomic_read(v);
        for (;;) {
 -              if (unlikely(c == (u)))
 +              if (unlikely(c == u))
                        break;
--              old = atomic64_cmpxchg((v), c, c + (a));
+-              old = atomic_cmpxchg((v), c, c + (a));
 +
-+              asm volatile("add %2,%0\n"
++              asm volatile("addl %2,%0\n"
 +
 +#ifdef CONFIG_PAX_REFCOUNT
 +                           "jno 0f\n"
-+                           "sub %2,%0\n"
++                           "subl %2,%0\n"
 +                           "int $4\n0:\n"
 +                           _ASM_EXTABLE(0b, 0b)
 +#endif
@@ -6560,278 +7463,456 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/atomic64_64.h linux-3.1.3/arch/x86/i
 +                           : "=r" (new)
 +                           : "0" (c), "ir" (a));
 +
-+              old = atomic64_cmpxchg(v, c, new);
++              old = atomic_cmpxchg(v, c, new);
                if (likely(old == c))
                        break;
                c = old;
-       }
--      return c != (u);
-+      return c != u;
+@@ -244,6 +473,48 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u)
+       return c;
  }
  
- #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)
-diff -urNp linux-3.1.3/arch/x86/include/asm/atomic.h linux-3.1.3/arch/x86/include/asm/atomic.h
---- linux-3.1.3/arch/x86/include/asm/atomic.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/atomic.h  2011-11-16 18:39:07.000000000 -0500
-@@ -22,7 +22,18 @@
++/**
++ * atomic_inc_not_zero_hint - increment if not null
++ * @v: pointer of type atomic_t
++ * @hint: probable value of the atomic before the increment
++ *
++ * This version of atomic_inc_not_zero() gives a hint of probable
++ * value of the atomic. This helps processor to not read the memory
++ * before doing the atomic read/modify/write cycle, lowering
++ * number of bus transactions on some arches.
++ *
++ * Returns: 0 if increment was not done, 1 otherwise.
++ */
++#define atomic_inc_not_zero_hint atomic_inc_not_zero_hint
++static inline int atomic_inc_not_zero_hint(atomic_t *v, int hint)
++{
++      int val, c = hint, new;
++
++      /* sanity test, should be removed by compiler if hint is a constant */
++      if (!hint)
++              return __atomic_add_unless(v, 1, 0);
++
++      do {
++              asm volatile("incl %0\n"
++
++#ifdef CONFIG_PAX_REFCOUNT
++                           "jno 0f\n"
++                           "decl %0\n"
++                           "int $4\n0:\n"
++                           _ASM_EXTABLE(0b, 0b)
++#endif
++
++                           : "=r" (new)
++                           : "0" (c));
++
++              val = atomic_cmpxchg(v, c, new);
++              if (val == c)
++                      return 1;
++              c = val;
++      } while (c);
++
++      return 0;
++}
+ /*
+  * atomic_dec_if_positive - decrement by 1 if old value positive
+diff --git a/arch/x86/include/asm/atomic64_32.h b/arch/x86/include/asm/atomic64_32.h
+index 24098aa..1e37723 100644
+--- a/arch/x86/include/asm/atomic64_32.h
++++ b/arch/x86/include/asm/atomic64_32.h
+@@ -12,6 +12,14 @@ typedef struct {
+       u64 __aligned(8) counter;
+ } atomic64_t;
++#ifdef CONFIG_PAX_REFCOUNT
++typedef struct {
++      u64 __aligned(8) counter;
++} atomic64_unchecked_t;
++#else
++typedef atomic64_t atomic64_unchecked_t;
++#endif
++
+ #define ATOMIC64_INIT(val)    { (val) }
+ #ifdef CONFIG_X86_CMPXCHG64
+@@ -38,6 +46,21 @@ static inline long long atomic64_cmpxchg(atomic64_t *v, long long o, long long n
+ }
+ /**
++ * atomic64_cmpxchg_unchecked - cmpxchg atomic64 variable
++ * @p: pointer to type atomic64_unchecked_t
++ * @o: expected value
++ * @n: new value
++ *
++ * Atomically sets @v to @n if it was equal to @o and returns
++ * the old value.
++ */
++
++static inline long long atomic64_cmpxchg_unchecked(atomic64_unchecked_t *v, long long o, long long n)
++{
++      return cmpxchg64(&v->counter, o, n);
++}
++
++/**
+  * atomic64_xchg - xchg atomic64 variable
+  * @v: pointer to type atomic64_t
+  * @n: value to assign
+@@ -77,6 +100,24 @@ static inline void atomic64_set(atomic64_t *v, long long i)
+ }
+ /**
++ * atomic64_set_unchecked - set atomic64 variable
++ * @v: pointer to type atomic64_unchecked_t
++ * @n: value to assign
++ *
++ * Atomically sets the value of @v to @n.
++ */
++static inline void atomic64_set_unchecked(atomic64_unchecked_t *v, long long i)
++{
++      unsigned high = (unsigned)(i >> 32);
++      unsigned low = (unsigned)i;
++      asm volatile(ATOMIC64_ALTERNATIVE(set)
++                   : "+b" (low), "+c" (high)
++                   : "S" (v)
++                   : "eax", "edx", "memory"
++                   );
++}
++
++/**
+  * atomic64_read - read atomic64 variable
+  * @v: pointer to type atomic64_t
+  *
+@@ -93,6 +134,22 @@ static inline long long atomic64_read(atomic64_t *v)
+  }
+ /**
++ * atomic64_read_unchecked - read atomic64 variable
++ * @v: pointer to type atomic64_unchecked_t
++ *
++ * Atomically reads the value of @v and returns it.
++ */
++static inline long long atomic64_read_unchecked(atomic64_unchecked_t *v)
++{
++      long long r;
++      asm volatile(ATOMIC64_ALTERNATIVE(read_unchecked)
++                   : "=A" (r), "+c" (v)
++                   : : "memory"
++                   );
++      return r;
++ }
++
++/**
+  * atomic64_add_return - add and return
+  * @i: integer value to add
+  * @v: pointer to type atomic64_t
+@@ -108,6 +165,22 @@ static inline long long atomic64_add_return(long long i, atomic64_t *v)
+       return i;
+ }
++/**
++ * atomic64_add_return_unchecked - add and return
++ * @i: integer value to add
++ * @v: pointer to type atomic64_unchecked_t
++ *
++ * Atomically adds @i to @v and returns @i + *@v
++ */
++static inline long long atomic64_add_return_unchecked(long long i, atomic64_unchecked_t *v)
++{
++      asm volatile(ATOMIC64_ALTERNATIVE(add_return_unchecked)
++                   : "+A" (i), "+c" (v)
++                   : : "memory"
++                   );
++      return i;
++}
++
+ /*
+  * Other variants with different arithmetic operators:
   */
- static inline int atomic_read(const atomic_t *v)
+@@ -131,6 +204,17 @@ static inline long long atomic64_inc_return(atomic64_t *v)
+       return a;
+ }
++static inline long long atomic64_inc_return_unchecked(atomic64_unchecked_t *v)
++{
++      long long a;
++      asm volatile(ATOMIC64_ALTERNATIVE(inc_return_unchecked)
++                   : "=A" (a)
++                   : "S" (v)
++                   : "memory", "ecx"
++                   );
++      return a;
++}
++
+ static inline long long atomic64_dec_return(atomic64_t *v)
  {
--      return (*(volatile int *)&(v)->counter);
-+      return (*(volatile const int *)&(v)->counter);
+       long long a;
+@@ -159,6 +243,22 @@ static inline long long atomic64_add(long long i, atomic64_t *v)
+ }
+ /**
++ * atomic64_add_unchecked - add integer to atomic64 variable
++ * @i: integer value to add
++ * @v: pointer to type atomic64_unchecked_t
++ *
++ * Atomically adds @i to @v.
++ */
++static inline long long atomic64_add_unchecked(long long i, atomic64_unchecked_t *v)
++{
++      asm volatile(ATOMIC64_ALTERNATIVE_(add_unchecked, add_return_unchecked)
++                   : "+A" (i), "+c" (v)
++                   : : "memory"
++                   );
++      return i;
 +}
 +
 +/**
-+ * atomic_read_unchecked - read atomic variable
-+ * @v: pointer of type atomic_unchecked_t
+  * atomic64_sub - subtract the atomic64 variable
+  * @i: integer value to subtract
+  * @v: pointer to type atomic64_t
+diff --git a/arch/x86/include/asm/atomic64_64.h b/arch/x86/include/asm/atomic64_64.h
+index 017594d..d3fcf72 100644
+--- a/arch/x86/include/asm/atomic64_64.h
++++ b/arch/x86/include/asm/atomic64_64.h
+@@ -18,7 +18,19 @@
+  */
+ static inline long atomic64_read(const atomic64_t *v)
+ {
+-      return (*(volatile long *)&(v)->counter);
++      return (*(volatile const long *)&(v)->counter);
++}
++
++/**
++ * atomic64_read_unchecked - read atomic64 variable
++ * @v: pointer of type atomic64_unchecked_t
 + *
 + * Atomically reads the value of @v.
++ * Doesn't imply a read memory barrier.
 + */
-+static inline int atomic_read_unchecked(const atomic_unchecked_t *v)
++static inline long atomic64_read_unchecked(const atomic64_unchecked_t *v)
 +{
-+      return (*(volatile const int *)&(v)->counter);
++      return (*(volatile const long *)&(v)->counter);
  }
  
  /**
-@@ -38,6 +49,18 @@ static inline void atomic_set(atomic_t *
+@@ -34,6 +46,18 @@ static inline void atomic64_set(atomic64_t *v, long i)
  }
  
  /**
-+ * atomic_set_unchecked - set atomic variable
-+ * @v: pointer of type atomic_unchecked_t
++ * atomic64_set_unchecked - set atomic64 variable
++ * @v: pointer to type atomic64_unchecked_t
 + * @i: required value
 + *
 + * Atomically sets the value of @v to @i.
 + */
-+static inline void atomic_set_unchecked(atomic_unchecked_t *v, int i)
++static inline void atomic64_set_unchecked(atomic64_unchecked_t *v, long i)
 +{
 +      v->counter = i;
 +}
 +
 +/**
-  * atomic_add - add integer to atomic variable
+  * atomic64_add - add integer to atomic64 variable
   * @i: integer value to add
-  * @v: pointer of type atomic_t
-@@ -46,7 +69,29 @@ static inline void atomic_set(atomic_t *
+  * @v: pointer to type atomic64_t
+@@ -42,6 +66,28 @@ static inline void atomic64_set(atomic64_t *v, long i)
   */
- static inline void atomic_add(int i, atomic_t *v)
+ static inline void atomic64_add(long i, atomic64_t *v)
  {
--      asm volatile(LOCK_PREFIX "addl %1,%0"
-+      asm volatile(LOCK_PREFIX "addl %1,%0\n"
++      asm volatile(LOCK_PREFIX "addq %1,%0\n"
 +
 +#ifdef CONFIG_PAX_REFCOUNT
 +                   "jno 0f\n"
-+                   LOCK_PREFIX "subl %1,%0\n"
++                   LOCK_PREFIX "subq %1,%0\n"
 +                   "int $4\n0:\n"
 +                   _ASM_EXTABLE(0b, 0b)
 +#endif
 +
-+                   : "+m" (v->counter)
-+                   : "ir" (i));
++                   : "=m" (v->counter)
++                   : "er" (i), "m" (v->counter));
 +}
 +
 +/**
-+ * atomic_add_unchecked - add integer to atomic variable
++ * atomic64_add_unchecked - add integer to atomic64 variable
 + * @i: integer value to add
-+ * @v: pointer of type atomic_unchecked_t
++ * @v: pointer to type atomic64_unchecked_t
 + *
 + * Atomically adds @i to @v.
 + */
-+static inline void atomic_add_unchecked(int i, atomic_unchecked_t *v)
++static inline void atomic64_add_unchecked(long i, atomic64_unchecked_t *v)
 +{
-+      asm volatile(LOCK_PREFIX "addl %1,%0\n"
-                    : "+m" (v->counter)
-                    : "ir" (i));
- }
-@@ -60,7 +105,29 @@ static inline void atomic_add(int i, ato
+       asm volatile(LOCK_PREFIX "addq %1,%0"
+                    : "=m" (v->counter)
+                    : "er" (i), "m" (v->counter));
+@@ -56,7 +102,29 @@ static inline void atomic64_add(long i, atomic64_t *v)
   */
- static inline void atomic_sub(int i, atomic_t *v)
+ static inline void atomic64_sub(long i, atomic64_t *v)
  {
--      asm volatile(LOCK_PREFIX "subl %1,%0"
-+      asm volatile(LOCK_PREFIX "subl %1,%0\n"
+-      asm volatile(LOCK_PREFIX "subq %1,%0"
++      asm volatile(LOCK_PREFIX "subq %1,%0\n"
 +
 +#ifdef CONFIG_PAX_REFCOUNT
 +                   "jno 0f\n"
-+                   LOCK_PREFIX "addl %1,%0\n"
++                   LOCK_PREFIX "addq %1,%0\n"
 +                   "int $4\n0:\n"
 +                   _ASM_EXTABLE(0b, 0b)
 +#endif
 +
-+                   : "+m" (v->counter)
-+                   : "ir" (i));
++                   : "=m" (v->counter)
++                   : "er" (i), "m" (v->counter));
 +}
 +
 +/**
-+ * atomic_sub_unchecked - subtract integer from atomic variable
++ * atomic64_sub_unchecked - subtract the atomic64 variable
 + * @i: integer value to subtract
-+ * @v: pointer of type atomic_unchecked_t
++ * @v: pointer to type atomic64_unchecked_t
 + *
 + * Atomically subtracts @i from @v.
 + */
-+static inline void atomic_sub_unchecked(int i, atomic_unchecked_t *v)
++static inline void atomic64_sub_unchecked(long i, atomic64_unchecked_t *v)
 +{
-+      asm volatile(LOCK_PREFIX "subl %1,%0\n"
-                    : "+m" (v->counter)
-                    : "ir" (i));
++      asm volatile(LOCK_PREFIX "subq %1,%0\n"
+                    : "=m" (v->counter)
+                    : "er" (i), "m" (v->counter));
  }
-@@ -78,7 +145,16 @@ static inline int atomic_sub_and_test(in
+@@ -74,7 +142,16 @@ static inline int atomic64_sub_and_test(long i, atomic64_t *v)
  {
        unsigned char c;
  
--      asm volatile(LOCK_PREFIX "subl %2,%0; sete %1"
-+      asm volatile(LOCK_PREFIX "subl %2,%0\n"
+-      asm volatile(LOCK_PREFIX "subq %2,%0; sete %1"
++      asm volatile(LOCK_PREFIX "subq %2,%0\n"
 +
 +#ifdef CONFIG_PAX_REFCOUNT
 +                   "jno 0f\n"
-+                   LOCK_PREFIX "addl %2,%0\n"
++                   LOCK_PREFIX "addq %2,%0\n"
 +                   "int $4\n0:\n"
 +                   _ASM_EXTABLE(0b, 0b)
 +#endif
 +
 +                   "sete %1\n"
-                    : "+m" (v->counter), "=qm" (c)
-                    : "ir" (i) : "memory");
+                    : "=m" (v->counter), "=qm" (c)
+                    : "er" (i), "m" (v->counter) : "memory");
        return c;
-@@ -92,7 +168,27 @@ static inline int atomic_sub_and_test(in
+@@ -88,6 +165,27 @@ static inline int atomic64_sub_and_test(long i, atomic64_t *v)
   */
- static inline void atomic_inc(atomic_t *v)
+ static inline void atomic64_inc(atomic64_t *v)
  {
--      asm volatile(LOCK_PREFIX "incl %0"
-+      asm volatile(LOCK_PREFIX "incl %0\n"
++      asm volatile(LOCK_PREFIX "incq %0\n"
 +
 +#ifdef CONFIG_PAX_REFCOUNT
 +                   "jno 0f\n"
-+                   LOCK_PREFIX "decl %0\n"
++                   LOCK_PREFIX "decq %0\n"
 +                   "int $4\n0:\n"
 +                   _ASM_EXTABLE(0b, 0b)
 +#endif
 +
-+                   : "+m" (v->counter));
++                   : "=m" (v->counter)
++                   : "m" (v->counter));
 +}
 +
 +/**
-+ * atomic_inc_unchecked - increment atomic variable
-+ * @v: pointer of type atomic_unchecked_t
++ * atomic64_inc_unchecked - increment atomic64 variable
++ * @v: pointer to type atomic64_unchecked_t
 + *
 + * Atomically increments @v by 1.
 + */
-+static inline void atomic_inc_unchecked(atomic_unchecked_t *v)
++static inline void atomic64_inc_unchecked(atomic64_unchecked_t *v)
 +{
-+      asm volatile(LOCK_PREFIX "incl %0\n"
-                    : "+m" (v->counter));
- }
-@@ -104,7 +200,27 @@ static inline void atomic_inc(atomic_t *
+       asm volatile(LOCK_PREFIX "incq %0"
+                    : "=m" (v->counter)
+                    : "m" (v->counter));
+@@ -101,7 +199,28 @@ static inline void atomic64_inc(atomic64_t *v)
   */
- static inline void atomic_dec(atomic_t *v)
+ static inline void atomic64_dec(atomic64_t *v)
  {
--      asm volatile(LOCK_PREFIX "decl %0"
-+      asm volatile(LOCK_PREFIX "decl %0\n"
+-      asm volatile(LOCK_PREFIX "decq %0"
++      asm volatile(LOCK_PREFIX "decq %0\n"
 +
 +#ifdef CONFIG_PAX_REFCOUNT
 +                   "jno 0f\n"
-+                   LOCK_PREFIX "incl %0\n"
++                   LOCK_PREFIX "incq %0\n"
 +                   "int $4\n0:\n"
 +                   _ASM_EXTABLE(0b, 0b)
 +#endif
 +
-+                   : "+m" (v->counter));
++                   : "=m" (v->counter)
++                   : "m" (v->counter));
 +}
 +
 +/**
-+ * atomic_dec_unchecked - decrement atomic variable
-+ * @v: pointer of type atomic_unchecked_t
++ * atomic64_dec_unchecked - decrement atomic64 variable
++ * @v: pointer to type atomic64_t
 + *
 + * Atomically decrements @v by 1.
 + */
-+static inline void atomic_dec_unchecked(atomic_unchecked_t *v)
++static inline void atomic64_dec_unchecked(atomic64_unchecked_t *v)
 +{
-+      asm volatile(LOCK_PREFIX "decl %0\n"
-                    : "+m" (v->counter));
++      asm volatile(LOCK_PREFIX "decq %0\n"
+                    : "=m" (v->counter)
+                    : "m" (v->counter));
  }
-@@ -120,7 +236,16 @@ static inline int atomic_dec_and_test(at
+@@ -118,7 +237,16 @@ static inline int atomic64_dec_and_test(atomic64_t *v)
  {
        unsigned char c;
  
--      asm volatile(LOCK_PREFIX "decl %0; sete %1"
-+      asm volatile(LOCK_PREFIX "decl %0\n"
+-      asm volatile(LOCK_PREFIX "decq %0; sete %1"
++      asm volatile(LOCK_PREFIX "decq %0\n"
 +
 +#ifdef CONFIG_PAX_REFCOUNT
 +                   "jno 0f\n"
-+                   LOCK_PREFIX "incl %0\n"
++                   LOCK_PREFIX "incq %0\n"
 +                   "int $4\n0:\n"
 +                   _ASM_EXTABLE(0b, 0b)
 +#endif
 +
 +                   "sete %1\n"
-                    : "+m" (v->counter), "=qm" (c)
-                    : : "memory");
+                    : "=m" (v->counter), "=qm" (c)
+                    : "m" (v->counter) : "memory");
        return c != 0;
-@@ -138,7 +263,35 @@ static inline int atomic_inc_and_test(at
+@@ -136,7 +264,16 @@ static inline int atomic64_inc_and_test(atomic64_t *v)
  {
        unsigned char c;
  
--      asm volatile(LOCK_PREFIX "incl %0; sete %1"
-+      asm volatile(LOCK_PREFIX "incl %0\n"
+-      asm volatile(LOCK_PREFIX "incq %0; sete %1"
++      asm volatile(LOCK_PREFIX "incq %0\n"
 +
 +#ifdef CONFIG_PAX_REFCOUNT
 +                   "jno 0f\n"
-+                   LOCK_PREFIX "decl %0\n"
++                   LOCK_PREFIX "decq %0\n"
 +                   "int $4\n0:\n"
 +                   _ASM_EXTABLE(0b, 0b)
 +#endif
 +
 +                   "sete %1\n"
-+                   : "+m" (v->counter), "=qm" (c)
-+                   : : "memory");
-+      return c != 0;
-+}
-+
-+/**
-+ * atomic_inc_and_test_unchecked - increment and test
-+ * @v: pointer of type atomic_unchecked_t
-+ *
-+ * Atomically increments @v by 1
-+ * and returns true if the result is zero, or false for all
-+ * other cases.
-+ */
-+static inline int atomic_inc_and_test_unchecked(atomic_unchecked_t *v)
-+{
-+      unsigned char c;
-+
-+      asm volatile(LOCK_PREFIX "incl %0\n"
-+                   "sete %1\n"
-                    : "+m" (v->counter), "=qm" (c)
-                    : : "memory");
+                    : "=m" (v->counter), "=qm" (c)
+                    : "m" (v->counter) : "memory");
        return c != 0;
-@@ -157,7 +310,16 @@ static inline int atomic_add_negative(in
+@@ -155,7 +292,16 @@ static inline int atomic64_add_negative(long i, atomic64_t *v)
  {
        unsigned char c;
  
--      asm volatile(LOCK_PREFIX "addl %2,%0; sets %1"
-+      asm volatile(LOCK_PREFIX "addl %2,%0\n"
+-      asm volatile(LOCK_PREFIX "addq %2,%0; sets %1"
++      asm volatile(LOCK_PREFIX "addq %2,%0\n"
 +
 +#ifdef CONFIG_PAX_REFCOUNT
 +                   "jno 0f\n"
-+                   LOCK_PREFIX "subl %2,%0\n"
++                   LOCK_PREFIX "subq %2,%0\n"
 +                   "int $4\n0:\n"
 +                   _ASM_EXTABLE(0b, 0b)
 +#endif
 +
 +                   "sets %1\n"
-                    : "+m" (v->counter), "=qm" (c)
-                    : "ir" (i) : "memory");
+                    : "=m" (v->counter), "=qm" (c)
+                    : "er" (i), "m" (v->counter) : "memory");
        return c;
-@@ -180,6 +342,46 @@ static inline int atomic_add_return(int 
- #endif
-       /* Modern 486+ processor */
-       __i = i;
-+      asm volatile(LOCK_PREFIX "xaddl %0, %1\n"
+@@ -171,7 +317,31 @@ static inline int atomic64_add_negative(long i, atomic64_t *v)
+ static inline long atomic64_add_return(long i, atomic64_t *v)
+ {
+       long __i = i;
+-      asm volatile(LOCK_PREFIX "xaddq %0, %1;"
++      asm volatile(LOCK_PREFIX "xaddq %0, %1\n"
 +
 +#ifdef CONFIG_PAX_REFCOUNT
 +                   "jno 0f\n"
-+                   "movl %0, %1\n"
++                   "movq %0, %1\n"
 +                   "int $4\n0:\n"
 +                   _ASM_EXTABLE(0b, 0b)
 +#endif
@@ -6839,88 +7920,63 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/atomic.h linux-3.1.3/arch/x86/includ
 +                   : "+r" (i), "+m" (v->counter)
 +                   : : "memory");
 +      return i + __i;
-+
-+#ifdef CONFIG_M386
-+no_xadd: /* Legacy 386 processor */
-+      local_irq_save(flags);
-+      __i = atomic_read(v);
-+      atomic_set(v, i + __i);
-+      local_irq_restore(flags);
-+      return i + __i;
-+#endif
 +}
 +
 +/**
-+ * atomic_add_return_unchecked - add integer and return
-+ * @v: pointer of type atomic_unchecked_t
++ * atomic64_add_return_unchecked - add and return
 + * @i: integer value to add
++ * @v: pointer to type atomic64_unchecked_t
 + *
 + * Atomically adds @i to @v and returns @i + @v
 + */
-+static inline int atomic_add_return_unchecked(int i, atomic_unchecked_t *v)
++static inline long atomic64_add_return_unchecked(long i, atomic64_unchecked_t *v)
 +{
-+      int __i;
-+#ifdef CONFIG_M386
-+      unsigned long flags;
-+      if (unlikely(boot_cpu_data.x86 <= 3))
-+              goto no_xadd;
-+#endif
-+      /* Modern 486+ processor */
-+      __i = i;
-       asm volatile(LOCK_PREFIX "xaddl %0, %1"
++      long __i = i;
++      asm volatile(LOCK_PREFIX "xaddq %0, %1"
                     : "+r" (i), "+m" (v->counter)
                     : : "memory");
-@@ -208,6 +410,10 @@ static inline int atomic_sub_return(int 
+       return i + __i;
+@@ -183,6 +353,10 @@ static inline long atomic64_sub_return(long i, atomic64_t *v)
  }
  
- #define atomic_inc_return(v)  (atomic_add_return(1, v))
-+static inline int atomic_inc_return_unchecked(atomic_unchecked_t *v)
+ #define atomic64_inc_return(v)  (atomic64_add_return(1, (v)))
++static inline long atomic64_inc_return_unchecked(atomic64_unchecked_t *v)
 +{
-+      return atomic_add_return_unchecked(1, v);
++      return atomic64_add_return_unchecked(1, v);
 +}
- #define atomic_dec_return(v)  (atomic_sub_return(1, v))
+ #define atomic64_dec_return(v)  (atomic64_sub_return(1, (v)))
  
- static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
-@@ -215,11 +421,21 @@ static inline int atomic_cmpxchg(atomic_
+ static inline long atomic64_cmpxchg(atomic64_t *v, long old, long new)
+@@ -190,6 +364,11 @@ static inline long atomic64_cmpxchg(atomic64_t *v, long old, long new)
        return cmpxchg(&v->counter, old, new);
  }
  
-+static inline int atomic_cmpxchg_unchecked(atomic_unchecked_t *v, int old, int new)
++static inline long atomic64_cmpxchg_unchecked(atomic64_unchecked_t *v, long old, long new)
 +{
 +      return cmpxchg(&v->counter, old, new);
 +}
 +
- static inline int atomic_xchg(atomic_t *v, int new)
+ static inline long atomic64_xchg(atomic64_t *v, long new)
  {
        return xchg(&v->counter, new);
- }
-+static inline int atomic_xchg_unchecked(atomic_unchecked_t *v, int new)
-+{
-+      return xchg(&v->counter, new);
-+}
-+
- /**
-  * __atomic_add_unless - add unless the number is already a given value
-  * @v: pointer of type atomic_t
-@@ -231,12 +447,25 @@ static inline int atomic_xchg(atomic_t *
+@@ -206,17 +385,30 @@ static inline long atomic64_xchg(atomic64_t *v, long new)
   */
- static inline int __atomic_add_unless(atomic_t *v, int a, int u)
+ static inline int atomic64_add_unless(atomic64_t *v, long a, long u)
  {
--      int c, old;
-+      int c, old, new;
-       c = atomic_read(v);
+-      long c, old;
++      long c, old, new;
+       c = atomic64_read(v);
        for (;;) {
 -              if (unlikely(c == (u)))
 +              if (unlikely(c == u))
                        break;
--              old = atomic_cmpxchg((v), c, c + (a));
+-              old = atomic64_cmpxchg((v), c, c + (a));
 +
-+              asm volatile("addl %2,%0\n"
++              asm volatile("add %2,%0\n"
 +
 +#ifdef CONFIG_PAX_REFCOUNT
 +                           "jno 0f\n"
-+                           "subl %2,%0\n"
++                           "sub %2,%0\n"
 +                           "int $4\n0:\n"
 +                           _ASM_EXTABLE(0b, 0b)
 +#endif
@@ -6928,62 +7984,20 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/atomic.h linux-3.1.3/arch/x86/includ
 +                           : "=r" (new)
 +                           : "0" (c), "ir" (a));
 +
-+              old = atomic_cmpxchg(v, c, new);
++              old = atomic64_cmpxchg(v, c, new);
                if (likely(old == c))
                        break;
                c = old;
-@@ -244,6 +473,48 @@ static inline int __atomic_add_unless(at
-       return c;
+       }
+-      return c != (u);
++      return c != u;
  }
  
-+/**
-+ * atomic_inc_not_zero_hint - increment if not null
-+ * @v: pointer of type atomic_t
-+ * @hint: probable value of the atomic before the increment
-+ *
-+ * This version of atomic_inc_not_zero() gives a hint of probable
-+ * value of the atomic. This helps processor to not read the memory
-+ * before doing the atomic read/modify/write cycle, lowering
-+ * number of bus transactions on some arches.
-+ *
-+ * Returns: 0 if increment was not done, 1 otherwise.
-+ */
-+#define atomic_inc_not_zero_hint atomic_inc_not_zero_hint
-+static inline int atomic_inc_not_zero_hint(atomic_t *v, int hint)
-+{
-+      int val, c = hint, new;
-+
-+      /* sanity test, should be removed by compiler if hint is a constant */
-+      if (!hint)
-+              return __atomic_add_unless(v, 1, 0);
-+
-+      do {
-+              asm volatile("incl %0\n"
-+
-+#ifdef CONFIG_PAX_REFCOUNT
-+                           "jno 0f\n"
-+                           "decl %0\n"
-+                           "int $4\n0:\n"
-+                           _ASM_EXTABLE(0b, 0b)
-+#endif
-+
-+                           : "=r" (new)
-+                           : "0" (c));
-+
-+              val = atomic_cmpxchg(v, c, new);
-+              if (val == c)
-+                      return 1;
-+              c = val;
-+      } while (c);
-+
-+      return 0;
-+}
- /*
-  * atomic_dec_if_positive - decrement by 1 if old value positive
-diff -urNp linux-3.1.3/arch/x86/include/asm/bitops.h linux-3.1.3/arch/x86/include/asm/bitops.h
---- linux-3.1.3/arch/x86/include/asm/bitops.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/bitops.h  2011-11-16 18:39:07.000000000 -0500
+ #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)
+diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h
+index 1775d6e..b65017f 100644
+--- a/arch/x86/include/asm/bitops.h
++++ b/arch/x86/include/asm/bitops.h
 @@ -38,7 +38,7 @@
   * a mask operation on a byte.
   */
@@ -6993,9 +8007,10 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/bitops.h linux-3.1.3/arch/x86/includ
  #define CONST_MASK(nr)                        (1 << ((nr) & 7))
  
  /**
-diff -urNp linux-3.1.3/arch/x86/include/asm/boot.h linux-3.1.3/arch/x86/include/asm/boot.h
---- linux-3.1.3/arch/x86/include/asm/boot.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/boot.h    2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/include/asm/boot.h b/arch/x86/include/asm/boot.h
+index 5e1a2ee..c9f9533 100644
+--- a/arch/x86/include/asm/boot.h
++++ b/arch/x86/include/asm/boot.h
 @@ -11,10 +11,15 @@
  #include <asm/pgtable_types.h>
  
@@ -7013,21 +8028,10 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/boot.h linux-3.1.3/arch/x86/include/
  /* Minimum kernel alignment, as a power of two */
  #ifdef CONFIG_X86_64
  #define MIN_KERNEL_ALIGN_LG2  PMD_SHIFT
-diff -urNp linux-3.1.3/arch/x86/include/asm/cacheflush.h linux-3.1.3/arch/x86/include/asm/cacheflush.h
---- linux-3.1.3/arch/x86/include/asm/cacheflush.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/cacheflush.h      2011-11-16 18:39:07.000000000 -0500
-@@ -26,7 +26,7 @@ static inline unsigned long get_page_mem
-       unsigned long pg_flags = pg->flags & _PGMT_MASK;
-       if (pg_flags == _PGMT_DEFAULT)
--              return -1;
-+              return ~0UL;
-       else if (pg_flags == _PGMT_WC)
-               return _PAGE_CACHE_WC;
-       else if (pg_flags == _PGMT_UC_MINUS)
-diff -urNp linux-3.1.3/arch/x86/include/asm/cache.h linux-3.1.3/arch/x86/include/asm/cache.h
---- linux-3.1.3/arch/x86/include/asm/cache.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/cache.h   2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/include/asm/cache.h b/arch/x86/include/asm/cache.h
+index 48f99f1..d78ebf9 100644
+--- a/arch/x86/include/asm/cache.h
++++ b/arch/x86/include/asm/cache.h
 @@ -5,12 +5,13 @@
  
  /* L1 cache line size */
@@ -7044,10 +8048,24 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/cache.h linux-3.1.3/arch/x86/include
  
  #ifdef CONFIG_X86_VSMP
  #ifdef CONFIG_SMP
-diff -urNp linux-3.1.3/arch/x86/include/asm/checksum_32.h linux-3.1.3/arch/x86/include/asm/checksum_32.h
---- linux-3.1.3/arch/x86/include/asm/checksum_32.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/checksum_32.h     2011-11-16 18:39:07.000000000 -0500
-@@ -31,6 +31,14 @@ asmlinkage __wsum csum_partial_copy_gene
+diff --git a/arch/x86/include/asm/cacheflush.h b/arch/x86/include/asm/cacheflush.h
+index 4e12668..501d239 100644
+--- a/arch/x86/include/asm/cacheflush.h
++++ b/arch/x86/include/asm/cacheflush.h
+@@ -26,7 +26,7 @@ static inline unsigned long get_page_memtype(struct page *pg)
+       unsigned long pg_flags = pg->flags & _PGMT_MASK;
+       if (pg_flags == _PGMT_DEFAULT)
+-              return -1;
++              return ~0UL;
+       else if (pg_flags == _PGMT_WC)
+               return _PAGE_CACHE_WC;
+       else if (pg_flags == _PGMT_UC_MINUS)
+diff --git a/arch/x86/include/asm/checksum_32.h b/arch/x86/include/asm/checksum_32.h
+index 46fc474..b02b0f9 100644
+--- a/arch/x86/include/asm/checksum_32.h
++++ b/arch/x86/include/asm/checksum_32.h
+@@ -31,6 +31,14 @@ asmlinkage __wsum csum_partial_copy_generic(const void *src, void *dst,
                                            int len, __wsum sum,
                                            int *src_err_ptr, int *dst_err_ptr);
  
@@ -7062,7 +8080,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/checksum_32.h linux-3.1.3/arch/x86/i
  /*
   *    Note: when you get a NULL pointer exception here this means someone
   *    passed in an incorrect kernel address to one of these functions.
-@@ -50,7 +58,7 @@ static inline __wsum csum_partial_copy_f
+@@ -50,7 +58,7 @@ static inline __wsum csum_partial_copy_from_user(const void __user *src,
                                                 int *err_ptr)
  {
        might_sleep();
@@ -7071,7 +8089,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/checksum_32.h linux-3.1.3/arch/x86/i
                                         len, sum, err_ptr, NULL);
  }
  
-@@ -178,7 +186,7 @@ static inline __wsum csum_and_copy_to_us
+@@ -178,7 +186,7 @@ static inline __wsum csum_and_copy_to_user(const void *src,
  {
        might_sleep();
        if (access_ok(VERIFY_WRITE, dst, len))
@@ -7080,10 +8098,11 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/checksum_32.h linux-3.1.3/arch/x86/i
                                                 len, sum, NULL, err_ptr);
  
        if (len)
-diff -urNp linux-3.1.3/arch/x86/include/asm/cpufeature.h linux-3.1.3/arch/x86/include/asm/cpufeature.h
---- linux-3.1.3/arch/x86/include/asm/cpufeature.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/cpufeature.h      2011-11-16 18:39:07.000000000 -0500
-@@ -358,7 +358,7 @@ static __always_inline __pure bool __sta
+diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
+index 88b23a4..d2e5f9f 100644
+--- a/arch/x86/include/asm/cpufeature.h
++++ b/arch/x86/include/asm/cpufeature.h
+@@ -358,7 +358,7 @@ static __always_inline __pure bool __static_cpu_has(u16 bit)
                             ".section .discard,\"aw\",@progbits\n"
                             " .byte 0xff + (4f-3f) - (2b-1b)\n" /* size check */
                             ".previous\n"
@@ -7092,25 +8111,10 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/cpufeature.h linux-3.1.3/arch/x86/in
                             "3: movb $1,%0\n"
                             "4:\n"
                             ".previous\n"
-diff -urNp linux-3.1.3/arch/x86/include/asm/desc_defs.h linux-3.1.3/arch/x86/include/asm/desc_defs.h
---- linux-3.1.3/arch/x86/include/asm/desc_defs.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/desc_defs.h       2011-11-16 18:39:07.000000000 -0500
-@@ -31,6 +31,12 @@ struct desc_struct {
-                       unsigned base1: 8, type: 4, s: 1, dpl: 2, p: 1;
-                       unsigned limit: 4, avl: 1, l: 1, d: 1, g: 1, base2: 8;
-               };
-+              struct {
-+                      u16 offset_low;
-+                      u16 seg;
-+                      unsigned reserved: 8, type: 4, s: 1, dpl: 2, p: 1;
-+                      unsigned offset_high: 16;
-+              } gate;
-       };
- } __attribute__((packed));
-diff -urNp linux-3.1.3/arch/x86/include/asm/desc.h linux-3.1.3/arch/x86/include/asm/desc.h
---- linux-3.1.3/arch/x86/include/asm/desc.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/desc.h    2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/include/asm/desc.h b/arch/x86/include/asm/desc.h
+index 41935fa..3b40db8 100644
+--- a/arch/x86/include/asm/desc.h
++++ b/arch/x86/include/asm/desc.h
 @@ -4,6 +4,7 @@
  #include <asm/desc_defs.h>
  #include <asm/ldt.h>
@@ -7119,7 +8123,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/desc.h linux-3.1.3/arch/x86/include/
  
  #include <linux/smp.h>
  
-@@ -16,6 +17,7 @@ static inline void fill_ldt(struct desc_
+@@ -16,6 +17,7 @@ static inline void fill_ldt(struct desc_struct *desc, const struct user_desc *in
  
        desc->type              = (info->read_exec_only ^ 1) << 1;
        desc->type             |= info->contents << 2;
@@ -7127,7 +8131,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/desc.h linux-3.1.3/arch/x86/include/
  
        desc->s                 = 1;
        desc->dpl               = 0x3;
-@@ -34,17 +36,12 @@ static inline void fill_ldt(struct desc_
+@@ -34,17 +36,12 @@ static inline void fill_ldt(struct desc_struct *desc, const struct user_desc *in
  }
  
  extern struct desc_ptr idt_descr;
@@ -7148,7 +8152,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/desc.h linux-3.1.3/arch/x86/include/
  }
  
  #ifdef CONFIG_X86_64
-@@ -69,8 +66,14 @@ static inline void pack_gate(gate_desc *
+@@ -69,8 +66,14 @@ static inline void pack_gate(gate_desc *gate, unsigned char type,
                             unsigned long base, unsigned dpl, unsigned flags,
                             unsigned short seg)
  {
@@ -7165,7 +8169,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/desc.h linux-3.1.3/arch/x86/include/
  }
  
  #endif
-@@ -115,12 +118,16 @@ static inline void paravirt_free_ldt(str
+@@ -115,12 +118,16 @@ static inline void paravirt_free_ldt(struct desc_struct *ldt, unsigned entries)
  
  static inline void native_write_idt_entry(gate_desc *idt, int entry, const gate_desc *gate)
  {
@@ -7182,7 +8186,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/desc.h linux-3.1.3/arch/x86/include/
  }
  
  static inline void
-@@ -134,7 +141,9 @@ native_write_gdt_entry(struct desc_struc
+@@ -134,7 +141,9 @@ native_write_gdt_entry(struct desc_struct *gdt, int entry, const void *desc, int
        default:        size = sizeof(*gdt);            break;
        }
  
@@ -7192,7 +8196,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/desc.h linux-3.1.3/arch/x86/include/
  }
  
  static inline void pack_descriptor(struct desc_struct *desc, unsigned long base,
-@@ -207,7 +216,9 @@ static inline void native_set_ldt(const 
+@@ -207,7 +216,9 @@ static inline void native_set_ldt(const void *addr, unsigned int entries)
  
  static inline void native_load_tr_desc(void)
  {
@@ -7202,7 +8206,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/desc.h linux-3.1.3/arch/x86/include/
  }
  
  static inline void native_load_gdt(const struct desc_ptr *dtr)
-@@ -244,8 +255,10 @@ static inline void native_load_tls(struc
+@@ -244,8 +255,10 @@ static inline void native_load_tls(struct thread_struct *t, unsigned int cpu)
        struct desc_struct *gdt = get_cpu_gdt_table(cpu);
        unsigned int i;
  
@@ -7213,7 +8217,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/desc.h linux-3.1.3/arch/x86/include/
  }
  
  #define _LDT_empty(info)                              \
-@@ -307,7 +320,7 @@ static inline void set_desc_limit(struct
+@@ -307,7 +320,7 @@ static inline void set_desc_limit(struct desc_struct *desc, unsigned long limit)
        desc->limit = (limit >> 16) & 0xf;
  }
  
@@ -7222,7 +8226,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/desc.h linux-3.1.3/arch/x86/include/
                             unsigned dpl, unsigned ist, unsigned seg)
  {
        gate_desc s;
-@@ -326,7 +339,7 @@ static inline void _set_gate(int gate, u
+@@ -326,7 +339,7 @@ static inline void _set_gate(int gate, unsigned type, void *addr,
   * Pentium F0 0F bugfix can have resulted in the mapped
   * IDT being write-protected.
   */
@@ -7231,7 +8235,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/desc.h linux-3.1.3/arch/x86/include/
  {
        BUG_ON((unsigned)n > 0xFF);
        _set_gate(n, GATE_INTERRUPT, addr, 0, 0, __KERNEL_CS);
-@@ -356,19 +369,19 @@ static inline void alloc_intr_gate(unsig
+@@ -356,19 +369,19 @@ static inline void alloc_intr_gate(unsigned int n, void *addr)
  /*
   * This routine sets up an interrupt gate at directory privilege level 3.
   */
@@ -7254,7 +8258,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/desc.h linux-3.1.3/arch/x86/include/
  {
        BUG_ON((unsigned)n > 0xFF);
        _set_gate(n, GATE_TRAP, addr, 0, 0, __KERNEL_CS);
-@@ -377,19 +390,31 @@ static inline void set_trap_gate(unsigne
+@@ -377,19 +390,31 @@ static inline void set_trap_gate(unsigned int n, void *addr)
  static inline void set_task_gate(unsigned int n, unsigned int gdt_entry)
  {
        BUG_ON((unsigned)n > 0xFF);
@@ -7289,9 +8293,27 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/desc.h linux-3.1.3/arch/x86/include/
 +#endif
 +
  #endif /* _ASM_X86_DESC_H */
-diff -urNp linux-3.1.3/arch/x86/include/asm/e820.h linux-3.1.3/arch/x86/include/asm/e820.h
---- linux-3.1.3/arch/x86/include/asm/e820.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/e820.h    2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/include/asm/desc_defs.h b/arch/x86/include/asm/desc_defs.h
+index 278441f..b95a174 100644
+--- a/arch/x86/include/asm/desc_defs.h
++++ b/arch/x86/include/asm/desc_defs.h
+@@ -31,6 +31,12 @@ struct desc_struct {
+                       unsigned base1: 8, type: 4, s: 1, dpl: 2, p: 1;
+                       unsigned limit: 4, avl: 1, l: 1, d: 1, g: 1, base2: 8;
+               };
++              struct {
++                      u16 offset_low;
++                      u16 seg;
++                      unsigned reserved: 8, type: 4, s: 1, dpl: 2, p: 1;
++                      unsigned offset_high: 16;
++              } gate;
+       };
+ } __attribute__((packed));
+diff --git a/arch/x86/include/asm/e820.h b/arch/x86/include/asm/e820.h
+index 908b969..a1f4eb4 100644
+--- a/arch/x86/include/asm/e820.h
++++ b/arch/x86/include/asm/e820.h
 @@ -69,7 +69,7 @@ struct e820map {
  #define ISA_START_ADDRESS     0xa0000
  #define ISA_END_ADDRESS               0x100000
@@ -7301,9 +8323,10 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/e820.h linux-3.1.3/arch/x86/include/
  #define BIOS_END              0x00100000
  
  #define BIOS_ROM_BASE         0xffe00000
-diff -urNp linux-3.1.3/arch/x86/include/asm/elf.h linux-3.1.3/arch/x86/include/asm/elf.h
---- linux-3.1.3/arch/x86/include/asm/elf.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/elf.h     2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h
+index f2ad216..eb24c96 100644
+--- a/arch/x86/include/asm/elf.h
++++ b/arch/x86/include/asm/elf.h
 @@ -237,7 +237,25 @@ extern int force_personality32;
     the loader.  We need to make sure that it is out of the way of the program
     that it will "exec", and that there is sufficient room for the brk.  */
@@ -7350,7 +8373,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/elf.h linux-3.1.3/arch/x86/include/a
  
  #define VDSO_ENTRY                                                    \
        ((unsigned long)VDSO32_SYMBOL(VDSO_CURRENT_BASE, vsyscall))
-@@ -317,7 +333,4 @@ extern int arch_setup_additional_pages(s
+@@ -317,7 +333,4 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm,
  extern int syscall32_setup_pages(struct linux_binprm *, int exstack);
  #define compat_arch_setup_additional_pages    syscall32_setup_pages
  
@@ -7358,9 +8381,10 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/elf.h linux-3.1.3/arch/x86/include/a
 -#define arch_randomize_brk arch_randomize_brk
 -
  #endif /* _ASM_X86_ELF_H */
-diff -urNp linux-3.1.3/arch/x86/include/asm/emergency-restart.h linux-3.1.3/arch/x86/include/asm/emergency-restart.h
---- linux-3.1.3/arch/x86/include/asm/emergency-restart.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/emergency-restart.h       2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/include/asm/emergency-restart.h b/arch/x86/include/asm/emergency-restart.h
+index cc70c1c..d96d011 100644
+--- a/arch/x86/include/asm/emergency-restart.h
++++ b/arch/x86/include/asm/emergency-restart.h
 @@ -15,6 +15,6 @@ enum reboot_type {
  
  extern enum reboot_type reboot_type;
@@ -7369,9 +8393,10 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/emergency-restart.h linux-3.1.3/arch
 +extern void machine_emergency_restart(void) __noreturn;
  
  #endif /* _ASM_X86_EMERGENCY_RESTART_H */
-diff -urNp linux-3.1.3/arch/x86/include/asm/futex.h linux-3.1.3/arch/x86/include/asm/futex.h
---- linux-3.1.3/arch/x86/include/asm/futex.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/futex.h   2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/include/asm/futex.h b/arch/x86/include/asm/futex.h
+index d09bb03..4ea4194 100644
+--- a/arch/x86/include/asm/futex.h
++++ b/arch/x86/include/asm/futex.h
 @@ -12,16 +12,18 @@
  #include <asm/system.h>
  
@@ -7401,7 +8426,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/futex.h linux-3.1.3/arch/x86/include
                     : "r" (oparg), "i" (-EFAULT), "1" (0))
  
  static inline int futex_atomic_op_inuser(int encoded_op, u32 __user *uaddr)
-@@ -61,10 +63,10 @@ static inline int futex_atomic_op_inuser
+@@ -61,10 +63,10 @@ static inline int futex_atomic_op_inuser(int encoded_op, u32 __user *uaddr)
  
        switch (op) {
        case FUTEX_OP_SET:
@@ -7414,7 +8439,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/futex.h linux-3.1.3/arch/x86/include
                                   uaddr, oparg);
                break;
        case FUTEX_OP_OR:
-@@ -123,13 +125,13 @@ static inline int futex_atomic_cmpxchg_i
+@@ -123,13 +125,13 @@ static inline int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
        if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
                return -EFAULT;
  
@@ -7430,9 +8455,10 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/futex.h linux-3.1.3/arch/x86/include
                     : "i" (-EFAULT), "r" (newval), "1" (oldval)
                     : "memory"
        );
-diff -urNp linux-3.1.3/arch/x86/include/asm/hw_irq.h linux-3.1.3/arch/x86/include/asm/hw_irq.h
---- linux-3.1.3/arch/x86/include/asm/hw_irq.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/hw_irq.h  2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h
+index 0919905..2cf38d6 100644
+--- a/arch/x86/include/asm/hw_irq.h
++++ b/arch/x86/include/asm/hw_irq.h
 @@ -136,8 +136,8 @@ extern void setup_ioapic_dest(void);
  extern void enable_IO_APIC(void);
  
@@ -7444,10 +8470,11 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/hw_irq.h linux-3.1.3/arch/x86/includ
  
  /* EISA */
  extern void eisa_set_level_irq(unsigned int irq);
-diff -urNp linux-3.1.3/arch/x86/include/asm/i387.h linux-3.1.3/arch/x86/include/asm/i387.h
---- linux-3.1.3/arch/x86/include/asm/i387.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/i387.h    2011-11-16 18:39:07.000000000 -0500
-@@ -92,6 +92,11 @@ static inline int fxrstor_checking(struc
+diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
+index c9e09ea..73888df 100644
+--- a/arch/x86/include/asm/i387.h
++++ b/arch/x86/include/asm/i387.h
+@@ -92,6 +92,11 @@ static inline int fxrstor_checking(struct i387_fxsave_struct *fx)
  {
        int err;
  
@@ -7459,7 +8486,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/i387.h linux-3.1.3/arch/x86/include/
        /* See comment in fxsave() below. */
  #ifdef CONFIG_AS_FXSAVEQ
        asm volatile("1:  fxrstorq %[fx]\n\t"
-@@ -121,6 +126,11 @@ static inline int fxsave_user(struct i38
+@@ -121,6 +126,11 @@ static inline int fxsave_user(struct i387_fxsave_struct __user *fx)
  {
        int err;
  
@@ -7471,7 +8498,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/i387.h linux-3.1.3/arch/x86/include/
        /*
         * Clear the bytes not touched by the fxsave and reserved
         * for the SW usage.
-@@ -213,13 +223,8 @@ static inline void fpu_fxsave(struct fpu
+@@ -213,13 +223,8 @@ static inline void fpu_fxsave(struct fpu *fpu)
  #endif        /* CONFIG_X86_64 */
  
  /* We need a safe address that is cheap to find and that is already
@@ -7487,7 +8514,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/i387.h linux-3.1.3/arch/x86/include/
  
  /*
   * These must be called with preempt disabled
-@@ -312,7 +317,7 @@ static inline void kernel_fpu_begin(void
+@@ -312,7 +317,7 @@ static inline void kernel_fpu_begin(void)
        struct thread_info *me = current_thread_info();
        preempt_disable();
        if (me->status & TS_USEDFPU)
@@ -7496,9 +8523,10 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/i387.h linux-3.1.3/arch/x86/include/
        else
                clts();
  }
-diff -urNp linux-3.1.3/arch/x86/include/asm/io.h linux-3.1.3/arch/x86/include/asm/io.h
---- linux-3.1.3/arch/x86/include/asm/io.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/io.h      2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
+index d8e8eef..99f81ae 100644
+--- a/arch/x86/include/asm/io.h
++++ b/arch/x86/include/asm/io.h
 @@ -194,6 +194,17 @@ extern void set_iounmap_nonlazy(void);
  
  #include <linux/vmalloc.h>
@@ -7517,10 +8545,11 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/io.h linux-3.1.3/arch/x86/include/as
  /*
   * Convert a virtual cached pointer to an uncached pointer
   */
-diff -urNp linux-3.1.3/arch/x86/include/asm/irqflags.h linux-3.1.3/arch/x86/include/asm/irqflags.h
---- linux-3.1.3/arch/x86/include/asm/irqflags.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/irqflags.h        2011-11-16 18:39:07.000000000 -0500
-@@ -141,6 +141,11 @@ static inline notrace unsigned long arch
+diff --git a/arch/x86/include/asm/irqflags.h b/arch/x86/include/asm/irqflags.h
+index bba3cf8..06bc8da 100644
+--- a/arch/x86/include/asm/irqflags.h
++++ b/arch/x86/include/asm/irqflags.h
+@@ -141,6 +141,11 @@ static inline notrace unsigned long arch_local_irq_save(void)
        sti;                                    \
        sysexit
  
@@ -7532,9 +8561,10 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/irqflags.h linux-3.1.3/arch/x86/incl
  #else
  #define INTERRUPT_RETURN              iret
  #define ENABLE_INTERRUPTS_SYSEXIT     sti; sysexit
-diff -urNp linux-3.1.3/arch/x86/include/asm/kprobes.h linux-3.1.3/arch/x86/include/asm/kprobes.h
---- linux-3.1.3/arch/x86/include/asm/kprobes.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/kprobes.h 2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/include/asm/kprobes.h b/arch/x86/include/asm/kprobes.h
+index 5478825..839e88c 100644
+--- a/arch/x86/include/asm/kprobes.h
++++ b/arch/x86/include/asm/kprobes.h
 @@ -37,13 +37,8 @@ typedef u8 kprobe_opcode_t;
  #define RELATIVEJUMP_SIZE 5
  #define RELATIVECALL_OPCODE 0xe8
@@ -7551,9 +8581,10 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/kprobes.h linux-3.1.3/arch/x86/inclu
  
  #define flush_insn_slot(p)    do { } while (0)
  
-diff -urNp linux-3.1.3/arch/x86/include/asm/kvm_host.h linux-3.1.3/arch/x86/include/asm/kvm_host.h
---- linux-3.1.3/arch/x86/include/asm/kvm_host.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/kvm_host.h        2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
+index dd51c83..66cbfac 100644
+--- a/arch/x86/include/asm/kvm_host.h
++++ b/arch/x86/include/asm/kvm_host.h
 @@ -456,7 +456,7 @@ struct kvm_arch {
        unsigned int n_requested_mmu_pages;
        unsigned int n_max_mmu_pages;
@@ -7572,9 +8603,10 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/kvm_host.h linux-3.1.3/arch/x86/incl
  
  struct kvm_arch_async_pf {
        u32 token;
-diff -urNp linux-3.1.3/arch/x86/include/asm/local.h linux-3.1.3/arch/x86/include/asm/local.h
---- linux-3.1.3/arch/x86/include/asm/local.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/local.h   2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/include/asm/local.h b/arch/x86/include/asm/local.h
+index 9cdae5d..300d20f 100644
+--- a/arch/x86/include/asm/local.h
++++ b/arch/x86/include/asm/local.h
 @@ -18,26 +18,58 @@ typedef struct {
  
  static inline void local_inc(local_t *l)
@@ -7638,7 +8670,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/local.h linux-3.1.3/arch/x86/include
                     : "+m" (l->a.counter)
                     : "ir" (i));
  }
-@@ -55,7 +87,16 @@ static inline int local_sub_and_test(lon
+@@ -55,7 +87,16 @@ static inline int local_sub_and_test(long i, local_t *l)
  {
        unsigned char c;
  
@@ -7656,7 +8688,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/local.h linux-3.1.3/arch/x86/include
                     : "+m" (l->a.counter), "=qm" (c)
                     : "ir" (i) : "memory");
        return c;
-@@ -73,7 +114,16 @@ static inline int local_dec_and_test(loc
+@@ -73,7 +114,16 @@ static inline int local_dec_and_test(local_t *l)
  {
        unsigned char c;
  
@@ -7674,7 +8706,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/local.h linux-3.1.3/arch/x86/include
                     : "+m" (l->a.counter), "=qm" (c)
                     : : "memory");
        return c != 0;
-@@ -91,7 +141,16 @@ static inline int local_inc_and_test(loc
+@@ -91,7 +141,16 @@ static inline int local_inc_and_test(local_t *l)
  {
        unsigned char c;
  
@@ -7692,7 +8724,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/local.h linux-3.1.3/arch/x86/include
                     : "+m" (l->a.counter), "=qm" (c)
                     : : "memory");
        return c != 0;
-@@ -110,7 +169,16 @@ static inline int local_add_negative(lon
+@@ -110,7 +169,16 @@ static inline int local_add_negative(long i, local_t *l)
  {
        unsigned char c;
  
@@ -7710,7 +8742,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/local.h linux-3.1.3/arch/x86/include
                     : "+m" (l->a.counter), "=qm" (c)
                     : "ir" (i) : "memory");
        return c;
-@@ -133,7 +201,15 @@ static inline long local_add_return(long
+@@ -133,7 +201,15 @@ static inline long local_add_return(long i, local_t *l)
  #endif
        /* Modern 486+ processor */
        __i = i;
@@ -7727,9 +8759,10 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/local.h linux-3.1.3/arch/x86/include
                     : "+r" (i), "+m" (l->a.counter)
                     : : "memory");
        return i + __i;
-diff -urNp linux-3.1.3/arch/x86/include/asm/mman.h linux-3.1.3/arch/x86/include/asm/mman.h
---- linux-3.1.3/arch/x86/include/asm/mman.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/mman.h    2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/include/asm/mman.h b/arch/x86/include/asm/mman.h
+index 593e51d..fa69c9a 100644
+--- a/arch/x86/include/asm/mman.h
++++ b/arch/x86/include/asm/mman.h
 @@ -5,4 +5,14 @@
  
  #include <asm-generic/mman.h>
@@ -7745,10 +8778,45 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/mman.h linux-3.1.3/arch/x86/include/
 +#endif
 +
  #endif /* _ASM_X86_MMAN_H */
-diff -urNp linux-3.1.3/arch/x86/include/asm/mmu_context.h linux-3.1.3/arch/x86/include/asm/mmu_context.h
---- linux-3.1.3/arch/x86/include/asm/mmu_context.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/mmu_context.h     2011-11-16 18:39:07.000000000 -0500
-@@ -24,6 +24,18 @@ void destroy_context(struct mm_struct *m
+diff --git a/arch/x86/include/asm/mmu.h b/arch/x86/include/asm/mmu.h
+index 5f55e69..e20bfb1 100644
+--- a/arch/x86/include/asm/mmu.h
++++ b/arch/x86/include/asm/mmu.h
+@@ -9,7 +9,7 @@
+  * we put the segment information here.
+  */
+ typedef struct {
+-      void *ldt;
++      struct desc_struct *ldt;
+       int size;
+ #ifdef CONFIG_X86_64
+@@ -18,7 +18,19 @@ typedef struct {
+ #endif
+       struct mutex lock;
+-      void *vdso;
++      unsigned long vdso;
++
++#ifdef CONFIG_X86_32
++#if defined(CONFIG_PAX_PAGEEXEC) || defined(CONFIG_PAX_SEGMEXEC)
++      unsigned long user_cs_base;
++      unsigned long user_cs_limit;
++
++#if defined(CONFIG_PAX_PAGEEXEC) && defined(CONFIG_SMP)
++      cpumask_t cpu_user_cs_mask;
++#endif
++
++#endif
++#endif
+ } mm_context_t;
+ #ifdef CONFIG_SMP
+diff --git a/arch/x86/include/asm/mmu_context.h b/arch/x86/include/asm/mmu_context.h
+index 6902152..399f3a2 100644
+--- a/arch/x86/include/asm/mmu_context.h
++++ b/arch/x86/include/asm/mmu_context.h
+@@ -24,6 +24,18 @@ void destroy_context(struct mm_struct *mm);
  
  static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
  {
@@ -7767,7 +8835,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/mmu_context.h linux-3.1.3/arch/x86/i
  #ifdef CONFIG_SMP
        if (percpu_read(cpu_tlbstate.state) == TLBSTATE_OK)
                percpu_write(cpu_tlbstate.state, TLBSTATE_LAZY);
-@@ -34,16 +46,30 @@ static inline void switch_mm(struct mm_s
+@@ -34,16 +46,30 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
                             struct task_struct *tsk)
  {
        unsigned cpu = smp_processor_id();
@@ -7798,7 +8866,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/mmu_context.h linux-3.1.3/arch/x86/i
  
                /* stop flush ipis for the previous mm */
                cpumask_clear_cpu(cpu, mm_cpumask(prev));
-@@ -53,9 +79,38 @@ static inline void switch_mm(struct mm_s
+@@ -53,9 +79,38 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
                 */
                if (unlikely(prev->context.ldt != next->context.ldt))
                        load_LDT_nolock(&next->context);
@@ -7838,7 +8906,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/mmu_context.h linux-3.1.3/arch/x86/i
                percpu_write(cpu_tlbstate.state, TLBSTATE_OK);
                BUG_ON(percpu_read(cpu_tlbstate.active_mm) != next);
  
-@@ -64,11 +119,28 @@ static inline void switch_mm(struct mm_s
+@@ -64,11 +119,28 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
                         * tlb flush IPI delivery. We must reload CR3
                         * to make sure to use no freed page tables.
                         */
@@ -7862,48 +8930,16 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/mmu_context.h linux-3.1.3/arch/x86/i
 +#endif
 +
                }
--      }
- #endif
-+      }
++#endif
+       }
+-#endif
  }
  
  #define activate_mm(prev, next)                       \
-diff -urNp linux-3.1.3/arch/x86/include/asm/mmu.h linux-3.1.3/arch/x86/include/asm/mmu.h
---- linux-3.1.3/arch/x86/include/asm/mmu.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/mmu.h     2011-11-16 18:39:07.000000000 -0500
-@@ -9,7 +9,7 @@
-  * we put the segment information here.
-  */
- typedef struct {
--      void *ldt;
-+      struct desc_struct *ldt;
-       int size;
- #ifdef CONFIG_X86_64
-@@ -18,7 +18,19 @@ typedef struct {
- #endif
-       struct mutex lock;
--      void *vdso;
-+      unsigned long vdso;
-+
-+#ifdef CONFIG_X86_32
-+#if defined(CONFIG_PAX_PAGEEXEC) || defined(CONFIG_PAX_SEGMEXEC)
-+      unsigned long user_cs_base;
-+      unsigned long user_cs_limit;
-+
-+#if defined(CONFIG_PAX_PAGEEXEC) && defined(CONFIG_SMP)
-+      cpumask_t cpu_user_cs_mask;
-+#endif
-+
-+#endif
-+#endif
- } mm_context_t;
- #ifdef CONFIG_SMP
-diff -urNp linux-3.1.3/arch/x86/include/asm/module.h linux-3.1.3/arch/x86/include/asm/module.h
---- linux-3.1.3/arch/x86/include/asm/module.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/module.h  2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/include/asm/module.h b/arch/x86/include/asm/module.h
+index 9eae775..c914fea 100644
+--- a/arch/x86/include/asm/module.h
++++ b/arch/x86/include/asm/module.h
 @@ -5,6 +5,7 @@
  
  #ifdef CONFIG_X86_64
@@ -7912,14 +8948,16 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/module.h linux-3.1.3/arch/x86/includ
  #elif defined CONFIG_M386
  #define MODULE_PROC_FAMILY "386 "
  #elif defined CONFIG_M486
-@@ -59,8 +60,18 @@
+@@ -59,8 +60,20 @@
  #error unknown processor family
  #endif
  
 -#ifdef CONFIG_X86_32
 -# define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY
-+#ifdef CONFIG_PAX_KERNEXEC
-+#define MODULE_PAX_KERNEXEC "KERNEXEC "
++#ifdef CONFIG_PAX_KERNEXEC_PLUGIN_METHOD_BTS
++#define MODULE_PAX_KERNEXEC "KERNEXEC_BTS "
++#elif defined(CONFIG_PAX_KERNEXEC_PLUGIN_METHOD_OR)
++#define MODULE_PAX_KERNEXEC "KERNEXEC_OR "
 +#else
 +#define MODULE_PAX_KERNEXEC ""
  #endif
@@ -7933,9 +8971,10 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/module.h linux-3.1.3/arch/x86/includ
 +#define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY MODULE_PAX_KERNEXEC MODULE_PAX_UDEREF
 +
  #endif /* _ASM_X86_MODULE_H */
-diff -urNp linux-3.1.3/arch/x86/include/asm/page_64_types.h linux-3.1.3/arch/x86/include/asm/page_64_types.h
---- linux-3.1.3/arch/x86/include/asm/page_64_types.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/page_64_types.h   2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/include/asm/page_64_types.h b/arch/x86/include/asm/page_64_types.h
+index 7639dbf..e08a58c 100644
+--- a/arch/x86/include/asm/page_64_types.h
++++ b/arch/x86/include/asm/page_64_types.h
 @@ -56,7 +56,7 @@ void copy_page(void *to, void *from);
  
  /* duplicated to the one in bootmem.h */
@@ -7945,10 +8984,11 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/page_64_types.h linux-3.1.3/arch/x86
  
  extern unsigned long __phys_addr(unsigned long);
  #define __phys_reloc_hide(x)  (x)
-diff -urNp linux-3.1.3/arch/x86/include/asm/paravirt.h linux-3.1.3/arch/x86/include/asm/paravirt.h
---- linux-3.1.3/arch/x86/include/asm/paravirt.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/paravirt.h        2011-11-16 18:39:07.000000000 -0500
-@@ -667,6 +667,18 @@ static inline void set_pgd(pgd_t *pgdp, 
+diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h
+index a7d2db9..edb023e 100644
+--- a/arch/x86/include/asm/paravirt.h
++++ b/arch/x86/include/asm/paravirt.h
+@@ -667,6 +667,18 @@ static inline void set_pgd(pgd_t *pgdp, pgd_t pgd)
                            val);
  }
  
@@ -7967,7 +9007,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/paravirt.h linux-3.1.3/arch/x86/incl
  static inline void pgd_clear(pgd_t *pgdp)
  {
        set_pgd(pgdp, __pgd(0));
-@@ -748,6 +760,21 @@ static inline void __set_fixmap(unsigned
+@@ -748,6 +760,21 @@ static inline void __set_fixmap(unsigned /* enum fixed_addresses */ idx,
        pv_mmu_ops.set_fixmap(idx, phys, flags);
  }
  
@@ -8020,9 +9060,10 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/paravirt.h linux-3.1.3/arch/x86/incl
  #endif        /* CONFIG_X86_32 */
  
  #endif /* __ASSEMBLY__ */
-diff -urNp linux-3.1.3/arch/x86/include/asm/paravirt_types.h linux-3.1.3/arch/x86/include/asm/paravirt_types.h
---- linux-3.1.3/arch/x86/include/asm/paravirt_types.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/paravirt_types.h  2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
+index 8e8b9a4..f07d725 100644
+--- a/arch/x86/include/asm/paravirt_types.h
++++ b/arch/x86/include/asm/paravirt_types.h
 @@ -84,20 +84,20 @@ struct pv_init_ops {
         */
        unsigned (*patch)(u8 type, u16 clobber, void *insnbuf,
@@ -8095,10 +9136,11 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/paravirt_types.h linux-3.1.3/arch/x8
  
  /* This contains all the paravirt structures: we get a convenient
   * number for each function using the offset which we use to indicate
-diff -urNp linux-3.1.3/arch/x86/include/asm/pgalloc.h linux-3.1.3/arch/x86/include/asm/pgalloc.h
---- linux-3.1.3/arch/x86/include/asm/pgalloc.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/pgalloc.h 2011-11-16 18:39:07.000000000 -0500
-@@ -63,6 +63,13 @@ static inline void pmd_populate_kernel(s
+diff --git a/arch/x86/include/asm/pgalloc.h b/arch/x86/include/asm/pgalloc.h
+index b4389a4..b7ff22c 100644
+--- a/arch/x86/include/asm/pgalloc.h
++++ b/arch/x86/include/asm/pgalloc.h
+@@ -63,6 +63,13 @@ static inline void pmd_populate_kernel(struct mm_struct *mm,
                                       pmd_t *pmd, pte_t *pte)
  {
        paravirt_alloc_pte(mm, __pa(pte) >> PAGE_SHIFT);
@@ -8112,10 +9154,11 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/pgalloc.h linux-3.1.3/arch/x86/inclu
        set_pmd(pmd, __pmd(__pa(pte) | _PAGE_TABLE));
  }
  
-diff -urNp linux-3.1.3/arch/x86/include/asm/pgtable-2level.h linux-3.1.3/arch/x86/include/asm/pgtable-2level.h
---- linux-3.1.3/arch/x86/include/asm/pgtable-2level.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/pgtable-2level.h  2011-11-16 18:39:07.000000000 -0500
-@@ -18,7 +18,9 @@ static inline void native_set_pte(pte_t 
+diff --git a/arch/x86/include/asm/pgtable-2level.h b/arch/x86/include/asm/pgtable-2level.h
+index 98391db..8f6984e 100644
+--- a/arch/x86/include/asm/pgtable-2level.h
++++ b/arch/x86/include/asm/pgtable-2level.h
+@@ -18,7 +18,9 @@ static inline void native_set_pte(pte_t *ptep , pte_t pte)
  
  static inline void native_set_pmd(pmd_t *pmdp, pmd_t pmd)
  {
@@ -8125,88 +9168,11 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/pgtable-2level.h linux-3.1.3/arch/x8
  }
  
  static inline void native_set_pte_atomic(pte_t *ptep, pte_t pte)
-diff -urNp linux-3.1.3/arch/x86/include/asm/pgtable_32.h linux-3.1.3/arch/x86/include/asm/pgtable_32.h
---- linux-3.1.3/arch/x86/include/asm/pgtable_32.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/pgtable_32.h      2011-11-16 18:39:07.000000000 -0500
-@@ -25,9 +25,6 @@
- struct mm_struct;
- struct vm_area_struct;
--extern pgd_t swapper_pg_dir[1024];
--extern pgd_t initial_page_table[1024];
--
- static inline void pgtable_cache_init(void) { }
- static inline void check_pgt_cache(void) { }
- void paging_init(void);
-@@ -48,6 +45,12 @@ extern void set_pmd_pfn(unsigned long, u
- # include <asm/pgtable-2level.h>
- #endif
-+extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
-+extern pgd_t initial_page_table[PTRS_PER_PGD];
-+#ifdef CONFIG_X86_PAE
-+extern pmd_t swapper_pm_dir[PTRS_PER_PGD][PTRS_PER_PMD];
-+#endif
-+
- #if defined(CONFIG_HIGHPTE)
- #define pte_offset_map(dir, address)                                  \
-       ((pte_t *)kmap_atomic(pmd_page(*(dir))) +               \
-@@ -62,7 +65,9 @@ extern void set_pmd_pfn(unsigned long, u
- /* Clear a kernel PTE and flush it from the TLB */
- #define kpte_clear_flush(ptep, vaddr)         \
- do {                                          \
-+      pax_open_kernel();                      \
-       pte_clear(&init_mm, (vaddr), (ptep));   \
-+      pax_close_kernel();                     \
-       __flush_tlb_one((vaddr));               \
- } while (0)
-@@ -74,6 +79,9 @@ do {                                         \
- #endif /* !__ASSEMBLY__ */
-+#define HAVE_ARCH_UNMAPPED_AREA
-+#define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN
-+
- /*
-  * kern_addr_valid() is (1) for FLATMEM and (0) for
-  * SPARSEMEM and DISCONTIGMEM
-diff -urNp linux-3.1.3/arch/x86/include/asm/pgtable_32_types.h linux-3.1.3/arch/x86/include/asm/pgtable_32_types.h
---- linux-3.1.3/arch/x86/include/asm/pgtable_32_types.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/pgtable_32_types.h        2011-11-16 18:39:07.000000000 -0500
-@@ -8,7 +8,7 @@
-  */
- #ifdef CONFIG_X86_PAE
- # include <asm/pgtable-3level_types.h>
--# define PMD_SIZE     (1UL << PMD_SHIFT)
-+# define PMD_SIZE     (_AC(1, UL) << PMD_SHIFT)
- # define PMD_MASK     (~(PMD_SIZE - 1))
- #else
- # include <asm/pgtable-2level_types.h>
-@@ -46,6 +46,19 @@ extern bool __vmalloc_start_set; /* set 
- # define VMALLOC_END  (FIXADDR_START - 2 * PAGE_SIZE)
- #endif
-+#ifdef CONFIG_PAX_KERNEXEC
-+#ifndef __ASSEMBLY__
-+extern unsigned char MODULES_EXEC_VADDR[];
-+extern unsigned char MODULES_EXEC_END[];
-+#endif
-+#include <asm/boot.h>
-+#define ktla_ktva(addr)               (addr + LOAD_PHYSICAL_ADDR + PAGE_OFFSET)
-+#define ktva_ktla(addr)               (addr - LOAD_PHYSICAL_ADDR - PAGE_OFFSET)
-+#else
-+#define ktla_ktva(addr)               (addr)
-+#define ktva_ktla(addr)               (addr)
-+#endif
-+
- #define MODULES_VADDR VMALLOC_START
- #define MODULES_END   VMALLOC_END
- #define MODULES_LEN   (MODULES_VADDR - MODULES_END)
-diff -urNp linux-3.1.3/arch/x86/include/asm/pgtable-3level.h linux-3.1.3/arch/x86/include/asm/pgtable-3level.h
---- linux-3.1.3/arch/x86/include/asm/pgtable-3level.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/pgtable-3level.h  2011-11-16 18:39:07.000000000 -0500
-@@ -38,12 +38,16 @@ static inline void native_set_pte_atomic
+diff --git a/arch/x86/include/asm/pgtable-3level.h b/arch/x86/include/asm/pgtable-3level.h
+index effff47..f9e4035 100644
+--- a/arch/x86/include/asm/pgtable-3level.h
++++ b/arch/x86/include/asm/pgtable-3level.h
+@@ -38,12 +38,16 @@ static inline void native_set_pte_atomic(pte_t *ptep, pte_t pte)
  
  static inline void native_set_pmd(pmd_t *pmdp, pmd_t pmd)
  {
@@ -8223,67 +9189,11 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/pgtable-3level.h linux-3.1.3/arch/x8
  }
  
  /*
-diff -urNp linux-3.1.3/arch/x86/include/asm/pgtable_64.h linux-3.1.3/arch/x86/include/asm/pgtable_64.h
---- linux-3.1.3/arch/x86/include/asm/pgtable_64.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/pgtable_64.h      2011-11-16 18:39:07.000000000 -0500
-@@ -16,10 +16,13 @@
- extern pud_t level3_kernel_pgt[512];
- extern pud_t level3_ident_pgt[512];
-+extern pud_t level3_vmalloc_pgt[512];
-+extern pud_t level3_vmemmap_pgt[512];
-+extern pud_t level2_vmemmap_pgt[512];
- extern pmd_t level2_kernel_pgt[512];
- extern pmd_t level2_fixmap_pgt[512];
--extern pmd_t level2_ident_pgt[512];
--extern pgd_t init_level4_pgt[];
-+extern pmd_t level2_ident_pgt[512*2];
-+extern pgd_t init_level4_pgt[512];
- #define swapper_pg_dir init_level4_pgt
-@@ -61,7 +64,9 @@ static inline void native_set_pte_atomic
- static inline void native_set_pmd(pmd_t *pmdp, pmd_t pmd)
- {
-+      pax_open_kernel();
-       *pmdp = pmd;
-+      pax_close_kernel();
- }
- static inline void native_pmd_clear(pmd_t *pmd)
-@@ -107,6 +112,13 @@ static inline void native_pud_clear(pud_
- static inline void native_set_pgd(pgd_t *pgdp, pgd_t pgd)
- {
-+      pax_open_kernel();
-+      *pgdp = pgd;
-+      pax_close_kernel();
-+}
-+
-+static inline void native_set_pgd_batched(pgd_t *pgdp, pgd_t pgd)
-+{
-       *pgdp = pgd;
- }
-diff -urNp linux-3.1.3/arch/x86/include/asm/pgtable_64_types.h linux-3.1.3/arch/x86/include/asm/pgtable_64_types.h
---- linux-3.1.3/arch/x86/include/asm/pgtable_64_types.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/pgtable_64_types.h        2011-11-16 18:39:07.000000000 -0500
-@@ -59,5 +59,10 @@ typedef struct { pteval_t pte; } pte_t;
- #define MODULES_VADDR    _AC(0xffffffffa0000000, UL)
- #define MODULES_END      _AC(0xffffffffff000000, UL)
- #define MODULES_LEN   (MODULES_END - MODULES_VADDR)
-+#define MODULES_EXEC_VADDR MODULES_VADDR
-+#define MODULES_EXEC_END MODULES_END
-+
-+#define ktla_ktva(addr)               (addr)
-+#define ktva_ktla(addr)               (addr)
- #endif /* _ASM_X86_PGTABLE_64_DEFS_H */
-diff -urNp linux-3.1.3/arch/x86/include/asm/pgtable.h linux-3.1.3/arch/x86/include/asm/pgtable.h
---- linux-3.1.3/arch/x86/include/asm/pgtable.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/pgtable.h 2011-11-16 18:39:07.000000000 -0500
-@@ -44,6 +44,7 @@ extern struct mm_struct *pgd_page_get_mm
+diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
+index 18601c8..3d716d1 100644
+--- a/arch/x86/include/asm/pgtable.h
++++ b/arch/x86/include/asm/pgtable.h
+@@ -44,6 +44,7 @@ extern struct mm_struct *pgd_page_get_mm(struct page *page);
  
  #ifndef __PAGETABLE_PUD_FOLDED
  #define set_pgd(pgdp, pgd)            native_set_pgd(pgdp, pgd)
@@ -8291,7 +9201,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/pgtable.h linux-3.1.3/arch/x86/inclu
  #define pgd_clear(pgd)                        native_pgd_clear(pgd)
  #endif
  
-@@ -81,12 +82,51 @@ extern struct mm_struct *pgd_page_get_mm
+@@ -81,12 +82,51 @@ extern struct mm_struct *pgd_page_get_mm(struct page *page);
  
  #define arch_end_context_switch(prev) do {} while(0)
  
@@ -8343,7 +9253,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/pgtable.h linux-3.1.3/arch/x86/inclu
  static inline int pte_dirty(pte_t pte)
  {
        return pte_flags(pte) & _PAGE_DIRTY;
-@@ -196,9 +236,29 @@ static inline pte_t pte_wrprotect(pte_t 
+@@ -196,9 +236,29 @@ static inline pte_t pte_wrprotect(pte_t pte)
        return pte_clear_flags(pte, _PAGE_RW);
  }
  
@@ -8374,7 +9284,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/pgtable.h linux-3.1.3/arch/x86/inclu
  }
  
  static inline pte_t pte_mkdirty(pte_t pte)
-@@ -390,6 +450,15 @@ pte_t *populate_extra_pte(unsigned long 
+@@ -390,6 +450,15 @@ pte_t *populate_extra_pte(unsigned long vaddr);
  #endif
  
  #ifndef __ASSEMBLY__
@@ -8390,7 +9300,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/pgtable.h linux-3.1.3/arch/x86/inclu
  #include <linux/mm_types.h>
  
  static inline int pte_none(pte_t pte)
-@@ -560,7 +629,7 @@ static inline pud_t *pud_offset(pgd_t *p
+@@ -560,7 +629,7 @@ static inline pud_t *pud_offset(pgd_t *pgd, unsigned long address)
  
  static inline int pgd_bad(pgd_t pgd)
  {
@@ -8434,7 +9344,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/pgtable.h linux-3.1.3/arch/x86/inclu
  #ifndef __ASSEMBLY__
  
  extern int direct_gbpages;
-@@ -758,11 +846,23 @@ static inline void pmdp_set_wrprotect(st
+@@ -758,11 +846,23 @@ static inline void pmdp_set_wrprotect(struct mm_struct *mm,
   * dst and src can be on the same page, but the range must not overlap,
   * and must not cross a page boundary.
   */
@@ -8460,9 +9370,150 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/pgtable.h linux-3.1.3/arch/x86/inclu
  
  #include <asm-generic/pgtable.h>
  #endif        /* __ASSEMBLY__ */
-diff -urNp linux-3.1.3/arch/x86/include/asm/pgtable_types.h linux-3.1.3/arch/x86/include/asm/pgtable_types.h
---- linux-3.1.3/arch/x86/include/asm/pgtable_types.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/pgtable_types.h   2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/include/asm/pgtable_32.h b/arch/x86/include/asm/pgtable_32.h
+index 0c92113..34a77c6 100644
+--- a/arch/x86/include/asm/pgtable_32.h
++++ b/arch/x86/include/asm/pgtable_32.h
+@@ -25,9 +25,6 @@
+ struct mm_struct;
+ struct vm_area_struct;
+-extern pgd_t swapper_pg_dir[1024];
+-extern pgd_t initial_page_table[1024];
+-
+ static inline void pgtable_cache_init(void) { }
+ static inline void check_pgt_cache(void) { }
+ void paging_init(void);
+@@ -48,6 +45,12 @@ extern void set_pmd_pfn(unsigned long, unsigned long, pgprot_t);
+ # include <asm/pgtable-2level.h>
+ #endif
++extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
++extern pgd_t initial_page_table[PTRS_PER_PGD];
++#ifdef CONFIG_X86_PAE
++extern pmd_t swapper_pm_dir[PTRS_PER_PGD][PTRS_PER_PMD];
++#endif
++
+ #if defined(CONFIG_HIGHPTE)
+ #define pte_offset_map(dir, address)                                  \
+       ((pte_t *)kmap_atomic(pmd_page(*(dir))) +               \
+@@ -62,7 +65,9 @@ extern void set_pmd_pfn(unsigned long, unsigned long, pgprot_t);
+ /* Clear a kernel PTE and flush it from the TLB */
+ #define kpte_clear_flush(ptep, vaddr)         \
+ do {                                          \
++      pax_open_kernel();                      \
+       pte_clear(&init_mm, (vaddr), (ptep));   \
++      pax_close_kernel();                     \
+       __flush_tlb_one((vaddr));               \
+ } while (0)
+@@ -74,6 +79,9 @@ do {                                         \
+ #endif /* !__ASSEMBLY__ */
++#define HAVE_ARCH_UNMAPPED_AREA
++#define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN
++
+ /*
+  * kern_addr_valid() is (1) for FLATMEM and (0) for
+  * SPARSEMEM and DISCONTIGMEM
+diff --git a/arch/x86/include/asm/pgtable_32_types.h b/arch/x86/include/asm/pgtable_32_types.h
+index ed5903b..c7fe163 100644
+--- a/arch/x86/include/asm/pgtable_32_types.h
++++ b/arch/x86/include/asm/pgtable_32_types.h
+@@ -8,7 +8,7 @@
+  */
+ #ifdef CONFIG_X86_PAE
+ # include <asm/pgtable-3level_types.h>
+-# define PMD_SIZE     (1UL << PMD_SHIFT)
++# define PMD_SIZE     (_AC(1, UL) << PMD_SHIFT)
+ # define PMD_MASK     (~(PMD_SIZE - 1))
+ #else
+ # include <asm/pgtable-2level_types.h>
+@@ -46,6 +46,19 @@ extern bool __vmalloc_start_set; /* set once high_memory is set */
+ # define VMALLOC_END  (FIXADDR_START - 2 * PAGE_SIZE)
+ #endif
++#ifdef CONFIG_PAX_KERNEXEC
++#ifndef __ASSEMBLY__
++extern unsigned char MODULES_EXEC_VADDR[];
++extern unsigned char MODULES_EXEC_END[];
++#endif
++#include <asm/boot.h>
++#define ktla_ktva(addr)               (addr + LOAD_PHYSICAL_ADDR + PAGE_OFFSET)
++#define ktva_ktla(addr)               (addr - LOAD_PHYSICAL_ADDR - PAGE_OFFSET)
++#else
++#define ktla_ktva(addr)               (addr)
++#define ktva_ktla(addr)               (addr)
++#endif
++
+ #define MODULES_VADDR VMALLOC_START
+ #define MODULES_END   VMALLOC_END
+ #define MODULES_LEN   (MODULES_VADDR - MODULES_END)
+diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h
+index 975f709..107976d 100644
+--- a/arch/x86/include/asm/pgtable_64.h
++++ b/arch/x86/include/asm/pgtable_64.h
+@@ -16,10 +16,14 @@
+ extern pud_t level3_kernel_pgt[512];
+ extern pud_t level3_ident_pgt[512];
++extern pud_t level3_vmalloc_start_pgt[512];
++extern pud_t level3_vmalloc_end_pgt[512];
++extern pud_t level3_vmemmap_pgt[512];
++extern pud_t level2_vmemmap_pgt[512];
+ extern pmd_t level2_kernel_pgt[512];
+ extern pmd_t level2_fixmap_pgt[512];
+-extern pmd_t level2_ident_pgt[512];
+-extern pgd_t init_level4_pgt[];
++extern pmd_t level2_ident_pgt[512*2];
++extern pgd_t init_level4_pgt[512];
+ #define swapper_pg_dir init_level4_pgt
+@@ -61,7 +65,9 @@ static inline void native_set_pte_atomic(pte_t *ptep, pte_t pte)
+ static inline void native_set_pmd(pmd_t *pmdp, pmd_t pmd)
+ {
++      pax_open_kernel();
+       *pmdp = pmd;
++      pax_close_kernel();
+ }
+ static inline void native_pmd_clear(pmd_t *pmd)
+@@ -107,6 +113,13 @@ static inline void native_pud_clear(pud_t *pud)
+ static inline void native_set_pgd(pgd_t *pgdp, pgd_t pgd)
+ {
++      pax_open_kernel();
++      *pgdp = pgd;
++      pax_close_kernel();
++}
++
++static inline void native_set_pgd_batched(pgd_t *pgdp, pgd_t pgd)
++{
+       *pgdp = pgd;
+ }
+diff --git a/arch/x86/include/asm/pgtable_64_types.h b/arch/x86/include/asm/pgtable_64_types.h
+index 766ea16..5b96cb3 100644
+--- a/arch/x86/include/asm/pgtable_64_types.h
++++ b/arch/x86/include/asm/pgtable_64_types.h
+@@ -59,5 +59,10 @@ typedef struct { pteval_t pte; } pte_t;
+ #define MODULES_VADDR    _AC(0xffffffffa0000000, UL)
+ #define MODULES_END      _AC(0xffffffffff000000, UL)
+ #define MODULES_LEN   (MODULES_END - MODULES_VADDR)
++#define MODULES_EXEC_VADDR MODULES_VADDR
++#define MODULES_EXEC_END MODULES_END
++
++#define ktla_ktva(addr)               (addr)
++#define ktva_ktla(addr)               (addr)
+ #endif /* _ASM_X86_PGTABLE_64_DEFS_H */
+diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h
+index 013286a..8b42f4f 100644
+--- a/arch/x86/include/asm/pgtable_types.h
++++ b/arch/x86/include/asm/pgtable_types.h
 @@ -16,13 +16,12 @@
  #define _PAGE_BIT_PSE         7       /* 4 MB (or 2MB) page */
  #define _PAGE_BIT_PAT         7       /* on 4KB pages */
@@ -8530,7 +9581,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/pgtable_types.h linux-3.1.3/arch/x86
  #define PGD_IDENT_ATTR         0x001          /* PRESENT (no other attributes) */
  #endif
  
-@@ -207,7 +210,17 @@ static inline pgdval_t pgd_flags(pgd_t p
+@@ -207,7 +210,17 @@ static inline pgdval_t pgd_flags(pgd_t pgd)
  {
        return native_pgd_val(pgd) & PTE_FLAGS_MASK;
  }
@@ -8548,7 +9599,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/pgtable_types.h linux-3.1.3/arch/x86
  #if PAGETABLE_LEVELS > 3
  typedef struct { pudval_t pud; } pud_t;
  
-@@ -221,8 +234,6 @@ static inline pudval_t native_pud_val(pu
+@@ -221,8 +234,6 @@ static inline pudval_t native_pud_val(pud_t pud)
        return pud.pud;
  }
  #else
@@ -8557,7 +9608,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/pgtable_types.h linux-3.1.3/arch/x86
  static inline pudval_t native_pud_val(pud_t pud)
  {
        return native_pgd_val(pud.pgd);
-@@ -242,8 +253,6 @@ static inline pmdval_t native_pmd_val(pm
+@@ -242,8 +253,6 @@ static inline pmdval_t native_pmd_val(pmd_t pmd)
        return pmd.pmd;
  }
  #else
@@ -8574,9 +9625,10 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/pgtable_types.h linux-3.1.3/arch/x86
  
  #define pgprot_writecombine   pgprot_writecombine
  extern pgprot_t pgprot_writecombine(pgprot_t prot);
-diff -urNp linux-3.1.3/arch/x86/include/asm/processor.h linux-3.1.3/arch/x86/include/asm/processor.h
---- linux-3.1.3/arch/x86/include/asm/processor.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/processor.h       2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
+index 0d1171c..36571a9 100644
+--- a/arch/x86/include/asm/processor.h
++++ b/arch/x86/include/asm/processor.h
 @@ -266,7 +266,7 @@ struct tss_struct {
  
  } ____cacheline_aligned;
@@ -8586,7 +9638,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/processor.h linux-3.1.3/arch/x86/inc
  
  /*
   * Save the original ist values for checking stack pointers during debugging
-@@ -858,11 +858,18 @@ static inline void spin_lock_prefetch(co
+@@ -858,11 +858,18 @@ static inline void spin_lock_prefetch(const void *x)
   */
  #define TASK_SIZE             PAGE_OFFSET
  #define TASK_SIZE_MAX         TASK_SIZE
@@ -8607,7 +9659,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/processor.h linux-3.1.3/arch/x86/inc
        .vm86_info              = NULL,                                   \
        .sysenter_cs            = __KERNEL_CS,                            \
        .io_bitmap_ptr          = NULL,                                   \
-@@ -876,7 +883,7 @@ static inline void spin_lock_prefetch(co
+@@ -876,7 +883,7 @@ static inline void spin_lock_prefetch(const void *x)
   */
  #define INIT_TSS  {                                                     \
        .x86_tss = {                                                      \
@@ -8616,7 +9668,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/processor.h linux-3.1.3/arch/x86/inc
                .ss0            = __KERNEL_DS,                            \
                .ss1            = __KERNEL_CS,                            \
                .io_bitmap_base = INVALID_IO_BITMAP_OFFSET,               \
-@@ -887,11 +894,7 @@ static inline void spin_lock_prefetch(co
+@@ -887,11 +894,7 @@ static inline void spin_lock_prefetch(const void *x)
  extern unsigned long thread_saved_pc(struct task_struct *tsk);
  
  #define THREAD_SIZE_LONGS      (THREAD_SIZE/sizeof(unsigned long))
@@ -8629,7 +9681,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/processor.h linux-3.1.3/arch/x86/inc
  
  /*
   * The below -8 is to reserve 8 bytes on top of the ring0 stack.
-@@ -906,7 +909,7 @@ extern unsigned long thread_saved_pc(str
+@@ -906,7 +909,7 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
  #define task_pt_regs(task)                                             \
  ({                                                                     \
         struct pt_regs *__regs__;                                       \
@@ -8638,7 +9690,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/processor.h linux-3.1.3/arch/x86/inc
         __regs__ - 1;                                                   \
  })
  
-@@ -916,13 +919,13 @@ extern unsigned long thread_saved_pc(str
+@@ -916,13 +919,13 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
  /*
   * User space process size. 47bits minus one guard page.
   */
@@ -8654,7 +9706,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/processor.h linux-3.1.3/arch/x86/inc
  
  #define TASK_SIZE             (test_thread_flag(TIF_IA32) ? \
                                        IA32_PAGE_OFFSET : TASK_SIZE_MAX)
-@@ -933,11 +936,11 @@ extern unsigned long thread_saved_pc(str
+@@ -933,11 +936,11 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
  #define STACK_TOP_MAX         TASK_SIZE_MAX
  
  #define INIT_THREAD  { \
@@ -8668,7 +9720,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/processor.h linux-3.1.3/arch/x86/inc
  }
  
  /*
-@@ -959,6 +962,10 @@ extern void start_thread(struct pt_regs 
+@@ -959,6 +962,10 @@ extern void start_thread(struct pt_regs *regs, unsigned long new_ip,
   */
  #define TASK_UNMAPPED_BASE    (PAGE_ALIGN(TASK_SIZE / 3))
  
@@ -8679,10 +9731,11 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/processor.h linux-3.1.3/arch/x86/inc
  #define KSTK_EIP(task)                (task_pt_regs(task)->ip)
  
  /* Get/set a process' ability to use the timestamp counter instruction */
-diff -urNp linux-3.1.3/arch/x86/include/asm/ptrace.h linux-3.1.3/arch/x86/include/asm/ptrace.h
---- linux-3.1.3/arch/x86/include/asm/ptrace.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/ptrace.h  2011-11-16 18:39:07.000000000 -0500
-@@ -156,28 +156,29 @@ static inline unsigned long regs_return_
+diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h
+index 3566454..4bdfb8c 100644
+--- a/arch/x86/include/asm/ptrace.h
++++ b/arch/x86/include/asm/ptrace.h
+@@ -156,28 +156,29 @@ static inline unsigned long regs_return_value(struct pt_regs *regs)
  }
  
  /*
@@ -8718,7 +9771,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/ptrace.h linux-3.1.3/arch/x86/includ
  #endif
  }
  
-@@ -193,15 +194,16 @@ static inline int v8086_mode(struct pt_r
+@@ -193,15 +194,16 @@ static inline int v8086_mode(struct pt_regs *regs)
  #ifdef CONFIG_X86_64
  static inline bool user_64bit_mode(struct pt_regs *regs)
  {
@@ -8737,9 +9790,10 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/ptrace.h linux-3.1.3/arch/x86/includ
  #endif
  }
  #endif
-diff -urNp linux-3.1.3/arch/x86/include/asm/reboot.h linux-3.1.3/arch/x86/include/asm/reboot.h
---- linux-3.1.3/arch/x86/include/asm/reboot.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/reboot.h  2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/include/asm/reboot.h b/arch/x86/include/asm/reboot.h
+index 3250e3d..20db631 100644
+--- a/arch/x86/include/asm/reboot.h
++++ b/arch/x86/include/asm/reboot.h
 @@ -6,19 +6,19 @@
  struct pt_regs;
  
@@ -8766,10 +9820,11 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/reboot.h linux-3.1.3/arch/x86/includ
  /* These must match dispatch_table in reboot_32.S */
  #define MRR_BIOS      0
  #define MRR_APM               1
-diff -urNp linux-3.1.3/arch/x86/include/asm/rwsem.h linux-3.1.3/arch/x86/include/asm/rwsem.h
---- linux-3.1.3/arch/x86/include/asm/rwsem.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/rwsem.h   2011-11-16 18:39:07.000000000 -0500
-@@ -64,6 +64,14 @@ static inline void __down_read(struct rw
+diff --git a/arch/x86/include/asm/rwsem.h b/arch/x86/include/asm/rwsem.h
+index df4cd32..27ae072 100644
+--- a/arch/x86/include/asm/rwsem.h
++++ b/arch/x86/include/asm/rwsem.h
+@@ -64,6 +64,14 @@ static inline void __down_read(struct rw_semaphore *sem)
  {
        asm volatile("# beginning down_read\n\t"
                     LOCK_PREFIX _ASM_INC "(%1)\n\t"
@@ -8784,7 +9839,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/rwsem.h linux-3.1.3/arch/x86/include
                     /* adds 0x00000001 */
                     "  jns        1f\n"
                     "  call call_rwsem_down_read_failed\n"
-@@ -85,6 +93,14 @@ static inline int __down_read_trylock(st
+@@ -85,6 +93,14 @@ static inline int __down_read_trylock(struct rw_semaphore *sem)
                     "1:\n\t"
                     "  mov          %1,%2\n\t"
                     "  add          %3,%2\n\t"
@@ -8799,7 +9854,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/rwsem.h linux-3.1.3/arch/x86/include
                     "  jle          2f\n\t"
                     LOCK_PREFIX "  cmpxchg  %2,%0\n\t"
                     "  jnz          1b\n\t"
-@@ -104,6 +120,14 @@ static inline void __down_write_nested(s
+@@ -104,6 +120,14 @@ static inline void __down_write_nested(struct rw_semaphore *sem, int subclass)
        long tmp;
        asm volatile("# beginning down_write\n\t"
                     LOCK_PREFIX "  xadd      %1,(%2)\n\t"
@@ -8814,7 +9869,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/rwsem.h linux-3.1.3/arch/x86/include
                     /* adds 0xffff0001, returns the old value */
                     "  test      %1,%1\n\t"
                     /* was the count 0 before? */
-@@ -141,6 +165,14 @@ static inline void __up_read(struct rw_s
+@@ -141,6 +165,14 @@ static inline void __up_read(struct rw_semaphore *sem)
        long tmp;
        asm volatile("# beginning __up_read\n\t"
                     LOCK_PREFIX "  xadd      %1,(%2)\n\t"
@@ -8829,7 +9884,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/rwsem.h linux-3.1.3/arch/x86/include
                     /* subtracts 1, returns the old value */
                     "  jns        1f\n\t"
                     "  call call_rwsem_wake\n" /* expects old value in %edx */
-@@ -159,6 +191,14 @@ static inline void __up_write(struct rw_
+@@ -159,6 +191,14 @@ static inline void __up_write(struct rw_semaphore *sem)
        long tmp;
        asm volatile("# beginning __up_write\n\t"
                     LOCK_PREFIX "  xadd      %1,(%2)\n\t"
@@ -8844,7 +9899,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/rwsem.h linux-3.1.3/arch/x86/include
                     /* subtracts 0xffff0001, returns the old value */
                     "  jns        1f\n\t"
                     "  call call_rwsem_wake\n" /* expects old value in %edx */
-@@ -176,6 +216,14 @@ static inline void __downgrade_write(str
+@@ -176,6 +216,14 @@ static inline void __downgrade_write(struct rw_semaphore *sem)
  {
        asm volatile("# beginning __downgrade_write\n\t"
                     LOCK_PREFIX _ASM_ADD "%2,(%1)\n\t"
@@ -8859,7 +9914,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/rwsem.h linux-3.1.3/arch/x86/include
                     /*
                      * transitions 0xZZZZ0001 -> 0xYYYY0001 (i386)
                      *     0xZZZZZZZZ00000001 -> 0xYYYYYYYY00000001 (x86_64)
-@@ -194,7 +242,15 @@ static inline void __downgrade_write(str
+@@ -194,7 +242,15 @@ static inline void __downgrade_write(struct rw_semaphore *sem)
   */
  static inline void rwsem_atomic_add(long delta, struct rw_semaphore *sem)
  {
@@ -8876,7 +9931,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/rwsem.h linux-3.1.3/arch/x86/include
                     : "+m" (sem->count)
                     : "er" (delta));
  }
-@@ -206,7 +262,15 @@ static inline long rwsem_atomic_update(l
+@@ -206,7 +262,15 @@ static inline long rwsem_atomic_update(long delta, struct rw_semaphore *sem)
  {
        long tmp = delta;
  
@@ -8893,9 +9948,10 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/rwsem.h linux-3.1.3/arch/x86/include
                     : "+r" (tmp), "+m" (sem->count)
                     : : "memory");
  
-diff -urNp linux-3.1.3/arch/x86/include/asm/segment.h linux-3.1.3/arch/x86/include/asm/segment.h
---- linux-3.1.3/arch/x86/include/asm/segment.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/segment.h 2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/include/asm/segment.h b/arch/x86/include/asm/segment.h
+index 5e64171..f58957e 100644
+--- a/arch/x86/include/asm/segment.h
++++ b/arch/x86/include/asm/segment.h
 @@ -64,10 +64,15 @@
   *  26 - ESPFIX small SS
   *  27 - per-cpu                      [ offset to per-cpu data area ]
@@ -8962,10 +10018,11 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/segment.h linux-3.1.3/arch/x86/inclu
  #define __KERNEL_DS   (GDT_ENTRY_KERNEL_DS*8)
  #define __USER_DS     (GDT_ENTRY_DEFAULT_USER_DS*8+3)
  #define __USER_CS     (GDT_ENTRY_DEFAULT_USER_CS*8+3)
-diff -urNp linux-3.1.3/arch/x86/include/asm/smp.h linux-3.1.3/arch/x86/include/asm/smp.h
---- linux-3.1.3/arch/x86/include/asm/smp.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/smp.h     2011-11-16 18:39:07.000000000 -0500
-@@ -36,7 +36,7 @@ DECLARE_PER_CPU(cpumask_var_t, cpu_core_
+diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
+index 73b11bc..d4a3b63 100644
+--- a/arch/x86/include/asm/smp.h
++++ b/arch/x86/include/asm/smp.h
+@@ -36,7 +36,7 @@ DECLARE_PER_CPU(cpumask_var_t, cpu_core_map);
  /* cpus sharing the last level cache: */
  DECLARE_PER_CPU(cpumask_var_t, cpu_llc_shared_map);
  DECLARE_PER_CPU(u16, cpu_llc_id);
@@ -8983,7 +10040,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/smp.h linux-3.1.3/arch/x86/include/a
  
  /* Globals due to paravirt */
  extern void set_cpu_sibling_map(int cpu);
-@@ -192,14 +192,8 @@ extern unsigned disabled_cpus __cpuinitd
+@@ -192,14 +192,8 @@ extern unsigned disabled_cpus __cpuinitdata;
  extern int safe_smp_processor_id(void);
  
  #elif defined(CONFIG_X86_64_SMP)
@@ -9000,10 +10057,11 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/smp.h linux-3.1.3/arch/x86/include/a
  #define safe_smp_processor_id()               smp_processor_id()
  
  #endif
-diff -urNp linux-3.1.3/arch/x86/include/asm/spinlock.h linux-3.1.3/arch/x86/include/asm/spinlock.h
---- linux-3.1.3/arch/x86/include/asm/spinlock.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/spinlock.h        2011-11-16 18:39:07.000000000 -0500
-@@ -248,6 +248,14 @@ static inline int arch_write_can_lock(ar
+diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h
+index ee67edf..49c796b 100644
+--- a/arch/x86/include/asm/spinlock.h
++++ b/arch/x86/include/asm/spinlock.h
+@@ -248,6 +248,14 @@ static inline int arch_write_can_lock(arch_rwlock_t *lock)
  static inline void arch_read_lock(arch_rwlock_t *rw)
  {
        asm volatile(LOCK_PREFIX READ_LOCK_SIZE(dec) " (%0)\n\t"
@@ -9018,7 +10076,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/spinlock.h linux-3.1.3/arch/x86/incl
                     "jns 1f\n"
                     "call __read_lock_failed\n\t"
                     "1:\n"
-@@ -257,6 +265,14 @@ static inline void arch_read_lock(arch_r
+@@ -257,6 +265,14 @@ static inline void arch_read_lock(arch_rwlock_t *rw)
  static inline void arch_write_lock(arch_rwlock_t *rw)
  {
        asm volatile(LOCK_PREFIX WRITE_LOCK_SUB(%1) "(%0)\n\t"
@@ -9033,7 +10091,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/spinlock.h linux-3.1.3/arch/x86/incl
                     "jz 1f\n"
                     "call __write_lock_failed\n\t"
                     "1:\n"
-@@ -286,13 +302,29 @@ static inline int arch_write_trylock(arc
+@@ -286,13 +302,29 @@ static inline int arch_write_trylock(arch_rwlock_t *lock)
  
  static inline void arch_read_unlock(arch_rwlock_t *rw)
  {
@@ -9065,9 +10123,10 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/spinlock.h linux-3.1.3/arch/x86/incl
                     : "+m" (rw->write) : "i" (RW_LOCK_BIAS) : "memory");
  }
  
-diff -urNp linux-3.1.3/arch/x86/include/asm/stackprotector.h linux-3.1.3/arch/x86/include/asm/stackprotector.h
---- linux-3.1.3/arch/x86/include/asm/stackprotector.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/stackprotector.h  2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/include/asm/stackprotector.h b/arch/x86/include/asm/stackprotector.h
+index 1575177..cb23f52 100644
+--- a/arch/x86/include/asm/stackprotector.h
++++ b/arch/x86/include/asm/stackprotector.h
 @@ -48,7 +48,7 @@
   * head_32 for boot CPU and setup_per_cpu_areas() for others.
   */
@@ -9077,7 +10136,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/stackprotector.h linux-3.1.3/arch/x8
  
  /*
   * Initialize the stackprotector canary value.
-@@ -113,7 +113,7 @@ static inline void setup_stack_canary_se
+@@ -113,7 +113,7 @@ static inline void setup_stack_canary_segment(int cpu)
  
  static inline void load_stack_canary_segment(void)
  {
@@ -9086,9 +10145,10 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/stackprotector.h linux-3.1.3/arch/x8
        asm volatile ("mov %0, %%gs" : : "r" (0));
  #endif
  }
-diff -urNp linux-3.1.3/arch/x86/include/asm/stacktrace.h linux-3.1.3/arch/x86/include/asm/stacktrace.h
---- linux-3.1.3/arch/x86/include/asm/stacktrace.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/stacktrace.h      2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/include/asm/stacktrace.h b/arch/x86/include/asm/stacktrace.h
+index 70bbe39..4ae2bd4 100644
+--- a/arch/x86/include/asm/stacktrace.h
++++ b/arch/x86/include/asm/stacktrace.h
 @@ -11,28 +11,20 @@
  
  extern int kstack_depth_to_print;
@@ -9104,7 +10164,15 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/stacktrace.h linux-3.1.3/arch/x86/in
 -                                    void *data,
 -                                    unsigned long *end,
 -                                    int *graph);
--
++typedef unsigned long walk_stack_t(struct task_struct *task,
++                                 void *stack_start,
++                                 unsigned long *stack,
++                                 unsigned long bp,
++                                 const struct stacktrace_ops *ops,
++                                 void *data,
++                                 unsigned long *end,
++                                 int *graph);
 -extern unsigned long
 -print_context_stack(struct thread_info *tinfo,
 -                  unsigned long *stack, unsigned long bp,
@@ -9116,15 +10184,6 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/stacktrace.h linux-3.1.3/arch/x86/in
 -                     unsigned long *stack, unsigned long bp,
 -                     const struct stacktrace_ops *ops, void *data,
 -                     unsigned long *end, int *graph);
-+typedef unsigned long walk_stack_t(struct task_struct *task,
-+                                 void *stack_start,
-+                                 unsigned long *stack,
-+                                 unsigned long bp,
-+                                 const struct stacktrace_ops *ops,
-+                                 void *data,
-+                                 unsigned long *end,
-+                                 int *graph);
-+
 +extern walk_stack_t print_context_stack;
 +extern walk_stack_t print_context_stack_bp;
  
@@ -9139,10 +10198,11 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/stacktrace.h linux-3.1.3/arch/x86/in
  };
  
  void dump_trace(struct task_struct *tsk, struct pt_regs *regs,
-diff -urNp linux-3.1.3/arch/x86/include/asm/sys_ia32.h linux-3.1.3/arch/x86/include/asm/sys_ia32.h
---- linux-3.1.3/arch/x86/include/asm/sys_ia32.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/sys_ia32.h        2011-11-16 18:39:07.000000000 -0500
-@@ -40,7 +40,7 @@ asmlinkage long sys32_rt_sigprocmask(int
+diff --git a/arch/x86/include/asm/sys_ia32.h b/arch/x86/include/asm/sys_ia32.h
+index cb23852..2dde194 100644
+--- a/arch/x86/include/asm/sys_ia32.h
++++ b/arch/x86/include/asm/sys_ia32.h
+@@ -40,7 +40,7 @@ asmlinkage long sys32_rt_sigprocmask(int, compat_sigset_t __user *,
                                     compat_sigset_t __user *, unsigned int);
  asmlinkage long sys32_alarm(unsigned int);
  
@@ -9151,9 +10211,10 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/sys_ia32.h linux-3.1.3/arch/x86/incl
  asmlinkage long sys32_sysfs(int, u32, u32);
  
  asmlinkage long sys32_sched_rr_get_interval(compat_pid_t,
-diff -urNp linux-3.1.3/arch/x86/include/asm/system.h linux-3.1.3/arch/x86/include/asm/system.h
---- linux-3.1.3/arch/x86/include/asm/system.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/system.h  2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/include/asm/system.h b/arch/x86/include/asm/system.h
+index c2ff2a1..4349184 100644
+--- a/arch/x86/include/asm/system.h
++++ b/arch/x86/include/asm/system.h
 @@ -129,7 +129,7 @@ do {                                                                       \
             "call __switch_to\n\t"                                       \
             "movq "__percpu_arg([current_task])",%%rsi\n\t"              \
@@ -9172,7 +10233,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/system.h linux-3.1.3/arch/x86/includ
               [current_task] "m" (current_task)                          \
               __switch_canary_iparam                                     \
             : "memory", "cc" __EXTRA_CLOBBER)
-@@ -200,7 +200,7 @@ static inline unsigned long get_limit(un
+@@ -200,7 +200,7 @@ static inline unsigned long get_limit(unsigned long segment)
  {
        unsigned long __limit;
        asm("lsll %1,%0" : "=r" (__limit) : "r" (segment));
@@ -9196,9 +10257,10 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/system.h linux-3.1.3/arch/x86/includ
  
  /*
   * Force strict CPU ordering.
-diff -urNp linux-3.1.3/arch/x86/include/asm/thread_info.h linux-3.1.3/arch/x86/include/asm/thread_info.h
---- linux-3.1.3/arch/x86/include/asm/thread_info.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/thread_info.h     2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
+index a1fe5c1..ee326d8 100644
+--- a/arch/x86/include/asm/thread_info.h
++++ b/arch/x86/include/asm/thread_info.h
 @@ -10,6 +10,7 @@
  #include <linux/compiler.h>
  #include <asm/page.h>
@@ -9245,38 +10307,24 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/thread_info.h linux-3.1.3/arch/x86/i
  #define init_stack            (init_thread_union.stack)
  
  #else /* !__ASSEMBLY__ */
-@@ -170,6 +164,23 @@ struct thread_info {
+@@ -170,45 +164,40 @@ struct thread_info {
        ret;                                                            \
  })
  
-+#ifdef __ASSEMBLY__
-+/* how to get the thread information struct from ASM */
-+#define GET_THREAD_INFO(reg)   \
-+      mov PER_CPU_VAR(current_tinfo), reg
-+
-+/* use this one if reg already contains %esp */
-+#define GET_THREAD_INFO_WITH_ESP(reg) GET_THREAD_INFO(reg)
-+#else
-+/* how to get the thread information struct from C */
-+DECLARE_PER_CPU(struct thread_info *, current_tinfo);
-+
-+static __always_inline struct thread_info *current_thread_info(void)
-+{
-+      return percpu_read_stable(current_tinfo);
-+}
-+#endif
-+
- #ifdef CONFIG_X86_32
- #define STACK_WARN    (THREAD_SIZE/8)
-@@ -180,35 +191,13 @@ struct thread_info {
-  */
- #ifndef __ASSEMBLY__
+-#ifdef CONFIG_X86_32
+-
+-#define STACK_WARN    (THREAD_SIZE/8)
+-/*
+- * macros/functions for gaining access to the thread information structure
+- *
+- * preempt_count needs to be 1 initially, until the scheduler is functional.
+- */
+-#ifndef __ASSEMBLY__
+-
+-
+-/* how to get the current stack pointer from C */
+-register unsigned long current_stack_pointer asm("esp") __used;
 -
- /* how to get the current stack pointer from C */
- register unsigned long current_stack_pointer asm("esp") __used;
 -/* how to get the thread information struct from C */
 -static inline struct thread_info *current_thread_info(void)
 -{
@@ -9286,15 +10334,40 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/thread_info.h linux-3.1.3/arch/x86/i
 -
 -#else /* !__ASSEMBLY__ */
 -
--/* how to get the thread information struct from ASM */
--#define GET_THREAD_INFO(reg)   \
++#ifdef __ASSEMBLY__
+ /* how to get the thread information struct from ASM */
+ #define GET_THREAD_INFO(reg)   \
 -      movl $-THREAD_SIZE, reg; \
 -      andl %esp, reg
--
--/* use this one if reg already contains %esp */
++      mov PER_CPU_VAR(current_tinfo), reg
+ /* use this one if reg already contains %esp */
 -#define GET_THREAD_INFO_WITH_ESP(reg) \
 -      andl $-THREAD_SIZE, reg
--
++#define GET_THREAD_INFO_WITH_ESP(reg) GET_THREAD_INFO(reg)
++#else
++/* how to get the thread information struct from C */
++DECLARE_PER_CPU(struct thread_info *, current_tinfo);
++
++static __always_inline struct thread_info *current_thread_info(void)
++{
++      return percpu_read_stable(current_tinfo);
++}
++#endif
++
++#ifdef CONFIG_X86_32
++
++#define STACK_WARN    (THREAD_SIZE/8)
++/*
++ * macros/functions for gaining access to the thread information structure
++ *
++ * preempt_count needs to be 1 initially, until the scheduler is functional.
++ */
++#ifndef __ASSEMBLY__
++
++/* how to get the current stack pointer from C */
++register unsigned long current_stack_pointer asm("esp") __used;
  #endif
  
  #else /* X86_32 */
@@ -9305,7 +10378,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/thread_info.h linux-3.1.3/arch/x86/i
  /*
   * macros/functions for gaining access to the thread information structure
   * preempt_count needs to be 1 initially, until the scheduler is functional.
-@@ -216,21 +205,8 @@ static inline struct thread_info *curren
+@@ -216,21 +205,8 @@ static inline struct thread_info *current_thread_info(void)
  #ifndef __ASSEMBLY__
  DECLARE_PER_CPU(unsigned long, kernel_stack);
  
@@ -9346,10 +10419,234 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/thread_info.h linux-3.1.3/arch/x86/i
 +
  #endif
  #endif /* _ASM_X86_THREAD_INFO_H */
-diff -urNp linux-3.1.3/arch/x86/include/asm/uaccess_32.h linux-3.1.3/arch/x86/include/asm/uaccess_32.h
---- linux-3.1.3/arch/x86/include/asm/uaccess_32.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/uaccess_32.h      2011-11-16 18:40:08.000000000 -0500
-@@ -43,6 +43,11 @@ unsigned long __must_check __copy_from_u
+diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
+index 36361bf..324f262 100644
+--- a/arch/x86/include/asm/uaccess.h
++++ b/arch/x86/include/asm/uaccess.h
+@@ -7,12 +7,15 @@
+ #include <linux/compiler.h>
+ #include <linux/thread_info.h>
+ #include <linux/string.h>
++#include <linux/sched.h>
+ #include <asm/asm.h>
+ #include <asm/page.h>
+ #define VERIFY_READ 0
+ #define VERIFY_WRITE 1
++extern void check_object_size(const void *ptr, unsigned long n, bool to);
++
+ /*
+  * The fs value determines whether argument validity checking should be
+  * performed or not.  If get_fs() == USER_DS, checking is performed, with
+@@ -28,7 +31,12 @@
+ #define get_ds()      (KERNEL_DS)
+ #define get_fs()      (current_thread_info()->addr_limit)
++#if defined(CONFIG_X86_32) && defined(CONFIG_PAX_MEMORY_UDEREF)
++void __set_fs(mm_segment_t x);
++void set_fs(mm_segment_t x);
++#else
+ #define set_fs(x)     (current_thread_info()->addr_limit = (x))
++#endif
+ #define segment_eq(a, b)      ((a).seg == (b).seg)
+@@ -76,7 +84,33 @@
+  * checks that the pointer is in the user space range - after calling
+  * this function, memory access functions may still return -EFAULT.
+  */
+-#define access_ok(type, addr, size) (likely(__range_not_ok(addr, size) == 0))
++#define __access_ok(type, addr, size) (likely(__range_not_ok(addr, size) == 0))
++#define access_ok(type, addr, size)                                   \
++({                                                                    \
++      long __size = size;                                             \
++      unsigned long __addr = (unsigned long)addr;                     \
++      unsigned long __addr_ao = __addr & PAGE_MASK;                   \
++      unsigned long __end_ao = __addr + __size - 1;                   \
++      bool __ret_ao = __range_not_ok(__addr, __size) == 0;            \
++      if (__ret_ao && unlikely((__end_ao ^ __addr_ao) & PAGE_MASK)) { \
++              while(__addr_ao <= __end_ao) {                          \
++                      char __c_ao;                                    \
++                      __addr_ao += PAGE_SIZE;                         \
++                      if (__size > PAGE_SIZE)                         \
++                              cond_resched();                         \
++                      if (__get_user(__c_ao, (char __user *)__addr))  \
++                              break;                                  \
++                      if (type != VERIFY_WRITE) {                     \
++                              __addr = __addr_ao;                     \
++                              continue;                               \
++                      }                                               \
++                      if (__put_user(__c_ao, (char __user *)__addr))  \
++                              break;                                  \
++                      __addr = __addr_ao;                             \
++              }                                                       \
++      }                                                               \
++      __ret_ao;                                                       \
++})
+ /*
+  * The exception table consists of pairs of addresses: the first is the
+@@ -182,12 +216,20 @@ extern int __get_user_bad(void);
+       asm volatile("call __put_user_" #size : "=a" (__ret_pu) \
+                    : "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
+-
++#if defined(CONFIG_X86_32) && defined(CONFIG_PAX_MEMORY_UDEREF)
++#define __copyuser_seg "gs;"
++#define __COPYUSER_SET_ES "pushl %%gs; popl %%es\n"
++#define __COPYUSER_RESTORE_ES "pushl %%ss; popl %%es\n"
++#else
++#define __copyuser_seg
++#define __COPYUSER_SET_ES
++#define __COPYUSER_RESTORE_ES
++#endif
+ #ifdef CONFIG_X86_32
+ #define __put_user_asm_u64(x, addr, err, errret)                      \
+-      asm volatile("1:        movl %%eax,0(%2)\n"                     \
+-                   "2:        movl %%edx,4(%2)\n"                     \
++      asm volatile("1:        "__copyuser_seg"movl %%eax,0(%2)\n"     \
++                   "2:        "__copyuser_seg"movl %%edx,4(%2)\n"     \
+                    "3:\n"                                             \
+                    ".section .fixup,\"ax\"\n"                         \
+                    "4:        movl %3,%0\n"                           \
+@@ -199,8 +241,8 @@ extern int __get_user_bad(void);
+                    : "A" (x), "r" (addr), "i" (errret), "0" (err))
+ #define __put_user_asm_ex_u64(x, addr)                                        \
+-      asm volatile("1:        movl %%eax,0(%1)\n"                     \
+-                   "2:        movl %%edx,4(%1)\n"                     \
++      asm volatile("1:        "__copyuser_seg"movl %%eax,0(%1)\n"     \
++                   "2:        "__copyuser_seg"movl %%edx,4(%1)\n"     \
+                    "3:\n"                                             \
+                    _ASM_EXTABLE(1b, 2b - 1b)                          \
+                    _ASM_EXTABLE(2b, 3b - 2b)                          \
+@@ -252,7 +294,7 @@ extern void __put_user_8(void);
+       __typeof__(*(ptr)) __pu_val;                            \
+       __chk_user_ptr(ptr);                                    \
+       might_fault();                                          \
+-      __pu_val = x;                                           \
++      __pu_val = (x);                                         \
+       switch (sizeof(*(ptr))) {                               \
+       case 1:                                                 \
+               __put_user_x(1, __pu_val, ptr, __ret_pu);       \
+@@ -373,7 +415,7 @@ do {                                                                       \
+ } while (0)
+ #define __get_user_asm(x, addr, err, itype, rtype, ltype, errret)     \
+-      asm volatile("1:        mov"itype" %2,%"rtype"1\n"              \
++      asm volatile("1:        "__copyuser_seg"mov"itype" %2,%"rtype"1\n"\
+                    "2:\n"                                             \
+                    ".section .fixup,\"ax\"\n"                         \
+                    "3:        mov %3,%0\n"                            \
+@@ -381,7 +423,7 @@ do {                                                                       \
+                    "  jmp 2b\n"                                       \
+                    ".previous\n"                                      \
+                    _ASM_EXTABLE(1b, 3b)                               \
+-                   : "=r" (err), ltype(x)                             \
++                   : "=r" (err), ltype (x)                            \
+                    : "m" (__m(addr)), "i" (errret), "0" (err))
+ #define __get_user_size_ex(x, ptr, size)                              \
+@@ -406,7 +448,7 @@ do {                                                                       \
+ } while (0)
+ #define __get_user_asm_ex(x, addr, itype, rtype, ltype)                       \
+-      asm volatile("1:        mov"itype" %1,%"rtype"0\n"              \
++      asm volatile("1:        "__copyuser_seg"mov"itype" %1,%"rtype"0\n"\
+                    "2:\n"                                             \
+                    _ASM_EXTABLE(1b, 2b - 1b)                          \
+                    : ltype(x) : "m" (__m(addr)))
+@@ -423,13 +465,24 @@ do {                                                                     \
+       int __gu_err;                                                   \
+       unsigned long __gu_val;                                         \
+       __get_user_size(__gu_val, (ptr), (size), __gu_err, -EFAULT);    \
+-      (x) = (__force __typeof__(*(ptr)))__gu_val;                     \
++      (x) = (__typeof__(*(ptr)))__gu_val;                             \
+       __gu_err;                                                       \
+ })
+ /* FIXME: this hack is definitely wrong -AK */
+ struct __large_struct { unsigned long buf[100]; };
+-#define __m(x) (*(struct __large_struct __user *)(x))
++#if defined(CONFIG_X86_64) && defined(CONFIG_PAX_MEMORY_UDEREF)
++#define ____m(x)                                      \
++({                                                    \
++      unsigned long ____x = (unsigned long)(x);       \
++      if (____x < PAX_USER_SHADOW_BASE)               \
++              ____x += PAX_USER_SHADOW_BASE;          \
++      (void __user *)____x;                           \
++})
++#else
++#define ____m(x) (x)
++#endif
++#define __m(x) (*(struct __large_struct __user *)____m(x))
+ /*
+  * Tell gcc we read from memory instead of writing: this is because
+@@ -437,7 +490,7 @@ struct __large_struct { unsigned long buf[100]; };
+  * aliasing issues.
+  */
+ #define __put_user_asm(x, addr, err, itype, rtype, ltype, errret)     \
+-      asm volatile("1:        mov"itype" %"rtype"1,%2\n"              \
++      asm volatile("1:        "__copyuser_seg"mov"itype" %"rtype"1,%2\n"\
+                    "2:\n"                                             \
+                    ".section .fixup,\"ax\"\n"                         \
+                    "3:        mov %3,%0\n"                            \
+@@ -445,10 +498,10 @@ struct __large_struct { unsigned long buf[100]; };
+                    ".previous\n"                                      \
+                    _ASM_EXTABLE(1b, 3b)                               \
+                    : "=r"(err)                                        \
+-                   : ltype(x), "m" (__m(addr)), "i" (errret), "0" (err))
++                   : ltype (x), "m" (__m(addr)), "i" (errret), "0" (err))
+ #define __put_user_asm_ex(x, addr, itype, rtype, ltype)                       \
+-      asm volatile("1:        mov"itype" %"rtype"0,%1\n"              \
++      asm volatile("1:        "__copyuser_seg"mov"itype" %"rtype"0,%1\n"\
+                    "2:\n"                                             \
+                    _ASM_EXTABLE(1b, 2b - 1b)                          \
+                    : : ltype(x), "m" (__m(addr)))
+@@ -487,8 +540,12 @@ struct __large_struct { unsigned long buf[100]; };
+  * On error, the variable @x is set to zero.
+  */
++#if defined(CONFIG_X86_64) && defined(CONFIG_PAX_MEMORY_UDEREF)
++#define __get_user(x, ptr)    get_user((x), (ptr))
++#else
+ #define __get_user(x, ptr)                                            \
+       __get_user_nocheck((x), (ptr), sizeof(*(ptr)))
++#endif
+ /**
+  * __put_user: - Write a simple value into user space, with less checking.
+@@ -510,8 +567,12 @@ struct __large_struct { unsigned long buf[100]; };
+  * Returns zero on success, or -EFAULT on error.
+  */
++#if defined(CONFIG_X86_64) && defined(CONFIG_PAX_MEMORY_UDEREF)
++#define __put_user(x, ptr)    put_user((x), (ptr))
++#else
+ #define __put_user(x, ptr)                                            \
+       __put_user_nocheck((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr)))
++#endif
+ #define __get_user_unaligned __get_user
+ #define __put_user_unaligned __put_user
+@@ -529,7 +590,7 @@ struct __large_struct { unsigned long buf[100]; };
+ #define get_user_ex(x, ptr)   do {                                    \
+       unsigned long __gue_val;                                        \
+       __get_user_size_ex((__gue_val), (ptr), (sizeof(*(ptr))));       \
+-      (x) = (__force __typeof__(*(ptr)))__gue_val;                    \
++      (x) = (__typeof__(*(ptr)))__gue_val;                            \
+ } while (0)
+ #ifdef CONFIG_X86_WP_WORKS_OK
+diff --git a/arch/x86/include/asm/uaccess_32.h b/arch/x86/include/asm/uaccess_32.h
+index 566e803..89f1e60 100644
+--- a/arch/x86/include/asm/uaccess_32.h
++++ b/arch/x86/include/asm/uaccess_32.h
+@@ -43,6 +43,11 @@ unsigned long __must_check __copy_from_user_ll_nocache_nozero
  static __always_inline unsigned long __must_check
  __copy_to_user_inatomic(void __user *to, const void *from, unsigned long n)
  {
@@ -9361,7 +10658,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/uaccess_32.h linux-3.1.3/arch/x86/in
        if (__builtin_constant_p(n)) {
                unsigned long ret;
  
-@@ -61,6 +66,8 @@ __copy_to_user_inatomic(void __user *to,
+@@ -61,6 +66,8 @@ __copy_to_user_inatomic(void __user *to, const void *from, unsigned long n)
                        return ret;
                }
        }
@@ -9370,7 +10667,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/uaccess_32.h linux-3.1.3/arch/x86/in
        return __copy_to_user_ll(to, from, n);
  }
  
-@@ -82,12 +89,16 @@ static __always_inline unsigned long __m
+@@ -82,12 +89,16 @@ static __always_inline unsigned long __must_check
  __copy_to_user(void __user *to, const void *from, unsigned long n)
  {
        might_fault();
@@ -9400,7 +10697,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/uaccess_32.h linux-3.1.3/arch/x86/in
        if (__builtin_constant_p(n)) {
                unsigned long ret;
  
-@@ -152,6 +169,8 @@ __copy_from_user(void *to, const void __
+@@ -152,6 +169,8 @@ __copy_from_user(void *to, const void __user *from, unsigned long n)
                        return ret;
                }
        }
@@ -9409,7 +10706,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/uaccess_32.h linux-3.1.3/arch/x86/in
        return __copy_from_user_ll(to, from, n);
  }
  
-@@ -159,6 +178,10 @@ static __always_inline unsigned long __c
+@@ -159,6 +178,10 @@ static __always_inline unsigned long __copy_from_user_nocache(void *to,
                                const void __user *from, unsigned long n)
  {
        might_fault();
@@ -9425,18 +10722,18 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/uaccess_32.h linux-3.1.3/arch/x86/in
                                  unsigned long n)
  {
 -       return __copy_from_user_ll_nocache_nozero(to, from, n);
--}
 +      if ((long)n < 0)
 +              return n;
++
++      return __copy_from_user_ll_nocache_nozero(to, from, n);
+ }
  
 -unsigned long __must_check copy_to_user(void __user *to,
 -                                      const void *from, unsigned long n);
 -unsigned long __must_check _copy_from_user(void *to,
 -                                        const void __user *from,
 -                                        unsigned long n);
-+      return __copy_from_user_ll_nocache_nozero(to, from, n);
-+}
+-
 +extern void copy_to_user_overflow(void)
 +#ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS
 +      __compiletime_error("copy_to_user() buffer size is not provably correct")
@@ -9447,7 +10744,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/uaccess_32.h linux-3.1.3/arch/x86/in
  
  extern void copy_from_user_overflow(void)
  #ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS
-@@ -199,17 +226,61 @@ extern void copy_from_user_overflow(void
+@@ -199,17 +226,61 @@ extern void copy_from_user_overflow(void)
  #endif
  ;
  
@@ -9516,9 +10813,10 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/uaccess_32.h linux-3.1.3/arch/x86/in
        return n;
  }
  
-diff -urNp linux-3.1.3/arch/x86/include/asm/uaccess_64.h linux-3.1.3/arch/x86/include/asm/uaccess_64.h
---- linux-3.1.3/arch/x86/include/asm/uaccess_64.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/uaccess_64.h      2011-11-16 18:40:08.000000000 -0500
+diff --git a/arch/x86/include/asm/uaccess_64.h b/arch/x86/include/asm/uaccess_64.h
+index 1c66d30..59bd7d4 100644
+--- a/arch/x86/include/asm/uaccess_64.h
++++ b/arch/x86/include/asm/uaccess_64.h
 @@ -10,6 +10,9 @@
  #include <asm/alternative.h>
  #include <asm/cpufeature.h>
@@ -9529,20 +10827,37 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/uaccess_64.h linux-3.1.3/arch/x86/in
  
  /*
   * Copy To/From Userspace
-@@ -36,26 +39,26 @@ copy_user_generic(void *to, const void *
+@@ -17,12 +20,12 @@
+ /* Handles exceptions in both to and from, but doesn't do access_ok */
+ __must_check unsigned long
+-copy_user_generic_string(void *to, const void *from, unsigned len);
++copy_user_generic_string(void *to, const void *from, unsigned long len);
+ __must_check unsigned long
+-copy_user_generic_unrolled(void *to, const void *from, unsigned len);
++copy_user_generic_unrolled(void *to, const void *from, unsigned long len);
+ static __always_inline __must_check unsigned long
+-copy_user_generic(void *to, const void *from, unsigned len)
++copy_user_generic(void *to, const void *from, unsigned long len)
+ {
+       unsigned ret;
+@@ -36,138 +39,226 @@ copy_user_generic(void *to, const void *from, unsigned len)
        return ret;
  }
  
--__must_check unsigned long
--_copy_to_user(void __user *to, const void *from, unsigned len);
--__must_check unsigned long
--_copy_from_user(void *to, const void __user *from, unsigned len);
 +static __always_inline __must_check unsigned long
-+__copy_to_user(void __user *to, const void *from, unsigned len);
++__copy_to_user(void __user *to, const void *from, unsigned long len);
 +static __always_inline __must_check unsigned long
-+__copy_from_user(void *to, const void __user *from, unsigned len);
++__copy_from_user(void *to, const void __user *from, unsigned long len);
  __must_check unsigned long
- copy_in_user(void __user *to, const void __user *from, unsigned len);
+-_copy_to_user(void __user *to, const void *from, unsigned len);
+-__must_check unsigned long
+-_copy_from_user(void *to, const void __user *from, unsigned len);
+-__must_check unsigned long
+-copy_in_user(void __user *to, const void __user *from, unsigned len);
++copy_in_user(void __user *to, const void __user *from, unsigned long len);
  
  static inline unsigned long __must_check copy_from_user(void *to,
                                          const void __user *from,
@@ -9561,7 +10876,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/uaccess_64.h linux-3.1.3/arch/x86/in
 +
 +      if (access_ok(VERIFY_READ, from, n))
 +              n = __copy_from_user(to, from, n);
-+      else if ((int)n > 0) {
++      else if (n < INT_MAX) {
 +              if (!__builtin_constant_p(n))
 +                      check_object_size(to, n, false);
 +              memset(to, 0, n);
@@ -9569,7 +10884,9 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/uaccess_64.h linux-3.1.3/arch/x86/in
        return n;
  }
  
-@@ -64,110 +67,198 @@ int copy_to_user(void __user *dst, const
+ static __always_inline __must_check
+-int copy_to_user(void __user *dst, const void *src, unsigned size)
++int copy_to_user(void __user *dst, const void *src, unsigned long size)
  {
        might_fault();
  
@@ -9581,7 +10898,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/uaccess_64.h linux-3.1.3/arch/x86/in
  
  static __always_inline __must_check
 -int __copy_from_user(void *dst, const void __user *src, unsigned size)
-+unsigned long __copy_from_user(void *dst, const void __user *src, unsigned size)
++unsigned long __copy_from_user(void *dst, const void __user *src, unsigned long size)
  {
 -      int ret = 0;
 +      int sz = __compiletime_object_size(dst);
@@ -9593,7 +10910,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/uaccess_64.h linux-3.1.3/arch/x86/in
 +
 +      pax_track_stack();
 +
-+      if ((int)size < 0)
++      if (size > INT_MAX)
 +              return size;
 +
 +#ifdef CONFIG_PAX_MEMORY_UDEREF
@@ -9671,7 +10988,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/uaccess_64.h linux-3.1.3/arch/x86/in
  
  static __always_inline __must_check
 -int __copy_to_user(void __user *dst, const void *src, unsigned size)
-+unsigned long __copy_to_user(void __user *dst, const void *src, unsigned size)
++unsigned long __copy_to_user(void __user *dst, const void *src, unsigned long size)
  {
 -      int ret = 0;
 +      int sz = __compiletime_object_size(src);
@@ -9683,7 +11000,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/uaccess_64.h linux-3.1.3/arch/x86/in
 +
 +      pax_track_stack();
 +
-+      if ((int)size < 0)
++      if (size > INT_MAX)
 +              return size;
 +
 +#ifdef CONFIG_PAX_MEMORY_UDEREF
@@ -9761,7 +11078,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/uaccess_64.h linux-3.1.3/arch/x86/in
  
  static __always_inline __must_check
 -int __copy_in_user(void __user *dst, const void __user *src, unsigned size)
-+unsigned long __copy_in_user(void __user *dst, const void __user *src, unsigned size)
++unsigned long __copy_in_user(void __user *dst, const void __user *src, unsigned long size)
  {
 -      int ret = 0;
 +      unsigned ret = 0;
@@ -9771,7 +11088,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/uaccess_64.h linux-3.1.3/arch/x86/in
 -              return copy_user_generic((__force void *)dst,
 -                                       (__force void *)src, size);
 +
-+      if ((int)size < 0)
++      if (size > INT_MAX)
 +              return size;
 +
 +#ifdef CONFIG_PAX_MEMORY_UDEREF
@@ -9801,7 +11118,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/uaccess_64.h linux-3.1.3/arch/x86/in
                               ret, "b", "b", "=q", 1);
                if (likely(!ret))
                        __put_user_asm(tmp, (u8 __user *)dst,
-@@ -176,7 +267,7 @@ int __copy_in_user(void __user *dst, con
+@@ -176,7 +267,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size)
        }
        case 2: {
                u16 tmp;
@@ -9810,7 +11127,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/uaccess_64.h linux-3.1.3/arch/x86/in
                               ret, "w", "w", "=r", 2);
                if (likely(!ret))
                        __put_user_asm(tmp, (u16 __user *)dst,
-@@ -186,7 +277,7 @@ int __copy_in_user(void __user *dst, con
+@@ -186,7 +277,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size)
  
        case 4: {
                u32 tmp;
@@ -9819,7 +11136,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/uaccess_64.h linux-3.1.3/arch/x86/in
                               ret, "l", "k", "=r", 4);
                if (likely(!ret))
                        __put_user_asm(tmp, (u32 __user *)dst,
-@@ -195,7 +286,7 @@ int __copy_in_user(void __user *dst, con
+@@ -195,7 +286,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size)
        }
        case 8: {
                u64 tmp;
@@ -9828,7 +11145,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/uaccess_64.h linux-3.1.3/arch/x86/in
                               ret, "q", "", "=r", 8);
                if (likely(!ret))
                        __put_user_asm(tmp, (u64 __user *)dst,
-@@ -203,8 +294,16 @@ int __copy_in_user(void __user *dst, con
+@@ -203,8 +294,16 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size)
                return ret;
        }
        default:
@@ -9847,14 +11164,17 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/uaccess_64.h linux-3.1.3/arch/x86/in
        }
  }
  
-@@ -221,33 +320,72 @@ __must_check unsigned long __clear_user(
+@@ -219,35 +318,74 @@ __must_check unsigned long clear_user(void __user *mem, unsigned long len);
+ __must_check unsigned long __clear_user(void __user *mem, unsigned long len);
  static __must_check __always_inline int
- __copy_from_user_inatomic(void *dst, const void __user *src, unsigned size)
+-__copy_from_user_inatomic(void *dst, const void __user *src, unsigned size)
++__copy_from_user_inatomic(void *dst, const void __user *src, unsigned long size)
  {
 -      return copy_user_generic(dst, (__force const void *)src, size);
 +      pax_track_stack();
 +
-+      if ((int)size < 0)
++      if (size > INT_MAX)
 +              return size;
 +
 +#ifdef CONFIG_PAX_MEMORY_UDEREF
@@ -9869,11 +11189,12 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/uaccess_64.h linux-3.1.3/arch/x86/in
  }
  
 -static __must_check __always_inline int
+-__copy_to_user_inatomic(void __user *dst, const void *src, unsigned size)
 +static __must_check __always_inline unsigned long
- __copy_to_user_inatomic(void __user *dst, const void *src, unsigned size)
++__copy_to_user_inatomic(void __user *dst, const void *src, unsigned long size)
  {
 -      return copy_user_generic((__force void *)dst, src, size);
-+      if ((int)size < 0)
++      if (size > INT_MAX)
 +              return size;
 +
 +#ifdef CONFIG_PAX_MEMORY_UDEREF
@@ -9888,16 +11209,17 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/uaccess_64.h linux-3.1.3/arch/x86/in
  }
  
 -extern long __copy_user_nocache(void *dst, const void __user *src,
+-                              unsigned size, int zerorest);
 +extern unsigned long __copy_user_nocache(void *dst, const void __user *src,
-                               unsigned size, int zerorest);
++                              unsigned long size, int zerorest);
  
 -static inline int
 -__copy_from_user_nocache(void *dst, const void __user *src, unsigned size)
-+static inline unsigned long __copy_from_user_nocache(void *dst, const void __user *src, unsigned size)
++static inline unsigned long __copy_from_user_nocache(void *dst, const void __user *src, unsigned long size)
  {
        might_sleep();
 +
-+      if ((int)size < 0)
++      if (size > INT_MAX)
 +              return size;
 +
 +#ifdef CONFIG_PAX_MEMORY_UDEREF
@@ -9910,10 +11232,11 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/uaccess_64.h linux-3.1.3/arch/x86/in
  
 -static inline int
 -__copy_from_user_inatomic_nocache(void *dst, const void __user *src,
+-                                unsigned size)
 +static inline unsigned long __copy_from_user_inatomic_nocache(void *dst, const void __user *src,
-                                 unsigned size)
++                                unsigned long size)
  {
-+      if ((int)size < 0)
++      if (size > INT_MAX)
 +              return size;
 +
 +#ifdef CONFIG_PAX_MEMORY_UDEREF
@@ -9927,234 +11250,13 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/uaccess_64.h linux-3.1.3/arch/x86/in
 -unsigned long
 -copy_user_handle_tail(char *to, char *from, unsigned len, unsigned zerorest);
 +extern unsigned long
-+copy_user_handle_tail(char __user *to, char __user *from, unsigned len, unsigned zerorest);
++copy_user_handle_tail(char __user *to, char __user *from, unsigned long len, unsigned zerorest);
  
  #endif /* _ASM_X86_UACCESS_64_H */
-diff -urNp linux-3.1.3/arch/x86/include/asm/uaccess.h linux-3.1.3/arch/x86/include/asm/uaccess.h
---- linux-3.1.3/arch/x86/include/asm/uaccess.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/uaccess.h 2011-11-16 18:39:07.000000000 -0500
-@@ -7,12 +7,15 @@
- #include <linux/compiler.h>
- #include <linux/thread_info.h>
- #include <linux/string.h>
-+#include <linux/sched.h>
- #include <asm/asm.h>
- #include <asm/page.h>
- #define VERIFY_READ 0
- #define VERIFY_WRITE 1
-+extern void check_object_size(const void *ptr, unsigned long n, bool to);
-+
- /*
-  * The fs value determines whether argument validity checking should be
-  * performed or not.  If get_fs() == USER_DS, checking is performed, with
-@@ -28,7 +31,12 @@
- #define get_ds()      (KERNEL_DS)
- #define get_fs()      (current_thread_info()->addr_limit)
-+#if defined(CONFIG_X86_32) && defined(CONFIG_PAX_MEMORY_UDEREF)
-+void __set_fs(mm_segment_t x);
-+void set_fs(mm_segment_t x);
-+#else
- #define set_fs(x)     (current_thread_info()->addr_limit = (x))
-+#endif
- #define segment_eq(a, b)      ((a).seg == (b).seg)
-@@ -76,7 +84,33 @@
-  * checks that the pointer is in the user space range - after calling
-  * this function, memory access functions may still return -EFAULT.
-  */
--#define access_ok(type, addr, size) (likely(__range_not_ok(addr, size) == 0))
-+#define __access_ok(type, addr, size) (likely(__range_not_ok(addr, size) == 0))
-+#define access_ok(type, addr, size)                                   \
-+({                                                                    \
-+      long __size = size;                                             \
-+      unsigned long __addr = (unsigned long)addr;                     \
-+      unsigned long __addr_ao = __addr & PAGE_MASK;                   \
-+      unsigned long __end_ao = __addr + __size - 1;                   \
-+      bool __ret_ao = __range_not_ok(__addr, __size) == 0;            \
-+      if (__ret_ao && unlikely((__end_ao ^ __addr_ao) & PAGE_MASK)) { \
-+              while(__addr_ao <= __end_ao) {                          \
-+                      char __c_ao;                                    \
-+                      __addr_ao += PAGE_SIZE;                         \
-+                      if (__size > PAGE_SIZE)                         \
-+                              cond_resched();                         \
-+                      if (__get_user(__c_ao, (char __user *)__addr))  \
-+                              break;                                  \
-+                      if (type != VERIFY_WRITE) {                     \
-+                              __addr = __addr_ao;                     \
-+                              continue;                               \
-+                      }                                               \
-+                      if (__put_user(__c_ao, (char __user *)__addr))  \
-+                              break;                                  \
-+                      __addr = __addr_ao;                             \
-+              }                                                       \
-+      }                                                               \
-+      __ret_ao;                                                       \
-+})
- /*
-  * The exception table consists of pairs of addresses: the first is the
-@@ -182,12 +216,20 @@ extern int __get_user_bad(void);
-       asm volatile("call __put_user_" #size : "=a" (__ret_pu) \
-                    : "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
--
-+#if defined(CONFIG_X86_32) && defined(CONFIG_PAX_MEMORY_UDEREF)
-+#define __copyuser_seg "gs;"
-+#define __COPYUSER_SET_ES "pushl %%gs; popl %%es\n"
-+#define __COPYUSER_RESTORE_ES "pushl %%ss; popl %%es\n"
-+#else
-+#define __copyuser_seg
-+#define __COPYUSER_SET_ES
-+#define __COPYUSER_RESTORE_ES
-+#endif
- #ifdef CONFIG_X86_32
- #define __put_user_asm_u64(x, addr, err, errret)                      \
--      asm volatile("1:        movl %%eax,0(%2)\n"                     \
--                   "2:        movl %%edx,4(%2)\n"                     \
-+      asm volatile("1:        "__copyuser_seg"movl %%eax,0(%2)\n"     \
-+                   "2:        "__copyuser_seg"movl %%edx,4(%2)\n"     \
-                    "3:\n"                                             \
-                    ".section .fixup,\"ax\"\n"                         \
-                    "4:        movl %3,%0\n"                           \
-@@ -199,8 +241,8 @@ extern int __get_user_bad(void);
-                    : "A" (x), "r" (addr), "i" (errret), "0" (err))
- #define __put_user_asm_ex_u64(x, addr)                                        \
--      asm volatile("1:        movl %%eax,0(%1)\n"                     \
--                   "2:        movl %%edx,4(%1)\n"                     \
-+      asm volatile("1:        "__copyuser_seg"movl %%eax,0(%1)\n"     \
-+                   "2:        "__copyuser_seg"movl %%edx,4(%1)\n"     \
-                    "3:\n"                                             \
-                    _ASM_EXTABLE(1b, 2b - 1b)                          \
-                    _ASM_EXTABLE(2b, 3b - 2b)                          \
-@@ -252,7 +294,7 @@ extern void __put_user_8(void);
-       __typeof__(*(ptr)) __pu_val;                            \
-       __chk_user_ptr(ptr);                                    \
-       might_fault();                                          \
--      __pu_val = x;                                           \
-+      __pu_val = (x);                                         \
-       switch (sizeof(*(ptr))) {                               \
-       case 1:                                                 \
-               __put_user_x(1, __pu_val, ptr, __ret_pu);       \
-@@ -373,7 +415,7 @@ do {                                                                       \
- } while (0)
- #define __get_user_asm(x, addr, err, itype, rtype, ltype, errret)     \
--      asm volatile("1:        mov"itype" %2,%"rtype"1\n"              \
-+      asm volatile("1:        "__copyuser_seg"mov"itype" %2,%"rtype"1\n"\
-                    "2:\n"                                             \
-                    ".section .fixup,\"ax\"\n"                         \
-                    "3:        mov %3,%0\n"                            \
-@@ -381,7 +423,7 @@ do {                                                                       \
-                    "  jmp 2b\n"                                       \
-                    ".previous\n"                                      \
-                    _ASM_EXTABLE(1b, 3b)                               \
--                   : "=r" (err), ltype(x)                             \
-+                   : "=r" (err), ltype (x)                            \
-                    : "m" (__m(addr)), "i" (errret), "0" (err))
- #define __get_user_size_ex(x, ptr, size)                              \
-@@ -406,7 +448,7 @@ do {                                                                       \
- } while (0)
- #define __get_user_asm_ex(x, addr, itype, rtype, ltype)                       \
--      asm volatile("1:        mov"itype" %1,%"rtype"0\n"              \
-+      asm volatile("1:        "__copyuser_seg"mov"itype" %1,%"rtype"0\n"\
-                    "2:\n"                                             \
-                    _ASM_EXTABLE(1b, 2b - 1b)                          \
-                    : ltype(x) : "m" (__m(addr)))
-@@ -423,13 +465,24 @@ do {                                                                     \
-       int __gu_err;                                                   \
-       unsigned long __gu_val;                                         \
-       __get_user_size(__gu_val, (ptr), (size), __gu_err, -EFAULT);    \
--      (x) = (__force __typeof__(*(ptr)))__gu_val;                     \
-+      (x) = (__typeof__(*(ptr)))__gu_val;                             \
-       __gu_err;                                                       \
- })
- /* FIXME: this hack is definitely wrong -AK */
- struct __large_struct { unsigned long buf[100]; };
--#define __m(x) (*(struct __large_struct __user *)(x))
-+#if defined(CONFIG_X86_64) && defined(CONFIG_PAX_MEMORY_UDEREF)
-+#define ____m(x)                                      \
-+({                                                    \
-+      unsigned long ____x = (unsigned long)(x);       \
-+      if (____x < PAX_USER_SHADOW_BASE)               \
-+              ____x += PAX_USER_SHADOW_BASE;          \
-+      (void __user *)____x;                           \
-+})
-+#else
-+#define ____m(x) (x)
-+#endif
-+#define __m(x) (*(struct __large_struct __user *)____m(x))
- /*
-  * Tell gcc we read from memory instead of writing: this is because
-@@ -437,7 +490,7 @@ struct __large_struct { unsigned long bu
-  * aliasing issues.
-  */
- #define __put_user_asm(x, addr, err, itype, rtype, ltype, errret)     \
--      asm volatile("1:        mov"itype" %"rtype"1,%2\n"              \
-+      asm volatile("1:        "__copyuser_seg"mov"itype" %"rtype"1,%2\n"\
-                    "2:\n"                                             \
-                    ".section .fixup,\"ax\"\n"                         \
-                    "3:        mov %3,%0\n"                            \
-@@ -445,10 +498,10 @@ struct __large_struct { unsigned long bu
-                    ".previous\n"                                      \
-                    _ASM_EXTABLE(1b, 3b)                               \
-                    : "=r"(err)                                        \
--                   : ltype(x), "m" (__m(addr)), "i" (errret), "0" (err))
-+                   : ltype (x), "m" (__m(addr)), "i" (errret), "0" (err))
- #define __put_user_asm_ex(x, addr, itype, rtype, ltype)                       \
--      asm volatile("1:        mov"itype" %"rtype"0,%1\n"              \
-+      asm volatile("1:        "__copyuser_seg"mov"itype" %"rtype"0,%1\n"\
-                    "2:\n"                                             \
-                    _ASM_EXTABLE(1b, 2b - 1b)                          \
-                    : : ltype(x), "m" (__m(addr)))
-@@ -487,8 +540,12 @@ struct __large_struct { unsigned long bu
-  * On error, the variable @x is set to zero.
-  */
-+#if defined(CONFIG_X86_64) && defined(CONFIG_PAX_MEMORY_UDEREF)
-+#define __get_user(x, ptr)    get_user((x), (ptr))
-+#else
- #define __get_user(x, ptr)                                            \
-       __get_user_nocheck((x), (ptr), sizeof(*(ptr)))
-+#endif
- /**
-  * __put_user: - Write a simple value into user space, with less checking.
-@@ -510,8 +567,12 @@ struct __large_struct { unsigned long bu
-  * Returns zero on success, or -EFAULT on error.
-  */
-+#if defined(CONFIG_X86_64) && defined(CONFIG_PAX_MEMORY_UDEREF)
-+#define __put_user(x, ptr)    put_user((x), (ptr))
-+#else
- #define __put_user(x, ptr)                                            \
-       __put_user_nocheck((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr)))
-+#endif
- #define __get_user_unaligned __get_user
- #define __put_user_unaligned __put_user
-@@ -529,7 +590,7 @@ struct __large_struct { unsigned long bu
- #define get_user_ex(x, ptr)   do {                                    \
-       unsigned long __gue_val;                                        \
-       __get_user_size_ex((__gue_val), (ptr), (sizeof(*(ptr))));       \
--      (x) = (__force __typeof__(*(ptr)))__gue_val;                    \
-+      (x) = (__typeof__(*(ptr)))__gue_val;                            \
- } while (0)
- #ifdef CONFIG_X86_WP_WORKS_OK
-diff -urNp linux-3.1.3/arch/x86/include/asm/vdso.h linux-3.1.3/arch/x86/include/asm/vdso.h
---- linux-3.1.3/arch/x86/include/asm/vdso.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/vdso.h    2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/include/asm/vdso.h b/arch/x86/include/asm/vdso.h
+index bb05228..d763d5b 100644
+--- a/arch/x86/include/asm/vdso.h
++++ b/arch/x86/include/asm/vdso.h
 @@ -11,7 +11,7 @@ extern const char VDSO32_PRELINK[];
  #define VDSO32_SYMBOL(base, name)                                     \
  ({                                                                    \
@@ -10164,9 +11266,10 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/vdso.h linux-3.1.3/arch/x86/include/
  })
  #endif
  
-diff -urNp linux-3.1.3/arch/x86/include/asm/x86_init.h linux-3.1.3/arch/x86/include/asm/x86_init.h
---- linux-3.1.3/arch/x86/include/asm/x86_init.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/x86_init.h        2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
+index d3d8590..d296b5f 100644
+--- a/arch/x86/include/asm/x86_init.h
++++ b/arch/x86/include/asm/x86_init.h
 @@ -28,7 +28,7 @@ struct x86_init_mpparse {
        void (*mpc_oem_bus_info)(struct mpc_bus *m, char *name);
        void (*find_smp_config)(void);
@@ -10284,10 +11387,11 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/x86_init.h linux-3.1.3/arch/x86/incl
  
  extern struct x86_init_ops x86_init;
  extern struct x86_cpuinit_ops x86_cpuinit;
-diff -urNp linux-3.1.3/arch/x86/include/asm/xsave.h linux-3.1.3/arch/x86/include/asm/xsave.h
---- linux-3.1.3/arch/x86/include/asm/xsave.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/include/asm/xsave.h   2011-11-16 18:39:07.000000000 -0500
-@@ -65,6 +65,11 @@ static inline int xsave_user(struct xsav
+diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h
+index c6ce245..ffbdab7 100644
+--- a/arch/x86/include/asm/xsave.h
++++ b/arch/x86/include/asm/xsave.h
+@@ -65,6 +65,11 @@ static inline int xsave_user(struct xsave_struct __user *buf)
  {
        int err;
  
@@ -10299,7 +11403,7 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/xsave.h linux-3.1.3/arch/x86/include
        /*
         * Clear the xsave header first, so that reserved fields are
         * initialized to zero.
-@@ -96,10 +101,15 @@ static inline int xsave_user(struct xsav
+@@ -96,10 +101,15 @@ static inline int xsave_user(struct xsave_struct __user *buf)
  static inline int xrestore_user(struct xsave_struct __user *buf, u64 mask)
  {
        int err;
@@ -10316,136 +11420,11 @@ diff -urNp linux-3.1.3/arch/x86/include/asm/xsave.h linux-3.1.3/arch/x86/include
        __asm__ __volatile__("1: .byte " REX_PREFIX "0x0f,0xae,0x2f\n"
                             "2:\n"
                             ".section .fixup,\"ax\"\n"
-diff -urNp linux-3.1.3/arch/x86/Kconfig linux-3.1.3/arch/x86/Kconfig
---- linux-3.1.3/arch/x86/Kconfig       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/Kconfig       2011-11-16 18:40:08.000000000 -0500
-@@ -236,7 +236,7 @@ config X86_HT
- config X86_32_LAZY_GS
-       def_bool y
--      depends on X86_32 && !CC_STACKPROTECTOR
-+      depends on X86_32 && !CC_STACKPROTECTOR && !PAX_MEMORY_UDEREF
- config ARCH_HWEIGHT_CFLAGS
-       string
-@@ -1019,7 +1019,7 @@ choice
- config NOHIGHMEM
-       bool "off"
--      depends on !X86_NUMAQ
-+      depends on !X86_NUMAQ && !(PAX_PAGEEXEC && PAX_ENABLE_PAE)
-       ---help---
-         Linux can use up to 64 Gigabytes of physical memory on x86 systems.
-         However, the address space of 32-bit x86 processors is only 4
-@@ -1056,7 +1056,7 @@ config NOHIGHMEM
- config HIGHMEM4G
-       bool "4GB"
--      depends on !X86_NUMAQ
-+      depends on !X86_NUMAQ && !(PAX_PAGEEXEC && PAX_ENABLE_PAE)
-       ---help---
-         Select this if you have a 32-bit processor and between 1 and 4
-         gigabytes of physical RAM.
-@@ -1110,7 +1110,7 @@ config PAGE_OFFSET
-       hex
-       default 0xB0000000 if VMSPLIT_3G_OPT
-       default 0x80000000 if VMSPLIT_2G
--      default 0x78000000 if VMSPLIT_2G_OPT
-+      default 0x70000000 if VMSPLIT_2G_OPT
-       default 0x40000000 if VMSPLIT_1G
-       default 0xC0000000
-       depends on X86_32
-@@ -1484,6 +1484,7 @@ config SECCOMP
- config CC_STACKPROTECTOR
-       bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)"
-+      depends on X86_64 || !PAX_MEMORY_UDEREF
-       ---help---
-         This option turns on the -fstack-protector GCC feature. This
-         feature puts, at the beginning of functions, a canary value on
-@@ -1541,6 +1542,7 @@ config KEXEC_JUMP
- config PHYSICAL_START
-       hex "Physical address where the kernel is loaded" if (EXPERT || CRASH_DUMP)
-       default "0x1000000"
-+      range 0x400000 0x40000000
-       ---help---
-         This gives the physical address where the kernel is loaded.
-@@ -1604,6 +1606,7 @@ config X86_NEED_RELOCS
- config PHYSICAL_ALIGN
-       hex "Alignment value to which kernel should be aligned" if X86_32
-       default "0x1000000"
-+      range 0x400000 0x1000000 if PAX_KERNEXEC
-       range 0x2000 0x1000000
-       ---help---
-         This value puts the alignment restrictions on physical address
-@@ -1635,9 +1638,10 @@ config HOTPLUG_CPU
-         Say N if you want to disable CPU hotplug.
- config COMPAT_VDSO
--      def_bool y
-+      def_bool n
-       prompt "Compat VDSO support"
-       depends on X86_32 || IA32_EMULATION
-+      depends on !PAX_NOEXEC && !PAX_MEMORY_UDEREF
-       ---help---
-         Map the 32-bit VDSO to the predictable old-style address too.
-diff -urNp linux-3.1.3/arch/x86/Kconfig.cpu linux-3.1.3/arch/x86/Kconfig.cpu
---- linux-3.1.3/arch/x86/Kconfig.cpu   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/Kconfig.cpu   2011-11-16 18:39:07.000000000 -0500
-@@ -341,7 +341,7 @@ config X86_PPRO_FENCE
- config X86_F00F_BUG
-       def_bool y
--      depends on M586MMX || M586TSC || M586 || M486 || M386
-+      depends on (M586MMX || M586TSC || M586 || M486 || M386) && !PAX_KERNEXEC
- config X86_INVD_BUG
-       def_bool y
-@@ -365,7 +365,7 @@ config X86_POPAD_OK
- config X86_ALIGNMENT_16
-       def_bool y
--      depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || MELAN || MK6 || M586MMX || M586TSC || M586 || M486 || MVIAC3_2 || MGEODEGX1
-+      depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || X86_ELAN || MK8 || MK7 || MK6 || MCORE2 || MPENTIUM4 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || M486 || MVIAC3_2 || MGEODEGX1
- config X86_INTEL_USERCOPY
-       def_bool y
-@@ -411,7 +411,7 @@ config X86_CMPXCHG64
- # generates cmov.
- config X86_CMOV
-       def_bool y
--      depends on (MK8 || MK7 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || X86_64 || MATOM || MGEODE_LX)
-+      depends on (MK8 || MK7 || MCORE2 || MPSC || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || X86_64 || MATOM || MGEODE_LX)
- config X86_MINIMUM_CPU_FAMILY
-       int
-diff -urNp linux-3.1.3/arch/x86/Kconfig.debug linux-3.1.3/arch/x86/Kconfig.debug
---- linux-3.1.3/arch/x86/Kconfig.debug 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/Kconfig.debug 2011-11-16 18:39:07.000000000 -0500
-@@ -81,7 +81,7 @@ config X86_PTDUMP
- config DEBUG_RODATA
-       bool "Write protect kernel read-only data structures"
-       default y
--      depends on DEBUG_KERNEL
-+      depends on DEBUG_KERNEL && BROKEN
-       ---help---
-         Mark the kernel read-only data as write-protected in the pagetables,
-         in order to catch accidental (and incorrect) writes to such const
-@@ -99,7 +99,7 @@ config DEBUG_RODATA_TEST
- config DEBUG_SET_MODULE_RONX
-       bool "Set loadable kernel module data as NX and text as RO"
--      depends on MODULES
-+      depends on MODULES && BROKEN
-       ---help---
-         This option helps catch unintended modifications to loadable
-         kernel module's text and read-only data. It also prevents execution
-diff -urNp linux-3.1.3/arch/x86/kernel/acpi/realmode/Makefile linux-3.1.3/arch/x86/kernel/acpi/realmode/Makefile
---- linux-3.1.3/arch/x86/kernel/acpi/realmode/Makefile 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/acpi/realmode/Makefile 2011-11-16 18:39:07.000000000 -0500
-@@ -41,6 +41,9 @@ KBUILD_CFLAGS        := $(LINUXINCLUDE) -g -Os 
+diff --git a/arch/x86/kernel/acpi/realmode/Makefile b/arch/x86/kernel/acpi/realmode/Makefile
+index 6a564ac..9b1340c 100644
+--- a/arch/x86/kernel/acpi/realmode/Makefile
++++ b/arch/x86/kernel/acpi/realmode/Makefile
+@@ -41,6 +41,9 @@ KBUILD_CFLAGS        := $(LINUXINCLUDE) -g -Os -D_SETUP -D_WAKEUP -D__KERNEL__ \
                   $(call cc-option, -fno-stack-protector) \
                   $(call cc-option, -mpreferred-stack-boundary=2)
  KBUILD_CFLAGS += $(call cc-option, -m32)
@@ -10455,9 +11434,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/acpi/realmode/Makefile linux-3.1.3/arch/x
  KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
  GCOV_PROFILE := n
  
-diff -urNp linux-3.1.3/arch/x86/kernel/acpi/realmode/wakeup.S linux-3.1.3/arch/x86/kernel/acpi/realmode/wakeup.S
---- linux-3.1.3/arch/x86/kernel/acpi/realmode/wakeup.S 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/acpi/realmode/wakeup.S 2011-11-16 18:40:08.000000000 -0500
+diff --git a/arch/x86/kernel/acpi/realmode/wakeup.S b/arch/x86/kernel/acpi/realmode/wakeup.S
+index b4fd836..4358fe3 100644
+--- a/arch/x86/kernel/acpi/realmode/wakeup.S
++++ b/arch/x86/kernel/acpi/realmode/wakeup.S
 @@ -108,6 +108,9 @@ wakeup_code:
        /* Do any other stuff... */
  
@@ -10476,9 +11456,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/acpi/realmode/wakeup.S linux-3.1.3/arch/x
  #else
        pushw   $0
        pushw   trampoline_segment
-diff -urNp linux-3.1.3/arch/x86/kernel/acpi/sleep.c linux-3.1.3/arch/x86/kernel/acpi/sleep.c
---- linux-3.1.3/arch/x86/kernel/acpi/sleep.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/acpi/sleep.c   2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c
+index 103b6ab..2004d0a 100644
+--- a/arch/x86/kernel/acpi/sleep.c
++++ b/arch/x86/kernel/acpi/sleep.c
 @@ -94,8 +94,12 @@ int acpi_suspend_lowlevel(void)
        header->trampoline_segment = trampoline_address() >> 4;
  #ifdef CONFIG_SMP
@@ -10492,9 +11473,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/acpi/sleep.c linux-3.1.3/arch/x86/kernel/
        initial_gs = per_cpu_offset(smp_processor_id());
  #endif
        initial_code = (unsigned long)wakeup_long64;
-diff -urNp linux-3.1.3/arch/x86/kernel/acpi/wakeup_32.S linux-3.1.3/arch/x86/kernel/acpi/wakeup_32.S
---- linux-3.1.3/arch/x86/kernel/acpi/wakeup_32.S       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/acpi/wakeup_32.S       2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/kernel/acpi/wakeup_32.S b/arch/x86/kernel/acpi/wakeup_32.S
+index 13ab720..95d5442 100644
+--- a/arch/x86/kernel/acpi/wakeup_32.S
++++ b/arch/x86/kernel/acpi/wakeup_32.S
 @@ -30,13 +30,11 @@ wakeup_pmode_return:
        # and restore the stack ... but you need gdt for this to work
        movl    saved_context_esp, %esp
@@ -10511,10 +11493,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/acpi/wakeup_32.S linux-3.1.3/arch/x86/ker
  
  bogus_magic:
        jmp     bogus_magic
-diff -urNp linux-3.1.3/arch/x86/kernel/alternative.c linux-3.1.3/arch/x86/kernel/alternative.c
---- linux-3.1.3/arch/x86/kernel/alternative.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/alternative.c  2011-11-16 18:39:07.000000000 -0500
-@@ -276,6 +276,13 @@ void __init_or_module apply_alternatives
+diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
+index c638228..16dfa8d 100644
+--- a/arch/x86/kernel/alternative.c
++++ b/arch/x86/kernel/alternative.c
+@@ -276,6 +276,13 @@ void __init_or_module apply_alternatives(struct alt_instr *start,
         */
        for (a = start; a < end; a++) {
                instr = (u8 *)&a->instr_offset + a->instr_offset;
@@ -10528,7 +11511,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/alternative.c linux-3.1.3/arch/x86/kernel
                replacement = (u8 *)&a->repl_offset + a->repl_offset;
                BUG_ON(a->replacementlen > a->instrlen);
                BUG_ON(a->instrlen > sizeof(insnbuf));
-@@ -307,10 +314,16 @@ static void alternatives_smp_lock(const 
+@@ -307,10 +314,16 @@ static void alternatives_smp_lock(const s32 *start, const s32 *end,
        for (poff = start; poff < end; poff++) {
                u8 *ptr = (u8 *)poff + *poff;
  
@@ -10546,7 +11529,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/alternative.c linux-3.1.3/arch/x86/kernel
                        text_poke(ptr, ((unsigned char []){0xf0}), 1);
        };
        mutex_unlock(&text_mutex);
-@@ -328,10 +341,16 @@ static void alternatives_smp_unlock(cons
+@@ -328,10 +341,16 @@ static void alternatives_smp_unlock(const s32 *start, const s32 *end,
        for (poff = start; poff < end; poff++) {
                u8 *ptr = (u8 *)poff + *poff;
  
@@ -10564,7 +11547,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/alternative.c linux-3.1.3/arch/x86/kernel
                        text_poke(ptr, ((unsigned char []){0x3E}), 1);
        };
        mutex_unlock(&text_mutex);
-@@ -500,7 +519,7 @@ void __init_or_module apply_paravirt(str
+@@ -500,7 +519,7 @@ void __init_or_module apply_paravirt(struct paravirt_patch_site *start,
  
                BUG_ON(p->len > MAX_PATCH_LEN);
                /* prep the buffer with the original instructions */
@@ -10573,7 +11556,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/alternative.c linux-3.1.3/arch/x86/kernel
                used = pv_init_ops.patch(p->instrtype, p->clobbers, insnbuf,
                                         (unsigned long)p->instr, p->len);
  
-@@ -568,7 +587,7 @@ void __init alternative_instructions(voi
+@@ -568,7 +587,7 @@ void __init alternative_instructions(void)
        if (smp_alt_once)
                free_init_pages("SMP alternatives",
                                (unsigned long)__smp_locks,
@@ -10582,7 +11565,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/alternative.c linux-3.1.3/arch/x86/kernel
  
        restart_nmi();
  }
-@@ -585,13 +604,17 @@ void __init alternative_instructions(voi
+@@ -585,13 +604,17 @@ void __init alternative_instructions(void)
   * instructions. And on the local CPU you need to be protected again NMI or MCE
   * handlers seeing an inconsistent instruction while you patch.
   */
@@ -10602,7 +11585,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/alternative.c linux-3.1.3/arch/x86/kernel
        local_irq_restore(flags);
        /* Could also do a CLFLUSH here to speed up CPU recovery; but
           that causes hangs on some VIA CPUs. */
-@@ -613,36 +636,22 @@ void *__init_or_module text_poke_early(v
+@@ -613,36 +636,22 @@ void *__init_or_module text_poke_early(void *addr, const void *opcode,
   */
  void *__kprobes text_poke(void *addr, const void *opcode, size_t len)
  {
@@ -10647,9 +11630,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/alternative.c linux-3.1.3/arch/x86/kernel
        return addr;
  }
  
-diff -urNp linux-3.1.3/arch/x86/kernel/apic/apic.c linux-3.1.3/arch/x86/kernel/apic/apic.c
---- linux-3.1.3/arch/x86/kernel/apic/apic.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/apic/apic.c    2011-11-16 18:40:08.000000000 -0500
+diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
+index 52fa563..5de9d9c 100644
+--- a/arch/x86/kernel/apic/apic.c
++++ b/arch/x86/kernel/apic/apic.c
 @@ -174,7 +174,7 @@ int first_system_vector = 0xfe;
  /*
   * Debug level, exported for io_apic.c
@@ -10659,7 +11643,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/apic/apic.c linux-3.1.3/arch/x86/kernel/a
  
  int pic_mode;
  
-@@ -1835,7 +1835,7 @@ void smp_error_interrupt(struct pt_regs 
+@@ -1835,7 +1835,7 @@ void smp_error_interrupt(struct pt_regs *regs)
        apic_write(APIC_ESR, 0);
        v1 = apic_read(APIC_ESR);
        ack_APIC_irq();
@@ -10668,7 +11652,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/apic/apic.c linux-3.1.3/arch/x86/kernel/a
  
        apic_printk(APIC_DEBUG, KERN_DEBUG "APIC error on CPU%d: %02x(%02x)",
                    smp_processor_id(), v0 , v1);
-@@ -2209,6 +2209,8 @@ static int __cpuinit apic_cluster_num(vo
+@@ -2209,6 +2209,8 @@ static int __cpuinit apic_cluster_num(void)
        u16 *bios_cpu_apicid;
        DECLARE_BITMAP(clustermap, NUM_APIC_CLUSTERS);
  
@@ -10677,10 +11661,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/apic/apic.c linux-3.1.3/arch/x86/kernel/a
        bios_cpu_apicid = early_per_cpu_ptr(x86_bios_cpu_apicid);
        bitmap_zero(clustermap, NUM_APIC_CLUSTERS);
  
-diff -urNp linux-3.1.3/arch/x86/kernel/apic/io_apic.c linux-3.1.3/arch/x86/kernel/apic/io_apic.c
---- linux-3.1.3/arch/x86/kernel/apic/io_apic.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/apic/io_apic.c 2011-11-16 18:39:07.000000000 -0500
-@@ -1028,7 +1028,7 @@ int IO_APIC_get_PCI_irq_vector(int bus, 
+diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
+index 8eb863e..32e6934 100644
+--- a/arch/x86/kernel/apic/io_apic.c
++++ b/arch/x86/kernel/apic/io_apic.c
+@@ -1028,7 +1028,7 @@ int IO_APIC_get_PCI_irq_vector(int bus, int slot, int pin,
  }
  EXPORT_SYMBOL(IO_APIC_get_PCI_irq_vector);
  
@@ -10698,7 +11683,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/apic/io_apic.c linux-3.1.3/arch/x86/kerne
  {
        raw_spin_unlock(&vector_lock);
  }
-@@ -2405,7 +2405,7 @@ static void ack_apic_edge(struct irq_dat
+@@ -2405,7 +2405,7 @@ static void ack_apic_edge(struct irq_data *data)
        ack_APIC_irq();
  }
  
@@ -10707,7 +11692,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/apic/io_apic.c linux-3.1.3/arch/x86/kerne
  
  /*
   * IO-APIC versions below 0x20 don't support EOI register.
-@@ -2513,7 +2513,7 @@ static void ack_apic_level(struct irq_da
+@@ -2513,7 +2513,7 @@ static void ack_apic_level(struct irq_data *data)
         * at the cpu.
         */
        if (!(v & (1 << (i & 0x1f)))) {
@@ -10716,9 +11701,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/apic/io_apic.c linux-3.1.3/arch/x86/kerne
  
                eoi_ioapic_irq(irq, cfg);
        }
-diff -urNp linux-3.1.3/arch/x86/kernel/apm_32.c linux-3.1.3/arch/x86/kernel/apm_32.c
---- linux-3.1.3/arch/x86/kernel/apm_32.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/apm_32.c       2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
+index 0371c48..54cdf63 100644
+--- a/arch/x86/kernel/apm_32.c
++++ b/arch/x86/kernel/apm_32.c
 @@ -413,7 +413,7 @@ static DEFINE_MUTEX(apm_mutex);
   * This is for buggy BIOS's that refer to (real mode) segment 0x40
   * even though they are called in protected mode.
@@ -10751,7 +11737,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/apm_32.c linux-3.1.3/arch/x86/kernel/apm_
        put_cpu();
  
        return call->eax & 0xff;
-@@ -667,7 +674,10 @@ static long __apm_bios_call_simple(void 
+@@ -667,7 +674,10 @@ static long __apm_bios_call_simple(void *_call)
        BUG_ON(cpu != 0);
        gdt = get_cpu_gdt_table(cpu);
        save_desc_40 = gdt[0x40 / 8];
@@ -10762,7 +11748,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/apm_32.c linux-3.1.3/arch/x86/kernel/apm_
  
        apm_irq_save(flags);
        APM_DO_SAVE_SEGS;
-@@ -675,7 +685,11 @@ static long __apm_bios_call_simple(void 
+@@ -675,7 +685,11 @@ static long __apm_bios_call_simple(void *_call)
                                         &call->eax);
        APM_DO_RESTORE_SEGS;
        apm_irq_restore(flags);
@@ -10790,20 +11776,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/apm_32.c linux-3.1.3/arch/x86/kernel/apm_
  
        proc_create("apm", 0, NULL, &apm_file_ops);
  
-diff -urNp linux-3.1.3/arch/x86/kernel/asm-offsets_64.c linux-3.1.3/arch/x86/kernel/asm-offsets_64.c
---- linux-3.1.3/arch/x86/kernel/asm-offsets_64.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/asm-offsets_64.c       2011-11-16 18:39:07.000000000 -0500
-@@ -69,6 +69,7 @@ int main(void)
-       BLANK();
- #undef ENTRY
-+      DEFINE(TSS_size, sizeof(struct tss_struct));
-       OFFSET(TSS_ist, tss_struct, x86_tss.ist);
-       BLANK();
-diff -urNp linux-3.1.3/arch/x86/kernel/asm-offsets.c linux-3.1.3/arch/x86/kernel/asm-offsets.c
---- linux-3.1.3/arch/x86/kernel/asm-offsets.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/asm-offsets.c  2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/kernel/asm-offsets.c b/arch/x86/kernel/asm-offsets.c
+index 4f13faf..87db5d2 100644
+--- a/arch/x86/kernel/asm-offsets.c
++++ b/arch/x86/kernel/asm-offsets.c
 @@ -33,6 +33,8 @@ void common(void) {
        OFFSET(TI_status, thread_info, status);
        OFFSET(TI_addr_limit, thread_info, addr_limit);
@@ -10820,16 +11796,16 @@ diff -urNp linux-3.1.3/arch/x86/kernel/asm-offsets.c linux-3.1.3/arch/x86/kernel
 +
 +#ifdef CONFIG_PAX_KERNEXEC
 +      OFFSET(PV_CPU_write_cr0, pv_cpu_ops, write_cr0);
-+#endif
-+
+ #endif
 +#ifdef CONFIG_PAX_MEMORY_UDEREF
 +      OFFSET(PV_MMU_read_cr3, pv_mmu_ops, read_cr3);
 +      OFFSET(PV_MMU_write_cr3, pv_mmu_ops, write_cr3);
 +#ifdef CONFIG_X86_64
 +      OFFSET(PV_MMU_set_pgd_batched, pv_mmu_ops, set_pgd_batched);
 +#endif
- #endif
++#endif
++
 +#endif
 +
 +      BLANK();
@@ -10840,10 +11816,38 @@ diff -urNp linux-3.1.3/arch/x86/kernel/asm-offsets.c linux-3.1.3/arch/x86/kernel
  #ifdef CONFIG_XEN
        BLANK();
        OFFSET(XEN_vcpu_info_mask, vcpu_info, evtchn_upcall_mask);
-diff -urNp linux-3.1.3/arch/x86/kernel/cpu/amd.c linux-3.1.3/arch/x86/kernel/cpu/amd.c
---- linux-3.1.3/arch/x86/kernel/cpu/amd.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/cpu/amd.c      2011-11-16 18:39:07.000000000 -0500
-@@ -647,7 +647,7 @@ static unsigned int __cpuinit amd_size_c
+diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c
+index e72a119..6e2955d 100644
+--- a/arch/x86/kernel/asm-offsets_64.c
++++ b/arch/x86/kernel/asm-offsets_64.c
+@@ -69,6 +69,7 @@ int main(void)
+       BLANK();
+ #undef ENTRY
++      DEFINE(TSS_size, sizeof(struct tss_struct));
+       OFFSET(TSS_ist, tss_struct, x86_tss.ist);
+       BLANK();
+diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile
+index 6042981..e638266 100644
+--- a/arch/x86/kernel/cpu/Makefile
++++ b/arch/x86/kernel/cpu/Makefile
+@@ -8,10 +8,6 @@ CFLAGS_REMOVE_common.o = -pg
+ CFLAGS_REMOVE_perf_event.o = -pg
+ endif
+-# Make sure load_percpu_segment has no stackprotector
+-nostackp := $(call cc-option, -fno-stack-protector)
+-CFLAGS_common.o               := $(nostackp)
+-
+ obj-y                 := intel_cacheinfo.o scattered.o topology.o
+ obj-y                 += proc.o capflags.o powerflags.o common.o
+ obj-y                 += vmware.o hypervisor.o sched.o mshyperv.o
+diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
+index b13ed39..603286c 100644
+--- a/arch/x86/kernel/cpu/amd.c
++++ b/arch/x86/kernel/cpu/amd.c
+@@ -647,7 +647,7 @@ static unsigned int __cpuinit amd_size_cache(struct cpuinfo_x86 *c,
                                                        unsigned int size)
  {
        /* AMD errata T13 (order #21922) */
@@ -10852,10 +11856,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/cpu/amd.c linux-3.1.3/arch/x86/kernel/cpu
                /* Duron Rev A0 */
                if (c->x86_model == 3 && c->x86_mask == 0)
                        size = 64;
-diff -urNp linux-3.1.3/arch/x86/kernel/cpu/common.c linux-3.1.3/arch/x86/kernel/cpu/common.c
---- linux-3.1.3/arch/x86/kernel/cpu/common.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/cpu/common.c   2011-11-16 18:39:07.000000000 -0500
-@@ -83,60 +83,6 @@ static const struct cpu_dev __cpuinitcon
+diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
+index 6218439..0f1addc 100644
+--- a/arch/x86/kernel/cpu/common.c
++++ b/arch/x86/kernel/cpu/common.c
+@@ -83,60 +83,6 @@ static const struct cpu_dev __cpuinitconst default_cpu = {
  
  static const struct cpu_dev *this_cpu __cpuinitdata = &default_cpu;
  
@@ -10925,7 +11930,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/cpu/common.c linux-3.1.3/arch/x86/kernel/
        gdt_descr.size = GDT_SIZE - 1;
        load_gdt(&gdt_descr);
        /* Reload the per-cpu base */
-@@ -840,6 +786,10 @@ static void __cpuinit identify_cpu(struc
+@@ -840,6 +786,10 @@ static void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
        /* Filter out anything that depends on CPUID levels we don't have */
        filter_cpuid_features(c, true);
  
@@ -10936,7 +11941,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/cpu/common.c linux-3.1.3/arch/x86/kernel/
        /* If the model name is still unset, do table lookup. */
        if (!c->x86_model_id[0]) {
                const char *p;
-@@ -1019,6 +969,9 @@ static __init int setup_disablecpuid(cha
+@@ -1019,6 +969,9 @@ static __init int setup_disablecpuid(char *arg)
  }
  __setup("clearcpuid=", setup_disablecpuid);
  
@@ -10946,7 +11951,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/cpu/common.c linux-3.1.3/arch/x86/kernel/
  #ifdef CONFIG_X86_64
  struct desc_ptr idt_descr = { NR_VECTORS * 16 - 1, (unsigned long) idt_table };
  
-@@ -1034,7 +987,7 @@ DEFINE_PER_CPU(struct task_struct *, cur
+@@ -1034,7 +987,7 @@ DEFINE_PER_CPU(struct task_struct *, current_task) ____cacheline_aligned =
  EXPORT_PER_CPU_SYMBOL(current_task);
  
  DEFINE_PER_CPU(unsigned long, kernel_stack) =
@@ -10955,7 +11960,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/cpu/common.c linux-3.1.3/arch/x86/kernel/
  EXPORT_PER_CPU_SYMBOL(kernel_stack);
  
  DEFINE_PER_CPU(char *, irq_stack_ptr) =
-@@ -1099,7 +1052,7 @@ struct pt_regs * __cpuinit idle_regs(str
+@@ -1099,7 +1052,7 @@ struct pt_regs * __cpuinit idle_regs(struct pt_regs *regs)
  {
        memset(regs, 0, sizeof(struct pt_regs));
        regs->fs = __KERNEL_PERCPU;
@@ -10999,10 +12004,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/cpu/common.c linux-3.1.3/arch/x86/kernel/
        struct thread_struct *thread = &curr->thread;
  
        if (cpumask_test_and_set_cpu(cpu, cpu_initialized_mask)) {
-diff -urNp linux-3.1.3/arch/x86/kernel/cpu/intel.c linux-3.1.3/arch/x86/kernel/cpu/intel.c
---- linux-3.1.3/arch/x86/kernel/cpu/intel.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/cpu/intel.c    2011-11-16 18:39:07.000000000 -0500
-@@ -172,7 +172,7 @@ static void __cpuinit trap_init_f00f_bug
+diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
+index ed6086e..a1dcf29 100644
+--- a/arch/x86/kernel/cpu/intel.c
++++ b/arch/x86/kernel/cpu/intel.c
+@@ -172,7 +172,7 @@ static void __cpuinit trap_init_f00f_bug(void)
         * Update the IDT descriptor and reload the IDT so that
         * it uses the read-only mapped virtual address.
         */
@@ -11011,23 +12017,25 @@ diff -urNp linux-3.1.3/arch/x86/kernel/cpu/intel.c linux-3.1.3/arch/x86/kernel/c
        load_idt(&idt_descr);
  }
  #endif
-diff -urNp linux-3.1.3/arch/x86/kernel/cpu/Makefile linux-3.1.3/arch/x86/kernel/cpu/Makefile
---- linux-3.1.3/arch/x86/kernel/cpu/Makefile   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/cpu/Makefile   2011-11-16 18:39:07.000000000 -0500
-@@ -8,10 +8,6 @@ CFLAGS_REMOVE_common.o = -pg
- CFLAGS_REMOVE_perf_event.o = -pg
- endif
--# Make sure load_percpu_segment has no stackprotector
--nostackp := $(call cc-option, -fno-stack-protector)
--CFLAGS_common.o               := $(nostackp)
--
- obj-y                 := intel_cacheinfo.o scattered.o topology.o
- obj-y                 += proc.o capflags.o powerflags.o common.o
- obj-y                 += vmware.o hypervisor.o sched.o mshyperv.o
-diff -urNp linux-3.1.3/arch/x86/kernel/cpu/mcheck/mce.c linux-3.1.3/arch/x86/kernel/cpu/mcheck/mce.c
---- linux-3.1.3/arch/x86/kernel/cpu/mcheck/mce.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/cpu/mcheck/mce.c       2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/kernel/cpu/mcheck/mce-inject.c b/arch/x86/kernel/cpu/mcheck/mce-inject.c
+index 0ed633c..82cef2a 100644
+--- a/arch/x86/kernel/cpu/mcheck/mce-inject.c
++++ b/arch/x86/kernel/cpu/mcheck/mce-inject.c
+@@ -215,7 +215,9 @@ static int inject_init(void)
+       if (!alloc_cpumask_var(&mce_inject_cpumask, GFP_KERNEL))
+               return -ENOMEM;
+       printk(KERN_INFO "Machine check injector initialized\n");
+-      mce_chrdev_ops.write = mce_write;
++      pax_open_kernel();
++      *(void **)&mce_chrdev_ops.write = mce_write;
++      pax_close_kernel();
+       register_die_notifier(&mce_raise_nb);
+       return 0;
+ }
+diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
+index 08363b0..ee26113 100644
+--- a/arch/x86/kernel/cpu/mcheck/mce.c
++++ b/arch/x86/kernel/cpu/mcheck/mce.c
 @@ -42,6 +42,7 @@
  #include <asm/processor.h>
  #include <asm/mce.h>
@@ -11058,7 +12066,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/cpu/mcheck/mce.c linux-3.1.3/arch/x86/ker
  
  /* Panic in progress. Enable interrupts and wait for final IPI */
  static void wait_for_panic(void)
-@@ -260,7 +261,7 @@ static void mce_panic(char *msg, struct 
+@@ -260,7 +261,7 @@ static void mce_panic(char *msg, struct mce *final, char *exp)
                /*
                 * Make sure only one CPU runs in machine check panic
                 */
@@ -11067,7 +12075,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/cpu/mcheck/mce.c linux-3.1.3/arch/x86/ker
                        wait_for_panic();
                barrier();
  
-@@ -268,7 +269,7 @@ static void mce_panic(char *msg, struct 
+@@ -268,7 +269,7 @@ static void mce_panic(char *msg, struct mce *final, char *exp)
                console_verbose();
        } else {
                /* Don't log too much for fake panic */
@@ -11085,7 +12093,26 @@ diff -urNp linux-3.1.3/arch/x86/kernel/cpu/mcheck/mce.c linux-3.1.3/arch/x86/ker
                wait_for_panic();
        if (!monarch_timeout)
                goto out;
-@@ -1429,7 +1430,7 @@ void __cpuinit mcheck_cpu_init(struct cp
+@@ -1392,7 +1393,7 @@ static void unexpected_machine_check(struct pt_regs *regs, long error_code)
+ }
+ /* Call the installed machine check handler for this CPU setup. */
+-void (*machine_check_vector)(struct pt_regs *, long error_code) =
++void (*machine_check_vector)(struct pt_regs *, long error_code) __read_only =
+                                               unexpected_machine_check;
+ /*
+@@ -1415,7 +1416,9 @@ void __cpuinit mcheck_cpu_init(struct cpuinfo_x86 *c)
+               return;
+       }
++      pax_open_kernel();
+       machine_check_vector = do_machine_check;
++      pax_close_kernel();
+       __mcheck_cpu_init_generic();
+       __mcheck_cpu_init_vendor(c);
+@@ -1429,7 +1432,7 @@ void __cpuinit mcheck_cpu_init(struct cpuinfo_x86 *c)
   */
  
  static DEFINE_SPINLOCK(mce_chrdev_state_lock);
@@ -11094,7 +12121,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/cpu/mcheck/mce.c linux-3.1.3/arch/x86/ker
  static int mce_chrdev_open_exclu;     /* already open exclusive? */
  
  static int mce_chrdev_open(struct inode *inode, struct file *file)
-@@ -1437,7 +1438,7 @@ static int mce_chrdev_open(struct inode 
+@@ -1437,7 +1440,7 @@ static int mce_chrdev_open(struct inode *inode, struct file *file)
        spin_lock(&mce_chrdev_state_lock);
  
        if (mce_chrdev_open_exclu ||
@@ -11103,7 +12130,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/cpu/mcheck/mce.c linux-3.1.3/arch/x86/ker
                spin_unlock(&mce_chrdev_state_lock);
  
                return -EBUSY;
-@@ -1445,7 +1446,7 @@ static int mce_chrdev_open(struct inode 
+@@ -1445,7 +1448,7 @@ static int mce_chrdev_open(struct inode *inode, struct file *file)
  
        if (file->f_flags & O_EXCL)
                mce_chrdev_open_exclu = 1;
@@ -11112,7 +12139,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/cpu/mcheck/mce.c linux-3.1.3/arch/x86/ker
  
        spin_unlock(&mce_chrdev_state_lock);
  
-@@ -1456,7 +1457,7 @@ static int mce_chrdev_release(struct ino
+@@ -1456,7 +1459,7 @@ static int mce_chrdev_release(struct inode *inode, struct file *file)
  {
        spin_lock(&mce_chrdev_state_lock);
  
@@ -11121,7 +12148,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/cpu/mcheck/mce.c linux-3.1.3/arch/x86/ker
        mce_chrdev_open_exclu = 0;
  
        spin_unlock(&mce_chrdev_state_lock);
-@@ -2147,7 +2148,7 @@ struct dentry *mce_get_debugfs_dir(void)
+@@ -2147,7 +2150,7 @@ struct dentry *mce_get_debugfs_dir(void)
  static void mce_reset(void)
  {
        cpu_missing = 0;
@@ -11130,23 +12157,38 @@ diff -urNp linux-3.1.3/arch/x86/kernel/cpu/mcheck/mce.c linux-3.1.3/arch/x86/ker
        atomic_set(&mce_executing, 0);
        atomic_set(&mce_callin, 0);
        atomic_set(&global_nwo, 0);
-diff -urNp linux-3.1.3/arch/x86/kernel/cpu/mcheck/mce-inject.c linux-3.1.3/arch/x86/kernel/cpu/mcheck/mce-inject.c
---- linux-3.1.3/arch/x86/kernel/cpu/mcheck/mce-inject.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/cpu/mcheck/mce-inject.c        2011-11-16 18:39:07.000000000 -0500
-@@ -215,7 +215,9 @@ static int inject_init(void)
-       if (!alloc_cpumask_var(&mce_inject_cpumask, GFP_KERNEL))
-               return -ENOMEM;
-       printk(KERN_INFO "Machine check injector initialized\n");
--      mce_chrdev_ops.write = mce_write;
+diff --git a/arch/x86/kernel/cpu/mcheck/p5.c b/arch/x86/kernel/cpu/mcheck/p5.c
+index 5c0e653..1e82c7c 100644
+--- a/arch/x86/kernel/cpu/mcheck/p5.c
++++ b/arch/x86/kernel/cpu/mcheck/p5.c
+@@ -50,7 +50,9 @@ void intel_p5_mcheck_init(struct cpuinfo_x86 *c)
+       if (!cpu_has(c, X86_FEATURE_MCE))
+               return;
 +      pax_open_kernel();
-+      *(void **)&mce_chrdev_ops.write = mce_write;
+       machine_check_vector = pentium_machine_check;
 +      pax_close_kernel();
-       register_die_notifier(&mce_raise_nb);
-       return 0;
- }
-diff -urNp linux-3.1.3/arch/x86/kernel/cpu/mtrr/main.c linux-3.1.3/arch/x86/kernel/cpu/mtrr/main.c
---- linux-3.1.3/arch/x86/kernel/cpu/mtrr/main.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/cpu/mtrr/main.c        2011-11-16 18:39:07.000000000 -0500
+       /* Make sure the vector pointer is visible before we enable MCEs: */
+       wmb();
+diff --git a/arch/x86/kernel/cpu/mcheck/winchip.c b/arch/x86/kernel/cpu/mcheck/winchip.c
+index 54060f5..e6ba93d 100644
+--- a/arch/x86/kernel/cpu/mcheck/winchip.c
++++ b/arch/x86/kernel/cpu/mcheck/winchip.c
+@@ -24,7 +24,9 @@ void winchip_mcheck_init(struct cpuinfo_x86 *c)
+ {
+       u32 lo, hi;
++      pax_open_kernel();
+       machine_check_vector = winchip_machine_check;
++      pax_close_kernel();
+       /* Make sure the vector pointer is visible before we enable MCEs: */
+       wmb();
+diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c
+index 6b96110..0da73eb 100644
+--- a/arch/x86/kernel/cpu/mtrr/main.c
++++ b/arch/x86/kernel/cpu/mtrr/main.c
 @@ -62,7 +62,7 @@ static DEFINE_MUTEX(mtrr_mutex);
  u64 size_or_mask, size_and_mask;
  static bool mtrr_aps_delayed_init;
@@ -11156,9 +12198,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/cpu/mtrr/main.c linux-3.1.3/arch/x86/kern
  
  const struct mtrr_ops *mtrr_if;
  
-diff -urNp linux-3.1.3/arch/x86/kernel/cpu/mtrr/mtrr.h linux-3.1.3/arch/x86/kernel/cpu/mtrr/mtrr.h
---- linux-3.1.3/arch/x86/kernel/cpu/mtrr/mtrr.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/cpu/mtrr/mtrr.h        2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/kernel/cpu/mtrr/mtrr.h b/arch/x86/kernel/cpu/mtrr/mtrr.h
+index df5e41f..816c719 100644
+--- a/arch/x86/kernel/cpu/mtrr/mtrr.h
++++ b/arch/x86/kernel/cpu/mtrr/mtrr.h
 @@ -25,7 +25,7 @@ struct mtrr_ops {
        int     (*validate_add_page)(unsigned long base, unsigned long size,
                                     unsigned int type);
@@ -11168,10 +12211,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/cpu/mtrr/mtrr.h linux-3.1.3/arch/x86/kern
  
  extern int generic_get_free_region(unsigned long base, unsigned long size,
                                   int replace_reg);
-diff -urNp linux-3.1.3/arch/x86/kernel/cpu/perf_event.c linux-3.1.3/arch/x86/kernel/cpu/perf_event.c
---- linux-3.1.3/arch/x86/kernel/cpu/perf_event.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/cpu/perf_event.c       2011-11-16 18:40:08.000000000 -0500
-@@ -795,6 +795,8 @@ static int x86_schedule_events(struct cp
+diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
+index cfa62ec..9250dd7 100644
+--- a/arch/x86/kernel/cpu/perf_event.c
++++ b/arch/x86/kernel/cpu/perf_event.c
+@@ -795,6 +795,8 @@ static int x86_schedule_events(struct cpu_hw_events *cpuc, int n, int *assign)
        int i, j, w, wmax, num = 0;
        struct hw_perf_event *hwc;
  
@@ -11180,7 +12224,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/cpu/perf_event.c linux-3.1.3/arch/x86/ker
        bitmap_zero(used_mask, X86_PMC_IDX_MAX);
  
        for (i = 0; i < n; i++) {
-@@ -1919,7 +1921,7 @@ perf_callchain_user(struct perf_callchai
+@@ -1919,7 +1921,7 @@ perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs)
                        break;
  
                perf_callchain_store(entry, frame.return_address);
@@ -11189,10 +12233,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/cpu/perf_event.c linux-3.1.3/arch/x86/ker
        }
  }
  
-diff -urNp linux-3.1.3/arch/x86/kernel/crash.c linux-3.1.3/arch/x86/kernel/crash.c
---- linux-3.1.3/arch/x86/kernel/crash.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/crash.c        2011-11-16 18:39:07.000000000 -0500
-@@ -42,7 +42,7 @@ static void kdump_nmi_callback(int cpu, 
+diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c
+index 764c7c2..c5d9c7b 100644
+--- a/arch/x86/kernel/crash.c
++++ b/arch/x86/kernel/crash.c
+@@ -42,7 +42,7 @@ static void kdump_nmi_callback(int cpu, struct die_args *args)
        regs = args->regs;
  
  #ifdef CONFIG_X86_32
@@ -11201,9 +12246,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/crash.c linux-3.1.3/arch/x86/kernel/crash
                crash_fixup_ss_esp(&fixed_regs, regs);
                regs = &fixed_regs;
        }
-diff -urNp linux-3.1.3/arch/x86/kernel/doublefault_32.c linux-3.1.3/arch/x86/kernel/doublefault_32.c
---- linux-3.1.3/arch/x86/kernel/doublefault_32.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/doublefault_32.c       2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/kernel/doublefault_32.c b/arch/x86/kernel/doublefault_32.c
+index 37250fe..bf2ec74 100644
+--- a/arch/x86/kernel/doublefault_32.c
++++ b/arch/x86/kernel/doublefault_32.c
 @@ -11,7 +11,7 @@
  
  #define DOUBLEFAULT_STACKSIZE (1024)
@@ -11222,7 +12268,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/doublefault_32.c linux-3.1.3/arch/x86/ker
  
        printk(KERN_EMERG "PANIC: double fault, gdt at %08lx [%d bytes]\n", gdt, gdt_desc.size);
  
-@@ -58,10 +58,10 @@ struct tss_struct doublefault_tss __cach
+@@ -58,10 +58,10 @@ struct tss_struct doublefault_tss __cacheline_aligned = {
                /* 0x2 bit is always set */
                .flags          = X86_EFLAGS_SF | 0x2,
                .sp             = STACK_START,
@@ -11235,196 +12281,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/doublefault_32.c linux-3.1.3/arch/x86/ker
                .fs             = __KERNEL_PERCPU,
  
                .__cr3          = __pa_nodebug(swapper_pg_dir),
-diff -urNp linux-3.1.3/arch/x86/kernel/dumpstack_32.c linux-3.1.3/arch/x86/kernel/dumpstack_32.c
---- linux-3.1.3/arch/x86/kernel/dumpstack_32.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/dumpstack_32.c 2011-11-16 18:39:07.000000000 -0500
-@@ -38,15 +38,13 @@ void dump_trace(struct task_struct *task
-               bp = stack_frame(task, regs);
-       for (;;) {
--              struct thread_info *context;
-+              void *stack_start = (void *)((unsigned long)stack & ~(THREAD_SIZE-1));
--              context = (struct thread_info *)
--                      ((unsigned long)stack & (~(THREAD_SIZE - 1)));
--              bp = ops->walk_stack(context, stack, bp, ops, data, NULL, &graph);
-+              bp = ops->walk_stack(task, stack_start, stack, bp, ops, data, NULL, &graph);
--              stack = (unsigned long *)context->previous_esp;
--              if (!stack)
-+              if (stack_start == task_stack_page(task))
-                       break;
-+              stack = *(unsigned long **)stack_start;
-               if (ops->stack(data, "IRQ") < 0)
-                       break;
-               touch_nmi_watchdog();
-@@ -96,21 +94,22 @@ void show_registers(struct pt_regs *regs
-        * When in-kernel, we also print out the stack and code at the
-        * time of the fault..
-        */
--      if (!user_mode_vm(regs)) {
-+      if (!user_mode(regs)) {
-               unsigned int code_prologue = code_bytes * 43 / 64;
-               unsigned int code_len = code_bytes;
-               unsigned char c;
-               u8 *ip;
-+              unsigned long cs_base = get_desc_base(&get_cpu_gdt_table(smp_processor_id())[(0xffff & regs->cs) >> 3]);
-               printk(KERN_EMERG "Stack:\n");
-               show_stack_log_lvl(NULL, regs, &regs->sp, 0, KERN_EMERG);
-               printk(KERN_EMERG "Code: ");
--              ip = (u8 *)regs->ip - code_prologue;
-+              ip = (u8 *)regs->ip - code_prologue + cs_base;
-               if (ip < (u8 *)PAGE_OFFSET || probe_kernel_address(ip, c)) {
-                       /* try starting at IP */
--                      ip = (u8 *)regs->ip;
-+                      ip = (u8 *)regs->ip + cs_base;
-                       code_len = code_len - code_prologue + 1;
-               }
-               for (i = 0; i < code_len; i++, ip++) {
-@@ -119,7 +118,7 @@ void show_registers(struct pt_regs *regs
-                               printk(" Bad EIP value.");
-                               break;
-                       }
--                      if (ip == (u8 *)regs->ip)
-+                      if (ip == (u8 *)regs->ip + cs_base)
-                               printk("<%02x> ", c);
-                       else
-                               printk("%02x ", c);
-@@ -132,6 +131,7 @@ int is_valid_bugaddr(unsigned long ip)
- {
-       unsigned short ud2;
-+      ip = ktla_ktva(ip);
-       if (ip < PAGE_OFFSET)
-               return 0;
-       if (probe_kernel_address((unsigned short *)ip, ud2))
-@@ -139,3 +139,15 @@ int is_valid_bugaddr(unsigned long ip)
-       return ud2 == 0x0b0f;
- }
-+
-+#ifdef CONFIG_PAX_MEMORY_STACKLEAK
-+void pax_check_alloca(unsigned long size)
-+{
-+      unsigned long sp = (unsigned long)&sp, stack_left;
-+
-+      /* all kernel stacks are of the same size */
-+      stack_left = sp & (THREAD_SIZE - 1);
-+      BUG_ON(stack_left < 256 || size >= stack_left - 256);
-+}
-+EXPORT_SYMBOL(pax_check_alloca);
-+#endif
-diff -urNp linux-3.1.3/arch/x86/kernel/dumpstack_64.c linux-3.1.3/arch/x86/kernel/dumpstack_64.c
---- linux-3.1.3/arch/x86/kernel/dumpstack_64.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/dumpstack_64.c 2011-11-16 18:39:07.000000000 -0500
-@@ -119,9 +119,9 @@ void dump_trace(struct task_struct *task
-       unsigned long *irq_stack_end =
-               (unsigned long *)per_cpu(irq_stack_ptr, cpu);
-       unsigned used = 0;
--      struct thread_info *tinfo;
-       int graph = 0;
-       unsigned long dummy;
-+      void *stack_start;
-       if (!task)
-               task = current;
-@@ -142,10 +142,10 @@ void dump_trace(struct task_struct *task
-        * current stack address. If the stacks consist of nested
-        * exceptions
-        */
--      tinfo = task_thread_info(task);
-       for (;;) {
-               char *id;
-               unsigned long *estack_end;
-+
-               estack_end = in_exception_stack(cpu, (unsigned long)stack,
-                                               &used, &id);
-@@ -153,7 +153,7 @@ void dump_trace(struct task_struct *task
-                       if (ops->stack(data, id) < 0)
-                               break;
--                      bp = ops->walk_stack(tinfo, stack, bp, ops,
-+                      bp = ops->walk_stack(task, estack_end - EXCEPTION_STKSZ, stack, bp, ops,
-                                            data, estack_end, &graph);
-                       ops->stack(data, "<EOE>");
-                       /*
-@@ -172,7 +172,7 @@ void dump_trace(struct task_struct *task
-                       if (in_irq_stack(stack, irq_stack, irq_stack_end)) {
-                               if (ops->stack(data, "IRQ") < 0)
-                                       break;
--                              bp = ops->walk_stack(tinfo, stack, bp,
-+                              bp = ops->walk_stack(task, irq_stack, stack, bp,
-                                       ops, data, irq_stack_end, &graph);
-                               /*
-                                * We link to the next stack (which would be
-@@ -191,7 +191,8 @@ void dump_trace(struct task_struct *task
-       /*
-        * This handles the process stack:
-        */
--      bp = ops->walk_stack(tinfo, stack, bp, ops, data, NULL, &graph);
-+      stack_start = (void *)((unsigned long)stack & ~(THREAD_SIZE-1));
-+      bp = ops->walk_stack(task, stack_start, stack, bp, ops, data, NULL, &graph);
-       put_cpu();
- }
- EXPORT_SYMBOL(dump_trace);
-@@ -305,3 +306,50 @@ int is_valid_bugaddr(unsigned long ip)
-       return ud2 == 0x0b0f;
- }
-+
-+#ifdef CONFIG_PAX_MEMORY_STACKLEAK
-+void pax_check_alloca(unsigned long size)
-+{
-+      unsigned long sp = (unsigned long)&sp, stack_start, stack_end;
-+      unsigned cpu, used;
-+      char *id;
-+
-+      /* check the process stack first */
-+      stack_start = (unsigned long)task_stack_page(current);
-+      stack_end = stack_start + THREAD_SIZE;
-+      if (likely(stack_start <= sp && sp < stack_end)) {
-+              unsigned long stack_left = sp & (THREAD_SIZE - 1);
-+              BUG_ON(stack_left < 256 || size >= stack_left - 256);
-+              return;
-+      }
-+
-+      cpu = get_cpu();
-+
-+      /* check the irq stacks */
-+      stack_end = (unsigned long)per_cpu(irq_stack_ptr, cpu);
-+      stack_start = stack_end - IRQ_STACK_SIZE;
-+      if (stack_start <= sp && sp < stack_end) {
-+              unsigned long stack_left = sp & (IRQ_STACK_SIZE - 1);
-+              put_cpu();
-+              BUG_ON(stack_left < 256 || size >= stack_left - 256);
-+              return;
-+      }
-+
-+      /* check the exception stacks */
-+      used = 0;
-+      stack_end = (unsigned long)in_exception_stack(cpu, sp, &used, &id);
-+      stack_start = stack_end - EXCEPTION_STKSZ;
-+      if (stack_end && stack_start <= sp && sp < stack_end) {
-+              unsigned long stack_left = sp & (EXCEPTION_STKSZ - 1);
-+              put_cpu();
-+              BUG_ON(stack_left < 256 || size >= stack_left - 256);
-+              return;
-+      }
-+
-+      put_cpu();
-+
-+      /* unknown stack */
-+      BUG();
-+}
-+EXPORT_SYMBOL(pax_check_alloca);
-+#endif
-diff -urNp linux-3.1.3/arch/x86/kernel/dumpstack.c linux-3.1.3/arch/x86/kernel/dumpstack.c
---- linux-3.1.3/arch/x86/kernel/dumpstack.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/dumpstack.c    2011-11-16 18:40:08.000000000 -0500
+diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
+index 1aae78f..aab3a3d 100644
+--- a/arch/x86/kernel/dumpstack.c
++++ b/arch/x86/kernel/dumpstack.c
 @@ -2,6 +2,9 @@
   *  Copyright (C) 1991, 1992  Linus Torvalds
   *  Copyright (C) 2000, 2001, 2002 Andi Kleen, SuSE Labs
@@ -11435,7 +12295,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/dumpstack.c linux-3.1.3/arch/x86/kernel/d
  #include <linux/kallsyms.h>
  #include <linux/kprobes.h>
  #include <linux/uaccess.h>
-@@ -35,9 +38,8 @@ void printk_address(unsigned long addres
+@@ -35,9 +38,8 @@ void printk_address(unsigned long address, int reliable)
  static void
  print_ftrace_graph_addr(unsigned long addr, void *data,
                        const struct stacktrace_ops *ops,
@@ -11446,7 +12306,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/dumpstack.c linux-3.1.3/arch/x86/kernel/d
        unsigned long ret_addr;
        int index = task->curr_ret_stack;
  
-@@ -58,7 +60,7 @@ print_ftrace_graph_addr(unsigned long ad
+@@ -58,7 +60,7 @@ print_ftrace_graph_addr(unsigned long addr, void *data,
  static inline void
  print_ftrace_graph_addr(unsigned long addr, void *data,
                        const struct stacktrace_ops *ops,
@@ -11455,7 +12315,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/dumpstack.c linux-3.1.3/arch/x86/kernel/d
  { }
  #endif
  
-@@ -69,10 +71,8 @@ print_ftrace_graph_addr(unsigned long ad
+@@ -69,10 +71,8 @@ print_ftrace_graph_addr(unsigned long addr, void *data,
   * severe exception (double fault, nmi, stack fault, debug, mce) hardware stack
   */
  
@@ -11467,7 +12327,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/dumpstack.c linux-3.1.3/arch/x86/kernel/d
        if (end) {
                if (p < end && p >= (end-THREAD_SIZE))
                        return 1;
-@@ -83,14 +83,14 @@ static inline int valid_stack_ptr(struct
+@@ -83,14 +83,14 @@ static inline int valid_stack_ptr(struct thread_info *tinfo,
  }
  
  unsigned long
@@ -11484,7 +12344,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/dumpstack.c linux-3.1.3/arch/x86/kernel/d
                unsigned long addr;
  
                addr = *stack;
-@@ -102,7 +102,7 @@ print_context_stack(struct thread_info *
+@@ -102,7 +102,7 @@ print_context_stack(struct thread_info *tinfo,
                        } else {
                                ops->address(data, addr, 0);
                        }
@@ -11493,7 +12353,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/dumpstack.c linux-3.1.3/arch/x86/kernel/d
                }
                stack++;
        }
-@@ -111,7 +111,7 @@ print_context_stack(struct thread_info *
+@@ -111,7 +111,7 @@ print_context_stack(struct thread_info *tinfo,
  EXPORT_SYMBOL_GPL(print_context_stack);
  
  unsigned long
@@ -11502,7 +12362,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/dumpstack.c linux-3.1.3/arch/x86/kernel/d
                       unsigned long *stack, unsigned long bp,
                       const struct stacktrace_ops *ops, void *data,
                       unsigned long *end, int *graph)
-@@ -119,7 +119,7 @@ print_context_stack_bp(struct thread_inf
+@@ -119,7 +119,7 @@ print_context_stack_bp(struct thread_info *tinfo,
        struct stack_frame *frame = (struct stack_frame *)bp;
        unsigned long *ret_addr = &frame->return_address;
  
@@ -11511,7 +12371,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/dumpstack.c linux-3.1.3/arch/x86/kernel/d
                unsigned long addr = *ret_addr;
  
                if (!__kernel_text_address(addr))
-@@ -128,7 +128,7 @@ print_context_stack_bp(struct thread_inf
+@@ -128,7 +128,7 @@ print_context_stack_bp(struct thread_info *tinfo,
                ops->address(data, addr, 1);
                frame = frame->next_frame;
                ret_addr = &frame->return_address;
@@ -11538,7 +12398,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/dumpstack.c linux-3.1.3/arch/x86/kernel/d
  void __kprobes oops_end(unsigned long flags, struct pt_regs *regs, int signr)
  {
        if (regs && kexec_should_crash(current))
-@@ -243,7 +245,10 @@ void __kprobes oops_end(unsigned long fl
+@@ -243,7 +245,10 @@ void __kprobes oops_end(unsigned long flags, struct pt_regs *regs, int signr)
                panic("Fatal exception in interrupt");
        if (panic_on_oops)
                panic("Fatal exception");
@@ -11550,7 +12410,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/dumpstack.c linux-3.1.3/arch/x86/kernel/d
  }
  
  int __kprobes __die(const char *str, struct pt_regs *regs, long err)
-@@ -269,7 +274,7 @@ int __kprobes __die(const char *str, str
+@@ -269,7 +274,7 @@ int __kprobes __die(const char *str, struct pt_regs *regs, long err)
  
        show_registers(regs);
  #ifdef CONFIG_X86_32
@@ -11559,7 +12419,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/dumpstack.c linux-3.1.3/arch/x86/kernel/d
                sp = regs->sp;
                ss = regs->ss & 0xffff;
        } else {
-@@ -297,7 +302,7 @@ void die(const char *str, struct pt_regs
+@@ -297,7 +302,7 @@ void die(const char *str, struct pt_regs *regs, long err)
        unsigned long flags = oops_begin();
        int sig = SIGSEGV;
  
@@ -11568,9 +12428,199 @@ diff -urNp linux-3.1.3/arch/x86/kernel/dumpstack.c linux-3.1.3/arch/x86/kernel/d
                report_bug(regs->ip, regs);
  
        if (__die(str, regs, err))
-diff -urNp linux-3.1.3/arch/x86/kernel/early_printk.c linux-3.1.3/arch/x86/kernel/early_printk.c
---- linux-3.1.3/arch/x86/kernel/early_printk.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/early_printk.c 2011-11-16 18:40:08.000000000 -0500
+diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c
+index 3b97a80..667ce7a 100644
+--- a/arch/x86/kernel/dumpstack_32.c
++++ b/arch/x86/kernel/dumpstack_32.c
+@@ -38,15 +38,13 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
+               bp = stack_frame(task, regs);
+       for (;;) {
+-              struct thread_info *context;
++              void *stack_start = (void *)((unsigned long)stack & ~(THREAD_SIZE-1));
+-              context = (struct thread_info *)
+-                      ((unsigned long)stack & (~(THREAD_SIZE - 1)));
+-              bp = ops->walk_stack(context, stack, bp, ops, data, NULL, &graph);
++              bp = ops->walk_stack(task, stack_start, stack, bp, ops, data, NULL, &graph);
+-              stack = (unsigned long *)context->previous_esp;
+-              if (!stack)
++              if (stack_start == task_stack_page(task))
+                       break;
++              stack = *(unsigned long **)stack_start;
+               if (ops->stack(data, "IRQ") < 0)
+                       break;
+               touch_nmi_watchdog();
+@@ -96,21 +94,22 @@ void show_registers(struct pt_regs *regs)
+        * When in-kernel, we also print out the stack and code at the
+        * time of the fault..
+        */
+-      if (!user_mode_vm(regs)) {
++      if (!user_mode(regs)) {
+               unsigned int code_prologue = code_bytes * 43 / 64;
+               unsigned int code_len = code_bytes;
+               unsigned char c;
+               u8 *ip;
++              unsigned long cs_base = get_desc_base(&get_cpu_gdt_table(smp_processor_id())[(0xffff & regs->cs) >> 3]);
+               printk(KERN_EMERG "Stack:\n");
+               show_stack_log_lvl(NULL, regs, &regs->sp, 0, KERN_EMERG);
+               printk(KERN_EMERG "Code: ");
+-              ip = (u8 *)regs->ip - code_prologue;
++              ip = (u8 *)regs->ip - code_prologue + cs_base;
+               if (ip < (u8 *)PAGE_OFFSET || probe_kernel_address(ip, c)) {
+                       /* try starting at IP */
+-                      ip = (u8 *)regs->ip;
++                      ip = (u8 *)regs->ip + cs_base;
+                       code_len = code_len - code_prologue + 1;
+               }
+               for (i = 0; i < code_len; i++, ip++) {
+@@ -119,7 +118,7 @@ void show_registers(struct pt_regs *regs)
+                               printk(" Bad EIP value.");
+                               break;
+                       }
+-                      if (ip == (u8 *)regs->ip)
++                      if (ip == (u8 *)regs->ip + cs_base)
+                               printk("<%02x> ", c);
+                       else
+                               printk("%02x ", c);
+@@ -132,6 +131,7 @@ int is_valid_bugaddr(unsigned long ip)
+ {
+       unsigned short ud2;
++      ip = ktla_ktva(ip);
+       if (ip < PAGE_OFFSET)
+               return 0;
+       if (probe_kernel_address((unsigned short *)ip, ud2))
+@@ -139,3 +139,15 @@ int is_valid_bugaddr(unsigned long ip)
+       return ud2 == 0x0b0f;
+ }
++
++#ifdef CONFIG_PAX_MEMORY_STACKLEAK
++void pax_check_alloca(unsigned long size)
++{
++      unsigned long sp = (unsigned long)&sp, stack_left;
++
++      /* all kernel stacks are of the same size */
++      stack_left = sp & (THREAD_SIZE - 1);
++      BUG_ON(stack_left < 256 || size >= stack_left - 256);
++}
++EXPORT_SYMBOL(pax_check_alloca);
++#endif
+diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c
+index 19853ad..508ca79 100644
+--- a/arch/x86/kernel/dumpstack_64.c
++++ b/arch/x86/kernel/dumpstack_64.c
+@@ -119,9 +119,9 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
+       unsigned long *irq_stack_end =
+               (unsigned long *)per_cpu(irq_stack_ptr, cpu);
+       unsigned used = 0;
+-      struct thread_info *tinfo;
+       int graph = 0;
+       unsigned long dummy;
++      void *stack_start;
+       if (!task)
+               task = current;
+@@ -142,10 +142,10 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
+        * current stack address. If the stacks consist of nested
+        * exceptions
+        */
+-      tinfo = task_thread_info(task);
+       for (;;) {
+               char *id;
+               unsigned long *estack_end;
++
+               estack_end = in_exception_stack(cpu, (unsigned long)stack,
+                                               &used, &id);
+@@ -153,7 +153,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
+                       if (ops->stack(data, id) < 0)
+                               break;
+-                      bp = ops->walk_stack(tinfo, stack, bp, ops,
++                      bp = ops->walk_stack(task, estack_end - EXCEPTION_STKSZ, stack, bp, ops,
+                                            data, estack_end, &graph);
+                       ops->stack(data, "<EOE>");
+                       /*
+@@ -172,7 +172,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
+                       if (in_irq_stack(stack, irq_stack, irq_stack_end)) {
+                               if (ops->stack(data, "IRQ") < 0)
+                                       break;
+-                              bp = ops->walk_stack(tinfo, stack, bp,
++                              bp = ops->walk_stack(task, irq_stack, stack, bp,
+                                       ops, data, irq_stack_end, &graph);
+                               /*
+                                * We link to the next stack (which would be
+@@ -191,7 +191,8 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
+       /*
+        * This handles the process stack:
+        */
+-      bp = ops->walk_stack(tinfo, stack, bp, ops, data, NULL, &graph);
++      stack_start = (void *)((unsigned long)stack & ~(THREAD_SIZE-1));
++      bp = ops->walk_stack(task, stack_start, stack, bp, ops, data, NULL, &graph);
+       put_cpu();
+ }
+ EXPORT_SYMBOL(dump_trace);
+@@ -305,3 +306,50 @@ int is_valid_bugaddr(unsigned long ip)
+       return ud2 == 0x0b0f;
+ }
++
++#ifdef CONFIG_PAX_MEMORY_STACKLEAK
++void pax_check_alloca(unsigned long size)
++{
++      unsigned long sp = (unsigned long)&sp, stack_start, stack_end;
++      unsigned cpu, used;
++      char *id;
++
++      /* check the process stack first */
++      stack_start = (unsigned long)task_stack_page(current);
++      stack_end = stack_start + THREAD_SIZE;
++      if (likely(stack_start <= sp && sp < stack_end)) {
++              unsigned long stack_left = sp & (THREAD_SIZE - 1);
++              BUG_ON(stack_left < 256 || size >= stack_left - 256);
++              return;
++      }
++
++      cpu = get_cpu();
++
++      /* check the irq stacks */
++      stack_end = (unsigned long)per_cpu(irq_stack_ptr, cpu);
++      stack_start = stack_end - IRQ_STACK_SIZE;
++      if (stack_start <= sp && sp < stack_end) {
++              unsigned long stack_left = sp & (IRQ_STACK_SIZE - 1);
++              put_cpu();
++              BUG_ON(stack_left < 256 || size >= stack_left - 256);
++              return;
++      }
++
++      /* check the exception stacks */
++      used = 0;
++      stack_end = (unsigned long)in_exception_stack(cpu, sp, &used, &id);
++      stack_start = stack_end - EXCEPTION_STKSZ;
++      if (stack_end && stack_start <= sp && sp < stack_end) {
++              unsigned long stack_left = sp & (EXCEPTION_STKSZ - 1);
++              put_cpu();
++              BUG_ON(stack_left < 256 || size >= stack_left - 256);
++              return;
++      }
++
++      put_cpu();
++
++      /* unknown stack */
++      BUG();
++}
++EXPORT_SYMBOL(pax_check_alloca);
++#endif
+diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c
+index cd28a35..2601699 100644
+--- a/arch/x86/kernel/early_printk.c
++++ b/arch/x86/kernel/early_printk.c
 @@ -7,6 +7,7 @@
  #include <linux/pci_regs.h>
  #include <linux/pci_ids.h>
@@ -11579,7 +12629,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/early_printk.c linux-3.1.3/arch/x86/kerne
  #include <asm/io.h>
  #include <asm/processor.h>
  #include <asm/fcntl.h>
-@@ -179,6 +180,8 @@ asmlinkage void early_printk(const char 
+@@ -179,6 +180,8 @@ asmlinkage void early_printk(const char *fmt, ...)
        int n;
        va_list ap;
  
@@ -11588,9 +12638,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/early_printk.c linux-3.1.3/arch/x86/kerne
        va_start(ap, fmt);
        n = vscnprintf(buf, sizeof(buf), fmt, ap);
        early_console->write(early_console, buf, n);
-diff -urNp linux-3.1.3/arch/x86/kernel/entry_32.S linux-3.1.3/arch/x86/kernel/entry_32.S
---- linux-3.1.3/arch/x86/kernel/entry_32.S     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/entry_32.S     2011-11-16 18:40:08.000000000 -0500
+diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
+index f3f6f53..0841b66 100644
+--- a/arch/x86/kernel/entry_32.S
++++ b/arch/x86/kernel/entry_32.S
 @@ -186,13 +186,146 @@
        /*CFI_REL_OFFSET gs, PT_GS*/
  .endm
@@ -12241,7 +13292,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_32.S linux-3.1.3/arch/x86/kernel/en
  /*
   * End of kprobes section
   */
-@@ -1109,7 +1358,7 @@ BUILD_INTERRUPT3(xen_hvm_callback_vector
+@@ -1109,7 +1358,7 @@ BUILD_INTERRUPT3(xen_hvm_callback_vector, XEN_HVM_EVTCHN_CALLBACK,
  
  ENTRY(mcount)
        ret
@@ -12368,9 +13419,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_32.S linux-3.1.3/arch/x86/kernel/en
  #endif
  
  /*
-diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/entry_64.S
---- linux-3.1.3/arch/x86/kernel/entry_64.S     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/entry_64.S     2011-11-17 18:28:56.000000000 -0500
+diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
+index 6419bb0..00440bf 100644
+--- a/arch/x86/kernel/entry_64.S
++++ b/arch/x86/kernel/entry_64.S
 @@ -55,6 +55,8 @@
  #include <asm/paravirt.h>
  #include <asm/ftrace.h>
@@ -12444,7 +13496,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
        jmp *%rdi
  #endif
  
-@@ -178,6 +186,269 @@ ENTRY(native_usergs_sysret64)
+@@ -178,6 +186,282 @@ ENTRY(native_usergs_sysret64)
  ENDPROC(native_usergs_sysret64)
  #endif /* CONFIG_PARAVIRT */
  
@@ -12463,6 +13515,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
 +      .endm
 +
 +      .macro pax_enter_kernel
++      pax_set_fptr_mask
 +#ifdef CONFIG_PAX_KERNEXEC
 +      call pax_enter_kernel
 +#endif
@@ -12484,14 +13537,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
 +
 +      GET_CR0_INTO_RDI
 +      bts $16,%rdi
-+      jnc 1f
++      jnc 3f
 +      mov %cs,%edi
 +      cmp $__KERNEL_CS,%edi
-+      jz 3f
-+      ljmpq __KERNEL_CS,3f
-+1:    ljmpq __KERNEXEC_KERNEL_CS,2f
-+2:    SET_RDI_INTO_CR0
-+3:
++      jnz 2f
++1:
 +
 +#ifdef CONFIG_PARAVIRT
 +      PV_RESTORE_REGS(CLBR_RDI)
@@ -12500,6 +13550,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
 +      popq %rdi
 +      pax_force_retaddr
 +      retq
++
++2:    ljmpq __KERNEL_CS,1f
++3:    ljmpq __KERNEXEC_KERNEL_CS,4f
++4:    SET_RDI_INTO_CR0
++      jmp 1b
 +ENDPROC(pax_enter_kernel)
 +
 +ENTRY(pax_exit_kernel)
@@ -12511,13 +13566,22 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
 +
 +      mov %cs,%rdi
 +      cmp $__KERNEXEC_KERNEL_CS,%edi
-+      jnz 2f
-+      GET_CR0_INTO_RDI
-+      btr $16,%rdi
-+      ljmpq __KERNEL_CS,1f
-+1:    SET_RDI_INTO_CR0
-+2:
++      jz 2f
++1:
++
++#ifdef CONFIG_PARAVIRT
++      PV_RESTORE_REGS(CLBR_RDI);
++#endif
++
++      popq %rdi
++      pax_force_retaddr
++      retq
 +
++2:    GET_CR0_INTO_RDI
++      btr $16,%rdi
++      ljmpq __KERNEL_CS,3f
++3:    SET_RDI_INTO_CR0
++      jmp 1b
 +#ifdef CONFIG_PARAVIRT
 +      PV_RESTORE_REGS(CLBR_RDI);
 +#endif
@@ -12529,6 +13593,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
 +#endif
 +
 +      .macro pax_enter_kernel_user
++      pax_set_fptr_mask
 +#ifdef CONFIG_PAX_MEMORY_UDEREF
 +      call pax_enter_kernel_user
 +#endif
@@ -12661,16 +13726,16 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
 +
 +#ifdef CONFIG_PAX_MEMORY_STACKLEAK
 +/*
-+ * r10: thread_info
++ * r11: thread_info
 + * rcx, rdx: can be clobbered
 + */
 +ENTRY(pax_erase_kstack)
 +      pushq %rdi
 +      pushq %rax
-+      pushq %r10
++      pushq %r11
 +
-+      GET_THREAD_INFO(%r10)
-+      mov TI_lowest_stack(%r10), %rdi
++      GET_THREAD_INFO(%r11)
++      mov TI_lowest_stack(%r11), %rdi
 +      mov $-0xBEEF, %rax
 +      std
 +
@@ -12700,11 +13765,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
 +      shr $3, %ecx
 +      rep stosq
 +
-+      mov TI_task_thread_sp0(%r10), %rdi
++      mov TI_task_thread_sp0(%r11), %rdi
 +      sub $256, %rdi
-+      mov %rdi, TI_lowest_stack(%r10)
++      mov %rdi, TI_lowest_stack(%r11)
 +
-+      popq %r10
++      popq %r11
 +      popq %rax
 +      popq %rdi
 +      pax_force_retaddr
@@ -12714,7 +13779,18 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
  
  .macro TRACE_IRQS_IRETQ offset=ARGOFFSET
  #ifdef CONFIG_TRACE_IRQFLAGS
-@@ -319,7 +590,7 @@ ENDPROC(native_usergs_sysret64)
+@@ -231,8 +515,8 @@ ENDPROC(native_usergs_sysret64)
+       .endm
+       .macro UNFAKE_STACK_FRAME
+-      addq $8*6, %rsp
+-      CFI_ADJUST_CFA_OFFSET   -(6*8)
++      addq $8*6 + ARG_SKIP, %rsp
++      CFI_ADJUST_CFA_OFFSET   -(6*8 + ARG_SKIP)
+       .endm
+ /*
+@@ -319,7 +603,7 @@ ENDPROC(native_usergs_sysret64)
        movq %rsp, %rsi
  
        leaq -RBP(%rsp),%rdi    /* arg1 for handler */
@@ -12723,7 +13799,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
        je 1f
        SWAPGS
        /*
-@@ -350,9 +621,10 @@ ENTRY(save_rest)
+@@ -350,9 +634,10 @@ ENTRY(save_rest)
        movq_cfi r15, R15+16
        movq %r11, 8(%rsp)      /* return address */
        FIXUP_TOP_OF_STACK %r11, 16
@@ -12735,12 +13811,12 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
  
  /* save complete stack frame */
        .pushsection .kprobes.text, "ax"
-@@ -381,9 +653,10 @@ ENTRY(save_paranoid)
+@@ -381,9 +666,10 @@ ENTRY(save_paranoid)
        js 1f   /* negative -> in kernel */
        SWAPGS
        xorl %ebx,%ebx
 -1:    ret
-+1:    pax_force_retaddr
++1:    pax_force_retaddr_bts
 +      ret
        CFI_ENDPROC
 -END(save_paranoid)
@@ -12748,7 +13824,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
        .popsection
  
  /*
-@@ -405,7 +678,7 @@ ENTRY(ret_from_fork)
+@@ -405,7 +691,7 @@ ENTRY(ret_from_fork)
  
        RESTORE_REST
  
@@ -12757,7 +13833,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
        je   int_ret_from_sys_call
  
        testl $_TIF_IA32, TI_flags(%rcx)        # 32-bit compat task needs IRET
-@@ -415,7 +688,7 @@ ENTRY(ret_from_fork)
+@@ -415,7 +701,7 @@ ENTRY(ret_from_fork)
        jmp ret_from_sys_call                   # go to the SYSRET fastpath
  
        CFI_ENDPROC
@@ -12766,7 +13842,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
  
  /*
   * System call entry. Up to 6 arguments in registers are supported.
-@@ -451,7 +724,7 @@ END(ret_from_fork)
+@@ -451,7 +737,7 @@ END(ret_from_fork)
  ENTRY(system_call)
        CFI_STARTPROC   simple
        CFI_SIGNAL_FRAME
@@ -12775,10 +13851,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
        CFI_REGISTER    rip,rcx
        /*CFI_REGISTER  rflags,r11*/
        SWAPGS_UNSAFE_STACK
-@@ -464,12 +737,13 @@ ENTRY(system_call_after_swapgs)
+@@ -464,12 +750,13 @@ ENTRY(system_call_after_swapgs)
  
        movq    %rsp,PER_CPU_VAR(old_rsp)
        movq    PER_CPU_VAR(kernel_stack),%rsp
++      SAVE_ARGS 8*6,0
 +      pax_enter_kernel_user
        /*
         * No need to follow this irqs off/on section - it's straight
@@ -12786,11 +13863,19 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
         */
        ENABLE_INTERRUPTS(CLBR_NONE)
 -      SAVE_ARGS 8,0
-+      SAVE_ARGS 8*6,0
        movq  %rax,ORIG_RAX-ARGOFFSET(%rsp)
        movq  %rcx,RIP-ARGOFFSET(%rsp)
        CFI_REL_OFFSET rip,RIP-ARGOFFSET
-@@ -498,6 +772,8 @@ sysret_check:
+@@ -479,7 +766,7 @@ ENTRY(system_call_after_swapgs)
+ system_call_fastpath:
+       cmpq $__NR_syscall_max,%rax
+       ja badsys
+-      movq %r10,%rcx
++      movq R10-ARGOFFSET(%rsp),%rcx
+       call *sys_call_table(,%rax,8)  # XXX:    rip relative
+       movq %rax,RAX-ARGOFFSET(%rsp)
+ /*
+@@ -498,6 +785,8 @@ sysret_check:
        andl %edi,%edx
        jnz  sysret_careful
        CFI_REMEMBER_STATE
@@ -12799,7 +13884,15 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
        /*
         * sysretq will re-enable interrupts:
         */
-@@ -556,6 +832,9 @@ auditsys:
+@@ -549,14 +838,18 @@ badsys:
+        * jump back to the normal fast path.
+        */
+ auditsys:
+-      movq %r10,%r9                   /* 6th arg: 4th syscall arg */
++      movq R10-ARGOFFSET(%rsp),%r9    /* 6th arg: 4th syscall arg */
+       movq %rdx,%r8                   /* 5th arg: 3rd syscall arg */
+       movq %rsi,%rcx                  /* 4th arg: 2nd syscall arg */
+       movq %rdi,%rdx                  /* 3rd arg: 1st syscall arg */
        movq %rax,%rsi                  /* 2nd arg: syscall number */
        movl $AUDIT_ARCH_X86_64,%edi    /* 1st arg: audit arch */
        call audit_syscall_entry
@@ -12807,9 +13900,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
 +      pax_erase_kstack
 +
        LOAD_ARGS 0             /* reload call-clobbered registers */
++      pax_set_fptr_mask
        jmp system_call_fastpath
  
-@@ -586,6 +865,9 @@ tracesys:
+       /*
+@@ -586,16 +879,20 @@ tracesys:
        FIXUP_TOP_OF_STACK %rdi
        movq %rsp,%rdi
        call syscall_trace_enter
@@ -12819,7 +13914,19 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
        /*
         * Reload arg registers from stack in case ptrace changed them.
         * We don't reload %rax because syscall_trace_enter() returned
-@@ -607,7 +889,7 @@ tracesys:
+        * the value it wants us to use in the table lookup.
+        */
+       LOAD_ARGS ARGOFFSET, 1
++      pax_set_fptr_mask
+       RESTORE_REST
+       cmpq $__NR_syscall_max,%rax
+       ja   int_ret_from_sys_call      /* RAX(%rsp) set to -ENOSYS above */
+-      movq %r10,%rcx  /* fixup for C */
++      movq R10-ARGOFFSET(%rsp),%rcx   /* fixup for C */
+       call *sys_call_table(,%rax,8)
+       movq %rax,RAX-ARGOFFSET(%rsp)
+       /* Use IRET because user could have changed frame */
+@@ -607,7 +904,7 @@ tracesys:
  GLOBAL(int_ret_from_sys_call)
        DISABLE_INTERRUPTS(CLBR_NONE)
        TRACE_IRQS_OFF
@@ -12828,7 +13935,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
        je retint_restore_args
        movl $_TIF_ALLWORK_MASK,%edi
        /* edi: mask to check */
-@@ -664,7 +946,7 @@ int_restore_rest:
+@@ -664,7 +961,7 @@ int_restore_rest:
        TRACE_IRQS_OFF
        jmp int_with_check
        CFI_ENDPROC
@@ -12837,7 +13944,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
  
  /*
   * Certain special system calls that need to save a complete full stack frame.
-@@ -680,7 +962,7 @@ ENTRY(\label)
+@@ -680,7 +977,7 @@ ENTRY(\label)
        call \func
        jmp ptregscall_common
        CFI_ENDPROC
@@ -12846,7 +13953,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
        .endm
  
        PTREGSCALL stub_clone, sys_clone, %r8
-@@ -698,9 +980,10 @@ ENTRY(ptregscall_common)
+@@ -698,9 +995,10 @@ ENTRY(ptregscall_common)
        movq_cfi_restore R12+8, r12
        movq_cfi_restore RBP+8, rbp
        movq_cfi_restore RBX+8, rbx
@@ -12858,7 +13965,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
  
  ENTRY(stub_execve)
        CFI_STARTPROC
-@@ -715,7 +998,7 @@ ENTRY(stub_execve)
+@@ -715,7 +1013,7 @@ ENTRY(stub_execve)
        RESTORE_REST
        jmp int_ret_from_sys_call
        CFI_ENDPROC
@@ -12867,7 +13974,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
  
  /*
   * sigreturn is special because it needs to restore all registers on return.
-@@ -733,7 +1016,7 @@ ENTRY(stub_rt_sigreturn)
+@@ -733,7 +1031,7 @@ ENTRY(stub_rt_sigreturn)
        RESTORE_REST
        jmp int_ret_from_sys_call
        CFI_ENDPROC
@@ -12876,7 +13983,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
  
  /*
   * Build the entry stubs and pointer table with some assembler magic.
-@@ -768,7 +1051,7 @@ vector=vector+1
+@@ -768,7 +1066,7 @@ vector=vector+1
  2:    jmp common_interrupt
  .endr
        CFI_ENDPROC
@@ -12885,7 +13992,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
  
  .previous
  END(interrupt)
-@@ -789,6 +1072,16 @@ END(interrupt)
+@@ -789,6 +1087,16 @@ END(interrupt)
        CFI_ADJUST_CFA_OFFSET ORIG_RAX-RBP
        SAVE_ARGS_IRQ
        PARTIAL_FRAME 0
@@ -12902,7 +14009,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
        call \func
        .endm
  
-@@ -820,7 +1113,7 @@ ret_from_intr:
+@@ -820,7 +1128,7 @@ ret_from_intr:
  
  exit_intr:
        GET_THREAD_INFO(%rcx)
@@ -12911,7 +14018,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
        je retint_kernel
  
        /* Interrupt came from user space */
-@@ -842,12 +1135,16 @@ retint_swapgs:          /* return to user-space 
+@@ -842,12 +1150,16 @@ retint_swapgs:          /* return to user-space */
         * The iretq could re-enable interrupts:
         */
        DISABLE_INTERRUPTS(CLBR_ANY)
@@ -12928,7 +14035,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
        /*
         * The iretq could re-enable interrupts:
         */
-@@ -936,7 +1233,7 @@ ENTRY(retint_kernel)
+@@ -936,7 +1248,7 @@ ENTRY(retint_kernel)
  #endif
  
        CFI_ENDPROC
@@ -12937,7 +14044,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
  /*
   * End of kprobes section
   */
-@@ -952,7 +1249,7 @@ ENTRY(\sym)
+@@ -952,7 +1264,7 @@ ENTRY(\sym)
        interrupt \do_sym
        jmp ret_from_intr
        CFI_ENDPROC
@@ -12946,7 +14053,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
  .endm
  
  #ifdef CONFIG_SMP
-@@ -1017,12 +1314,22 @@ ENTRY(\sym)
+@@ -1017,12 +1329,22 @@ ENTRY(\sym)
        CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15
        call error_entry
        DEFAULT_FRAME 0
@@ -12970,7 +14077,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
  .endm
  
  .macro paranoidzeroentry sym do_sym
-@@ -1034,15 +1341,25 @@ ENTRY(\sym)
+@@ -1034,15 +1356,25 @@ ENTRY(\sym)
        CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15
        call save_paranoid
        TRACE_IRQS_OFF
@@ -12998,7 +14105,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
  .macro paranoidzeroentry_ist sym do_sym ist
  ENTRY(\sym)
        INTR_FRAME
-@@ -1052,14 +1369,30 @@ ENTRY(\sym)
+@@ -1052,14 +1384,30 @@ ENTRY(\sym)
        CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15
        call save_paranoid
        TRACE_IRQS_OFF
@@ -13030,7 +14137,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
  .endm
  
  .macro errorentry sym do_sym
-@@ -1070,13 +1403,23 @@ ENTRY(\sym)
+@@ -1070,13 +1418,23 @@ ENTRY(\sym)
        CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15
        call error_entry
        DEFAULT_FRAME 0
@@ -13055,7 +14162,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
  .endm
  
        /* error code is on the stack already */
-@@ -1089,13 +1432,23 @@ ENTRY(\sym)
+@@ -1089,13 +1447,23 @@ ENTRY(\sym)
        call save_paranoid
        DEFAULT_FRAME 0
        TRACE_IRQS_OFF
@@ -13080,7 +14187,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
  .endm
  
  zeroentry divide_error do_divide_error
-@@ -1125,9 +1478,10 @@ gs_change:
+@@ -1125,9 +1493,10 @@ gs_change:
  2:    mfence          /* workaround */
        SWAPGS
        popfq_cfi
@@ -13092,7 +14199,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
  
        .section __ex_table,"a"
        .align 8
-@@ -1149,13 +1503,14 @@ ENTRY(kernel_thread_helper)
+@@ -1149,13 +1518,14 @@ ENTRY(kernel_thread_helper)
         * Here we are in the child and the registers are set as they were
         * at kernel_thread() invocation in the parent.
         */
@@ -13108,9 +14215,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
  
  /*
   * execve(). This function needs to use IRET, not SYSRET, to set up all state properly.
-@@ -1184,9 +1539,10 @@ ENTRY(kernel_execve)
+@@ -1182,11 +1552,11 @@ ENTRY(kernel_execve)
+       RESTORE_REST
+       testq %rax,%rax
        je int_ret_from_sys_call
-       RESTORE_ARGS
+-      RESTORE_ARGS
        UNFAKE_STACK_FRAME
 +      pax_force_retaddr
        ret
@@ -13120,7 +14229,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
  
  /* Call softirq on interrupt stack. Interrupts are off. */
  ENTRY(call_softirq)
-@@ -1204,9 +1560,10 @@ ENTRY(call_softirq)
+@@ -1204,9 +1574,10 @@ ENTRY(call_softirq)
        CFI_DEF_CFA_REGISTER    rsp
        CFI_ADJUST_CFA_OFFSET   -8
        decl PER_CPU_VAR(irq_count)
@@ -13132,7 +14241,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
  
  #ifdef CONFIG_XEN
  zeroentry xen_hypervisor_callback xen_do_hypervisor_callback
-@@ -1244,7 +1601,7 @@ ENTRY(xen_do_hypervisor_callback)   # do
+@@ -1244,7 +1615,7 @@ ENTRY(xen_do_hypervisor_callback)   # do_hypervisor_callback(struct *pt_regs)
        decl PER_CPU_VAR(irq_count)
        jmp  error_exit
        CFI_ENDPROC
@@ -13141,7 +14250,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
  
  /*
   * Hypervisor uses this for application faults while it executes.
-@@ -1303,7 +1660,7 @@ ENTRY(xen_failsafe_callback)
+@@ -1303,7 +1674,7 @@ ENTRY(xen_failsafe_callback)
        SAVE_ALL
        jmp error_exit
        CFI_ENDPROC
@@ -13150,7 +14259,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
  
  apicinterrupt XEN_HVM_EVTCHN_CALLBACK \
        xen_hvm_callback_vector xen_evtchn_do_upcall
-@@ -1352,16 +1709,31 @@ ENTRY(paranoid_exit)
+@@ -1352,16 +1723,31 @@ ENTRY(paranoid_exit)
        TRACE_IRQS_OFF
        testl %ebx,%ebx                         /* swapgs needed? */
        jnz paranoid_restore
@@ -13162,7 +14271,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
 +      TRACE_IRQS_IRETQ 0
 +      SWAPGS_UNSAFE_STACK
 +      RESTORE_ALL 8
-+      pax_force_retaddr
++      pax_force_retaddr_bts
 +      jmp irq_return
 +#endif
  paranoid_swapgs:
@@ -13179,11 +14288,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
 +      pax_exit_kernel
        TRACE_IRQS_IRETQ 0
        RESTORE_ALL 8
-+      pax_force_retaddr
++      pax_force_retaddr_bts
        jmp irq_return
  paranoid_userspace:
        GET_THREAD_INFO(%rcx)
-@@ -1390,7 +1762,7 @@ paranoid_schedule:
+@@ -1390,7 +1776,7 @@ paranoid_schedule:
        TRACE_IRQS_OFF
        jmp paranoid_userspace
        CFI_ENDPROC
@@ -13192,7 +14301,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
  
  /*
   * Exception entry point. This expects an error code/orig_rax on the stack.
-@@ -1417,12 +1789,13 @@ ENTRY(error_entry)
+@@ -1417,12 +1803,13 @@ ENTRY(error_entry)
        movq_cfi r14, R14+8
        movq_cfi r15, R15+8
        xorl %ebx,%ebx
@@ -13203,11 +14312,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
        SWAPGS
  error_sti:
        TRACE_IRQS_OFF
-+      pax_force_retaddr
++      pax_force_retaddr_bts
        ret
  
  /*
-@@ -1449,7 +1822,7 @@ bstep_iret:
+@@ -1449,7 +1836,7 @@ bstep_iret:
        movq %rcx,RIP+8(%rsp)
        jmp error_swapgs
        CFI_ENDPROC
@@ -13216,7 +14325,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
  
  
  /* ebx:       no swapgs flag (1: don't need swapgs, 0: need it) */
-@@ -1469,7 +1842,7 @@ ENTRY(error_exit)
+@@ -1469,7 +1856,7 @@ ENTRY(error_exit)
        jnz retint_careful
        jmp retint_swapgs
        CFI_ENDPROC
@@ -13225,7 +14334,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
  
  
        /* runs on exception stack */
-@@ -1481,6 +1854,16 @@ ENTRY(nmi)
+@@ -1481,6 +1868,16 @@ ENTRY(nmi)
        CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15
        call save_paranoid
        DEFAULT_FRAME 0
@@ -13242,7 +14351,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
        /* paranoidentry do_nmi, 0; without TRACE_IRQS_OFF */
        movq %rsp,%rdi
        movq $-1,%rsi
-@@ -1491,12 +1874,28 @@ ENTRY(nmi)
+@@ -1491,12 +1888,28 @@ ENTRY(nmi)
        DISABLE_INTERRUPTS(CLBR_NONE)
        testl %ebx,%ebx                         /* swapgs needed? */
        jnz nmi_restore
@@ -13253,7 +14362,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
 +      pax_exit_kernel
 +      SWAPGS_UNSAFE_STACK
 +      RESTORE_ALL 8
-+      pax_force_retaddr
++      pax_force_retaddr_bts
 +      jmp irq_return
 +#endif
  nmi_swapgs:
@@ -13268,11 +14377,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
  nmi_restore:
 +      pax_exit_kernel
        RESTORE_ALL 8
-+      pax_force_retaddr
++      pax_force_retaddr_bts
        jmp irq_return
  nmi_userspace:
        GET_THREAD_INFO(%rcx)
-@@ -1525,14 +1924,14 @@ nmi_schedule:
+@@ -1525,14 +1938,14 @@ nmi_schedule:
        jmp paranoid_exit
        CFI_ENDPROC
  #endif
@@ -13289,10 +14398,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/en
  
  /*
   * End of kprobes section
-diff -urNp linux-3.1.3/arch/x86/kernel/ftrace.c linux-3.1.3/arch/x86/kernel/ftrace.c
---- linux-3.1.3/arch/x86/kernel/ftrace.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/ftrace.c       2011-11-16 18:39:07.000000000 -0500
-@@ -126,7 +126,7 @@ static void *mod_code_ip;          /* holds the 
+diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
+index c9a281f..ce2f317 100644
+--- a/arch/x86/kernel/ftrace.c
++++ b/arch/x86/kernel/ftrace.c
+@@ -126,7 +126,7 @@ static void *mod_code_ip;          /* holds the IP to write to */
  static const void *mod_code_newcode;  /* holds the text to write to the IP */
  
  static unsigned nmi_wait_count;
@@ -13301,7 +14411,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/ftrace.c linux-3.1.3/arch/x86/kernel/ftra
  
  int ftrace_arch_read_dyn_info(char *buf, int size)
  {
-@@ -134,7 +134,7 @@ int ftrace_arch_read_dyn_info(char *buf,
+@@ -134,7 +134,7 @@ int ftrace_arch_read_dyn_info(char *buf, int size)
  
        r = snprintf(buf, size, "%u %u",
                     nmi_wait_count,
@@ -13322,7 +14432,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/ftrace.c linux-3.1.3/arch/x86/kernel/ftra
        }
        /* Must have previous changes seen before executions */
        smp_mb();
-@@ -271,6 +273,8 @@ ftrace_modify_code(unsigned long ip, uns
+@@ -271,6 +273,8 @@ ftrace_modify_code(unsigned long ip, unsigned const char *old_code,
  {
        unsigned char replaced[MCOUNT_INSN_SIZE];
  
@@ -13331,7 +14441,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/ftrace.c linux-3.1.3/arch/x86/kernel/ftra
        /*
         * Note: Due to modules and __init, code can
         *  disappear and change, we need to protect against faulting
-@@ -327,7 +331,7 @@ int ftrace_update_ftrace_func(ftrace_fun
+@@ -327,7 +331,7 @@ int ftrace_update_ftrace_func(ftrace_func_t func)
        unsigned char old[MCOUNT_INSN_SIZE], *new;
        int ret;
  
@@ -13340,7 +14450,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/ftrace.c linux-3.1.3/arch/x86/kernel/ftra
        new = ftrace_call_replace(ip, (unsigned long)func);
        ret = ftrace_modify_code(ip, old, new);
  
-@@ -353,6 +357,8 @@ static int ftrace_mod_jmp(unsigned long 
+@@ -353,6 +357,8 @@ static int ftrace_mod_jmp(unsigned long ip,
  {
        unsigned char code[MCOUNT_INSN_SIZE];
  
@@ -13349,9 +14459,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/ftrace.c linux-3.1.3/arch/x86/kernel/ftra
        if (probe_kernel_read(code, (void *)ip, MCOUNT_INSN_SIZE))
                return -EFAULT;
  
-diff -urNp linux-3.1.3/arch/x86/kernel/head32.c linux-3.1.3/arch/x86/kernel/head32.c
---- linux-3.1.3/arch/x86/kernel/head32.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/head32.c       2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/kernel/head32.c b/arch/x86/kernel/head32.c
+index 3bb0850..55a56f4 100644
+--- a/arch/x86/kernel/head32.c
++++ b/arch/x86/kernel/head32.c
 @@ -19,6 +19,7 @@
  #include <asm/io_apic.h>
  #include <asm/bios_ebda.h>
@@ -13369,9 +14480,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/head32.c linux-3.1.3/arch/x86/kernel/head
  
  #ifdef CONFIG_BLK_DEV_INITRD
        /* Reserve INITRD */
-diff -urNp linux-3.1.3/arch/x86/kernel/head_32.S linux-3.1.3/arch/x86/kernel/head_32.S
---- linux-3.1.3/arch/x86/kernel/head_32.S      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/head_32.S      2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
+index ce0be7c..c41476e 100644
+--- a/arch/x86/kernel/head_32.S
++++ b/arch/x86/kernel/head_32.S
 @@ -25,6 +25,12 @@
  /* Physical address */
  #define pa(X) ((X) - __PAGE_OFFSET)
@@ -13398,7 +14510,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/head_32.S linux-3.1.3/arch/x86/kernel/hea
  
  /* Number of possible pages in the lowmem region */
  LOWMEM_PAGES = (((1<<32) - __PAGE_OFFSET) >> PAGE_SHIFT)
-@@ -77,6 +79,12 @@ INIT_MAP_SIZE = PAGE_TABLE_SIZE(KERNEL_P
+@@ -77,6 +79,12 @@ INIT_MAP_SIZE = PAGE_TABLE_SIZE(KERNEL_PAGES) * PAGE_SIZE
  RESERVE_BRK(pagetables, INIT_MAP_SIZE)
  
  /*
@@ -13708,9 +14820,9 @@ diff -urNp linux-3.1.3/arch/x86/kernel/head_32.S linux-3.1.3/arch/x86/kernel/hea
  ENTRY(stack_start)
 -      .long init_thread_union+THREAD_SIZE
 +      .long init_thread_union+THREAD_SIZE-8
-+
-+ready:        .byte 0
  
++ready:        .byte 0
++
 +.section .rodata,"a",@progbits
  early_recursion_flag:
        .long 0
@@ -13806,33 +14918,38 @@ diff -urNp linux-3.1.3/arch/x86/kernel/head_32.S linux-3.1.3/arch/x86/kernel/hea
 +      /* Be sure this is zeroed to avoid false validations in Xen */
 +      .fill PAGE_SIZE_asm - GDT_SIZE,1,0
 +      .endr
-diff -urNp linux-3.1.3/arch/x86/kernel/head_64.S linux-3.1.3/arch/x86/kernel/head_64.S
---- linux-3.1.3/arch/x86/kernel/head_64.S      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/head_64.S      2011-11-16 18:39:07.000000000 -0500
-@@ -19,6 +19,7 @@
+diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
+index e11e394..9aebc5d 100644
+--- a/arch/x86/kernel/head_64.S
++++ b/arch/x86/kernel/head_64.S
+@@ -19,6 +19,8 @@
  #include <asm/cache.h>
  #include <asm/processor-flags.h>
  #include <asm/percpu.h>
 +#include <asm/cpufeature.h>
++#include <asm/alternative-asm.h>
  
  #ifdef CONFIG_PARAVIRT
  #include <asm/asm-offsets.h>
-@@ -38,6 +39,10 @@ L4_PAGE_OFFSET = pgd_index(__PAGE_OFFSET
+@@ -38,6 +40,12 @@ L4_PAGE_OFFSET = pgd_index(__PAGE_OFFSET)
  L3_PAGE_OFFSET = pud_index(__PAGE_OFFSET)
  L4_START_KERNEL = pgd_index(__START_KERNEL_map)
  L3_START_KERNEL = pud_index(__START_KERNEL_map)
 +L4_VMALLOC_START = pgd_index(VMALLOC_START)
 +L3_VMALLOC_START = pud_index(VMALLOC_START)
++L4_VMALLOC_END = pgd_index(VMALLOC_END)
++L3_VMALLOC_END = pud_index(VMALLOC_END)
 +L4_VMEMMAP_START = pgd_index(VMEMMAP_START)
 +L3_VMEMMAP_START = pud_index(VMEMMAP_START)
  
        .text
        __HEAD
-@@ -85,35 +90,22 @@ startup_64:
+@@ -85,35 +93,23 @@ startup_64:
         */
        addq    %rbp, init_level4_pgt + 0(%rip)
        addq    %rbp, init_level4_pgt + (L4_PAGE_OFFSET*8)(%rip)
 +      addq    %rbp, init_level4_pgt + (L4_VMALLOC_START*8)(%rip)
++      addq    %rbp, init_level4_pgt + (L4_VMALLOC_END*8)(%rip)
 +      addq    %rbp, init_level4_pgt + (L4_VMEMMAP_START*8)(%rip)
        addq    %rbp, init_level4_pgt + (L4_START_KERNEL*8)(%rip)
  
@@ -13844,11 +14961,12 @@ diff -urNp linux-3.1.3/arch/x86/kernel/head_64.S linux-3.1.3/arch/x86/kernel/hea
 -      addq    %rbp, level3_kernel_pgt + (510*8)(%rip)
 -      addq    %rbp, level3_kernel_pgt + (511*8)(%rip)
 +      addq    %rbp, level3_vmemmap_pgt + (L3_VMEMMAP_START*8)(%rip)
--      addq    %rbp, level2_fixmap_pgt + (506*8)(%rip)
++
 +      addq    %rbp, level3_kernel_pgt + (L3_START_KERNEL*8)(%rip)
 +      addq    %rbp, level3_kernel_pgt + (L3_START_KERNEL*8+8)(%rip)
  
+       addq    %rbp, level2_fixmap_pgt + (506*8)(%rip)
+-
 -      /* Add an Identity mapping if I am above 1G */
 -      leaq    _text(%rip), %rdi
 -      andq    $PMD_PAGE_MASK, %rdi
@@ -13869,12 +14987,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/head_64.S linux-3.1.3/arch/x86/kernel/hea
 -      leaq    level2_spare_pgt(%rip), %rbx
 -      movq    %rdx, 0(%rbx, %rax, 8)
 -ident_complete:
-+      addq    %rbp, level2_fixmap_pgt + (506*8)(%rip)
 +      addq    %rbp, level2_fixmap_pgt + (507*8)(%rip)
  
        /*
         * Fixup the kernel text+data virtual addresses. Note that
-@@ -160,8 +152,8 @@ ENTRY(secondary_startup_64)
+@@ -160,8 +156,8 @@ ENTRY(secondary_startup_64)
         * after the boot processor executes this code.
         */
  
@@ -13885,7 +15002,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/head_64.S linux-3.1.3/arch/x86/kernel/hea
        movq    %rax, %cr4
  
        /* Setup early boot stage 4 level pagetables. */
-@@ -183,9 +175,14 @@ ENTRY(secondary_startup_64)
+@@ -183,9 +179,17 @@ ENTRY(secondary_startup_64)
        movl    $MSR_EFER, %ecx
        rdmsr
        btsl    $_EFER_SCE, %eax        /* Enable System Call */
@@ -13894,14 +15011,25 @@ diff -urNp linux-3.1.3/arch/x86/kernel/head_64.S linux-3.1.3/arch/x86/kernel/hea
        jnc     1f
        btsl    $_EFER_NX, %eax
 +      leaq    init_level4_pgt(%rip), %rdi
++#ifndef CONFIG_EFI
 +      btsq    $_PAGE_BIT_NX, 8*L4_PAGE_OFFSET(%rdi)
++#endif
 +      btsq    $_PAGE_BIT_NX, 8*L4_VMALLOC_START(%rdi)
++      btsq    $_PAGE_BIT_NX, 8*L4_VMALLOC_END(%rdi)
 +      btsq    $_PAGE_BIT_NX, 8*L4_VMEMMAP_START(%rdi)
 +      btsq    $_PAGE_BIT_NX, __supported_pte_mask(%rip)
  1:    wrmsr                           /* Make changes effective */
  
        /* Setup cr0 */
-@@ -269,7 +266,7 @@ ENTRY(secondary_startup_64)
+@@ -247,6 +251,7 @@ ENTRY(secondary_startup_64)
+        * jump.  In addition we need to ensure %cs is set so we make this
+        * a far return.
+        */
++      pax_set_fptr_mask
+       movq    initial_code(%rip),%rax
+       pushq   $0              # fake return address to stop unwinder
+       pushq   $__KERNEL_CS    # set correct cs
+@@ -269,7 +274,7 @@ ENTRY(secondary_startup_64)
  bad_address:
        jmp bad_address
  
@@ -13910,7 +15038,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/head_64.S linux-3.1.3/arch/x86/kernel/hea
  #ifdef CONFIG_EARLY_PRINTK
        .globl early_idt_handlers
  early_idt_handlers:
-@@ -314,18 +311,23 @@ ENTRY(early_idt_handler)
+@@ -314,18 +319,23 @@ ENTRY(early_idt_handler)
  #endif /* EARLY_PRINTK */
  1:    hlt
        jmp 1b
@@ -13927,15 +15055,15 @@ diff -urNp linux-3.1.3/arch/x86/kernel/head_64.S linux-3.1.3/arch/x86/kernel/hea
        .asciz "PANIC: early exception %02lx rip %lx:%lx error %lx cr2 %lx\n"
  early_idt_ripmsg:
        .asciz "RIP %s\n"
--#endif /* CONFIG_EARLY_PRINTK */
-       .previous
-+#endif /* CONFIG_EARLY_PRINTK */
++      .previous
+ #endif /* CONFIG_EARLY_PRINTK */
+-      .previous
  
 +      .section .rodata,"a",@progbits
  #define NEXT_PAGE(name) \
        .balign PAGE_SIZE; \
  ENTRY(name)
-@@ -338,7 +340,6 @@ ENTRY(name)
+@@ -338,7 +348,6 @@ ENTRY(name)
        i = i + 1 ;                                     \
        .endr
  
@@ -13943,12 +15071,14 @@ diff -urNp linux-3.1.3/arch/x86/kernel/head_64.S linux-3.1.3/arch/x86/kernel/hea
        /*
         * This default setting generates an ident mapping at address 0x100000
         * and a mapping for the kernel that precisely maps virtual address
-@@ -349,13 +350,36 @@ NEXT_PAGE(init_level4_pgt)
+@@ -349,13 +358,41 @@ NEXT_PAGE(init_level4_pgt)
        .quad   level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE
        .org    init_level4_pgt + L4_PAGE_OFFSET*8, 0
        .quad   level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE
 +      .org    init_level4_pgt + L4_VMALLOC_START*8, 0
-+      .quad   level3_vmalloc_pgt - __START_KERNEL_map + _KERNPG_TABLE
++      .quad   level3_vmalloc_start_pgt - __START_KERNEL_map + _KERNPG_TABLE
++      .org    init_level4_pgt + L4_VMALLOC_END*8, 0
++      .quad   level3_vmalloc_end_pgt - __START_KERNEL_map + _KERNPG_TABLE
 +      .org    init_level4_pgt + L4_VMEMMAP_START*8, 0
 +      .quad   level3_vmemmap_pgt - __START_KERNEL_map + _KERNPG_TABLE
        .org    init_level4_pgt + L4_START_KERNEL*8, 0
@@ -13971,7 +15101,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/head_64.S linux-3.1.3/arch/x86/kernel/hea
 +      .fill   510,8,0
 +#endif
 +
-+NEXT_PAGE(level3_vmalloc_pgt)
++NEXT_PAGE(level3_vmalloc_start_pgt)
++      .fill   512,8,0
++
++NEXT_PAGE(level3_vmalloc_end_pgt)
 +      .fill   512,8,0
 +
 +NEXT_PAGE(level3_vmemmap_pgt)
@@ -13980,7 +15113,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/head_64.S linux-3.1.3/arch/x86/kernel/hea
  
  NEXT_PAGE(level3_kernel_pgt)
        .fill   L3_START_KERNEL,8,0
-@@ -363,20 +387,23 @@ NEXT_PAGE(level3_kernel_pgt)
+@@ -363,20 +400,23 @@ NEXT_PAGE(level3_kernel_pgt)
        .quad   level2_kernel_pgt - __START_KERNEL_map + _KERNPG_TABLE
        .quad   level2_fixmap_pgt - __START_KERNEL_map + _PAGE_TABLE
  
@@ -14012,7 +15145,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/head_64.S linux-3.1.3/arch/x86/kernel/hea
  
  NEXT_PAGE(level2_kernel_pgt)
        /*
-@@ -389,33 +416,55 @@ NEXT_PAGE(level2_kernel_pgt)
+@@ -389,33 +429,55 @@ NEXT_PAGE(level2_kernel_pgt)
         *  If you want to increase this then increase MODULES_VADDR
         *  too.)
         */
@@ -14078,9 +15211,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/head_64.S linux-3.1.3/arch/x86/kernel/hea
  
        __PAGE_ALIGNED_BSS
        .align PAGE_SIZE
-diff -urNp linux-3.1.3/arch/x86/kernel/i386_ksyms_32.c linux-3.1.3/arch/x86/kernel/i386_ksyms_32.c
---- linux-3.1.3/arch/x86/kernel/i386_ksyms_32.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/i386_ksyms_32.c        2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/kernel/i386_ksyms_32.c b/arch/x86/kernel/i386_ksyms_32.c
+index 9c3bd4a..e1d9b35 100644
+--- a/arch/x86/kernel/i386_ksyms_32.c
++++ b/arch/x86/kernel/i386_ksyms_32.c
 @@ -20,8 +20,12 @@ extern void cmpxchg8b_emu(void);
  EXPORT_SYMBOL(cmpxchg8b_emu);
  #endif
@@ -14102,9 +15236,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/i386_ksyms_32.c linux-3.1.3/arch/x86/kern
 +#ifdef CONFIG_PAX_KERNEXEC
 +EXPORT_SYMBOL(__LOAD_PHYSICAL_ADDR);
 +#endif
-diff -urNp linux-3.1.3/arch/x86/kernel/i8259.c linux-3.1.3/arch/x86/kernel/i8259.c
---- linux-3.1.3/arch/x86/kernel/i8259.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/i8259.c        2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/kernel/i8259.c b/arch/x86/kernel/i8259.c
+index 6104852..6114160 100644
+--- a/arch/x86/kernel/i8259.c
++++ b/arch/x86/kernel/i8259.c
 @@ -210,7 +210,7 @@ spurious_8259A_irq:
                               "spurious 8259A interrupt: IRQ%d.\n", irq);
                        spurious_irq_mask |= irqmask;
@@ -14114,10 +15249,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/i8259.c linux-3.1.3/arch/x86/kernel/i8259
                /*
                 * Theoretically we do not have to handle this IRQ,
                 * but in Linux this does not cause problems and is
-diff -urNp linux-3.1.3/arch/x86/kernel/init_task.c linux-3.1.3/arch/x86/kernel/init_task.c
---- linux-3.1.3/arch/x86/kernel/init_task.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/init_task.c    2011-11-16 18:39:07.000000000 -0500
-@@ -20,8 +20,7 @@ static struct sighand_struct init_sighan
+diff --git a/arch/x86/kernel/init_task.c b/arch/x86/kernel/init_task.c
+index 43e9ccf..44ccf6f 100644
+--- a/arch/x86/kernel/init_task.c
++++ b/arch/x86/kernel/init_task.c
+@@ -20,8 +20,7 @@ static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
   * way process stacks are handled. This is done by having a special
   * "init_task" linker map entry..
   */
@@ -14135,9 +15271,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/init_task.c linux-3.1.3/arch/x86/kernel/i
 -
 +struct tss_struct init_tss[NR_CPUS] ____cacheline_internodealigned_in_smp = { [0 ... NR_CPUS-1] = INIT_TSS };
 +EXPORT_SYMBOL(init_tss);
-diff -urNp linux-3.1.3/arch/x86/kernel/ioport.c linux-3.1.3/arch/x86/kernel/ioport.c
---- linux-3.1.3/arch/x86/kernel/ioport.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/ioport.c       2011-11-16 18:40:08.000000000 -0500
+diff --git a/arch/x86/kernel/ioport.c b/arch/x86/kernel/ioport.c
+index 8c96897..be66bfa 100644
+--- a/arch/x86/kernel/ioport.c
++++ b/arch/x86/kernel/ioport.c
 @@ -6,6 +6,7 @@
  #include <linux/sched.h>
  #include <linux/kernel.h>
@@ -14146,7 +15283,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/ioport.c linux-3.1.3/arch/x86/kernel/iopo
  #include <linux/errno.h>
  #include <linux/types.h>
  #include <linux/ioport.h>
-@@ -28,6 +29,12 @@ asmlinkage long sys_ioperm(unsigned long
+@@ -28,6 +29,12 @@ asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on)
  
        if ((from + num <= from) || (from + num > IO_BITMAP_BITS))
                return -EINVAL;
@@ -14159,7 +15296,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/ioport.c linux-3.1.3/arch/x86/kernel/iopo
        if (turn_on && !capable(CAP_SYS_RAWIO))
                return -EPERM;
  
-@@ -54,7 +61,7 @@ asmlinkage long sys_ioperm(unsigned long
+@@ -54,7 +61,7 @@ asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on)
         * because the ->io_bitmap_max value must match the bitmap
         * contents:
         */
@@ -14168,7 +15305,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/ioport.c linux-3.1.3/arch/x86/kernel/iopo
  
        if (turn_on)
                bitmap_clear(t->io_bitmap_ptr, from, num);
-@@ -102,6 +109,12 @@ long sys_iopl(unsigned int level, struct
+@@ -102,6 +109,12 @@ long sys_iopl(unsigned int level, struct pt_regs *regs)
                return -EINVAL;
        /* Trying to gain more privileges? */
        if (level > old) {
@@ -14181,9 +15318,48 @@ diff -urNp linux-3.1.3/arch/x86/kernel/ioport.c linux-3.1.3/arch/x86/kernel/iopo
                if (!capable(CAP_SYS_RAWIO))
                        return -EPERM;
        }
-diff -urNp linux-3.1.3/arch/x86/kernel/irq_32.c linux-3.1.3/arch/x86/kernel/irq_32.c
---- linux-3.1.3/arch/x86/kernel/irq_32.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/irq_32.c       2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
+index 6c0802e..bea25ae 100644
+--- a/arch/x86/kernel/irq.c
++++ b/arch/x86/kernel/irq.c
+@@ -17,7 +17,7 @@
+ #include <asm/mce.h>
+ #include <asm/hw_irq.h>
+-atomic_t irq_err_count;
++atomic_unchecked_t irq_err_count;
+ /* Function pointer for generic interrupt vector handling */
+ void (*x86_platform_ipi_callback)(void) = NULL;
+@@ -116,9 +116,9 @@ int arch_show_interrupts(struct seq_file *p, int prec)
+               seq_printf(p, "%10u ", per_cpu(mce_poll_count, j));
+       seq_printf(p, "  Machine check polls\n");
+ #endif
+-      seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count));
++      seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read_unchecked(&irq_err_count));
+ #if defined(CONFIG_X86_IO_APIC)
+-      seq_printf(p, "%*s: %10u\n", prec, "MIS", atomic_read(&irq_mis_count));
++      seq_printf(p, "%*s: %10u\n", prec, "MIS", atomic_read_unchecked(&irq_mis_count));
+ #endif
+       return 0;
+ }
+@@ -158,10 +158,10 @@ u64 arch_irq_stat_cpu(unsigned int cpu)
+ u64 arch_irq_stat(void)
+ {
+-      u64 sum = atomic_read(&irq_err_count);
++      u64 sum = atomic_read_unchecked(&irq_err_count);
+ #ifdef CONFIG_X86_IO_APIC
+-      sum += atomic_read(&irq_mis_count);
++      sum += atomic_read_unchecked(&irq_mis_count);
+ #endif
+       return sum;
+ }
+diff --git a/arch/x86/kernel/irq_32.c b/arch/x86/kernel/irq_32.c
+index 7209070..cbcd71a 100644
+--- a/arch/x86/kernel/irq_32.c
++++ b/arch/x86/kernel/irq_32.c
 @@ -36,7 +36,7 @@ static int check_stack_overflow(void)
        __asm__ __volatile__("andl %%esp,%0" :
                             "=r" (sp) : "0" (THREAD_SIZE - 1));
@@ -14193,7 +15369,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/irq_32.c linux-3.1.3/arch/x86/kernel/irq_
  }
  
  static void print_stack_overflow(void)
-@@ -54,8 +54,8 @@ static inline void print_stack_overflow(
+@@ -54,8 +54,8 @@ static inline void print_stack_overflow(void) { }
   * per-CPU IRQ handling contexts (thread information and stack)
   */
  union irq_ctx {
@@ -14204,7 +15380,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/irq_32.c linux-3.1.3/arch/x86/kernel/irq_
  } __attribute__((aligned(THREAD_SIZE)));
  
  static DEFINE_PER_CPU(union irq_ctx *, hardirq_ctx);
-@@ -75,10 +75,9 @@ static void call_on_stack(void *func, vo
+@@ -75,10 +75,9 @@ static void call_on_stack(void *func, void *stack)
  static inline int
  execute_on_irq_stack(int overflow, struct irq_desc *desc, int irq)
  {
@@ -14216,7 +15392,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/irq_32.c linux-3.1.3/arch/x86/kernel/irq_
        irqctx = __this_cpu_read(hardirq_ctx);
  
        /*
-@@ -87,21 +86,16 @@ execute_on_irq_stack(int overflow, struc
+@@ -87,21 +86,16 @@ execute_on_irq_stack(int overflow, struct irq_desc *desc, int irq)
         * handler) we can't do that and just have to keep using the
         * current stack (which is the irq stack already after all)
         */
@@ -14244,7 +15420,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/irq_32.c linux-3.1.3/arch/x86/kernel/irq_
  
        if (unlikely(overflow))
                call_on_stack(print_stack_overflow, isp);
-@@ -113,6 +107,11 @@ execute_on_irq_stack(int overflow, struc
+@@ -113,6 +107,11 @@ execute_on_irq_stack(int overflow, struct irq_desc *desc, int irq)
                     :  "0" (irq),   "1" (desc),  "2" (isp),
                        "D" (desc->handle_irq)
                     : "memory", "cc", "ecx");
@@ -14256,7 +15432,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/irq_32.c linux-3.1.3/arch/x86/kernel/irq_
        return 1;
  }
  
-@@ -121,29 +120,11 @@ execute_on_irq_stack(int overflow, struc
+@@ -121,29 +120,11 @@ execute_on_irq_stack(int overflow, struct irq_desc *desc, int irq)
   */
  void __cpuinit irq_ctx_init(int cpu)
  {
@@ -14323,47 +15499,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/irq_32.c linux-3.1.3/arch/x86/kernel/irq_
                /*
                 * Shouldn't happen, we returned above if in_interrupt():
                 */
-diff -urNp linux-3.1.3/arch/x86/kernel/irq.c linux-3.1.3/arch/x86/kernel/irq.c
---- linux-3.1.3/arch/x86/kernel/irq.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/irq.c  2011-11-16 18:39:07.000000000 -0500
-@@ -17,7 +17,7 @@
- #include <asm/mce.h>
- #include <asm/hw_irq.h>
--atomic_t irq_err_count;
-+atomic_unchecked_t irq_err_count;
- /* Function pointer for generic interrupt vector handling */
- void (*x86_platform_ipi_callback)(void) = NULL;
-@@ -116,9 +116,9 @@ int arch_show_interrupts(struct seq_file
-               seq_printf(p, "%10u ", per_cpu(mce_poll_count, j));
-       seq_printf(p, "  Machine check polls\n");
- #endif
--      seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count));
-+      seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read_unchecked(&irq_err_count));
- #if defined(CONFIG_X86_IO_APIC)
--      seq_printf(p, "%*s: %10u\n", prec, "MIS", atomic_read(&irq_mis_count));
-+      seq_printf(p, "%*s: %10u\n", prec, "MIS", atomic_read_unchecked(&irq_mis_count));
- #endif
-       return 0;
- }
-@@ -158,10 +158,10 @@ u64 arch_irq_stat_cpu(unsigned int cpu)
- u64 arch_irq_stat(void)
- {
--      u64 sum = atomic_read(&irq_err_count);
-+      u64 sum = atomic_read_unchecked(&irq_err_count);
- #ifdef CONFIG_X86_IO_APIC
--      sum += atomic_read(&irq_mis_count);
-+      sum += atomic_read_unchecked(&irq_mis_count);
- #endif
-       return sum;
- }
-diff -urNp linux-3.1.3/arch/x86/kernel/kgdb.c linux-3.1.3/arch/x86/kernel/kgdb.c
---- linux-3.1.3/arch/x86/kernel/kgdb.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/kgdb.c 2011-11-16 18:39:07.000000000 -0500
-@@ -124,11 +124,11 @@ char *dbg_get_reg(int regno, void *mem, 
+diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c
+index 00354d4..187ae44 100644
+--- a/arch/x86/kernel/kgdb.c
++++ b/arch/x86/kernel/kgdb.c
+@@ -124,11 +124,11 @@ char *dbg_get_reg(int regno, void *mem, struct pt_regs *regs)
  #ifdef CONFIG_X86_32
        switch (regno) {
        case GDB_SS:
@@ -14377,7 +15517,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/kgdb.c linux-3.1.3/arch/x86/kernel/kgdb.c
                        *(unsigned long *)mem = kernel_stack_pointer(regs);
                break;
        case GDB_GS:
-@@ -473,12 +473,12 @@ int kgdb_arch_handle_exception(int e_vec
+@@ -473,12 +473,12 @@ int kgdb_arch_handle_exception(int e_vector, int signo, int err_code,
        case 'k':
                /* clear the trace bit */
                linux_regs->flags &= ~X86_EFLAGS_TF;
@@ -14392,7 +15532,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/kgdb.c linux-3.1.3/arch/x86/kernel/kgdb.c
                                   raw_smp_processor_id());
                }
  
-@@ -534,7 +534,7 @@ static int __kgdb_notify(struct die_args
+@@ -534,7 +534,7 @@ static int __kgdb_notify(struct die_args *args, unsigned long cmd)
                return NOTIFY_DONE;
  
        case DIE_DEBUG:
@@ -14401,10 +15541,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/kgdb.c linux-3.1.3/arch/x86/kernel/kgdb.c
                        if (user_mode(regs))
                                return single_step_cont(regs, args);
                        break;
-diff -urNp linux-3.1.3/arch/x86/kernel/kprobes.c linux-3.1.3/arch/x86/kernel/kprobes.c
---- linux-3.1.3/arch/x86/kernel/kprobes.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/kprobes.c      2011-11-16 18:39:07.000000000 -0500
-@@ -117,8 +117,11 @@ static void __kprobes __synthesize_relat
+diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c
+index 794bc95..c6e29e9 100644
+--- a/arch/x86/kernel/kprobes.c
++++ b/arch/x86/kernel/kprobes.c
+@@ -117,8 +117,11 @@ static void __kprobes __synthesize_relative_insn(void *from, void *to, u8 op)
        } __attribute__((packed)) *insn;
  
        insn = (struct __arch_relative_insn *)from;
@@ -14416,7 +15557,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/kprobes.c linux-3.1.3/arch/x86/kernel/kpr
  }
  
  /* Insert a jump instruction at address 'from', which jumps to address 'to'.*/
-@@ -155,7 +158,7 @@ static int __kprobes can_boost(kprobe_op
+@@ -155,7 +158,7 @@ static int __kprobes can_boost(kprobe_opcode_t *opcodes)
        kprobe_opcode_t opcode;
        kprobe_opcode_t *orig_opcodes = opcodes;
  
@@ -14425,7 +15566,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/kprobes.c linux-3.1.3/arch/x86/kernel/kpr
                return 0;       /* Page fault may occur on this address. */
  
  retry:
-@@ -316,7 +319,9 @@ static int __kprobes __copy_instruction(
+@@ -316,7 +319,9 @@ static int __kprobes __copy_instruction(u8 *dest, u8 *src, int recover)
                }
        }
        insn_get_length(&insn);
@@ -14435,7 +15576,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/kprobes.c linux-3.1.3/arch/x86/kernel/kpr
  
  #ifdef CONFIG_X86_64
        if (insn_rip_relative(&insn)) {
-@@ -340,7 +345,9 @@ static int __kprobes __copy_instruction(
+@@ -340,7 +345,9 @@ static int __kprobes __copy_instruction(u8 *dest, u8 *src, int recover)
                          (u8 *) dest;
                BUG_ON((s64) (s32) newdisp != newdisp); /* Sanity check.  */
                disp = (u8 *) dest + insn_offset_displacement(&insn);
@@ -14445,7 +15586,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/kprobes.c linux-3.1.3/arch/x86/kernel/kpr
        }
  #endif
        return insn.length;
-@@ -354,12 +361,12 @@ static void __kprobes arch_copy_kprobe(s
+@@ -354,12 +361,12 @@ static void __kprobes arch_copy_kprobe(struct kprobe *p)
         */
        __copy_instruction(p->ainsn.insn, p->addr, 0);
  
@@ -14460,7 +15601,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/kprobes.c linux-3.1.3/arch/x86/kernel/kpr
  }
  
  int __kprobes arch_prepare_kprobe(struct kprobe *p)
-@@ -476,7 +483,7 @@ static void __kprobes setup_singlestep(s
+@@ -476,7 +483,7 @@ static void __kprobes setup_singlestep(struct kprobe *p, struct pt_regs *regs,
                 * nor set current_kprobe, because it doesn't use single
                 * stepping.
                 */
@@ -14469,7 +15610,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/kprobes.c linux-3.1.3/arch/x86/kernel/kpr
                preempt_enable_no_resched();
                return;
        }
-@@ -495,7 +502,7 @@ static void __kprobes setup_singlestep(s
+@@ -495,7 +502,7 @@ static void __kprobes setup_singlestep(struct kprobe *p, struct pt_regs *regs,
        if (p->opcode == BREAKPOINT_INSTRUCTION)
                regs->ip = (unsigned long)p->addr;
        else
@@ -14478,7 +15619,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/kprobes.c linux-3.1.3/arch/x86/kernel/kpr
  }
  
  /*
-@@ -574,7 +581,7 @@ static int __kprobes kprobe_handler(stru
+@@ -574,7 +581,7 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
                                setup_singlestep(p, regs, kcb, 0);
                        return 1;
                }
@@ -14487,7 +15628,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/kprobes.c linux-3.1.3/arch/x86/kernel/kpr
                /*
                 * The breakpoint instruction was removed right
                 * after we hit it.  Another cpu has removed
-@@ -682,6 +689,9 @@ static void __used __kprobes kretprobe_t
+@@ -682,6 +689,9 @@ static void __used __kprobes kretprobe_trampoline_holder(void)
                        "       movq %rax, 152(%rsp)\n"
                        RESTORE_REGS_STRING
                        "       popfq\n"
@@ -14497,7 +15638,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/kprobes.c linux-3.1.3/arch/x86/kernel/kpr
  #else
                        "       pushf\n"
                        SAVE_REGS_STRING
-@@ -819,7 +829,7 @@ static void __kprobes resume_execution(s
+@@ -819,7 +829,7 @@ static void __kprobes resume_execution(struct kprobe *p,
                struct pt_regs *regs, struct kprobe_ctlblk *kcb)
  {
        unsigned long *tos = stack_addr(regs);
@@ -14506,7 +15647,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/kprobes.c linux-3.1.3/arch/x86/kernel/kpr
        unsigned long orig_ip = (unsigned long)p->addr;
        kprobe_opcode_t *insn = p->ainsn.insn;
  
-@@ -1001,7 +1011,7 @@ int __kprobes kprobe_exceptions_notify(s
+@@ -1001,7 +1011,7 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
        struct die_args *args = data;
        int ret = NOTIFY_DONE;
  
@@ -14515,7 +15656,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/kprobes.c linux-3.1.3/arch/x86/kernel/kpr
                return ret;
  
        switch (val) {
-@@ -1383,7 +1393,7 @@ int __kprobes arch_prepare_optimized_kpr
+@@ -1383,7 +1393,7 @@ int __kprobes arch_prepare_optimized_kprobe(struct optimized_kprobe *op)
         * Verify if the address gap is in 2GB range, because this uses
         * a relative jump.
         */
@@ -14524,7 +15665,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/kprobes.c linux-3.1.3/arch/x86/kernel/kpr
        if (abs(rel) > 0x7fffffff)
                return -ERANGE;
  
-@@ -1404,11 +1414,11 @@ int __kprobes arch_prepare_optimized_kpr
+@@ -1404,11 +1414,11 @@ int __kprobes arch_prepare_optimized_kprobe(struct optimized_kprobe *op)
        synthesize_set_arg1(buf + TMPL_MOVE_IDX, (unsigned long)op);
  
        /* Set probe function call */
@@ -14538,7 +15679,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/kprobes.c linux-3.1.3/arch/x86/kernel/kpr
  
        flush_icache_range((unsigned long) buf,
                           (unsigned long) buf + TMPL_END_IDX +
-@@ -1430,7 +1440,7 @@ static void __kprobes setup_optimize_kpr
+@@ -1430,7 +1440,7 @@ static void __kprobes setup_optimize_kprobe(struct text_poke_param *tprm,
                        ((long)op->kp.addr + RELATIVEJUMP_SIZE));
  
        /* Backup instructions which will be replaced by jump address */
@@ -14547,10 +15688,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/kprobes.c linux-3.1.3/arch/x86/kernel/kpr
               RELATIVE_ADDR_SIZE);
  
        insn_buf[0] = RELATIVEJUMP_OPCODE;
-diff -urNp linux-3.1.3/arch/x86/kernel/kvm.c linux-3.1.3/arch/x86/kernel/kvm.c
---- linux-3.1.3/arch/x86/kernel/kvm.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/kvm.c  2011-11-16 18:39:07.000000000 -0500
-@@ -437,6 +437,7 @@ static void __init paravirt_ops_setup(vo
+diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
+index a9c2116..a52d4fc 100644
+--- a/arch/x86/kernel/kvm.c
++++ b/arch/x86/kernel/kvm.c
+@@ -437,6 +437,7 @@ static void __init paravirt_ops_setup(void)
                pv_mmu_ops.set_pud = kvm_set_pud;
  #if PAGETABLE_LEVELS == 4
                pv_mmu_ops.set_pgd = kvm_set_pgd;
@@ -14558,10 +15700,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/kvm.c linux-3.1.3/arch/x86/kernel/kvm.c
  #endif
  #endif
                pv_mmu_ops.flush_tlb_user = kvm_flush_tlb;
-diff -urNp linux-3.1.3/arch/x86/kernel/ldt.c linux-3.1.3/arch/x86/kernel/ldt.c
---- linux-3.1.3/arch/x86/kernel/ldt.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/ldt.c  2011-11-16 18:39:07.000000000 -0500
-@@ -67,13 +67,13 @@ static int alloc_ldt(mm_context_t *pc, i
+diff --git a/arch/x86/kernel/ldt.c b/arch/x86/kernel/ldt.c
+index ea69726..604d066 100644
+--- a/arch/x86/kernel/ldt.c
++++ b/arch/x86/kernel/ldt.c
+@@ -67,13 +67,13 @@ static int alloc_ldt(mm_context_t *pc, int mincount, int reload)
        if (reload) {
  #ifdef CONFIG_SMP
                preempt_disable();
@@ -14577,7 +15720,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/ldt.c linux-3.1.3/arch/x86/kernel/ldt.c
  #endif
        }
        if (oldsize) {
-@@ -95,7 +95,7 @@ static inline int copy_ldt(mm_context_t 
+@@ -95,7 +95,7 @@ static inline int copy_ldt(mm_context_t *new, mm_context_t *old)
                return err;
  
        for (i = 0; i < old->size; i++)
@@ -14586,7 +15729,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/ldt.c linux-3.1.3/arch/x86/kernel/ldt.c
        return 0;
  }
  
-@@ -116,6 +116,24 @@ int init_new_context(struct task_struct 
+@@ -116,6 +116,24 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
                retval = copy_ldt(&mm->context, &old_mm->context);
                mutex_unlock(&old_mm->context.lock);
        }
@@ -14611,7 +15754,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/ldt.c linux-3.1.3/arch/x86/kernel/ldt.c
        return retval;
  }
  
-@@ -230,6 +248,13 @@ static int write_ldt(void __user *ptr, u
+@@ -230,6 +248,13 @@ static int write_ldt(void __user *ptr, unsigned long bytecount, int oldmode)
                }
        }
  
@@ -14625,9 +15768,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/ldt.c linux-3.1.3/arch/x86/kernel/ldt.c
        fill_ldt(&ldt, &ldt_info);
        if (oldmode)
                ldt.avl = 0;
-diff -urNp linux-3.1.3/arch/x86/kernel/machine_kexec_32.c linux-3.1.3/arch/x86/kernel/machine_kexec_32.c
---- linux-3.1.3/arch/x86/kernel/machine_kexec_32.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/machine_kexec_32.c     2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/kernel/machine_kexec_32.c b/arch/x86/kernel/machine_kexec_32.c
+index a3fa43b..8966f4c 100644
+--- a/arch/x86/kernel/machine_kexec_32.c
++++ b/arch/x86/kernel/machine_kexec_32.c
 @@ -27,7 +27,7 @@
  #include <asm/cacheflush.h>
  #include <asm/debugreg.h>
@@ -14637,7 +15781,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/machine_kexec_32.c linux-3.1.3/arch/x86/k
  {
        struct desc_ptr curidt;
  
-@@ -39,7 +39,7 @@ static void set_idt(void *newidt, __u16 
+@@ -39,7 +39,7 @@ static void set_idt(void *newidt, __u16 limit)
  }
  
  
@@ -14655,10 +15799,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/machine_kexec_32.c linux-3.1.3/arch/x86/k
  
        relocate_kernel_ptr = control_page;
        page_list[PA_CONTROL_PAGE] = __pa(control_page);
-diff -urNp linux-3.1.3/arch/x86/kernel/microcode_intel.c linux-3.1.3/arch/x86/kernel/microcode_intel.c
---- linux-3.1.3/arch/x86/kernel/microcode_intel.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/microcode_intel.c      2011-11-16 18:39:07.000000000 -0500
-@@ -440,13 +440,13 @@ static enum ucode_state request_microcod
+diff --git a/arch/x86/kernel/microcode_intel.c b/arch/x86/kernel/microcode_intel.c
+index 1a1b606..5c89b55 100644
+--- a/arch/x86/kernel/microcode_intel.c
++++ b/arch/x86/kernel/microcode_intel.c
+@@ -440,13 +440,13 @@ static enum ucode_state request_microcode_fw(int cpu, struct device *device)
  
  static int get_ucode_user(void *to, const void *from, size_t n)
  {
@@ -14674,9 +15819,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/microcode_intel.c linux-3.1.3/arch/x86/ke
  }
  
  static void microcode_fini_cpu(int cpu)
-diff -urNp linux-3.1.3/arch/x86/kernel/module.c linux-3.1.3/arch/x86/kernel/module.c
---- linux-3.1.3/arch/x86/kernel/module.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/module.c       2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/kernel/module.c b/arch/x86/kernel/module.c
+index 925179f..85bec6c 100644
+--- a/arch/x86/kernel/module.c
++++ b/arch/x86/kernel/module.c
 @@ -36,15 +36,60 @@
  #define DEBUGP(fmt...)
  #endif
@@ -14778,7 +15924,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/module.c linux-3.1.3/arch/x86/kernel/modu
                        break;
                default:
                        printk(KERN_ERR "module %s: Unknown relocation: %u\n",
-@@ -120,21 +171,30 @@ int apply_relocate_add(Elf64_Shdr *sechd
+@@ -120,21 +171,30 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
                case R_X86_64_NONE:
                        break;
                case R_X86_64_64:
@@ -14809,9 +15955,23 @@ diff -urNp linux-3.1.3/arch/x86/kernel/module.c linux-3.1.3/arch/x86/kernel/modu
  #if 0
                        if ((s64)val != *(s32 *)loc)
                                goto overflow;
-diff -urNp linux-3.1.3/arch/x86/kernel/paravirt.c linux-3.1.3/arch/x86/kernel/paravirt.c
---- linux-3.1.3/arch/x86/kernel/paravirt.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/paravirt.c     2011-11-17 18:29:42.000000000 -0500
+diff --git a/arch/x86/kernel/paravirt-spinlocks.c b/arch/x86/kernel/paravirt-spinlocks.c
+index 676b8c7..870ba04 100644
+--- a/arch/x86/kernel/paravirt-spinlocks.c
++++ b/arch/x86/kernel/paravirt-spinlocks.c
+@@ -13,7 +13,7 @@ default_spin_lock_flags(arch_spinlock_t *lock, unsigned long flags)
+       arch_spin_lock(lock);
+ }
+-struct pv_lock_ops pv_lock_ops = {
++struct pv_lock_ops pv_lock_ops __read_only = {
+ #ifdef CONFIG_SMP
+       .spin_is_locked = __ticket_spin_is_locked,
+       .spin_is_contended = __ticket_spin_is_contended,
+diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
+index d90272e..2d54e8e 100644
+--- a/arch/x86/kernel/paravirt.c
++++ b/arch/x86/kernel/paravirt.c
 @@ -53,6 +53,9 @@ u64 _paravirt_ident_64(u64 x)
  {
        return x;
@@ -14822,7 +15982,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/paravirt.c linux-3.1.3/arch/x86/kernel/pa
  
  void __init default_banner(void)
  {
-@@ -133,6 +136,9 @@ static void *get_call_destination(u8 typ
+@@ -133,6 +136,9 @@ static void *get_call_destination(u8 type)
                .pv_lock_ops = pv_lock_ops,
  #endif
        };
@@ -14832,7 +15992,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/paravirt.c linux-3.1.3/arch/x86/kernel/pa
        return *((void **)&tmpl + type);
  }
  
-@@ -145,15 +151,19 @@ unsigned paravirt_patch_default(u8 type,
+@@ -145,15 +151,19 @@ unsigned paravirt_patch_default(u8 type, u16 clobbers, void *insnbuf,
        if (opfunc == NULL)
                /* If there's no function, patch it with a ud2a (BUG) */
                ret = paravirt_patch_insns(insnbuf, len, ud2a, ud2a+sizeof(ud2a));
@@ -14855,7 +16015,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/paravirt.c linux-3.1.3/arch/x86/kernel/pa
  
        else if (type == PARAVIRT_PATCH(pv_cpu_ops.iret) ||
                 type == PARAVIRT_PATCH(pv_cpu_ops.irq_enable_sysexit) ||
-@@ -178,7 +188,7 @@ unsigned paravirt_patch_insns(void *insn
+@@ -178,7 +188,7 @@ unsigned paravirt_patch_insns(void *insnbuf, unsigned len,
        if (insn_len > len || start == NULL)
                insn_len = len;
        else
@@ -14953,21 +16113,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/paravirt.c linux-3.1.3/arch/x86/kernel/pa
  };
  
  EXPORT_SYMBOL_GPL(pv_time_ops);
-diff -urNp linux-3.1.3/arch/x86/kernel/paravirt-spinlocks.c linux-3.1.3/arch/x86/kernel/paravirt-spinlocks.c
---- linux-3.1.3/arch/x86/kernel/paravirt-spinlocks.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/paravirt-spinlocks.c   2011-11-16 18:39:07.000000000 -0500
-@@ -13,7 +13,7 @@ default_spin_lock_flags(arch_spinlock_t 
-       arch_spin_lock(lock);
- }
--struct pv_lock_ops pv_lock_ops = {
-+struct pv_lock_ops pv_lock_ops __read_only = {
- #ifdef CONFIG_SMP
-       .spin_is_locked = __ticket_spin_is_locked,
-       .spin_is_contended = __ticket_spin_is_contended,
-diff -urNp linux-3.1.3/arch/x86/kernel/pci-iommu_table.c linux-3.1.3/arch/x86/kernel/pci-iommu_table.c
---- linux-3.1.3/arch/x86/kernel/pci-iommu_table.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/pci-iommu_table.c      2011-11-16 18:40:08.000000000 -0500
+diff --git a/arch/x86/kernel/pci-iommu_table.c b/arch/x86/kernel/pci-iommu_table.c
+index 35ccf75..67e7d4d 100644
+--- a/arch/x86/kernel/pci-iommu_table.c
++++ b/arch/x86/kernel/pci-iommu_table.c
 @@ -2,7 +2,7 @@
  #include <asm/iommu_table.h>
  #include <linux/string.h>
@@ -14977,7 +16126,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/pci-iommu_table.c linux-3.1.3/arch/x86/ke
  
  #define DEBUG 1
  
-@@ -51,6 +51,8 @@ void __init check_iommu_entries(struct i
+@@ -51,6 +51,8 @@ void __init check_iommu_entries(struct iommu_table_entry *start,
  {
        struct iommu_table_entry *p, *q, *x;
  
@@ -14986,10 +16135,152 @@ diff -urNp linux-3.1.3/arch/x86/kernel/pci-iommu_table.c linux-3.1.3/arch/x86/ke
        /* Simple cyclic dependency checker. */
        for (p = start; p < finish; p++) {
                q = find_dependents_of(start, finish, p);
-diff -urNp linux-3.1.3/arch/x86/kernel/process_32.c linux-3.1.3/arch/x86/kernel/process_32.c
---- linux-3.1.3/arch/x86/kernel/process_32.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/process_32.c   2011-11-16 18:39:07.000000000 -0500
-@@ -66,6 +66,7 @@ asmlinkage void ret_from_fork(void) __as
+diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
+index e7e3b01..43c5af3 100644
+--- a/arch/x86/kernel/process.c
++++ b/arch/x86/kernel/process.c
+@@ -48,16 +48,33 @@ void free_thread_xstate(struct task_struct *tsk)
+ void free_thread_info(struct thread_info *ti)
+ {
+-      free_thread_xstate(ti->task);
+       free_pages((unsigned long)ti, get_order(THREAD_SIZE));
+ }
++static struct kmem_cache *task_struct_cachep;
++
+ void arch_task_cache_init(void)
+ {
+-        task_xstate_cachep =
+-              kmem_cache_create("task_xstate", xstate_size,
++      /* create a slab on which task_structs can be allocated */
++      task_struct_cachep =
++              kmem_cache_create("task_struct", sizeof(struct task_struct),
++                      ARCH_MIN_TASKALIGN, SLAB_PANIC | SLAB_NOTRACK, NULL);
++
++      task_xstate_cachep =
++              kmem_cache_create("task_xstate", xstate_size,
+                                 __alignof__(union thread_xstate),
+-                                SLAB_PANIC | SLAB_NOTRACK, NULL);
++                                SLAB_PANIC | SLAB_NOTRACK | SLAB_USERCOPY, NULL);
++}
++
++struct task_struct *alloc_task_struct_node(int node)
++{
++      return kmem_cache_alloc_node(task_struct_cachep, GFP_KERNEL, node);
++}
++
++void free_task_struct(struct task_struct *task)
++{
++      free_thread_xstate(task);
++      kmem_cache_free(task_struct_cachep, task);
+ }
+ /*
+@@ -70,7 +87,7 @@ void exit_thread(void)
+       unsigned long *bp = t->io_bitmap_ptr;
+       if (bp) {
+-              struct tss_struct *tss = &per_cpu(init_tss, get_cpu());
++              struct tss_struct *tss = init_tss + get_cpu();
+               t->io_bitmap_ptr = NULL;
+               clear_thread_flag(TIF_IO_BITMAP);
+@@ -106,7 +123,7 @@ void show_regs_common(void)
+       printk(KERN_CONT "\n");
+       printk(KERN_DEFAULT "Pid: %d, comm: %.20s %s %s %.*s",
+-              current->pid, current->comm, print_tainted(),
++              task_pid_nr(current), current->comm, print_tainted(),
+               init_utsname()->release,
+               (int)strcspn(init_utsname()->version, " "),
+               init_utsname()->version);
+@@ -120,6 +137,9 @@ void flush_thread(void)
+ {
+       struct task_struct *tsk = current;
++#if defined(CONFIG_X86_32) && !defined(CONFIG_CC_STACKPROTECTOR) && !defined(CONFIG_PAX_MEMORY_UDEREF)
++      loadsegment(gs, 0);
++#endif
+       flush_ptrace_hw_breakpoint(tsk);
+       memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array));
+       /*
+@@ -282,10 +302,10 @@ int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
+       regs.di = (unsigned long) arg;
+ #ifdef CONFIG_X86_32
+-      regs.ds = __USER_DS;
+-      regs.es = __USER_DS;
++      regs.ds = __KERNEL_DS;
++      regs.es = __KERNEL_DS;
+       regs.fs = __KERNEL_PERCPU;
+-      regs.gs = __KERNEL_STACK_CANARY;
++      savesegment(gs, regs.gs);
+ #else
+       regs.ss = __KERNEL_DS;
+ #endif
+@@ -403,7 +423,7 @@ void default_idle(void)
+ EXPORT_SYMBOL(default_idle);
+ #endif
+-void stop_this_cpu(void *dummy)
++__noreturn void stop_this_cpu(void *dummy)
+ {
+       local_irq_disable();
+       /*
+@@ -645,16 +665,37 @@ static int __init idle_setup(char *str)
+ }
+ early_param("idle", idle_setup);
+-unsigned long arch_align_stack(unsigned long sp)
++#ifdef CONFIG_PAX_RANDKSTACK
++void pax_randomize_kstack(struct pt_regs *regs)
+ {
+-      if (!(current->personality & ADDR_NO_RANDOMIZE) && randomize_va_space)
+-              sp -= get_random_int() % 8192;
+-      return sp & ~0xf;
+-}
++      struct thread_struct *thread = &current->thread;
++      unsigned long time;
+-unsigned long arch_randomize_brk(struct mm_struct *mm)
+-{
+-      unsigned long range_end = mm->brk + 0x02000000;
+-      return randomize_range(mm->brk, range_end, 0) ? : mm->brk;
+-}
++      if (!randomize_va_space)
++              return;
++
++      if (v8086_mode(regs))
++              return;
++      rdtscl(time);
++
++      /* P4 seems to return a 0 LSB, ignore it */
++#ifdef CONFIG_MPENTIUM4
++      time &= 0x3EUL;
++      time <<= 2;
++#elif defined(CONFIG_X86_64)
++      time &= 0xFUL;
++      time <<= 4;
++#else
++      time &= 0x1FUL;
++      time <<= 3;
++#endif
++
++      thread->sp0 ^= time;
++      load_sp0(init_tss + smp_processor_id(), thread);
++
++#ifdef CONFIG_X86_64
++      percpu_write(kernel_stack, thread->sp0);
++#endif
++}
++#endif
+diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
+index 7a3b651..5a946f6 100644
+--- a/arch/x86/kernel/process_32.c
++++ b/arch/x86/kernel/process_32.c
+@@ -66,6 +66,7 @@ asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
  unsigned long thread_saved_pc(struct task_struct *tsk)
  {
        return ((unsigned long *)tsk->thread.sp)[3];
@@ -14997,7 +16288,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/process_32.c linux-3.1.3/arch/x86/kernel/
  }
  
  #ifndef CONFIG_SMP
-@@ -128,15 +129,14 @@ void __show_regs(struct pt_regs *regs, i
+@@ -128,15 +129,14 @@ void __show_regs(struct pt_regs *regs, int all)
        unsigned long sp;
        unsigned short ss, gs;
  
@@ -15015,7 +16306,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/process_32.c linux-3.1.3/arch/x86/kernel/
  
        show_regs_common();
  
-@@ -198,13 +198,14 @@ int copy_thread(unsigned long clone_flag
+@@ -198,13 +198,14 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
        struct task_struct *tsk;
        int err;
  
@@ -15031,7 +16322,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/process_32.c linux-3.1.3/arch/x86/kernel/
  
        p->thread.ip = (unsigned long) ret_from_fork;
  
-@@ -294,7 +295,7 @@ __switch_to(struct task_struct *prev_p, 
+@@ -294,7 +295,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
        struct thread_struct *prev = &prev_p->thread,
                                 *next = &next_p->thread;
        int cpu = smp_processor_id();
@@ -15040,7 +16331,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/process_32.c linux-3.1.3/arch/x86/kernel/
        bool preload_fpu;
  
        /* never put a printk in __switch_to... printk() calls wake_up*() indirectly */
-@@ -329,6 +330,10 @@ __switch_to(struct task_struct *prev_p, 
+@@ -329,6 +330,10 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
         */
        lazy_save_gs(prev->gs);
  
@@ -15051,7 +16342,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/process_32.c linux-3.1.3/arch/x86/kernel/
        /*
         * Load the per-thread Thread-Local Storage descriptor.
         */
-@@ -364,6 +369,9 @@ __switch_to(struct task_struct *prev_p, 
+@@ -364,6 +369,9 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
         */
        arch_end_context_switch(next_p);
  
@@ -15061,7 +16352,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/process_32.c linux-3.1.3/arch/x86/kernel/
        if (preload_fpu)
                __math_state_restore();
  
-@@ -373,8 +381,6 @@ __switch_to(struct task_struct *prev_p, 
+@@ -373,8 +381,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
        if (prev->gs | next->gs)
                lazy_load_gs(next->gs);
  
@@ -15070,14 +16361,15 @@ diff -urNp linux-3.1.3/arch/x86/kernel/process_32.c linux-3.1.3/arch/x86/kernel/
        return prev_p;
  }
  
-@@ -404,4 +410,3 @@ unsigned long get_wchan(struct task_stru
+@@ -404,4 +410,3 @@ unsigned long get_wchan(struct task_struct *p)
        } while (count++ < 16);
        return 0;
  }
 -
-diff -urNp linux-3.1.3/arch/x86/kernel/process_64.c linux-3.1.3/arch/x86/kernel/process_64.c
---- linux-3.1.3/arch/x86/kernel/process_64.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/process_64.c   2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
+index f693e44..3c979b2 100644
+--- a/arch/x86/kernel/process_64.c
++++ b/arch/x86/kernel/process_64.c
 @@ -88,7 +88,7 @@ static void __exit_idle(void)
  void exit_idle(void)
  {
@@ -15087,7 +16379,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/process_64.c linux-3.1.3/arch/x86/kernel/
                return;
        __exit_idle();
  }
-@@ -262,8 +262,7 @@ int copy_thread(unsigned long clone_flag
+@@ -262,8 +262,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
        struct pt_regs *childregs;
        struct task_struct *me = current;
  
@@ -15097,7 +16389,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/process_64.c linux-3.1.3/arch/x86/kernel/
        *childregs = *regs;
  
        childregs->ax = 0;
-@@ -275,6 +274,7 @@ int copy_thread(unsigned long clone_flag
+@@ -275,6 +274,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
        p->thread.sp = (unsigned long) childregs;
        p->thread.sp0 = (unsigned long) (childregs+1);
        p->thread.usersp = me->thread.usersp;
@@ -15105,7 +16397,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/process_64.c linux-3.1.3/arch/x86/kernel/
  
        set_tsk_thread_flag(p, TIF_FORK);
  
-@@ -377,7 +377,7 @@ __switch_to(struct task_struct *prev_p, 
+@@ -377,7 +377,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
        struct thread_struct *prev = &prev_p->thread;
        struct thread_struct *next = &next_p->thread;
        int cpu = smp_processor_id();
@@ -15114,7 +16406,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/process_64.c linux-3.1.3/arch/x86/kernel/
        unsigned fsindex, gsindex;
        bool preload_fpu;
  
-@@ -473,10 +473,9 @@ __switch_to(struct task_struct *prev_p, 
+@@ -473,10 +473,9 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
        prev->usersp = percpu_read(old_rsp);
        percpu_write(old_rsp, next->usersp);
        percpu_write(current_task, next_p);
@@ -15127,7 +16419,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/process_64.c linux-3.1.3/arch/x86/kernel/
  
        /*
         * Now maybe reload the debug registers and handle I/O bitmaps
-@@ -538,12 +537,11 @@ unsigned long get_wchan(struct task_stru
+@@ -538,12 +537,11 @@ unsigned long get_wchan(struct task_struct *p)
        if (!p || p == current || p->state == TASK_RUNNING)
                return 0;
        stack = (unsigned long)task_stack_page(p);
@@ -15142,150 +16434,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/process_64.c linux-3.1.3/arch/x86/kernel/
                        return 0;
                ip = *(u64 *)(fp+8);
                if (!in_sched_functions(ip))
-diff -urNp linux-3.1.3/arch/x86/kernel/process.c linux-3.1.3/arch/x86/kernel/process.c
---- linux-3.1.3/arch/x86/kernel/process.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/process.c      2011-11-16 18:39:07.000000000 -0500
-@@ -48,16 +48,33 @@ void free_thread_xstate(struct task_stru
- void free_thread_info(struct thread_info *ti)
- {
--      free_thread_xstate(ti->task);
-       free_pages((unsigned long)ti, get_order(THREAD_SIZE));
- }
-+static struct kmem_cache *task_struct_cachep;
-+
- void arch_task_cache_init(void)
- {
--        task_xstate_cachep =
--              kmem_cache_create("task_xstate", xstate_size,
-+      /* create a slab on which task_structs can be allocated */
-+      task_struct_cachep =
-+              kmem_cache_create("task_struct", sizeof(struct task_struct),
-+                      ARCH_MIN_TASKALIGN, SLAB_PANIC | SLAB_NOTRACK, NULL);
-+
-+      task_xstate_cachep =
-+              kmem_cache_create("task_xstate", xstate_size,
-                                 __alignof__(union thread_xstate),
--                                SLAB_PANIC | SLAB_NOTRACK, NULL);
-+                                SLAB_PANIC | SLAB_NOTRACK | SLAB_USERCOPY, NULL);
-+}
-+
-+struct task_struct *alloc_task_struct_node(int node)
-+{
-+      return kmem_cache_alloc_node(task_struct_cachep, GFP_KERNEL, node);
-+}
-+
-+void free_task_struct(struct task_struct *task)
-+{
-+      free_thread_xstate(task);
-+      kmem_cache_free(task_struct_cachep, task);
- }
- /*
-@@ -70,7 +87,7 @@ void exit_thread(void)
-       unsigned long *bp = t->io_bitmap_ptr;
-       if (bp) {
--              struct tss_struct *tss = &per_cpu(init_tss, get_cpu());
-+              struct tss_struct *tss = init_tss + get_cpu();
-               t->io_bitmap_ptr = NULL;
-               clear_thread_flag(TIF_IO_BITMAP);
-@@ -106,7 +123,7 @@ void show_regs_common(void)
-       printk(KERN_CONT "\n");
-       printk(KERN_DEFAULT "Pid: %d, comm: %.20s %s %s %.*s",
--              current->pid, current->comm, print_tainted(),
-+              task_pid_nr(current), current->comm, print_tainted(),
-               init_utsname()->release,
-               (int)strcspn(init_utsname()->version, " "),
-               init_utsname()->version);
-@@ -120,6 +137,9 @@ void flush_thread(void)
- {
-       struct task_struct *tsk = current;
-+#if defined(CONFIG_X86_32) && !defined(CONFIG_CC_STACKPROTECTOR) && !defined(CONFIG_PAX_MEMORY_UDEREF)
-+      loadsegment(gs, 0);
-+#endif
-       flush_ptrace_hw_breakpoint(tsk);
-       memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array));
-       /*
-@@ -282,10 +302,10 @@ int kernel_thread(int (*fn)(void *), voi
-       regs.di = (unsigned long) arg;
- #ifdef CONFIG_X86_32
--      regs.ds = __USER_DS;
--      regs.es = __USER_DS;
-+      regs.ds = __KERNEL_DS;
-+      regs.es = __KERNEL_DS;
-       regs.fs = __KERNEL_PERCPU;
--      regs.gs = __KERNEL_STACK_CANARY;
-+      savesegment(gs, regs.gs);
- #else
-       regs.ss = __KERNEL_DS;
- #endif
-@@ -403,7 +423,7 @@ void default_idle(void)
- EXPORT_SYMBOL(default_idle);
- #endif
--void stop_this_cpu(void *dummy)
-+__noreturn void stop_this_cpu(void *dummy)
- {
-       local_irq_disable();
-       /*
-@@ -645,16 +665,37 @@ static int __init idle_setup(char *str)
- }
- early_param("idle", idle_setup);
--unsigned long arch_align_stack(unsigned long sp)
-+#ifdef CONFIG_PAX_RANDKSTACK
-+void pax_randomize_kstack(struct pt_regs *regs)
- {
--      if (!(current->personality & ADDR_NO_RANDOMIZE) && randomize_va_space)
--              sp -= get_random_int() % 8192;
--      return sp & ~0xf;
--}
-+      struct thread_struct *thread = &current->thread;
-+      unsigned long time;
--unsigned long arch_randomize_brk(struct mm_struct *mm)
--{
--      unsigned long range_end = mm->brk + 0x02000000;
--      return randomize_range(mm->brk, range_end, 0) ? : mm->brk;
--}
-+      if (!randomize_va_space)
-+              return;
-+
-+      if (v8086_mode(regs))
-+              return;
-+      rdtscl(time);
-+
-+      /* P4 seems to return a 0 LSB, ignore it */
-+#ifdef CONFIG_MPENTIUM4
-+      time &= 0x3EUL;
-+      time <<= 2;
-+#elif defined(CONFIG_X86_64)
-+      time &= 0xFUL;
-+      time <<= 4;
-+#else
-+      time &= 0x1FUL;
-+      time <<= 3;
-+#endif
-+
-+      thread->sp0 ^= time;
-+      load_sp0(init_tss + smp_processor_id(), thread);
-+
-+#ifdef CONFIG_X86_64
-+      percpu_write(kernel_stack, thread->sp0);
-+#endif
-+}
-+#endif
-diff -urNp linux-3.1.3/arch/x86/kernel/ptrace.c linux-3.1.3/arch/x86/kernel/ptrace.c
---- linux-3.1.3/arch/x86/kernel/ptrace.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/ptrace.c       2011-11-16 18:39:07.000000000 -0500
-@@ -822,7 +822,7 @@ long arch_ptrace(struct task_struct *chi
+diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
+index 8252879..d3219e0 100644
+--- a/arch/x86/kernel/ptrace.c
++++ b/arch/x86/kernel/ptrace.c
+@@ -822,7 +822,7 @@ long arch_ptrace(struct task_struct *child, long request,
                 unsigned long addr, unsigned long data)
  {
        int ret;
@@ -15294,7 +16447,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/ptrace.c linux-3.1.3/arch/x86/kernel/ptra
  
        switch (request) {
        /* read the word at location addr in the USER area. */
-@@ -907,14 +907,14 @@ long arch_ptrace(struct task_struct *chi
+@@ -907,14 +907,14 @@ long arch_ptrace(struct task_struct *child, long request,
                if ((int) addr < 0)
                        return -EIO;
                ret = do_get_thread_area(child, addr,
@@ -15311,7 +16464,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/ptrace.c linux-3.1.3/arch/x86/kernel/ptra
                break;
  #endif
  
-@@ -1331,7 +1331,7 @@ static void fill_sigtrap_info(struct tas
+@@ -1331,7 +1331,7 @@ static void fill_sigtrap_info(struct task_struct *tsk,
        memset(info, 0, sizeof(*info));
        info->si_signo = SIGTRAP;
        info->si_code = si_code;
@@ -15320,10 +16473,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/ptrace.c linux-3.1.3/arch/x86/kernel/ptra
  }
  
  void user_single_step_siginfo(struct task_struct *tsk,
-diff -urNp linux-3.1.3/arch/x86/kernel/pvclock.c linux-3.1.3/arch/x86/kernel/pvclock.c
---- linux-3.1.3/arch/x86/kernel/pvclock.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/pvclock.c      2011-11-16 18:39:07.000000000 -0500
-@@ -81,11 +81,11 @@ unsigned long pvclock_tsc_khz(struct pvc
+diff --git a/arch/x86/kernel/pvclock.c b/arch/x86/kernel/pvclock.c
+index 42eb330..139955c 100644
+--- a/arch/x86/kernel/pvclock.c
++++ b/arch/x86/kernel/pvclock.c
+@@ -81,11 +81,11 @@ unsigned long pvclock_tsc_khz(struct pvclock_vcpu_time_info *src)
        return pv_tsc_khz;
  }
  
@@ -15337,7 +16491,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/pvclock.c linux-3.1.3/arch/x86/kernel/pvc
  }
  
  cycle_t pvclock_clocksource_read(struct pvclock_vcpu_time_info *src)
-@@ -121,11 +121,11 @@ cycle_t pvclock_clocksource_read(struct 
+@@ -121,11 +121,11 @@ cycle_t pvclock_clocksource_read(struct pvclock_vcpu_time_info *src)
         * updating at the same time, and one of them could be slightly behind,
         * making the assumption that last_value always go forward fail to hold.
         */
@@ -15351,9 +16505,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/pvclock.c linux-3.1.3/arch/x86/kernel/pvc
        } while (unlikely(last != ret));
  
        return ret;
-diff -urNp linux-3.1.3/arch/x86/kernel/reboot.c linux-3.1.3/arch/x86/kernel/reboot.c
---- linux-3.1.3/arch/x86/kernel/reboot.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/reboot.c       2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
+index d4a705f..ef8f1a9 100644
+--- a/arch/x86/kernel/reboot.c
++++ b/arch/x86/kernel/reboot.c
 @@ -35,7 +35,7 @@ void (*pm_power_off)(void);
  EXPORT_SYMBOL(pm_power_off);
  
@@ -15363,7 +16518,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/reboot.c linux-3.1.3/arch/x86/kernel/rebo
  enum reboot_type reboot_type = BOOT_ACPI;
  int reboot_force;
  
-@@ -315,13 +315,17 @@ core_initcall(reboot_init);
+@@ -324,13 +324,17 @@ core_initcall(reboot_init);
  extern const unsigned char machine_real_restart_asm[];
  extern const u64 machine_real_restart_gdt[3];
  
@@ -15383,7 +16538,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/reboot.c linux-3.1.3/arch/x86/kernel/rebo
        local_irq_disable();
  
        /* Write zero to CMOS register number 0x0f, which the BIOS POST
-@@ -347,14 +351,14 @@ void machine_real_restart(unsigned int t
+@@ -356,14 +360,14 @@ void machine_real_restart(unsigned int type)
           boot)".  This seems like a fairly standard thing that gets set by
           REBOOT.COM programs, and the previous reset routine did this
           too. */
@@ -15400,7 +16555,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/reboot.c linux-3.1.3/arch/x86/kernel/rebo
  
        /* GDT[0]: GDT self-pointer */
        lowmem_gdt[0] =
-@@ -365,7 +369,33 @@ void machine_real_restart(unsigned int t
+@@ -374,7 +378,33 @@ void machine_real_restart(unsigned int type)
                GDT_ENTRY(0x009b, restart_pa, 0xffff);
  
        /* Jump to the identity-mapped low memory code */
@@ -15434,7 +16589,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/reboot.c linux-3.1.3/arch/x86/kernel/rebo
  }
  #ifdef CONFIG_APM_MODULE
  EXPORT_SYMBOL(machine_real_restart);
-@@ -523,7 +553,7 @@ void __attribute__((weak)) mach_reboot_f
+@@ -532,7 +562,7 @@ void __attribute__((weak)) mach_reboot_fixups(void)
   * try to force a triple fault and then cycle between hitting the keyboard
   * controller and doing that
   */
@@ -15443,7 +16598,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/reboot.c linux-3.1.3/arch/x86/kernel/rebo
  {
        int i;
        int attempt = 0;
-@@ -647,13 +677,13 @@ void native_machine_shutdown(void)
+@@ -656,13 +686,13 @@ void native_machine_shutdown(void)
  #endif
  }
  
@@ -15459,7 +16614,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/reboot.c linux-3.1.3/arch/x86/kernel/rebo
  {
        printk("machine restart\n");
  
-@@ -662,7 +692,7 @@ static void native_machine_restart(char 
+@@ -671,7 +701,7 @@ static void native_machine_restart(char *__unused)
        __machine_emergency_restart(0);
  }
  
@@ -15468,7 +16623,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/reboot.c linux-3.1.3/arch/x86/kernel/rebo
  {
        /* stop other cpus and apics */
        machine_shutdown();
-@@ -673,7 +703,7 @@ static void native_machine_halt(void)
+@@ -682,7 +712,7 @@ static void native_machine_halt(void)
        stop_this_cpu(NULL);
  }
  
@@ -15477,7 +16632,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/reboot.c linux-3.1.3/arch/x86/kernel/rebo
  {
        if (pm_power_off) {
                if (!reboot_force)
-@@ -682,6 +712,7 @@ static void native_machine_power_off(voi
+@@ -691,6 +721,7 @@ static void native_machine_power_off(void)
        }
        /* a fallback in case there is no PM info available */
        tboot_shutdown(TB_SHUTDOWN_HALT);
@@ -15485,10 +16640,39 @@ diff -urNp linux-3.1.3/arch/x86/kernel/reboot.c linux-3.1.3/arch/x86/kernel/rebo
  }
  
  struct machine_ops machine_ops = {
-diff -urNp linux-3.1.3/arch/x86/kernel/setup.c linux-3.1.3/arch/x86/kernel/setup.c
---- linux-3.1.3/arch/x86/kernel/setup.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/setup.c        2011-11-16 18:39:07.000000000 -0500
-@@ -447,7 +447,7 @@ static void __init parse_setup_data(void
+diff --git a/arch/x86/kernel/relocate_kernel_64.S b/arch/x86/kernel/relocate_kernel_64.S
+index 7a6f3b3..bed145d7 100644
+--- a/arch/x86/kernel/relocate_kernel_64.S
++++ b/arch/x86/kernel/relocate_kernel_64.S
+@@ -11,6 +11,7 @@
+ #include <asm/kexec.h>
+ #include <asm/processor-flags.h>
+ #include <asm/pgtable_types.h>
++#include <asm/alternative-asm.h>
+ /*
+  * Must be relocatable PIC code callable as a C function
+@@ -160,13 +161,14 @@ identity_mapped:
+       xorq    %rbp, %rbp
+       xorq    %r8,  %r8
+       xorq    %r9,  %r9
+-      xorq    %r10, %r9
++      xorq    %r10, %r10
+       xorq    %r11, %r11
+       xorq    %r12, %r12
+       xorq    %r13, %r13
+       xorq    %r14, %r14
+       xorq    %r15, %r15
++      pax_force_retaddr 0, 1
+       ret
+ 1:
+diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
+index afaf384..1a101fe 100644
+--- a/arch/x86/kernel/setup.c
++++ b/arch/x86/kernel/setup.c
+@@ -447,7 +447,7 @@ static void __init parse_setup_data(void)
  
                switch (data->type) {
                case SETUP_E820_EXT:
@@ -15526,9 +16710,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/setup.c linux-3.1.3/arch/x86/kernel/setup
        data_resource.end = virt_to_phys(_edata)-1;
        bss_resource.start = virt_to_phys(&__bss_start);
        bss_resource.end = virt_to_phys(&__bss_stop)-1;
-diff -urNp linux-3.1.3/arch/x86/kernel/setup_percpu.c linux-3.1.3/arch/x86/kernel/setup_percpu.c
---- linux-3.1.3/arch/x86/kernel/setup_percpu.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/setup_percpu.c 2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
+index 71f4727..16dc9f7 100644
+--- a/arch/x86/kernel/setup_percpu.c
++++ b/arch/x86/kernel/setup_percpu.c
 @@ -21,19 +21,17 @@
  #include <asm/cpu.h>
  #include <asm/stackprotector.h>
@@ -15553,7 +16738,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/setup_percpu.c linux-3.1.3/arch/x86/kerne
        [0 ... NR_CPUS-1] = BOOT_PERCPU_OFFSET,
  };
  EXPORT_SYMBOL(__per_cpu_offset);
-@@ -155,10 +153,10 @@ static inline void setup_percpu_segment(
+@@ -155,10 +153,10 @@ static inline void setup_percpu_segment(int cpu)
  {
  #ifdef CONFIG_X86_32
        struct desc_struct gdt;
@@ -15592,10 +16777,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/setup_percpu.c linux-3.1.3/arch/x86/kerne
                /*
                 * Up to this point, the boot CPU has been using .init.data
                 * area.  Reload any changed state for the boot CPU.
-diff -urNp linux-3.1.3/arch/x86/kernel/signal.c linux-3.1.3/arch/x86/kernel/signal.c
---- linux-3.1.3/arch/x86/kernel/signal.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/signal.c       2011-11-16 19:39:49.000000000 -0500
-@@ -198,7 +198,7 @@ static unsigned long align_sigframe(unsi
+diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
+index 54ddaeb2..a6aa4d2 100644
+--- a/arch/x86/kernel/signal.c
++++ b/arch/x86/kernel/signal.c
+@@ -198,7 +198,7 @@ static unsigned long align_sigframe(unsigned long sp)
         * Align the stack pointer according to the i386 ABI,
         * i.e. so that on function entry ((sp + 4) & 15) == 0.
         */
@@ -15604,7 +16790,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/signal.c linux-3.1.3/arch/x86/kernel/sign
  #else /* !CONFIG_X86_32 */
        sp = round_down(sp, 16) - 8;
  #endif
-@@ -249,11 +249,11 @@ get_sigframe(struct k_sigaction *ka, str
+@@ -249,11 +249,11 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size,
         * Return an always-bogus address instead so we will die with SIGSEGV.
         */
        if (onsigstack && !likely(on_sig_stack(sp)))
@@ -15618,7 +16804,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/signal.c linux-3.1.3/arch/x86/kernel/sign
  
        return (void __user *)sp;
  }
-@@ -308,9 +308,9 @@ __setup_frame(int sig, struct k_sigactio
+@@ -308,9 +308,9 @@ __setup_frame(int sig, struct k_sigaction *ka, sigset_t *set,
        }
  
        if (current->mm->context.vdso)
@@ -15630,7 +16816,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/signal.c linux-3.1.3/arch/x86/kernel/sign
        if (ka->sa.sa_flags & SA_RESTORER)
                restorer = ka->sa.sa_restorer;
  
-@@ -324,7 +324,7 @@ __setup_frame(int sig, struct k_sigactio
+@@ -324,7 +324,7 @@ __setup_frame(int sig, struct k_sigaction *ka, sigset_t *set,
         * reasons and because gdb uses it as a signature to notice
         * signal handler stack frames.
         */
@@ -15639,7 +16825,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/signal.c linux-3.1.3/arch/x86/kernel/sign
  
        if (err)
                return -EFAULT;
-@@ -378,7 +378,10 @@ static int __setup_rt_frame(int sig, str
+@@ -378,7 +378,10 @@ static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
                err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
  
                /* Set up to return from userspace.  */
@@ -15651,7 +16837,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/signal.c linux-3.1.3/arch/x86/kernel/sign
                if (ka->sa.sa_flags & SA_RESTORER)
                        restorer = ka->sa.sa_restorer;
                put_user_ex(restorer, &frame->pretcode);
-@@ -390,7 +393,7 @@ static int __setup_rt_frame(int sig, str
+@@ -390,7 +393,7 @@ static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
                 * reasons and because gdb uses it as a signature to notice
                 * signal handler stack frames.
                 */
@@ -15660,7 +16846,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/signal.c linux-3.1.3/arch/x86/kernel/sign
        } put_user_catch(err);
  
        if (err)
-@@ -762,6 +765,8 @@ static void do_signal(struct pt_regs *re
+@@ -762,6 +765,8 @@ static void do_signal(struct pt_regs *regs)
        siginfo_t info;
        int signr;
  
@@ -15669,7 +16855,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/signal.c linux-3.1.3/arch/x86/kernel/sign
        /*
         * We want the common case to go fast, which is why we may in certain
         * cases get here from kernel mode. Just return without doing anything
-@@ -769,7 +774,7 @@ static void do_signal(struct pt_regs *re
+@@ -769,7 +774,7 @@ static void do_signal(struct pt_regs *regs)
         * X86_32: vm86 regs switched out by assembly code before reaching
         * here, so testing against kernel CS suffices.
         */
@@ -15678,10 +16864,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/signal.c linux-3.1.3/arch/x86/kernel/sign
                return;
  
        signr = get_signal_to_deliver(&info, &ka, regs, NULL);
-diff -urNp linux-3.1.3/arch/x86/kernel/smpboot.c linux-3.1.3/arch/x86/kernel/smpboot.c
---- linux-3.1.3/arch/x86/kernel/smpboot.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/smpboot.c      2011-11-16 18:39:07.000000000 -0500
-@@ -709,17 +709,20 @@ static int __cpuinit do_boot_cpu(int api
+diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
+index 9f548cb..caf76f7 100644
+--- a/arch/x86/kernel/smpboot.c
++++ b/arch/x86/kernel/smpboot.c
+@@ -709,17 +709,20 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu)
        set_idle_for_cpu(cpu, c_idle.idle);
  do_rest:
        per_cpu(current_task, cpu) = c_idle.idle;
@@ -15705,7 +16892,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/smpboot.c linux-3.1.3/arch/x86/kernel/smp
        initial_code = (unsigned long)start_secondary;
        stack_start  = c_idle.idle->thread.sp;
  
-@@ -861,6 +864,12 @@ int __cpuinit native_cpu_up(unsigned int
+@@ -861,6 +864,12 @@ int __cpuinit native_cpu_up(unsigned int cpu)
  
        per_cpu(cpu_state, cpu) = CPU_UP_PREPARE;
  
@@ -15718,10 +16905,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/smpboot.c linux-3.1.3/arch/x86/kernel/smp
        err = do_boot_cpu(apicid, cpu);
        if (err) {
                pr_debug("do_boot_cpu failed %d\n", err);
-diff -urNp linux-3.1.3/arch/x86/kernel/step.c linux-3.1.3/arch/x86/kernel/step.c
---- linux-3.1.3/arch/x86/kernel/step.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/step.c 2011-11-16 18:39:07.000000000 -0500
-@@ -27,10 +27,10 @@ unsigned long convert_ip_to_linear(struc
+diff --git a/arch/x86/kernel/step.c b/arch/x86/kernel/step.c
+index c346d11..d43b163 100644
+--- a/arch/x86/kernel/step.c
++++ b/arch/x86/kernel/step.c
+@@ -27,10 +27,10 @@ unsigned long convert_ip_to_linear(struct task_struct *child, struct pt_regs *re
                struct desc_struct *desc;
                unsigned long base;
  
@@ -15734,7 +16922,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/step.c linux-3.1.3/arch/x86/kernel/step.c
                        addr = -1L; /* bogus selector, access would fault */
                else {
                        desc = child->mm->context.ldt + seg;
-@@ -42,7 +42,8 @@ unsigned long convert_ip_to_linear(struc
+@@ -42,7 +42,8 @@ unsigned long convert_ip_to_linear(struct task_struct *child, struct pt_regs *re
                        addr += base;
                }
                mutex_unlock(&child->mm->context.lock);
@@ -15744,7 +16932,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/step.c linux-3.1.3/arch/x86/kernel/step.c
  
        return addr;
  }
-@@ -53,6 +54,9 @@ static int is_setting_trap_flag(struct t
+@@ -53,6 +54,9 @@ static int is_setting_trap_flag(struct task_struct *child, struct pt_regs *regs)
        unsigned char opcode[15];
        unsigned long addr = convert_ip_to_linear(child, regs);
  
@@ -15754,17 +16942,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/step.c linux-3.1.3/arch/x86/kernel/step.c
        copied = access_process_vm(child, addr, opcode, sizeof(opcode), 0);
        for (i = 0; i < copied; i++) {
                switch (opcode[i]) {
-diff -urNp linux-3.1.3/arch/x86/kernel/syscall_table_32.S linux-3.1.3/arch/x86/kernel/syscall_table_32.S
---- linux-3.1.3/arch/x86/kernel/syscall_table_32.S     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/syscall_table_32.S     2011-11-16 18:39:07.000000000 -0500
-@@ -1,3 +1,4 @@
-+.section .rodata,"a",@progbits
- ENTRY(sys_call_table)
-       .long sys_restart_syscall       /* 0 - old "setup()" system call, used for restarting */
-       .long sys_exit
-diff -urNp linux-3.1.3/arch/x86/kernel/sys_i386_32.c linux-3.1.3/arch/x86/kernel/sys_i386_32.c
---- linux-3.1.3/arch/x86/kernel/sys_i386_32.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/sys_i386_32.c  2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/kernel/sys_i386_32.c b/arch/x86/kernel/sys_i386_32.c
+index 0b0cb5f..db6b9ed 100644
+--- a/arch/x86/kernel/sys_i386_32.c
++++ b/arch/x86/kernel/sys_i386_32.c
 @@ -24,17 +24,224 @@
  
  #include <asm/syscalls.h>
@@ -16002,9 +17183,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/sys_i386_32.c linux-3.1.3/arch/x86/kernel
 +
 +      return addr;
  }
-diff -urNp linux-3.1.3/arch/x86/kernel/sys_x86_64.c linux-3.1.3/arch/x86/kernel/sys_x86_64.c
---- linux-3.1.3/arch/x86/kernel/sys_x86_64.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/sys_x86_64.c   2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c
+index ff14a50..35626c3 100644
+--- a/arch/x86/kernel/sys_x86_64.c
++++ b/arch/x86/kernel/sys_x86_64.c
 @@ -32,8 +32,8 @@ out:
        return error;
  }
@@ -16016,7 +17198,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/sys_x86_64.c linux-3.1.3/arch/x86/kernel/
  {
        if (!test_thread_flag(TIF_IA32) && (flags & MAP_32BIT)) {
                unsigned long new_begin;
-@@ -52,7 +52,7 @@ static void find_start_end(unsigned long
+@@ -52,7 +52,7 @@ static void find_start_end(unsigned long flags, unsigned long *begin,
                                *begin = new_begin;
                }
        } else {
@@ -16025,7 +17207,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/sys_x86_64.c linux-3.1.3/arch/x86/kernel/
                *end = TASK_SIZE;
        }
  }
-@@ -69,16 +69,19 @@ arch_get_unmapped_area(struct file *filp
+@@ -69,16 +69,19 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
        if (flags & MAP_FIXED)
                return addr;
  
@@ -16057,7 +17239,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/sys_x86_64.c linux-3.1.3/arch/x86/kernel/
                        /*
                         * Remember the place where we stopped the search:
                         */
-@@ -128,7 +131,7 @@ arch_get_unmapped_area_topdown(struct fi
+@@ -128,7 +131,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
  {
        struct vm_area_struct *vma;
        struct mm_struct *mm = current->mm;
@@ -16066,7 +17248,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/sys_x86_64.c linux-3.1.3/arch/x86/kernel/
  
        /* requested length too big for entire address space */
        if (len > TASK_SIZE)
-@@ -141,13 +144,18 @@ arch_get_unmapped_area_topdown(struct fi
+@@ -141,13 +144,18 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
        if (!test_thread_flag(TIF_IA32) && (flags & MAP_32BIT))
                goto bottomup;
  
@@ -16089,7 +17271,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/sys_x86_64.c linux-3.1.3/arch/x86/kernel/
        }
  
        /* check if free_area_cache is useful for us */
-@@ -162,7 +170,7 @@ arch_get_unmapped_area_topdown(struct fi
+@@ -162,7 +170,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
        /* make sure it can fit in the remaining address space */
        if (addr > len) {
                vma = find_vma(mm, addr-len);
@@ -16098,7 +17280,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/sys_x86_64.c linux-3.1.3/arch/x86/kernel/
                        /* remember the address as a hint for next time */
                        return mm->free_area_cache = addr-len;
        }
-@@ -179,7 +187,7 @@ arch_get_unmapped_area_topdown(struct fi
+@@ -179,7 +187,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
                 * return with success:
                 */
                vma = find_vma(mm, addr);
@@ -16107,7 +17289,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/sys_x86_64.c linux-3.1.3/arch/x86/kernel/
                        /* remember the address as a hint for next time */
                        return mm->free_area_cache = addr;
  
-@@ -188,8 +196,8 @@ arch_get_unmapped_area_topdown(struct fi
+@@ -188,8 +196,8 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
                        mm->cached_hole_size = vma->vm_start - addr;
  
                /* try just below the current vma->vm_start */
@@ -16142,9 +17324,19 @@ diff -urNp linux-3.1.3/arch/x86/kernel/sys_x86_64.c linux-3.1.3/arch/x86/kernel/
        mm->cached_hole_size = ~0UL;
  
        return addr;
-diff -urNp linux-3.1.3/arch/x86/kernel/tboot.c linux-3.1.3/arch/x86/kernel/tboot.c
---- linux-3.1.3/arch/x86/kernel/tboot.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/tboot.c        2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/kernel/syscall_table_32.S b/arch/x86/kernel/syscall_table_32.S
+index bc19be3..0f5fbf7 100644
+--- a/arch/x86/kernel/syscall_table_32.S
++++ b/arch/x86/kernel/syscall_table_32.S
+@@ -1,3 +1,4 @@
++.section .rodata,"a",@progbits
+ ENTRY(sys_call_table)
+       .long sys_restart_syscall       /* 0 - old "setup()" system call, used for restarting */
+       .long sys_exit
+diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c
+index e07a2fc..db0369d 100644
+--- a/arch/x86/kernel/tboot.c
++++ b/arch/x86/kernel/tboot.c
 @@ -218,7 +218,7 @@ static int tboot_setup_sleep(void)
  
  void tboot_shutdown(u32 shutdown_type)
@@ -16163,7 +17355,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/tboot.c linux-3.1.3/arch/x86/kernel/tboot
        shutdown();
  
        /* should not reach here */
-@@ -297,7 +297,7 @@ void tboot_sleep(u8 sleep_state, u32 pm1
+@@ -297,7 +297,7 @@ void tboot_sleep(u8 sleep_state, u32 pm1a_control, u32 pm1b_control)
        tboot_shutdown(acpi_shutdown_map[sleep_state]);
  }
  
@@ -16172,7 +17364,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/tboot.c linux-3.1.3/arch/x86/kernel/tboot
  
  static int tboot_wait_for_aps(int num_aps)
  {
-@@ -321,9 +321,9 @@ static int __cpuinit tboot_cpu_callback(
+@@ -321,9 +321,9 @@ static int __cpuinit tboot_cpu_callback(struct notifier_block *nfb,
  {
        switch (action) {
        case CPU_DYING:
@@ -16193,10 +17385,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/tboot.c linux-3.1.3/arch/x86/kernel/tboot
        register_hotcpu_notifier(&tboot_cpu_notifier);
        return 0;
  }
-diff -urNp linux-3.1.3/arch/x86/kernel/time.c linux-3.1.3/arch/x86/kernel/time.c
---- linux-3.1.3/arch/x86/kernel/time.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/time.c 2011-11-16 18:39:07.000000000 -0500
-@@ -30,9 +30,9 @@ unsigned long profile_pc(struct pt_regs 
+diff --git a/arch/x86/kernel/time.c b/arch/x86/kernel/time.c
+index 5a64d05..804587b 100644
+--- a/arch/x86/kernel/time.c
++++ b/arch/x86/kernel/time.c
+@@ -30,9 +30,9 @@ unsigned long profile_pc(struct pt_regs *regs)
  {
        unsigned long pc = instruction_pointer(regs);
  
@@ -16208,7 +17401,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/time.c linux-3.1.3/arch/x86/kernel/time.c
  #else
                unsigned long *sp =
                        (unsigned long *)kernel_stack_pointer(regs);
-@@ -41,11 +41,17 @@ unsigned long profile_pc(struct pt_regs 
+@@ -41,11 +41,17 @@ unsigned long profile_pc(struct pt_regs *regs)
                 * or above a saved flags. Eflags has bits 22-31 zero,
                 * kernel addresses don't.
                 */
@@ -16226,10 +17419,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/time.c linux-3.1.3/arch/x86/kernel/time.c
        }
        return pc;
  }
-diff -urNp linux-3.1.3/arch/x86/kernel/tls.c linux-3.1.3/arch/x86/kernel/tls.c
---- linux-3.1.3/arch/x86/kernel/tls.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/tls.c  2011-11-16 18:39:07.000000000 -0500
-@@ -85,6 +85,11 @@ int do_set_thread_area(struct task_struc
+diff --git a/arch/x86/kernel/tls.c b/arch/x86/kernel/tls.c
+index 6bb7b85..dd853e1 100644
+--- a/arch/x86/kernel/tls.c
++++ b/arch/x86/kernel/tls.c
+@@ -85,6 +85,11 @@ int do_set_thread_area(struct task_struct *p, int idx,
        if (idx < GDT_ENTRY_TLS_MIN || idx > GDT_ENTRY_TLS_MAX)
                return -EINVAL;
  
@@ -16241,9 +17435,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/tls.c linux-3.1.3/arch/x86/kernel/tls.c
        set_tls_desc(p, idx, &info, 1);
  
        return 0;
-diff -urNp linux-3.1.3/arch/x86/kernel/trampoline_32.S linux-3.1.3/arch/x86/kernel/trampoline_32.S
---- linux-3.1.3/arch/x86/kernel/trampoline_32.S        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/trampoline_32.S        2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/kernel/trampoline_32.S b/arch/x86/kernel/trampoline_32.S
+index 451c0a7..e57f551 100644
+--- a/arch/x86/kernel/trampoline_32.S
++++ b/arch/x86/kernel/trampoline_32.S
 @@ -32,6 +32,12 @@
  #include <asm/segment.h>
  #include <asm/page_types.h>
@@ -16266,9 +17461,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/trampoline_32.S linux-3.1.3/arch/x86/kern
  
        # These need to be in the same 64K segment as the above;
        # hence we don't use the boot_gdt_descr defined in head.S
-diff -urNp linux-3.1.3/arch/x86/kernel/trampoline_64.S linux-3.1.3/arch/x86/kernel/trampoline_64.S
---- linux-3.1.3/arch/x86/kernel/trampoline_64.S        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/trampoline_64.S        2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/kernel/trampoline_64.S b/arch/x86/kernel/trampoline_64.S
+index 09ff517..df19fbff 100644
+--- a/arch/x86/kernel/trampoline_64.S
++++ b/arch/x86/kernel/trampoline_64.S
 @@ -90,7 +90,7 @@ startup_32:
        movl    $__KERNEL_DS, %eax      # Initialize the %ds segment register
        movl    %eax, %ds
@@ -16287,9 +17483,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/trampoline_64.S linux-3.1.3/arch/x86/kern
        .long   tgdt - r_base
        .short 0
        .quad   0x00cf9b000000ffff      # __KERNEL32_CS
-diff -urNp linux-3.1.3/arch/x86/kernel/traps.c linux-3.1.3/arch/x86/kernel/traps.c
---- linux-3.1.3/arch/x86/kernel/traps.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/traps.c        2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
+index 6913369..7e7dff6 100644
+--- a/arch/x86/kernel/traps.c
++++ b/arch/x86/kernel/traps.c
 @@ -70,12 +70,6 @@ asmlinkage int system_call(void);
  
  /* Do we ignore FPU interrupts ? */
@@ -16303,7 +17500,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/traps.c linux-3.1.3/arch/x86/kernel/traps
  #endif
  
  DECLARE_BITMAP(used_vectors, NR_VECTORS);
-@@ -117,13 +111,13 @@ static inline void preempt_conditional_c
+@@ -117,13 +111,13 @@ static inline void preempt_conditional_cli(struct pt_regs *regs)
  }
  
  static void __kprobes
@@ -16319,7 +17516,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/traps.c linux-3.1.3/arch/x86/kernel/traps
                /*
                 * traps 0, 1, 3, 4, and 5 should be forwarded to vm86.
                 * On nmi (interrupt 2), do_trap should not be called.
-@@ -134,7 +128,7 @@ do_trap(int trapnr, int signr, char *str
+@@ -134,7 +128,7 @@ do_trap(int trapnr, int signr, char *str, struct pt_regs *regs,
        }
  #endif
  
@@ -16358,7 +17555,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/traps.c linux-3.1.3/arch/x86/kernel/traps
        return;
  
  #ifdef CONFIG_X86_32
-@@ -264,14 +270,30 @@ do_general_protection(struct pt_regs *re
+@@ -264,14 +270,30 @@ do_general_protection(struct pt_regs *regs, long error_code)
        conditional_sti(regs);
  
  #ifdef CONFIG_X86_32
@@ -16405,7 +17602,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/traps.c linux-3.1.3/arch/x86/kernel/traps
        die("general protection fault", regs, error_code);
  }
  
-@@ -433,6 +462,17 @@ static notrace __kprobes void default_do
+@@ -433,6 +462,17 @@ static notrace __kprobes void default_do_nmi(struct pt_regs *regs)
  dotraplinkage notrace __kprobes void
  do_nmi(struct pt_regs *regs, long error_code)
  {
@@ -16423,7 +17620,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/traps.c linux-3.1.3/arch/x86/kernel/traps
        nmi_enter();
  
        inc_irq_stat(__nmi_count);
-@@ -569,7 +609,7 @@ dotraplinkage void __kprobes do_debug(st
+@@ -569,7 +609,7 @@ dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code)
        /* It's safe to allow irq's after DR6 has been saved */
        preempt_conditional_sti(regs);
  
@@ -16432,7 +17629,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/traps.c linux-3.1.3/arch/x86/kernel/traps
                handle_vm86_trap((struct kernel_vm86_regs *) regs,
                                error_code, 1);
                preempt_conditional_cli(regs);
-@@ -583,7 +623,7 @@ dotraplinkage void __kprobes do_debug(st
+@@ -583,7 +623,7 @@ dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code)
         * We already checked v86 mode above, so we can check for kernel mode
         * by just checking the CPL of CS.
         */
@@ -16441,7 +17638,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/traps.c linux-3.1.3/arch/x86/kernel/traps
                tsk->thread.debugreg6 &= ~DR_STEP;
                set_tsk_thread_flag(tsk, TIF_SINGLESTEP);
                regs->flags &= ~X86_EFLAGS_TF;
-@@ -612,7 +652,7 @@ void math_error(struct pt_regs *regs, in
+@@ -612,7 +652,7 @@ void math_error(struct pt_regs *regs, int error_code, int trapnr)
                return;
        conditional_sti(regs);
  
@@ -16450,7 +17647,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/traps.c linux-3.1.3/arch/x86/kernel/traps
        {
                if (!fixup_exception(regs)) {
                        task->thread.error_code = error_code;
-@@ -723,7 +763,7 @@ asmlinkage void __attribute__((weak)) sm
+@@ -723,7 +763,7 @@ asmlinkage void __attribute__((weak)) smp_threshold_interrupt(void)
  void __math_state_restore(void)
  {
        struct thread_info *thread = current_thread_info();
@@ -16469,9 +17666,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/traps.c linux-3.1.3/arch/x86/kernel/traps
  
        if (!tsk_used_math(tsk)) {
                local_irq_enable();
-diff -urNp linux-3.1.3/arch/x86/kernel/verify_cpu.S linux-3.1.3/arch/x86/kernel/verify_cpu.S
---- linux-3.1.3/arch/x86/kernel/verify_cpu.S   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/verify_cpu.S   2011-11-16 18:40:08.000000000 -0500
+diff --git a/arch/x86/kernel/verify_cpu.S b/arch/x86/kernel/verify_cpu.S
+index b9242ba..50c5edd 100644
+--- a/arch/x86/kernel/verify_cpu.S
++++ b/arch/x86/kernel/verify_cpu.S
 @@ -20,6 +20,7 @@
   *    arch/x86/boot/compressed/head_64.S: Boot cpu verification
   *    arch/x86/kernel/trampoline_64.S: secondary processor verification
@@ -16480,9 +17678,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/verify_cpu.S linux-3.1.3/arch/x86/kernel/
   *
   *    verify_cpu, returns the status of longmode and SSE in register %eax.
   *            0: Success    1: Failure
-diff -urNp linux-3.1.3/arch/x86/kernel/vm86_32.c linux-3.1.3/arch/x86/kernel/vm86_32.c
---- linux-3.1.3/arch/x86/kernel/vm86_32.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/vm86_32.c      2011-11-16 18:40:08.000000000 -0500
+diff --git a/arch/x86/kernel/vm86_32.c b/arch/x86/kernel/vm86_32.c
+index 863f875..4307295 100644
+--- a/arch/x86/kernel/vm86_32.c
++++ b/arch/x86/kernel/vm86_32.c
 @@ -41,6 +41,7 @@
  #include <linux/ptrace.h>
  #include <linux/audit.h>
@@ -16491,7 +17690,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/vm86_32.c linux-3.1.3/arch/x86/kernel/vm8
  
  #include <asm/uaccess.h>
  #include <asm/io.h>
-@@ -148,7 +149,7 @@ struct pt_regs *save_v86_state(struct ke
+@@ -148,7 +149,7 @@ struct pt_regs *save_v86_state(struct kernel_vm86_regs *regs)
                do_exit(SIGSEGV);
        }
  
@@ -16500,7 +17699,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/vm86_32.c linux-3.1.3/arch/x86/kernel/vm8
        current->thread.sp0 = current->thread.saved_sp0;
        current->thread.sysenter_cs = __KERNEL_CS;
        load_sp0(tss, &current->thread);
-@@ -208,6 +209,13 @@ int sys_vm86old(struct vm86_struct __use
+@@ -208,6 +209,13 @@ int sys_vm86old(struct vm86_struct __user *v86, struct pt_regs *regs)
        struct task_struct *tsk;
        int tmp, ret = -EPERM;
  
@@ -16514,7 +17713,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/vm86_32.c linux-3.1.3/arch/x86/kernel/vm8
        tsk = current;
        if (tsk->thread.saved_sp0)
                goto out;
-@@ -238,6 +246,14 @@ int sys_vm86(unsigned long cmd, unsigned
+@@ -238,6 +246,14 @@ int sys_vm86(unsigned long cmd, unsigned long arg, struct pt_regs *regs)
        int tmp, ret;
        struct vm86plus_struct __user *v86;
  
@@ -16529,7 +17728,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/vm86_32.c linux-3.1.3/arch/x86/kernel/vm8
        tsk = current;
        switch (cmd) {
        case VM86_REQUEST_IRQ:
-@@ -324,7 +340,7 @@ static void do_sys_vm86(struct kernel_vm
+@@ -324,7 +340,7 @@ static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk
        tsk->thread.saved_fs = info->regs32->fs;
        tsk->thread.saved_gs = get_user_gs(info->regs32);
  
@@ -16538,7 +17737,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/vm86_32.c linux-3.1.3/arch/x86/kernel/vm8
        tsk->thread.sp0 = (unsigned long) &info->VM86_TSS_ESP0;
        if (cpu_has_sep)
                tsk->thread.sysenter_cs = 0;
-@@ -529,7 +545,7 @@ static void do_int(struct kernel_vm86_re
+@@ -529,7 +545,7 @@ static void do_int(struct kernel_vm86_regs *regs, int i,
                goto cannot_handle;
        if (i == 0x21 && is_revectored(AH(regs), &KVM86->int21_revectored))
                goto cannot_handle;
@@ -16547,9 +17746,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/vm86_32.c linux-3.1.3/arch/x86/kernel/vm8
        if (get_user(segoffs, intr_ptr))
                goto cannot_handle;
        if ((segoffs >> 16) == BIOSSEG)
-diff -urNp linux-3.1.3/arch/x86/kernel/vmlinux.lds.S linux-3.1.3/arch/x86/kernel/vmlinux.lds.S
---- linux-3.1.3/arch/x86/kernel/vmlinux.lds.S  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/vmlinux.lds.S  2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
+index 0f703f1..9e15f64 100644
+--- a/arch/x86/kernel/vmlinux.lds.S
++++ b/arch/x86/kernel/vmlinux.lds.S
 @@ -26,6 +26,13 @@
  #include <asm/page_types.h>
  #include <asm/cache.h>
@@ -16626,7 +17826,8 @@ diff -urNp linux-3.1.3/arch/x86/kernel/vmlinux.lds.S linux-3.1.3/arch/x86/kernel
  
 -      NOTES :text :note
 +      . += __KERNEL_TEXT_OFFSET;
-+
+-      EXCEPTION_TABLE(16) :text = 0x9090
 +#ifdef CONFIG_X86_32
 +      . = ALIGN(PAGE_SIZE);
 +      .module.text : AT(ADDR(.module.text) - LOAD_OFFSET) {
@@ -16662,8 +17863,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/vmlinux.lds.S linux-3.1.3/arch/x86/kernel
 +
 +      . = ALIGN(PAGE_SIZE);
 +      NOTES :rodata :note
--      EXCEPTION_TABLE(16) :text = 0x9090
++
 +      EXCEPTION_TABLE(16) :rodata
  
  #if defined(CONFIG_DEBUG_RODATA)
@@ -16810,10 +18010,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/vmlinux.lds.S linux-3.1.3/arch/x86/kernel
           "kernel image bigger than KERNEL_IMAGE_SIZE");
  
  #ifdef CONFIG_SMP
-diff -urNp linux-3.1.3/arch/x86/kernel/vsyscall_64.c linux-3.1.3/arch/x86/kernel/vsyscall_64.c
---- linux-3.1.3/arch/x86/kernel/vsyscall_64.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/vsyscall_64.c  2011-11-16 18:39:07.000000000 -0500
-@@ -56,15 +56,13 @@ DEFINE_VVAR(struct vsyscall_gtod_data, v
+diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c
+index b56c65de..561a55b 100644
+--- a/arch/x86/kernel/vsyscall_64.c
++++ b/arch/x86/kernel/vsyscall_64.c
+@@ -56,15 +56,13 @@ DEFINE_VVAR(struct vsyscall_gtod_data, vsyscall_gtod_data) =
        .lock = __SEQLOCK_UNLOCKED(__vsyscall_gtod_data.lock),
  };
  
@@ -16830,7 +18031,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/vsyscall_64.c linux-3.1.3/arch/x86/kernel
                else if (!strcmp("none", str))
                        vsyscall_mode = NONE;
                else
-@@ -177,7 +175,7 @@ bool emulate_vsyscall(struct pt_regs *re
+@@ -177,7 +175,7 @@ bool emulate_vsyscall(struct pt_regs *regs, unsigned long address)
  
        tsk = current;
        if (seccomp_mode(&tsk->seccomp))
@@ -16839,7 +18040,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/vsyscall_64.c linux-3.1.3/arch/x86/kernel
  
        switch (vsyscall_nr) {
        case 0:
-@@ -219,8 +217,7 @@ bool emulate_vsyscall(struct pt_regs *re
+@@ -219,8 +217,7 @@ bool emulate_vsyscall(struct pt_regs *regs, unsigned long address)
        return true;
  
  sigsegv:
@@ -16861,9 +18062,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/vsyscall_64.c linux-3.1.3/arch/x86/kernel
        BUILD_BUG_ON((unsigned long)__fix_to_virt(VSYSCALL_FIRST_PAGE) !=
                     (unsigned long)VSYSCALL_START);
  
-diff -urNp linux-3.1.3/arch/x86/kernel/x8664_ksyms_64.c linux-3.1.3/arch/x86/kernel/x8664_ksyms_64.c
---- linux-3.1.3/arch/x86/kernel/x8664_ksyms_64.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/x8664_ksyms_64.c       2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/kernel/x8664_ksyms_64.c b/arch/x86/kernel/x8664_ksyms_64.c
+index 9796c2f..f686fbf 100644
+--- a/arch/x86/kernel/x8664_ksyms_64.c
++++ b/arch/x86/kernel/x8664_ksyms_64.c
 @@ -29,8 +29,6 @@ EXPORT_SYMBOL(__put_user_8);
  EXPORT_SYMBOL(copy_user_generic_string);
  EXPORT_SYMBOL(copy_user_generic_unrolled);
@@ -16873,10 +18075,11 @@ diff -urNp linux-3.1.3/arch/x86/kernel/x8664_ksyms_64.c linux-3.1.3/arch/x86/ker
  
  EXPORT_SYMBOL(copy_page);
  EXPORT_SYMBOL(clear_page);
-diff -urNp linux-3.1.3/arch/x86/kernel/xsave.c linux-3.1.3/arch/x86/kernel/xsave.c
---- linux-3.1.3/arch/x86/kernel/xsave.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kernel/xsave.c        2011-11-16 18:39:07.000000000 -0500
-@@ -130,7 +130,7 @@ int check_for_xstate(struct i387_fxsave_
+diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
+index a391134..d0b63b6e 100644
+--- a/arch/x86/kernel/xsave.c
++++ b/arch/x86/kernel/xsave.c
+@@ -130,7 +130,7 @@ int check_for_xstate(struct i387_fxsave_struct __user *buf,
            fx_sw_user->xstate_size > fx_sw_user->extended_size)
                return -EINVAL;
  
@@ -16894,7 +18097,7 @@ diff -urNp linux-3.1.3/arch/x86/kernel/xsave.c linux-3.1.3/arch/x86/kernel/xsave
  }
  
  /*
-@@ -299,7 +299,7 @@ int restore_i387_xstate(void __user *buf
+@@ -299,7 +299,7 @@ int restore_i387_xstate(void __user *buf)
        if (use_xsave())
                err = restore_user_xstate(buf);
        else
@@ -16903,9 +18106,10 @@ diff -urNp linux-3.1.3/arch/x86/kernel/xsave.c linux-3.1.3/arch/x86/kernel/xsave
                                       buf);
        if (unlikely(err)) {
                /*
-diff -urNp linux-3.1.3/arch/x86/kvm/emulate.c linux-3.1.3/arch/x86/kvm/emulate.c
---- linux-3.1.3/arch/x86/kvm/emulate.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kvm/emulate.c 2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
+index 8b4cc5f..f086b5b 100644
+--- a/arch/x86/kvm/emulate.c
++++ b/arch/x86/kvm/emulate.c
 @@ -96,7 +96,7 @@
  #define Src2ImmByte (2<<29)
  #define Src2One     (3<<29)
@@ -16940,9 +18144,10 @@ diff -urNp linux-3.1.3/arch/x86/kvm/emulate.c linux-3.1.3/arch/x86/kvm/emulate.c
                switch ((_dst).bytes) {                                      \
                case 1:                                                      \
                        ____emulate_2op(_op,_src,_dst,_eflags,_bx,_by,"b",u8); \
-diff -urNp linux-3.1.3/arch/x86/kvm/lapic.c linux-3.1.3/arch/x86/kvm/lapic.c
---- linux-3.1.3/arch/x86/kvm/lapic.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kvm/lapic.c   2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
+index 57dcbd4..79aba9b 100644
+--- a/arch/x86/kvm/lapic.c
++++ b/arch/x86/kvm/lapic.c
 @@ -53,7 +53,7 @@
  #define APIC_BUS_CYCLE_NS 1
  
@@ -16952,10 +18157,11 @@ diff -urNp linux-3.1.3/arch/x86/kvm/lapic.c linux-3.1.3/arch/x86/kvm/lapic.c
  
  #define APIC_LVT_NUM                  6
  /* 14 is the version for Xeon and Pentium 8.4.8*/
-diff -urNp linux-3.1.3/arch/x86/kvm/mmu.c linux-3.1.3/arch/x86/kvm/mmu.c
---- linux-3.1.3/arch/x86/kvm/mmu.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kvm/mmu.c     2011-11-16 18:39:07.000000000 -0500
-@@ -3552,7 +3552,7 @@ void kvm_mmu_pte_write(struct kvm_vcpu *
+diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
+index 8e8da79..13bc641 100644
+--- a/arch/x86/kvm/mmu.c
++++ b/arch/x86/kvm/mmu.c
+@@ -3552,7 +3552,7 @@ void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa,
  
        pgprintk("%s: gpa %llx bytes %d\n", __func__, gpa, bytes);
  
@@ -16964,7 +18170,7 @@ diff -urNp linux-3.1.3/arch/x86/kvm/mmu.c linux-3.1.3/arch/x86/kvm/mmu.c
  
        /*
         * Assume that the pte write on a page table of the same type
-@@ -3584,7 +3584,7 @@ void kvm_mmu_pte_write(struct kvm_vcpu *
+@@ -3584,7 +3584,7 @@ void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa,
        }
  
        spin_lock(&vcpu->kvm->mmu_lock);
@@ -16973,9 +18179,10 @@ diff -urNp linux-3.1.3/arch/x86/kvm/mmu.c linux-3.1.3/arch/x86/kvm/mmu.c
                gentry = 0;
        kvm_mmu_free_some_pages(vcpu);
        ++vcpu->kvm->stat.mmu_pte_write;
-diff -urNp linux-3.1.3/arch/x86/kvm/paging_tmpl.h linux-3.1.3/arch/x86/kvm/paging_tmpl.h
---- linux-3.1.3/arch/x86/kvm/paging_tmpl.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kvm/paging_tmpl.h     2011-11-16 19:40:44.000000000 -0500
+diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
+index 507e2b8..fc55f89 100644
+--- a/arch/x86/kvm/paging_tmpl.h
++++ b/arch/x86/kvm/paging_tmpl.h
 @@ -197,7 +197,7 @@ retry_walk:
                if (unlikely(kvm_is_error_hva(host_addr)))
                        goto error;
@@ -16985,7 +18192,7 @@ diff -urNp linux-3.1.3/arch/x86/kvm/paging_tmpl.h linux-3.1.3/arch/x86/kvm/pagin
                if (unlikely(__copy_from_user(&pte, ptep_user, sizeof(pte))))
                        goto error;
  
-@@ -575,6 +575,8 @@ static int FNAME(page_fault)(struct kvm_
+@@ -575,6 +575,8 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr, u32 error_code,
        unsigned long mmu_seq;
        bool map_writable;
  
@@ -16994,7 +18201,7 @@ diff -urNp linux-3.1.3/arch/x86/kvm/paging_tmpl.h linux-3.1.3/arch/x86/kvm/pagin
        pgprintk("%s: addr %lx err %x\n", __func__, addr, error_code);
  
        if (unlikely(error_code & PFERR_RSVD_MASK))
-@@ -701,7 +703,7 @@ static void FNAME(invlpg)(struct kvm_vcp
+@@ -701,7 +703,7 @@ static void FNAME(invlpg)(struct kvm_vcpu *vcpu, gva_t gva)
        if (need_flush)
                kvm_flush_remote_tlbs(vcpu->kvm);
  
@@ -17003,10 +18210,11 @@ diff -urNp linux-3.1.3/arch/x86/kvm/paging_tmpl.h linux-3.1.3/arch/x86/kvm/pagin
  
        spin_unlock(&vcpu->kvm->mmu_lock);
  
-diff -urNp linux-3.1.3/arch/x86/kvm/svm.c linux-3.1.3/arch/x86/kvm/svm.c
---- linux-3.1.3/arch/x86/kvm/svm.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kvm/svm.c     2011-11-16 18:39:07.000000000 -0500
-@@ -3381,7 +3381,11 @@ static void reload_tss(struct kvm_vcpu *
+diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
+index 475d1c9..33658ff 100644
+--- a/arch/x86/kvm/svm.c
++++ b/arch/x86/kvm/svm.c
+@@ -3381,7 +3381,11 @@ static void reload_tss(struct kvm_vcpu *vcpu)
        int cpu = raw_smp_processor_id();
  
        struct svm_cpu_data *sd = per_cpu(svm_data, cpu);
@@ -17018,7 +18226,7 @@ diff -urNp linux-3.1.3/arch/x86/kvm/svm.c linux-3.1.3/arch/x86/kvm/svm.c
        load_TR_desc();
  }
  
-@@ -3759,6 +3763,10 @@ static void svm_vcpu_run(struct kvm_vcpu
+@@ -3759,6 +3763,10 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)
  #endif
  #endif
  
@@ -17029,9 +18237,10 @@ diff -urNp linux-3.1.3/arch/x86/kvm/svm.c linux-3.1.3/arch/x86/kvm/svm.c
        reload_tss(vcpu);
  
        local_irq_disable();
-diff -urNp linux-3.1.3/arch/x86/kvm/vmx.c linux-3.1.3/arch/x86/kvm/vmx.c
---- linux-3.1.3/arch/x86/kvm/vmx.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kvm/vmx.c     2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
+index e65a158..656dc24 100644
+--- a/arch/x86/kvm/vmx.c
++++ b/arch/x86/kvm/vmx.c
 @@ -1251,7 +1251,11 @@ static void reload_tss(void)
        struct desc_struct *descs;
  
@@ -17058,7 +18267,7 @@ diff -urNp linux-3.1.3/arch/x86/kvm/vmx.c linux-3.1.3/arch/x86/kvm/vmx.c
  
        if (enable_ept && !cpu_has_vmx_ept_2m_page())
                kvm_disable_largepages();
-@@ -3535,7 +3542,7 @@ static void vmx_set_constant_host_state(
+@@ -3535,7 +3542,7 @@ static void vmx_set_constant_host_state(void)
        vmcs_writel(HOST_IDTR_BASE, dt.address);   /* 22.2.4 */
  
        asm("mov $.Lkvm_vmx_return, %0" : "=r"(tmpl));
@@ -17067,7 +18276,7 @@ diff -urNp linux-3.1.3/arch/x86/kvm/vmx.c linux-3.1.3/arch/x86/kvm/vmx.c
  
        rdmsr(MSR_IA32_SYSENTER_CS, low32, high32);
        vmcs_write32(HOST_IA32_SYSENTER_CS, low32);
-@@ -6021,6 +6028,12 @@ static void __noclone vmx_vcpu_run(struc
+@@ -6021,6 +6028,12 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
                "jmp .Lkvm_vmx_return \n\t"
                ".Llaunched: " __ex(ASM_VMX_VMRESUME) "\n\t"
                ".Lkvm_vmx_return: "
@@ -17080,7 +18289,7 @@ diff -urNp linux-3.1.3/arch/x86/kvm/vmx.c linux-3.1.3/arch/x86/kvm/vmx.c
                /* Save guest registers, load host registers, keep flags */
                "mov %0, %c[wordsize](%%"R"sp) \n\t"
                "pop %0 \n\t"
-@@ -6069,6 +6082,11 @@ static void __noclone vmx_vcpu_run(struc
+@@ -6069,6 +6082,11 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
  #endif
                [cr2]"i"(offsetof(struct vcpu_vmx, vcpu.arch.cr2)),
                [wordsize]"i"(sizeof(ulong))
@@ -17092,7 +18301,7 @@ diff -urNp linux-3.1.3/arch/x86/kvm/vmx.c linux-3.1.3/arch/x86/kvm/vmx.c
              : "cc", "memory"
                , R"ax", R"bx", R"di", R"si"
  #ifdef CONFIG_X86_64
-@@ -6097,7 +6115,16 @@ static void __noclone vmx_vcpu_run(struc
+@@ -6097,7 +6115,16 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
                }
        }
  
@@ -17110,10 +18319,11 @@ diff -urNp linux-3.1.3/arch/x86/kvm/vmx.c linux-3.1.3/arch/x86/kvm/vmx.c
        vmx->loaded_vmcs->launched = 1;
  
        vmx->exit_reason = vmcs_read32(VM_EXIT_REASON);
-diff -urNp linux-3.1.3/arch/x86/kvm/x86.c linux-3.1.3/arch/x86/kvm/x86.c
---- linux-3.1.3/arch/x86/kvm/x86.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/kvm/x86.c     2011-11-16 18:39:07.000000000 -0500
-@@ -1334,8 +1334,8 @@ static int xen_hvm_config(struct kvm_vcp
+diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
+index 84a28ea..9326501 100644
+--- a/arch/x86/kvm/x86.c
++++ b/arch/x86/kvm/x86.c
+@@ -1334,8 +1334,8 @@ static int xen_hvm_config(struct kvm_vcpu *vcpu, u64 data)
  {
        struct kvm *kvm = vcpu->kvm;
        int lm = is_long_mode(vcpu);
@@ -17124,7 +18334,7 @@ diff -urNp linux-3.1.3/arch/x86/kvm/x86.c linux-3.1.3/arch/x86/kvm/x86.c
        u8 blob_size = lm ? kvm->arch.xen_hvm_config.blob_size_64
                : kvm->arch.xen_hvm_config.blob_size_32;
        u32 page_num = data & ~PAGE_MASK;
-@@ -2137,6 +2137,8 @@ long kvm_arch_dev_ioctl(struct file *fil
+@@ -2137,6 +2137,8 @@ long kvm_arch_dev_ioctl(struct file *filp,
                if (n < msr_list.nmsrs)
                        goto out;
                r = -EFAULT;
@@ -17133,7 +18343,7 @@ diff -urNp linux-3.1.3/arch/x86/kvm/x86.c linux-3.1.3/arch/x86/kvm/x86.c
                if (copy_to_user(user_msr_list->indices, &msrs_to_save,
                                 num_msrs_to_save * sizeof(u32)))
                        goto out;
-@@ -2312,15 +2314,20 @@ static int kvm_vcpu_ioctl_set_cpuid2(str
+@@ -2312,15 +2314,20 @@ static int kvm_vcpu_ioctl_set_cpuid2(struct kvm_vcpu *vcpu,
                                     struct kvm_cpuid2 *cpuid,
                                     struct kvm_cpuid_entry2 __user *entries)
  {
@@ -17157,7 +18367,7 @@ diff -urNp linux-3.1.3/arch/x86/kvm/x86.c linux-3.1.3/arch/x86/kvm/x86.c
        vcpu->arch.cpuid_nent = cpuid->nent;
        kvm_apic_set_version(vcpu);
        kvm_x86_ops->cpuid_update(vcpu);
-@@ -2335,15 +2342,19 @@ static int kvm_vcpu_ioctl_get_cpuid2(str
+@@ -2335,15 +2342,19 @@ static int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu,
                                     struct kvm_cpuid2 *cpuid,
                                     struct kvm_cpuid_entry2 __user *entries)
  {
@@ -17180,7 +18390,7 @@ diff -urNp linux-3.1.3/arch/x86/kvm/x86.c linux-3.1.3/arch/x86/kvm/x86.c
        return 0;
  
  out:
-@@ -2718,7 +2729,7 @@ static int kvm_vcpu_ioctl_set_lapic(stru
+@@ -2718,7 +2729,7 @@ static int kvm_vcpu_ioctl_set_lapic(struct kvm_vcpu *vcpu,
  static int kvm_vcpu_ioctl_interrupt(struct kvm_vcpu *vcpu,
                                    struct kvm_interrupt *irq)
  {
@@ -17198,10 +18408,11 @@ diff -urNp linux-3.1.3/arch/x86/kvm/x86.c linux-3.1.3/arch/x86/kvm/x86.c
  {
        int r;
        struct kvm_x86_ops *ops = (struct kvm_x86_ops *)opaque;
-diff -urNp linux-3.1.3/arch/x86/lguest/boot.c linux-3.1.3/arch/x86/lguest/boot.c
---- linux-3.1.3/arch/x86/lguest/boot.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/lguest/boot.c 2011-11-16 18:39:07.000000000 -0500
-@@ -1184,9 +1184,10 @@ static __init int early_put_chars(u32 vt
+diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c
+index 13ee258..b9632f6 100644
+--- a/arch/x86/lguest/boot.c
++++ b/arch/x86/lguest/boot.c
+@@ -1184,9 +1184,10 @@ static __init int early_put_chars(u32 vtermno, const char *buf, int count)
   * Rebooting also tells the Host we're finished, but the RESTART flag tells the
   * Launcher to reboot us.
   */
@@ -17213,9 +18424,10 @@ diff -urNp linux-3.1.3/arch/x86/lguest/boot.c linux-3.1.3/arch/x86/lguest/boot.c
  }
  
  /*G:050
-diff -urNp linux-3.1.3/arch/x86/lib/atomic64_32.c linux-3.1.3/arch/x86/lib/atomic64_32.c
---- linux-3.1.3/arch/x86/lib/atomic64_32.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/lib/atomic64_32.c     2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/lib/atomic64_32.c b/arch/x86/lib/atomic64_32.c
+index 042f682..c92afb6 100644
+--- a/arch/x86/lib/atomic64_32.c
++++ b/arch/x86/lib/atomic64_32.c
 @@ -8,18 +8,30 @@
  
  long long atomic64_read_cx8(long long, const atomic64_t *v);
@@ -17294,9 +18506,10 @@ diff -urNp linux-3.1.3/arch/x86/lib/atomic64_32.c linux-3.1.3/arch/x86/lib/atomi
  long long atomic64_dec_if_positive_386(atomic64_t *v);
  EXPORT_SYMBOL(atomic64_dec_if_positive_386);
  int atomic64_inc_not_zero_386(atomic64_t *v);
-diff -urNp linux-3.1.3/arch/x86/lib/atomic64_386_32.S linux-3.1.3/arch/x86/lib/atomic64_386_32.S
---- linux-3.1.3/arch/x86/lib/atomic64_386_32.S 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/lib/atomic64_386_32.S 2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/lib/atomic64_386_32.S b/arch/x86/lib/atomic64_386_32.S
+index e8e7e0d..56fd1b0 100644
+--- a/arch/x86/lib/atomic64_386_32.S
++++ b/arch/x86/lib/atomic64_386_32.S
 @@ -48,6 +48,10 @@ BEGIN(read)
        movl  (v), %eax
        movl 4(v), %edx
@@ -17552,9 +18765,10 @@ diff -urNp linux-3.1.3/arch/x86/lib/atomic64_386_32.S linux-3.1.3/arch/x86/lib/a
        js 1f
        movl %eax,  (v)
        movl %edx, 4(v)
-diff -urNp linux-3.1.3/arch/x86/lib/atomic64_cx8_32.S linux-3.1.3/arch/x86/lib/atomic64_cx8_32.S
---- linux-3.1.3/arch/x86/lib/atomic64_cx8_32.S 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/lib/atomic64_cx8_32.S 2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/lib/atomic64_cx8_32.S b/arch/x86/lib/atomic64_cx8_32.S
+index 391a083..d658e9f 100644
+--- a/arch/x86/lib/atomic64_cx8_32.S
++++ b/arch/x86/lib/atomic64_cx8_32.S
 @@ -35,10 +35,20 @@ ENTRY(atomic64_read_cx8)
        CFI_STARTPROC
  
@@ -17776,9 +18990,10 @@ diff -urNp linux-3.1.3/arch/x86/lib/atomic64_cx8_32.S linux-3.1.3/arch/x86/lib/a
        ret
  4:
        testl %edx, %edx
-diff -urNp linux-3.1.3/arch/x86/lib/checksum_32.S linux-3.1.3/arch/x86/lib/checksum_32.S
---- linux-3.1.3/arch/x86/lib/checksum_32.S     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/lib/checksum_32.S     2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/lib/checksum_32.S b/arch/x86/lib/checksum_32.S
+index 78d16a5..fbcf666 100644
+--- a/arch/x86/lib/checksum_32.S
++++ b/arch/x86/lib/checksum_32.S
 @@ -28,7 +28,8 @@
  #include <linux/linkage.h>
  #include <asm/dwarf2.h>
@@ -17789,7 +19004,7 @@ diff -urNp linux-3.1.3/arch/x86/lib/checksum_32.S linux-3.1.3/arch/x86/lib/check
  /*
   * computes a partial checksum, e.g. for TCP/UDP fragments
   */
-@@ -296,9 +297,24 @@ unsigned int csum_partial_copy_generic (
+@@ -296,9 +297,24 @@ unsigned int csum_partial_copy_generic (const char *src, char *dst,
  
  #define ARGBASE 16            
  #define FP            12
@@ -18023,9 +19238,10 @@ diff -urNp linux-3.1.3/arch/x86/lib/checksum_32.S linux-3.1.3/arch/x86/lib/check
                                
  #undef ROUND
  #undef ROUND1         
-diff -urNp linux-3.1.3/arch/x86/lib/clear_page_64.S linux-3.1.3/arch/x86/lib/clear_page_64.S
---- linux-3.1.3/arch/x86/lib/clear_page_64.S   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/lib/clear_page_64.S   2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/lib/clear_page_64.S b/arch/x86/lib/clear_page_64.S
+index f2145cf..cea889d 100644
+--- a/arch/x86/lib/clear_page_64.S
++++ b/arch/x86/lib/clear_page_64.S
 @@ -11,6 +11,7 @@ ENTRY(clear_page_c)
        movl $4096/8,%ecx
        xorl %eax,%eax
@@ -18059,9 +19275,10 @@ diff -urNp linux-3.1.3/arch/x86/lib/clear_page_64.S linux-3.1.3/arch/x86/lib/cle
  1:    .byte 0xeb                                      /* jmp <disp8> */
        .byte (clear_page_c - clear_page) - (2f - 1b)   /* offset */
  2:    .byte 0xeb                                      /* jmp <disp8> */
-diff -urNp linux-3.1.3/arch/x86/lib/cmpxchg16b_emu.S linux-3.1.3/arch/x86/lib/cmpxchg16b_emu.S
---- linux-3.1.3/arch/x86/lib/cmpxchg16b_emu.S  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/lib/cmpxchg16b_emu.S  2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/lib/cmpxchg16b_emu.S b/arch/x86/lib/cmpxchg16b_emu.S
+index 1e572c5..2a162cd 100644
+--- a/arch/x86/lib/cmpxchg16b_emu.S
++++ b/arch/x86/lib/cmpxchg16b_emu.S
 @@ -53,11 +53,13 @@ this_cpu_cmpxchg16b_emu:
  
        popf
@@ -18076,9 +19293,10 @@ diff -urNp linux-3.1.3/arch/x86/lib/cmpxchg16b_emu.S linux-3.1.3/arch/x86/lib/cm
        ret
  
  CFI_ENDPROC
-diff -urNp linux-3.1.3/arch/x86/lib/copy_page_64.S linux-3.1.3/arch/x86/lib/copy_page_64.S
---- linux-3.1.3/arch/x86/lib/copy_page_64.S    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/lib/copy_page_64.S    2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/lib/copy_page_64.S b/arch/x86/lib/copy_page_64.S
+index 01c805b..dccb07f 100644
+--- a/arch/x86/lib/copy_page_64.S
++++ b/arch/x86/lib/copy_page_64.S
 @@ -9,6 +9,7 @@ copy_page_c:
        CFI_STARTPROC
        movl $4096/8,%ecx
@@ -18087,6 +19305,42 @@ diff -urNp linux-3.1.3/arch/x86/lib/copy_page_64.S linux-3.1.3/arch/x86/lib/copy
        ret
        CFI_ENDPROC
  ENDPROC(copy_page_c)
+@@ -39,7 +40,7 @@ ENTRY(copy_page)
+       movq     16 (%rsi), %rdx
+       movq     24 (%rsi), %r8
+       movq     32 (%rsi), %r9
+-      movq     40 (%rsi), %r10
++      movq     40 (%rsi), %r13
+       movq     48 (%rsi), %r11
+       movq     56 (%rsi), %r12
+@@ -50,7 +51,7 @@ ENTRY(copy_page)
+       movq     %rdx, 16 (%rdi)
+       movq     %r8,  24 (%rdi)
+       movq     %r9,  32 (%rdi)
+-      movq     %r10, 40 (%rdi)
++      movq     %r13, 40 (%rdi)
+       movq     %r11, 48 (%rdi)
+       movq     %r12, 56 (%rdi)
+@@ -69,7 +70,7 @@ ENTRY(copy_page)
+       movq     16 (%rsi), %rdx
+       movq     24 (%rsi), %r8
+       movq     32 (%rsi), %r9
+-      movq     40 (%rsi), %r10
++      movq     40 (%rsi), %r13
+       movq     48 (%rsi), %r11
+       movq     56 (%rsi), %r12
+@@ -78,7 +79,7 @@ ENTRY(copy_page)
+       movq     %rdx, 16 (%rdi)
+       movq     %r8,  24 (%rdi)
+       movq     %r9,  32 (%rdi)
+-      movq     %r10, 40 (%rdi)
++      movq     %r13, 40 (%rdi)
+       movq     %r11, 48 (%rdi)
+       movq     %r12, 56 (%rdi)
 @@ -95,6 +96,7 @@ ENTRY(copy_page)
        CFI_RESTORE r13
        addq    $3*8,%rsp
@@ -18104,9 +19358,10 @@ diff -urNp linux-3.1.3/arch/x86/lib/copy_page_64.S linux-3.1.3/arch/x86/lib/copy
  1:    .byte 0xeb                                      /* jmp <disp8> */
        .byte (copy_page_c - copy_page) - (2f - 1b)     /* offset */
  2:
-diff -urNp linux-3.1.3/arch/x86/lib/copy_user_64.S linux-3.1.3/arch/x86/lib/copy_user_64.S
---- linux-3.1.3/arch/x86/lib/copy_user_64.S    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/lib/copy_user_64.S    2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/lib/copy_user_64.S b/arch/x86/lib/copy_user_64.S
+index 0248402..821c786 100644
+--- a/arch/x86/lib/copy_user_64.S
++++ b/arch/x86/lib/copy_user_64.S
 @@ -16,6 +16,7 @@
  #include <asm/thread_info.h>
  #include <asm/cpufeature.h>
@@ -18175,6 +19430,30 @@ diff -urNp linux-3.1.3/arch/x86/lib/copy_user_64.S linux-3.1.3/arch/x86/lib/copy
        ret
        CFI_ENDPROC
  ENDPROC(bad_from_user)
+@@ -141,19 +115,19 @@ ENTRY(copy_user_generic_unrolled)
+       jz 17f
+ 1:    movq (%rsi),%r8
+ 2:    movq 1*8(%rsi),%r9
+-3:    movq 2*8(%rsi),%r10
++3:    movq 2*8(%rsi),%rax
+ 4:    movq 3*8(%rsi),%r11
+ 5:    movq %r8,(%rdi)
+ 6:    movq %r9,1*8(%rdi)
+-7:    movq %r10,2*8(%rdi)
++7:    movq %rax,2*8(%rdi)
+ 8:    movq %r11,3*8(%rdi)
+ 9:    movq 4*8(%rsi),%r8
+ 10:   movq 5*8(%rsi),%r9
+-11:   movq 6*8(%rsi),%r10
++11:   movq 6*8(%rsi),%rax
+ 12:   movq 7*8(%rsi),%r11
+ 13:   movq %r8,4*8(%rdi)
+ 14:   movq %r9,5*8(%rdi)
+-15:   movq %r10,6*8(%rdi)
++15:   movq %rax,6*8(%rdi)
+ 16:   movq %r11,7*8(%rdi)
+       leaq 64(%rsi),%rsi
+       leaq 64(%rdi),%rdi
 @@ -179,6 +153,7 @@ ENTRY(copy_user_generic_unrolled)
        decl %ecx
        jnz 21b
@@ -18199,9 +19478,10 @@ diff -urNp linux-3.1.3/arch/x86/lib/copy_user_64.S linux-3.1.3/arch/x86/lib/copy
        ret
  
        .section .fixup,"ax"
-diff -urNp linux-3.1.3/arch/x86/lib/copy_user_nocache_64.S linux-3.1.3/arch/x86/lib/copy_user_nocache_64.S
---- linux-3.1.3/arch/x86/lib/copy_user_nocache_64.S    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/lib/copy_user_nocache_64.S    2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/lib/copy_user_nocache_64.S b/arch/x86/lib/copy_user_nocache_64.S
+index cb0c112..e3a6895 100644
+--- a/arch/x86/lib/copy_user_nocache_64.S
++++ b/arch/x86/lib/copy_user_nocache_64.S
 @@ -8,12 +8,14 @@
  
  #include <linux/linkage.h>
@@ -18233,6 +19513,30 @@ diff -urNp linux-3.1.3/arch/x86/lib/copy_user_nocache_64.S linux-3.1.3/arch/x86/
        cmpl $8,%edx
        jb 20f          /* less then 8 bytes, go to byte copy loop */
        ALIGN_DESTINATION
+@@ -59,19 +70,19 @@ ENTRY(__copy_user_nocache)
+       jz 17f
+ 1:    movq (%rsi),%r8
+ 2:    movq 1*8(%rsi),%r9
+-3:    movq 2*8(%rsi),%r10
++3:    movq 2*8(%rsi),%rax
+ 4:    movq 3*8(%rsi),%r11
+ 5:    movnti %r8,(%rdi)
+ 6:    movnti %r9,1*8(%rdi)
+-7:    movnti %r10,2*8(%rdi)
++7:    movnti %rax,2*8(%rdi)
+ 8:    movnti %r11,3*8(%rdi)
+ 9:    movq 4*8(%rsi),%r8
+ 10:   movq 5*8(%rsi),%r9
+-11:   movq 6*8(%rsi),%r10
++11:   movq 6*8(%rsi),%rax
+ 12:   movq 7*8(%rsi),%r11
+ 13:   movnti %r8,4*8(%rdi)
+ 14:   movnti %r9,5*8(%rdi)
+-15:   movnti %r10,6*8(%rdi)
++15:   movnti %rax,6*8(%rdi)
+ 16:   movnti %r11,7*8(%rdi)
+       leaq 64(%rsi),%rsi
+       leaq 64(%rdi),%rdi
 @@ -98,6 +109,7 @@ ENTRY(__copy_user_nocache)
        jnz 21b
  23:   xorl %eax,%eax
@@ -18241,9 +19545,10 @@ diff -urNp linux-3.1.3/arch/x86/lib/copy_user_nocache_64.S linux-3.1.3/arch/x86/
        ret
  
        .section .fixup,"ax"
-diff -urNp linux-3.1.3/arch/x86/lib/csum-copy_64.S linux-3.1.3/arch/x86/lib/csum-copy_64.S
---- linux-3.1.3/arch/x86/lib/csum-copy_64.S    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/lib/csum-copy_64.S    2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/lib/csum-copy_64.S b/arch/x86/lib/csum-copy_64.S
+index fb903b7..c92b7f7 100644
+--- a/arch/x86/lib/csum-copy_64.S
++++ b/arch/x86/lib/csum-copy_64.S
 @@ -8,6 +8,7 @@
  #include <linux/linkage.h>
  #include <asm/dwarf2.h>
@@ -18256,14 +19561,15 @@ diff -urNp linux-3.1.3/arch/x86/lib/csum-copy_64.S linux-3.1.3/arch/x86/lib/csum
        CFI_RESTORE rbp
        addq $7*8, %rsp
        CFI_ADJUST_CFA_OFFSET -7*8
-+      pax_force_retaddr
++      pax_force_retaddr 0, 1
        ret
        CFI_RESTORE_STATE
  
-diff -urNp linux-3.1.3/arch/x86/lib/csum-wrappers_64.c linux-3.1.3/arch/x86/lib/csum-wrappers_64.c
---- linux-3.1.3/arch/x86/lib/csum-wrappers_64.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/lib/csum-wrappers_64.c        2011-11-16 18:39:07.000000000 -0500
-@@ -52,7 +52,13 @@ csum_partial_copy_from_user(const void _
+diff --git a/arch/x86/lib/csum-wrappers_64.c b/arch/x86/lib/csum-wrappers_64.c
+index 459b58a..9570bc7 100644
+--- a/arch/x86/lib/csum-wrappers_64.c
++++ b/arch/x86/lib/csum-wrappers_64.c
+@@ -52,7 +52,13 @@ csum_partial_copy_from_user(const void __user *src, void *dst,
                        len -= 2;
                }
        }
@@ -18278,7 +19584,7 @@ diff -urNp linux-3.1.3/arch/x86/lib/csum-wrappers_64.c linux-3.1.3/arch/x86/lib/
                                dst, len, isum, errp, NULL);
        if (unlikely(*errp))
                goto out_err;
-@@ -105,7 +111,13 @@ csum_partial_copy_to_user(const void *sr
+@@ -105,7 +111,13 @@ csum_partial_copy_to_user(const void *src, void __user *dst,
        }
  
        *errp = 0;
@@ -18293,9 +19599,10 @@ diff -urNp linux-3.1.3/arch/x86/lib/csum-wrappers_64.c linux-3.1.3/arch/x86/lib/
                                         len, isum, NULL, errp);
  }
  EXPORT_SYMBOL(csum_partial_copy_to_user);
-diff -urNp linux-3.1.3/arch/x86/lib/getuser.S linux-3.1.3/arch/x86/lib/getuser.S
---- linux-3.1.3/arch/x86/lib/getuser.S 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/lib/getuser.S 2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/lib/getuser.S b/arch/x86/lib/getuser.S
+index 51f1504..ddac4c1 100644
+--- a/arch/x86/lib/getuser.S
++++ b/arch/x86/lib/getuser.S
 @@ -33,15 +33,38 @@
  #include <asm/asm-offsets.h>
  #include <asm/thread_info.h>
@@ -18419,9 +19726,10 @@ diff -urNp linux-3.1.3/arch/x86/lib/getuser.S linux-3.1.3/arch/x86/lib/getuser.S
        ret
        CFI_ENDPROC
  END(bad_get_user)
-diff -urNp linux-3.1.3/arch/x86/lib/insn.c linux-3.1.3/arch/x86/lib/insn.c
---- linux-3.1.3/arch/x86/lib/insn.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/lib/insn.c    2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/lib/insn.c b/arch/x86/lib/insn.c
+index 9f33b98..dfc7678 100644
+--- a/arch/x86/lib/insn.c
++++ b/arch/x86/lib/insn.c
 @@ -21,6 +21,11 @@
  #include <linux/string.h>
  #include <asm/inat.h>
@@ -18445,9 +19753,10 @@ diff -urNp linux-3.1.3/arch/x86/lib/insn.c linux-3.1.3/arch/x86/lib/insn.c
        insn->x86_64 = x86_64 ? 1 : 0;
        insn->opnd_bytes = 4;
        if (x86_64)
-diff -urNp linux-3.1.3/arch/x86/lib/iomap_copy_64.S linux-3.1.3/arch/x86/lib/iomap_copy_64.S
---- linux-3.1.3/arch/x86/lib/iomap_copy_64.S   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/lib/iomap_copy_64.S   2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/lib/iomap_copy_64.S b/arch/x86/lib/iomap_copy_64.S
+index 05a95e7..326f2fa 100644
+--- a/arch/x86/lib/iomap_copy_64.S
++++ b/arch/x86/lib/iomap_copy_64.S
 @@ -17,6 +17,7 @@
  
  #include <linux/linkage.h>
@@ -18464,9 +19773,10 @@ diff -urNp linux-3.1.3/arch/x86/lib/iomap_copy_64.S linux-3.1.3/arch/x86/lib/iom
        ret
        CFI_ENDPROC
  ENDPROC(__iowrite32_copy)
-diff -urNp linux-3.1.3/arch/x86/lib/memcpy_64.S linux-3.1.3/arch/x86/lib/memcpy_64.S
---- linux-3.1.3/arch/x86/lib/memcpy_64.S       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/lib/memcpy_64.S       2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/lib/memcpy_64.S b/arch/x86/lib/memcpy_64.S
+index efbf2a0..8893637 100644
+--- a/arch/x86/lib/memcpy_64.S
++++ b/arch/x86/lib/memcpy_64.S
 @@ -34,6 +34,7 @@
        rep movsq
        movl %edx, %ecx
@@ -18483,9 +19793,48 @@ diff -urNp linux-3.1.3/arch/x86/lib/memcpy_64.S linux-3.1.3/arch/x86/lib/memcpy_
        ret
  .Lmemcpy_e_e:
        .previous
-@@ -141,6 +143,7 @@ ENTRY(memcpy)
+@@ -81,13 +83,13 @@ ENTRY(memcpy)
+        */
+       movq 0*8(%rsi), %r8
+       movq 1*8(%rsi), %r9
+-      movq 2*8(%rsi), %r10
++      movq 2*8(%rsi), %rcx
+       movq 3*8(%rsi), %r11
+       leaq 4*8(%rsi), %rsi
+       movq %r8,       0*8(%rdi)
        movq %r9,       1*8(%rdi)
-       movq %r10,      -2*8(%rdi, %rdx)
+-      movq %r10,      2*8(%rdi)
++      movq %rcx,      2*8(%rdi)
+       movq %r11,      3*8(%rdi)
+       leaq 4*8(%rdi), %rdi
+       jae  .Lcopy_forward_loop
+@@ -110,12 +112,12 @@ ENTRY(memcpy)
+       subq $0x20,     %rdx
+       movq -1*8(%rsi),        %r8
+       movq -2*8(%rsi),        %r9
+-      movq -3*8(%rsi),        %r10
++      movq -3*8(%rsi),        %rcx
+       movq -4*8(%rsi),        %r11
+       leaq -4*8(%rsi),        %rsi
+       movq %r8,               -1*8(%rdi)
+       movq %r9,               -2*8(%rdi)
+-      movq %r10,              -3*8(%rdi)
++      movq %rcx,              -3*8(%rdi)
+       movq %r11,              -4*8(%rdi)
+       leaq -4*8(%rdi),        %rdi
+       jae  .Lcopy_backward_loop
+@@ -135,12 +137,13 @@ ENTRY(memcpy)
+        */
+       movq 0*8(%rsi), %r8
+       movq 1*8(%rsi), %r9
+-      movq -2*8(%rsi, %rdx),  %r10
++      movq -2*8(%rsi, %rdx),  %rcx
+       movq -1*8(%rsi, %rdx),  %r11
+       movq %r8,       0*8(%rdi)
+       movq %r9,       1*8(%rdi)
+-      movq %r10,      -2*8(%rdi, %rdx)
++      movq %rcx,      -2*8(%rdi, %rdx)
        movq %r11,      -1*8(%rdi, %rdx)
 +      pax_force_retaddr
        retq
@@ -18515,9 +19864,122 @@ diff -urNp linux-3.1.3/arch/x86/lib/memcpy_64.S linux-3.1.3/arch/x86/lib/memcpy_
        retq
        CFI_ENDPROC
  ENDPROC(memcpy)
-diff -urNp linux-3.1.3/arch/x86/lib/memmove_64.S linux-3.1.3/arch/x86/lib/memmove_64.S
---- linux-3.1.3/arch/x86/lib/memmove_64.S      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/lib/memmove_64.S      2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/lib/memmove_64.S b/arch/x86/lib/memmove_64.S
+index ee16461..c39c199 100644
+--- a/arch/x86/lib/memmove_64.S
++++ b/arch/x86/lib/memmove_64.S
+@@ -61,13 +61,13 @@ ENTRY(memmove)
+ 5:
+       sub $0x20, %rdx
+       movq 0*8(%rsi), %r11
+-      movq 1*8(%rsi), %r10
++      movq 1*8(%rsi), %rcx
+       movq 2*8(%rsi), %r9
+       movq 3*8(%rsi), %r8
+       leaq 4*8(%rsi), %rsi
+       movq %r11, 0*8(%rdi)
+-      movq %r10, 1*8(%rdi)
++      movq %rcx, 1*8(%rdi)
+       movq %r9, 2*8(%rdi)
+       movq %r8, 3*8(%rdi)
+       leaq 4*8(%rdi), %rdi
+@@ -81,10 +81,10 @@ ENTRY(memmove)
+ 4:
+       movq %rdx, %rcx
+       movq -8(%rsi, %rdx), %r11
+-      lea -8(%rdi, %rdx), %r10
++      lea -8(%rdi, %rdx), %r9
+       shrq $3, %rcx
+       rep movsq
+-      movq %r11, (%r10)
++      movq %r11, (%r9)
+       jmp 13f
+ .Lmemmove_end_forward:
+@@ -95,14 +95,14 @@ ENTRY(memmove)
+ 7:
+       movq %rdx, %rcx
+       movq (%rsi), %r11
+-      movq %rdi, %r10
++      movq %rdi, %r9
+       leaq -8(%rsi, %rdx), %rsi
+       leaq -8(%rdi, %rdx), %rdi
+       shrq $3, %rcx
+       std
+       rep movsq
+       cld
+-      movq %r11, (%r10)
++      movq %r11, (%r9)
+       jmp 13f
+       /*
+@@ -127,13 +127,13 @@ ENTRY(memmove)
+ 8:
+       subq $0x20, %rdx
+       movq -1*8(%rsi), %r11
+-      movq -2*8(%rsi), %r10
++      movq -2*8(%rsi), %rcx
+       movq -3*8(%rsi), %r9
+       movq -4*8(%rsi), %r8
+       leaq -4*8(%rsi), %rsi
+       movq %r11, -1*8(%rdi)
+-      movq %r10, -2*8(%rdi)
++      movq %rcx, -2*8(%rdi)
+       movq %r9, -3*8(%rdi)
+       movq %r8, -4*8(%rdi)
+       leaq -4*8(%rdi), %rdi
+@@ -151,11 +151,11 @@ ENTRY(memmove)
+        * Move data from 16 bytes to 31 bytes.
+        */
+       movq 0*8(%rsi), %r11
+-      movq 1*8(%rsi), %r10
++      movq 1*8(%rsi), %rcx
+       movq -2*8(%rsi, %rdx), %r9
+       movq -1*8(%rsi, %rdx), %r8
+       movq %r11, 0*8(%rdi)
+-      movq %r10, 1*8(%rdi)
++      movq %rcx, 1*8(%rdi)
+       movq %r9, -2*8(%rdi, %rdx)
+       movq %r8, -1*8(%rdi, %rdx)
+       jmp 13f
+@@ -167,9 +167,9 @@ ENTRY(memmove)
+        * Move data from 8 bytes to 15 bytes.
+        */
+       movq 0*8(%rsi), %r11
+-      movq -1*8(%rsi, %rdx), %r10
++      movq -1*8(%rsi, %rdx), %r9
+       movq %r11, 0*8(%rdi)
+-      movq %r10, -1*8(%rdi, %rdx)
++      movq %r9, -1*8(%rdi, %rdx)
+       jmp 13f
+ 10:
+       cmpq $4, %rdx
+@@ -178,9 +178,9 @@ ENTRY(memmove)
+        * Move data from 4 bytes to 7 bytes.
+        */
+       movl (%rsi), %r11d
+-      movl -4(%rsi, %rdx), %r10d
++      movl -4(%rsi, %rdx), %r9d
+       movl %r11d, (%rdi)
+-      movl %r10d, -4(%rdi, %rdx)
++      movl %r9d, -4(%rdi, %rdx)
+       jmp 13f
+ 11:
+       cmp $2, %rdx
+@@ -189,9 +189,9 @@ ENTRY(memmove)
+        * Move data from 2 bytes to 3 bytes.
+        */
+       movw (%rsi), %r11w
+-      movw -2(%rsi, %rdx), %r10w
++      movw -2(%rsi, %rdx), %r9w
+       movw %r11w, (%rdi)
+-      movw %r10w, -2(%rdi, %rdx)
++      movw %r9w, -2(%rdi, %rdx)
+       jmp 13f
+ 12:
+       cmp $1, %rdx
 @@ -202,6 +202,7 @@ ENTRY(memmove)
        movb (%rsi), %r11b
        movb %r11b, (%rdi)
@@ -18534,9 +19996,10 @@ diff -urNp linux-3.1.3/arch/x86/lib/memmove_64.S linux-3.1.3/arch/x86/lib/memmov
        retq
  .Lmemmove_end_forward_efs:
        .previous
-diff -urNp linux-3.1.3/arch/x86/lib/memset_64.S linux-3.1.3/arch/x86/lib/memset_64.S
---- linux-3.1.3/arch/x86/lib/memset_64.S       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/lib/memset_64.S       2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/lib/memset_64.S b/arch/x86/lib/memset_64.S
+index 79bd454..dff325a 100644
+--- a/arch/x86/lib/memset_64.S
++++ b/arch/x86/lib/memset_64.S
 @@ -31,6 +31,7 @@
        movl %r8d,%ecx
        rep stosb
@@ -18553,18 +20016,36 @@ diff -urNp linux-3.1.3/arch/x86/lib/memset_64.S linux-3.1.3/arch/x86/lib/memset_
        ret
  .Lmemset_e_e:
        .previous
-@@ -121,6 +123,7 @@ ENTRY(__memset)
+@@ -60,13 +62,13 @@
+ ENTRY(memset)
+ ENTRY(__memset)
+       CFI_STARTPROC
+-      movq %rdi,%r10
+       movq %rdx,%r11
+       /* expand byte value  */
+       movzbl %sil,%ecx
+       movabs $0x0101010101010101,%rax
+       mul    %rcx             /* with rax, clobbers rdx */
++      movq  %rdi,%rdx
+       /* align dst */
+       movl  %edi,%r9d
+@@ -120,7 +122,8 @@ ENTRY(__memset)
+       jnz     .Lloop_1
  
  .Lende:
-       movq    %r10,%rax
+-      movq    %r10,%rax
++      movq    %rdx,%rax
 +      pax_force_retaddr
        ret
  
        CFI_RESTORE_STATE
-diff -urNp linux-3.1.3/arch/x86/lib/mmx_32.c linux-3.1.3/arch/x86/lib/mmx_32.c
---- linux-3.1.3/arch/x86/lib/mmx_32.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/lib/mmx_32.c  2011-11-16 18:39:07.000000000 -0500
-@@ -29,6 +29,7 @@ void *_mmx_memcpy(void *to, const void *
+diff --git a/arch/x86/lib/mmx_32.c b/arch/x86/lib/mmx_32.c
+index c9f2d9b..e7fd2c0 100644
+--- a/arch/x86/lib/mmx_32.c
++++ b/arch/x86/lib/mmx_32.c
+@@ -29,6 +29,7 @@ void *_mmx_memcpy(void *to, const void *from, size_t len)
  {
        void *p;
        int i;
@@ -18572,7 +20053,7 @@ diff -urNp linux-3.1.3/arch/x86/lib/mmx_32.c linux-3.1.3/arch/x86/lib/mmx_32.c
  
        if (unlikely(in_interrupt()))
                return __memcpy(to, from, len);
-@@ -39,44 +40,72 @@ void *_mmx_memcpy(void *to, const void *
+@@ -39,44 +40,72 @@ void *_mmx_memcpy(void *to, const void *from, size_t len)
        kernel_fpu_begin();
  
        __asm__ __volatile__ (
@@ -18679,7 +20160,7 @@ diff -urNp linux-3.1.3/arch/x86/lib/mmx_32.c linux-3.1.3/arch/x86/lib/mmx_32.c
  
        kernel_fpu_begin();
  
-@@ -166,42 +196,70 @@ static void fast_copy_page(void *to, voi
+@@ -166,42 +196,70 @@ static void fast_copy_page(void *to, void *from)
         * but that is for later. -AV
         */
        __asm__ __volatile__(
@@ -18879,9 +20360,10 @@ diff -urNp linux-3.1.3/arch/x86/lib/mmx_32.c linux-3.1.3/arch/x86/lib/mmx_32.c
  
                from += 64;
                to += 64;
-diff -urNp linux-3.1.3/arch/x86/lib/msr-reg.S linux-3.1.3/arch/x86/lib/msr-reg.S
---- linux-3.1.3/arch/x86/lib/msr-reg.S 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/lib/msr-reg.S 2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/lib/msr-reg.S b/arch/x86/lib/msr-reg.S
+index 69fa106..adda88b 100644
+--- a/arch/x86/lib/msr-reg.S
++++ b/arch/x86/lib/msr-reg.S
 @@ -3,6 +3,7 @@
  #include <asm/dwarf2.h>
  #include <asm/asm.h>
@@ -18890,17 +20372,44 @@ diff -urNp linux-3.1.3/arch/x86/lib/msr-reg.S linux-3.1.3/arch/x86/lib/msr-reg.S
  
  #ifdef CONFIG_X86_64
  /*
-@@ -37,6 +38,7 @@ ENTRY(native_\op\()_safe_regs)
-       movl    %edi, 28(%r10)
+@@ -16,7 +17,7 @@ ENTRY(native_\op\()_safe_regs)
+       CFI_STARTPROC
+       pushq_cfi %rbx
+       pushq_cfi %rbp
+-      movq    %rdi, %r10      /* Save pointer */
++      movq    %rdi, %r9       /* Save pointer */
+       xorl    %r11d, %r11d    /* Return value */
+       movl    (%rdi), %eax
+       movl    4(%rdi), %ecx
+@@ -27,16 +28,17 @@ ENTRY(native_\op\()_safe_regs)
+       movl    28(%rdi), %edi
+       CFI_REMEMBER_STATE
+ 1:    \op
+-2:    movl    %eax, (%r10)
++2:    movl    %eax, (%r9)
+       movl    %r11d, %eax     /* Return value */
+-      movl    %ecx, 4(%r10)
+-      movl    %edx, 8(%r10)
+-      movl    %ebx, 12(%r10)
+-      movl    %ebp, 20(%r10)
+-      movl    %esi, 24(%r10)
+-      movl    %edi, 28(%r10)
++      movl    %ecx, 4(%r9)
++      movl    %edx, 8(%r9)
++      movl    %ebx, 12(%r9)
++      movl    %ebp, 20(%r9)
++      movl    %esi, 24(%r9)
++      movl    %edi, 28(%r9)
        popq_cfi %rbp
        popq_cfi %rbx
 +      pax_force_retaddr
        ret
  3:
        CFI_RESTORE_STATE
-diff -urNp linux-3.1.3/arch/x86/lib/putuser.S linux-3.1.3/arch/x86/lib/putuser.S
---- linux-3.1.3/arch/x86/lib/putuser.S 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/lib/putuser.S 2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/lib/putuser.S b/arch/x86/lib/putuser.S
+index 36b0d15..d381858 100644
+--- a/arch/x86/lib/putuser.S
++++ b/arch/x86/lib/putuser.S
 @@ -15,7 +15,9 @@
  #include <asm/thread_info.h>
  #include <asm/errno.h>
@@ -19040,28 +20549,84 @@ diff -urNp linux-3.1.3/arch/x86/lib/putuser.S linux-3.1.3/arch/x86/lib/putuser.S
  #endif
        xor %eax,%eax
        EXIT
-diff -urNp linux-3.1.3/arch/x86/lib/rwlock.S linux-3.1.3/arch/x86/lib/rwlock.S
---- linux-3.1.3/arch/x86/lib/rwlock.S  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/lib/rwlock.S  2011-11-16 18:39:07.000000000 -0500
-@@ -23,6 +23,7 @@ ENTRY(__write_lock_failed)
+diff --git a/arch/x86/lib/rwlock.S b/arch/x86/lib/rwlock.S
+index 1cad221..de671ee 100644
+--- a/arch/x86/lib/rwlock.S
++++ b/arch/x86/lib/rwlock.S
+@@ -16,13 +16,34 @@ ENTRY(__write_lock_failed)
+       FRAME
+ 0:    LOCK_PREFIX
+       WRITE_LOCK_ADD($RW_LOCK_BIAS) (%__lock_ptr)
++
++#ifdef CONFIG_PAX_REFCOUNT
++      jno 1234f
++      LOCK_PREFIX
++      WRITE_LOCK_SUB($RW_LOCK_BIAS) (%__lock_ptr)
++      int $4
++1234:
++      _ASM_EXTABLE(1234b, 1234b)
++#endif
++
+ 1:    rep; nop
+       cmpl    $WRITE_LOCK_CMP, (%__lock_ptr)
+       jne     1b
+       LOCK_PREFIX
        WRITE_LOCK_SUB($RW_LOCK_BIAS) (%__lock_ptr)
++
++#ifdef CONFIG_PAX_REFCOUNT
++      jno 1234f
++      LOCK_PREFIX
++      WRITE_LOCK_ADD($RW_LOCK_BIAS) (%__lock_ptr)
++      int $4
++1234:
++      _ASM_EXTABLE(1234b, 1234b)
++#endif
++
        jnz     0b
        ENDFRAME
 +      pax_force_retaddr
        ret
        CFI_ENDPROC
  END(__write_lock_failed)
-@@ -39,6 +40,7 @@ ENTRY(__read_lock_failed)
+@@ -32,13 +53,34 @@ ENTRY(__read_lock_failed)
+       FRAME
+ 0:    LOCK_PREFIX
+       READ_LOCK_SIZE(inc) (%__lock_ptr)
++
++#ifdef CONFIG_PAX_REFCOUNT
++      jno 1234f
++      LOCK_PREFIX
++      READ_LOCK_SIZE(dec) (%__lock_ptr)
++      int $4
++1234:
++      _ASM_EXTABLE(1234b, 1234b)
++#endif
++
+ 1:    rep; nop
+       READ_LOCK_SIZE(cmp) $1, (%__lock_ptr)
+       js      1b
+       LOCK_PREFIX
        READ_LOCK_SIZE(dec) (%__lock_ptr)
++
++#ifdef CONFIG_PAX_REFCOUNT
++      jno 1234f
++      LOCK_PREFIX
++      READ_LOCK_SIZE(inc) (%__lock_ptr)
++      int $4
++1234:
++      _ASM_EXTABLE(1234b, 1234b)
++#endif
++
        js      0b
        ENDFRAME
 +      pax_force_retaddr
        ret
        CFI_ENDPROC
  END(__read_lock_failed)
-diff -urNp linux-3.1.3/arch/x86/lib/rwsem.S linux-3.1.3/arch/x86/lib/rwsem.S
---- linux-3.1.3/arch/x86/lib/rwsem.S   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/lib/rwsem.S   2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/lib/rwsem.S b/arch/x86/lib/rwsem.S
+index 5dff5f0..cadebf4 100644
+--- a/arch/x86/lib/rwsem.S
++++ b/arch/x86/lib/rwsem.S
 @@ -94,6 +94,7 @@ ENTRY(call_rwsem_down_read_failed)
        __ASM_SIZE(pop,_cfi) %__ASM_REG(dx)
        CFI_RESTORE __ASM_REG(dx)
@@ -19096,9 +20661,10 @@ diff -urNp linux-3.1.3/arch/x86/lib/rwsem.S linux-3.1.3/arch/x86/lib/rwsem.S
        ret
        CFI_ENDPROC
  ENDPROC(call_rwsem_downgrade_wake)
-diff -urNp linux-3.1.3/arch/x86/lib/thunk_64.S linux-3.1.3/arch/x86/lib/thunk_64.S
---- linux-3.1.3/arch/x86/lib/thunk_64.S        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/lib/thunk_64.S        2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/lib/thunk_64.S b/arch/x86/lib/thunk_64.S
+index a63efd6..ccecad8 100644
+--- a/arch/x86/lib/thunk_64.S
++++ b/arch/x86/lib/thunk_64.S
 @@ -8,6 +8,7 @@
  #include <linux/linkage.h>
  #include <asm/dwarf2.h>
@@ -19114,9 +20680,10 @@ diff -urNp linux-3.1.3/arch/x86/lib/thunk_64.S linux-3.1.3/arch/x86/lib/thunk_64
 +      pax_force_retaddr
        ret
        CFI_ENDPROC
-diff -urNp linux-3.1.3/arch/x86/lib/usercopy_32.c linux-3.1.3/arch/x86/lib/usercopy_32.c
---- linux-3.1.3/arch/x86/lib/usercopy_32.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/lib/usercopy_32.c     2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/lib/usercopy_32.c b/arch/x86/lib/usercopy_32.c
+index e218d5d..35679b4 100644
+--- a/arch/x86/lib/usercopy_32.c
++++ b/arch/x86/lib/usercopy_32.c
 @@ -43,7 +43,7 @@ do {                                                                    \
        __asm__ __volatile__(                                              \
                "       testl %1,%1\n"                                     \
@@ -19139,7 +20706,7 @@ diff -urNp linux-3.1.3/arch/x86/lib/usercopy_32.c linux-3.1.3/arch/x86/lib/userc
                ".section .fixup,\"ax\"\n"                              \
                "3:     lea 0(%2,%0,4),%0\n"                            \
                "       jmp 2b\n"                                       \
-@@ -200,6 +202,7 @@ long strnlen_user(const char __user *s, 
+@@ -200,6 +202,7 @@ long strnlen_user(const char __user *s, long n)
        might_fault();
  
        __asm__ __volatile__(
@@ -19147,7 +20714,7 @@ diff -urNp linux-3.1.3/arch/x86/lib/usercopy_32.c linux-3.1.3/arch/x86/lib/userc
                "       testl %0, %0\n"
                "       jz 3f\n"
                "       andl %0,%%ecx\n"
-@@ -208,6 +211,7 @@ long strnlen_user(const char __user *s, 
+@@ -208,6 +211,7 @@ long strnlen_user(const char __user *s, long n)
                "       subl %%ecx,%0\n"
                "       addl %0,%%eax\n"
                "1:\n"
@@ -19164,7 +20731,7 @@ diff -urNp linux-3.1.3/arch/x86/lib/usercopy_32.c linux-3.1.3/arch/x86/lib/userc
  {
        int d0, d1;
        __asm__ __volatile__(
-@@ -239,36 +243,36 @@ __copy_user_intel(void __user *to, const
+@@ -239,36 +243,36 @@ __copy_user_intel(void __user *to, const void *from, unsigned long size)
                       "       .align 2,0x90\n"
                       "3:     movl 0(%4), %%eax\n"
                       "4:     movl 4(%4), %%edx\n"
@@ -19217,7 +20784,7 @@ diff -urNp linux-3.1.3/arch/x86/lib/usercopy_32.c linux-3.1.3/arch/x86/lib/userc
                       "       addl $-64, %0\n"
                       "       addl $64, %4\n"
                       "       addl $64, %3\n"
-@@ -278,10 +282,119 @@ __copy_user_intel(void __user *to, const
+@@ -278,10 +282,119 @@ __copy_user_intel(void __user *to, const void *from, unsigned long size)
                       "       shrl  $2, %0\n"
                       "       andl  $3, %%eax\n"
                       "       cld\n"
@@ -19337,7 +20904,7 @@ diff -urNp linux-3.1.3/arch/x86/lib/usercopy_32.c linux-3.1.3/arch/x86/lib/userc
                       ".section .fixup,\"ax\"\n"
                       "101:   lea 0(%%eax,%0,4),%0\n"
                       "       jmp 100b\n"
-@@ -339,41 +452,41 @@ __copy_user_zeroing_intel(void *to, cons
+@@ -339,41 +452,41 @@ __copy_user_zeroing_intel(void *to, const void __user *from, unsigned long size)
        int d0, d1;
        __asm__ __volatile__(
                       "        .align 2,0x90\n"
@@ -19397,7 +20964,7 @@ diff -urNp linux-3.1.3/arch/x86/lib/usercopy_32.c linux-3.1.3/arch/x86/lib/userc
                       "        movl %%eax, 56(%3)\n"
                       "        movl %%edx, 60(%3)\n"
                       "        addl $-64, %0\n"
-@@ -385,9 +498,9 @@ __copy_user_zeroing_intel(void *to, cons
+@@ -385,9 +498,9 @@ __copy_user_zeroing_intel(void *to, const void __user *from, unsigned long size)
                       "        shrl  $2, %0\n"
                       "        andl $3, %%eax\n"
                       "        cld\n"
@@ -19409,7 +20976,7 @@ diff -urNp linux-3.1.3/arch/x86/lib/usercopy_32.c linux-3.1.3/arch/x86/lib/userc
                       "8:\n"
                       ".section .fixup,\"ax\"\n"
                       "9:      lea 0(%%eax,%0,4),%0\n"
-@@ -440,41 +553,41 @@ static unsigned long __copy_user_zeroing
+@@ -440,41 +553,41 @@ static unsigned long __copy_user_zeroing_intel_nocache(void *to,
  
        __asm__ __volatile__(
               "        .align 2,0x90\n"
@@ -19469,7 +21036,7 @@ diff -urNp linux-3.1.3/arch/x86/lib/usercopy_32.c linux-3.1.3/arch/x86/lib/userc
               "        movnti %%eax, 56(%3)\n"
               "        movnti %%edx, 60(%3)\n"
               "        addl $-64, %0\n"
-@@ -487,9 +600,9 @@ static unsigned long __copy_user_zeroing
+@@ -487,9 +600,9 @@ static unsigned long __copy_user_zeroing_intel_nocache(void *to,
               "        shrl  $2, %0\n"
               "        andl $3, %%eax\n"
               "        cld\n"
@@ -19481,7 +21048,7 @@ diff -urNp linux-3.1.3/arch/x86/lib/usercopy_32.c linux-3.1.3/arch/x86/lib/userc
               "8:\n"
               ".section .fixup,\"ax\"\n"
               "9:      lea 0(%%eax,%0,4),%0\n"
-@@ -537,41 +650,41 @@ static unsigned long __copy_user_intel_n
+@@ -537,41 +650,41 @@ static unsigned long __copy_user_intel_nocache(void *to,
  
        __asm__ __volatile__(
               "        .align 2,0x90\n"
@@ -19541,7 +21108,7 @@ diff -urNp linux-3.1.3/arch/x86/lib/usercopy_32.c linux-3.1.3/arch/x86/lib/userc
               "        movnti %%eax, 56(%3)\n"
               "        movnti %%edx, 60(%3)\n"
               "        addl $-64, %0\n"
-@@ -584,9 +697,9 @@ static unsigned long __copy_user_intel_n
+@@ -584,9 +697,9 @@ static unsigned long __copy_user_intel_nocache(void *to,
               "        shrl  $2, %0\n"
               "        andl $3, %%eax\n"
               "        cld\n"
@@ -19553,7 +21120,7 @@ diff -urNp linux-3.1.3/arch/x86/lib/usercopy_32.c linux-3.1.3/arch/x86/lib/userc
               "8:\n"
               ".section .fixup,\"ax\"\n"
               "9:      lea 0(%%eax,%0,4),%0\n"
-@@ -629,32 +742,36 @@ static unsigned long __copy_user_intel_n
+@@ -629,32 +742,36 @@ static unsigned long __copy_user_intel_nocache(void *to,
   */
  unsigned long __copy_user_zeroing_intel(void *to, const void __user *from,
                                        unsigned long size);
@@ -19625,7 +21192,7 @@ diff -urNp linux-3.1.3/arch/x86/lib/usercopy_32.c linux-3.1.3/arch/x86/lib/userc
        return n;
  }
  EXPORT_SYMBOL(__copy_to_user_ll);
-@@ -797,10 +914,9 @@ unsigned long __copy_from_user_ll_nozero
+@@ -797,10 +914,9 @@ unsigned long __copy_from_user_ll_nozero(void *to, const void __user *from,
                                         unsigned long n)
  {
        if (movsl_is_ok(to, from, n))
@@ -19638,7 +21205,7 @@ diff -urNp linux-3.1.3/arch/x86/lib/usercopy_32.c linux-3.1.3/arch/x86/lib/userc
        return n;
  }
  EXPORT_SYMBOL(__copy_from_user_ll_nozero);
-@@ -827,65 +943,50 @@ unsigned long __copy_from_user_ll_nocach
+@@ -827,65 +943,50 @@ unsigned long __copy_from_user_ll_nocache_nozero(void *to, const void __user *fr
        if (n > 64 && cpu_has_xmm2)
                n = __copy_user_intel_nocache(to, from, n);
        else
@@ -19667,16 +21234,13 @@ diff -urNp linux-3.1.3/arch/x86/lib/usercopy_32.c linux-3.1.3/arch/x86/lib/userc
 - */
 -unsigned long
 -copy_to_user(void __user *to, const void *from, unsigned long n)
-+void copy_from_user_overflow(void)
- {
+-{
 -      if (access_ok(VERIFY_WRITE, to, n))
 -              n = __copy_to_user(to, from, n);
 -      return n;
-+      WARN(1, "Buffer overflow detected!\n");
- }
+-}
 -EXPORT_SYMBOL(copy_to_user);
-+EXPORT_SYMBOL(copy_from_user_overflow);
+-
 -/**
 - * copy_from_user: - Copy a block of data from user space.
 - * @to:   Destination address, in kernel space.
@@ -19695,23 +21259,30 @@ diff -urNp linux-3.1.3/arch/x86/lib/usercopy_32.c linux-3.1.3/arch/x86/lib/userc
 - */
 -unsigned long
 -_copy_from_user(void *to, const void __user *from, unsigned long n)
-+void copy_to_user_overflow(void)
- {
+-{
 -      if (access_ok(VERIFY_READ, from, n))
 -              n = __copy_from_user(to, from, n);
 -      else
 -              memset(to, 0, n);
 -      return n;
-+      WARN(1, "Buffer overflow detected!\n");
- }
+-}
 -EXPORT_SYMBOL(_copy_from_user);
+-
+ void copy_from_user_overflow(void)
+ {
+       WARN(1, "Buffer overflow detected!\n");
+ }
+ EXPORT_SYMBOL(copy_from_user_overflow);
++
++void copy_to_user_overflow(void)
++{
++      WARN(1, "Buffer overflow detected!\n");
++}
 +EXPORT_SYMBOL(copy_to_user_overflow);
--void copy_from_user_overflow(void)
++
 +#ifdef CONFIG_PAX_MEMORY_UDEREF
 +void __set_fs(mm_segment_t x)
- {
--      WARN(1, "Buffer overflow detected!\n");
++{
 +      switch (x.seg) {
 +      case 0:
 +              loadsegment(gs, 0);
@@ -19726,8 +21297,7 @@ diff -urNp linux-3.1.3/arch/x86/lib/usercopy_32.c linux-3.1.3/arch/x86/lib/userc
 +              BUG();
 +      }
 +      return;
- }
--EXPORT_SYMBOL(copy_from_user_overflow);
++}
 +EXPORT_SYMBOL(__set_fs);
 +
 +void set_fs(mm_segment_t x)
@@ -19737,9 +21307,10 @@ diff -urNp linux-3.1.3/arch/x86/lib/usercopy_32.c linux-3.1.3/arch/x86/lib/userc
 +}
 +EXPORT_SYMBOL(set_fs);
 +#endif
-diff -urNp linux-3.1.3/arch/x86/lib/usercopy_64.c linux-3.1.3/arch/x86/lib/usercopy_64.c
---- linux-3.1.3/arch/x86/lib/usercopy_64.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/lib/usercopy_64.c     2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/lib/usercopy_64.c b/arch/x86/lib/usercopy_64.c
+index b7c2849..8633ad8 100644
+--- a/arch/x86/lib/usercopy_64.c
++++ b/arch/x86/lib/usercopy_64.c
 @@ -42,6 +42,12 @@ long
  __strncpy_from_user(char *dst, const char __user *src, long count)
  {
@@ -19753,7 +21324,7 @@ diff -urNp linux-3.1.3/arch/x86/lib/usercopy_64.c linux-3.1.3/arch/x86/lib/userc
        __do_strncpy_from_user(dst, src, count, res);
        return res;
  }
-@@ -65,6 +71,12 @@ unsigned long __clear_user(void __user *
+@@ -65,6 +71,12 @@ unsigned long __clear_user(void __user *addr, unsigned long size)
  {
        long __d0;
        might_fault();
@@ -19766,9 +21337,12 @@ diff -urNp linux-3.1.3/arch/x86/lib/usercopy_64.c linux-3.1.3/arch/x86/lib/userc
        /* no memory constraint because it doesn't change any memory gcc knows
           about */
        asm volatile(
-@@ -151,10 +163,18 @@ EXPORT_SYMBOL(strlen_user);
+@@ -149,12 +161,20 @@ long strlen_user(const char __user *s)
+ }
+ EXPORT_SYMBOL(strlen_user);
  
- unsigned long copy_in_user(void __user *to, const void __user *from, unsigned len)
+-unsigned long copy_in_user(void __user *to, const void __user *from, unsigned len)
++unsigned long copy_in_user(void __user *to, const void __user *from, unsigned long len)
  {
 -      if (access_ok(VERIFY_WRITE, to, len) && access_ok(VERIFY_READ, from, len)) { 
 -              return copy_user_generic((__force void *)to, (__force void *)from, len);
@@ -19794,38 +21368,15 @@ diff -urNp linux-3.1.3/arch/x86/lib/usercopy_64.c linux-3.1.3/arch/x86/lib/userc
   */
  unsigned long
 -copy_user_handle_tail(char *to, char *from, unsigned len, unsigned zerorest)
-+copy_user_handle_tail(char __user *to, char __user *from, unsigned len, unsigned zerorest)
++copy_user_handle_tail(char __user *to, char __user *from, unsigned long len, unsigned zerorest)
  {
        char c;
        unsigned zero_len;
-diff -urNp linux-3.1.3/arch/x86/Makefile linux-3.1.3/arch/x86/Makefile
---- linux-3.1.3/arch/x86/Makefile      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/Makefile      2011-11-17 18:30:30.000000000 -0500
-@@ -46,6 +46,7 @@ else
-         UTS_MACHINE := x86_64
-         CHECKFLAGS += -D__x86_64__ -m64
-+        biarch := $(call cc-option,-m64)
-         KBUILD_AFLAGS += -m64
-         KBUILD_CFLAGS += -m64
-@@ -195,3 +196,12 @@ define archhelp
-   echo  '                  FDARGS="..."  arguments for the booted kernel'
-   echo  '                  FDINITRD=file initrd for the booted kernel'
- endef
-+
-+define OLD_LD
-+
-+*** ${VERSION}.${PATCHLEVEL} PaX kernels no longer build correctly with old versions of binutils.
-+*** Please upgrade your binutils to 2.18 or newer
-+endef
-+
-+archprepare:
-+      $(if $(LDFLAGS_BUILD_ID),,$(error $(OLD_LD)))
-diff -urNp linux-3.1.3/arch/x86/mm/extable.c linux-3.1.3/arch/x86/mm/extable.c
---- linux-3.1.3/arch/x86/mm/extable.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/mm/extable.c  2011-11-16 18:39:07.000000000 -0500
-@@ -8,7 +8,7 @@ int fixup_exception(struct pt_regs *regs
+diff --git a/arch/x86/mm/extable.c b/arch/x86/mm/extable.c
+index d0474ad..36e9257 100644
+--- a/arch/x86/mm/extable.c
++++ b/arch/x86/mm/extable.c
+@@ -8,7 +8,7 @@ int fixup_exception(struct pt_regs *regs)
        const struct exception_table_entry *fixup;
  
  #ifdef CONFIG_PNPBIOS
@@ -19834,9 +21385,10 @@ diff -urNp linux-3.1.3/arch/x86/mm/extable.c linux-3.1.3/arch/x86/mm/extable.c
                extern u32 pnp_bios_fault_eip, pnp_bios_fault_esp;
                extern u32 pnp_bios_is_utter_crap;
                pnp_bios_is_utter_crap = 1;
-diff -urNp linux-3.1.3/arch/x86/mm/fault.c linux-3.1.3/arch/x86/mm/fault.c
---- linux-3.1.3/arch/x86/mm/fault.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/mm/fault.c    2011-11-16 20:43:50.000000000 -0500
+diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
+index 0d17c8c..4f4764f 100644
+--- a/arch/x86/mm/fault.c
++++ b/arch/x86/mm/fault.c
 @@ -13,11 +13,18 @@
  #include <linux/perf_event.h>         /* perf_sw_event                */
  #include <linux/hugetlb.h>            /* hstate_index_to_shift        */
@@ -19856,7 +21408,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/fault.c linux-3.1.3/arch/x86/mm/fault.c
  
  /*
   * Page fault error code bits:
-@@ -55,7 +62,7 @@ static inline int __kprobes notify_page_
+@@ -55,7 +62,7 @@ static inline int __kprobes notify_page_fault(struct pt_regs *regs)
        int ret = 0;
  
        /* kprobe_running() needs smp_processor_id() */
@@ -19865,7 +21417,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/fault.c linux-3.1.3/arch/x86/mm/fault.c
                preempt_disable();
                if (kprobe_running() && kprobe_fault_handler(regs, 14))
                        ret = 1;
-@@ -116,7 +123,10 @@ check_prefetch_opcode(struct pt_regs *re
+@@ -116,7 +123,10 @@ check_prefetch_opcode(struct pt_regs *regs, unsigned char *instr,
                return !instr_lo || (instr_lo>>1) == 1;
        case 0x00:
                /* Prefetch instruction is 0x0F0D or 0x0F18 */
@@ -19877,7 +21429,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/fault.c linux-3.1.3/arch/x86/mm/fault.c
                        return 0;
  
                *prefetch = (instr_lo == 0xF) &&
-@@ -150,7 +160,10 @@ is_prefetch(struct pt_regs *regs, unsign
+@@ -150,7 +160,10 @@ is_prefetch(struct pt_regs *regs, unsigned long error_code, unsigned long addr)
        while (instr < max_instr) {
                unsigned char opcode;
  
@@ -19889,7 +21441,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/fault.c linux-3.1.3/arch/x86/mm/fault.c
                        break;
  
                instr++;
-@@ -181,6 +194,34 @@ force_sig_info_fault(int si_signo, int s
+@@ -181,6 +194,34 @@ force_sig_info_fault(int si_signo, int si_code, unsigned long address,
        force_sig_info(si_signo, &info, tsk);
  }
  
@@ -19962,7 +21514,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/fault.c linux-3.1.3/arch/x86/mm/fault.c
  
                        if (!ret)
                                break;
-@@ -277,6 +335,11 @@ static noinline __kprobes int vmalloc_fa
+@@ -277,6 +335,11 @@ static noinline __kprobes int vmalloc_fault(unsigned long address)
         * an interrupt in the middle of a task switch..
         */
        pgd_paddr = read_cr3();
@@ -19974,7 +21526,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/fault.c linux-3.1.3/arch/x86/mm/fault.c
        pmd_k = vmalloc_sync_one(__va(pgd_paddr), address);
        if (!pmd_k)
                return -1;
-@@ -372,7 +435,14 @@ static noinline __kprobes int vmalloc_fa
+@@ -372,7 +435,14 @@ static noinline __kprobes int vmalloc_fault(unsigned long address)
         * happen within a race in page table update. In the later
         * case just flush:
         */
@@ -19989,7 +21541,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/fault.c linux-3.1.3/arch/x86/mm/fault.c
        pgd_ref = pgd_offset_k(address);
        if (pgd_none(*pgd_ref))
                return -1;
-@@ -534,7 +604,7 @@ static int is_errata93(struct pt_regs *r
+@@ -534,7 +604,7 @@ static int is_errata93(struct pt_regs *regs, unsigned long address)
  static int is_errata100(struct pt_regs *regs, unsigned long address)
  {
  #ifdef CONFIG_X86_64
@@ -19998,7 +21550,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/fault.c linux-3.1.3/arch/x86/mm/fault.c
                return 1;
  #endif
        return 0;
-@@ -561,7 +631,7 @@ static int is_f00f_bug(struct pt_regs *r
+@@ -561,7 +631,7 @@ static int is_f00f_bug(struct pt_regs *regs, unsigned long address)
  }
  
  static const char nx_warning[] = KERN_CRIT
@@ -20007,7 +21559,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/fault.c linux-3.1.3/arch/x86/mm/fault.c
  
  static void
  show_fault_oops(struct pt_regs *regs, unsigned long error_code,
-@@ -570,14 +640,25 @@ show_fault_oops(struct pt_regs *regs, un
+@@ -570,15 +640,26 @@ show_fault_oops(struct pt_regs *regs, unsigned long error_code,
        if (!oops_may_print())
                return;
  
@@ -20020,8 +21572,8 @@ diff -urNp linux-3.1.3/arch/x86/mm/fault.c linux-3.1.3/arch/x86/mm/fault.c
                if (pte && pte_present(*pte) && !pte_exec(*pte))
 -                      printk(nx_warning, current_uid());
 +                      printk(nx_warning, current_uid(), current->comm, task_pid_nr(current));
-+      }
-+
+       }
 +#ifdef CONFIG_PAX_KERNEXEC
 +      if (init_mm.start_code <= address && address < init_mm.end_code) {
 +              if (current->signal->curr_ip)
@@ -20030,12 +21582,13 @@ diff -urNp linux-3.1.3/arch/x86/mm/fault.c linux-3.1.3/arch/x86/mm/fault.c
 +              else
 +                      printk(KERN_ERR "PAX: %s:%d, uid/euid: %u/%u, attempted to modify kernel code\n",
 +                                       current->comm, task_pid_nr(current), current_uid(), current_euid());
-       }
++      }
 +#endif
++
        printk(KERN_ALERT "BUG: unable to handle kernel ");
        if (address < PAGE_SIZE)
-@@ -733,6 +814,21 @@ __bad_area_nosemaphore(struct pt_regs *r
+               printk(KERN_CONT "NULL pointer dereference");
+@@ -733,6 +814,21 @@ __bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code,
                }
  #endif
  
@@ -20057,7 +21610,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/fault.c linux-3.1.3/arch/x86/mm/fault.c
                if (unlikely(show_unhandled_signals))
                        show_signal_msg(regs, error_code, address, tsk);
  
-@@ -829,7 +925,7 @@ do_sigbus(struct pt_regs *regs, unsigned
+@@ -829,7 +925,7 @@ do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address,
        if (fault & (VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE)) {
                printk(KERN_ERR
        "MCE: Killing %s:%d due to hardware memory corruption fault at %lx\n",
@@ -20066,7 +21619,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/fault.c linux-3.1.3/arch/x86/mm/fault.c
                code = BUS_MCEERR_AR;
        }
  #endif
-@@ -884,6 +980,99 @@ static int spurious_fault_check(unsigned
+@@ -884,6 +980,99 @@ static int spurious_fault_check(unsigned long error_code, pte_t *pte)
        return 1;
  }
  
@@ -20176,7 +21729,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/fault.c linux-3.1.3/arch/x86/mm/fault.c
        if (error_code & PF_WRITE) {
                /* write, present and write, not present: */
                if (unlikely(!(vma->vm_flags & VM_WRITE)))
-@@ -989,19 +1181,33 @@ do_page_fault(struct pt_regs *regs, unsi
+@@ -989,18 +1181,32 @@ do_page_fault(struct pt_regs *regs, unsigned long error_code)
  {
        struct vm_area_struct *vma;
        struct task_struct *tsk;
@@ -20187,7 +21740,11 @@ diff -urNp linux-3.1.3/arch/x86/mm/fault.c linux-3.1.3/arch/x86/mm/fault.c
        unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE |
                                        (write ? FAULT_FLAG_WRITE : 0);
  
-+      /* Get the faulting address: */
+-      tsk = current;
+-      mm = tsk->mm;
+-
+       /* Get the faulting address: */
+-      address = read_cr2();
 +      unsigned long address = read_cr2();
 +
 +#if defined(CONFIG_X86_64) && defined(CONFIG_PAX_MEMORY_UDEREF)
@@ -20205,16 +21762,12 @@ diff -urNp linux-3.1.3/arch/x86/mm/fault.c linux-3.1.3/arch/x86/mm/fault.c
 +      }
 +#endif
 +
-       tsk = current;
-       mm = tsk->mm;
++      tsk = current;
++      mm = tsk->mm;
  
--      /* Get the faulting address: */
--      address = read_cr2();
--
        /*
         * Detect and handle instructions that would cause a page fault for
-        * both a tracked kernel page and a userspace page.
-@@ -1061,7 +1267,7 @@ do_page_fault(struct pt_regs *regs, unsi
+@@ -1061,7 +1267,7 @@ do_page_fault(struct pt_regs *regs, unsigned long error_code)
         * User-mode registers count as a user access even for any
         * potential system fault or CPU buglet:
         */
@@ -20512,10 +22065,20 @@ diff -urNp linux-3.1.3/arch/x86/mm/fault.c linux-3.1.3/arch/x86/mm/fault.c
 +
 +      return ret ? -EFAULT : 0;
 +}
-diff -urNp linux-3.1.3/arch/x86/mm/gup.c linux-3.1.3/arch/x86/mm/gup.c
---- linux-3.1.3/arch/x86/mm/gup.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/mm/gup.c      2011-11-16 18:39:07.000000000 -0500
-@@ -253,7 +253,7 @@ int __get_user_pages_fast(unsigned long 
+diff --git a/arch/x86/mm/gup.c b/arch/x86/mm/gup.c
+index ea30585..7d26398 100644
+--- a/arch/x86/mm/gup.c
++++ b/arch/x86/mm/gup.c
+@@ -201,6 +201,8 @@ static noinline int gup_huge_pud(pud_t pud, unsigned long addr,
+       do {
+               VM_BUG_ON(compound_head(page) != head);
+               pages[*nr] = page;
++              if (PageTail(page))
++                      get_huge_page_tail(page);
+               (*nr)++;
+               page++;
+               refs++;
+@@ -253,7 +255,7 @@ int __get_user_pages_fast(unsigned long start, int nr_pages, int write,
        addr = start;
        len = (unsigned long) nr_pages << PAGE_SHIFT;
        end = start + len;
@@ -20524,10 +22087,11 @@ diff -urNp linux-3.1.3/arch/x86/mm/gup.c linux-3.1.3/arch/x86/mm/gup.c
                                        (void __user *)start, len)))
                return 0;
  
-diff -urNp linux-3.1.3/arch/x86/mm/highmem_32.c linux-3.1.3/arch/x86/mm/highmem_32.c
---- linux-3.1.3/arch/x86/mm/highmem_32.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/mm/highmem_32.c       2011-11-16 18:39:07.000000000 -0500
-@@ -44,7 +44,10 @@ void *kmap_atomic_prot(struct page *page
+diff --git a/arch/x86/mm/highmem_32.c b/arch/x86/mm/highmem_32.c
+index f4f29b1..5cac4fb 100644
+--- a/arch/x86/mm/highmem_32.c
++++ b/arch/x86/mm/highmem_32.c
+@@ -44,7 +44,11 @@ void *kmap_atomic_prot(struct page *page, pgprot_t prot)
        idx = type + KM_TYPE_NR*smp_processor_id();
        vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
        BUG_ON(!pte_none(*(kmap_pte-idx)));
@@ -20535,13 +22099,15 @@ diff -urNp linux-3.1.3/arch/x86/mm/highmem_32.c linux-3.1.3/arch/x86/mm/highmem_
 +      pax_open_kernel();
        set_pte(kmap_pte-idx, mk_pte(page, prot));
 +      pax_close_kernel();
++
+       arch_flush_lazy_mmu_mode();
  
        return (void *)vaddr;
- }
-diff -urNp linux-3.1.3/arch/x86/mm/hugetlbpage.c linux-3.1.3/arch/x86/mm/hugetlbpage.c
---- linux-3.1.3/arch/x86/mm/hugetlbpage.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/mm/hugetlbpage.c      2011-11-16 18:39:07.000000000 -0500
-@@ -266,13 +266,20 @@ static unsigned long hugetlb_get_unmappe
+diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c
+index f581a18..29efd37 100644
+--- a/arch/x86/mm/hugetlbpage.c
++++ b/arch/x86/mm/hugetlbpage.c
+@@ -266,13 +266,20 @@ static unsigned long hugetlb_get_unmapped_area_bottomup(struct file *file,
        struct hstate *h = hstate_file(file);
        struct mm_struct *mm = current->mm;
        struct vm_area_struct *vma;
@@ -20601,7 +22167,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/hugetlbpage.c linux-3.1.3/arch/x86/mm/hugetlb
  }
  
  static unsigned long hugetlb_get_unmapped_area_topdown(struct file *file,
-@@ -308,10 +316,9 @@ static unsigned long hugetlb_get_unmappe
+@@ -308,10 +316,9 @@ static unsigned long hugetlb_get_unmapped_area_topdown(struct file *file,
  {
        struct hstate *h = hstate_file(file);
        struct mm_struct *mm = current->mm;
@@ -20614,7 +22180,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/hugetlbpage.c linux-3.1.3/arch/x86/mm/hugetlb
  
        /* don't allow allocations above current base */
        if (mm->free_area_cache > base)
-@@ -321,64 +328,63 @@ static unsigned long hugetlb_get_unmappe
+@@ -321,64 +328,63 @@ static unsigned long hugetlb_get_unmapped_area_topdown(struct file *file,
                largest_hole = 0;
                mm->free_area_cache  = base;
        }
@@ -20717,7 +22283,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/hugetlbpage.c linux-3.1.3/arch/x86/mm/hugetlb
        mm->free_area_cache = base;
        mm->cached_hole_size = ~0UL;
  
-@@ -399,10 +406,19 @@ hugetlb_get_unmapped_area(struct file *f
+@@ -399,10 +406,19 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
        struct hstate *h = hstate_file(file);
        struct mm_struct *mm = current->mm;
        struct vm_area_struct *vma;
@@ -20738,7 +22304,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/hugetlbpage.c linux-3.1.3/arch/x86/mm/hugetlb
                return -ENOMEM;
  
        if (flags & MAP_FIXED) {
-@@ -414,8 +430,7 @@ hugetlb_get_unmapped_area(struct file *f
+@@ -414,8 +430,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
        if (addr) {
                addr = ALIGN(addr, huge_page_size(h));
                vma = find_vma(mm, addr);
@@ -20748,9 +22314,141 @@ diff -urNp linux-3.1.3/arch/x86/mm/hugetlbpage.c linux-3.1.3/arch/x86/mm/hugetlb
                        return addr;
        }
        if (mm->get_unmapped_area == arch_get_unmapped_area)
-diff -urNp linux-3.1.3/arch/x86/mm/init_32.c linux-3.1.3/arch/x86/mm/init_32.c
---- linux-3.1.3/arch/x86/mm/init_32.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/mm/init_32.c  2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
+index 87488b9..7129f32 100644
+--- a/arch/x86/mm/init.c
++++ b/arch/x86/mm/init.c
+@@ -31,7 +31,7 @@ int direct_gbpages
+ static void __init find_early_table_space(unsigned long end, int use_pse,
+                                         int use_gbpages)
+ {
+-      unsigned long puds, pmds, ptes, tables, start = 0, good_end = end;
++      unsigned long puds, pmds, ptes, tables, start = 0x100000, good_end = end;
+       phys_addr_t base;
+       puds = (end + PUD_SIZE - 1) >> PUD_SHIFT;
+@@ -312,8 +312,29 @@ unsigned long __init_refok init_memory_mapping(unsigned long start,
+  */
+ int devmem_is_allowed(unsigned long pagenr)
+ {
++#ifdef CONFIG_GRKERNSEC_KMEM
++      /* allow BDA */
++      if (!pagenr)
++              return 1;
++      /* allow EBDA */
++      if ((0x9f000 >> PAGE_SHIFT) == pagenr)
++              return 1;
++#else
++      if (!pagenr)
++              return 1;
++#ifdef CONFIG_VM86
++      if (pagenr < (ISA_START_ADDRESS >> PAGE_SHIFT))
++              return 1;
++#endif
++#endif
++
++      if ((ISA_START_ADDRESS >> PAGE_SHIFT) <= pagenr && pagenr < (ISA_END_ADDRESS >> PAGE_SHIFT))
++              return 1;
++#ifdef CONFIG_GRKERNSEC_KMEM
++      /* throw out everything else below 1MB */
+       if (pagenr <= 256)
+-              return 1;
++              return 0;
++#endif
+       if (iomem_is_exclusive(pagenr << PAGE_SHIFT))
+               return 0;
+       if (!page_is_ram(pagenr))
+@@ -372,6 +393,86 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end)
+ void free_initmem(void)
+ {
++
++#ifdef CONFIG_PAX_KERNEXEC
++#ifdef CONFIG_X86_32
++      /* PaX: limit KERNEL_CS to actual size */
++      unsigned long addr, limit;
++      struct desc_struct d;
++      int cpu;
++
++      limit = paravirt_enabled() ? ktva_ktla(0xffffffff) : (unsigned long)&_etext;
++      limit = (limit - 1UL) >> PAGE_SHIFT;
++
++      memset(__LOAD_PHYSICAL_ADDR + PAGE_OFFSET, POISON_FREE_INITMEM, PAGE_SIZE);
++      for (cpu = 0; cpu < NR_CPUS; cpu++) {
++              pack_descriptor(&d, get_desc_base(&get_cpu_gdt_table(cpu)[GDT_ENTRY_KERNEL_CS]), limit, 0x9B, 0xC);
++              write_gdt_entry(get_cpu_gdt_table(cpu), GDT_ENTRY_KERNEL_CS, &d, DESCTYPE_S);
++      }
++
++      /* PaX: make KERNEL_CS read-only */
++      addr = PFN_ALIGN(ktla_ktva((unsigned long)&_text));
++      if (!paravirt_enabled())
++              set_memory_ro(addr, (PFN_ALIGN(_sdata) - addr) >> PAGE_SHIFT);
++/*
++              for (addr = ktla_ktva((unsigned long)&_text); addr < (unsigned long)&_sdata; addr += PMD_SIZE) {
++                      pgd = pgd_offset_k(addr);
++                      pud = pud_offset(pgd, addr);
++                      pmd = pmd_offset(pud, addr);
++                      set_pmd(pmd, __pmd(pmd_val(*pmd) & ~_PAGE_RW));
++              }
++*/
++#ifdef CONFIG_X86_PAE
++      set_memory_nx(PFN_ALIGN(__init_begin), (PFN_ALIGN(__init_end) - PFN_ALIGN(__init_begin)) >> PAGE_SHIFT);
++/*
++      for (addr = (unsigned long)&__init_begin; addr < (unsigned long)&__init_end; addr += PMD_SIZE) {
++              pgd = pgd_offset_k(addr);
++              pud = pud_offset(pgd, addr);
++              pmd = pmd_offset(pud, addr);
++              set_pmd(pmd, __pmd(pmd_val(*pmd) | (_PAGE_NX & __supported_pte_mask)));
++      }
++*/
++#endif
++
++#ifdef CONFIG_MODULES
++      set_memory_4k((unsigned long)MODULES_EXEC_VADDR, (MODULES_EXEC_END - MODULES_EXEC_VADDR) >> PAGE_SHIFT);
++#endif
++
++#else
++      pgd_t *pgd;
++      pud_t *pud;
++      pmd_t *pmd;
++      unsigned long addr, end;
++
++      /* PaX: make kernel code/rodata read-only, rest non-executable */
++      for (addr = __START_KERNEL_map; addr < __START_KERNEL_map + KERNEL_IMAGE_SIZE; addr += PMD_SIZE) {
++              pgd = pgd_offset_k(addr);
++              pud = pud_offset(pgd, addr);
++              pmd = pmd_offset(pud, addr);
++              if (!pmd_present(*pmd))
++                      continue;
++              if ((unsigned long)_text <= addr && addr < (unsigned long)_sdata)
++                      set_pmd(pmd, __pmd(pmd_val(*pmd) & ~_PAGE_RW));
++              else
++                      set_pmd(pmd, __pmd(pmd_val(*pmd) | (_PAGE_NX & __supported_pte_mask)));
++      }
++
++      addr = (unsigned long)__va(__pa(__START_KERNEL_map));
++      end = addr + KERNEL_IMAGE_SIZE;
++      for (; addr < end; addr += PMD_SIZE) {
++              pgd = pgd_offset_k(addr);
++              pud = pud_offset(pgd, addr);
++              pmd = pmd_offset(pud, addr);
++              if (!pmd_present(*pmd))
++                      continue;
++              if ((unsigned long)__va(__pa(_text)) <= addr && addr < (unsigned long)__va(__pa(_sdata)))
++                      set_pmd(pmd, __pmd(pmd_val(*pmd) & ~_PAGE_RW));
++      }
++#endif
++
++      flush_tlb_all();
++#endif
++
+       free_init_pages("unused kernel memory",
+                       (unsigned long)(&__init_begin),
+                       (unsigned long)(&__init_end));
+diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
+index 29f7c6d..b46b35b 100644
+--- a/arch/x86/mm/init_32.c
++++ b/arch/x86/mm/init_32.c
 @@ -74,36 +74,6 @@ static __init void *alloc_low_page(void)
  }
  
@@ -20788,7 +22486,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/init_32.c linux-3.1.3/arch/x86/mm/init_32.c
   * Create a page table and place a pointer to it in a middle page
   * directory entry:
   */
-@@ -123,13 +93,28 @@ static pte_t * __init one_page_table_ini
+@@ -123,13 +93,28 @@ static pte_t * __init one_page_table_init(pmd_t *pmd)
                        page_table = (pte_t *)alloc_low_page();
  
                paravirt_alloc_pte(&init_mm, __pa(page_table) >> PAGE_SHIFT);
@@ -20817,7 +22515,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/init_32.c linux-3.1.3/arch/x86/mm/init_32.c
  pmd_t * __init populate_extra_pmd(unsigned long vaddr)
  {
        int pgd_idx = pgd_index(vaddr);
-@@ -203,6 +188,7 @@ page_table_range_init(unsigned long star
+@@ -203,6 +188,7 @@ page_table_range_init(unsigned long start, unsigned long end, pgd_t *pgd_base)
        int pgd_idx, pmd_idx;
        unsigned long vaddr;
        pgd_t *pgd;
@@ -20825,7 +22523,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/init_32.c linux-3.1.3/arch/x86/mm/init_32.c
        pmd_t *pmd;
        pte_t *pte = NULL;
  
-@@ -212,8 +198,13 @@ page_table_range_init(unsigned long star
+@@ -212,8 +198,13 @@ page_table_range_init(unsigned long start, unsigned long end, pgd_t *pgd_base)
        pgd = pgd_base + pgd_idx;
  
        for ( ; (pgd_idx < PTRS_PER_PGD) && (vaddr != end); pgd++, pgd_idx++) {
@@ -20841,7 +22539,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/init_32.c linux-3.1.3/arch/x86/mm/init_32.c
                for (; (pmd_idx < PTRS_PER_PMD) && (vaddr != end);
                                                        pmd++, pmd_idx++) {
                        pte = page_table_kmap_check(one_page_table_init(pmd),
-@@ -225,11 +216,20 @@ page_table_range_init(unsigned long star
+@@ -225,11 +216,20 @@ page_table_range_init(unsigned long start, unsigned long end, pgd_t *pgd_base)
        }
  }
  
@@ -20866,7 +22564,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/init_32.c linux-3.1.3/arch/x86/mm/init_32.c
  }
  
  /*
-@@ -246,9 +246,10 @@ kernel_physical_mapping_init(unsigned lo
+@@ -246,9 +246,10 @@ kernel_physical_mapping_init(unsigned long start,
        unsigned long last_map_addr = end;
        unsigned long start_pfn, end_pfn;
        pgd_t *pgd_base = swapper_pg_dir;
@@ -20941,7 +22639,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/init_32.c linux-3.1.3/arch/x86/mm/init_32.c
                                        prot = PAGE_KERNEL_EXEC;
  
                                pages_4k++;
-@@ -472,7 +473,7 @@ void __init native_pagetable_setup_start
+@@ -472,7 +473,7 @@ void __init native_pagetable_setup_start(pgd_t *base)
  
                pud = pud_offset(pgd, va);
                pmd = pmd_offset(pud, va);
@@ -20950,7 +22648,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/init_32.c linux-3.1.3/arch/x86/mm/init_32.c
                        break;
  
                pte = pte_offset_kernel(pmd, va);
-@@ -524,12 +525,10 @@ void __init early_ioremap_page_table_ran
+@@ -524,12 +525,10 @@ void __init early_ioremap_page_table_range_init(void)
  
  static void __init pagetable_init(void)
  {
@@ -21025,10 +22723,11 @@ diff -urNp linux-3.1.3/arch/x86/mm/init_32.c linux-3.1.3/arch/x86/mm/init_32.c
        set_pages_ro(virt_to_page(start), size >> PAGE_SHIFT);
        printk(KERN_INFO "Write protecting the kernel text: %luk\n",
                size >> 10);
-diff -urNp linux-3.1.3/arch/x86/mm/init_64.c linux-3.1.3/arch/x86/mm/init_64.c
---- linux-3.1.3/arch/x86/mm/init_64.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/mm/init_64.c  2011-11-16 18:39:07.000000000 -0500
-@@ -75,7 +75,7 @@ early_param("gbpages", parse_direct_gbpa
+diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
+index bbaaa00..16dffad 100644
+--- a/arch/x86/mm/init_64.c
++++ b/arch/x86/mm/init_64.c
+@@ -75,7 +75,7 @@ early_param("gbpages", parse_direct_gbpages_on);
   * around without checking the pgd every time.
   */
  
@@ -21037,7 +22736,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/init_64.c linux-3.1.3/arch/x86/mm/init_64.c
  EXPORT_SYMBOL_GPL(__supported_pte_mask);
  
  int force_personality32;
-@@ -108,12 +108,22 @@ void sync_global_pgds(unsigned long star
+@@ -108,12 +108,22 @@ void sync_global_pgds(unsigned long start, unsigned long end)
  
        for (address = start; address <= end; address += PGDIR_SIZE) {
                const pgd_t *pgd_ref = pgd_offset_k(address);
@@ -21060,7 +22759,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/init_64.c linux-3.1.3/arch/x86/mm/init_64.c
                list_for_each_entry(page, &pgd_list, lru) {
                        pgd_t *pgd;
                        spinlock_t *pgt_lock;
-@@ -122,6 +132,7 @@ void sync_global_pgds(unsigned long star
+@@ -122,6 +132,7 @@ void sync_global_pgds(unsigned long start, unsigned long end)
                        /* the pgt_lock only for Xen */
                        pgt_lock = &pgd_page_get_mm(page)->page_table_lock;
                        spin_lock(pgt_lock);
@@ -21068,7 +22767,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/init_64.c linux-3.1.3/arch/x86/mm/init_64.c
  
                        if (pgd_none(*pgd))
                                set_pgd(pgd, *pgd_ref);
-@@ -129,7 +140,10 @@ void sync_global_pgds(unsigned long star
+@@ -129,7 +140,10 @@ void sync_global_pgds(unsigned long start, unsigned long end)
                                BUG_ON(pgd_page_vaddr(*pgd)
                                       != pgd_page_vaddr(*pgd_ref));
  
@@ -21079,7 +22778,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/init_64.c linux-3.1.3/arch/x86/mm/init_64.c
                }
                spin_unlock(&pgd_lock);
        }
-@@ -203,7 +217,9 @@ void set_pte_vaddr_pud(pud_t *pud_page, 
+@@ -203,7 +217,9 @@ void set_pte_vaddr_pud(pud_t *pud_page, unsigned long vaddr, pte_t new_pte)
        pmd = fill_pmd(pud, vaddr);
        pte = fill_pte(pmd, vaddr);
  
@@ -21089,7 +22788,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/init_64.c linux-3.1.3/arch/x86/mm/init_64.c
  
        /*
         * It's enough to flush this one mapping.
-@@ -262,14 +278,12 @@ static void __init __init_extra_mapping(
+@@ -262,14 +278,12 @@ static void __init __init_extra_mapping(unsigned long phys, unsigned long size,
                pgd = pgd_offset_k((unsigned long)__va(phys));
                if (pgd_none(*pgd)) {
                        pud = (pud_t *) spp_getpage();
@@ -21106,7 +22805,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/init_64.c linux-3.1.3/arch/x86/mm/init_64.c
                }
                pmd = pmd_offset(pud, phys);
                BUG_ON(!pmd_none(*pmd));
-@@ -330,7 +344,7 @@ static __ref void *alloc_low_page(unsign
+@@ -330,7 +344,7 @@ static __ref void *alloc_low_page(unsigned long *phys)
        if (pfn >= pgt_buf_top)
                panic("alloc_low_page: ran out of memory");
  
@@ -21115,7 +22814,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/init_64.c linux-3.1.3/arch/x86/mm/init_64.c
        clear_page(adr);
        *phys  = pfn * PAGE_SIZE;
        return adr;
-@@ -346,7 +360,7 @@ static __ref void *map_low_page(void *vi
+@@ -346,7 +360,7 @@ static __ref void *map_low_page(void *virt)
  
        phys = __pa(virt);
        left = phys & (PAGE_SIZE - 1);
@@ -21148,7 +22847,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/init_64.c linux-3.1.3/arch/x86/mm/init_64.c
  };
  
  struct vm_area_struct *get_gate_vma(struct mm_struct *mm)
-@@ -888,7 +908,7 @@ int in_gate_area_no_mm(unsigned long add
+@@ -888,7 +908,7 @@ int in_gate_area_no_mm(unsigned long addr)
  
  const char *arch_vma_name(struct vm_area_struct *vma)
  {
@@ -21157,140 +22856,11 @@ diff -urNp linux-3.1.3/arch/x86/mm/init_64.c linux-3.1.3/arch/x86/mm/init_64.c
                return "[vdso]";
        if (vma == &gate_vma)
                return "[vsyscall]";
-diff -urNp linux-3.1.3/arch/x86/mm/init.c linux-3.1.3/arch/x86/mm/init.c
---- linux-3.1.3/arch/x86/mm/init.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/mm/init.c     2011-11-17 18:31:28.000000000 -0500
-@@ -31,7 +31,7 @@ int direct_gbpages
- static void __init find_early_table_space(unsigned long end, int use_pse,
-                                         int use_gbpages)
- {
--      unsigned long puds, pmds, ptes, tables, start = 0, good_end = end;
-+      unsigned long puds, pmds, ptes, tables, start = 0x100000, good_end = end;
-       phys_addr_t base;
-       puds = (end + PUD_SIZE - 1) >> PUD_SHIFT;
-@@ -312,8 +312,29 @@ unsigned long __init_refok init_memory_m
-  */
- int devmem_is_allowed(unsigned long pagenr)
- {
--      if (pagenr <= 256)
-+#ifdef CONFIG_GRKERNSEC_KMEM
-+      /* allow BDA */
-+      if (!pagenr)
-+              return 1;
-+      /* allow EBDA */
-+      if ((0x9f000 >> PAGE_SHIFT) == pagenr)
-+              return 1;
-+#else
-+      if (!pagenr)
-+              return 1;
-+#ifdef CONFIG_VM86
-+      if (pagenr < (ISA_START_ADDRESS >> PAGE_SHIFT))
-+              return 1;
-+#endif
-+#endif
-+
-+      if ((ISA_START_ADDRESS >> PAGE_SHIFT) <= pagenr && pagenr < (ISA_END_ADDRESS >> PAGE_SHIFT))
-               return 1;
-+#ifdef CONFIG_GRKERNSEC_KMEM
-+      /* throw out everything else below 1MB */
-+      if (pagenr <= 256)
-+              return 0;
-+#endif
-       if (iomem_is_exclusive(pagenr << PAGE_SHIFT))
-               return 0;
-       if (!page_is_ram(pagenr))
-@@ -372,6 +393,86 @@ void free_init_pages(char *what, unsigne
- void free_initmem(void)
- {
-+
-+#ifdef CONFIG_PAX_KERNEXEC
-+#ifdef CONFIG_X86_32
-+      /* PaX: limit KERNEL_CS to actual size */
-+      unsigned long addr, limit;
-+      struct desc_struct d;
-+      int cpu;
-+
-+      limit = paravirt_enabled() ? ktva_ktla(0xffffffff) : (unsigned long)&_etext;
-+      limit = (limit - 1UL) >> PAGE_SHIFT;
-+
-+      memset(__LOAD_PHYSICAL_ADDR + PAGE_OFFSET, POISON_FREE_INITMEM, PAGE_SIZE);
-+      for (cpu = 0; cpu < NR_CPUS; cpu++) {
-+              pack_descriptor(&d, get_desc_base(&get_cpu_gdt_table(cpu)[GDT_ENTRY_KERNEL_CS]), limit, 0x9B, 0xC);
-+              write_gdt_entry(get_cpu_gdt_table(cpu), GDT_ENTRY_KERNEL_CS, &d, DESCTYPE_S);
-+      }
-+
-+      /* PaX: make KERNEL_CS read-only */
-+      addr = PFN_ALIGN(ktla_ktva((unsigned long)&_text));
-+      if (!paravirt_enabled())
-+              set_memory_ro(addr, (PFN_ALIGN(_sdata) - addr) >> PAGE_SHIFT);
-+/*
-+              for (addr = ktla_ktva((unsigned long)&_text); addr < (unsigned long)&_sdata; addr += PMD_SIZE) {
-+                      pgd = pgd_offset_k(addr);
-+                      pud = pud_offset(pgd, addr);
-+                      pmd = pmd_offset(pud, addr);
-+                      set_pmd(pmd, __pmd(pmd_val(*pmd) & ~_PAGE_RW));
-+              }
-+*/
-+#ifdef CONFIG_X86_PAE
-+      set_memory_nx(PFN_ALIGN(__init_begin), (PFN_ALIGN(__init_end) - PFN_ALIGN(__init_begin)) >> PAGE_SHIFT);
-+/*
-+      for (addr = (unsigned long)&__init_begin; addr < (unsigned long)&__init_end; addr += PMD_SIZE) {
-+              pgd = pgd_offset_k(addr);
-+              pud = pud_offset(pgd, addr);
-+              pmd = pmd_offset(pud, addr);
-+              set_pmd(pmd, __pmd(pmd_val(*pmd) | (_PAGE_NX & __supported_pte_mask)));
-+      }
-+*/
-+#endif
-+
-+#ifdef CONFIG_MODULES
-+      set_memory_4k((unsigned long)MODULES_EXEC_VADDR, (MODULES_EXEC_END - MODULES_EXEC_VADDR) >> PAGE_SHIFT);
-+#endif
-+
-+#else
-+      pgd_t *pgd;
-+      pud_t *pud;
-+      pmd_t *pmd;
-+      unsigned long addr, end;
-+
-+      /* PaX: make kernel code/rodata read-only, rest non-executable */
-+      for (addr = __START_KERNEL_map; addr < __START_KERNEL_map + KERNEL_IMAGE_SIZE; addr += PMD_SIZE) {
-+              pgd = pgd_offset_k(addr);
-+              pud = pud_offset(pgd, addr);
-+              pmd = pmd_offset(pud, addr);
-+              if (!pmd_present(*pmd))
-+                      continue;
-+              if ((unsigned long)_text <= addr && addr < (unsigned long)_sdata)
-+                      set_pmd(pmd, __pmd(pmd_val(*pmd) & ~_PAGE_RW));
-+              else
-+                      set_pmd(pmd, __pmd(pmd_val(*pmd) | (_PAGE_NX & __supported_pte_mask)));
-+      }
-+
-+      addr = (unsigned long)__va(__pa(__START_KERNEL_map));
-+      end = addr + KERNEL_IMAGE_SIZE;
-+      for (; addr < end; addr += PMD_SIZE) {
-+              pgd = pgd_offset_k(addr);
-+              pud = pud_offset(pgd, addr);
-+              pmd = pmd_offset(pud, addr);
-+              if (!pmd_present(*pmd))
-+                      continue;
-+              if ((unsigned long)__va(__pa(_text)) <= addr && addr < (unsigned long)__va(__pa(_sdata)))
-+                      set_pmd(pmd, __pmd(pmd_val(*pmd) & ~_PAGE_RW));
-+      }
-+#endif
-+
-+      flush_tlb_all();
-+#endif
-+
-       free_init_pages("unused kernel memory",
-                       (unsigned long)(&__init_begin),
-                       (unsigned long)(&__init_end));
-diff -urNp linux-3.1.3/arch/x86/mm/iomap_32.c linux-3.1.3/arch/x86/mm/iomap_32.c
---- linux-3.1.3/arch/x86/mm/iomap_32.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/mm/iomap_32.c 2011-11-16 18:39:07.000000000 -0500
-@@ -64,7 +64,11 @@ void *kmap_atomic_prot_pfn(unsigned long
+diff --git a/arch/x86/mm/iomap_32.c b/arch/x86/mm/iomap_32.c
+index 7b179b4..6bd1777 100644
+--- a/arch/x86/mm/iomap_32.c
++++ b/arch/x86/mm/iomap_32.c
+@@ -64,7 +64,11 @@ void *kmap_atomic_prot_pfn(unsigned long pfn, pgprot_t prot)
        type = kmap_atomic_idx_push();
        idx = type + KM_TYPE_NR * smp_processor_id();
        vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
@@ -21302,10 +22872,11 @@ diff -urNp linux-3.1.3/arch/x86/mm/iomap_32.c linux-3.1.3/arch/x86/mm/iomap_32.c
        arch_flush_lazy_mmu_mode();
  
        return (void *)vaddr;
-diff -urNp linux-3.1.3/arch/x86/mm/ioremap.c linux-3.1.3/arch/x86/mm/ioremap.c
---- linux-3.1.3/arch/x86/mm/ioremap.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/mm/ioremap.c  2011-11-16 18:39:07.000000000 -0500
-@@ -97,7 +97,7 @@ static void __iomem *__ioremap_caller(re
+diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
+index be1ef57..9680edc 100644
+--- a/arch/x86/mm/ioremap.c
++++ b/arch/x86/mm/ioremap.c
+@@ -97,7 +97,7 @@ static void __iomem *__ioremap_caller(resource_size_t phys_addr,
        for (pfn = phys_addr >> PAGE_SHIFT; pfn <= last_pfn; pfn++) {
                int is_ram = page_is_ram(pfn);
  
@@ -21314,7 +22885,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/ioremap.c linux-3.1.3/arch/x86/mm/ioremap.c
                        return NULL;
                WARN_ON_ONCE(is_ram);
        }
-@@ -344,7 +344,7 @@ static int __init early_ioremap_debug_se
+@@ -344,7 +344,7 @@ static int __init early_ioremap_debug_setup(char *str)
  early_param("early_ioremap_debug", early_ioremap_debug_setup);
  
  static __initdata int after_paging_init;
@@ -21333,10 +22904,11 @@ diff -urNp linux-3.1.3/arch/x86/mm/ioremap.c linux-3.1.3/arch/x86/mm/ioremap.c
  
        /*
         * The boot-ioremap range spans multiple pmds, for which
-diff -urNp linux-3.1.3/arch/x86/mm/kmemcheck/kmemcheck.c linux-3.1.3/arch/x86/mm/kmemcheck/kmemcheck.c
---- linux-3.1.3/arch/x86/mm/kmemcheck/kmemcheck.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/mm/kmemcheck/kmemcheck.c      2011-11-16 18:39:07.000000000 -0500
-@@ -622,9 +622,9 @@ bool kmemcheck_fault(struct pt_regs *reg
+diff --git a/arch/x86/mm/kmemcheck/kmemcheck.c b/arch/x86/mm/kmemcheck/kmemcheck.c
+index d87dd6d..bf3fa66 100644
+--- a/arch/x86/mm/kmemcheck/kmemcheck.c
++++ b/arch/x86/mm/kmemcheck/kmemcheck.c
+@@ -622,9 +622,9 @@ bool kmemcheck_fault(struct pt_regs *regs, unsigned long address,
         * memory (e.g. tracked pages)? For now, we need this to avoid
         * invoking kmemcheck for PnP BIOS calls.
         */
@@ -21348,10 +22920,11 @@ diff -urNp linux-3.1.3/arch/x86/mm/kmemcheck/kmemcheck.c linux-3.1.3/arch/x86/mm
                return false;
  
        pte = kmemcheck_pte_lookup(address);
-diff -urNp linux-3.1.3/arch/x86/mm/mmap.c linux-3.1.3/arch/x86/mm/mmap.c
---- linux-3.1.3/arch/x86/mm/mmap.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/mm/mmap.c     2011-11-16 18:39:07.000000000 -0500
-@@ -49,7 +49,7 @@ static unsigned int stack_maxrandom_size
+diff --git a/arch/x86/mm/mmap.c b/arch/x86/mm/mmap.c
+index 1dab519..60a7e5f 100644
+--- a/arch/x86/mm/mmap.c
++++ b/arch/x86/mm/mmap.c
+@@ -49,7 +49,7 @@ static unsigned int stack_maxrandom_size(void)
   * Leave an at least ~128 MB hole with possible stack randomization.
   */
  #define MIN_GAP (128*1024*1024UL + stack_maxrandom_size())
@@ -21406,7 +22979,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/mmap.c linux-3.1.3/arch/x86/mm/mmap.c
                return TASK_UNMAPPED_BASE + mmap_rnd();
  }
  
-@@ -125,11 +138,23 @@ static unsigned long mmap_legacy_base(vo
+@@ -125,11 +138,23 @@ static unsigned long mmap_legacy_base(void)
  void arch_pick_mmap_layout(struct mm_struct *mm)
  {
        if (mmap_is_legacy()) {
@@ -21432,10 +23005,11 @@ diff -urNp linux-3.1.3/arch/x86/mm/mmap.c linux-3.1.3/arch/x86/mm/mmap.c
                mm->get_unmapped_area = arch_get_unmapped_area_topdown;
                mm->unmap_area = arch_unmap_area_topdown;
        }
-diff -urNp linux-3.1.3/arch/x86/mm/mmio-mod.c linux-3.1.3/arch/x86/mm/mmio-mod.c
---- linux-3.1.3/arch/x86/mm/mmio-mod.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/mm/mmio-mod.c 2011-11-16 18:39:07.000000000 -0500
-@@ -195,7 +195,7 @@ static void pre(struct kmmio_probe *p, s
+diff --git a/arch/x86/mm/mmio-mod.c b/arch/x86/mm/mmio-mod.c
+index 67421f3..8d6b107 100644
+--- a/arch/x86/mm/mmio-mod.c
++++ b/arch/x86/mm/mmio-mod.c
+@@ -195,7 +195,7 @@ static void pre(struct kmmio_probe *p, struct pt_regs *regs,
                break;
        default:
                {
@@ -21444,7 +23018,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/mmio-mod.c linux-3.1.3/arch/x86/mm/mmio-mod.c
                        my_trace->opcode = MMIO_UNKNOWN_OP;
                        my_trace->width = 0;
                        my_trace->value = (*ip) << 16 | *(ip + 1) << 8 |
-@@ -235,7 +235,7 @@ static void post(struct kmmio_probe *p, 
+@@ -235,7 +235,7 @@ static void post(struct kmmio_probe *p, unsigned long condition,
  static void ioremap_trace_core(resource_size_t offset, unsigned long size,
                                                        void __iomem *addr)
  {
@@ -21453,7 +23027,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/mmio-mod.c linux-3.1.3/arch/x86/mm/mmio-mod.c
        struct remap_trace *trace = kmalloc(sizeof(*trace), GFP_KERNEL);
        /* These are page-unaligned. */
        struct mmiotrace_map map = {
-@@ -259,7 +259,7 @@ static void ioremap_trace_core(resource_
+@@ -259,7 +259,7 @@ static void ioremap_trace_core(resource_size_t offset, unsigned long size,
                        .private = trace
                },
                .phys = offset,
@@ -21462,10 +23036,24 @@ diff -urNp linux-3.1.3/arch/x86/mm/mmio-mod.c linux-3.1.3/arch/x86/mm/mmio-mod.c
        };
        map.map_id = trace->id;
  
-diff -urNp linux-3.1.3/arch/x86/mm/pageattr.c linux-3.1.3/arch/x86/mm/pageattr.c
---- linux-3.1.3/arch/x86/mm/pageattr.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/mm/pageattr.c 2011-11-16 18:39:07.000000000 -0500
-@@ -261,7 +261,7 @@ static inline pgprot_t static_protection
+diff --git a/arch/x86/mm/pageattr-test.c b/arch/x86/mm/pageattr-test.c
+index b008656..773eac2 100644
+--- a/arch/x86/mm/pageattr-test.c
++++ b/arch/x86/mm/pageattr-test.c
+@@ -36,7 +36,7 @@ enum {
+ static int pte_testbit(pte_t pte)
+ {
+-      return pte_flags(pte) & _PAGE_UNUSED1;
++      return pte_flags(pte) & _PAGE_CPA_TEST;
+ }
+ struct split_state {
+diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
+index f9e5267..6f6e27f 100644
+--- a/arch/x86/mm/pageattr.c
++++ b/arch/x86/mm/pageattr.c
+@@ -261,7 +261,7 @@ static inline pgprot_t static_protections(pgprot_t prot, unsigned long address,
         */
  #ifdef CONFIG_PCI_BIOS
        if (pcibios_enabled && within(pfn, BIOS_BEGIN >> PAGE_SHIFT, BIOS_END >> PAGE_SHIFT))
@@ -21474,7 +23062,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/pageattr.c linux-3.1.3/arch/x86/mm/pageattr.c
  #endif
  
        /*
-@@ -269,9 +269,10 @@ static inline pgprot_t static_protection
+@@ -269,9 +269,10 @@ static inline pgprot_t static_protections(pgprot_t prot, unsigned long address,
         * Does not cover __inittext since that is gone later on. On
         * 64bit we do not enforce !NX on the low mapping
         */
@@ -21487,7 +23075,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/pageattr.c linux-3.1.3/arch/x86/mm/pageattr.c
        /*
         * The .rodata section needs to be read-only. Using the pfn
         * catches all aliases.
-@@ -279,6 +280,7 @@ static inline pgprot_t static_protection
+@@ -279,6 +280,7 @@ static inline pgprot_t static_protections(pgprot_t prot, unsigned long address,
        if (within(pfn, __pa((unsigned long)__start_rodata) >> PAGE_SHIFT,
                   __pa((unsigned long)__end_rodata) >> PAGE_SHIFT))
                pgprot_val(forbidden) |= _PAGE_RW;
@@ -21495,7 +23083,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/pageattr.c linux-3.1.3/arch/x86/mm/pageattr.c
  
  #if defined(CONFIG_X86_64) && defined(CONFIG_DEBUG_RODATA)
        /*
-@@ -317,6 +319,13 @@ static inline pgprot_t static_protection
+@@ -317,6 +319,13 @@ static inline pgprot_t static_protections(pgprot_t prot, unsigned long address,
        }
  #endif
  
@@ -21549,21 +23137,10 @@ diff -urNp linux-3.1.3/arch/x86/mm/pageattr.c linux-3.1.3/arch/x86/mm/pageattr.c
  }
  
  static int
-diff -urNp linux-3.1.3/arch/x86/mm/pageattr-test.c linux-3.1.3/arch/x86/mm/pageattr-test.c
---- linux-3.1.3/arch/x86/mm/pageattr-test.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/mm/pageattr-test.c    2011-11-16 18:39:07.000000000 -0500
-@@ -36,7 +36,7 @@ enum {
- static int pte_testbit(pte_t pte)
- {
--      return pte_flags(pte) & _PAGE_UNUSED1;
-+      return pte_flags(pte) & _PAGE_CPA_TEST;
- }
- struct split_state {
-diff -urNp linux-3.1.3/arch/x86/mm/pat.c linux-3.1.3/arch/x86/mm/pat.c
---- linux-3.1.3/arch/x86/mm/pat.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/mm/pat.c      2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
+index f6ff57b..481690f 100644
+--- a/arch/x86/mm/pat.c
++++ b/arch/x86/mm/pat.c
 @@ -361,7 +361,7 @@ int free_memtype(u64 start, u64 end)
  
        if (!entry) {
@@ -21573,7 +23150,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/pat.c linux-3.1.3/arch/x86/mm/pat.c
                return -EINVAL;
        }
  
-@@ -492,8 +492,8 @@ static inline int range_is_allowed(unsig
+@@ -492,8 +492,8 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size)
        while (cursor < to) {
                if (!devmem_is_allowed(pfn)) {
                        printk(KERN_INFO
@@ -21584,7 +23161,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/pat.c linux-3.1.3/arch/x86/mm/pat.c
                        return 0;
                }
                cursor += PAGE_SIZE;
-@@ -557,7 +557,7 @@ int kernel_map_sync_memtype(u64 base, un
+@@ -557,7 +557,7 @@ int kernel_map_sync_memtype(u64 base, unsigned long size, unsigned long flags)
                printk(KERN_INFO
                        "%s:%d ioremap_change_attr failed %s "
                        "for %Lx-%Lx\n",
@@ -21593,7 +23170,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/pat.c linux-3.1.3/arch/x86/mm/pat.c
                        cattr_name(flags),
                        base, (unsigned long long)(base + size));
                return -EINVAL;
-@@ -593,7 +593,7 @@ static int reserve_pfn_range(u64 paddr, 
+@@ -593,7 +593,7 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot,
                if (want_flags != flags) {
                        printk(KERN_WARNING
                        "%s:%d map pfn RAM range req %s for %Lx-%Lx, got %s\n",
@@ -21602,7 +23179,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/pat.c linux-3.1.3/arch/x86/mm/pat.c
                                cattr_name(want_flags),
                                (unsigned long long)paddr,
                                (unsigned long long)(paddr + size),
-@@ -615,7 +615,7 @@ static int reserve_pfn_range(u64 paddr, 
+@@ -615,7 +615,7 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot,
                        free_memtype(paddr, paddr + size);
                        printk(KERN_ERR "%s:%d map pfn expected mapping type %s"
                                " for %Lx-%Lx, got %s\n",
@@ -21611,10 +23188,11 @@ diff -urNp linux-3.1.3/arch/x86/mm/pat.c linux-3.1.3/arch/x86/mm/pat.c
                                cattr_name(want_flags),
                                (unsigned long long)paddr,
                                (unsigned long long)(paddr + size),
-diff -urNp linux-3.1.3/arch/x86/mm/pf_in.c linux-3.1.3/arch/x86/mm/pf_in.c
---- linux-3.1.3/arch/x86/mm/pf_in.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/mm/pf_in.c    2011-11-16 18:39:07.000000000 -0500
-@@ -148,7 +148,7 @@ enum reason_type get_ins_type(unsigned l
+diff --git a/arch/x86/mm/pf_in.c b/arch/x86/mm/pf_in.c
+index 9f0614d..92ae64a 100644
+--- a/arch/x86/mm/pf_in.c
++++ b/arch/x86/mm/pf_in.c
+@@ -148,7 +148,7 @@ enum reason_type get_ins_type(unsigned long ins_addr)
        int i;
        enum reason_type rv = OTHERS;
  
@@ -21623,7 +23201,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/pf_in.c linux-3.1.3/arch/x86/mm/pf_in.c
        p += skip_prefix(p, &prf);
        p += get_opcode(p, &opcode);
  
-@@ -168,7 +168,7 @@ static unsigned int get_ins_reg_width(un
+@@ -168,7 +168,7 @@ static unsigned int get_ins_reg_width(unsigned long ins_addr)
        struct prefix_bits prf;
        int i;
  
@@ -21632,7 +23210,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/pf_in.c linux-3.1.3/arch/x86/mm/pf_in.c
        p += skip_prefix(p, &prf);
        p += get_opcode(p, &opcode);
  
-@@ -191,7 +191,7 @@ unsigned int get_ins_mem_width(unsigned 
+@@ -191,7 +191,7 @@ unsigned int get_ins_mem_width(unsigned long ins_addr)
        struct prefix_bits prf;
        int i;
  
@@ -21641,7 +23219,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/pf_in.c linux-3.1.3/arch/x86/mm/pf_in.c
        p += skip_prefix(p, &prf);
        p += get_opcode(p, &opcode);
  
-@@ -415,7 +415,7 @@ unsigned long get_ins_reg_val(unsigned l
+@@ -415,7 +415,7 @@ unsigned long get_ins_reg_val(unsigned long ins_addr, struct pt_regs *regs)
        struct prefix_bits prf;
        int i;
  
@@ -21650,7 +23228,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/pf_in.c linux-3.1.3/arch/x86/mm/pf_in.c
        p += skip_prefix(p, &prf);
        p += get_opcode(p, &opcode);
        for (i = 0; i < ARRAY_SIZE(reg_rop); i++)
-@@ -470,7 +470,7 @@ unsigned long get_ins_imm_val(unsigned l
+@@ -470,7 +470,7 @@ unsigned long get_ins_imm_val(unsigned long ins_addr)
        struct prefix_bits prf;
        int i;
  
@@ -21659,27 +23237,11 @@ diff -urNp linux-3.1.3/arch/x86/mm/pf_in.c linux-3.1.3/arch/x86/mm/pf_in.c
        p += skip_prefix(p, &prf);
        p += get_opcode(p, &opcode);
        for (i = 0; i < ARRAY_SIZE(imm_wop); i++)
-diff -urNp linux-3.1.3/arch/x86/mm/pgtable_32.c linux-3.1.3/arch/x86/mm/pgtable_32.c
---- linux-3.1.3/arch/x86/mm/pgtable_32.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/mm/pgtable_32.c       2011-11-16 18:39:07.000000000 -0500
-@@ -48,10 +48,13 @@ void set_pte_vaddr(unsigned long vaddr, 
-               return;
-       }
-       pte = pte_offset_kernel(pmd, vaddr);
-+
-+      pax_open_kernel();
-       if (pte_val(pteval))
-               set_pte_at(&init_mm, vaddr, pte, pteval);
-       else
-               pte_clear(&init_mm, vaddr, pte);
-+      pax_close_kernel();
-       /*
-        * It's enough to flush this one mapping.
-diff -urNp linux-3.1.3/arch/x86/mm/pgtable.c linux-3.1.3/arch/x86/mm/pgtable.c
---- linux-3.1.3/arch/x86/mm/pgtable.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/mm/pgtable.c  2011-11-16 18:39:07.000000000 -0500
-@@ -84,10 +84,52 @@ static inline void pgd_list_del(pgd_t *p
+diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
+index 8573b83..6372501 100644
+--- a/arch/x86/mm/pgtable.c
++++ b/arch/x86/mm/pgtable.c
+@@ -84,10 +84,52 @@ static inline void pgd_list_del(pgd_t *pgd)
        list_del(&page->lru);
  }
  
@@ -21694,7 +23256,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/pgtable.c linux-3.1.3/arch/x86/mm/pgtable.c
 +              *dst++ = __pgd((pgd_val(*src++) | (_PAGE_NX & __supported_pte_mask)) & ~_PAGE_USER);
 +}
 +#endif
-+
 +#ifdef CONFIG_PAX_PER_CPU_PGD
 +void __clone_user_pgds(pgd_t *dst, const pgd_t *src, int count)
 +{
@@ -21705,7 +23267,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/pgtable.c linux-3.1.3/arch/x86/mm/pgtable.c
 +#else
 +              *dst++ = *src++;
 +#endif
++
 +}
 +#endif
 +
@@ -21760,7 +23322,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/pgtable.c linux-3.1.3/arch/x86/mm/pgtable.c
  
  void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd)
  {
-@@ -170,36 +213,38 @@ void pud_populate(struct mm_struct *mm, 
+@@ -170,36 +213,38 @@ void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd)
         */
        flush_tlb_mm(mm);
  }
@@ -21810,7 +23372,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/pgtable.c linux-3.1.3/arch/x86/mm/pgtable.c
                return -ENOMEM;
        }
  
-@@ -212,51 +257,55 @@ static int preallocate_pmds(pmd_t *pmds[
+@@ -212,51 +257,55 @@ static int preallocate_pmds(pmd_t *pmds[])
   * preallocate which never got a corresponding vma will need to be
   * freed manually.
   */
@@ -21924,9 +23486,28 @@ diff -urNp linux-3.1.3/arch/x86/mm/pgtable.c linux-3.1.3/arch/x86/mm/pgtable.c
        pgd_dtor(pgd);
        paravirt_pgd_free(mm, pgd);
        free_page((unsigned long)pgd);
-diff -urNp linux-3.1.3/arch/x86/mm/setup_nx.c linux-3.1.3/arch/x86/mm/setup_nx.c
---- linux-3.1.3/arch/x86/mm/setup_nx.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/mm/setup_nx.c 2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/mm/pgtable_32.c b/arch/x86/mm/pgtable_32.c
+index cac7184..09a39fa 100644
+--- a/arch/x86/mm/pgtable_32.c
++++ b/arch/x86/mm/pgtable_32.c
+@@ -48,10 +48,13 @@ void set_pte_vaddr(unsigned long vaddr, pte_t pteval)
+               return;
+       }
+       pte = pte_offset_kernel(pmd, vaddr);
++
++      pax_open_kernel();
+       if (pte_val(pteval))
+               set_pte_at(&init_mm, vaddr, pte, pteval);
+       else
+               pte_clear(&init_mm, vaddr, pte);
++      pax_close_kernel();
+       /*
+        * It's enough to flush this one mapping.
+diff --git a/arch/x86/mm/setup_nx.c b/arch/x86/mm/setup_nx.c
+index 410531d..0f16030 100644
+--- a/arch/x86/mm/setup_nx.c
++++ b/arch/x86/mm/setup_nx.c
 @@ -5,8 +5,10 @@
  #include <asm/pgtable.h>
  #include <asm/proto.h>
@@ -21938,7 +23519,7 @@ diff -urNp linux-3.1.3/arch/x86/mm/setup_nx.c linux-3.1.3/arch/x86/mm/setup_nx.c
  /*
   * noexec = on|off
   *
-@@ -28,12 +30,17 @@ static int __init noexec_setup(char *str
+@@ -28,12 +30,17 @@ static int __init noexec_setup(char *str)
        return 0;
  }
  early_param("noexec", noexec_setup);
@@ -21956,9 +23537,10 @@ diff -urNp linux-3.1.3/arch/x86/mm/setup_nx.c linux-3.1.3/arch/x86/mm/setup_nx.c
                __supported_pte_mask &= ~_PAGE_NX;
  }
  
-diff -urNp linux-3.1.3/arch/x86/mm/tlb.c linux-3.1.3/arch/x86/mm/tlb.c
---- linux-3.1.3/arch/x86/mm/tlb.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/mm/tlb.c      2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
+index d6c0418..06a0ad5 100644
+--- a/arch/x86/mm/tlb.c
++++ b/arch/x86/mm/tlb.c
 @@ -65,7 +65,11 @@ void leave_mm(int cpu)
                BUG();
        cpumask_clear_cpu(cpu,
@@ -21971,90 +23553,10 @@ diff -urNp linux-3.1.3/arch/x86/mm/tlb.c linux-3.1.3/arch/x86/mm/tlb.c
  }
  EXPORT_SYMBOL_GPL(leave_mm);
  
-diff -urNp linux-3.1.3/arch/x86/net/bpf_jit_comp.c linux-3.1.3/arch/x86/net/bpf_jit_comp.c
---- linux-3.1.3/arch/x86/net/bpf_jit_comp.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/net/bpf_jit_comp.c    2011-11-20 19:21:53.000000000 -0500
-@@ -117,6 +117,10 @@ static inline void bpf_flush_icache(void
-       set_fs(old_fs);
- }
-+struct bpf_jit_work {
-+      struct work_struct work;
-+      void *image;
-+};
- void bpf_jit_compile(struct sk_filter *fp)
- {
-@@ -141,6 +145,10 @@ void bpf_jit_compile(struct sk_filter *f
-       if (addrs == NULL)
-               return;
-+      fp->work = kmalloc(sizeof(*fp->work), GFP_KERNEL);
-+      if (!fp->work)
-+              goto out;
-+
-       /* Before first pass, make a rough estimation of addrs[]
-        * each bpf instruction is translated to less than 64 bytes
-        */
-@@ -585,11 +593,12 @@ cond_branch:                     f_offset = addrs[i + filt
-                       if (image) {
-                               if (unlikely(proglen + ilen > oldproglen)) {
-                                       pr_err("bpb_jit_compile fatal error\n");
--                                      kfree(addrs);
--                                      module_free(NULL, image);
--                                      return;
-+                                      module_free_exec(NULL, image);
-+                                      goto out;
-                               }
-+                              pax_open_kernel();
-                               memcpy(image + proglen, temp, ilen);
-+                              pax_close_kernel();
-                       }
-                       proglen += ilen;
-                       addrs[i] = proglen;
-@@ -609,7 +618,7 @@ cond_branch:                       f_offset = addrs[i + filt
-                       break;
-               }
-               if (proglen == oldproglen) {
--                      image = module_alloc(max_t(unsigned int,
-+                      image = module_alloc_exec(max_t(unsigned int,
-                                                  proglen,
-                                                  sizeof(struct work_struct)));
-                       if (!image)
-@@ -631,24 +640,27 @@ cond_branch:                     f_offset = addrs[i + filt
-               fp->bpf_func = (void *)image;
-       }
- out:
-+      kfree(fp->work);
-       kfree(addrs);
-       return;
- }
- static void jit_free_defer(struct work_struct *arg)
- {
--      module_free(NULL, arg);
-+      module_free_exec(NULL, ((struct bpf_jit_work*)arg)->image);
-+      kfree(arg);
- }
- /* run from softirq, we must use a work_struct to call
-- * module_free() from process context
-+ * module_free_exec() from process context
-  */
- void bpf_jit_free(struct sk_filter *fp)
- {
-       if (fp->bpf_func != sk_run_filter) {
--              struct work_struct *work = (struct work_struct *)fp->bpf_func;
-+              struct work_struct *work = &fp->work->work;
-               INIT_WORK(work, jit_free_defer);
-+              fp->work->image = fp->bpf_func;
-               schedule_work(work);
-       }
- }
-diff -urNp linux-3.1.3/arch/x86/net/bpf_jit.S linux-3.1.3/arch/x86/net/bpf_jit.S
---- linux-3.1.3/arch/x86/net/bpf_jit.S 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/net/bpf_jit.S 2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/net/bpf_jit.S b/arch/x86/net/bpf_jit.S
+index 6687022..ceabcfa 100644
+--- a/arch/x86/net/bpf_jit.S
++++ b/arch/x86/net/bpf_jit.S
 @@ -9,6 +9,7 @@
   */
  #include <linux/linkage.h>
@@ -22132,10 +23634,93 @@ diff -urNp linux-3.1.3/arch/x86/net/bpf_jit.S linux-3.1.3/arch/x86/net/bpf_jit.S
        xchg    %eax,%ebx
 +      pax_force_retaddr
        ret
-diff -urNp linux-3.1.3/arch/x86/oprofile/backtrace.c linux-3.1.3/arch/x86/oprofile/backtrace.c
---- linux-3.1.3/arch/x86/oprofile/backtrace.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/oprofile/backtrace.c  2011-11-16 18:39:07.000000000 -0500
-@@ -46,11 +46,11 @@ dump_user_backtrace_32(struct stack_fram
+diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
+index bfab3fa..05aac3a 100644
+--- a/arch/x86/net/bpf_jit_comp.c
++++ b/arch/x86/net/bpf_jit_comp.c
+@@ -117,6 +117,10 @@ static inline void bpf_flush_icache(void *start, void *end)
+       set_fs(old_fs);
+ }
++struct bpf_jit_work {
++      struct work_struct work;
++      void *image;
++};
+ void bpf_jit_compile(struct sk_filter *fp)
+ {
+@@ -141,6 +145,10 @@ void bpf_jit_compile(struct sk_filter *fp)
+       if (addrs == NULL)
+               return;
++      fp->work = kmalloc(sizeof(*fp->work), GFP_KERNEL);
++      if (!fp->work)
++              goto out;
++
+       /* Before first pass, make a rough estimation of addrs[]
+        * each bpf instruction is translated to less than 64 bytes
+        */
+@@ -585,11 +593,12 @@ cond_branch:                     f_offset = addrs[i + filter[i].jf] - addrs[i];
+                       if (image) {
+                               if (unlikely(proglen + ilen > oldproglen)) {
+                                       pr_err("bpb_jit_compile fatal error\n");
+-                                      kfree(addrs);
+-                                      module_free(NULL, image);
+-                                      return;
++                                      module_free_exec(NULL, image);
++                                      goto out;
+                               }
++                              pax_open_kernel();
+                               memcpy(image + proglen, temp, ilen);
++                              pax_close_kernel();
+                       }
+                       proglen += ilen;
+                       addrs[i] = proglen;
+@@ -609,7 +618,7 @@ cond_branch:                       f_offset = addrs[i + filter[i].jf] - addrs[i];
+                       break;
+               }
+               if (proglen == oldproglen) {
+-                      image = module_alloc(max_t(unsigned int,
++                      image = module_alloc_exec(max_t(unsigned int,
+                                                  proglen,
+                                                  sizeof(struct work_struct)));
+                       if (!image)
+@@ -631,24 +640,27 @@ cond_branch:                     f_offset = addrs[i + filter[i].jf] - addrs[i];
+               fp->bpf_func = (void *)image;
+       }
+ out:
++      kfree(fp->work);
+       kfree(addrs);
+       return;
+ }
+ static void jit_free_defer(struct work_struct *arg)
+ {
+-      module_free(NULL, arg);
++      module_free_exec(NULL, ((struct bpf_jit_work*)arg)->image);
++      kfree(arg);
+ }
+ /* run from softirq, we must use a work_struct to call
+- * module_free() from process context
++ * module_free_exec() from process context
+  */
+ void bpf_jit_free(struct sk_filter *fp)
+ {
+       if (fp->bpf_func != sk_run_filter) {
+-              struct work_struct *work = (struct work_struct *)fp->bpf_func;
++              struct work_struct *work = &fp->work->work;
+               INIT_WORK(work, jit_free_defer);
++              fp->work->image = fp->bpf_func;
+               schedule_work(work);
+       }
+ }
+diff --git a/arch/x86/oprofile/backtrace.c b/arch/x86/oprofile/backtrace.c
+index bff89df..377758a 100644
+--- a/arch/x86/oprofile/backtrace.c
++++ b/arch/x86/oprofile/backtrace.c
+@@ -46,11 +46,11 @@ dump_user_backtrace_32(struct stack_frame_ia32 *head)
        struct stack_frame_ia32 *fp;
        unsigned long bytes;
  
@@ -22149,7 +23734,7 @@ diff -urNp linux-3.1.3/arch/x86/oprofile/backtrace.c linux-3.1.3/arch/x86/oprofi
  
        oprofile_add_trace(bufhead[0].return_address);
  
-@@ -92,7 +92,7 @@ static struct stack_frame *dump_user_bac
+@@ -92,7 +92,7 @@ static struct stack_frame *dump_user_backtrace(struct stack_frame *head)
        struct stack_frame bufhead[2];
        unsigned long bytes;
  
@@ -22158,7 +23743,7 @@ diff -urNp linux-3.1.3/arch/x86/oprofile/backtrace.c linux-3.1.3/arch/x86/oprofi
        if (bytes != sizeof(bufhead))
                return NULL;
  
-@@ -111,7 +111,7 @@ x86_backtrace(struct pt_regs * const reg
+@@ -111,7 +111,7 @@ x86_backtrace(struct pt_regs * const regs, unsigned int depth)
  {
        struct stack_frame *head = (struct stack_frame *)frame_pointer(regs);
  
@@ -22167,9 +23752,10 @@ diff -urNp linux-3.1.3/arch/x86/oprofile/backtrace.c linux-3.1.3/arch/x86/oprofi
                unsigned long stack = kernel_stack_pointer(regs);
                if (depth)
                        dump_trace(NULL, regs, (unsigned long *)stack, 0,
-diff -urNp linux-3.1.3/arch/x86/pci/mrst.c linux-3.1.3/arch/x86/pci/mrst.c
---- linux-3.1.3/arch/x86/pci/mrst.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/pci/mrst.c    2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/pci/mrst.c b/arch/x86/pci/mrst.c
+index cb29191..036766d 100644
+--- a/arch/x86/pci/mrst.c
++++ b/arch/x86/pci/mrst.c
 @@ -234,7 +234,9 @@ int __init pci_mrst_init(void)
        printk(KERN_INFO "Moorestown platform detected, using MRST PCI ops\n");
        pci_mmcfg_late_init();
@@ -22181,9 +23767,10 @@ diff -urNp linux-3.1.3/arch/x86/pci/mrst.c linux-3.1.3/arch/x86/pci/mrst.c
        /* Continue with standard init */
        return 1;
  }
-diff -urNp linux-3.1.3/arch/x86/pci/pcbios.c linux-3.1.3/arch/x86/pci/pcbios.c
---- linux-3.1.3/arch/x86/pci/pcbios.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/pci/pcbios.c  2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/pci/pcbios.c b/arch/x86/pci/pcbios.c
+index f685535..2b76a81 100644
+--- a/arch/x86/pci/pcbios.c
++++ b/arch/x86/pci/pcbios.c
 @@ -79,50 +79,93 @@ union bios32 {
  static struct {
        unsigned long address;
@@ -22319,7 +23906,7 @@ diff -urNp linux-3.1.3/arch/x86/pci/pcbios.c linux-3.1.3/arch/x86/pci/pcbios.c
                        : "memory");
                local_irq_restore(flags);
  
-@@ -189,7 +235,10 @@ static int pci_bios_read(unsigned int se
+@@ -189,7 +235,10 @@ static int pci_bios_read(unsigned int seg, unsigned int bus,
  
        switch (len) {
        case 1:
@@ -22331,7 +23918,7 @@ diff -urNp linux-3.1.3/arch/x86/pci/pcbios.c linux-3.1.3/arch/x86/pci/pcbios.c
                        "jc 1f\n\t"
                        "xor %%ah, %%ah\n"
                        "1:"
-@@ -198,7 +247,8 @@ static int pci_bios_read(unsigned int se
+@@ -198,7 +247,8 @@ static int pci_bios_read(unsigned int seg, unsigned int bus,
                        : "1" (PCIBIOS_READ_CONFIG_BYTE),
                          "b" (bx),
                          "D" ((long)reg),
@@ -22341,7 +23928,7 @@ diff -urNp linux-3.1.3/arch/x86/pci/pcbios.c linux-3.1.3/arch/x86/pci/pcbios.c
                /*
                 * Zero-extend the result beyond 8 bits, do not trust the
                 * BIOS having done it:
-@@ -206,7 +256,10 @@ static int pci_bios_read(unsigned int se
+@@ -206,7 +256,10 @@ static int pci_bios_read(unsigned int seg, unsigned int bus,
                *value &= 0xff;
                break;
        case 2:
@@ -22353,7 +23940,7 @@ diff -urNp linux-3.1.3/arch/x86/pci/pcbios.c linux-3.1.3/arch/x86/pci/pcbios.c
                        "jc 1f\n\t"
                        "xor %%ah, %%ah\n"
                        "1:"
-@@ -215,7 +268,8 @@ static int pci_bios_read(unsigned int se
+@@ -215,7 +268,8 @@ static int pci_bios_read(unsigned int seg, unsigned int bus,
                        : "1" (PCIBIOS_READ_CONFIG_WORD),
                          "b" (bx),
                          "D" ((long)reg),
@@ -22363,7 +23950,7 @@ diff -urNp linux-3.1.3/arch/x86/pci/pcbios.c linux-3.1.3/arch/x86/pci/pcbios.c
                /*
                 * Zero-extend the result beyond 16 bits, do not trust the
                 * BIOS having done it:
-@@ -223,7 +277,10 @@ static int pci_bios_read(unsigned int se
+@@ -223,7 +277,10 @@ static int pci_bios_read(unsigned int seg, unsigned int bus,
                *value &= 0xffff;
                break;
        case 4:
@@ -22375,7 +23962,7 @@ diff -urNp linux-3.1.3/arch/x86/pci/pcbios.c linux-3.1.3/arch/x86/pci/pcbios.c
                        "jc 1f\n\t"
                        "xor %%ah, %%ah\n"
                        "1:"
-@@ -232,7 +289,8 @@ static int pci_bios_read(unsigned int se
+@@ -232,7 +289,8 @@ static int pci_bios_read(unsigned int seg, unsigned int bus,
                        : "1" (PCIBIOS_READ_CONFIG_DWORD),
                          "b" (bx),
                          "D" ((long)reg),
@@ -22385,7 +23972,7 @@ diff -urNp linux-3.1.3/arch/x86/pci/pcbios.c linux-3.1.3/arch/x86/pci/pcbios.c
                break;
        }
  
-@@ -256,7 +314,10 @@ static int pci_bios_write(unsigned int s
+@@ -256,7 +314,10 @@ static int pci_bios_write(unsigned int seg, unsigned int bus,
  
        switch (len) {
        case 1:
@@ -22397,7 +23984,7 @@ diff -urNp linux-3.1.3/arch/x86/pci/pcbios.c linux-3.1.3/arch/x86/pci/pcbios.c
                        "jc 1f\n\t"
                        "xor %%ah, %%ah\n"
                        "1:"
-@@ -265,10 +326,14 @@ static int pci_bios_write(unsigned int s
+@@ -265,10 +326,14 @@ static int pci_bios_write(unsigned int seg, unsigned int bus,
                          "c" (value),
                          "b" (bx),
                          "D" ((long)reg),
@@ -22414,7 +24001,7 @@ diff -urNp linux-3.1.3/arch/x86/pci/pcbios.c linux-3.1.3/arch/x86/pci/pcbios.c
                        "jc 1f\n\t"
                        "xor %%ah, %%ah\n"
                        "1:"
-@@ -277,10 +342,14 @@ static int pci_bios_write(unsigned int s
+@@ -277,10 +342,14 @@ static int pci_bios_write(unsigned int seg, unsigned int bus,
                          "c" (value),
                          "b" (bx),
                          "D" ((long)reg),
@@ -22431,7 +24018,7 @@ diff -urNp linux-3.1.3/arch/x86/pci/pcbios.c linux-3.1.3/arch/x86/pci/pcbios.c
                        "jc 1f\n\t"
                        "xor %%ah, %%ah\n"
                        "1:"
-@@ -289,7 +358,8 @@ static int pci_bios_write(unsigned int s
+@@ -289,7 +358,8 @@ static int pci_bios_write(unsigned int seg, unsigned int bus,
                          "c" (value),
                          "b" (bx),
                          "D" ((long)reg),
@@ -22441,7 +24028,7 @@ diff -urNp linux-3.1.3/arch/x86/pci/pcbios.c linux-3.1.3/arch/x86/pci/pcbios.c
                break;
        }
  
-@@ -394,10 +464,13 @@ struct irq_routing_table * pcibios_get_i
+@@ -394,10 +464,13 @@ struct irq_routing_table * pcibios_get_irq_routing_table(void)
  
        DBG("PCI: Fetching IRQ routing table... ");
        __asm__("push %%es\n\t"
@@ -22456,7 +24043,7 @@ diff -urNp linux-3.1.3/arch/x86/pci/pcbios.c linux-3.1.3/arch/x86/pci/pcbios.c
                "jc 1f\n\t"
                "xor %%ah, %%ah\n"
                "1:"
-@@ -408,7 +481,8 @@ struct irq_routing_table * pcibios_get_i
+@@ -408,7 +481,8 @@ struct irq_routing_table * pcibios_get_irq_routing_table(void)
                  "1" (0),
                  "D" ((long) &opt),
                  "S" (&pci_indirect),
@@ -22466,7 +24053,7 @@ diff -urNp linux-3.1.3/arch/x86/pci/pcbios.c linux-3.1.3/arch/x86/pci/pcbios.c
                : "memory");
        DBG("OK  ret=%d, size=%d, map=%x\n", ret, opt.size, map);
        if (ret & 0xff00)
-@@ -432,7 +506,10 @@ int pcibios_set_irq_routing(struct pci_d
+@@ -432,7 +506,10 @@ int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq)
  {
        int ret;
  
@@ -22478,7 +24065,7 @@ diff -urNp linux-3.1.3/arch/x86/pci/pcbios.c linux-3.1.3/arch/x86/pci/pcbios.c
                "jc 1f\n\t"
                "xor %%ah, %%ah\n"
                "1:"
-@@ -440,7 +517,8 @@ int pcibios_set_irq_routing(struct pci_d
+@@ -440,7 +517,8 @@ int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq)
                : "0" (PCIBIOS_SET_PCI_HW_INT),
                  "b" ((dev->bus->number << 8) | dev->devfn),
                  "c" ((irq << 8) | (pin + 10)),
@@ -22488,9 +24075,10 @@ diff -urNp linux-3.1.3/arch/x86/pci/pcbios.c linux-3.1.3/arch/x86/pci/pcbios.c
        return !(ret & 0xff00);
  }
  EXPORT_SYMBOL(pcibios_set_irq_routing);
-diff -urNp linux-3.1.3/arch/x86/platform/efi/efi_32.c linux-3.1.3/arch/x86/platform/efi/efi_32.c
---- linux-3.1.3/arch/x86/platform/efi/efi_32.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/platform/efi/efi_32.c 2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/platform/efi/efi_32.c b/arch/x86/platform/efi/efi_32.c
+index 5cab48e..b025f9b 100644
+--- a/arch/x86/platform/efi/efi_32.c
++++ b/arch/x86/platform/efi/efi_32.c
 @@ -38,70 +38,56 @@
   */
  
@@ -22505,10 +24093,11 @@ diff -urNp linux-3.1.3/arch/x86/platform/efi/efi_32.c linux-3.1.3/arch/x86/platf
 -      unsigned long temp;
        struct desc_ptr gdt_descr;
  
--      local_irq_save(efi_rt_eflags);
 +#ifdef CONFIG_PAX_KERNEXEC
 +      struct desc_struct d;
 +#endif
++
+       local_irq_save(efi_rt_eflags);
  
 -      /*
 -       * If I don't have PAE, I should just duplicate two entries in page
@@ -22516,8 +24105,7 @@ diff -urNp linux-3.1.3/arch/x86/platform/efi/efi_32.c linux-3.1.3/arch/x86/platf
 -       * page directory.
 -       */
 -      cr4 = read_cr4_safe();
-+      local_irq_save(efi_rt_eflags);
+-
 -      if (cr4 & X86_CR4_PAE) {
 -              efi_bak_pg_dir_pointer[0].pgd =
 -                  swapper_pg_dir[pgd_index(0)].pgd;
@@ -22588,9 +24176,10 @@ diff -urNp linux-3.1.3/arch/x86/platform/efi/efi_32.c linux-3.1.3/arch/x86/platf
  
        /*
         * After the lock is released, the original page table is restored.
-diff -urNp linux-3.1.3/arch/x86/platform/efi/efi_stub_32.S linux-3.1.3/arch/x86/platform/efi/efi_stub_32.S
---- linux-3.1.3/arch/x86/platform/efi/efi_stub_32.S    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/platform/efi/efi_stub_32.S    2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/platform/efi/efi_stub_32.S b/arch/x86/platform/efi/efi_stub_32.S
+index fbe66e6..c5c0dd2 100644
+--- a/arch/x86/platform/efi/efi_stub_32.S
++++ b/arch/x86/platform/efi/efi_stub_32.S
 @@ -6,7 +6,9 @@
   */
  
@@ -22699,9 +24288,10 @@ diff -urNp linux-3.1.3/arch/x86/platform/efi/efi_stub_32.S linux-3.1.3/arch/x86/
  saved_return_addr:
        .long 0
  efi_rt_function_ptr:
-diff -urNp linux-3.1.3/arch/x86/platform/efi/efi_stub_64.S linux-3.1.3/arch/x86/platform/efi/efi_stub_64.S
---- linux-3.1.3/arch/x86/platform/efi/efi_stub_64.S    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/platform/efi/efi_stub_64.S    2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/platform/efi/efi_stub_64.S b/arch/x86/platform/efi/efi_stub_64.S
+index 4c07cca..2c8427d 100644
+--- a/arch/x86/platform/efi/efi_stub_64.S
++++ b/arch/x86/platform/efi/efi_stub_64.S
 @@ -7,6 +7,7 @@
   */
  
@@ -22714,7 +24304,7 @@ diff -urNp linux-3.1.3/arch/x86/platform/efi/efi_stub_64.S linux-3.1.3/arch/x86/
        call *%rdi
        addq $32, %rsp
        RESTORE_XMM
-+      pax_force_retaddr
++      pax_force_retaddr 0, 1
        ret
  ENDPROC(efi_call0)
  
@@ -22722,7 +24312,7 @@ diff -urNp linux-3.1.3/arch/x86/platform/efi/efi_stub_64.S linux-3.1.3/arch/x86/
        call *%rdi
        addq $32, %rsp
        RESTORE_XMM
-+      pax_force_retaddr
++      pax_force_retaddr 0, 1
        ret
  ENDPROC(efi_call1)
  
@@ -22730,7 +24320,7 @@ diff -urNp linux-3.1.3/arch/x86/platform/efi/efi_stub_64.S linux-3.1.3/arch/x86/
        call *%rdi
        addq $32, %rsp
        RESTORE_XMM
-+      pax_force_retaddr
++      pax_force_retaddr 0, 1
        ret
  ENDPROC(efi_call2)
  
@@ -22738,7 +24328,7 @@ diff -urNp linux-3.1.3/arch/x86/platform/efi/efi_stub_64.S linux-3.1.3/arch/x86/
        call *%rdi
        addq $32, %rsp
        RESTORE_XMM
-+      pax_force_retaddr
++      pax_force_retaddr 0, 1
        ret
  ENDPROC(efi_call3)
  
@@ -22746,7 +24336,7 @@ diff -urNp linux-3.1.3/arch/x86/platform/efi/efi_stub_64.S linux-3.1.3/arch/x86/
        call *%rdi
        addq $32, %rsp
        RESTORE_XMM
-+      pax_force_retaddr
++      pax_force_retaddr 0, 1
        ret
  ENDPROC(efi_call4)
  
@@ -22754,7 +24344,7 @@ diff -urNp linux-3.1.3/arch/x86/platform/efi/efi_stub_64.S linux-3.1.3/arch/x86/
        call *%rdi
        addq $48, %rsp
        RESTORE_XMM
-+      pax_force_retaddr
++      pax_force_retaddr 0, 1
        ret
  ENDPROC(efi_call5)
  
@@ -22762,12 +24352,13 @@ diff -urNp linux-3.1.3/arch/x86/platform/efi/efi_stub_64.S linux-3.1.3/arch/x86/
        call *%rdi
        addq $48, %rsp
        RESTORE_XMM
-+      pax_force_retaddr
++      pax_force_retaddr 0, 1
        ret
  ENDPROC(efi_call6)
-diff -urNp linux-3.1.3/arch/x86/platform/mrst/mrst.c linux-3.1.3/arch/x86/platform/mrst/mrst.c
---- linux-3.1.3/arch/x86/platform/mrst/mrst.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/platform/mrst/mrst.c  2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/platform/mrst/mrst.c b/arch/x86/platform/mrst/mrst.c
+index fe73276..70fe25a 100644
+--- a/arch/x86/platform/mrst/mrst.c
++++ b/arch/x86/platform/mrst/mrst.c
 @@ -239,14 +239,16 @@ static int mrst_i8042_detect(void)
  }
  
@@ -22787,10 +24378,11 @@ diff -urNp linux-3.1.3/arch/x86/platform/mrst/mrst.c linux-3.1.3/arch/x86/platfo
  }
  
  /*
-diff -urNp linux-3.1.3/arch/x86/platform/uv/tlb_uv.c linux-3.1.3/arch/x86/platform/uv/tlb_uv.c
---- linux-3.1.3/arch/x86/platform/uv/tlb_uv.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/platform/uv/tlb_uv.c  2011-11-16 19:39:11.000000000 -0500
-@@ -377,6 +377,8 @@ static void reset_with_ipi(struct pnmask
+diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c
+index 5b55219..b326540 100644
+--- a/arch/x86/platform/uv/tlb_uv.c
++++ b/arch/x86/platform/uv/tlb_uv.c
+@@ -377,6 +377,8 @@ static void reset_with_ipi(struct pnmask *distribution, struct bau_control *bcp)
        struct bau_control *smaster = bcp->socket_master;
        struct reset_args reset_args;
  
@@ -22799,9 +24391,10 @@ diff -urNp linux-3.1.3/arch/x86/platform/uv/tlb_uv.c linux-3.1.3/arch/x86/platfo
        reset_args.sender = sender;
        cpus_clear(*mask);
        /* find a single cpu for each uvhub in this distribution mask */
-diff -urNp linux-3.1.3/arch/x86/power/cpu.c linux-3.1.3/arch/x86/power/cpu.c
---- linux-3.1.3/arch/x86/power/cpu.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/power/cpu.c   2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c
+index 87bb35e..eff2da8 100644
+--- a/arch/x86/power/cpu.c
++++ b/arch/x86/power/cpu.c
 @@ -130,7 +130,7 @@ static void do_fpu_end(void)
  static void fix_processor_context(void)
  {
@@ -22821,9 +24414,10 @@ diff -urNp linux-3.1.3/arch/x86/power/cpu.c linux-3.1.3/arch/x86/power/cpu.c
  
        syscall_init();                         /* This sets MSR_*STAR and related */
  #endif
-diff -urNp linux-3.1.3/arch/x86/vdso/Makefile linux-3.1.3/arch/x86/vdso/Makefile
---- linux-3.1.3/arch/x86/vdso/Makefile 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/vdso/Makefile 2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/vdso/Makefile b/arch/x86/vdso/Makefile
+index 5d17950..2253fc9 100644
+--- a/arch/x86/vdso/Makefile
++++ b/arch/x86/vdso/Makefile
 @@ -137,7 +137,7 @@ quiet_cmd_vdso = VDSO    $@
                       -Wl,-T,$(filter %.lds,$^) $(filter %.o,$^) && \
                 sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@'
@@ -22833,9 +24427,10 @@ diff -urNp linux-3.1.3/arch/x86/vdso/Makefile linux-3.1.3/arch/x86/vdso/Makefile
  GCOV_PROFILE := n
  
  #
-diff -urNp linux-3.1.3/arch/x86/vdso/vdso32-setup.c linux-3.1.3/arch/x86/vdso/vdso32-setup.c
---- linux-3.1.3/arch/x86/vdso/vdso32-setup.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/vdso/vdso32-setup.c   2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/vdso/vdso32-setup.c b/arch/x86/vdso/vdso32-setup.c
+index 468d591..8e80a0a 100644
+--- a/arch/x86/vdso/vdso32-setup.c
++++ b/arch/x86/vdso/vdso32-setup.c
 @@ -25,6 +25,7 @@
  #include <asm/tlbflush.h>
  #include <asm/vdso.h>
@@ -22844,7 +24439,7 @@ diff -urNp linux-3.1.3/arch/x86/vdso/vdso32-setup.c linux-3.1.3/arch/x86/vdso/vd
  
  enum {
        VDSO_DISABLED = 0,
-@@ -226,7 +227,7 @@ static inline void map_compat_vdso(int m
+@@ -226,7 +227,7 @@ static inline void map_compat_vdso(int map)
  void enable_sep_cpu(void)
  {
        int cpu = get_cpu();
@@ -22862,7 +24457,7 @@ diff -urNp linux-3.1.3/arch/x86/vdso/vdso32-setup.c linux-3.1.3/arch/x86/vdso/vd
        /*
         * Make sure the vDSO gets into every core dump.
         * Dumping its contents makes post-mortem fully interpretable later
-@@ -331,14 +332,14 @@ int arch_setup_additional_pages(struct l
+@@ -331,14 +332,14 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
        if (compat)
                addr = VDSO_HIGH_BASE;
        else {
@@ -22879,7 +24474,7 @@ diff -urNp linux-3.1.3/arch/x86/vdso/vdso32-setup.c linux-3.1.3/arch/x86/vdso/vd
  
        if (compat_uses_vma || !compat) {
                /*
-@@ -361,11 +362,11 @@ int arch_setup_additional_pages(struct l
+@@ -361,11 +362,11 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
        }
  
        current_thread_info()->sysenter_return =
@@ -22909,7 +24504,7 @@ diff -urNp linux-3.1.3/arch/x86/vdso/vdso32-setup.c linux-3.1.3/arch/x86/vdso/vd
        return NULL;
  }
  
-@@ -423,7 +430,7 @@ struct vm_area_struct *get_gate_vma(stru
+@@ -423,7 +430,7 @@ struct vm_area_struct *get_gate_vma(struct mm_struct *mm)
         * Check to see if the corresponding task was created in compat vdso
         * mode.
         */
@@ -22918,9 +24513,10 @@ diff -urNp linux-3.1.3/arch/x86/vdso/vdso32-setup.c linux-3.1.3/arch/x86/vdso/vd
                return &gate_vma;
        return NULL;
  }
-diff -urNp linux-3.1.3/arch/x86/vdso/vma.c linux-3.1.3/arch/x86/vdso/vma.c
---- linux-3.1.3/arch/x86/vdso/vma.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/vdso/vma.c    2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/vdso/vma.c b/arch/x86/vdso/vma.c
+index 316fbca..4638633 100644
+--- a/arch/x86/vdso/vma.c
++++ b/arch/x86/vdso/vma.c
 @@ -16,8 +16,6 @@
  #include <asm/vdso.h>
  #include <asm/page.h>
@@ -22930,7 +24526,7 @@ diff -urNp linux-3.1.3/arch/x86/vdso/vma.c linux-3.1.3/arch/x86/vdso/vma.c
  extern char vdso_start[], vdso_end[];
  extern unsigned short vdso_sync_cpuid;
  
-@@ -97,13 +95,15 @@ static unsigned long vdso_addr(unsigned 
+@@ -97,13 +95,15 @@ static unsigned long vdso_addr(unsigned long start, unsigned len)
  int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
  {
        struct mm_struct *mm = current->mm;
@@ -22950,7 +24546,7 @@ diff -urNp linux-3.1.3/arch/x86/vdso/vma.c linux-3.1.3/arch/x86/vdso/vma.c
        addr = vdso_addr(mm->start_stack, vdso_size);
        addr = get_unmapped_area(NULL, addr, vdso_size, 0, 0);
        if (IS_ERR_VALUE(addr)) {
-@@ -111,26 +111,18 @@ int arch_setup_additional_pages(struct l
+@@ -111,26 +111,18 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
                goto up_fail;
        }
  
@@ -22981,9 +24577,10 @@ diff -urNp linux-3.1.3/arch/x86/vdso/vma.c linux-3.1.3/arch/x86/vdso/vma.c
 -      return 0;
 -}
 -__setup("vdso=", vdso_setup);
-diff -urNp linux-3.1.3/arch/x86/xen/enlighten.c linux-3.1.3/arch/x86/xen/enlighten.c
---- linux-3.1.3/arch/x86/xen/enlighten.c       2011-11-26 19:57:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/xen/enlighten.c       2011-11-26 19:58:40.000000000 -0500
+diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
+index 46c8069..6330d3c 100644
+--- a/arch/x86/xen/enlighten.c
++++ b/arch/x86/xen/enlighten.c
 @@ -85,8 +85,6 @@ EXPORT_SYMBOL_GPL(xen_start_info);
  
  struct shared_info xen_dummy_shared_info;
@@ -22993,7 +24590,7 @@ diff -urNp linux-3.1.3/arch/x86/xen/enlighten.c linux-3.1.3/arch/x86/xen/enlight
  RESERVE_BRK(shared_info_page_brk, PAGE_SIZE);
  __read_mostly int xen_have_vector_callback;
  EXPORT_SYMBOL_GPL(xen_have_vector_callback);
-@@ -1028,7 +1026,7 @@ static const struct pv_apic_ops xen_apic
+@@ -1028,7 +1026,7 @@ static const struct pv_apic_ops xen_apic_ops __initconst = {
  #endif
  };
  
@@ -23023,7 +24620,7 @@ diff -urNp linux-3.1.3/arch/x86/xen/enlighten.c linux-3.1.3/arch/x86/xen/enlight
  {
        xen_reboot(SHUTDOWN_poweroff);
  }
-@@ -1152,7 +1150,17 @@ asmlinkage void __init xen_start_kernel(
+@@ -1152,7 +1150,17 @@ asmlinkage void __init xen_start_kernel(void)
        __userpte_alloc_gfp &= ~__GFP_HIGHMEM;
  
        /* Work out if we support NX */
@@ -23042,7 +24639,7 @@ diff -urNp linux-3.1.3/arch/x86/xen/enlighten.c linux-3.1.3/arch/x86/xen/enlight
  
        xen_setup_features();
  
-@@ -1183,13 +1191,6 @@ asmlinkage void __init xen_start_kernel(
+@@ -1183,13 +1191,6 @@ asmlinkage void __init xen_start_kernel(void)
  
        machine_ops = xen_machine_ops;
  
@@ -23056,30 +24653,33 @@ diff -urNp linux-3.1.3/arch/x86/xen/enlighten.c linux-3.1.3/arch/x86/xen/enlight
        xen_smp_init();
  
  #ifdef CONFIG_ACPI_NUMA
-diff -urNp linux-3.1.3/arch/x86/xen/mmu.c linux-3.1.3/arch/x86/xen/mmu.c
---- linux-3.1.3/arch/x86/xen/mmu.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/xen/mmu.c     2011-11-16 18:39:07.000000000 -0500
-@@ -1768,6 +1768,8 @@ pgd_t * __init xen_setup_kernel_pagetabl
+diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
+index 3dd53f9..5aa5df3 100644
+--- a/arch/x86/xen/mmu.c
++++ b/arch/x86/xen/mmu.c
+@@ -1768,6 +1768,9 @@ pgd_t * __init xen_setup_kernel_pagetable(pgd_t *pgd,
        convert_pfn_mfn(init_level4_pgt);
        convert_pfn_mfn(level3_ident_pgt);
        convert_pfn_mfn(level3_kernel_pgt);
-+      convert_pfn_mfn(level3_vmalloc_pgt);
++      convert_pfn_mfn(level3_vmalloc_start_pgt);
++      convert_pfn_mfn(level3_vmalloc_end_pgt);
 +      convert_pfn_mfn(level3_vmemmap_pgt);
  
        l3 = m2v(pgd[pgd_index(__START_KERNEL_map)].pgd);
        l2 = m2v(l3[pud_index(__START_KERNEL_map)].pud);
-@@ -1786,7 +1788,10 @@ pgd_t * __init xen_setup_kernel_pagetabl
+@@ -1786,7 +1789,11 @@ pgd_t * __init xen_setup_kernel_pagetable(pgd_t *pgd,
        set_page_prot(init_level4_pgt, PAGE_KERNEL_RO);
        set_page_prot(level3_ident_pgt, PAGE_KERNEL_RO);
        set_page_prot(level3_kernel_pgt, PAGE_KERNEL_RO);
-+      set_page_prot(level3_vmalloc_pgt, PAGE_KERNEL_RO);
++      set_page_prot(level3_vmalloc_start_pgt, PAGE_KERNEL_RO);
++      set_page_prot(level3_vmalloc_end_pgt, PAGE_KERNEL_RO);
 +      set_page_prot(level3_vmemmap_pgt, PAGE_KERNEL_RO);
        set_page_prot(level3_user_vsyscall, PAGE_KERNEL_RO);
 +      set_page_prot(level2_vmemmap_pgt, PAGE_KERNEL_RO);
        set_page_prot(level2_kernel_pgt, PAGE_KERNEL_RO);
        set_page_prot(level2_fixmap_pgt, PAGE_KERNEL_RO);
  
-@@ -2000,6 +2005,7 @@ static void __init xen_post_allocator_in
+@@ -2000,6 +2007,7 @@ static void __init xen_post_allocator_init(void)
        pv_mmu_ops.set_pud = xen_set_pud;
  #if PAGETABLE_LEVELS == 4
        pv_mmu_ops.set_pgd = xen_set_pgd;
@@ -23087,7 +24687,7 @@ diff -urNp linux-3.1.3/arch/x86/xen/mmu.c linux-3.1.3/arch/x86/xen/mmu.c
  #endif
  
        /* This will work as long as patching hasn't happened yet
-@@ -2081,6 +2087,7 @@ static const struct pv_mmu_ops xen_mmu_o
+@@ -2081,6 +2089,7 @@ static const struct pv_mmu_ops xen_mmu_ops __initconst = {
        .pud_val = PV_CALLEE_SAVE(xen_pud_val),
        .make_pud = PV_CALLEE_SAVE(xen_make_pud),
        .set_pgd = xen_set_pgd_hyper,
@@ -23095,10 +24695,11 @@ diff -urNp linux-3.1.3/arch/x86/xen/mmu.c linux-3.1.3/arch/x86/xen/mmu.c
  
        .alloc_pud = xen_alloc_pmd_init,
        .release_pud = xen_release_pmd_init,
-diff -urNp linux-3.1.3/arch/x86/xen/smp.c linux-3.1.3/arch/x86/xen/smp.c
---- linux-3.1.3/arch/x86/xen/smp.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/xen/smp.c     2011-11-16 18:39:07.000000000 -0500
-@@ -194,11 +194,6 @@ static void __init xen_smp_prepare_boot_
+diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
+index 041d4fe..7666b7e 100644
+--- a/arch/x86/xen/smp.c
++++ b/arch/x86/xen/smp.c
+@@ -194,11 +194,6 @@ static void __init xen_smp_prepare_boot_cpu(void)
  {
        BUG_ON(smp_processor_id() != 0);
        native_smp_prepare_boot_cpu();
@@ -23110,7 +24711,7 @@ diff -urNp linux-3.1.3/arch/x86/xen/smp.c linux-3.1.3/arch/x86/xen/smp.c
        xen_filter_cpu_maps();
        xen_setup_vcpu_info_placement();
  }
-@@ -275,12 +270,12 @@ cpu_initialize_context(unsigned int cpu,
+@@ -275,12 +270,12 @@ cpu_initialize_context(unsigned int cpu, struct task_struct *idle)
        gdt = get_cpu_gdt_table(cpu);
  
        ctxt->flags = VGCF_IN_KERNEL;
@@ -23126,7 +24727,7 @@ diff -urNp linux-3.1.3/arch/x86/xen/smp.c linux-3.1.3/arch/x86/xen/smp.c
  #else
        ctxt->gs_base_kernel = per_cpu_offset(cpu);
  #endif
-@@ -331,13 +326,12 @@ static int __cpuinit xen_cpu_up(unsigned
+@@ -331,13 +326,12 @@ static int __cpuinit xen_cpu_up(unsigned int cpu)
        int rc;
  
        per_cpu(current_task, cpu) = idle;
@@ -23142,9 +24743,10 @@ diff -urNp linux-3.1.3/arch/x86/xen/smp.c linux-3.1.3/arch/x86/xen/smp.c
  #endif
        xen_setup_runstate_info(cpu);
        xen_setup_timer(cpu);
-diff -urNp linux-3.1.3/arch/x86/xen/xen-asm_32.S linux-3.1.3/arch/x86/xen/xen-asm_32.S
---- linux-3.1.3/arch/x86/xen/xen-asm_32.S      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/xen/xen-asm_32.S      2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/xen/xen-asm_32.S b/arch/x86/xen/xen-asm_32.S
+index b040b0e..8cc4fe0 100644
+--- a/arch/x86/xen/xen-asm_32.S
++++ b/arch/x86/xen/xen-asm_32.S
 @@ -83,14 +83,14 @@ ENTRY(xen_iret)
        ESP_OFFSET=4    # bytes pushed onto stack
  
@@ -23166,9 +24768,10 @@ diff -urNp linux-3.1.3/arch/x86/xen/xen-asm_32.S linux-3.1.3/arch/x86/xen/xen-as
  #else
        movl xen_vcpu, %eax
  #endif
-diff -urNp linux-3.1.3/arch/x86/xen/xen-head.S linux-3.1.3/arch/x86/xen/xen-head.S
---- linux-3.1.3/arch/x86/xen/xen-head.S        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/xen/xen-head.S        2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S
+index aaa7291..3f77960 100644
+--- a/arch/x86/xen/xen-head.S
++++ b/arch/x86/xen/xen-head.S
 @@ -19,6 +19,17 @@ ENTRY(startup_xen)
  #ifdef CONFIG_X86_32
        mov %esi,xen_start_info
@@ -23187,9 +24790,10 @@ diff -urNp linux-3.1.3/arch/x86/xen/xen-head.S linux-3.1.3/arch/x86/xen/xen-head
  #else
        mov %rsi,xen_start_info
        mov $init_thread_union+THREAD_SIZE,%rsp
-diff -urNp linux-3.1.3/arch/x86/xen/xen-ops.h linux-3.1.3/arch/x86/xen/xen-ops.h
---- linux-3.1.3/arch/x86/xen/xen-ops.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/arch/x86/xen/xen-ops.h 2011-11-16 18:39:07.000000000 -0500
+diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h
+index b095739..8c17bcd 100644
+--- a/arch/x86/xen/xen-ops.h
++++ b/arch/x86/xen/xen-ops.h
 @@ -10,8 +10,6 @@
  extern const char xen_hypervisor_callback[];
  extern const char xen_failsafe_callback[];
@@ -23199,10 +24803,11 @@ diff -urNp linux-3.1.3/arch/x86/xen/xen-ops.h linux-3.1.3/arch/x86/xen/xen-ops.h
  struct trap_info;
  void xen_copy_trap_info(struct trap_info *traps);
  
-diff -urNp linux-3.1.3/block/blk-iopoll.c linux-3.1.3/block/blk-iopoll.c
---- linux-3.1.3/block/blk-iopoll.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/block/blk-iopoll.c     2011-11-16 18:39:07.000000000 -0500
-@@ -77,7 +77,7 @@ void blk_iopoll_complete(struct blk_iopo
+diff --git a/block/blk-iopoll.c b/block/blk-iopoll.c
+index 58916af..9cb880b 100644
+--- a/block/blk-iopoll.c
++++ b/block/blk-iopoll.c
+@@ -77,7 +77,7 @@ void blk_iopoll_complete(struct blk_iopoll *iopoll)
  }
  EXPORT_SYMBOL(blk_iopoll_complete);
  
@@ -23211,10 +24816,11 @@ diff -urNp linux-3.1.3/block/blk-iopoll.c linux-3.1.3/block/blk-iopoll.c
  {
        struct list_head *list = &__get_cpu_var(blk_cpu_iopoll);
        int rearm = 0, budget = blk_iopoll_budget;
-diff -urNp linux-3.1.3/block/blk-map.c linux-3.1.3/block/blk-map.c
---- linux-3.1.3/block/blk-map.c        2011-11-26 19:57:27.000000000 -0500
-+++ linux-3.1.3/block/blk-map.c        2011-11-26 19:58:40.000000000 -0500
-@@ -302,7 +302,7 @@ int blk_rq_map_kern(struct request_queue
+diff --git a/block/blk-map.c b/block/blk-map.c
+index 164cd00..6d96fc1 100644
+--- a/block/blk-map.c
++++ b/block/blk-map.c
+@@ -302,7 +302,7 @@ int blk_rq_map_kern(struct request_queue *q, struct request *rq, void *kbuf,
        if (!len || !kbuf)
                return -EINVAL;
  
@@ -23223,10 +24829,11 @@ diff -urNp linux-3.1.3/block/blk-map.c linux-3.1.3/block/blk-map.c
        if (do_copy)
                bio = bio_copy_kern(q, kbuf, len, gfp_mask, reading);
        else
-diff -urNp linux-3.1.3/block/blk-softirq.c linux-3.1.3/block/blk-softirq.c
---- linux-3.1.3/block/blk-softirq.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/block/blk-softirq.c    2011-11-16 18:39:07.000000000 -0500
-@@ -17,7 +17,7 @@ static DEFINE_PER_CPU(struct list_head, 
+diff --git a/block/blk-softirq.c b/block/blk-softirq.c
+index 1366a89..e17f54b 100644
+--- a/block/blk-softirq.c
++++ b/block/blk-softirq.c
+@@ -17,7 +17,7 @@ static DEFINE_PER_CPU(struct list_head, blk_cpu_done);
   * Softirq action handler - move entries to local list and loop over them
   * while passing them to the queue registered handler.
   */
@@ -23235,10 +24842,11 @@ diff -urNp linux-3.1.3/block/blk-softirq.c linux-3.1.3/block/blk-softirq.c
  {
        struct list_head *cpu_list, local_list;
  
-diff -urNp linux-3.1.3/block/bsg.c linux-3.1.3/block/bsg.c
---- linux-3.1.3/block/bsg.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/block/bsg.c    2011-11-16 18:39:07.000000000 -0500
-@@ -176,16 +176,24 @@ static int blk_fill_sgv4_hdr_rq(struct r
+diff --git a/block/bsg.c b/block/bsg.c
+index 702f131..37808bf 100644
+--- a/block/bsg.c
++++ b/block/bsg.c
+@@ -176,16 +176,24 @@ static int blk_fill_sgv4_hdr_rq(struct request_queue *q, struct request *rq,
                                struct sg_io_v4 *hdr, struct bsg_device *bd,
                                fmode_t has_write_perm)
  {
@@ -23265,10 +24873,11 @@ diff -urNp linux-3.1.3/block/bsg.c linux-3.1.3/block/bsg.c
        if (hdr->subprotocol == BSG_SUB_PROTOCOL_SCSI_CMD) {
                if (blk_verify_command(rq->cmd, has_write_perm))
                        return -EPERM;
-diff -urNp linux-3.1.3/block/compat_ioctl.c linux-3.1.3/block/compat_ioctl.c
---- linux-3.1.3/block/compat_ioctl.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/block/compat_ioctl.c   2011-11-16 18:39:07.000000000 -0500
-@@ -340,7 +340,7 @@ static int compat_fd_ioctl(struct block_
+diff --git a/block/compat_ioctl.c b/block/compat_ioctl.c
+index 7b72502..646105c 100644
+--- a/block/compat_ioctl.c
++++ b/block/compat_ioctl.c
+@@ -340,7 +340,7 @@ static int compat_fd_ioctl(struct block_device *bdev, fmode_t mode,
                err |= __get_user(f->spec1, &uf->spec1);
                err |= __get_user(f->fmt_gap, &uf->fmt_gap);
                err |= __get_user(name, &uf->name);
@@ -23277,9 +24886,10 @@ diff -urNp linux-3.1.3/block/compat_ioctl.c linux-3.1.3/block/compat_ioctl.c
                if (err) {
                        err = -EFAULT;
                        goto out;
-diff -urNp linux-3.1.3/block/scsi_ioctl.c linux-3.1.3/block/scsi_ioctl.c
---- linux-3.1.3/block/scsi_ioctl.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/block/scsi_ioctl.c     2011-11-16 18:39:07.000000000 -0500
+diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
+index 4f4230b..0feae9a 100644
+--- a/block/scsi_ioctl.c
++++ b/block/scsi_ioctl.c
 @@ -222,8 +222,20 @@ EXPORT_SYMBOL(blk_verify_command);
  static int blk_fill_sghdr_rq(struct request_queue *q, struct request *rq,
                             struct sg_io_hdr *hdr, fmode_t mode)
@@ -23302,7 +24912,7 @@ diff -urNp linux-3.1.3/block/scsi_ioctl.c linux-3.1.3/block/scsi_ioctl.c
        if (blk_verify_command(rq->cmd, mode & FMODE_WRITE))
                return -EPERM;
  
-@@ -432,6 +444,8 @@ int sg_scsi_ioctl(struct request_queue *
+@@ -432,6 +444,8 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode,
        int err;
        unsigned int in_len, out_len, bytes, opcode, cmdlen;
        char *buffer = NULL, sense[SCSI_SENSE_BUFFERSIZE];
@@ -23311,7 +24921,7 @@ diff -urNp linux-3.1.3/block/scsi_ioctl.c linux-3.1.3/block/scsi_ioctl.c
  
        if (!sic)
                return -EINVAL;
-@@ -465,9 +479,18 @@ int sg_scsi_ioctl(struct request_queue *
+@@ -465,9 +479,18 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode,
         */
        err = -EFAULT;
        rq->cmd_len = cmdlen;
@@ -23331,9 +24941,10 @@ diff -urNp linux-3.1.3/block/scsi_ioctl.c linux-3.1.3/block/scsi_ioctl.c
        if (in_len && copy_from_user(buffer, sic->data + cmdlen, in_len))
                goto error;
  
-diff -urNp linux-3.1.3/crypto/cryptd.c linux-3.1.3/crypto/cryptd.c
---- linux-3.1.3/crypto/cryptd.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/crypto/cryptd.c        2011-11-16 18:39:07.000000000 -0500
+diff --git a/crypto/cryptd.c b/crypto/cryptd.c
+index 671d4d6..5f24030 100644
+--- a/crypto/cryptd.c
++++ b/crypto/cryptd.c
 @@ -63,7 +63,7 @@ struct cryptd_blkcipher_ctx {
  
  struct cryptd_blkcipher_request_ctx {
@@ -23352,10 +24963,11 @@ diff -urNp linux-3.1.3/crypto/cryptd.c linux-3.1.3/crypto/cryptd.c
  
  static void cryptd_queue_worker(struct work_struct *work);
  
-diff -urNp linux-3.1.3/crypto/serpent.c linux-3.1.3/crypto/serpent.c
---- linux-3.1.3/crypto/serpent.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/crypto/serpent.c       2011-11-16 18:40:10.000000000 -0500
-@@ -224,6 +224,8 @@ static int serpent_setkey(struct crypto_
+diff --git a/crypto/serpent.c b/crypto/serpent.c
+index b651a55..a9ddd79b 100644
+--- a/crypto/serpent.c
++++ b/crypto/serpent.c
+@@ -224,6 +224,8 @@ static int serpent_setkey(struct crypto_tfm *tfm, const u8 *key,
        u32 r0,r1,r2,r3,r4;
        int i;
  
@@ -23364,184 +24976,10 @@ diff -urNp linux-3.1.3/crypto/serpent.c linux-3.1.3/crypto/serpent.c
        /* Copy key, add padding */
  
        for (i = 0; i < keylen; ++i)
-diff -urNp linux-3.1.3/Documentation/dontdiff linux-3.1.3/Documentation/dontdiff
---- linux-3.1.3/Documentation/dontdiff 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/Documentation/dontdiff 2011-11-16 18:39:07.000000000 -0500
-@@ -5,6 +5,7 @@
- *.cis
- *.cpio
- *.csp
-+*.dbg
- *.dsp
- *.dvi
- *.elf
-@@ -48,9 +49,11 @@
- *.tab.h
- *.tex
- *.ver
-+*.vim
- *.xml
- *.xz
- *_MODULES
-+*_reg_safe.h
- *_vga16.c
- *~
- \#*#
-@@ -70,6 +73,7 @@ Kerntypes
- Module.markers
- Module.symvers
- PENDING
-+PERF*
- SCCS
- System.map*
- TAGS
-@@ -93,19 +97,24 @@ bounds.h
- bsetup
- btfixupprep
- build
-+builtin-policy.h
- bvmlinux
- bzImage*
- capability_names.h
- capflags.c
- classlist.h*
-+clut_vga16.c
-+common-cmds.h
- comp*.log
- compile.h*
- conf
- config
- config-*
- config_data.h*
-+config.c
- config.mak
- config.mak.autogen
-+config.tmp
- conmakehash
- consolemap_deftbl.c*
- cpustr.h
-@@ -119,6 +128,7 @@ dslm
- elf2ecoff
- elfconfig.h*
- evergreen_reg_safe.h
-+exception_policy.conf
- fixdep
- flask.h
- fore200e_mkfirm
-@@ -126,12 +136,14 @@ fore200e_pca_fw.c*
- gconf
- gconf.glade.h
- gen-devlist
-+gen-kdb_cmds.c
- gen_crc32table
- gen_init_cpio
- generated
- genheaders
- genksyms
- *_gray256.c
-+hash
- hpet_example
- hugepage-mmap
- hugepage-shm
-@@ -146,7 +158,7 @@ int32.c
- int4.c
- int8.c
- kallsyms
--kconfig
-+kern_constants.h
- keywords.c
- ksym.c*
- ksym.h*
-@@ -154,7 +166,6 @@ kxgettext
- lkc_defs.h
- lex.c
- lex.*.c
--linux
- logo_*.c
- logo_*_clut224.c
- logo_*_mono.c
-@@ -166,7 +177,6 @@ machtypes.h
- map
- map_hugetlb
- maui_boot.h
--media
- mconf
- miboot*
- mk_elfconfig
-@@ -174,6 +184,7 @@ mkboot
- mkbugboot
- mkcpustr
- mkdep
-+mkpiggy
- mkprep
- mkregtable
- mktables
-@@ -209,6 +220,7 @@ r300_reg_safe.h
- r420_reg_safe.h
- r600_reg_safe.h
- recordmcount
-+regdb.c
- relocs
- rlim_names.h
- rn50_reg_safe.h
-@@ -219,6 +231,7 @@ setup
- setup.bin
- setup.elf
- sImage
-+slabinfo
- sm_tbl*
- split-include
- syscalltab.h
-@@ -229,6 +242,7 @@ tftpboot.img
- timeconst.h
- times.h*
- trix_boot.h
-+user_constants.h
- utsrelease.h*
- vdso-syms.lds
- vdso.lds
-@@ -246,7 +260,9 @@ vmlinux
- vmlinux-*
- vmlinux.aout
- vmlinux.bin.all
-+vmlinux.bin.bz2
- vmlinux.lds
-+vmlinux.relocs
- vmlinuz
- voffset.h
- vsyscall.lds
-@@ -254,9 +270,11 @@ vsyscall_32.lds
- wanxlfw.inc
- uImage
- unifdef
-+utsrelease.h
- wakeup.bin
- wakeup.elf
- wakeup.lds
- zImage*
- zconf.hash.c
-+zconf.lex.c
- zoffset.h
-diff -urNp linux-3.1.3/Documentation/kernel-parameters.txt linux-3.1.3/Documentation/kernel-parameters.txt
---- linux-3.1.3/Documentation/kernel-parameters.txt    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/Documentation/kernel-parameters.txt    2011-11-16 18:39:07.000000000 -0500
-@@ -1898,6 +1898,13 @@ bytes respectively. Such letter suffixes
-                       the specified number of seconds.  This is to be used if
-                       your oopses keep scrolling off the screen.
-+      pax_nouderef    [X86] disables UDEREF.  Most likely needed under certain
-+                      virtualization environments that don't cope well with the
-+                      expand down segment used by UDEREF on X86-32 or the frequent
-+                      page table updates on X86-64.
-+
-+      pax_softmode=   0/1 to disable/enable PaX softmode on boot already.
-+
-       pcbit=          [HW,ISDN]
-       pcd.            [PARIDE]
-diff -urNp linux-3.1.3/drivers/acpi/apei/cper.c linux-3.1.3/drivers/acpi/apei/cper.c
---- linux-3.1.3/drivers/acpi/apei/cper.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/acpi/apei/cper.c       2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/acpi/apei/cper.c b/drivers/acpi/apei/cper.c
+index 5d41894..22021e4 100644
+--- a/drivers/acpi/apei/cper.c
++++ b/drivers/acpi/apei/cper.c
 @@ -38,12 +38,12 @@
   */
  u64 cper_next_record_id(void)
@@ -23559,9 +24997,10 @@ diff -urNp linux-3.1.3/drivers/acpi/apei/cper.c linux-3.1.3/drivers/acpi/apei/cp
  }
  EXPORT_SYMBOL_GPL(cper_next_record_id);
  
-diff -urNp linux-3.1.3/drivers/acpi/ec_sys.c linux-3.1.3/drivers/acpi/ec_sys.c
---- linux-3.1.3/drivers/acpi/ec_sys.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/acpi/ec_sys.c  2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/acpi/ec_sys.c b/drivers/acpi/ec_sys.c
+index 22f918b..9fafb84 100644
+--- a/drivers/acpi/ec_sys.c
++++ b/drivers/acpi/ec_sys.c
 @@ -11,6 +11,7 @@
  #include <linux/kernel.h>
  #include <linux/acpi.h>
@@ -23570,7 +25009,7 @@ diff -urNp linux-3.1.3/drivers/acpi/ec_sys.c linux-3.1.3/drivers/acpi/ec_sys.c
  #include "internal.h"
  
  MODULE_AUTHOR("Thomas Renninger <trenn@suse.de>");
-@@ -39,7 +40,7 @@ static ssize_t acpi_ec_read_io(struct fi
+@@ -39,7 +40,7 @@ static ssize_t acpi_ec_read_io(struct file *f, char __user *buf,
         * struct acpi_ec *ec = ((struct seq_file *)f->private_data)->private;
         */
        unsigned int size = EC_SPACE_SIZE;
@@ -23579,7 +25018,7 @@ diff -urNp linux-3.1.3/drivers/acpi/ec_sys.c linux-3.1.3/drivers/acpi/ec_sys.c
        loff_t init_off = *off;
        int err = 0;
  
-@@ -52,9 +53,11 @@ static ssize_t acpi_ec_read_io(struct fi
+@@ -52,9 +53,11 @@ static ssize_t acpi_ec_read_io(struct file *f, char __user *buf,
                size = count;
  
        while (size) {
@@ -23592,7 +25031,7 @@ diff -urNp linux-3.1.3/drivers/acpi/ec_sys.c linux-3.1.3/drivers/acpi/ec_sys.c
                *off += 1;
                size--;
        }
-@@ -70,7 +73,6 @@ static ssize_t acpi_ec_write_io(struct f
+@@ -70,7 +73,6 @@ static ssize_t acpi_ec_write_io(struct file *f, const char __user *buf,
  
        unsigned int size = count;
        loff_t init_off = *off;
@@ -23600,7 +25039,7 @@ diff -urNp linux-3.1.3/drivers/acpi/ec_sys.c linux-3.1.3/drivers/acpi/ec_sys.c
        int err = 0;
  
        if (*off >= EC_SPACE_SIZE)
-@@ -81,7 +83,9 @@ static ssize_t acpi_ec_write_io(struct f
+@@ -81,7 +83,9 @@ static ssize_t acpi_ec_write_io(struct file *f, const char __user *buf,
        }
  
        while (size) {
@@ -23611,35 +25050,36 @@ diff -urNp linux-3.1.3/drivers/acpi/ec_sys.c linux-3.1.3/drivers/acpi/ec_sys.c
                err = ec_write(*off, byte_write);
                if (err)
                        return err;
-diff -urNp linux-3.1.3/drivers/acpi/proc.c linux-3.1.3/drivers/acpi/proc.c
---- linux-3.1.3/drivers/acpi/proc.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/acpi/proc.c    2011-11-16 18:39:07.000000000 -0500
-@@ -342,19 +342,13 @@ acpi_system_write_wakeup_device(struct f
+diff --git a/drivers/acpi/proc.c b/drivers/acpi/proc.c
+index f5f9869..da87aeb 100644
+--- a/drivers/acpi/proc.c
++++ b/drivers/acpi/proc.c
+@@ -342,19 +342,13 @@ acpi_system_write_wakeup_device(struct file *file,
                                size_t count, loff_t * ppos)
  {
        struct list_head *node, *next;
 -      char strbuf[5];
 -      char str[5] = "";
 -      unsigned int len = count;
--
++      char strbuf[5] = {0};
 -      if (len > 4)
 -              len = 4;
 -      if (len < 0)
--              return -EFAULT;
-+      char strbuf[5] = {0};
--      if (copy_from_user(strbuf, buffer, len))
 +      if (count > 4)
 +              count = 4;
 +      if (copy_from_user(strbuf, buffer, count))
                return -EFAULT;
+-
+-      if (copy_from_user(strbuf, buffer, len))
+-              return -EFAULT;
 -      strbuf[len] = '\0';
 -      sscanf(strbuf, "%s", str);
 +      strbuf[count] = '\0';
  
        mutex_lock(&acpi_device_lock);
        list_for_each_safe(node, next, &acpi_wakeup_device_list) {
-@@ -363,7 +357,7 @@ acpi_system_write_wakeup_device(struct f
+@@ -363,7 +357,7 @@ acpi_system_write_wakeup_device(struct file *file,
                if (!dev->wakeup.flags.valid)
                        continue;
  
@@ -23648,10 +25088,11 @@ diff -urNp linux-3.1.3/drivers/acpi/proc.c linux-3.1.3/drivers/acpi/proc.c
                        if (device_can_wakeup(&dev->dev)) {
                                bool enable = !device_may_wakeup(&dev->dev);
                                device_set_wakeup_enable(&dev->dev, enable);
-diff -urNp linux-3.1.3/drivers/acpi/processor_driver.c linux-3.1.3/drivers/acpi/processor_driver.c
---- linux-3.1.3/drivers/acpi/processor_driver.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/acpi/processor_driver.c        2011-11-16 18:39:07.000000000 -0500
-@@ -473,7 +473,7 @@ static int __cpuinit acpi_processor_add(
+diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
+index a4e0f1b..9793b28 100644
+--- a/drivers/acpi/processor_driver.c
++++ b/drivers/acpi/processor_driver.c
+@@ -473,7 +473,7 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device)
                return 0;
  #endif
  
@@ -23660,10 +25101,11 @@ diff -urNp linux-3.1.3/drivers/acpi/processor_driver.c linux-3.1.3/drivers/acpi/
  
        /*
         * Buggy BIOS check
-diff -urNp linux-3.1.3/drivers/ata/libata-core.c linux-3.1.3/drivers/ata/libata-core.c
---- linux-3.1.3/drivers/ata/libata-core.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ata/libata-core.c      2011-11-16 18:39:07.000000000 -0500
-@@ -4733,7 +4733,7 @@ void ata_qc_free(struct ata_queued_cmd *
+diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
+index 4a3a5ae..cbee192 100644
+--- a/drivers/ata/libata-core.c
++++ b/drivers/ata/libata-core.c
+@@ -4733,7 +4733,7 @@ void ata_qc_free(struct ata_queued_cmd *qc)
        struct ata_port *ap;
        unsigned int tag;
  
@@ -23672,7 +25114,7 @@ diff -urNp linux-3.1.3/drivers/ata/libata-core.c linux-3.1.3/drivers/ata/libata-
        ap = qc->ap;
  
        qc->flags = 0;
-@@ -4749,7 +4749,7 @@ void __ata_qc_complete(struct ata_queued
+@@ -4749,7 +4749,7 @@ void __ata_qc_complete(struct ata_queued_cmd *qc)
        struct ata_port *ap;
        struct ata_link *link;
  
@@ -23681,7 +25123,7 @@ diff -urNp linux-3.1.3/drivers/ata/libata-core.c linux-3.1.3/drivers/ata/libata-
        WARN_ON_ONCE(!(qc->flags & ATA_QCFLAG_ACTIVE));
        ap = qc->ap;
        link = qc->dev->link;
-@@ -5754,6 +5754,7 @@ static void ata_finalize_port_ops(struct
+@@ -5754,6 +5754,7 @@ static void ata_finalize_port_ops(struct ata_port_operations *ops)
                return;
  
        spin_lock(&lock);
@@ -23689,7 +25131,7 @@ diff -urNp linux-3.1.3/drivers/ata/libata-core.c linux-3.1.3/drivers/ata/libata-
  
        for (cur = ops->inherits; cur; cur = cur->inherits) {
                void **inherit = (void **)cur;
-@@ -5767,8 +5768,9 @@ static void ata_finalize_port_ops(struct
+@@ -5767,8 +5768,9 @@ static void ata_finalize_port_ops(struct ata_port_operations *ops)
                if (IS_ERR(*pp))
                        *pp = NULL;
  
@@ -23700,9 +25142,10 @@ diff -urNp linux-3.1.3/drivers/ata/libata-core.c linux-3.1.3/drivers/ata/libata-
        spin_unlock(&lock);
  }
  
-diff -urNp linux-3.1.3/drivers/ata/libata-eh.c linux-3.1.3/drivers/ata/libata-eh.c
---- linux-3.1.3/drivers/ata/libata-eh.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ata/libata-eh.c        2011-11-16 18:40:10.000000000 -0500
+diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
+index ed16fbe..fc92cb8 100644
+--- a/drivers/ata/libata-eh.c
++++ b/drivers/ata/libata-eh.c
 @@ -2515,6 +2515,8 @@ void ata_eh_report(struct ata_port *ap)
  {
        struct ata_link *link;
@@ -23712,10 +25155,11 @@ diff -urNp linux-3.1.3/drivers/ata/libata-eh.c linux-3.1.3/drivers/ata/libata-eh
        ata_for_each_link(link, ap, HOST_FIRST)
                ata_eh_link_report(link);
  }
-diff -urNp linux-3.1.3/drivers/ata/pata_arasan_cf.c linux-3.1.3/drivers/ata/pata_arasan_cf.c
---- linux-3.1.3/drivers/ata/pata_arasan_cf.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ata/pata_arasan_cf.c   2011-11-16 18:39:07.000000000 -0500
-@@ -862,7 +862,9 @@ static int __devinit arasan_cf_probe(str
+diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c
+index 719bb73..79ce858 100644
+--- a/drivers/ata/pata_arasan_cf.c
++++ b/drivers/ata/pata_arasan_cf.c
+@@ -862,7 +862,9 @@ static int __devinit arasan_cf_probe(struct platform_device *pdev)
        /* Handle platform specific quirks */
        if (pdata->quirk) {
                if (pdata->quirk & CF_BROKEN_PIO) {
@@ -23726,10 +25170,11 @@ diff -urNp linux-3.1.3/drivers/ata/pata_arasan_cf.c linux-3.1.3/drivers/ata/pata
                        ap->pio_mask = 0;
                }
                if (pdata->quirk & CF_BROKEN_MWDMA)
-diff -urNp linux-3.1.3/drivers/atm/adummy.c linux-3.1.3/drivers/atm/adummy.c
---- linux-3.1.3/drivers/atm/adummy.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/atm/adummy.c   2011-11-16 18:39:07.000000000 -0500
-@@ -114,7 +114,7 @@ adummy_send(struct atm_vcc *vcc, struct 
+diff --git a/drivers/atm/adummy.c b/drivers/atm/adummy.c
+index f9b983a..887b9d8 100644
+--- a/drivers/atm/adummy.c
++++ b/drivers/atm/adummy.c
+@@ -114,7 +114,7 @@ adummy_send(struct atm_vcc *vcc, struct sk_buff *skb)
                vcc->pop(vcc, skb);
        else
                dev_kfree_skb_any(skb);
@@ -23738,10 +25183,11 @@ diff -urNp linux-3.1.3/drivers/atm/adummy.c linux-3.1.3/drivers/atm/adummy.c
  
        return 0;
  }
-diff -urNp linux-3.1.3/drivers/atm/ambassador.c linux-3.1.3/drivers/atm/ambassador.c
---- linux-3.1.3/drivers/atm/ambassador.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/atm/ambassador.c       2011-11-16 18:39:07.000000000 -0500
-@@ -454,7 +454,7 @@ static void tx_complete (amb_dev * dev, 
+diff --git a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c
+index f8f41e0..1f987dd 100644
+--- a/drivers/atm/ambassador.c
++++ b/drivers/atm/ambassador.c
+@@ -454,7 +454,7 @@ static void tx_complete (amb_dev * dev, tx_out * tx) {
    PRINTD (DBG_FLOW|DBG_TX, "tx_complete %p %p", dev, tx);
    
    // VC layer stats
@@ -23750,7 +25196,7 @@ diff -urNp linux-3.1.3/drivers/atm/ambassador.c linux-3.1.3/drivers/atm/ambassad
    
    // free the descriptor
    kfree (tx_descr);
-@@ -495,7 +495,7 @@ static void rx_complete (amb_dev * dev, 
+@@ -495,7 +495,7 @@ static void rx_complete (amb_dev * dev, rx_out * rx) {
          dump_skb ("<<<", vc, skb);
          
          // VC layer stats
@@ -23759,7 +25205,7 @@ diff -urNp linux-3.1.3/drivers/atm/ambassador.c linux-3.1.3/drivers/atm/ambassad
          __net_timestamp(skb);
          // end of our responsibility
          atm_vcc->push (atm_vcc, skb);
-@@ -510,7 +510,7 @@ static void rx_complete (amb_dev * dev, 
+@@ -510,7 +510,7 @@ static void rx_complete (amb_dev * dev, rx_out * rx) {
        } else {
                PRINTK (KERN_INFO, "dropped over-size frame");
        // should we count this?
@@ -23768,7 +25214,7 @@ diff -urNp linux-3.1.3/drivers/atm/ambassador.c linux-3.1.3/drivers/atm/ambassad
        }
        
      } else {
-@@ -1338,7 +1338,7 @@ static int amb_send (struct atm_vcc * at
+@@ -1338,7 +1338,7 @@ static int amb_send (struct atm_vcc * atm_vcc, struct sk_buff * skb) {
    }
    
    if (check_area (skb->data, skb->len)) {
@@ -23777,10 +25223,11 @@ diff -urNp linux-3.1.3/drivers/atm/ambassador.c linux-3.1.3/drivers/atm/ambassad
      return -ENOMEM; // ?
    }
    
-diff -urNp linux-3.1.3/drivers/atm/atmtcp.c linux-3.1.3/drivers/atm/atmtcp.c
---- linux-3.1.3/drivers/atm/atmtcp.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/atm/atmtcp.c   2011-11-16 18:39:07.000000000 -0500
-@@ -207,7 +207,7 @@ static int atmtcp_v_send(struct atm_vcc 
+diff --git a/drivers/atm/atmtcp.c b/drivers/atm/atmtcp.c
+index b22d71c..d6e1049 100644
+--- a/drivers/atm/atmtcp.c
++++ b/drivers/atm/atmtcp.c
+@@ -207,7 +207,7 @@ static int atmtcp_v_send(struct atm_vcc *vcc,struct sk_buff *skb)
                if (vcc->pop) vcc->pop(vcc,skb);
                else dev_kfree_skb(skb);
                if (dev_data) return 0;
@@ -23789,7 +25236,7 @@ diff -urNp linux-3.1.3/drivers/atm/atmtcp.c linux-3.1.3/drivers/atm/atmtcp.c
                return -ENOLINK;
        }
        size = skb->len+sizeof(struct atmtcp_hdr);
-@@ -215,7 +215,7 @@ static int atmtcp_v_send(struct atm_vcc 
+@@ -215,7 +215,7 @@ static int atmtcp_v_send(struct atm_vcc *vcc,struct sk_buff *skb)
        if (!new_skb) {
                if (vcc->pop) vcc->pop(vcc,skb);
                else dev_kfree_skb(skb);
@@ -23798,7 +25245,7 @@ diff -urNp linux-3.1.3/drivers/atm/atmtcp.c linux-3.1.3/drivers/atm/atmtcp.c
                return -ENOBUFS;
        }
        hdr = (void *) skb_put(new_skb,sizeof(struct atmtcp_hdr));
-@@ -226,8 +226,8 @@ static int atmtcp_v_send(struct atm_vcc 
+@@ -226,8 +226,8 @@ static int atmtcp_v_send(struct atm_vcc *vcc,struct sk_buff *skb)
        if (vcc->pop) vcc->pop(vcc,skb);
        else dev_kfree_skb(skb);
        out_vcc->push(out_vcc,new_skb);
@@ -23809,7 +25256,7 @@ diff -urNp linux-3.1.3/drivers/atm/atmtcp.c linux-3.1.3/drivers/atm/atmtcp.c
        return 0;
  }
  
-@@ -301,7 +301,7 @@ static int atmtcp_c_send(struct atm_vcc 
+@@ -301,7 +301,7 @@ static int atmtcp_c_send(struct atm_vcc *vcc,struct sk_buff *skb)
        out_vcc = find_vcc(dev, ntohs(hdr->vpi), ntohs(hdr->vci));
        read_unlock(&vcc_sklist_lock);
        if (!out_vcc) {
@@ -23818,7 +25265,7 @@ diff -urNp linux-3.1.3/drivers/atm/atmtcp.c linux-3.1.3/drivers/atm/atmtcp.c
                goto done;
        }
        skb_pull(skb,sizeof(struct atmtcp_hdr));
-@@ -313,8 +313,8 @@ static int atmtcp_c_send(struct atm_vcc 
+@@ -313,8 +313,8 @@ static int atmtcp_c_send(struct atm_vcc *vcc,struct sk_buff *skb)
        __net_timestamp(new_skb);
        skb_copy_from_linear_data(skb, skb_put(new_skb, skb->len), skb->len);
        out_vcc->push(out_vcc,new_skb);
@@ -23829,9 +25276,10 @@ diff -urNp linux-3.1.3/drivers/atm/atmtcp.c linux-3.1.3/drivers/atm/atmtcp.c
  done:
        if (vcc->pop) vcc->pop(vcc,skb);
        else dev_kfree_skb(skb);
-diff -urNp linux-3.1.3/drivers/atm/eni.c linux-3.1.3/drivers/atm/eni.c
---- linux-3.1.3/drivers/atm/eni.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/atm/eni.c      2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c
+index 9307141..d8521bf 100644
+--- a/drivers/atm/eni.c
++++ b/drivers/atm/eni.c
 @@ -526,7 +526,7 @@ static int rx_aal0(struct atm_vcc *vcc)
                DPRINTK(DEV_LABEL "(itf %d): trashing empty cell\n",
                    vcc->dev->number);
@@ -23868,7 +25316,7 @@ diff -urNp linux-3.1.3/drivers/atm/eni.c linux-3.1.3/drivers/atm/eni.c
        }
        wake_up(&eni_dev->rx_wait);
  }
-@@ -1228,7 +1228,7 @@ static void dequeue_tx(struct atm_dev *d
+@@ -1228,7 +1228,7 @@ static void dequeue_tx(struct atm_dev *dev)
                    PCI_DMA_TODEVICE);
                if (vcc->pop) vcc->pop(vcc,skb);
                else dev_kfree_skb_irq(skb);
@@ -23886,10 +25334,11 @@ diff -urNp linux-3.1.3/drivers/atm/eni.c linux-3.1.3/drivers/atm/eni.c
      "MMF", "SMF", "MMF", "03?", /*  0- 3 */
      "UTP", "05?", "06?", "07?", /*  4- 7 */
      "TAXI","09?", "10?", "11?", /*  8-11 */
-diff -urNp linux-3.1.3/drivers/atm/firestream.c linux-3.1.3/drivers/atm/firestream.c
---- linux-3.1.3/drivers/atm/firestream.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/atm/firestream.c       2011-11-16 18:39:07.000000000 -0500
-@@ -750,7 +750,7 @@ static void process_txdone_queue (struct
+diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c
+index 5072f8a..fa52520 100644
+--- a/drivers/atm/firestream.c
++++ b/drivers/atm/firestream.c
+@@ -750,7 +750,7 @@ static void process_txdone_queue (struct fs_dev *dev, struct queue *q)
                                }
                        }
  
@@ -23898,7 +25347,7 @@ diff -urNp linux-3.1.3/drivers/atm/firestream.c linux-3.1.3/drivers/atm/firestre
  
                        fs_dprintk (FS_DEBUG_TXMEM, "i");
                        fs_dprintk (FS_DEBUG_ALLOC, "Free t-skb: %p\n", skb);
-@@ -817,7 +817,7 @@ static void process_incoming (struct fs_
+@@ -817,7 +817,7 @@ static void process_incoming (struct fs_dev *dev, struct queue *q)
  #endif
                                skb_put (skb, qe->p1 & 0xffff); 
                                ATM_SKB(skb)->vcc = atm_vcc;
@@ -23907,7 +25356,7 @@ diff -urNp linux-3.1.3/drivers/atm/firestream.c linux-3.1.3/drivers/atm/firestre
                                __net_timestamp(skb);
                                fs_dprintk (FS_DEBUG_ALLOC, "Free rec-skb: %p (pushed)\n", skb);
                                atm_vcc->push (atm_vcc, skb);
-@@ -838,12 +838,12 @@ static void process_incoming (struct fs_
+@@ -838,12 +838,12 @@ static void process_incoming (struct fs_dev *dev, struct queue *q)
                                kfree (pe);
                        }
                        if (atm_vcc)
@@ -23922,10 +25371,11 @@ diff -urNp linux-3.1.3/drivers/atm/firestream.c linux-3.1.3/drivers/atm/firestre
                        break;
                default: /* Hmm. Haven't written the code to handle the others yet... -- REW */
                        printk (KERN_WARNING "Don't know what to do with RX status %x: %s.\n", 
-diff -urNp linux-3.1.3/drivers/atm/fore200e.c linux-3.1.3/drivers/atm/fore200e.c
---- linux-3.1.3/drivers/atm/fore200e.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/atm/fore200e.c 2011-11-16 18:39:07.000000000 -0500
-@@ -933,9 +933,9 @@ fore200e_tx_irq(struct fore200e* fore200
+diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c
+index 361f5ae..7fc552d 100644
+--- a/drivers/atm/fore200e.c
++++ b/drivers/atm/fore200e.c
+@@ -933,9 +933,9 @@ fore200e_tx_irq(struct fore200e* fore200e)
  #endif
                /* check error condition */
                if (*entry->status & STATUS_ERROR)
@@ -23937,7 +25387,7 @@ diff -urNp linux-3.1.3/drivers/atm/fore200e.c linux-3.1.3/drivers/atm/fore200e.c
            }
        }
  
-@@ -1084,7 +1084,7 @@ fore200e_push_rpd(struct fore200e* fore2
+@@ -1084,7 +1084,7 @@ fore200e_push_rpd(struct fore200e* fore200e, struct atm_vcc* vcc, struct rpd* rp
      if (skb == NULL) {
        DPRINTK(2, "unable to alloc new skb, rx PDU length = %d\n", pdu_len);
  
@@ -23946,7 +25396,7 @@ diff -urNp linux-3.1.3/drivers/atm/fore200e.c linux-3.1.3/drivers/atm/fore200e.c
        return -ENOMEM;
      } 
  
-@@ -1127,14 +1127,14 @@ fore200e_push_rpd(struct fore200e* fore2
+@@ -1127,14 +1127,14 @@ fore200e_push_rpd(struct fore200e* fore200e, struct atm_vcc* vcc, struct rpd* rp
  
        dev_kfree_skb_any(skb);
  
@@ -23963,7 +25413,7 @@ diff -urNp linux-3.1.3/drivers/atm/fore200e.c linux-3.1.3/drivers/atm/fore200e.c
  
      ASSERT(atomic_read(&sk_atm(vcc)->sk_wmem_alloc) >= 0);
  
-@@ -1212,7 +1212,7 @@ fore200e_rx_irq(struct fore200e* fore200
+@@ -1212,7 +1212,7 @@ fore200e_rx_irq(struct fore200e* fore200e)
                DPRINTK(2, "damaged PDU on %d.%d.%d\n",
                        fore200e->atm_dev->number,
                        entry->rpd->atm_header.vpi, entry->rpd->atm_header.vci);
@@ -23972,7 +25422,7 @@ diff -urNp linux-3.1.3/drivers/atm/fore200e.c linux-3.1.3/drivers/atm/fore200e.c
            }
        }
  
-@@ -1657,7 +1657,7 @@ fore200e_send(struct atm_vcc *vcc, struc
+@@ -1657,7 +1657,7 @@ fore200e_send(struct atm_vcc *vcc, struct sk_buff *skb)
                goto retry_here;
            }
  
@@ -23981,10 +25431,11 @@ diff -urNp linux-3.1.3/drivers/atm/fore200e.c linux-3.1.3/drivers/atm/fore200e.c
  
            fore200e->tx_sat++;
            DPRINTK(2, "tx queue of device %s is saturated, PDU dropped - heartbeat is %08x\n",
-diff -urNp linux-3.1.3/drivers/atm/he.c linux-3.1.3/drivers/atm/he.c
---- linux-3.1.3/drivers/atm/he.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/atm/he.c       2011-11-16 18:39:07.000000000 -0500
-@@ -1709,7 +1709,7 @@ he_service_rbrq(struct he_dev *he_dev, i
+diff --git a/drivers/atm/he.c b/drivers/atm/he.c
+index 9a51df4..f3bb5f8 100644
+--- a/drivers/atm/he.c
++++ b/drivers/atm/he.c
+@@ -1709,7 +1709,7 @@ he_service_rbrq(struct he_dev *he_dev, int group)
  
                if (RBRQ_HBUF_ERR(he_dev->rbrq_head)) {
                        hprintk("HBUF_ERR!  (cid 0x%x)\n", cid);
@@ -23993,7 +25444,7 @@ diff -urNp linux-3.1.3/drivers/atm/he.c linux-3.1.3/drivers/atm/he.c
                        goto return_host_buffers;
                }
  
-@@ -1736,7 +1736,7 @@ he_service_rbrq(struct he_dev *he_dev, i
+@@ -1736,7 +1736,7 @@ he_service_rbrq(struct he_dev *he_dev, int group)
                                RBRQ_LEN_ERR(he_dev->rbrq_head)
                                                        ? "LEN_ERR" : "",
                                                        vcc->vpi, vcc->vci);
@@ -24002,7 +25453,7 @@ diff -urNp linux-3.1.3/drivers/atm/he.c linux-3.1.3/drivers/atm/he.c
                        goto return_host_buffers;
                }
  
-@@ -1788,7 +1788,7 @@ he_service_rbrq(struct he_dev *he_dev, i
+@@ -1788,7 +1788,7 @@ he_service_rbrq(struct he_dev *he_dev, int group)
                vcc->push(vcc, skb);
                spin_lock(&he_dev->global_lock);
  
@@ -24011,7 +25462,7 @@ diff -urNp linux-3.1.3/drivers/atm/he.c linux-3.1.3/drivers/atm/he.c
  
  return_host_buffers:
                ++pdus_assembled;
-@@ -2114,7 +2114,7 @@ __enqueue_tpd(struct he_dev *he_dev, str
+@@ -2114,7 +2114,7 @@ __enqueue_tpd(struct he_dev *he_dev, struct he_tpd *tpd, unsigned cid)
                                        tpd->vcc->pop(tpd->vcc, tpd->skb);
                                else
                                        dev_kfree_skb_any(tpd->skb);
@@ -24020,7 +25471,7 @@ diff -urNp linux-3.1.3/drivers/atm/he.c linux-3.1.3/drivers/atm/he.c
                        }
                        pci_pool_free(he_dev->tpd_pool, tpd, TPD_ADDR(tpd->status));
                        return;
-@@ -2526,7 +2526,7 @@ he_send(struct atm_vcc *vcc, struct sk_b
+@@ -2526,7 +2526,7 @@ he_send(struct atm_vcc *vcc, struct sk_buff *skb)
                        vcc->pop(vcc, skb);
                else
                        dev_kfree_skb_any(skb);
@@ -24029,7 +25480,7 @@ diff -urNp linux-3.1.3/drivers/atm/he.c linux-3.1.3/drivers/atm/he.c
                return -EINVAL;
        }
  
-@@ -2537,7 +2537,7 @@ he_send(struct atm_vcc *vcc, struct sk_b
+@@ -2537,7 +2537,7 @@ he_send(struct atm_vcc *vcc, struct sk_buff *skb)
                        vcc->pop(vcc, skb);
                else
                        dev_kfree_skb_any(skb);
@@ -24038,7 +25489,7 @@ diff -urNp linux-3.1.3/drivers/atm/he.c linux-3.1.3/drivers/atm/he.c
                return -EINVAL;
        }
  #endif
-@@ -2549,7 +2549,7 @@ he_send(struct atm_vcc *vcc, struct sk_b
+@@ -2549,7 +2549,7 @@ he_send(struct atm_vcc *vcc, struct sk_buff *skb)
                        vcc->pop(vcc, skb);
                else
                        dev_kfree_skb_any(skb);
@@ -24047,7 +25498,7 @@ diff -urNp linux-3.1.3/drivers/atm/he.c linux-3.1.3/drivers/atm/he.c
                spin_unlock_irqrestore(&he_dev->global_lock, flags);
                return -ENOMEM;
        }
-@@ -2591,7 +2591,7 @@ he_send(struct atm_vcc *vcc, struct sk_b
+@@ -2591,7 +2591,7 @@ he_send(struct atm_vcc *vcc, struct sk_buff *skb)
                                        vcc->pop(vcc, skb);
                                else
                                        dev_kfree_skb_any(skb);
@@ -24056,7 +25507,7 @@ diff -urNp linux-3.1.3/drivers/atm/he.c linux-3.1.3/drivers/atm/he.c
                                spin_unlock_irqrestore(&he_dev->global_lock, flags);
                                return -ENOMEM;
                        }
-@@ -2622,7 +2622,7 @@ he_send(struct atm_vcc *vcc, struct sk_b
+@@ -2622,7 +2622,7 @@ he_send(struct atm_vcc *vcc, struct sk_buff *skb)
        __enqueue_tpd(he_dev, tpd, cid);
        spin_unlock_irqrestore(&he_dev->global_lock, flags);
  
@@ -24065,10 +25516,11 @@ diff -urNp linux-3.1.3/drivers/atm/he.c linux-3.1.3/drivers/atm/he.c
  
        return 0;
  }
-diff -urNp linux-3.1.3/drivers/atm/horizon.c linux-3.1.3/drivers/atm/horizon.c
---- linux-3.1.3/drivers/atm/horizon.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/atm/horizon.c  2011-11-16 18:39:07.000000000 -0500
-@@ -1035,7 +1035,7 @@ static void rx_schedule (hrz_dev * dev, 
+diff --git a/drivers/atm/horizon.c b/drivers/atm/horizon.c
+index b812103..e391a49 100644
+--- a/drivers/atm/horizon.c
++++ b/drivers/atm/horizon.c
+@@ -1035,7 +1035,7 @@ static void rx_schedule (hrz_dev * dev, int irq) {
        {
          struct atm_vcc * vcc = ATM_SKB(skb)->vcc;
          // VC layer stats
@@ -24077,7 +25529,7 @@ diff -urNp linux-3.1.3/drivers/atm/horizon.c linux-3.1.3/drivers/atm/horizon.c
          __net_timestamp(skb);
          // end of our responsibility
          vcc->push (vcc, skb);
-@@ -1187,7 +1187,7 @@ static void tx_schedule (hrz_dev * const
+@@ -1187,7 +1187,7 @@ static void tx_schedule (hrz_dev * const dev, int irq) {
        dev->tx_iovec = NULL;
        
        // VC layer stats
@@ -24086,10 +25538,11 @@ diff -urNp linux-3.1.3/drivers/atm/horizon.c linux-3.1.3/drivers/atm/horizon.c
        
        // free the skb
        hrz_kfree_skb (skb);
-diff -urNp linux-3.1.3/drivers/atm/idt77252.c linux-3.1.3/drivers/atm/idt77252.c
---- linux-3.1.3/drivers/atm/idt77252.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/atm/idt77252.c 2011-11-16 18:39:07.000000000 -0500
-@@ -812,7 +812,7 @@ drain_scq(struct idt77252_dev *card, str
+diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c
+index db06f34..dcebb61 100644
+--- a/drivers/atm/idt77252.c
++++ b/drivers/atm/idt77252.c
+@@ -812,7 +812,7 @@ drain_scq(struct idt77252_dev *card, struct vc_map *vc)
                else
                        dev_kfree_skb(skb);
  
@@ -24098,7 +25551,7 @@ diff -urNp linux-3.1.3/drivers/atm/idt77252.c linux-3.1.3/drivers/atm/idt77252.c
        }
  
        atomic_dec(&scq->used);
-@@ -1075,13 +1075,13 @@ dequeue_rx(struct idt77252_dev *card, st
+@@ -1075,13 +1075,13 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
                        if ((sb = dev_alloc_skb(64)) == NULL) {
                                printk("%s: Can't allocate buffers for aal0.\n",
                                       card->name);
@@ -24114,7 +25567,7 @@ diff -urNp linux-3.1.3/drivers/atm/idt77252.c linux-3.1.3/drivers/atm/idt77252.c
                                dev_kfree_skb(sb);
                                break;
                        }
-@@ -1098,7 +1098,7 @@ dequeue_rx(struct idt77252_dev *card, st
+@@ -1098,7 +1098,7 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
                        ATM_SKB(sb)->vcc = vcc;
                        __net_timestamp(sb);
                        vcc->push(vcc, sb);
@@ -24123,7 +25576,7 @@ diff -urNp linux-3.1.3/drivers/atm/idt77252.c linux-3.1.3/drivers/atm/idt77252.c
  
                        cell += ATM_CELL_PAYLOAD;
                }
-@@ -1135,13 +1135,13 @@ dequeue_rx(struct idt77252_dev *card, st
+@@ -1135,13 +1135,13 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
                                 "(CDC: %08x)\n",
                                 card->name, len, rpp->len, readl(SAR_REG_CDC));
                        recycle_rx_pool_skb(card, rpp);
@@ -24139,7 +25592,7 @@ diff -urNp linux-3.1.3/drivers/atm/idt77252.c linux-3.1.3/drivers/atm/idt77252.c
                        return;
                }
                if (skb_queue_len(&rpp->queue) > 1) {
-@@ -1152,7 +1152,7 @@ dequeue_rx(struct idt77252_dev *card, st
+@@ -1152,7 +1152,7 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
                                RXPRINTK("%s: Can't alloc RX skb.\n",
                                         card->name);
                                recycle_rx_pool_skb(card, rpp);
@@ -24148,7 +25601,7 @@ diff -urNp linux-3.1.3/drivers/atm/idt77252.c linux-3.1.3/drivers/atm/idt77252.c
                                return;
                        }
                        if (!atm_charge(vcc, skb->truesize)) {
-@@ -1171,7 +1171,7 @@ dequeue_rx(struct idt77252_dev *card, st
+@@ -1171,7 +1171,7 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
                        __net_timestamp(skb);
  
                        vcc->push(vcc, skb);
@@ -24157,7 +25610,7 @@ diff -urNp linux-3.1.3/drivers/atm/idt77252.c linux-3.1.3/drivers/atm/idt77252.c
  
                        return;
                }
-@@ -1193,7 +1193,7 @@ dequeue_rx(struct idt77252_dev *card, st
+@@ -1193,7 +1193,7 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
                __net_timestamp(skb);
  
                vcc->push(vcc, skb);
@@ -24166,7 +25619,7 @@ diff -urNp linux-3.1.3/drivers/atm/idt77252.c linux-3.1.3/drivers/atm/idt77252.c
  
                if (skb->truesize > SAR_FB_SIZE_3)
                        add_rx_skb(card, 3, SAR_FB_SIZE_3, 1);
-@@ -1304,14 +1304,14 @@ idt77252_rx_raw(struct idt77252_dev *car
+@@ -1304,14 +1304,14 @@ idt77252_rx_raw(struct idt77252_dev *card)
                if (vcc->qos.aal != ATM_AAL0) {
                        RPRINTK("%s: raw cell for non AAL0 vc %u.%u\n",
                                card->name, vpi, vci);
@@ -24183,7 +25636,7 @@ diff -urNp linux-3.1.3/drivers/atm/idt77252.c linux-3.1.3/drivers/atm/idt77252.c
                        goto drop;
                }
  
-@@ -1330,7 +1330,7 @@ idt77252_rx_raw(struct idt77252_dev *car
+@@ -1330,7 +1330,7 @@ idt77252_rx_raw(struct idt77252_dev *card)
                ATM_SKB(sb)->vcc = vcc;
                __net_timestamp(sb);
                vcc->push(vcc, sb);
@@ -24192,7 +25645,7 @@ diff -urNp linux-3.1.3/drivers/atm/idt77252.c linux-3.1.3/drivers/atm/idt77252.c
  
  drop:
                skb_pull(queue, 64);
-@@ -1955,13 +1955,13 @@ idt77252_send_skb(struct atm_vcc *vcc, s
+@@ -1955,13 +1955,13 @@ idt77252_send_skb(struct atm_vcc *vcc, struct sk_buff *skb, int oam)
  
        if (vc == NULL) {
                printk("%s: NULL connection in send().\n", card->name);
@@ -24208,7 +25661,7 @@ diff -urNp linux-3.1.3/drivers/atm/idt77252.c linux-3.1.3/drivers/atm/idt77252.c
                dev_kfree_skb(skb);
                return -EINVAL;
        }
-@@ -1973,14 +1973,14 @@ idt77252_send_skb(struct atm_vcc *vcc, s
+@@ -1973,14 +1973,14 @@ idt77252_send_skb(struct atm_vcc *vcc, struct sk_buff *skb, int oam)
                break;
        default:
                printk("%s: Unsupported AAL: %d\n", card->name, vcc->qos.aal);
@@ -24225,7 +25678,7 @@ diff -urNp linux-3.1.3/drivers/atm/idt77252.c linux-3.1.3/drivers/atm/idt77252.c
                dev_kfree_skb(skb);
                return -EINVAL;
        }
-@@ -1988,7 +1988,7 @@ idt77252_send_skb(struct atm_vcc *vcc, s
+@@ -1988,7 +1988,7 @@ idt77252_send_skb(struct atm_vcc *vcc, struct sk_buff *skb, int oam)
  
        err = queue_skb(card, vc, skb, oam);
        if (err) {
@@ -24234,7 +25687,7 @@ diff -urNp linux-3.1.3/drivers/atm/idt77252.c linux-3.1.3/drivers/atm/idt77252.c
                dev_kfree_skb(skb);
                return err;
        }
-@@ -2011,7 +2011,7 @@ idt77252_send_oam(struct atm_vcc *vcc, v
+@@ -2011,7 +2011,7 @@ idt77252_send_oam(struct atm_vcc *vcc, void *cell, int flags)
        skb = dev_alloc_skb(64);
        if (!skb) {
                printk("%s: Out of memory in send_oam().\n", card->name);
@@ -24243,10 +25696,11 @@ diff -urNp linux-3.1.3/drivers/atm/idt77252.c linux-3.1.3/drivers/atm/idt77252.c
                return -ENOMEM;
        }
        atomic_add(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc);
-diff -urNp linux-3.1.3/drivers/atm/iphase.c linux-3.1.3/drivers/atm/iphase.c
---- linux-3.1.3/drivers/atm/iphase.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/atm/iphase.c   2011-11-16 18:39:07.000000000 -0500
-@@ -1121,7 +1121,7 @@ static int rx_pkt(struct atm_dev *dev)  
+diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c
+index cb90f7a..bd33566 100644
+--- a/drivers/atm/iphase.c
++++ b/drivers/atm/iphase.c
+@@ -1121,7 +1121,7 @@ static int rx_pkt(struct atm_dev *dev)
        status = (u_short) (buf_desc_ptr->desc_mode);  
        if (status & (RX_CER | RX_PTE | RX_OFL))  
        {  
@@ -24255,7 +25709,7 @@ diff -urNp linux-3.1.3/drivers/atm/iphase.c linux-3.1.3/drivers/atm/iphase.c
                IF_ERR(printk("IA: bad packet, dropping it");)  
                  if (status & RX_CER) { 
                      IF_ERR(printk(" cause: packet CRC error\n");)
-@@ -1144,7 +1144,7 @@ static int rx_pkt(struct atm_dev *dev)  
+@@ -1144,7 +1144,7 @@ static int rx_pkt(struct atm_dev *dev)
        len = dma_addr - buf_addr;  
          if (len > iadev->rx_buf_sz) {
             printk("Over %d bytes sdu received, dropped!!!\n", iadev->rx_buf_sz);
@@ -24264,7 +25718,7 @@ diff -urNp linux-3.1.3/drivers/atm/iphase.c linux-3.1.3/drivers/atm/iphase.c
           goto out_free_desc;
          }
                  
-@@ -1294,7 +1294,7 @@ static void rx_dle_intr(struct atm_dev *
+@@ -1294,7 +1294,7 @@ static void rx_dle_intr(struct atm_dev *dev)
            ia_vcc = INPH_IA_VCC(vcc);
            if (ia_vcc == NULL)
            {
@@ -24273,7 +25727,7 @@ diff -urNp linux-3.1.3/drivers/atm/iphase.c linux-3.1.3/drivers/atm/iphase.c
               dev_kfree_skb_any(skb);
               atm_return(vcc, atm_guess_pdu2truesize(len));
               goto INCR_DLE;
-@@ -1306,7 +1306,7 @@ static void rx_dle_intr(struct atm_dev *
+@@ -1306,7 +1306,7 @@ static void rx_dle_intr(struct atm_dev *dev)
            if ((length > iadev->rx_buf_sz) || (length > 
                                (skb->len - sizeof(struct cpcs_trailer))))
            {
@@ -24282,7 +25736,7 @@ diff -urNp linux-3.1.3/drivers/atm/iphase.c linux-3.1.3/drivers/atm/iphase.c
               IF_ERR(printk("rx_dle_intr: Bad  AAL5 trailer %d (skb len %d)", 
                                                              length, skb->len);)
               dev_kfree_skb_any(skb);
-@@ -1322,7 +1322,7 @@ static void rx_dle_intr(struct atm_dev *
+@@ -1322,7 +1322,7 @@ static void rx_dle_intr(struct atm_dev *dev)
  
          IF_RX(printk("rx_dle_intr: skb push");)  
          vcc->push(vcc,skb);  
@@ -24291,7 +25745,7 @@ diff -urNp linux-3.1.3/drivers/atm/iphase.c linux-3.1.3/drivers/atm/iphase.c
            iadev->rx_pkt_cnt++;
        }  
  INCR_DLE:
-@@ -2802,15 +2802,15 @@ static int ia_ioctl(struct atm_dev *dev,
+@@ -2802,15 +2802,15 @@ static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg)
           {
               struct k_sonet_stats *stats;
               stats = &PRIV(_ia_dev[board])->sonet_stats;
@@ -24316,7 +25770,7 @@ diff -urNp linux-3.1.3/drivers/atm/iphase.c linux-3.1.3/drivers/atm/iphase.c
           }
              ia_cmds.status = 0;
              break;
-@@ -2915,7 +2915,7 @@ static int ia_pkt_tx (struct atm_vcc *vc
+@@ -2915,7 +2915,7 @@ static int ia_pkt_tx (struct atm_vcc *vcc, struct sk_buff *skb) {
        if ((desc == 0) || (desc > iadev->num_tx_desc))  
        {  
                IF_ERR(printk(DEV_LABEL "invalid desc for send: %d\n", desc);) 
@@ -24325,7 +25779,7 @@ diff -urNp linux-3.1.3/drivers/atm/iphase.c linux-3.1.3/drivers/atm/iphase.c
                if (vcc->pop)   
                    vcc->pop(vcc, skb);   
                else  
-@@ -3020,14 +3020,14 @@ static int ia_pkt_tx (struct atm_vcc *vc
+@@ -3020,14 +3020,14 @@ static int ia_pkt_tx (struct atm_vcc *vcc, struct sk_buff *skb) {
          ATM_DESC(skb) = vcc->vci;
          skb_queue_tail(&iadev->tx_dma_q, skb);
  
@@ -24342,10 +25796,11 @@ diff -urNp linux-3.1.3/drivers/atm/iphase.c linux-3.1.3/drivers/atm/iphase.c
            if (iavcc->vc_desc_cnt > 10) {
               vcc->tx_quota =  vcc->tx_quota * 3 / 4;
              printk("Tx1:  vcc->tx_quota = %d \n", (u32)vcc->tx_quota );
-diff -urNp linux-3.1.3/drivers/atm/lanai.c linux-3.1.3/drivers/atm/lanai.c
---- linux-3.1.3/drivers/atm/lanai.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/atm/lanai.c    2011-11-16 18:39:07.000000000 -0500
-@@ -1303,7 +1303,7 @@ static void lanai_send_one_aal5(struct l
+diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c
+index e828c54..ae83976 100644
+--- a/drivers/atm/lanai.c
++++ b/drivers/atm/lanai.c
+@@ -1303,7 +1303,7 @@ static void lanai_send_one_aal5(struct lanai_dev *lanai,
        vcc_tx_add_aal5_trailer(lvcc, skb->len, 0, 0);
        lanai_endtx(lanai, lvcc);
        lanai_free_skb(lvcc->tx.atmvcc, skb);
@@ -24354,7 +25809,7 @@ diff -urNp linux-3.1.3/drivers/atm/lanai.c linux-3.1.3/drivers/atm/lanai.c
  }
  
  /* Try to fill the buffer - don't call unless there is backlog */
-@@ -1426,7 +1426,7 @@ static void vcc_rx_aal5(struct lanai_vcc
+@@ -1426,7 +1426,7 @@ static void vcc_rx_aal5(struct lanai_vcc *lvcc, int endptr)
        ATM_SKB(skb)->vcc = lvcc->rx.atmvcc;
        __net_timestamp(skb);
        lvcc->rx.atmvcc->push(lvcc->rx.atmvcc, skb);
@@ -24363,7 +25818,7 @@ diff -urNp linux-3.1.3/drivers/atm/lanai.c linux-3.1.3/drivers/atm/lanai.c
      out:
        lvcc->rx.buf.ptr = end;
        cardvcc_write(lvcc, endptr, vcc_rxreadptr);
-@@ -1668,7 +1668,7 @@ static int handle_service(struct lanai_d
+@@ -1668,7 +1668,7 @@ static int handle_service(struct lanai_dev *lanai, u32 s)
                DPRINTK("(itf %d) got RX service entry 0x%X for non-AAL5 "
                    "vcc %d\n", lanai->number, (unsigned int) s, vci);
                lanai->stats.service_rxnotaal5++;
@@ -24372,7 +25827,7 @@ diff -urNp linux-3.1.3/drivers/atm/lanai.c linux-3.1.3/drivers/atm/lanai.c
                return 0;
        }
        if (likely(!(s & (SERVICE_TRASH | SERVICE_STREAM | SERVICE_CRCERR)))) {
-@@ -1680,7 +1680,7 @@ static int handle_service(struct lanai_d
+@@ -1680,7 +1680,7 @@ static int handle_service(struct lanai_dev *lanai, u32 s)
                int bytes;
                read_unlock(&vcc_sklist_lock);
                DPRINTK("got trashed rx pdu on vci %d\n", vci);
@@ -24381,7 +25836,7 @@ diff -urNp linux-3.1.3/drivers/atm/lanai.c linux-3.1.3/drivers/atm/lanai.c
                lvcc->stats.x.aal5.service_trash++;
                bytes = (SERVICE_GET_END(s) * 16) -
                    (((unsigned long) lvcc->rx.buf.ptr) -
-@@ -1692,7 +1692,7 @@ static int handle_service(struct lanai_d
+@@ -1692,7 +1692,7 @@ static int handle_service(struct lanai_dev *lanai, u32 s)
        }
        if (s & SERVICE_STREAM) {
                read_unlock(&vcc_sklist_lock);
@@ -24390,7 +25845,7 @@ diff -urNp linux-3.1.3/drivers/atm/lanai.c linux-3.1.3/drivers/atm/lanai.c
                lvcc->stats.x.aal5.service_stream++;
                printk(KERN_ERR DEV_LABEL "(itf %d): Got AAL5 stream "
                    "PDU on VCI %d!\n", lanai->number, vci);
-@@ -1700,7 +1700,7 @@ static int handle_service(struct lanai_d
+@@ -1700,7 +1700,7 @@ static int handle_service(struct lanai_dev *lanai, u32 s)
                return 0;
        }
        DPRINTK("got rx crc error on vci %d\n", vci);
@@ -24399,10 +25854,11 @@ diff -urNp linux-3.1.3/drivers/atm/lanai.c linux-3.1.3/drivers/atm/lanai.c
        lvcc->stats.x.aal5.service_rxcrc++;
        lvcc->rx.buf.ptr = &lvcc->rx.buf.start[SERVICE_GET_END(s) * 4];
        cardvcc_write(lvcc, SERVICE_GET_END(s), vcc_rxreadptr);
-diff -urNp linux-3.1.3/drivers/atm/nicstar.c linux-3.1.3/drivers/atm/nicstar.c
---- linux-3.1.3/drivers/atm/nicstar.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/atm/nicstar.c  2011-11-16 18:39:07.000000000 -0500
-@@ -1654,7 +1654,7 @@ static int ns_send(struct atm_vcc *vcc, 
+diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c
+index 1c70c45..300718d 100644
+--- a/drivers/atm/nicstar.c
++++ b/drivers/atm/nicstar.c
+@@ -1654,7 +1654,7 @@ static int ns_send(struct atm_vcc *vcc, struct sk_buff *skb)
        if ((vc = (vc_map *) vcc->dev_data) == NULL) {
                printk("nicstar%d: vcc->dev_data == NULL on ns_send().\n",
                       card->index);
@@ -24411,7 +25867,7 @@ diff -urNp linux-3.1.3/drivers/atm/nicstar.c linux-3.1.3/drivers/atm/nicstar.c
                dev_kfree_skb_any(skb);
                return -EINVAL;
        }
-@@ -1662,7 +1662,7 @@ static int ns_send(struct atm_vcc *vcc, 
+@@ -1662,7 +1662,7 @@ static int ns_send(struct atm_vcc *vcc, struct sk_buff *skb)
        if (!vc->tx) {
                printk("nicstar%d: Trying to transmit on a non-tx VC.\n",
                       card->index);
@@ -24420,7 +25876,7 @@ diff -urNp linux-3.1.3/drivers/atm/nicstar.c linux-3.1.3/drivers/atm/nicstar.c
                dev_kfree_skb_any(skb);
                return -EINVAL;
        }
-@@ -1670,14 +1670,14 @@ static int ns_send(struct atm_vcc *vcc, 
+@@ -1670,14 +1670,14 @@ static int ns_send(struct atm_vcc *vcc, struct sk_buff *skb)
        if (vcc->qos.aal != ATM_AAL5 && vcc->qos.aal != ATM_AAL0) {
                printk("nicstar%d: Only AAL0 and AAL5 are supported.\n",
                       card->index);
@@ -24437,7 +25893,7 @@ diff -urNp linux-3.1.3/drivers/atm/nicstar.c linux-3.1.3/drivers/atm/nicstar.c
                dev_kfree_skb_any(skb);
                return -EINVAL;
        }
-@@ -1725,11 +1725,11 @@ static int ns_send(struct atm_vcc *vcc, 
+@@ -1725,11 +1725,11 @@ static int ns_send(struct atm_vcc *vcc, struct sk_buff *skb)
        }
  
        if (push_scqe(card, vc, scq, &scqe, skb) != 0) {
@@ -24451,7 +25907,7 @@ diff -urNp linux-3.1.3/drivers/atm/nicstar.c linux-3.1.3/drivers/atm/nicstar.c
  
        return 0;
  }
-@@ -2046,14 +2046,14 @@ static void dequeue_rx(ns_dev * card, ns
+@@ -2046,14 +2046,14 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe)
                                printk
                                    ("nicstar%d: Can't allocate buffers for aal0.\n",
                                     card->index);
@@ -24468,7 +25924,7 @@ diff -urNp linux-3.1.3/drivers/atm/nicstar.c linux-3.1.3/drivers/atm/nicstar.c
                                dev_kfree_skb_any(sb);
                                break;
                        }
-@@ -2068,7 +2068,7 @@ static void dequeue_rx(ns_dev * card, ns
+@@ -2068,7 +2068,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe)
                        ATM_SKB(sb)->vcc = vcc;
                        __net_timestamp(sb);
                        vcc->push(vcc, sb);
@@ -24477,7 +25933,7 @@ diff -urNp linux-3.1.3/drivers/atm/nicstar.c linux-3.1.3/drivers/atm/nicstar.c
                        cell += ATM_CELL_PAYLOAD;
                }
  
-@@ -2085,7 +2085,7 @@ static void dequeue_rx(ns_dev * card, ns
+@@ -2085,7 +2085,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe)
                        if (iovb == NULL) {
                                printk("nicstar%d: Out of iovec buffers.\n",
                                       card->index);
@@ -24486,7 +25942,7 @@ diff -urNp linux-3.1.3/drivers/atm/nicstar.c linux-3.1.3/drivers/atm/nicstar.c
                                recycle_rx_buf(card, skb);
                                return;
                        }
-@@ -2109,7 +2109,7 @@ static void dequeue_rx(ns_dev * card, ns
+@@ -2109,7 +2109,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe)
                   small or large buffer itself. */
        } else if (NS_PRV_IOVCNT(iovb) >= NS_MAX_IOVECS) {
                printk("nicstar%d: received too big AAL5 SDU.\n", card->index);
@@ -24495,7 +25951,7 @@ diff -urNp linux-3.1.3/drivers/atm/nicstar.c linux-3.1.3/drivers/atm/nicstar.c
                recycle_iovec_rx_bufs(card, (struct iovec *)iovb->data,
                                      NS_MAX_IOVECS);
                NS_PRV_IOVCNT(iovb) = 0;
-@@ -2129,7 +2129,7 @@ static void dequeue_rx(ns_dev * card, ns
+@@ -2129,7 +2129,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe)
                            ("nicstar%d: Expected a small buffer, and this is not one.\n",
                             card->index);
                        which_list(card, skb);
@@ -24504,7 +25960,7 @@ diff -urNp linux-3.1.3/drivers/atm/nicstar.c linux-3.1.3/drivers/atm/nicstar.c
                        recycle_rx_buf(card, skb);
                        vc->rx_iov = NULL;
                        recycle_iov_buf(card, iovb);
-@@ -2142,7 +2142,7 @@ static void dequeue_rx(ns_dev * card, ns
+@@ -2142,7 +2142,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe)
                            ("nicstar%d: Expected a large buffer, and this is not one.\n",
                             card->index);
                        which_list(card, skb);
@@ -24513,7 +25969,7 @@ diff -urNp linux-3.1.3/drivers/atm/nicstar.c linux-3.1.3/drivers/atm/nicstar.c
                        recycle_iovec_rx_bufs(card, (struct iovec *)iovb->data,
                                              NS_PRV_IOVCNT(iovb));
                        vc->rx_iov = NULL;
-@@ -2165,7 +2165,7 @@ static void dequeue_rx(ns_dev * card, ns
+@@ -2165,7 +2165,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe)
                                printk(" - PDU size mismatch.\n");
                        else
                                printk(".\n");
@@ -24522,7 +25978,7 @@ diff -urNp linux-3.1.3/drivers/atm/nicstar.c linux-3.1.3/drivers/atm/nicstar.c
                        recycle_iovec_rx_bufs(card, (struct iovec *)iovb->data,
                                              NS_PRV_IOVCNT(iovb));
                        vc->rx_iov = NULL;
-@@ -2179,7 +2179,7 @@ static void dequeue_rx(ns_dev * card, ns
+@@ -2179,7 +2179,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe)
                        /* skb points to a small buffer */
                        if (!atm_charge(vcc, skb->truesize)) {
                                push_rxbufs(card, skb);
@@ -24531,7 +25987,7 @@ diff -urNp linux-3.1.3/drivers/atm/nicstar.c linux-3.1.3/drivers/atm/nicstar.c
                        } else {
                                skb_put(skb, len);
                                dequeue_sm_buf(card, skb);
-@@ -2189,7 +2189,7 @@ static void dequeue_rx(ns_dev * card, ns
+@@ -2189,7 +2189,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe)
                                ATM_SKB(skb)->vcc = vcc;
                                __net_timestamp(skb);
                                vcc->push(vcc, skb);
@@ -24540,7 +25996,7 @@ diff -urNp linux-3.1.3/drivers/atm/nicstar.c linux-3.1.3/drivers/atm/nicstar.c
                        }
                } else if (NS_PRV_IOVCNT(iovb) == 2) {  /* One small plus one large buffer */
                        struct sk_buff *sb;
-@@ -2200,7 +2200,7 @@ static void dequeue_rx(ns_dev * card, ns
+@@ -2200,7 +2200,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe)
                        if (len <= NS_SMBUFSIZE) {
                                if (!atm_charge(vcc, sb->truesize)) {
                                        push_rxbufs(card, sb);
@@ -24549,7 +26005,7 @@ diff -urNp linux-3.1.3/drivers/atm/nicstar.c linux-3.1.3/drivers/atm/nicstar.c
                                } else {
                                        skb_put(sb, len);
                                        dequeue_sm_buf(card, sb);
-@@ -2210,7 +2210,7 @@ static void dequeue_rx(ns_dev * card, ns
+@@ -2210,7 +2210,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe)
                                        ATM_SKB(sb)->vcc = vcc;
                                        __net_timestamp(sb);
                                        vcc->push(vcc, sb);
@@ -24558,7 +26014,7 @@ diff -urNp linux-3.1.3/drivers/atm/nicstar.c linux-3.1.3/drivers/atm/nicstar.c
                                }
  
                                push_rxbufs(card, skb);
-@@ -2219,7 +2219,7 @@ static void dequeue_rx(ns_dev * card, ns
+@@ -2219,7 +2219,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe)
  
                                if (!atm_charge(vcc, skb->truesize)) {
                                        push_rxbufs(card, skb);
@@ -24567,7 +26023,7 @@ diff -urNp linux-3.1.3/drivers/atm/nicstar.c linux-3.1.3/drivers/atm/nicstar.c
                                } else {
                                        dequeue_lg_buf(card, skb);
  #ifdef NS_USE_DESTRUCTORS
-@@ -2232,7 +2232,7 @@ static void dequeue_rx(ns_dev * card, ns
+@@ -2232,7 +2232,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe)
                                        ATM_SKB(skb)->vcc = vcc;
                                        __net_timestamp(skb);
                                        vcc->push(vcc, skb);
@@ -24576,7 +26032,7 @@ diff -urNp linux-3.1.3/drivers/atm/nicstar.c linux-3.1.3/drivers/atm/nicstar.c
                                }
  
                                push_rxbufs(card, sb);
-@@ -2253,7 +2253,7 @@ static void dequeue_rx(ns_dev * card, ns
+@@ -2253,7 +2253,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe)
                                        printk
                                            ("nicstar%d: Out of huge buffers.\n",
                                             card->index);
@@ -24585,7 +26041,7 @@ diff -urNp linux-3.1.3/drivers/atm/nicstar.c linux-3.1.3/drivers/atm/nicstar.c
                                        recycle_iovec_rx_bufs(card,
                                                              (struct iovec *)
                                                              iovb->data,
-@@ -2304,7 +2304,7 @@ static void dequeue_rx(ns_dev * card, ns
+@@ -2304,7 +2304,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe)
                                        card->hbpool.count++;
                                } else
                                        dev_kfree_skb_any(hb);
@@ -24594,7 +26050,7 @@ diff -urNp linux-3.1.3/drivers/atm/nicstar.c linux-3.1.3/drivers/atm/nicstar.c
                        } else {
                                /* Copy the small buffer to the huge buffer */
                                sb = (struct sk_buff *)iov->iov_base;
-@@ -2341,7 +2341,7 @@ static void dequeue_rx(ns_dev * card, ns
+@@ -2341,7 +2341,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe)
  #endif /* NS_USE_DESTRUCTORS */
                                __net_timestamp(hb);
                                vcc->push(vcc, hb);
@@ -24603,9 +26059,10 @@ diff -urNp linux-3.1.3/drivers/atm/nicstar.c linux-3.1.3/drivers/atm/nicstar.c
                        }
                }
  
-diff -urNp linux-3.1.3/drivers/atm/solos-pci.c linux-3.1.3/drivers/atm/solos-pci.c
---- linux-3.1.3/drivers/atm/solos-pci.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/atm/solos-pci.c        2011-11-16 18:40:10.000000000 -0500
+diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
+index 5d1d076..4f31f42 100644
+--- a/drivers/atm/solos-pci.c
++++ b/drivers/atm/solos-pci.c
 @@ -714,7 +714,7 @@ void solos_bh(unsigned long card_arg)
                                }
                                atm_charge(vcc, skb->truesize);
@@ -24615,7 +26072,7 @@ diff -urNp linux-3.1.3/drivers/atm/solos-pci.c linux-3.1.3/drivers/atm/solos-pci
                                break;
  
                        case PKT_STATUS:
-@@ -899,6 +899,8 @@ static int print_buffer(struct sk_buff *
+@@ -899,6 +899,8 @@ static int print_buffer(struct sk_buff *buf)
        char msg[500];
        char item[10];
  
@@ -24624,7 +26081,7 @@ diff -urNp linux-3.1.3/drivers/atm/solos-pci.c linux-3.1.3/drivers/atm/solos-pci
        len = buf->len;
        for (i = 0; i < len; i++){
                if(i % 8 == 0)
-@@ -1008,7 +1010,7 @@ static uint32_t fpga_tx(struct solos_car
+@@ -1008,7 +1010,7 @@ static uint32_t fpga_tx(struct solos_card *card)
                        vcc = SKB_CB(oldskb)->vcc;
  
                        if (vcc) {
@@ -24633,9 +26090,10 @@ diff -urNp linux-3.1.3/drivers/atm/solos-pci.c linux-3.1.3/drivers/atm/solos-pci
                                solos_pop(vcc, oldskb);
                        } else
                                dev_kfree_skb_irq(oldskb);
-diff -urNp linux-3.1.3/drivers/atm/suni.c linux-3.1.3/drivers/atm/suni.c
---- linux-3.1.3/drivers/atm/suni.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/atm/suni.c     2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/atm/suni.c b/drivers/atm/suni.c
+index 90f1ccc..04c4a1e 100644
+--- a/drivers/atm/suni.c
++++ b/drivers/atm/suni.c
 @@ -50,8 +50,8 @@ static DEFINE_SPINLOCK(sunis_lock);
  
  
@@ -24647,10 +26105,11 @@ diff -urNp linux-3.1.3/drivers/atm/suni.c linux-3.1.3/drivers/atm/suni.c
  
  
  static void suni_hz(unsigned long from_timer)
-diff -urNp linux-3.1.3/drivers/atm/uPD98402.c linux-3.1.3/drivers/atm/uPD98402.c
---- linux-3.1.3/drivers/atm/uPD98402.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/atm/uPD98402.c 2011-11-16 18:39:07.000000000 -0500
-@@ -42,7 +42,7 @@ static int fetch_stats(struct atm_dev *d
+diff --git a/drivers/atm/uPD98402.c b/drivers/atm/uPD98402.c
+index 5120a96..e2572bd 100644
+--- a/drivers/atm/uPD98402.c
++++ b/drivers/atm/uPD98402.c
+@@ -42,7 +42,7 @@ static int fetch_stats(struct atm_dev *dev,struct sonet_stats __user *arg,int ze
        struct sonet_stats tmp;
        int error = 0;
  
@@ -24659,7 +26118,7 @@ diff -urNp linux-3.1.3/drivers/atm/uPD98402.c linux-3.1.3/drivers/atm/uPD98402.c
        sonet_copy_stats(&PRIV(dev)->sonet_stats,&tmp);
        if (arg) error = copy_to_user(arg,&tmp,sizeof(tmp));
        if (zero && !error) {
-@@ -161,9 +161,9 @@ static int uPD98402_ioctl(struct atm_dev
+@@ -161,9 +161,9 @@ static int uPD98402_ioctl(struct atm_dev *dev,unsigned int cmd,void __user *arg)
  
  
  #define ADD_LIMITED(s,v) \
@@ -24672,7 +26131,7 @@ diff -urNp linux-3.1.3/drivers/atm/uPD98402.c linux-3.1.3/drivers/atm/uPD98402.c
  
  
  static void stat_event(struct atm_dev *dev)
-@@ -194,7 +194,7 @@ static void uPD98402_int(struct atm_dev 
+@@ -194,7 +194,7 @@ static void uPD98402_int(struct atm_dev *dev)
                if (reason & uPD98402_INT_PFM) stat_event(dev);
                if (reason & uPD98402_INT_PCO) {
                        (void) GET(PCOCR); /* clear interrupt cause */
@@ -24681,7 +26140,7 @@ diff -urNp linux-3.1.3/drivers/atm/uPD98402.c linux-3.1.3/drivers/atm/uPD98402.c
                            &PRIV(dev)->sonet_stats.uncorr_hcs);
                }
                if ((reason & uPD98402_INT_RFO) && 
-@@ -222,9 +222,9 @@ static int uPD98402_start(struct atm_dev
+@@ -222,9 +222,9 @@ static int uPD98402_start(struct atm_dev *dev)
        PUT(~(uPD98402_INT_PFM | uPD98402_INT_ALM | uPD98402_INT_RFO |
          uPD98402_INT_LOS),PIMR); /* enable them */
        (void) fetch_stats(dev,NULL,1); /* clear kernel counters */
@@ -24694,10 +26153,11 @@ diff -urNp linux-3.1.3/drivers/atm/uPD98402.c linux-3.1.3/drivers/atm/uPD98402.c
        return 0;
  }
  
-diff -urNp linux-3.1.3/drivers/atm/zatm.c linux-3.1.3/drivers/atm/zatm.c
---- linux-3.1.3/drivers/atm/zatm.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/atm/zatm.c     2011-11-16 18:39:07.000000000 -0500
-@@ -460,7 +460,7 @@ printk("dummy: 0x%08lx, 0x%08lx\n",dummy
+diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c
+index d889f56..17eb71e 100644
+--- a/drivers/atm/zatm.c
++++ b/drivers/atm/zatm.c
+@@ -460,7 +460,7 @@ printk("dummy: 0x%08lx, 0x%08lx\n",dummy[0],dummy[1]);
                }
                if (!size) {
                        dev_kfree_skb_irq(skb);
@@ -24706,7 +26166,7 @@ diff -urNp linux-3.1.3/drivers/atm/zatm.c linux-3.1.3/drivers/atm/zatm.c
                        continue;
                }
                if (!atm_charge(vcc,skb->truesize)) {
-@@ -470,7 +470,7 @@ printk("dummy: 0x%08lx, 0x%08lx\n",dummy
+@@ -470,7 +470,7 @@ printk("dummy: 0x%08lx, 0x%08lx\n",dummy[0],dummy[1]);
                skb->len = size;
                ATM_SKB(skb)->vcc = vcc;
                vcc->push(vcc,skb);
@@ -24715,7 +26175,7 @@ diff -urNp linux-3.1.3/drivers/atm/zatm.c linux-3.1.3/drivers/atm/zatm.c
        }
        zout(pos & 0xffff,MTA(mbx));
  #if 0 /* probably a stupid idea */
-@@ -734,7 +734,7 @@ if (*ZATM_PRV_DSC(skb) != (uPD98401_TXPD
+@@ -734,7 +734,7 @@ if (*ZATM_PRV_DSC(skb) != (uPD98401_TXPD_V | uPD98401_TXPD_DP |
                        skb_queue_head(&zatm_vcc->backlog,skb);
                        break;
                }
@@ -24724,9 +26184,10 @@ diff -urNp linux-3.1.3/drivers/atm/zatm.c linux-3.1.3/drivers/atm/zatm.c
        wake_up(&zatm_vcc->tx_wait);
  }
  
-diff -urNp linux-3.1.3/drivers/base/devtmpfs.c linux-3.1.3/drivers/base/devtmpfs.c
---- linux-3.1.3/drivers/base/devtmpfs.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/base/devtmpfs.c        2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c
+index a4760e0..51283cf 100644
+--- a/drivers/base/devtmpfs.c
++++ b/drivers/base/devtmpfs.c
 @@ -368,7 +368,7 @@ int devtmpfs_mount(const char *mntdir)
        if (!thread)
                return 0;
@@ -24736,9 +26197,10 @@ diff -urNp linux-3.1.3/drivers/base/devtmpfs.c linux-3.1.3/drivers/base/devtmpfs
        if (err)
                printk(KERN_INFO "devtmpfs: error mounting %i\n", err);
        else
-diff -urNp linux-3.1.3/drivers/base/power/wakeup.c linux-3.1.3/drivers/base/power/wakeup.c
---- linux-3.1.3/drivers/base/power/wakeup.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/base/power/wakeup.c    2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c
+index 84f7c7d..37cfd87 100644
+--- a/drivers/base/power/wakeup.c
++++ b/drivers/base/power/wakeup.c
 @@ -29,14 +29,14 @@ bool events_check_enabled;
   * They need to be modified together atomically, so it's better to use one
   * atomic variable to hold them both.
@@ -24756,7 +26218,7 @@ diff -urNp linux-3.1.3/drivers/base/power/wakeup.c linux-3.1.3/drivers/base/powe
  
        *cnt = (comb >> IN_PROGRESS_BITS);
        *inpr = comb & MAX_IN_PROGRESS;
-@@ -350,7 +350,7 @@ static void wakeup_source_activate(struc
+@@ -350,7 +350,7 @@ static void wakeup_source_activate(struct wakeup_source *ws)
        ws->last_time = ktime_get();
  
        /* Increment the counter of events in progress. */
@@ -24765,7 +26227,7 @@ diff -urNp linux-3.1.3/drivers/base/power/wakeup.c linux-3.1.3/drivers/base/powe
  }
  
  /**
-@@ -440,7 +440,7 @@ static void wakeup_source_deactivate(str
+@@ -440,7 +440,7 @@ static void wakeup_source_deactivate(struct wakeup_source *ws)
         * Increment the counter of registered wakeup events and decrement the
         * couter of wakeup events in progress simultaneously.
         */
@@ -24774,10 +26236,24 @@ diff -urNp linux-3.1.3/drivers/base/power/wakeup.c linux-3.1.3/drivers/base/powe
  }
  
  /**
-diff -urNp linux-3.1.3/drivers/block/cciss.c linux-3.1.3/drivers/block/cciss.c
---- linux-3.1.3/drivers/block/cciss.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/block/cciss.c  2011-11-16 18:40:10.000000000 -0500
-@@ -1179,6 +1179,8 @@ static int cciss_ioctl32_passthru(struct
+diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c
+index e086fbb..398e1fe 100644
+--- a/drivers/block/DAC960.c
++++ b/drivers/block/DAC960.c
+@@ -1980,6 +1980,8 @@ static bool DAC960_V1_ReadDeviceConfiguration(DAC960_Controller_T
+   unsigned long flags;
+   int Channel, TargetID;
++  pax_track_stack();
++
+   if (!init_dma_loaf(Controller->PCIDevice, &local_dma, 
+               DAC960_V1_MaxChannels*(sizeof(DAC960_V1_DCDB_T) +
+                       sizeof(DAC960_SCSI_Inquiry_T) +
+diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
+index c2f9b3e..5911988 100644
+--- a/drivers/block/cciss.c
++++ b/drivers/block/cciss.c
+@@ -1179,6 +1179,8 @@ static int cciss_ioctl32_passthru(struct block_device *bdev, fmode_t mode,
        int err;
        u32 cp;
  
@@ -24825,7 +26301,7 @@ diff -urNp linux-3.1.3/drivers/block/cciss.c linux-3.1.3/drivers/block/cciss.c
                (h->interrupts_enabled == 0));
  }
  
-@@ -3465,7 +3467,7 @@ static inline u32 next_command(ctlr_info
+@@ -3465,7 +3467,7 @@ static inline u32 next_command(ctlr_info_t *h)
        u32 a;
  
        if (unlikely(!(h->transMethod & CFGTBL_Trans_Performant)))
@@ -24834,7 +26310,7 @@ diff -urNp linux-3.1.3/drivers/block/cciss.c linux-3.1.3/drivers/block/cciss.c
  
        if ((*(h->reply_pool_head) & 1) == (h->reply_pool_wraparound)) {
                a = *(h->reply_pool_head); /* Next cmd in ring buffer */
-@@ -4020,7 +4022,7 @@ static void __devinit cciss_put_controll
+@@ -4020,7 +4022,7 @@ static void __devinit cciss_put_controller_into_performant_mode(ctlr_info_t *h)
                trans_support & CFGTBL_Trans_use_short_tags);
  
        /* Change the access methods to the performant access methods */
@@ -24843,7 +26319,7 @@ diff -urNp linux-3.1.3/drivers/block/cciss.c linux-3.1.3/drivers/block/cciss.c
        h->transMethod = CFGTBL_Trans_Performant;
  
        return;
-@@ -4292,7 +4294,7 @@ static int __devinit cciss_pci_init(ctlr
+@@ -4292,7 +4294,7 @@ static int __devinit cciss_pci_init(ctlr_info_t *h)
        if (prod_index < 0)
                return -ENODEV;
        h->product_name = products[prod_index].product_name;
@@ -24891,7 +26367,7 @@ diff -urNp linux-3.1.3/drivers/block/cciss.c linux-3.1.3/drivers/block/cciss.c
  
        /* Get the firmware version */
        inq_buff = kzalloc(sizeof(InquiryData_struct), GFP_KERNEL);
-@@ -5178,7 +5180,7 @@ static void cciss_shutdown(struct pci_de
+@@ -5178,7 +5180,7 @@ static void cciss_shutdown(struct pci_dev *pdev)
        kfree(flush_buf);
        if (return_code != IO_OK)
                dev_warn(&h->pdev->dev, "Error flushing cache\n");
@@ -24900,9 +26376,10 @@ diff -urNp linux-3.1.3/drivers/block/cciss.c linux-3.1.3/drivers/block/cciss.c
        free_irq(h->intr[PERF_MODE_INT], h);
  }
  
-diff -urNp linux-3.1.3/drivers/block/cciss.h linux-3.1.3/drivers/block/cciss.h
---- linux-3.1.3/drivers/block/cciss.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/block/cciss.h  2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/block/cciss.h b/drivers/block/cciss.h
+index c049548..a09cb6e 100644
+--- a/drivers/block/cciss.h
++++ b/drivers/block/cciss.h
 @@ -100,7 +100,7 @@ struct ctlr_info
        /* information about each logical volume */
        drive_info_struct *drv[CISS_MAX_LUN];
@@ -24912,10 +26389,11 @@ diff -urNp linux-3.1.3/drivers/block/cciss.h linux-3.1.3/drivers/block/cciss.h
  
        /* queue and queue Info */ 
        struct list_head reqQ;
-diff -urNp linux-3.1.3/drivers/block/cpqarray.c linux-3.1.3/drivers/block/cpqarray.c
---- linux-3.1.3/drivers/block/cpqarray.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/block/cpqarray.c       2011-11-16 18:40:10.000000000 -0500
-@@ -404,7 +404,7 @@ static int __devinit cpqarray_register_c
+diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c
+index b2fceb5..87fec83 100644
+--- a/drivers/block/cpqarray.c
++++ b/drivers/block/cpqarray.c
+@@ -404,7 +404,7 @@ static int __devinit cpqarray_register_ctlr( int i, struct pci_dev *pdev)
        if (register_blkdev(COMPAQ_SMART2_MAJOR+i, hba[i]->devname)) {
                goto Enomem4;
        }
@@ -24924,7 +26402,7 @@ diff -urNp linux-3.1.3/drivers/block/cpqarray.c linux-3.1.3/drivers/block/cpqarr
        if (request_irq(hba[i]->intr, do_ida_intr,
                IRQF_DISABLED|IRQF_SHARED, hba[i]->devname, hba[i]))
        {
-@@ -459,7 +459,7 @@ static int __devinit cpqarray_register_c
+@@ -459,7 +459,7 @@ static int __devinit cpqarray_register_ctlr( int i, struct pci_dev *pdev)
        add_timer(&hba[i]->timer);
  
        /* Enable IRQ now that spinlock and rate limit timer are set up */
@@ -24942,7 +26420,7 @@ diff -urNp linux-3.1.3/drivers/block/cpqarray.c linux-3.1.3/drivers/block/cpqarr
                        break;
                }
        }
-@@ -792,7 +792,7 @@ static int __devinit cpqarray_eisa_detec
+@@ -792,7 +792,7 @@ static int __devinit cpqarray_eisa_detect(void)
                hba[ctlr]->intr = intr;
                sprintf(hba[ctlr]->devname, "ida%d", nr_ctlr);
                hba[ctlr]->product_name = products[j].product_name;
@@ -24951,7 +26429,7 @@ diff -urNp linux-3.1.3/drivers/block/cpqarray.c linux-3.1.3/drivers/block/cpqarr
                hba[ctlr]->ctlr = ctlr;
                hba[ctlr]->board_id = board_id;
                hba[ctlr]->pci_dev = NULL; /* not PCI */
-@@ -911,6 +911,8 @@ static void do_ida_request(struct reques
+@@ -911,6 +911,8 @@ static void do_ida_request(struct request_queue *q)
        struct scatterlist tmp_sg[SG_MAX];
        int i, dir, seg;
  
@@ -24978,7 +26456,7 @@ diff -urNp linux-3.1.3/drivers/block/cpqarray.c linux-3.1.3/drivers/block/cpqarr
  
                /* Get onto the completion Q */
                addQ(&h->cmpQ, c);
-@@ -1050,7 +1052,7 @@ static irqreturn_t do_ida_intr(int irq, 
+@@ -1050,7 +1052,7 @@ static irqreturn_t do_ida_intr(int irq, void *dev_id)
        unsigned long flags;
        __u32 a,a1;
  
@@ -24987,7 +26465,7 @@ diff -urNp linux-3.1.3/drivers/block/cpqarray.c linux-3.1.3/drivers/block/cpqarr
        /* Is this interrupt for us? */
        if (istat == 0)
                return IRQ_NONE;
-@@ -1061,7 +1063,7 @@ static irqreturn_t do_ida_intr(int irq, 
+@@ -1061,7 +1063,7 @@ static irqreturn_t do_ida_intr(int irq, void *dev_id)
         */
        spin_lock_irqsave(IDA_LOCK(h->ctlr), flags);
        if (istat & FIFO_NOT_EMPTY) {
@@ -25019,7 +26497,7 @@ diff -urNp linux-3.1.3/drivers/block/cpqarray.c linux-3.1.3/drivers/block/cpqarr
        complete = pollcomplete(ctlr);
        
        pci_unmap_single(info_p->pci_dev, (dma_addr_t) c->req.sg[0].addr, 
-@@ -1549,9 +1551,9 @@ static int revalidate_allvol(ctlr_info_t
+@@ -1549,9 +1551,9 @@ static int revalidate_allvol(ctlr_info_t *host)
         * we check the new geometry.  Then turn interrupts back on when
         * we're done.
         */
@@ -25040,9 +26518,10 @@ diff -urNp linux-3.1.3/drivers/block/cpqarray.c linux-3.1.3/drivers/block/cpqarr
                if (done == 0) {
                        udelay(10);     /* a short fixed delay */
                } else
-diff -urNp linux-3.1.3/drivers/block/cpqarray.h linux-3.1.3/drivers/block/cpqarray.h
---- linux-3.1.3/drivers/block/cpqarray.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/block/cpqarray.h       2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/block/cpqarray.h b/drivers/block/cpqarray.h
+index be73e9d..7fbf140 100644
+--- a/drivers/block/cpqarray.h
++++ b/drivers/block/cpqarray.h
 @@ -99,7 +99,7 @@ struct ctlr_info {
        drv_info_t      drv[NWD];
        struct proc_dir_entry *proc;
@@ -25052,21 +26531,10 @@ diff -urNp linux-3.1.3/drivers/block/cpqarray.h linux-3.1.3/drivers/block/cpqarr
  
        cmdlist_t *reqQ;
        cmdlist_t *cmpQ;
-diff -urNp linux-3.1.3/drivers/block/DAC960.c linux-3.1.3/drivers/block/DAC960.c
---- linux-3.1.3/drivers/block/DAC960.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/block/DAC960.c 2011-11-16 18:40:10.000000000 -0500
-@@ -1980,6 +1980,8 @@ static bool DAC960_V1_ReadDeviceConfigur
-   unsigned long flags;
-   int Channel, TargetID;
-+  pax_track_stack();
-+
-   if (!init_dma_loaf(Controller->PCIDevice, &local_dma, 
-               DAC960_V1_MaxChannels*(sizeof(DAC960_V1_DCDB_T) +
-                       sizeof(DAC960_SCSI_Inquiry_T) +
-diff -urNp linux-3.1.3/drivers/block/drbd/drbd_int.h linux-3.1.3/drivers/block/drbd/drbd_int.h
---- linux-3.1.3/drivers/block/drbd/drbd_int.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/block/drbd/drbd_int.h  2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
+index ef2ceed..c9cb18e 100644
+--- a/drivers/block/drbd/drbd_int.h
++++ b/drivers/block/drbd/drbd_int.h
 @@ -737,7 +737,7 @@ struct drbd_request;
  struct drbd_epoch {
        struct list_head list;
@@ -25085,7 +26553,7 @@ diff -urNp linux-3.1.3/drivers/block/drbd/drbd_int.h linux-3.1.3/drivers/block/d
        unsigned int peer_seq;
        spinlock_t peer_seq_lock;
        unsigned int minor;
-@@ -1618,30 +1618,30 @@ static inline int drbd_setsockopt(struct
+@@ -1618,30 +1618,30 @@ static inline int drbd_setsockopt(struct socket *sock, int level, int optname,
  
  static inline void drbd_tcp_cork(struct socket *sock)
  {
@@ -25124,10 +26592,11 @@ diff -urNp linux-3.1.3/drivers/block/drbd/drbd_int.h linux-3.1.3/drivers/block/d
  }
  
  void drbd_bump_write_ordering(struct drbd_conf *mdev, enum write_ordering_e wo);
-diff -urNp linux-3.1.3/drivers/block/drbd/drbd_main.c linux-3.1.3/drivers/block/drbd/drbd_main.c
---- linux-3.1.3/drivers/block/drbd/drbd_main.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/block/drbd/drbd_main.c 2011-11-16 18:39:07.000000000 -0500
-@@ -2397,7 +2397,7 @@ static int _drbd_send_ack(struct drbd_co
+diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
+index 0358e55..bc33689 100644
+--- a/drivers/block/drbd/drbd_main.c
++++ b/drivers/block/drbd/drbd_main.c
+@@ -2397,7 +2397,7 @@ static int _drbd_send_ack(struct drbd_conf *mdev, enum drbd_packets cmd,
        p.sector   = sector;
        p.block_id = block_id;
        p.blksize  = blksize;
@@ -25136,7 +26605,7 @@ diff -urNp linux-3.1.3/drivers/block/drbd/drbd_main.c linux-3.1.3/drivers/block/
  
        if (!mdev->meta.socket || mdev->state.conn < C_CONNECTED)
                return false;
-@@ -2696,7 +2696,7 @@ int drbd_send_dblock(struct drbd_conf *m
+@@ -2696,7 +2696,7 @@ int drbd_send_dblock(struct drbd_conf *mdev, struct drbd_request *req)
        p.sector   = cpu_to_be64(req->sector);
        p.block_id = (unsigned long)req;
        p.seq_num  = cpu_to_be32(req->seq_num =
@@ -25145,7 +26614,7 @@ diff -urNp linux-3.1.3/drivers/block/drbd/drbd_main.c linux-3.1.3/drivers/block/
  
        dp_flags = bio_flags_to_wire(mdev, req->master_bio->bi_rw);
  
-@@ -2981,7 +2981,7 @@ void drbd_init_set_defaults(struct drbd_
+@@ -2981,7 +2981,7 @@ void drbd_init_set_defaults(struct drbd_conf *mdev)
        atomic_set(&mdev->unacked_cnt, 0);
        atomic_set(&mdev->local_cnt, 0);
        atomic_set(&mdev->net_cnt, 0);
@@ -25154,7 +26623,7 @@ diff -urNp linux-3.1.3/drivers/block/drbd/drbd_main.c linux-3.1.3/drivers/block/
        atomic_set(&mdev->pp_in_use, 0);
        atomic_set(&mdev->pp_in_use_by_net, 0);
        atomic_set(&mdev->rs_sect_in, 0);
-@@ -3063,8 +3063,8 @@ void drbd_mdev_cleanup(struct drbd_conf 
+@@ -3063,8 +3063,8 @@ void drbd_mdev_cleanup(struct drbd_conf *mdev)
                                mdev->receiver.t_state);
  
        /* no need to lock it, I'm the only thread alive */
@@ -25165,10 +26634,11 @@ diff -urNp linux-3.1.3/drivers/block/drbd/drbd_main.c linux-3.1.3/drivers/block/
        mdev->al_writ_cnt  =
        mdev->bm_writ_cnt  =
        mdev->read_cnt     =
-diff -urNp linux-3.1.3/drivers/block/drbd/drbd_nl.c linux-3.1.3/drivers/block/drbd/drbd_nl.c
---- linux-3.1.3/drivers/block/drbd/drbd_nl.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/block/drbd/drbd_nl.c   2011-11-16 18:39:07.000000000 -0500
-@@ -2359,7 +2359,7 @@ static void drbd_connector_callback(stru
+diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
+index 0feab26..5d9b3dd 100644
+--- a/drivers/block/drbd/drbd_nl.c
++++ b/drivers/block/drbd/drbd_nl.c
+@@ -2359,7 +2359,7 @@ static void drbd_connector_callback(struct cn_msg *req, struct netlink_skb_parms
        module_put(THIS_MODULE);
  }
  
@@ -25177,7 +26647,7 @@ diff -urNp linux-3.1.3/drivers/block/drbd/drbd_nl.c linux-3.1.3/drivers/block/dr
  
  static unsigned short *
  __tl_add_blob(unsigned short *tl, enum drbd_tags tag, const void *data,
-@@ -2430,7 +2430,7 @@ void drbd_bcast_state(struct drbd_conf *
+@@ -2430,7 +2430,7 @@ void drbd_bcast_state(struct drbd_conf *mdev, union drbd_state state)
        cn_reply->id.idx = CN_IDX_DRBD;
        cn_reply->id.val = CN_VAL_DRBD;
  
@@ -25186,7 +26656,7 @@ diff -urNp linux-3.1.3/drivers/block/drbd/drbd_nl.c linux-3.1.3/drivers/block/dr
        cn_reply->ack = 0; /* not used here. */
        cn_reply->len = sizeof(struct drbd_nl_cfg_reply) +
                (int)((char *)tl - (char *)reply->tag_list);
-@@ -2462,7 +2462,7 @@ void drbd_bcast_ev_helper(struct drbd_co
+@@ -2462,7 +2462,7 @@ void drbd_bcast_ev_helper(struct drbd_conf *mdev, char *helper_name)
        cn_reply->id.idx = CN_IDX_DRBD;
        cn_reply->id.val = CN_VAL_DRBD;
  
@@ -25195,7 +26665,7 @@ diff -urNp linux-3.1.3/drivers/block/drbd/drbd_nl.c linux-3.1.3/drivers/block/dr
        cn_reply->ack = 0; /* not used here. */
        cn_reply->len = sizeof(struct drbd_nl_cfg_reply) +
                (int)((char *)tl - (char *)reply->tag_list);
-@@ -2540,7 +2540,7 @@ void drbd_bcast_ee(struct drbd_conf *mde
+@@ -2540,7 +2540,7 @@ void drbd_bcast_ee(struct drbd_conf *mdev,
        cn_reply->id.idx = CN_IDX_DRBD;
        cn_reply->id.val = CN_VAL_DRBD;
  
@@ -25204,7 +26674,7 @@ diff -urNp linux-3.1.3/drivers/block/drbd/drbd_nl.c linux-3.1.3/drivers/block/dr
        cn_reply->ack = 0; // not used here.
        cn_reply->len = sizeof(struct drbd_nl_cfg_reply) +
                (int)((char*)tl - (char*)reply->tag_list);
-@@ -2579,7 +2579,7 @@ void drbd_bcast_sync_progress(struct drb
+@@ -2579,7 +2579,7 @@ void drbd_bcast_sync_progress(struct drbd_conf *mdev)
        cn_reply->id.idx = CN_IDX_DRBD;
        cn_reply->id.val = CN_VAL_DRBD;
  
@@ -25213,9 +26683,10 @@ diff -urNp linux-3.1.3/drivers/block/drbd/drbd_nl.c linux-3.1.3/drivers/block/dr
        cn_reply->ack = 0; /* not used here. */
        cn_reply->len = sizeof(struct drbd_nl_cfg_reply) +
                (int)((char *)tl - (char *)reply->tag_list);
-diff -urNp linux-3.1.3/drivers/block/drbd/drbd_receiver.c linux-3.1.3/drivers/block/drbd/drbd_receiver.c
---- linux-3.1.3/drivers/block/drbd/drbd_receiver.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/block/drbd/drbd_receiver.c     2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
+index 43beaca..4a5b1dd 100644
+--- a/drivers/block/drbd/drbd_receiver.c
++++ b/drivers/block/drbd/drbd_receiver.c
 @@ -894,7 +894,7 @@ retry:
        sock->sk->sk_sndtimeo = mdev->net_conf->timeout*HZ/10;
        sock->sk->sk_rcvtimeo = MAX_SCHEDULE_TIMEOUT;
@@ -25225,7 +26696,7 @@ diff -urNp linux-3.1.3/drivers/block/drbd/drbd_receiver.c linux-3.1.3/drivers/bl
        mdev->peer_seq = 0;
  
        drbd_thread_start(&mdev->asender);
-@@ -985,7 +985,7 @@ static enum finish_epoch drbd_may_finish
+@@ -985,7 +985,7 @@ static enum finish_epoch drbd_may_finish_epoch(struct drbd_conf *mdev,
        do {
                next_epoch = NULL;
  
@@ -25234,7 +26705,7 @@ diff -urNp linux-3.1.3/drivers/block/drbd/drbd_receiver.c linux-3.1.3/drivers/bl
  
                switch (ev & ~EV_CLEANUP) {
                case EV_PUT:
-@@ -1020,7 +1020,7 @@ static enum finish_epoch drbd_may_finish
+@@ -1020,7 +1020,7 @@ static enum finish_epoch drbd_may_finish_epoch(struct drbd_conf *mdev,
                                        rv = FE_DESTROYED;
                        } else {
                                epoch->flags = 0;
@@ -25243,7 +26714,7 @@ diff -urNp linux-3.1.3/drivers/block/drbd/drbd_receiver.c linux-3.1.3/drivers/bl
                                /* atomic_set(&epoch->active, 0); is already zero */
                                if (rv == FE_STILL_LIVE)
                                        rv = FE_RECYCLED;
-@@ -1191,14 +1191,14 @@ static int receive_Barrier(struct drbd_c
+@@ -1191,14 +1191,14 @@ static int receive_Barrier(struct drbd_conf *mdev, enum drbd_packets cmd, unsign
                drbd_wait_ee_list_empty(mdev, &mdev->active_ee);
                drbd_flush(mdev);
  
@@ -25260,7 +26731,7 @@ diff -urNp linux-3.1.3/drivers/block/drbd/drbd_receiver.c linux-3.1.3/drivers/bl
  
                D_ASSERT(atomic_read(&epoch->active) == 0);
                D_ASSERT(epoch->flags == 0);
-@@ -1210,11 +1210,11 @@ static int receive_Barrier(struct drbd_c
+@@ -1210,11 +1210,11 @@ static int receive_Barrier(struct drbd_conf *mdev, enum drbd_packets cmd, unsign
        }
  
        epoch->flags = 0;
@@ -25274,7 +26745,7 @@ diff -urNp linux-3.1.3/drivers/block/drbd/drbd_receiver.c linux-3.1.3/drivers/bl
                list_add(&epoch->list, &mdev->current_epoch->list);
                mdev->current_epoch = epoch;
                mdev->epochs++;
-@@ -1663,7 +1663,7 @@ static int receive_Data(struct drbd_conf
+@@ -1663,7 +1663,7 @@ static int receive_Data(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned
                spin_unlock(&mdev->peer_seq_lock);
  
                drbd_send_ack_dp(mdev, P_NEG_ACK, p, data_size);
@@ -25283,7 +26754,7 @@ diff -urNp linux-3.1.3/drivers/block/drbd/drbd_receiver.c linux-3.1.3/drivers/bl
                return drbd_drain_block(mdev, data_size);
        }
  
-@@ -1689,7 +1689,7 @@ static int receive_Data(struct drbd_conf
+@@ -1689,7 +1689,7 @@ static int receive_Data(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned
  
        spin_lock(&mdev->epoch_lock);
        e->epoch = mdev->current_epoch;
@@ -25292,7 +26763,7 @@ diff -urNp linux-3.1.3/drivers/block/drbd/drbd_receiver.c linux-3.1.3/drivers/bl
        atomic_inc(&e->epoch->active);
        spin_unlock(&mdev->epoch_lock);
  
-@@ -3885,7 +3885,7 @@ static void drbd_disconnect(struct drbd_
+@@ -3885,7 +3885,7 @@ static void drbd_disconnect(struct drbd_conf *mdev)
        D_ASSERT(list_empty(&mdev->done_ee));
  
        /* ok, no more ee's on the fly, it is safe to reset the epoch_size */
@@ -25301,10 +26772,11 @@ diff -urNp linux-3.1.3/drivers/block/drbd/drbd_receiver.c linux-3.1.3/drivers/bl
        D_ASSERT(list_empty(&mdev->current_epoch->list));
  }
  
-diff -urNp linux-3.1.3/drivers/block/loop.c linux-3.1.3/drivers/block/loop.c
---- linux-3.1.3/drivers/block/loop.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/block/loop.c   2011-11-16 18:39:07.000000000 -0500
-@@ -283,7 +283,7 @@ static int __do_lo_send_write(struct fil
+diff --git a/drivers/block/loop.c b/drivers/block/loop.c
+index 4720c7a..2c49af1 100644
+--- a/drivers/block/loop.c
++++ b/drivers/block/loop.c
+@@ -283,7 +283,7 @@ static int __do_lo_send_write(struct file *file,
        mm_segment_t old_fs = get_fs();
  
        set_fs(get_ds());
@@ -25313,10 +26785,11 @@ diff -urNp linux-3.1.3/drivers/block/loop.c linux-3.1.3/drivers/block/loop.c
        set_fs(old_fs);
        if (likely(bw == len))
                return 0;
-diff -urNp linux-3.1.3/drivers/block/nbd.c linux-3.1.3/drivers/block/nbd.c
---- linux-3.1.3/drivers/block/nbd.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/block/nbd.c    2011-11-16 18:40:10.000000000 -0500
-@@ -157,6 +157,8 @@ static int sock_xmit(struct nbd_device *
+diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
+index f533f33..6177bcb 100644
+--- a/drivers/block/nbd.c
++++ b/drivers/block/nbd.c
+@@ -157,6 +157,8 @@ static int sock_xmit(struct nbd_device *lo, int send, void *buf, int size,
        struct kvec iov;
        sigset_t blocked, oldset;
  
@@ -25325,7 +26798,7 @@ diff -urNp linux-3.1.3/drivers/block/nbd.c linux-3.1.3/drivers/block/nbd.c
        if (unlikely(!sock)) {
                printk(KERN_ERR "%s: Attempted %s on closed socket in sock_xmit\n",
                       lo->disk->disk_name, (send ? "send" : "recv"));
-@@ -572,6 +574,8 @@ static void do_nbd_request(struct reques
+@@ -572,6 +574,8 @@ static void do_nbd_request(struct request_queue *q)
  static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *lo,
                       unsigned int cmd, unsigned long arg)
  {
@@ -25334,10 +26807,33 @@ diff -urNp linux-3.1.3/drivers/block/nbd.c linux-3.1.3/drivers/block/nbd.c
        switch (cmd) {
        case NBD_DISCONNECT: {
                struct request sreq;
-diff -urNp linux-3.1.3/drivers/char/agp/frontend.c linux-3.1.3/drivers/char/agp/frontend.c
---- linux-3.1.3/drivers/char/agp/frontend.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/char/agp/frontend.c    2011-11-16 18:39:07.000000000 -0500
-@@ -817,7 +817,7 @@ static int agpioc_reserve_wrap(struct ag
+diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
+index 423fd56..06d3be0 100644
+--- a/drivers/char/Kconfig
++++ b/drivers/char/Kconfig
+@@ -8,7 +8,8 @@ source "drivers/tty/Kconfig"
+ config DEVKMEM
+       bool "/dev/kmem virtual device support"
+-      default y
++      default n
++      depends on !GRKERNSEC_KMEM
+       help
+         Say Y here if you want to support the /dev/kmem device. The
+         /dev/kmem device is rarely used, but can be used for certain
+@@ -596,6 +597,7 @@ config DEVPORT
+       bool
+       depends on !M68K
+       depends on ISA || PCI
++      depends on !GRKERNSEC_KMEM
+       default y
+ source "drivers/s390/char/Kconfig"
+diff --git a/drivers/char/agp/frontend.c b/drivers/char/agp/frontend.c
+index 2e04433..22afc64 100644
+--- a/drivers/char/agp/frontend.c
++++ b/drivers/char/agp/frontend.c
+@@ -817,7 +817,7 @@ static int agpioc_reserve_wrap(struct agp_file_private *priv, void __user *arg)
        if (copy_from_user(&reserve, arg, sizeof(struct agp_region)))
                return -EFAULT;
  
@@ -25346,9 +26842,10 @@ diff -urNp linux-3.1.3/drivers/char/agp/frontend.c linux-3.1.3/drivers/char/agp/
                return -EFAULT;
  
        client = agp_find_client_by_pid(reserve.pid);
-diff -urNp linux-3.1.3/drivers/char/briq_panel.c linux-3.1.3/drivers/char/briq_panel.c
---- linux-3.1.3/drivers/char/briq_panel.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/char/briq_panel.c      2011-11-16 18:40:10.000000000 -0500
+diff --git a/drivers/char/briq_panel.c b/drivers/char/briq_panel.c
+index 095ab90..afad0a4 100644
+--- a/drivers/char/briq_panel.c
++++ b/drivers/char/briq_panel.c
 @@ -9,6 +9,7 @@
  #include <linux/types.h>
  #include <linux/errno.h>
@@ -25365,7 +26862,7 @@ diff -urNp linux-3.1.3/drivers/char/briq_panel.c linux-3.1.3/drivers/char/briq_p
  
  static void update_vfd(void)
  {
-@@ -140,12 +142,15 @@ static ssize_t briq_panel_write(struct f
+@@ -140,12 +142,15 @@ static ssize_t briq_panel_write(struct file *file, const char __user *buf, size_
        if (!vfd_is_open)
                return -EBUSY;
  
@@ -25382,7 +26879,7 @@ diff -urNp linux-3.1.3/drivers/char/briq_panel.c linux-3.1.3/drivers/char/briq_p
                if (esc) {
                        set_led(c);
                        esc = 0;
-@@ -175,6 +180,7 @@ static ssize_t briq_panel_write(struct f
+@@ -175,6 +180,7 @@ static ssize_t briq_panel_write(struct file *file, const char __user *buf, size_
                buf++;
        }
        update_vfd();
@@ -25390,10 +26887,11 @@ diff -urNp linux-3.1.3/drivers/char/briq_panel.c linux-3.1.3/drivers/char/briq_p
  
        return len;
  }
-diff -urNp linux-3.1.3/drivers/char/genrtc.c linux-3.1.3/drivers/char/genrtc.c
---- linux-3.1.3/drivers/char/genrtc.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/char/genrtc.c  2011-11-16 18:40:10.000000000 -0500
-@@ -273,6 +273,7 @@ static int gen_rtc_ioctl(struct file *fi
+diff --git a/drivers/char/genrtc.c b/drivers/char/genrtc.c
+index f773a9d..65cd683 100644
+--- a/drivers/char/genrtc.c
++++ b/drivers/char/genrtc.c
+@@ -273,6 +273,7 @@ static int gen_rtc_ioctl(struct file *file,
        switch (cmd) {
  
        case RTC_PLL_GET:
@@ -25401,10 +26899,11 @@ diff -urNp linux-3.1.3/drivers/char/genrtc.c linux-3.1.3/drivers/char/genrtc.c
            if (get_rtc_pll(&pll))
                    return -EINVAL;
            else
-diff -urNp linux-3.1.3/drivers/char/hpet.c linux-3.1.3/drivers/char/hpet.c
---- linux-3.1.3/drivers/char/hpet.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/char/hpet.c    2011-11-16 18:39:07.000000000 -0500
-@@ -572,7 +572,7 @@ static inline unsigned long hpet_time_di
+diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
+index 0833896..cccce52 100644
+--- a/drivers/char/hpet.c
++++ b/drivers/char/hpet.c
+@@ -572,7 +572,7 @@ static inline unsigned long hpet_time_div(struct hpets *hpets,
  }
  
  static int
@@ -25413,9 +26912,10 @@ diff -urNp linux-3.1.3/drivers/char/hpet.c linux-3.1.3/drivers/char/hpet.c
                  struct hpet_info *info)
  {
        struct hpet_timer __iomem *timer;
-diff -urNp linux-3.1.3/drivers/char/ipmi/ipmi_msghandler.c linux-3.1.3/drivers/char/ipmi/ipmi_msghandler.c
---- linux-3.1.3/drivers/char/ipmi/ipmi_msghandler.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/char/ipmi/ipmi_msghandler.c    2011-11-16 18:40:10.000000000 -0500
+diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
+index 58c0e63..25aed94 100644
+--- a/drivers/char/ipmi/ipmi_msghandler.c
++++ b/drivers/char/ipmi/ipmi_msghandler.c
 @@ -415,7 +415,7 @@ struct ipmi_smi {
        struct proc_dir_entry *proc_dir;
        char                  proc_dir_name[10];
@@ -25437,7 +26937,7 @@ diff -urNp linux-3.1.3/drivers/char/ipmi/ipmi_msghandler.c linux-3.1.3/drivers/c
  
  static int is_lan_addr(struct ipmi_addr *addr)
  {
-@@ -2868,7 +2868,7 @@ int ipmi_register_smi(struct ipmi_smi_ha
+@@ -2868,7 +2868,7 @@ int ipmi_register_smi(struct ipmi_smi_handlers *handlers,
        INIT_LIST_HEAD(&intf->cmd_rcvrs);
        init_waitqueue_head(&intf->waitq);
        for (i = 0; i < IPMI_NUM_STATS; i++)
@@ -25455,9 +26955,10 @@ diff -urNp linux-3.1.3/drivers/char/ipmi/ipmi_msghandler.c linux-3.1.3/drivers/c
        si = (struct ipmi_system_interface_addr *) &addr;
        si->addr_type = IPMI_SYSTEM_INTERFACE_ADDR_TYPE;
        si->channel = IPMI_BMC_CHANNEL;
-diff -urNp linux-3.1.3/drivers/char/ipmi/ipmi_si_intf.c linux-3.1.3/drivers/char/ipmi/ipmi_si_intf.c
---- linux-3.1.3/drivers/char/ipmi/ipmi_si_intf.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/char/ipmi/ipmi_si_intf.c       2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
+index 9397ab4..d01bee1 100644
+--- a/drivers/char/ipmi/ipmi_si_intf.c
++++ b/drivers/char/ipmi/ipmi_si_intf.c
 @@ -277,7 +277,7 @@ struct smi_info {
        unsigned char slave_addr;
  
@@ -25479,7 +26980,7 @@ diff -urNp linux-3.1.3/drivers/char/ipmi/ipmi_si_intf.c linux-3.1.3/drivers/char
  
  #define SI_MAX_PARMS 4
  
-@@ -3230,7 +3230,7 @@ static int try_smi_init(struct smi_info 
+@@ -3230,7 +3230,7 @@ static int try_smi_init(struct smi_info *new_smi)
        atomic_set(&new_smi->req_events, 0);
        new_smi->run_to_completion = 0;
        for (i = 0; i < SI_NUM_STATS; i++)
@@ -25488,31 +26989,11 @@ diff -urNp linux-3.1.3/drivers/char/ipmi/ipmi_si_intf.c linux-3.1.3/drivers/char
  
        new_smi->interrupt_disabled = 1;
        atomic_set(&new_smi->stop_operation, 0);
-diff -urNp linux-3.1.3/drivers/char/Kconfig linux-3.1.3/drivers/char/Kconfig
---- linux-3.1.3/drivers/char/Kconfig   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/char/Kconfig   2011-11-16 18:40:10.000000000 -0500
-@@ -8,7 +8,8 @@ source "drivers/tty/Kconfig"
- config DEVKMEM
-       bool "/dev/kmem virtual device support"
--      default y
-+      default n
-+      depends on !GRKERNSEC_KMEM
-       help
-         Say Y here if you want to support the /dev/kmem device. The
-         /dev/kmem device is rarely used, but can be used for certain
-@@ -596,6 +597,7 @@ config DEVPORT
-       bool
-       depends on !M68K
-       depends on ISA || PCI
-+      depends on !GRKERNSEC_KMEM
-       default y
- source "drivers/s390/char/Kconfig"
-diff -urNp linux-3.1.3/drivers/char/mbcs.c linux-3.1.3/drivers/char/mbcs.c
---- linux-3.1.3/drivers/char/mbcs.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/char/mbcs.c    2011-11-16 18:39:07.000000000 -0500
-@@ -800,7 +800,7 @@ static int mbcs_remove(struct cx_dev *de
+diff --git a/drivers/char/mbcs.c b/drivers/char/mbcs.c
+index 1aeaaba..e018570 100644
+--- a/drivers/char/mbcs.c
++++ b/drivers/char/mbcs.c
+@@ -800,7 +800,7 @@ static int mbcs_remove(struct cx_dev *dev)
        return 0;
  }
  
@@ -25521,9 +27002,10 @@ diff -urNp linux-3.1.3/drivers/char/mbcs.c linux-3.1.3/drivers/char/mbcs.c
        {
         .part_num = MBCS_PART_NUM,
         .mfg_num = MBCS_MFG_NUM,
-diff -urNp linux-3.1.3/drivers/char/mem.c linux-3.1.3/drivers/char/mem.c
---- linux-3.1.3/drivers/char/mem.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/char/mem.c     2011-11-17 18:31:56.000000000 -0500
+diff --git a/drivers/char/mem.c b/drivers/char/mem.c
+index 8fc04b4..cebdeec 100644
+--- a/drivers/char/mem.c
++++ b/drivers/char/mem.c
 @@ -18,6 +18,7 @@
  #include <linux/raw.h>
  #include <linux/tty.h>
@@ -25543,7 +27025,7 @@ diff -urNp linux-3.1.3/drivers/char/mem.c linux-3.1.3/drivers/char/mem.c
  static inline unsigned long size_inside_page(unsigned long start,
                                             unsigned long size)
  {
-@@ -65,9 +70,13 @@ static inline int range_is_allowed(unsig
+@@ -65,9 +70,13 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size)
  
        while (cursor < to) {
                if (!devmem_is_allowed(pfn)) {
@@ -25557,7 +27039,7 @@ diff -urNp linux-3.1.3/drivers/char/mem.c linux-3.1.3/drivers/char/mem.c
                        return 0;
                }
                cursor += PAGE_SIZE;
-@@ -75,6 +84,11 @@ static inline int range_is_allowed(unsig
+@@ -75,6 +84,11 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size)
        }
        return 1;
  }
@@ -25569,7 +27051,7 @@ diff -urNp linux-3.1.3/drivers/char/mem.c linux-3.1.3/drivers/char/mem.c
  #else
  static inline int range_is_allowed(unsigned long pfn, unsigned long size)
  {
-@@ -117,6 +131,7 @@ static ssize_t read_mem(struct file *fil
+@@ -117,6 +131,7 @@ static ssize_t read_mem(struct file *file, char __user *buf,
  
        while (count > 0) {
                unsigned long remaining;
@@ -25577,7 +27059,7 @@ diff -urNp linux-3.1.3/drivers/char/mem.c linux-3.1.3/drivers/char/mem.c
  
                sz = size_inside_page(p, count);
  
-@@ -132,7 +147,23 @@ static ssize_t read_mem(struct file *fil
+@@ -132,7 +147,23 @@ static ssize_t read_mem(struct file *file, char __user *buf,
                if (!ptr)
                        return -EFAULT;
  
@@ -25602,7 +27084,7 @@ diff -urNp linux-3.1.3/drivers/char/mem.c linux-3.1.3/drivers/char/mem.c
                unxlate_dev_mem_ptr(p, ptr);
                if (remaining)
                        return -EFAULT;
-@@ -395,9 +426,8 @@ static ssize_t read_kmem(struct file *fi
+@@ -395,9 +426,8 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
                         size_t count, loff_t *ppos)
  {
        unsigned long p = *ppos;
@@ -25613,7 +27095,7 @@ diff -urNp linux-3.1.3/drivers/char/mem.c linux-3.1.3/drivers/char/mem.c
  
        read = 0;
        if (p < (unsigned long) high_memory) {
-@@ -419,6 +449,8 @@ static ssize_t read_kmem(struct file *fi
+@@ -419,6 +449,8 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
                }
  #endif
                while (low_count > 0) {
@@ -25622,7 +27104,7 @@ diff -urNp linux-3.1.3/drivers/char/mem.c linux-3.1.3/drivers/char/mem.c
                        sz = size_inside_page(p, low_count);
  
                        /*
-@@ -428,7 +460,22 @@ static ssize_t read_kmem(struct file *fi
+@@ -428,7 +460,22 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
                         */
                        kbuf = xlate_dev_kmem_ptr((char *)p);
  
@@ -25656,10 +27138,11 @@ diff -urNp linux-3.1.3/drivers/char/mem.c linux-3.1.3/drivers/char/mem.c
  };
  
  static int memory_open(struct inode *inode, struct file *filp)
-diff -urNp linux-3.1.3/drivers/char/nvram.c linux-3.1.3/drivers/char/nvram.c
---- linux-3.1.3/drivers/char/nvram.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/char/nvram.c   2011-11-16 18:39:07.000000000 -0500
-@@ -248,7 +248,7 @@ static ssize_t nvram_read(struct file *f
+diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c
+index da3cfee..a5a6606 100644
+--- a/drivers/char/nvram.c
++++ b/drivers/char/nvram.c
+@@ -248,7 +248,7 @@ static ssize_t nvram_read(struct file *file, char __user *buf,
  
        spin_unlock_irq(&rtc_lock);
  
@@ -25668,9 +27151,10 @@ diff -urNp linux-3.1.3/drivers/char/nvram.c linux-3.1.3/drivers/char/nvram.c
                return -EFAULT;
  
        *ppos = i;
-diff -urNp linux-3.1.3/drivers/char/random.c linux-3.1.3/drivers/char/random.c
---- linux-3.1.3/drivers/char/random.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/char/random.c  2011-11-16 18:40:10.000000000 -0500
+diff --git a/drivers/char/random.c b/drivers/char/random.c
+index c35a785..6d82202 100644
+--- a/drivers/char/random.c
++++ b/drivers/char/random.c
 @@ -261,8 +261,13 @@
  /*
   * Configuration information
@@ -25703,7 +27187,7 @@ diff -urNp linux-3.1.3/drivers/char/random.c linux-3.1.3/drivers/char/random.c
  #if 0
        /* x^2048 + x^1638 + x^1231 + x^819 + x^411 + x + 1  -- 115 */
        { 2048, 1638,   1231,   819,    411,    1 },
-@@ -909,7 +921,7 @@ static ssize_t extract_entropy_user(stru
+@@ -909,7 +921,7 @@ static ssize_t extract_entropy_user(struct entropy_store *r, void __user *buf,
  
                extract_buf(r, tmp);
                i = min_t(int, nbytes, EXTRACT_SIZE);
@@ -25721,9 +27205,10 @@ diff -urNp linux-3.1.3/drivers/char/random.c linux-3.1.3/drivers/char/random.c
  static int max_write_thresh = INPUT_POOL_WORDS * 32;
  static char sysctl_bootid[16];
  
-diff -urNp linux-3.1.3/drivers/char/sonypi.c linux-3.1.3/drivers/char/sonypi.c
---- linux-3.1.3/drivers/char/sonypi.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/char/sonypi.c  2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c
+index 1ee8ce7..b778bef 100644
+--- a/drivers/char/sonypi.c
++++ b/drivers/char/sonypi.c
 @@ -55,6 +55,7 @@
  #include <asm/uaccess.h>
  #include <asm/io.h>
@@ -25741,7 +27226,7 @@ diff -urNp linux-3.1.3/drivers/char/sonypi.c linux-3.1.3/drivers/char/sonypi.c
        int model;
        struct input_dev *input_jog_dev;
        struct input_dev *input_key_dev;
-@@ -898,7 +899,7 @@ static int sonypi_misc_fasync(int fd, st
+@@ -898,7 +899,7 @@ static int sonypi_misc_fasync(int fd, struct file *filp, int on)
  static int sonypi_misc_release(struct inode *inode, struct file *file)
  {
        mutex_lock(&sonypi_device.lock);
@@ -25750,7 +27235,7 @@ diff -urNp linux-3.1.3/drivers/char/sonypi.c linux-3.1.3/drivers/char/sonypi.c
        mutex_unlock(&sonypi_device.lock);
        return 0;
  }
-@@ -907,9 +908,9 @@ static int sonypi_misc_open(struct inode
+@@ -907,9 +908,9 @@ static int sonypi_misc_open(struct inode *inode, struct file *file)
  {
        mutex_lock(&sonypi_device.lock);
        /* Flush input queue on first open */
@@ -25762,10 +27247,33 @@ diff -urNp linux-3.1.3/drivers/char/sonypi.c linux-3.1.3/drivers/char/sonypi.c
        mutex_unlock(&sonypi_device.lock);
  
        return 0;
-diff -urNp linux-3.1.3/drivers/char/tpm/tpm_bios.c linux-3.1.3/drivers/char/tpm/tpm_bios.c
---- linux-3.1.3/drivers/char/tpm/tpm_bios.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/char/tpm/tpm_bios.c    2011-11-16 18:39:07.000000000 -0500
-@@ -173,7 +173,7 @@ static void *tpm_bios_measurements_start
+diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
+index 9ca5c02..7ce352c 100644
+--- a/drivers/char/tpm/tpm.c
++++ b/drivers/char/tpm/tpm.c
+@@ -414,7 +414,7 @@ static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf,
+                   chip->vendor.req_complete_val)
+                       goto out_recv;
+-              if ((status == chip->vendor.req_canceled)) {
++              if (status == chip->vendor.req_canceled) {
+                       dev_err(chip->dev, "Operation Canceled\n");
+                       rc = -ECANCELED;
+                       goto out;
+@@ -862,6 +862,8 @@ ssize_t tpm_show_pubek(struct device *dev, struct device_attribute *attr,
+       struct tpm_chip *chip = dev_get_drvdata(dev);
++      pax_track_stack();
++
+       tpm_cmd.header.in = tpm_readpubek_header;
+       err = transmit_cmd(chip, &tpm_cmd, READ_PUBEK_RESULT_SIZE,
+                       "attempting to read the PUBEK");
+diff --git a/drivers/char/tpm/tpm_bios.c b/drivers/char/tpm/tpm_bios.c
+index 0636520..169c1d0 100644
+--- a/drivers/char/tpm/tpm_bios.c
++++ b/drivers/char/tpm/tpm_bios.c
+@@ -173,7 +173,7 @@ static void *tpm_bios_measurements_start(struct seq_file *m, loff_t *pos)
        event = addr;
  
        if ((event->event_type == 0 && event->event_size == 0) ||
@@ -25774,7 +27282,7 @@ diff -urNp linux-3.1.3/drivers/char/tpm/tpm_bios.c linux-3.1.3/drivers/char/tpm/
                return NULL;
  
        return addr;
-@@ -198,7 +198,7 @@ static void *tpm_bios_measurements_next(
+@@ -198,7 +198,7 @@ static void *tpm_bios_measurements_next(struct seq_file *m, void *v,
                return NULL;
  
        if ((event->event_type == 0 && event->event_size == 0) ||
@@ -25783,7 +27291,7 @@ diff -urNp linux-3.1.3/drivers/char/tpm/tpm_bios.c linux-3.1.3/drivers/char/tpm/
                return NULL;
  
        (*pos)++;
-@@ -291,7 +291,8 @@ static int tpm_binary_bios_measurements_
+@@ -291,7 +291,8 @@ static int tpm_binary_bios_measurements_show(struct seq_file *m, void *v)
        int i;
  
        for (i = 0; i < sizeof(struct tcpa_event) + event->event_size; i++)
@@ -25793,7 +27301,7 @@ diff -urNp linux-3.1.3/drivers/char/tpm/tpm_bios.c linux-3.1.3/drivers/char/tpm/
  
        return 0;
  }
-@@ -410,8 +411,13 @@ static int read_log(struct tpm_bios_log 
+@@ -410,8 +411,13 @@ static int read_log(struct tpm_bios_log *log)
        log->bios_event_log_end = log->bios_event_log + len;
  
        virt = acpi_os_map_memory(start, len);
@@ -25808,31 +27316,11 @@ diff -urNp linux-3.1.3/drivers/char/tpm/tpm_bios.c linux-3.1.3/drivers/char/tpm/
  
        acpi_os_unmap_memory(virt, len);
        return 0;
-diff -urNp linux-3.1.3/drivers/char/tpm/tpm.c linux-3.1.3/drivers/char/tpm/tpm.c
---- linux-3.1.3/drivers/char/tpm/tpm.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/char/tpm/tpm.c 2011-11-16 18:40:10.000000000 -0500
-@@ -414,7 +414,7 @@ static ssize_t tpm_transmit(struct tpm_c
-                   chip->vendor.req_complete_val)
-                       goto out_recv;
--              if ((status == chip->vendor.req_canceled)) {
-+              if (status == chip->vendor.req_canceled) {
-                       dev_err(chip->dev, "Operation Canceled\n");
-                       rc = -ECANCELED;
-                       goto out;
-@@ -862,6 +862,8 @@ ssize_t tpm_show_pubek(struct device *de
-       struct tpm_chip *chip = dev_get_drvdata(dev);
-+      pax_track_stack();
-+
-       tpm_cmd.header.in = tpm_readpubek_header;
-       err = transmit_cmd(chip, &tpm_cmd, READ_PUBEK_RESULT_SIZE,
-                       "attempting to read the PUBEK");
-diff -urNp linux-3.1.3/drivers/char/virtio_console.c linux-3.1.3/drivers/char/virtio_console.c
---- linux-3.1.3/drivers/char/virtio_console.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/char/virtio_console.c  2011-11-16 18:39:07.000000000 -0500
-@@ -555,7 +555,7 @@ static ssize_t fill_readbuf(struct port 
+diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
+index fb68b12..0f6c6ca 100644
+--- a/drivers/char/virtio_console.c
++++ b/drivers/char/virtio_console.c
+@@ -555,7 +555,7 @@ static ssize_t fill_readbuf(struct port *port, char *out_buf, size_t out_count,
        if (to_user) {
                ssize_t ret;
  
@@ -25841,7 +27329,7 @@ diff -urNp linux-3.1.3/drivers/char/virtio_console.c linux-3.1.3/drivers/char/vi
                if (ret)
                        return -EFAULT;
        } else {
-@@ -654,7 +654,7 @@ static ssize_t port_fops_read(struct fil
+@@ -654,7 +654,7 @@ static ssize_t port_fops_read(struct file *filp, char __user *ubuf,
        if (!port_has_data(port) && !port->host_connected)
                return 0;
  
@@ -25850,10 +27338,11 @@ diff -urNp linux-3.1.3/drivers/char/virtio_console.c linux-3.1.3/drivers/char/vi
  }
  
  static ssize_t port_fops_write(struct file *filp, const char __user *ubuf,
-diff -urNp linux-3.1.3/drivers/crypto/hifn_795x.c linux-3.1.3/drivers/crypto/hifn_795x.c
---- linux-3.1.3/drivers/crypto/hifn_795x.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/crypto/hifn_795x.c     2011-11-16 18:40:10.000000000 -0500
-@@ -1655,6 +1655,8 @@ static int hifn_test(struct hifn_device 
+diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c
+index a84250a..68c725e 100644
+--- a/drivers/crypto/hifn_795x.c
++++ b/drivers/crypto/hifn_795x.c
+@@ -1655,6 +1655,8 @@ static int hifn_test(struct hifn_device *dev, int encdec, u8 snum)
                0xCA, 0x34, 0x2B, 0x2E};
        struct scatterlist sg;
  
@@ -25862,10 +27351,11 @@ diff -urNp linux-3.1.3/drivers/crypto/hifn_795x.c linux-3.1.3/drivers/crypto/hif
        memset(src, 0, sizeof(src));
        memset(ctx.key, 0, sizeof(ctx.key));
  
-diff -urNp linux-3.1.3/drivers/crypto/padlock-aes.c linux-3.1.3/drivers/crypto/padlock-aes.c
---- linux-3.1.3/drivers/crypto/padlock-aes.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/crypto/padlock-aes.c   2011-11-16 18:40:10.000000000 -0500
-@@ -109,6 +109,8 @@ static int aes_set_key(struct crypto_tfm
+diff --git a/drivers/crypto/padlock-aes.c b/drivers/crypto/padlock-aes.c
+index db33d30..7823369 100644
+--- a/drivers/crypto/padlock-aes.c
++++ b/drivers/crypto/padlock-aes.c
+@@ -109,6 +109,8 @@ static int aes_set_key(struct crypto_tfm *tfm, const u8 *in_key,
        struct crypto_aes_ctx gen_aes;
        int cpu;
  
@@ -25874,10 +27364,11 @@ diff -urNp linux-3.1.3/drivers/crypto/padlock-aes.c linux-3.1.3/drivers/crypto/p
        if (key_len % 8) {
                *flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
                return -EINVAL;
-diff -urNp linux-3.1.3/drivers/edac/amd64_edac.c linux-3.1.3/drivers/edac/amd64_edac.c
---- linux-3.1.3/drivers/edac/amd64_edac.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/edac/amd64_edac.c      2011-11-16 18:39:07.000000000 -0500
-@@ -2670,7 +2670,7 @@ static void __devexit amd64_remove_one_i
+diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
+index 9a8bebc..b1e4989 100644
+--- a/drivers/edac/amd64_edac.c
++++ b/drivers/edac/amd64_edac.c
+@@ -2670,7 +2670,7 @@ static void __devexit amd64_remove_one_instance(struct pci_dev *pdev)
   * PCI core identifies what devices are on a system during boot, and then
   * inquiry this table to see if this driver is for a given device found.
   */
@@ -25886,10 +27377,11 @@ diff -urNp linux-3.1.3/drivers/edac/amd64_edac.c linux-3.1.3/drivers/edac/amd64_
        {
                .vendor         = PCI_VENDOR_ID_AMD,
                .device         = PCI_DEVICE_ID_AMD_K8_NB_MEMCTL,
-diff -urNp linux-3.1.3/drivers/edac/amd76x_edac.c linux-3.1.3/drivers/edac/amd76x_edac.c
---- linux-3.1.3/drivers/edac/amd76x_edac.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/edac/amd76x_edac.c     2011-11-16 18:39:07.000000000 -0500
-@@ -321,7 +321,7 @@ static void __devexit amd76x_remove_one(
+diff --git a/drivers/edac/amd76x_edac.c b/drivers/edac/amd76x_edac.c
+index e47e73b..348e0bd 100644
+--- a/drivers/edac/amd76x_edac.c
++++ b/drivers/edac/amd76x_edac.c
+@@ -321,7 +321,7 @@ static void __devexit amd76x_remove_one(struct pci_dev *pdev)
        edac_mc_free(mci);
  }
  
@@ -25898,10 +27390,11 @@ diff -urNp linux-3.1.3/drivers/edac/amd76x_edac.c linux-3.1.3/drivers/edac/amd76
        {
         PCI_VEND_DEV(AMD, FE_GATE_700C), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
         AMD762},
-diff -urNp linux-3.1.3/drivers/edac/e752x_edac.c linux-3.1.3/drivers/edac/e752x_edac.c
---- linux-3.1.3/drivers/edac/e752x_edac.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/edac/e752x_edac.c      2011-11-16 18:39:07.000000000 -0500
-@@ -1380,7 +1380,7 @@ static void __devexit e752x_remove_one(s
+diff --git a/drivers/edac/e752x_edac.c b/drivers/edac/e752x_edac.c
+index 1af531a..3a8ff27 100644
+--- a/drivers/edac/e752x_edac.c
++++ b/drivers/edac/e752x_edac.c
+@@ -1380,7 +1380,7 @@ static void __devexit e752x_remove_one(struct pci_dev *pdev)
        edac_mc_free(mci);
  }
  
@@ -25910,10 +27403,11 @@ diff -urNp linux-3.1.3/drivers/edac/e752x_edac.c linux-3.1.3/drivers/edac/e752x_
        {
         PCI_VEND_DEV(INTEL, 7520_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
         E7520},
-diff -urNp linux-3.1.3/drivers/edac/e7xxx_edac.c linux-3.1.3/drivers/edac/e7xxx_edac.c
---- linux-3.1.3/drivers/edac/e7xxx_edac.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/edac/e7xxx_edac.c      2011-11-16 18:39:07.000000000 -0500
-@@ -525,7 +525,7 @@ static void __devexit e7xxx_remove_one(s
+diff --git a/drivers/edac/e7xxx_edac.c b/drivers/edac/e7xxx_edac.c
+index 6ffb6d2..383d8d7 100644
+--- a/drivers/edac/e7xxx_edac.c
++++ b/drivers/edac/e7xxx_edac.c
+@@ -525,7 +525,7 @@ static void __devexit e7xxx_remove_one(struct pci_dev *pdev)
        edac_mc_free(mci);
  }
  
@@ -25922,10 +27416,11 @@ diff -urNp linux-3.1.3/drivers/edac/e7xxx_edac.c linux-3.1.3/drivers/edac/e7xxx_
        {
         PCI_VEND_DEV(INTEL, 7205_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
         E7205},
-diff -urNp linux-3.1.3/drivers/edac/edac_pci_sysfs.c linux-3.1.3/drivers/edac/edac_pci_sysfs.c
---- linux-3.1.3/drivers/edac/edac_pci_sysfs.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/edac/edac_pci_sysfs.c  2011-11-16 18:39:07.000000000 -0500
-@@ -26,8 +26,8 @@ static int edac_pci_log_pe = 1;              /* log 
+diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c
+index 495198a..ac08c85 100644
+--- a/drivers/edac/edac_pci_sysfs.c
++++ b/drivers/edac/edac_pci_sysfs.c
+@@ -26,8 +26,8 @@ static int edac_pci_log_pe = 1;              /* log PCI parity errors */
  static int edac_pci_log_npe = 1;      /* log PCI non-parity error errors */
  static int edac_pci_poll_msec = 1000; /* one second workq period */
  
@@ -25936,7 +27431,7 @@ diff -urNp linux-3.1.3/drivers/edac/edac_pci_sysfs.c linux-3.1.3/drivers/edac/ed
  
  static struct kobject *edac_pci_top_main_kobj;
  static atomic_t edac_pci_sysfs_refcount = ATOMIC_INIT(0);
-@@ -582,7 +582,7 @@ static void edac_pci_dev_parity_test(str
+@@ -582,7 +582,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
                        edac_printk(KERN_CRIT, EDAC_PCI,
                                "Signaled System Error on %s\n",
                                pci_name(dev));
@@ -25945,7 +27440,7 @@ diff -urNp linux-3.1.3/drivers/edac/edac_pci_sysfs.c linux-3.1.3/drivers/edac/ed
                }
  
                if (status & (PCI_STATUS_PARITY)) {
-@@ -590,7 +590,7 @@ static void edac_pci_dev_parity_test(str
+@@ -590,7 +590,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
                                "Master Data Parity Error on %s\n",
                                pci_name(dev));
  
@@ -25954,7 +27449,7 @@ diff -urNp linux-3.1.3/drivers/edac/edac_pci_sysfs.c linux-3.1.3/drivers/edac/ed
                }
  
                if (status & (PCI_STATUS_DETECTED_PARITY)) {
-@@ -598,7 +598,7 @@ static void edac_pci_dev_parity_test(str
+@@ -598,7 +598,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
                                "Detected Parity Error on %s\n",
                                pci_name(dev));
  
@@ -25963,7 +27458,7 @@ diff -urNp linux-3.1.3/drivers/edac/edac_pci_sysfs.c linux-3.1.3/drivers/edac/ed
                }
        }
  
-@@ -619,7 +619,7 @@ static void edac_pci_dev_parity_test(str
+@@ -619,7 +619,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
                                edac_printk(KERN_CRIT, EDAC_PCI, "Bridge "
                                        "Signaled System Error on %s\n",
                                        pci_name(dev));
@@ -25972,7 +27467,7 @@ diff -urNp linux-3.1.3/drivers/edac/edac_pci_sysfs.c linux-3.1.3/drivers/edac/ed
                        }
  
                        if (status & (PCI_STATUS_PARITY)) {
-@@ -627,7 +627,7 @@ static void edac_pci_dev_parity_test(str
+@@ -627,7 +627,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
                                        "Master Data Parity Error on "
                                        "%s\n", pci_name(dev));
  
@@ -25981,7 +27476,7 @@ diff -urNp linux-3.1.3/drivers/edac/edac_pci_sysfs.c linux-3.1.3/drivers/edac/ed
                        }
  
                        if (status & (PCI_STATUS_DETECTED_PARITY)) {
-@@ -635,7 +635,7 @@ static void edac_pci_dev_parity_test(str
+@@ -635,7 +635,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
                                        "Detected Parity Error on %s\n",
                                        pci_name(dev));
  
@@ -26008,10 +27503,11 @@ diff -urNp linux-3.1.3/drivers/edac/edac_pci_sysfs.c linux-3.1.3/drivers/edac/ed
                        panic("EDAC: PCI Parity Error");
        }
  }
-diff -urNp linux-3.1.3/drivers/edac/i3000_edac.c linux-3.1.3/drivers/edac/i3000_edac.c
---- linux-3.1.3/drivers/edac/i3000_edac.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/edac/i3000_edac.c      2011-11-16 18:39:07.000000000 -0500
-@@ -470,7 +470,7 @@ static void __devexit i3000_remove_one(s
+diff --git a/drivers/edac/i3000_edac.c b/drivers/edac/i3000_edac.c
+index c0510b3..6e2a954 100644
+--- a/drivers/edac/i3000_edac.c
++++ b/drivers/edac/i3000_edac.c
+@@ -470,7 +470,7 @@ static void __devexit i3000_remove_one(struct pci_dev *pdev)
        edac_mc_free(mci);
  }
  
@@ -26020,10 +27516,11 @@ diff -urNp linux-3.1.3/drivers/edac/i3000_edac.c linux-3.1.3/drivers/edac/i3000_
        {
         PCI_VEND_DEV(INTEL, 3000_HB), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
         I3000},
-diff -urNp linux-3.1.3/drivers/edac/i3200_edac.c linux-3.1.3/drivers/edac/i3200_edac.c
---- linux-3.1.3/drivers/edac/i3200_edac.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/edac/i3200_edac.c      2011-11-16 18:39:07.000000000 -0500
-@@ -456,7 +456,7 @@ static void __devexit i3200_remove_one(s
+diff --git a/drivers/edac/i3200_edac.c b/drivers/edac/i3200_edac.c
+index aa08497..7e6822a 100644
+--- a/drivers/edac/i3200_edac.c
++++ b/drivers/edac/i3200_edac.c
+@@ -456,7 +456,7 @@ static void __devexit i3200_remove_one(struct pci_dev *pdev)
        edac_mc_free(mci);
  }
  
@@ -26032,10 +27529,11 @@ diff -urNp linux-3.1.3/drivers/edac/i3200_edac.c linux-3.1.3/drivers/edac/i3200_
        {
                PCI_VEND_DEV(INTEL, 3200_HB), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
                I3200},
-diff -urNp linux-3.1.3/drivers/edac/i5000_edac.c linux-3.1.3/drivers/edac/i5000_edac.c
---- linux-3.1.3/drivers/edac/i5000_edac.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/edac/i5000_edac.c      2011-11-16 18:39:07.000000000 -0500
-@@ -1516,7 +1516,7 @@ static void __devexit i5000_remove_one(s
+diff --git a/drivers/edac/i5000_edac.c b/drivers/edac/i5000_edac.c
+index 4dc3ac2..67d05a6 100644
+--- a/drivers/edac/i5000_edac.c
++++ b/drivers/edac/i5000_edac.c
+@@ -1516,7 +1516,7 @@ static void __devexit i5000_remove_one(struct pci_dev *pdev)
   *
   *    The "E500P" device is the first device supported.
   */
@@ -26044,10 +27542,11 @@ diff -urNp linux-3.1.3/drivers/edac/i5000_edac.c linux-3.1.3/drivers/edac/i5000_
        {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I5000_DEV16),
         .driver_data = I5000P},
  
-diff -urNp linux-3.1.3/drivers/edac/i5100_edac.c linux-3.1.3/drivers/edac/i5100_edac.c
---- linux-3.1.3/drivers/edac/i5100_edac.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/edac/i5100_edac.c      2011-11-16 18:39:07.000000000 -0500
-@@ -1051,7 +1051,7 @@ static void __devexit i5100_remove_one(s
+diff --git a/drivers/edac/i5100_edac.c b/drivers/edac/i5100_edac.c
+index bcbdeec..9886d16 100644
+--- a/drivers/edac/i5100_edac.c
++++ b/drivers/edac/i5100_edac.c
+@@ -1051,7 +1051,7 @@ static void __devexit i5100_remove_one(struct pci_dev *pdev)
        edac_mc_free(mci);
  }
  
@@ -26056,10 +27555,11 @@ diff -urNp linux-3.1.3/drivers/edac/i5100_edac.c linux-3.1.3/drivers/edac/i5100_
        /* Device 16, Function 0, Channel 0 Memory Map, Error Flag/Mask, ... */
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5100_16) },
        { 0, }
-diff -urNp linux-3.1.3/drivers/edac/i5400_edac.c linux-3.1.3/drivers/edac/i5400_edac.c
---- linux-3.1.3/drivers/edac/i5400_edac.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/edac/i5400_edac.c      2011-11-16 18:39:07.000000000 -0500
-@@ -1383,7 +1383,7 @@ static void __devexit i5400_remove_one(s
+diff --git a/drivers/edac/i5400_edac.c b/drivers/edac/i5400_edac.c
+index 74d6ec34..baff517 100644
+--- a/drivers/edac/i5400_edac.c
++++ b/drivers/edac/i5400_edac.c
+@@ -1383,7 +1383,7 @@ static void __devexit i5400_remove_one(struct pci_dev *pdev)
   *
   *    The "E500P" device is the first device supported.
   */
@@ -26068,10 +27568,11 @@ diff -urNp linux-3.1.3/drivers/edac/i5400_edac.c linux-3.1.3/drivers/edac/i5400_
        {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5400_ERR)},
        {0,}                    /* 0 terminated list. */
  };
-diff -urNp linux-3.1.3/drivers/edac/i7300_edac.c linux-3.1.3/drivers/edac/i7300_edac.c
---- linux-3.1.3/drivers/edac/i7300_edac.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/edac/i7300_edac.c      2011-11-16 18:39:07.000000000 -0500
-@@ -1191,7 +1191,7 @@ static void __devexit i7300_remove_one(s
+diff --git a/drivers/edac/i7300_edac.c b/drivers/edac/i7300_edac.c
+index a76fe83..15479e6 100644
+--- a/drivers/edac/i7300_edac.c
++++ b/drivers/edac/i7300_edac.c
+@@ -1191,7 +1191,7 @@ static void __devexit i7300_remove_one(struct pci_dev *pdev)
   *
   * Has only 8086:360c PCI ID
   */
@@ -26080,10 +27581,11 @@ diff -urNp linux-3.1.3/drivers/edac/i7300_edac.c linux-3.1.3/drivers/edac/i7300_
        {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I7300_MCH_ERR)},
        {0,}                    /* 0 terminated list. */
  };
-diff -urNp linux-3.1.3/drivers/edac/i7core_edac.c linux-3.1.3/drivers/edac/i7core_edac.c
---- linux-3.1.3/drivers/edac/i7core_edac.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/edac/i7core_edac.c     2011-11-16 18:39:07.000000000 -0500
-@@ -359,7 +359,7 @@ static const struct pci_id_table pci_dev
+diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c
+index f6cf448..3f612e9 100644
+--- a/drivers/edac/i7core_edac.c
++++ b/drivers/edac/i7core_edac.c
+@@ -359,7 +359,7 @@ static const struct pci_id_table pci_dev_table[] = {
  /*
   *    pci_device_id   table for which devices we are looking for
   */
@@ -26092,10 +27594,11 @@ diff -urNp linux-3.1.3/drivers/edac/i7core_edac.c linux-3.1.3/drivers/edac/i7cor
        {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_X58_HUB_MGMT)},
        {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_LYNNFIELD_QPI_LINK0)},
        {0,}                    /* 0 terminated list. */
-diff -urNp linux-3.1.3/drivers/edac/i82443bxgx_edac.c linux-3.1.3/drivers/edac/i82443bxgx_edac.c
---- linux-3.1.3/drivers/edac/i82443bxgx_edac.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/edac/i82443bxgx_edac.c 2011-11-16 18:39:07.000000000 -0500
-@@ -380,7 +380,7 @@ static void __devexit i82443bxgx_edacmc_
+diff --git a/drivers/edac/i82443bxgx_edac.c b/drivers/edac/i82443bxgx_edac.c
+index 4329d39..f3022ef 100644
+--- a/drivers/edac/i82443bxgx_edac.c
++++ b/drivers/edac/i82443bxgx_edac.c
+@@ -380,7 +380,7 @@ static void __devexit i82443bxgx_edacmc_remove_one(struct pci_dev *pdev)
  
  EXPORT_SYMBOL_GPL(i82443bxgx_edacmc_remove_one);
  
@@ -26104,10 +27607,11 @@ diff -urNp linux-3.1.3/drivers/edac/i82443bxgx_edac.c linux-3.1.3/drivers/edac/i
        {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443BX_0)},
        {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443BX_2)},
        {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443GX_0)},
-diff -urNp linux-3.1.3/drivers/edac/i82860_edac.c linux-3.1.3/drivers/edac/i82860_edac.c
---- linux-3.1.3/drivers/edac/i82860_edac.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/edac/i82860_edac.c     2011-11-16 18:39:07.000000000 -0500
-@@ -270,7 +270,7 @@ static void __devexit i82860_remove_one(
+diff --git a/drivers/edac/i82860_edac.c b/drivers/edac/i82860_edac.c
+index 931a057..fd28340 100644
+--- a/drivers/edac/i82860_edac.c
++++ b/drivers/edac/i82860_edac.c
+@@ -270,7 +270,7 @@ static void __devexit i82860_remove_one(struct pci_dev *pdev)
        edac_mc_free(mci);
  }
  
@@ -26116,10 +27620,11 @@ diff -urNp linux-3.1.3/drivers/edac/i82860_edac.c linux-3.1.3/drivers/edac/i8286
        {
         PCI_VEND_DEV(INTEL, 82860_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
         I82860},
-diff -urNp linux-3.1.3/drivers/edac/i82875p_edac.c linux-3.1.3/drivers/edac/i82875p_edac.c
---- linux-3.1.3/drivers/edac/i82875p_edac.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/edac/i82875p_edac.c    2011-11-16 18:39:07.000000000 -0500
-@@ -511,7 +511,7 @@ static void __devexit i82875p_remove_one
+diff --git a/drivers/edac/i82875p_edac.c b/drivers/edac/i82875p_edac.c
+index 33864c6..01edc61 100644
+--- a/drivers/edac/i82875p_edac.c
++++ b/drivers/edac/i82875p_edac.c
+@@ -511,7 +511,7 @@ static void __devexit i82875p_remove_one(struct pci_dev *pdev)
        edac_mc_free(mci);
  }
  
@@ -26128,10 +27633,11 @@ diff -urNp linux-3.1.3/drivers/edac/i82875p_edac.c linux-3.1.3/drivers/edac/i828
        {
         PCI_VEND_DEV(INTEL, 82875_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
         I82875P},
-diff -urNp linux-3.1.3/drivers/edac/i82975x_edac.c linux-3.1.3/drivers/edac/i82975x_edac.c
---- linux-3.1.3/drivers/edac/i82975x_edac.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/edac/i82975x_edac.c    2011-11-16 18:39:07.000000000 -0500
-@@ -604,7 +604,7 @@ static void __devexit i82975x_remove_one
+diff --git a/drivers/edac/i82975x_edac.c b/drivers/edac/i82975x_edac.c
+index a5da732..983363b 100644
+--- a/drivers/edac/i82975x_edac.c
++++ b/drivers/edac/i82975x_edac.c
+@@ -604,7 +604,7 @@ static void __devexit i82975x_remove_one(struct pci_dev *pdev)
        edac_mc_free(mci);
  }
  
@@ -26140,9 +27646,10 @@ diff -urNp linux-3.1.3/drivers/edac/i82975x_edac.c linux-3.1.3/drivers/edac/i829
        {
                PCI_VEND_DEV(INTEL, 82975_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
                I82975X
-diff -urNp linux-3.1.3/drivers/edac/mce_amd.h linux-3.1.3/drivers/edac/mce_amd.h
---- linux-3.1.3/drivers/edac/mce_amd.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/edac/mce_amd.h 2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/edac/mce_amd.h b/drivers/edac/mce_amd.h
+index 795a320..3bbc3d3 100644
+--- a/drivers/edac/mce_amd.h
++++ b/drivers/edac/mce_amd.h
 @@ -83,7 +83,7 @@ struct amd_decoder_ops {
        bool (*dc_mce)(u16, u8);
        bool (*ic_mce)(u16, u8);
@@ -26152,10 +27659,11 @@ diff -urNp linux-3.1.3/drivers/edac/mce_amd.h linux-3.1.3/drivers/edac/mce_amd.h
  
  void amd_report_gart_errors(bool);
  void amd_register_ecc_decoder(void (*f)(int, struct mce *, u32));
-diff -urNp linux-3.1.3/drivers/edac/r82600_edac.c linux-3.1.3/drivers/edac/r82600_edac.c
---- linux-3.1.3/drivers/edac/r82600_edac.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/edac/r82600_edac.c     2011-11-16 18:39:07.000000000 -0500
-@@ -373,7 +373,7 @@ static void __devexit r82600_remove_one(
+diff --git a/drivers/edac/r82600_edac.c b/drivers/edac/r82600_edac.c
+index b153674..ad2ba9b 100644
+--- a/drivers/edac/r82600_edac.c
++++ b/drivers/edac/r82600_edac.c
+@@ -373,7 +373,7 @@ static void __devexit r82600_remove_one(struct pci_dev *pdev)
        edac_mc_free(mci);
  }
  
@@ -26164,10 +27672,11 @@ diff -urNp linux-3.1.3/drivers/edac/r82600_edac.c linux-3.1.3/drivers/edac/r8260
        {
         PCI_DEVICE(PCI_VENDOR_ID_RADISYS, R82600_BRIDGE_ID)
         },
-diff -urNp linux-3.1.3/drivers/edac/x38_edac.c linux-3.1.3/drivers/edac/x38_edac.c
---- linux-3.1.3/drivers/edac/x38_edac.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/edac/x38_edac.c        2011-11-16 18:39:07.000000000 -0500
-@@ -440,7 +440,7 @@ static void __devexit x38_remove_one(str
+diff --git a/drivers/edac/x38_edac.c b/drivers/edac/x38_edac.c
+index b6f47de..c5acf3a 100644
+--- a/drivers/edac/x38_edac.c
++++ b/drivers/edac/x38_edac.c
+@@ -440,7 +440,7 @@ static void __devexit x38_remove_one(struct pci_dev *pdev)
        edac_mc_free(mci);
  }
  
@@ -26176,9 +27685,10 @@ diff -urNp linux-3.1.3/drivers/edac/x38_edac.c linux-3.1.3/drivers/edac/x38_edac
        {
         PCI_VEND_DEV(INTEL, X38_HB), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
         X38},
-diff -urNp linux-3.1.3/drivers/firewire/core-card.c linux-3.1.3/drivers/firewire/core-card.c
---- linux-3.1.3/drivers/firewire/core-card.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/firewire/core-card.c   2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c
+index 85661b0..c784559a 100644
+--- a/drivers/firewire/core-card.c
++++ b/drivers/firewire/core-card.c
 @@ -657,7 +657,7 @@ void fw_card_release(struct kref *kref)
  
  void fw_core_remove_card(struct fw_card *card)
@@ -26188,10 +27698,11 @@ diff -urNp linux-3.1.3/drivers/firewire/core-card.c linux-3.1.3/drivers/firewire
  
        card->driver->update_phy_reg(card, 4,
                                     PHY_LINK_ACTIVE | PHY_CONTENDER, 0);
-diff -urNp linux-3.1.3/drivers/firewire/core-cdev.c linux-3.1.3/drivers/firewire/core-cdev.c
---- linux-3.1.3/drivers/firewire/core-cdev.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/firewire/core-cdev.c   2011-11-16 18:39:07.000000000 -0500
-@@ -1331,8 +1331,7 @@ static int init_iso_resource(struct clie
+diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c
+index 4799393..37bd3ab 100644
+--- a/drivers/firewire/core-cdev.c
++++ b/drivers/firewire/core-cdev.c
+@@ -1331,8 +1331,7 @@ static int init_iso_resource(struct client *client,
        int ret;
  
        if ((request->channels == 0 && request->bandwidth == 0) ||
@@ -26201,20 +27712,10 @@ diff -urNp linux-3.1.3/drivers/firewire/core-cdev.c linux-3.1.3/drivers/firewire
                return -EINVAL;
  
        r  = kmalloc(sizeof(*r), GFP_KERNEL);
-diff -urNp linux-3.1.3/drivers/firewire/core.h linux-3.1.3/drivers/firewire/core.h
---- linux-3.1.3/drivers/firewire/core.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/firewire/core.h        2011-11-16 18:39:07.000000000 -0500
-@@ -101,6 +101,7 @@ struct fw_card_driver {
-       int (*stop_iso)(struct fw_iso_context *ctx);
- };
-+typedef struct fw_card_driver __no_const fw_card_driver_no_const;
- void fw_card_initialize(struct fw_card *card,
-               const struct fw_card_driver *driver, struct device *device);
-diff -urNp linux-3.1.3/drivers/firewire/core-transaction.c linux-3.1.3/drivers/firewire/core-transaction.c
---- linux-3.1.3/drivers/firewire/core-transaction.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/firewire/core-transaction.c    2011-11-16 18:40:10.000000000 -0500
+diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c
+index 334b82a..ea5261d 100644
+--- a/drivers/firewire/core-transaction.c
++++ b/drivers/firewire/core-transaction.c
 @@ -37,6 +37,7 @@
  #include <linux/timer.h>
  #include <linux/types.h>
@@ -26223,7 +27724,7 @@ diff -urNp linux-3.1.3/drivers/firewire/core-transaction.c linux-3.1.3/drivers/f
  
  #include <asm/byteorder.h>
  
-@@ -422,6 +423,8 @@ int fw_run_transaction(struct fw_card *c
+@@ -422,6 +423,8 @@ int fw_run_transaction(struct fw_card *card, int tcode, int destination_id,
        struct transaction_callback_data d;
        struct fw_transaction t;
  
@@ -26232,9 +27733,22 @@ diff -urNp linux-3.1.3/drivers/firewire/core-transaction.c linux-3.1.3/drivers/f
        init_timer_on_stack(&t.split_timeout_timer);
        init_completion(&d.done);
        d.payload = payload;
-diff -urNp linux-3.1.3/drivers/firmware/dmi_scan.c linux-3.1.3/drivers/firmware/dmi_scan.c
---- linux-3.1.3/drivers/firmware/dmi_scan.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/firmware/dmi_scan.c    2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/firewire/core.h b/drivers/firewire/core.h
+index b45be57..5fad18b 100644
+--- a/drivers/firewire/core.h
++++ b/drivers/firewire/core.h
+@@ -101,6 +101,7 @@ struct fw_card_driver {
+       int (*stop_iso)(struct fw_iso_context *ctx);
+ };
++typedef struct fw_card_driver __no_const fw_card_driver_no_const;
+ void fw_card_initialize(struct fw_card *card,
+               const struct fw_card_driver *driver, struct device *device);
+diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
+index bcb1126..2cc2121 100644
+--- a/drivers/firmware/dmi_scan.c
++++ b/drivers/firmware/dmi_scan.c
 @@ -449,11 +449,6 @@ void __init dmi_scan_machine(void)
                }
        }
@@ -26247,7 +27761,7 @@ diff -urNp linux-3.1.3/drivers/firmware/dmi_scan.c linux-3.1.3/drivers/firmware/
                p = dmi_ioremap(0xF0000, 0x10000);
                if (p == NULL)
                        goto error;
-@@ -725,7 +720,7 @@ int dmi_walk(void (*decode)(const struct
+@@ -725,7 +720,7 @@ int dmi_walk(void (*decode)(const struct dmi_header *, void *),
        if (buf == NULL)
                return -1;
  
@@ -26256,9 +27770,10 @@ diff -urNp linux-3.1.3/drivers/firmware/dmi_scan.c linux-3.1.3/drivers/firmware/
  
        iounmap(buf);
        return 0;
-diff -urNp linux-3.1.3/drivers/gpio/gpio-vr41xx.c linux-3.1.3/drivers/gpio/gpio-vr41xx.c
---- linux-3.1.3/drivers/gpio/gpio-vr41xx.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpio/gpio-vr41xx.c     2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/gpio/gpio-vr41xx.c b/drivers/gpio/gpio-vr41xx.c
+index 98723cb..10ca85b 100644
+--- a/drivers/gpio/gpio-vr41xx.c
++++ b/drivers/gpio/gpio-vr41xx.c
 @@ -204,7 +204,7 @@ static int giu_get_irq(unsigned int irq)
        printk(KERN_ERR "spurious GIU interrupt: %04x(%04x),%04x(%04x)\n",
               maskl, pendl, maskh, pendh);
@@ -26268,10 +27783,11 @@ diff -urNp linux-3.1.3/drivers/gpio/gpio-vr41xx.c linux-3.1.3/drivers/gpio/gpio-
  
        return -EINVAL;
  }
-diff -urNp linux-3.1.3/drivers/gpu/drm/drm_crtc.c linux-3.1.3/drivers/gpu/drm/drm_crtc.c
---- linux-3.1.3/drivers/gpu/drm/drm_crtc.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/drm_crtc.c     2011-11-16 18:39:07.000000000 -0500
-@@ -1374,7 +1374,7 @@ int drm_mode_getconnector(struct drm_dev
+diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
+index 2410c40..2d03563 100644
+--- a/drivers/gpu/drm/drm_crtc.c
++++ b/drivers/gpu/drm/drm_crtc.c
+@@ -1374,7 +1374,7 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
         */
        if ((out_resp->count_modes >= mode_count) && mode_count) {
                copied = 0;
@@ -26280,7 +27796,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/drm_crtc.c linux-3.1.3/drivers/gpu/drm/dr
                list_for_each_entry(mode, &connector->modes, head) {
                        drm_crtc_convert_to_umode(&u_mode, mode);
                        if (copy_to_user(mode_ptr + copied,
-@@ -1389,8 +1389,8 @@ int drm_mode_getconnector(struct drm_dev
+@@ -1389,8 +1389,8 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
  
        if ((out_resp->count_props >= props_count) && props_count) {
                copied = 0;
@@ -26291,7 +27807,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/drm_crtc.c linux-3.1.3/drivers/gpu/drm/dr
                for (i = 0; i < DRM_CONNECTOR_MAX_PROPERTY; i++) {
                        if (connector->property_ids[i] != 0) {
                                if (put_user(connector->property_ids[i],
-@@ -1412,7 +1412,7 @@ int drm_mode_getconnector(struct drm_dev
+@@ -1412,7 +1412,7 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
  
        if ((out_resp->count_encoders >= encoders_count) && encoders_count) {
                copied = 0;
@@ -26300,7 +27816,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/drm_crtc.c linux-3.1.3/drivers/gpu/drm/dr
                for (i = 0; i < DRM_CONNECTOR_MAX_ENCODER; i++) {
                        if (connector->encoder_ids[i] != 0) {
                                if (put_user(connector->encoder_ids[i],
-@@ -1571,7 +1571,7 @@ int drm_mode_setcrtc(struct drm_device *
+@@ -1571,7 +1571,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,
                }
  
                for (i = 0; i < crtc_req->count_connectors; i++) {
@@ -26309,7 +27825,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/drm_crtc.c linux-3.1.3/drivers/gpu/drm/dr
                        if (get_user(out_id, &set_connectors_ptr[i])) {
                                ret = -EFAULT;
                                goto out;
-@@ -1852,7 +1852,7 @@ int drm_mode_dirtyfb_ioctl(struct drm_de
+@@ -1852,7 +1852,7 @@ int drm_mode_dirtyfb_ioctl(struct drm_device *dev,
        fb = obj_to_fb(obj);
  
        num_clips = r->num_clips;
@@ -26318,7 +27834,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/drm_crtc.c linux-3.1.3/drivers/gpu/drm/dr
  
        if (!num_clips != !clips_ptr) {
                ret = -EINVAL;
-@@ -2272,7 +2272,7 @@ int drm_mode_getproperty_ioctl(struct dr
+@@ -2276,7 +2276,7 @@ int drm_mode_getproperty_ioctl(struct drm_device *dev,
        out_resp->flags = property->flags;
  
        if ((out_resp->count_values >= value_count) && value_count) {
@@ -26327,7 +27843,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/drm_crtc.c linux-3.1.3/drivers/gpu/drm/dr
                for (i = 0; i < value_count; i++) {
                        if (copy_to_user(values_ptr + i, &property->values[i], sizeof(uint64_t))) {
                                ret = -EFAULT;
-@@ -2285,7 +2285,7 @@ int drm_mode_getproperty_ioctl(struct dr
+@@ -2289,7 +2289,7 @@ int drm_mode_getproperty_ioctl(struct drm_device *dev,
        if (property->flags & DRM_MODE_PROP_ENUM) {
                if ((out_resp->count_enum_blobs >= enum_count) && enum_count) {
                        copied = 0;
@@ -26336,7 +27852,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/drm_crtc.c linux-3.1.3/drivers/gpu/drm/dr
                        list_for_each_entry(prop_enum, &property->enum_blob_list, head) {
  
                                if (copy_to_user(&enum_ptr[copied].value, &prop_enum->value, sizeof(uint64_t))) {
-@@ -2308,7 +2308,7 @@ int drm_mode_getproperty_ioctl(struct dr
+@@ -2312,7 +2312,7 @@ int drm_mode_getproperty_ioctl(struct drm_device *dev,
                if ((out_resp->count_enum_blobs >= blob_count) && blob_count) {
                        copied = 0;
                        blob_id_ptr = (uint32_t *)(unsigned long)out_resp->enum_blob_ptr;
@@ -26345,7 +27861,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/drm_crtc.c linux-3.1.3/drivers/gpu/drm/dr
  
                        list_for_each_entry(prop_blob, &property->enum_blob_list, head) {
                                if (put_user(prop_blob->base.id, blob_id_ptr + copied)) {
-@@ -2369,7 +2369,7 @@ int drm_mode_getblob_ioctl(struct drm_de
+@@ -2373,7 +2373,7 @@ int drm_mode_getblob_ioctl(struct drm_device *dev,
        struct drm_mode_get_blob *out_resp = data;
        struct drm_property_blob *blob;
        int ret = 0;
@@ -26354,7 +27870,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/drm_crtc.c linux-3.1.3/drivers/gpu/drm/dr
  
        if (!drm_core_check_feature(dev, DRIVER_MODESET))
                return -EINVAL;
-@@ -2383,7 +2383,7 @@ int drm_mode_getblob_ioctl(struct drm_de
+@@ -2387,7 +2387,7 @@ int drm_mode_getblob_ioctl(struct drm_device *dev,
        blob = obj_to_blob(obj);
  
        if (out_resp->length == blob->length) {
@@ -26363,10 +27879,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/drm_crtc.c linux-3.1.3/drivers/gpu/drm/dr
                if (copy_to_user(blob_ptr, blob->data, blob->length)){
                        ret = -EFAULT;
                        goto done;
-diff -urNp linux-3.1.3/drivers/gpu/drm/drm_crtc_helper.c linux-3.1.3/drivers/gpu/drm/drm_crtc_helper.c
---- linux-3.1.3/drivers/gpu/drm/drm_crtc_helper.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/drm_crtc_helper.c      2011-11-16 18:40:10.000000000 -0500
-@@ -276,7 +276,7 @@ static bool drm_encoder_crtc_ok(struct d
+diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
+index f88a9b2..8f4078f 100644
+--- a/drivers/gpu/drm/drm_crtc_helper.c
++++ b/drivers/gpu/drm/drm_crtc_helper.c
+@@ -276,7 +276,7 @@ static bool drm_encoder_crtc_ok(struct drm_encoder *encoder,
        struct drm_crtc *tmp;
        int crtc_mask = 1;
  
@@ -26375,7 +27892,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/drm_crtc_helper.c linux-3.1.3/drivers/gpu
  
        dev = crtc->dev;
  
-@@ -343,6 +343,8 @@ bool drm_crtc_helper_set_mode(struct drm
+@@ -343,6 +343,8 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc,
        struct drm_encoder *encoder;
        bool ret = true;
  
@@ -26384,9 +27901,10 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/drm_crtc_helper.c linux-3.1.3/drivers/gpu
        crtc->enabled = drm_helper_crtc_in_use(crtc);
        if (!crtc->enabled)
                return true;
-diff -urNp linux-3.1.3/drivers/gpu/drm/drm_drv.c linux-3.1.3/drivers/gpu/drm/drm_drv.c
---- linux-3.1.3/drivers/gpu/drm/drm_drv.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/drm_drv.c      2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
+index 93a112d..c8b065d 100644
+--- a/drivers/gpu/drm/drm_drv.c
++++ b/drivers/gpu/drm/drm_drv.c
 @@ -307,7 +307,7 @@ module_exit(drm_core_exit);
  /**
   * Copy and IOCTL return string to user space
@@ -26405,10 +27923,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/drm_drv.c linux-3.1.3/drivers/gpu/drm/drm
        ++file_priv->ioctl_count;
  
        DRM_DEBUG("pid=%d, cmd=0x%02x, nr=0x%02x, dev 0x%lx, auth=%d\n",
-diff -urNp linux-3.1.3/drivers/gpu/drm/drm_fops.c linux-3.1.3/drivers/gpu/drm/drm_fops.c
---- linux-3.1.3/drivers/gpu/drm/drm_fops.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/drm_fops.c     2011-11-16 18:39:07.000000000 -0500
-@@ -70,7 +70,7 @@ static int drm_setup(struct drm_device *
+diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c
+index 2ec7d48..be14bb1 100644
+--- a/drivers/gpu/drm/drm_fops.c
++++ b/drivers/gpu/drm/drm_fops.c
+@@ -70,7 +70,7 @@ static int drm_setup(struct drm_device * dev)
        }
  
        for (i = 0; i < ARRAY_SIZE(dev->counts); i++)
@@ -26417,7 +27936,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/drm_fops.c linux-3.1.3/drivers/gpu/drm/dr
  
        dev->sigdata.lock = NULL;
  
-@@ -134,8 +134,8 @@ int drm_open(struct inode *inode, struct
+@@ -134,8 +134,8 @@ int drm_open(struct inode *inode, struct file *filp)
  
        retcode = drm_open_helper(inode, filp, dev);
        if (!retcode) {
@@ -26428,7 +27947,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/drm_fops.c linux-3.1.3/drivers/gpu/drm/dr
                        retcode = drm_setup(dev);
        }
        if (!retcode) {
-@@ -472,7 +472,7 @@ int drm_release(struct inode *inode, str
+@@ -472,7 +472,7 @@ int drm_release(struct inode *inode, struct file *filp)
  
        mutex_lock(&drm_global_mutex);
  
@@ -26437,7 +27956,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/drm_fops.c linux-3.1.3/drivers/gpu/drm/dr
  
        if (dev->driver->preclose)
                dev->driver->preclose(dev, file_priv);
-@@ -484,7 +484,7 @@ int drm_release(struct inode *inode, str
+@@ -484,7 +484,7 @@ int drm_release(struct inode *inode, struct file *filp)
        DRM_DEBUG("pid = %d, device = 0x%lx, open_count = %d\n",
                  task_pid_nr(current),
                  (long)old_encode_dev(file_priv->minor->device),
@@ -26446,7 +27965,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/drm_fops.c linux-3.1.3/drivers/gpu/drm/dr
  
        /* if the master has gone away we can't do anything with the lock */
        if (file_priv->minor->master)
-@@ -565,8 +565,8 @@ int drm_release(struct inode *inode, str
+@@ -565,8 +565,8 @@ int drm_release(struct inode *inode, struct file *filp)
         * End inline drm_release
         */
  
@@ -26457,9 +27976,10 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/drm_fops.c linux-3.1.3/drivers/gpu/drm/dr
                if (atomic_read(&dev->ioctl_count)) {
                        DRM_ERROR("Device busy: %d\n",
                                  atomic_read(&dev->ioctl_count));
-diff -urNp linux-3.1.3/drivers/gpu/drm/drm_global.c linux-3.1.3/drivers/gpu/drm/drm_global.c
---- linux-3.1.3/drivers/gpu/drm/drm_global.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/drm_global.c   2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/gpu/drm/drm_global.c b/drivers/gpu/drm/drm_global.c
+index c87dc96..326055d 100644
+--- a/drivers/gpu/drm/drm_global.c
++++ b/drivers/gpu/drm/drm_global.c
 @@ -36,7 +36,7 @@
  struct drm_global_item {
        struct mutex mutex;
@@ -26487,7 +28007,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/drm_global.c linux-3.1.3/drivers/gpu/drm/
        }
  }
  
-@@ -70,7 +70,7 @@ int drm_global_item_ref(struct drm_globa
+@@ -70,7 +70,7 @@ int drm_global_item_ref(struct drm_global_reference *ref)
        void *object;
  
        mutex_lock(&item->mutex);
@@ -26496,7 +28016,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/drm_global.c linux-3.1.3/drivers/gpu/drm/
                item->object = kzalloc(ref->size, GFP_KERNEL);
                if (unlikely(item->object == NULL)) {
                        ret = -ENOMEM;
-@@ -83,7 +83,7 @@ int drm_global_item_ref(struct drm_globa
+@@ -83,7 +83,7 @@ int drm_global_item_ref(struct drm_global_reference *ref)
                        goto out_err;
  
        }
@@ -26505,7 +28025,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/drm_global.c linux-3.1.3/drivers/gpu/drm/
        ref->object = item->object;
        object = item->object;
        mutex_unlock(&item->mutex);
-@@ -100,9 +100,9 @@ void drm_global_item_unref(struct drm_gl
+@@ -100,9 +100,9 @@ void drm_global_item_unref(struct drm_global_reference *ref)
        struct drm_global_item *item = &glob[ref->global_type];
  
        mutex_lock(&item->mutex);
@@ -26517,10 +28037,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/drm_global.c linux-3.1.3/drivers/gpu/drm/
                ref->release(ref);
                item->object = NULL;
        }
-diff -urNp linux-3.1.3/drivers/gpu/drm/drm_info.c linux-3.1.3/drivers/gpu/drm/drm_info.c
---- linux-3.1.3/drivers/gpu/drm/drm_info.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/drm_info.c     2011-11-16 18:40:10.000000000 -0500
-@@ -75,10 +75,14 @@ int drm_vm_info(struct seq_file *m, void
+diff --git a/drivers/gpu/drm/drm_info.c b/drivers/gpu/drm/drm_info.c
+index ab1162d..42587b2 100644
+--- a/drivers/gpu/drm/drm_info.c
++++ b/drivers/gpu/drm/drm_info.c
+@@ -75,10 +75,14 @@ int drm_vm_info(struct seq_file *m, void *data)
        struct drm_local_map *map;
        struct drm_map_list *r_list;
  
@@ -26539,7 +28060,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/drm_info.c linux-3.1.3/drivers/gpu/drm/dr
        const char *type;
        int i;
  
-@@ -89,7 +93,7 @@ int drm_vm_info(struct seq_file *m, void
+@@ -89,7 +93,7 @@ int drm_vm_info(struct seq_file *m, void *data)
                map = r_list->map;
                if (!map)
                        continue;
@@ -26548,7 +28069,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/drm_info.c linux-3.1.3/drivers/gpu/drm/dr
                        type = "??";
                else
                        type = types[map->type];
-@@ -290,7 +294,11 @@ int drm_vma_info(struct seq_file *m, voi
+@@ -290,7 +294,11 @@ int drm_vma_info(struct seq_file *m, void *data)
                           vma->vm_flags & VM_MAYSHARE ? 's' : 'p',
                           vma->vm_flags & VM_LOCKED ? 'l' : '-',
                           vma->vm_flags & VM_IO ? 'i' : '-',
@@ -26560,10 +28081,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/drm_info.c linux-3.1.3/drivers/gpu/drm/dr
  
  #if defined(__i386__)
                pgprot = pgprot_val(vma->vm_page_prot);
-diff -urNp linux-3.1.3/drivers/gpu/drm/drm_ioc32.c linux-3.1.3/drivers/gpu/drm/drm_ioc32.c
---- linux-3.1.3/drivers/gpu/drm/drm_ioc32.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/drm_ioc32.c    2011-11-16 18:39:07.000000000 -0500
-@@ -455,7 +455,7 @@ static int compat_drm_infobufs(struct fi
+diff --git a/drivers/gpu/drm/drm_ioc32.c b/drivers/gpu/drm/drm_ioc32.c
+index 4a058c7..b42cd92 100644
+--- a/drivers/gpu/drm/drm_ioc32.c
++++ b/drivers/gpu/drm/drm_ioc32.c
+@@ -455,7 +455,7 @@ static int compat_drm_infobufs(struct file *file, unsigned int cmd,
        request = compat_alloc_user_space(nbytes);
        if (!access_ok(VERIFY_WRITE, request, nbytes))
                return -EFAULT;
@@ -26572,7 +28094,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/drm_ioc32.c linux-3.1.3/drivers/gpu/drm/d
  
        if (__put_user(count, &request->count)
            || __put_user(list, &request->list))
-@@ -516,7 +516,7 @@ static int compat_drm_mapbufs(struct fil
+@@ -516,7 +516,7 @@ static int compat_drm_mapbufs(struct file *file, unsigned int cmd,
        request = compat_alloc_user_space(nbytes);
        if (!access_ok(VERIFY_WRITE, request, nbytes))
                return -EFAULT;
@@ -26581,10 +28103,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/drm_ioc32.c linux-3.1.3/drivers/gpu/drm/d
  
        if (__put_user(count, &request->count)
            || __put_user(list, &request->list))
-diff -urNp linux-3.1.3/drivers/gpu/drm/drm_ioctl.c linux-3.1.3/drivers/gpu/drm/drm_ioctl.c
---- linux-3.1.3/drivers/gpu/drm/drm_ioctl.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/drm_ioctl.c    2011-11-16 18:39:07.000000000 -0500
-@@ -256,7 +256,7 @@ int drm_getstats(struct drm_device *dev,
+diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
+index 904d7e9..ab88581 100644
+--- a/drivers/gpu/drm/drm_ioctl.c
++++ b/drivers/gpu/drm/drm_ioctl.c
+@@ -256,7 +256,7 @@ int drm_getstats(struct drm_device *dev, void *data,
                        stats->data[i].value =
                            (file_priv->master->lock.hw_lock ? file_priv->master->lock.hw_lock->lock : 0);
                else
@@ -26593,10 +28116,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/drm_ioctl.c linux-3.1.3/drivers/gpu/drm/d
                stats->data[i].type = dev->types[i];
        }
  
-diff -urNp linux-3.1.3/drivers/gpu/drm/drm_lock.c linux-3.1.3/drivers/gpu/drm/drm_lock.c
---- linux-3.1.3/drivers/gpu/drm/drm_lock.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/drm_lock.c     2011-11-16 18:39:07.000000000 -0500
-@@ -89,7 +89,7 @@ int drm_lock(struct drm_device *dev, voi
+diff --git a/drivers/gpu/drm/drm_lock.c b/drivers/gpu/drm/drm_lock.c
+index 632ae24..244cf4a 100644
+--- a/drivers/gpu/drm/drm_lock.c
++++ b/drivers/gpu/drm/drm_lock.c
+@@ -89,7 +89,7 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv)
                if (drm_lock_take(&master->lock, lock->context)) {
                        master->lock.file_priv = file_priv;
                        master->lock.lock_time = jiffies;
@@ -26605,7 +28129,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/drm_lock.c linux-3.1.3/drivers/gpu/drm/dr
                        break;  /* Got lock */
                }
  
-@@ -160,7 +160,7 @@ int drm_unlock(struct drm_device *dev, v
+@@ -160,7 +160,7 @@ int drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv)
                return -EINVAL;
        }
  
@@ -26614,10 +28138,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/drm_lock.c linux-3.1.3/drivers/gpu/drm/dr
  
        if (drm_lock_free(&master->lock, lock->context)) {
                /* FIXME: Should really bail out here. */
-diff -urNp linux-3.1.3/drivers/gpu/drm/i810/i810_dma.c linux-3.1.3/drivers/gpu/drm/i810/i810_dma.c
---- linux-3.1.3/drivers/gpu/drm/i810/i810_dma.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/i810/i810_dma.c        2011-11-16 18:39:07.000000000 -0500
-@@ -950,8 +950,8 @@ static int i810_dma_vertex(struct drm_de
+diff --git a/drivers/gpu/drm/i810/i810_dma.c b/drivers/gpu/drm/i810/i810_dma.c
+index 8f371e8..9f85d52 100644
+--- a/drivers/gpu/drm/i810/i810_dma.c
++++ b/drivers/gpu/drm/i810/i810_dma.c
+@@ -950,8 +950,8 @@ static int i810_dma_vertex(struct drm_device *dev, void *data,
                                 dma->buflist[vertex->idx],
                                 vertex->discard, vertex->used);
  
@@ -26628,7 +28153,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/i810/i810_dma.c linux-3.1.3/drivers/gpu/d
        sarea_priv->last_enqueue = dev_priv->counter - 1;
        sarea_priv->last_dispatch = (int)hw_status[5];
  
-@@ -1111,8 +1111,8 @@ static int i810_dma_mc(struct drm_device
+@@ -1111,8 +1111,8 @@ static int i810_dma_mc(struct drm_device *dev, void *data,
        i810_dma_dispatch_mc(dev, dma->buflist[mc->idx], mc->used,
                             mc->last_render);
  
@@ -26639,9 +28164,10 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/i810/i810_dma.c linux-3.1.3/drivers/gpu/d
        sarea_priv->last_enqueue = dev_priv->counter - 1;
        sarea_priv->last_dispatch = (int)hw_status[5];
  
-diff -urNp linux-3.1.3/drivers/gpu/drm/i810/i810_drv.h linux-3.1.3/drivers/gpu/drm/i810/i810_drv.h
---- linux-3.1.3/drivers/gpu/drm/i810/i810_drv.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/i810/i810_drv.h        2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/gpu/drm/i810/i810_drv.h b/drivers/gpu/drm/i810/i810_drv.h
+index c9339f4..f5e1b9d 100644
+--- a/drivers/gpu/drm/i810/i810_drv.h
++++ b/drivers/gpu/drm/i810/i810_drv.h
 @@ -108,8 +108,8 @@ typedef struct drm_i810_private {
        int page_flipping;
  
@@ -26653,10 +28179,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/i810/i810_drv.h linux-3.1.3/drivers/gpu/d
  
        int front_offset;
  } drm_i810_private_t;
-diff -urNp linux-3.1.3/drivers/gpu/drm/i915/i915_debugfs.c linux-3.1.3/drivers/gpu/drm/i915/i915_debugfs.c
---- linux-3.1.3/drivers/gpu/drm/i915/i915_debugfs.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/i915/i915_debugfs.c    2011-11-16 18:39:07.000000000 -0500
-@@ -497,7 +497,7 @@ static int i915_interrupt_info(struct se
+diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
+index 3c395a5..02889c2 100644
+--- a/drivers/gpu/drm/i915/i915_debugfs.c
++++ b/drivers/gpu/drm/i915/i915_debugfs.c
+@@ -497,7 +497,7 @@ static int i915_interrupt_info(struct seq_file *m, void *data)
                           I915_READ(GTIMR));
        }
        seq_printf(m, "Interrupts received: %d\n",
@@ -26665,7 +28192,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/i915/i915_debugfs.c linux-3.1.3/drivers/g
        for (i = 0; i < I915_NUM_RINGS; i++) {
                if (IS_GEN6(dev) || IS_GEN7(dev)) {
                        seq_printf(m, "Graphics Interrupt mask (%s):    %08x\n",
-@@ -1185,7 +1185,7 @@ static int i915_opregion(struct seq_file
+@@ -1185,7 +1185,7 @@ static int i915_opregion(struct seq_file *m, void *unused)
                return ret;
  
        if (opregion->header)
@@ -26674,10 +28201,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/i915/i915_debugfs.c linux-3.1.3/drivers/g
  
        mutex_unlock(&dev->struct_mutex);
  
-diff -urNp linux-3.1.3/drivers/gpu/drm/i915/i915_dma.c linux-3.1.3/drivers/gpu/drm/i915/i915_dma.c
---- linux-3.1.3/drivers/gpu/drm/i915/i915_dma.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/i915/i915_dma.c        2011-11-16 18:39:07.000000000 -0500
-@@ -1171,7 +1171,7 @@ static bool i915_switcheroo_can_switch(s
+diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
+index 8a3942c..1b73bf1 100644
+--- a/drivers/gpu/drm/i915/i915_dma.c
++++ b/drivers/gpu/drm/i915/i915_dma.c
+@@ -1171,7 +1171,7 @@ static bool i915_switcheroo_can_switch(struct pci_dev *pdev)
        bool can_switch;
  
        spin_lock(&dev->count_lock);
@@ -26686,9 +28214,10 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/i915/i915_dma.c linux-3.1.3/drivers/gpu/d
        spin_unlock(&dev->count_lock);
        return can_switch;
  }
-diff -urNp linux-3.1.3/drivers/gpu/drm/i915/i915_drv.h linux-3.1.3/drivers/gpu/drm/i915/i915_drv.h
---- linux-3.1.3/drivers/gpu/drm/i915/i915_drv.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/i915/i915_drv.h        2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
+index 7916bd9..7c17a0f 100644
+--- a/drivers/gpu/drm/i915/i915_drv.h
++++ b/drivers/gpu/drm/i915/i915_drv.h
 @@ -222,7 +222,7 @@ struct drm_i915_display_funcs {
        /* render clock increase/decrease */
        /* display clock increase/decrease */
@@ -26716,7 +28245,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/i915/i915_drv.h linux-3.1.3/drivers/gpu/d
  };
  
  #define to_intel_bo(x) container_of(x, struct drm_i915_gem_object, base)
-@@ -1262,7 +1262,7 @@ extern int intel_setup_gmbus(struct drm_
+@@ -1262,7 +1262,7 @@ extern int intel_setup_gmbus(struct drm_device *dev);
  extern void intel_teardown_gmbus(struct drm_device *dev);
  extern void intel_gmbus_set_speed(struct i2c_adapter *adapter, int speed);
  extern void intel_gmbus_force_bit(struct i2c_adapter *adapter, bool force_bit);
@@ -26725,10 +28254,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/i915/i915_drv.h linux-3.1.3/drivers/gpu/d
  {
        return container_of(adapter, struct intel_gmbus, adapter)->force_bit;
  }
-diff -urNp linux-3.1.3/drivers/gpu/drm/i915/i915_gem_execbuffer.c linux-3.1.3/drivers/gpu/drm/i915/i915_gem_execbuffer.c
---- linux-3.1.3/drivers/gpu/drm/i915/i915_gem_execbuffer.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/i915/i915_gem_execbuffer.c     2011-11-16 18:39:07.000000000 -0500
-@@ -188,7 +188,7 @@ i915_gem_object_set_to_gpu_domain(struct
+diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+index 4934cf8..1da9c84 100644
+--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
++++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+@@ -188,7 +188,7 @@ i915_gem_object_set_to_gpu_domain(struct drm_i915_gem_object *obj,
                i915_gem_clflush_object(obj);
  
        if (obj->base.pending_write_domain)
@@ -26737,10 +28267,23 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/i915/i915_gem_execbuffer.c linux-3.1.3/dr
  
        /* The actual obj->write_domain will be updated with
         * pending_write_domain after we emit the accumulated flush for all
-diff -urNp linux-3.1.3/drivers/gpu/drm/i915/i915_irq.c linux-3.1.3/drivers/gpu/drm/i915/i915_irq.c
---- linux-3.1.3/drivers/gpu/drm/i915/i915_irq.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/i915/i915_irq.c        2011-11-16 18:39:07.000000000 -0500
-@@ -475,7 +475,7 @@ static irqreturn_t ivybridge_irq_handler
+@@ -864,9 +864,9 @@ i915_gem_check_execbuffer(struct drm_i915_gem_execbuffer2 *exec)
+ static int
+ validate_exec_list(struct drm_i915_gem_exec_object2 *exec,
+-                 int count)
++                 unsigned int count)
+ {
+-      int i;
++      unsigned int i;
+       for (i = 0; i < count; i++) {
+               char __user *ptr = (char __user *)(uintptr_t)exec[i].relocs_ptr;
+diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
+index 73248d0..f7bac29 100644
+--- a/drivers/gpu/drm/i915/i915_irq.c
++++ b/drivers/gpu/drm/i915/i915_irq.c
+@@ -475,7 +475,7 @@ static irqreturn_t ivybridge_irq_handler(DRM_IRQ_ARGS)
        u32 de_iir, gt_iir, de_ier, pch_iir, pm_iir;
        struct drm_i915_master_private *master_priv;
  
@@ -26749,7 +28292,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/i915/i915_irq.c linux-3.1.3/drivers/gpu/d
  
        /* disable master interrupt before clearing iir  */
        de_ier = I915_READ(DEIER);
-@@ -565,7 +565,7 @@ static irqreturn_t ironlake_irq_handler(
+@@ -565,7 +565,7 @@ static irqreturn_t ironlake_irq_handler(DRM_IRQ_ARGS)
        struct drm_i915_master_private *master_priv;
        u32 bsd_usr_interrupt = GT_BSD_USER_INTERRUPT;
  
@@ -26758,7 +28301,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/i915/i915_irq.c linux-3.1.3/drivers/gpu/d
  
        if (IS_GEN6(dev))
                bsd_usr_interrupt = GT_GEN6_BSD_USER_INTERRUPT;
-@@ -1228,7 +1228,7 @@ static irqreturn_t i915_driver_irq_handl
+@@ -1229,7 +1229,7 @@ static irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS)
        int ret = IRQ_NONE, pipe;
        bool blc_event = false;
  
@@ -26767,7 +28310,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/i915/i915_irq.c linux-3.1.3/drivers/gpu/d
  
        iir = I915_READ(IIR);
  
-@@ -1740,7 +1740,7 @@ static void ironlake_irq_preinstall(stru
+@@ -1741,7 +1741,7 @@ static void ironlake_irq_preinstall(struct drm_device *dev)
  {
        drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
  
@@ -26776,7 +28319,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/i915/i915_irq.c linux-3.1.3/drivers/gpu/d
  
        INIT_WORK(&dev_priv->hotplug_work, i915_hotplug_work_func);
        INIT_WORK(&dev_priv->error_work, i915_error_work_func);
-@@ -1904,7 +1904,7 @@ static void i915_driver_irq_preinstall(s
+@@ -1905,7 +1905,7 @@ static void i915_driver_irq_preinstall(struct drm_device * dev)
        drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
        int pipe;
  
@@ -26785,10 +28328,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/i915/i915_irq.c linux-3.1.3/drivers/gpu/d
  
        INIT_WORK(&dev_priv->hotplug_work, i915_hotplug_work_func);
        INIT_WORK(&dev_priv->error_work, i915_error_work_func);
-diff -urNp linux-3.1.3/drivers/gpu/drm/i915/intel_display.c linux-3.1.3/drivers/gpu/drm/i915/intel_display.c
---- linux-3.1.3/drivers/gpu/drm/i915/intel_display.c   2011-11-26 19:57:29.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/i915/intel_display.c   2011-11-26 20:00:43.000000000 -0500
-@@ -2205,7 +2205,7 @@ intel_pipe_set_base(struct drm_crtc *crt
+diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
+index 07e7cf3..c75f312 100644
+--- a/drivers/gpu/drm/i915/intel_display.c
++++ b/drivers/gpu/drm/i915/intel_display.c
+@@ -2205,7 +2205,7 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
  
                wait_event(dev_priv->pending_flip_queue,
                           atomic_read(&dev_priv->mm.wedged) ||
@@ -26797,7 +28341,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/i915/intel_display.c linux-3.1.3/drivers/
  
                /* Big Hammer, we also need to ensure that any pending
                 * MI_WAIT_FOR_EVENT inside a user batch buffer on the
-@@ -2826,7 +2826,7 @@ static void intel_crtc_wait_for_pending_
+@@ -2826,7 +2826,7 @@ static void intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc)
        obj = to_intel_framebuffer(crtc->fb)->obj;
        dev_priv = crtc->dev->dev_private;
        wait_event(dev_priv->pending_flip_queue,
@@ -26806,7 +28350,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/i915/intel_display.c linux-3.1.3/drivers/
  }
  
  static bool intel_crtc_driving_pch(struct drm_crtc *crtc)
-@@ -6676,7 +6676,7 @@ static void do_intel_finish_page_flip(st
+@@ -6676,7 +6676,7 @@ static void do_intel_finish_page_flip(struct drm_device *dev,
  
        atomic_clear_mask(1 << intel_crtc->plane,
                          &obj->pending_flip.counter);
@@ -26815,7 +28359,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/i915/intel_display.c linux-3.1.3/drivers/
                wake_up(&dev_priv->pending_flip_queue);
  
        schedule_work(&work->work);
-@@ -6965,7 +6965,7 @@ static int intel_crtc_page_flip(struct d
+@@ -6965,7 +6965,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
        /* Block clients from rendering to the new back buffer until
         * the flip occurs and the object is no longer visible.
         */
@@ -26824,7 +28368,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/i915/intel_display.c linux-3.1.3/drivers/
  
        ret = dev_priv->display.queue_flip(dev, crtc, fb, obj);
        if (ret)
-@@ -6979,7 +6979,7 @@ static int intel_crtc_page_flip(struct d
+@@ -6979,7 +6979,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
        return 0;
  
  cleanup_pending:
@@ -26833,9 +28377,10 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/i915/intel_display.c linux-3.1.3/drivers/
  cleanup_objs:
        drm_gem_object_unreference(&work->old_fb_obj->base);
        drm_gem_object_unreference(&obj->base);
-diff -urNp linux-3.1.3/drivers/gpu/drm/mga/mga_drv.h linux-3.1.3/drivers/gpu/drm/mga/mga_drv.h
---- linux-3.1.3/drivers/gpu/drm/mga/mga_drv.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/mga/mga_drv.h  2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/gpu/drm/mga/mga_drv.h b/drivers/gpu/drm/mga/mga_drv.h
+index 54558a0..2d97005 100644
+--- a/drivers/gpu/drm/mga/mga_drv.h
++++ b/drivers/gpu/drm/mga/mga_drv.h
 @@ -120,9 +120,9 @@ typedef struct drm_mga_private {
        u32 clear_cmd;
        u32 maccess;
@@ -26848,10 +28393,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/mga/mga_drv.h linux-3.1.3/drivers/gpu/drm
        u32 next_fence_to_post;
  
        unsigned int fb_cpp;
-diff -urNp linux-3.1.3/drivers/gpu/drm/mga/mga_irq.c linux-3.1.3/drivers/gpu/drm/mga/mga_irq.c
---- linux-3.1.3/drivers/gpu/drm/mga/mga_irq.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/mga/mga_irq.c  2011-11-16 18:39:07.000000000 -0500
-@@ -44,7 +44,7 @@ u32 mga_get_vblank_counter(struct drm_de
+diff --git a/drivers/gpu/drm/mga/mga_irq.c b/drivers/gpu/drm/mga/mga_irq.c
+index 2581202..f230a8d9 100644
+--- a/drivers/gpu/drm/mga/mga_irq.c
++++ b/drivers/gpu/drm/mga/mga_irq.c
+@@ -44,7 +44,7 @@ u32 mga_get_vblank_counter(struct drm_device *dev, int crtc)
        if (crtc != 0)
                return 0;
  
@@ -26860,7 +28406,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/mga/mga_irq.c linux-3.1.3/drivers/gpu/drm
  }
  
  
-@@ -60,7 +60,7 @@ irqreturn_t mga_driver_irq_handler(DRM_I
+@@ -60,7 +60,7 @@ irqreturn_t mga_driver_irq_handler(DRM_IRQ_ARGS)
        /* VBLANK interrupt */
        if (status & MGA_VLINEPEN) {
                MGA_WRITE(MGA_ICLEAR, MGA_VLINEICLR);
@@ -26869,7 +28415,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/mga/mga_irq.c linux-3.1.3/drivers/gpu/drm
                drm_handle_vblank(dev, 0);
                handled = 1;
        }
-@@ -79,7 +79,7 @@ irqreturn_t mga_driver_irq_handler(DRM_I
+@@ -79,7 +79,7 @@ irqreturn_t mga_driver_irq_handler(DRM_IRQ_ARGS)
                if ((prim_start & ~0x03) != (prim_end & ~0x03))
                        MGA_WRITE(MGA_PRIMEND, prim_end);
  
@@ -26878,7 +28424,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/mga/mga_irq.c linux-3.1.3/drivers/gpu/drm
                DRM_WAKEUP(&dev_priv->fence_queue);
                handled = 1;
        }
-@@ -130,7 +130,7 @@ int mga_driver_fence_wait(struct drm_dev
+@@ -130,7 +130,7 @@ int mga_driver_fence_wait(struct drm_device *dev, unsigned int *sequence)
         * using fences.
         */
        DRM_WAIT_ON(ret, dev_priv->fence_queue, 3 * DRM_HZ,
@@ -26887,9 +28433,10 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/mga/mga_irq.c linux-3.1.3/drivers/gpu/drm
                      - *sequence) <= (1 << 23)));
  
        *sequence = cur_fence;
-diff -urNp linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_bios.c linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_bios.c
---- linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_bios.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_bios.c 2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c
+index b311fab..dc11d6a 100644
+--- a/drivers/gpu/drm/nouveau/nouveau_bios.c
++++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
 @@ -201,7 +201,7 @@ struct methods {
        const char desc[8];
        void (*loadbios)(struct drm_device *, uint8_t *);
@@ -26899,7 +28446,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_bios.c linux-3.1.3/driver
  
  static struct methods shadow_methods[] = {
        { "PRAMIN", load_vbios_pramin, true },
-@@ -5489,7 +5489,7 @@ parse_bit_displayport_tbl_entry(struct d
+@@ -5489,7 +5489,7 @@ parse_bit_displayport_tbl_entry(struct drm_device *dev, struct nvbios *bios,
  struct bit_table {
        const char id;
        int (* const parse_fn)(struct drm_device *, struct nvbios *, struct bit_entry *);
@@ -26908,9 +28455,10 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_bios.c linux-3.1.3/driver
  
  #define BIT_TABLE(id, funcid) ((struct bit_table){ id, parse_bit_##funcid##_tbl_entry })
  
-diff -urNp linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_drv.h linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_drv.h
---- linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_drv.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_drv.h  2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h
+index d7d51de..7c6a7f1 100644
+--- a/drivers/gpu/drm/nouveau/nouveau_drv.h
++++ b/drivers/gpu/drm/nouveau/nouveau_drv.h
 @@ -238,7 +238,7 @@ struct nouveau_channel {
                struct list_head pending;
                uint32_t sequence;
@@ -26963,10 +28511,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_drv.h linux-3.1.3/drivers
        } ttm;
  
        struct {
-diff -urNp linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_fence.c linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_fence.c
---- linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_fence.c        2011-11-26 19:57:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_fence.c        2011-11-26 20:00:06.000000000 -0500
-@@ -85,7 +85,7 @@ nouveau_fence_update(struct nouveau_chan
+diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouveau/nouveau_fence.c
+index ae22dfa..4f09960 100644
+--- a/drivers/gpu/drm/nouveau/nouveau_fence.c
++++ b/drivers/gpu/drm/nouveau/nouveau_fence.c
+@@ -85,7 +85,7 @@ nouveau_fence_update(struct nouveau_channel *chan)
                if (USE_REFCNT(dev))
                        sequence = nvchan_rd32(chan, 0x48);
                else
@@ -26975,7 +28524,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_fence.c linux-3.1.3/drive
  
                if (chan->fence.sequence_ack == sequence)
                        goto out;
-@@ -539,7 +539,7 @@ nouveau_fence_channel_init(struct nouvea
+@@ -539,7 +539,7 @@ nouveau_fence_channel_init(struct nouveau_channel *chan)
                        return ret;
        }
  
@@ -26984,10 +28533,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_fence.c linux-3.1.3/drive
        return 0;
  }
  
-diff -urNp linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_gem.c linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_gem.c
---- linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_gem.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_gem.c  2011-11-16 18:39:07.000000000 -0500
-@@ -314,7 +314,7 @@ validate_init(struct nouveau_channel *ch
+diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c
+index 5f0bc57..eb9fac8 100644
+--- a/drivers/gpu/drm/nouveau/nouveau_gem.c
++++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
+@@ -314,7 +314,7 @@ validate_init(struct nouveau_channel *chan, struct drm_file *file_priv,
        int trycnt = 0;
        int ret, i;
  
@@ -26996,10 +28546,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_gem.c linux-3.1.3/drivers
  retry:
        if (++trycnt > 100000) {
                NV_ERROR(dev, "%s failed and gave up.\n", __func__);
-diff -urNp linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_state.c linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_state.c
---- linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_state.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_state.c        2011-11-16 18:39:07.000000000 -0500
-@@ -496,7 +496,7 @@ static bool nouveau_switcheroo_can_switc
+diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c
+index 10656e4..59bf2a4 100644
+--- a/drivers/gpu/drm/nouveau/nouveau_state.c
++++ b/drivers/gpu/drm/nouveau/nouveau_state.c
+@@ -496,7 +496,7 @@ static bool nouveau_switcheroo_can_switch(struct pci_dev *pdev)
        bool can_switch;
  
        spin_lock(&dev->count_lock);
@@ -27008,9 +28559,10 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_state.c linux-3.1.3/drive
        spin_unlock(&dev->count_lock);
        return can_switch;
  }
-diff -urNp linux-3.1.3/drivers/gpu/drm/nouveau/nv04_graph.c linux-3.1.3/drivers/gpu/drm/nouveau/nv04_graph.c
---- linux-3.1.3/drivers/gpu/drm/nouveau/nv04_graph.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/nouveau/nv04_graph.c   2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/gpu/drm/nouveau/nv04_graph.c b/drivers/gpu/drm/nouveau/nv04_graph.c
+index dbdea8e..cd6eeeb 100644
+--- a/drivers/gpu/drm/nouveau/nv04_graph.c
++++ b/drivers/gpu/drm/nouveau/nv04_graph.c
 @@ -554,7 +554,7 @@ static int
  nv04_graph_mthd_set_ref(struct nouveau_channel *chan,
                        u32 class, u32 mthd, u32 data)
@@ -27020,10 +28572,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/nouveau/nv04_graph.c linux-3.1.3/drivers/
        return 0;
  }
  
-diff -urNp linux-3.1.3/drivers/gpu/drm/r128/r128_cce.c linux-3.1.3/drivers/gpu/drm/r128/r128_cce.c
---- linux-3.1.3/drivers/gpu/drm/r128/r128_cce.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/r128/r128_cce.c        2011-11-16 18:39:07.000000000 -0500
-@@ -377,7 +377,7 @@ static int r128_do_init_cce(struct drm_d
+diff --git a/drivers/gpu/drm/r128/r128_cce.c b/drivers/gpu/drm/r128/r128_cce.c
+index 570e190..084a31a 100644
+--- a/drivers/gpu/drm/r128/r128_cce.c
++++ b/drivers/gpu/drm/r128/r128_cce.c
+@@ -377,7 +377,7 @@ static int r128_do_init_cce(struct drm_device *dev, drm_r128_init_t *init)
  
        /* GH: Simple idle check.
         */
@@ -27032,9 +28585,10 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/r128/r128_cce.c linux-3.1.3/drivers/gpu/d
  
        /* We don't support anything other than bus-mastering ring mode,
         * but the ring can be in either AGP or PCI space for the ring
-diff -urNp linux-3.1.3/drivers/gpu/drm/r128/r128_drv.h linux-3.1.3/drivers/gpu/drm/r128/r128_drv.h
---- linux-3.1.3/drivers/gpu/drm/r128/r128_drv.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/r128/r128_drv.h        2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/gpu/drm/r128/r128_drv.h b/drivers/gpu/drm/r128/r128_drv.h
+index 930c71b..499aded 100644
+--- a/drivers/gpu/drm/r128/r128_drv.h
++++ b/drivers/gpu/drm/r128/r128_drv.h
 @@ -90,14 +90,14 @@ typedef struct drm_r128_private {
        int is_pci;
        unsigned long cce_buffers_offset;
@@ -27052,10 +28606,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/r128/r128_drv.h linux-3.1.3/drivers/gpu/d
  
        u32 color_fmt;
        unsigned int front_offset;
-diff -urNp linux-3.1.3/drivers/gpu/drm/r128/r128_irq.c linux-3.1.3/drivers/gpu/drm/r128/r128_irq.c
---- linux-3.1.3/drivers/gpu/drm/r128/r128_irq.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/r128/r128_irq.c        2011-11-16 18:39:07.000000000 -0500
-@@ -42,7 +42,7 @@ u32 r128_get_vblank_counter(struct drm_d
+diff --git a/drivers/gpu/drm/r128/r128_irq.c b/drivers/gpu/drm/r128/r128_irq.c
+index 429d5a0..7e899ed 100644
+--- a/drivers/gpu/drm/r128/r128_irq.c
++++ b/drivers/gpu/drm/r128/r128_irq.c
+@@ -42,7 +42,7 @@ u32 r128_get_vblank_counter(struct drm_device *dev, int crtc)
        if (crtc != 0)
                return 0;
  
@@ -27064,7 +28619,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/r128/r128_irq.c linux-3.1.3/drivers/gpu/d
  }
  
  irqreturn_t r128_driver_irq_handler(DRM_IRQ_ARGS)
-@@ -56,7 +56,7 @@ irqreturn_t r128_driver_irq_handler(DRM_
+@@ -56,7 +56,7 @@ irqreturn_t r128_driver_irq_handler(DRM_IRQ_ARGS)
        /* VBLANK interrupt */
        if (status & R128_CRTC_VBLANK_INT) {
                R128_WRITE(R128_GEN_INT_STATUS, R128_CRTC_VBLANK_INT_AK);
@@ -27073,10 +28628,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/r128/r128_irq.c linux-3.1.3/drivers/gpu/d
                drm_handle_vblank(dev, 0);
                return IRQ_HANDLED;
        }
-diff -urNp linux-3.1.3/drivers/gpu/drm/r128/r128_state.c linux-3.1.3/drivers/gpu/drm/r128/r128_state.c
---- linux-3.1.3/drivers/gpu/drm/r128/r128_state.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/r128/r128_state.c      2011-11-16 18:39:07.000000000 -0500
-@@ -321,10 +321,10 @@ static void r128_clear_box(drm_r128_priv
+diff --git a/drivers/gpu/drm/r128/r128_state.c b/drivers/gpu/drm/r128/r128_state.c
+index a9e33ce..09edd4b 100644
+--- a/drivers/gpu/drm/r128/r128_state.c
++++ b/drivers/gpu/drm/r128/r128_state.c
+@@ -321,10 +321,10 @@ static void r128_clear_box(drm_r128_private_t *dev_priv,
  
  static void r128_cce_performance_boxes(drm_r128_private_t *dev_priv)
  {
@@ -27089,10 +28645,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/r128/r128_state.c linux-3.1.3/drivers/gpu
  }
  
  #endif
-diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/atom.c linux-3.1.3/drivers/gpu/drm/radeon/atom.c
---- linux-3.1.3/drivers/gpu/drm/radeon/atom.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/radeon/atom.c  2011-11-16 19:09:42.000000000 -0500
-@@ -1254,6 +1254,8 @@ struct atom_context *atom_parse(struct c
+diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c
+index 14cc88a..cc7b3a5 100644
+--- a/drivers/gpu/drm/radeon/atom.c
++++ b/drivers/gpu/drm/radeon/atom.c
+@@ -1254,6 +1254,8 @@ struct atom_context *atom_parse(struct card_info *card, void *bios)
        char name[512];
        int i;
  
@@ -27101,10 +28658,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/atom.c linux-3.1.3/drivers/gpu/drm
        if (!ctx)
                return NULL;
  
-diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/mkregtable.c linux-3.1.3/drivers/gpu/drm/radeon/mkregtable.c
---- linux-3.1.3/drivers/gpu/drm/radeon/mkregtable.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/radeon/mkregtable.c    2011-11-16 18:39:07.000000000 -0500
-@@ -637,14 +637,14 @@ static int parser_auth(struct table *t, 
+diff --git a/drivers/gpu/drm/radeon/mkregtable.c b/drivers/gpu/drm/radeon/mkregtable.c
+index 5a82b6b..9e69c73 100644
+--- a/drivers/gpu/drm/radeon/mkregtable.c
++++ b/drivers/gpu/drm/radeon/mkregtable.c
+@@ -637,14 +637,14 @@ static int parser_auth(struct table *t, const char *filename)
        regex_t mask_rex;
        regmatch_t match[4];
        char buf[1024];
@@ -27121,10 +28679,33 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/mkregtable.c linux-3.1.3/drivers/g
  
        if (regcomp
            (&mask_rex, "(0x[0-9a-fA-F]*) *([_a-zA-Z0-9]*)", REG_EXTENDED)) {
-diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon_atombios.c linux-3.1.3/drivers/gpu/drm/radeon/radeon_atombios.c
---- linux-3.1.3/drivers/gpu/drm/radeon/radeon_atombios.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/radeon/radeon_atombios.c       2011-11-16 18:40:10.000000000 -0500
-@@ -545,6 +545,8 @@ bool radeon_get_atom_connector_info_from
+diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
+index 184628c..30e1725 100644
+--- a/drivers/gpu/drm/radeon/radeon.h
++++ b/drivers/gpu/drm/radeon/radeon.h
+@@ -192,7 +192,7 @@ extern int sumo_get_temp(struct radeon_device *rdev);
+  */
+ struct radeon_fence_driver {
+       uint32_t                        scratch_reg;
+-      atomic_t                        seq;
++      atomic_unchecked_t              seq;
+       uint32_t                        last_seq;
+       unsigned long                   last_jiffies;
+       unsigned long                   last_timeout;
+@@ -962,7 +962,7 @@ struct radeon_asic {
+       void (*pre_page_flip)(struct radeon_device *rdev, int crtc);
+       u32 (*page_flip)(struct radeon_device *rdev, int crtc, u64 crtc_base);
+       void (*post_page_flip)(struct radeon_device *rdev, int crtc);
+-};
++} __no_const;
+ /*
+  * Asic structures
+diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
+index 285acc4..f4d909f 100644
+--- a/drivers/gpu/drm/radeon/radeon_atombios.c
++++ b/drivers/gpu/drm/radeon/radeon_atombios.c
+@@ -569,6 +569,8 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
        struct radeon_gpio_rec gpio;
        struct radeon_hpd hpd;
  
@@ -27133,10 +28714,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon_atombios.c linux-3.1.3/driv
        if (!atom_parse_data_header(ctx, index, &size, &frev, &crev, &data_offset))
                return false;
  
-diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon_device.c linux-3.1.3/drivers/gpu/drm/radeon/radeon_device.c
---- linux-3.1.3/drivers/gpu/drm/radeon/radeon_device.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/radeon/radeon_device.c 2011-11-16 18:39:07.000000000 -0500
-@@ -684,7 +684,7 @@ static bool radeon_switcheroo_can_switch
+diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
+index b51e157..8f14fb9 100644
+--- a/drivers/gpu/drm/radeon/radeon_device.c
++++ b/drivers/gpu/drm/radeon/radeon_device.c
+@@ -684,7 +684,7 @@ static bool radeon_switcheroo_can_switch(struct pci_dev *pdev)
        bool can_switch;
  
        spin_lock(&dev->count_lock);
@@ -27145,10 +28727,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon_device.c linux-3.1.3/driver
        spin_unlock(&dev->count_lock);
        return can_switch;
  }
-diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon_display.c linux-3.1.3/drivers/gpu/drm/radeon/radeon_display.c
---- linux-3.1.3/drivers/gpu/drm/radeon/radeon_display.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/radeon/radeon_display.c        2011-11-16 18:40:10.000000000 -0500
-@@ -925,6 +925,8 @@ void radeon_compute_pll_legacy(struct ra
+diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
+index 6adb3e5..b91553e2 100644
+--- a/drivers/gpu/drm/radeon/radeon_display.c
++++ b/drivers/gpu/drm/radeon/radeon_display.c
+@@ -925,6 +925,8 @@ void radeon_compute_pll_legacy(struct radeon_pll *pll,
        uint32_t post_div;
        u32 pll_out_min, pll_out_max;
  
@@ -27157,9 +28740,10 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon_display.c linux-3.1.3/drive
        DRM_DEBUG_KMS("PLL freq %llu %u %u\n", freq, pll->min_ref_div, pll->max_ref_div);
        freq = freq * 1000;
  
-diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon_drv.h linux-3.1.3/drivers/gpu/drm/radeon/radeon_drv.h
---- linux-3.1.3/drivers/gpu/drm/radeon/radeon_drv.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/radeon/radeon_drv.h    2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/gpu/drm/radeon/radeon_drv.h b/drivers/gpu/drm/radeon/radeon_drv.h
+index a1b59ca..86f2d44 100644
+--- a/drivers/gpu/drm/radeon/radeon_drv.h
++++ b/drivers/gpu/drm/radeon/radeon_drv.h
 @@ -255,7 +255,7 @@ typedef struct drm_radeon_private {
  
        /* SW interrupt */
@@ -27169,10 +28753,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon_drv.h linux-3.1.3/drivers/g
        int vblank_crtc;
        uint32_t irq_enable_reg;
        uint32_t r500_disp_irq_reg;
-diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon_fence.c linux-3.1.3/drivers/gpu/drm/radeon/radeon_fence.c
---- linux-3.1.3/drivers/gpu/drm/radeon/radeon_fence.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/radeon/radeon_fence.c  2011-11-16 18:39:07.000000000 -0500
-@@ -78,7 +78,7 @@ int radeon_fence_emit(struct radeon_devi
+diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c
+index 7fd4e3e..9748ab5 100644
+--- a/drivers/gpu/drm/radeon/radeon_fence.c
++++ b/drivers/gpu/drm/radeon/radeon_fence.c
+@@ -78,7 +78,7 @@ int radeon_fence_emit(struct radeon_device *rdev, struct radeon_fence *fence)
                write_unlock_irqrestore(&rdev->fence_drv.lock, irq_flags);
                return 0;
        }
@@ -27181,7 +28766,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon_fence.c linux-3.1.3/drivers
        if (!rdev->cp.ready)
                /* FIXME: cp is not running assume everythings is done right
                 * away
-@@ -373,7 +373,7 @@ int radeon_fence_driver_init(struct rade
+@@ -373,7 +373,7 @@ int radeon_fence_driver_init(struct radeon_device *rdev)
                return r;
        }
        radeon_fence_write(rdev, 0);
@@ -27190,31 +28775,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon_fence.c linux-3.1.3/drivers
        INIT_LIST_HEAD(&rdev->fence_drv.created);
        INIT_LIST_HEAD(&rdev->fence_drv.emited);
        INIT_LIST_HEAD(&rdev->fence_drv.signaled);
-diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon.h linux-3.1.3/drivers/gpu/drm/radeon/radeon.h
---- linux-3.1.3/drivers/gpu/drm/radeon/radeon.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/radeon/radeon.h        2011-11-16 18:39:07.000000000 -0500
-@@ -192,7 +192,7 @@ extern int sumo_get_temp(struct radeon_d
-  */
- struct radeon_fence_driver {
-       uint32_t                        scratch_reg;
--      atomic_t                        seq;
-+      atomic_unchecked_t              seq;
-       uint32_t                        last_seq;
-       unsigned long                   last_jiffies;
-       unsigned long                   last_timeout;
-@@ -962,7 +962,7 @@ struct radeon_asic {
-       void (*pre_page_flip)(struct radeon_device *rdev, int crtc);
-       u32 (*page_flip)(struct radeon_device *rdev, int crtc, u64 crtc_base);
-       void (*post_page_flip)(struct radeon_device *rdev, int crtc);
--};
-+} __no_const;
- /*
-  * Asic structures
-diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon_ioc32.c linux-3.1.3/drivers/gpu/drm/radeon/radeon_ioc32.c
---- linux-3.1.3/drivers/gpu/drm/radeon/radeon_ioc32.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/radeon/radeon_ioc32.c  2011-11-16 18:39:07.000000000 -0500
-@@ -359,7 +359,7 @@ static int compat_radeon_cp_setparam(str
+diff --git a/drivers/gpu/drm/radeon/radeon_ioc32.c b/drivers/gpu/drm/radeon/radeon_ioc32.c
+index 48b7cea..342236f 100644
+--- a/drivers/gpu/drm/radeon/radeon_ioc32.c
++++ b/drivers/gpu/drm/radeon/radeon_ioc32.c
+@@ -359,7 +359,7 @@ static int compat_radeon_cp_setparam(struct file *file, unsigned int cmd,
        request = compat_alloc_user_space(sizeof(*request));
        if (!access_ok(VERIFY_WRITE, request, sizeof(*request))
            || __put_user(req32.param, &request->param)
@@ -27223,10 +28788,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon_ioc32.c linux-3.1.3/drivers
                          &request->value))
                return -EFAULT;
  
-diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon_irq.c linux-3.1.3/drivers/gpu/drm/radeon/radeon_irq.c
---- linux-3.1.3/drivers/gpu/drm/radeon/radeon_irq.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/radeon/radeon_irq.c    2011-11-16 18:39:07.000000000 -0500
-@@ -225,8 +225,8 @@ static int radeon_emit_irq(struct drm_de
+diff --git a/drivers/gpu/drm/radeon/radeon_irq.c b/drivers/gpu/drm/radeon/radeon_irq.c
+index 465746b..cb2b055 100644
+--- a/drivers/gpu/drm/radeon/radeon_irq.c
++++ b/drivers/gpu/drm/radeon/radeon_irq.c
+@@ -225,8 +225,8 @@ static int radeon_emit_irq(struct drm_device * dev)
        unsigned int ret;
        RING_LOCALS;
  
@@ -27237,7 +28803,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon_irq.c linux-3.1.3/drivers/g
  
        BEGIN_RING(4);
        OUT_RING_REG(RADEON_LAST_SWI_REG, ret);
-@@ -352,7 +352,7 @@ int radeon_driver_irq_postinstall(struct
+@@ -352,7 +352,7 @@ int radeon_driver_irq_postinstall(struct drm_device *dev)
        drm_radeon_private_t *dev_priv =
            (drm_radeon_private_t *) dev->dev_private;
  
@@ -27246,10 +28812,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon_irq.c linux-3.1.3/drivers/g
        DRM_INIT_WAITQUEUE(&dev_priv->swi_queue);
  
        dev->max_vblank_count = 0x001fffff;
-diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon_state.c linux-3.1.3/drivers/gpu/drm/radeon/radeon_state.c
---- linux-3.1.3/drivers/gpu/drm/radeon/radeon_state.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/radeon/radeon_state.c  2011-11-16 18:39:07.000000000 -0500
-@@ -2168,7 +2168,7 @@ static int radeon_cp_clear(struct drm_de
+diff --git a/drivers/gpu/drm/radeon/radeon_state.c b/drivers/gpu/drm/radeon/radeon_state.c
+index 92e7ea7..147ffad 100644
+--- a/drivers/gpu/drm/radeon/radeon_state.c
++++ b/drivers/gpu/drm/radeon/radeon_state.c
+@@ -2168,7 +2168,7 @@ static int radeon_cp_clear(struct drm_device *dev, void *data, struct drm_file *
        if (sarea_priv->nbox > RADEON_NR_SAREA_CLIPRECTS)
                sarea_priv->nbox = RADEON_NR_SAREA_CLIPRECTS;
  
@@ -27258,7 +28825,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon_state.c linux-3.1.3/drivers
                               sarea_priv->nbox * sizeof(depth_boxes[0])))
                return -EFAULT;
  
-@@ -3031,7 +3031,7 @@ static int radeon_cp_getparam(struct drm
+@@ -3031,7 +3031,7 @@ static int radeon_cp_getparam(struct drm_device *dev, void *data, struct drm_fil
  {
        drm_radeon_private_t *dev_priv = dev->dev_private;
        drm_radeon_getparam_t *param = data;
@@ -27267,10 +28834,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon_state.c linux-3.1.3/drivers
  
        DRM_DEBUG("pid=%d\n", DRM_CURRENTPID);
  
-diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon_ttm.c linux-3.1.3/drivers/gpu/drm/radeon/radeon_ttm.c
---- linux-3.1.3/drivers/gpu/drm/radeon/radeon_ttm.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/radeon/radeon_ttm.c    2011-11-16 18:39:07.000000000 -0500
-@@ -672,8 +672,10 @@ int radeon_mmap(struct file *filp, struc
+diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
+index 0b5468b..9c4b308 100644
+--- a/drivers/gpu/drm/radeon/radeon_ttm.c
++++ b/drivers/gpu/drm/radeon/radeon_ttm.c
+@@ -672,8 +672,10 @@ int radeon_mmap(struct file *filp, struct vm_area_struct *vma)
        }
        if (unlikely(ttm_vm_ops == NULL)) {
                ttm_vm_ops = vma->vm_ops;
@@ -27283,10 +28851,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon_ttm.c linux-3.1.3/drivers/g
        }
        vma->vm_ops = &radeon_ttm_vm_ops;
        return 0;
-diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/rs690.c linux-3.1.3/drivers/gpu/drm/radeon/rs690.c
---- linux-3.1.3/drivers/gpu/drm/radeon/rs690.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/radeon/rs690.c 2011-11-16 18:39:07.000000000 -0500
-@@ -304,9 +304,11 @@ void rs690_crtc_bandwidth_compute(struct
+diff --git a/drivers/gpu/drm/radeon/rs690.c b/drivers/gpu/drm/radeon/rs690.c
+index a9049ed..501f284 100644
+--- a/drivers/gpu/drm/radeon/rs690.c
++++ b/drivers/gpu/drm/radeon/rs690.c
+@@ -304,9 +304,11 @@ void rs690_crtc_bandwidth_compute(struct radeon_device *rdev,
                if (rdev->pm.max_bandwidth.full > rdev->pm.sideport_bandwidth.full &&
                        rdev->pm.sideport_bandwidth.full)
                        rdev->pm.max_bandwidth = rdev->pm.sideport_bandwidth;
@@ -27299,10 +28868,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/rs690.c linux-3.1.3/drivers/gpu/dr
        } else {
                if (rdev->pm.max_bandwidth.full > rdev->pm.k8_bandwidth.full &&
                        rdev->pm.k8_bandwidth.full)
-diff -urNp linux-3.1.3/drivers/gpu/drm/ttm/ttm_page_alloc.c linux-3.1.3/drivers/gpu/drm/ttm/ttm_page_alloc.c
---- linux-3.1.3/drivers/gpu/drm/ttm/ttm_page_alloc.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/ttm/ttm_page_alloc.c   2011-11-16 18:39:07.000000000 -0500
-@@ -398,9 +398,9 @@ static int ttm_pool_get_num_unused_pages
+diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c
+index 727e93d..1565650 100644
+--- a/drivers/gpu/drm/ttm/ttm_page_alloc.c
++++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c
+@@ -398,9 +398,9 @@ static int ttm_pool_get_num_unused_pages(void)
  static int ttm_pool_mm_shrink(struct shrinker *shrink,
                              struct shrink_control *sc)
  {
@@ -27314,9 +28884,10 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/ttm/ttm_page_alloc.c linux-3.1.3/drivers/
        struct ttm_page_pool *pool;
        int shrink_pages = sc->nr_to_scan;
  
-diff -urNp linux-3.1.3/drivers/gpu/drm/via/via_drv.h linux-3.1.3/drivers/gpu/drm/via/via_drv.h
---- linux-3.1.3/drivers/gpu/drm/via/via_drv.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/via/via_drv.h  2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
+index 9cf87d9..2000b7d 100644
+--- a/drivers/gpu/drm/via/via_drv.h
++++ b/drivers/gpu/drm/via/via_drv.h
 @@ -51,7 +51,7 @@ typedef struct drm_via_ring_buffer {
  typedef uint32_t maskarray_t[5];
  
@@ -27335,10 +28906,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/via/via_drv.h linux-3.1.3/drivers/gpu/drm
        drm_via_state_t hc_state;
        char pci_buf[VIA_PCI_BUF_SIZE];
        const uint32_t *fire_offsets[VIA_FIRE_BUF_SIZE];
-diff -urNp linux-3.1.3/drivers/gpu/drm/via/via_irq.c linux-3.1.3/drivers/gpu/drm/via/via_irq.c
---- linux-3.1.3/drivers/gpu/drm/via/via_irq.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/via/via_irq.c  2011-11-16 18:39:07.000000000 -0500
-@@ -102,7 +102,7 @@ u32 via_get_vblank_counter(struct drm_de
+diff --git a/drivers/gpu/drm/via/via_irq.c b/drivers/gpu/drm/via/via_irq.c
+index d391f48..10c8ca3 100644
+--- a/drivers/gpu/drm/via/via_irq.c
++++ b/drivers/gpu/drm/via/via_irq.c
+@@ -102,7 +102,7 @@ u32 via_get_vblank_counter(struct drm_device *dev, int crtc)
        if (crtc != 0)
                return 0;
  
@@ -27347,7 +28919,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/via/via_irq.c linux-3.1.3/drivers/gpu/drm
  }
  
  irqreturn_t via_driver_irq_handler(DRM_IRQ_ARGS)
-@@ -117,8 +117,8 @@ irqreturn_t via_driver_irq_handler(DRM_I
+@@ -117,8 +117,8 @@ irqreturn_t via_driver_irq_handler(DRM_IRQ_ARGS)
  
        status = VIA_READ(VIA_REG_INTERRUPT);
        if (status & VIA_IRQ_VBLANK_PENDING) {
@@ -27358,7 +28930,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/via/via_irq.c linux-3.1.3/drivers/gpu/drm
                        do_gettimeofday(&cur_vblank);
                        if (dev_priv->last_vblank_valid) {
                                dev_priv->usec_per_vblank =
-@@ -128,7 +128,7 @@ irqreturn_t via_driver_irq_handler(DRM_I
+@@ -128,7 +128,7 @@ irqreturn_t via_driver_irq_handler(DRM_IRQ_ARGS)
                        dev_priv->last_vblank = cur_vblank;
                        dev_priv->last_vblank_valid = 1;
                }
@@ -27367,7 +28939,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/via/via_irq.c linux-3.1.3/drivers/gpu/drm
                        DRM_DEBUG("US per vblank is: %u\n",
                                  dev_priv->usec_per_vblank);
                }
-@@ -138,7 +138,7 @@ irqreturn_t via_driver_irq_handler(DRM_I
+@@ -138,7 +138,7 @@ irqreturn_t via_driver_irq_handler(DRM_IRQ_ARGS)
  
        for (i = 0; i < dev_priv->num_irqs; ++i) {
                if (status & cur_irq->pending_mask) {
@@ -27376,7 +28948,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/via/via_irq.c linux-3.1.3/drivers/gpu/drm
                        DRM_WAKEUP(&cur_irq->irq_queue);
                        handled = 1;
                        if (dev_priv->irq_map[drm_via_irq_dma0_td] == i)
-@@ -243,11 +243,11 @@ via_driver_irq_wait(struct drm_device *d
+@@ -243,11 +243,11 @@ via_driver_irq_wait(struct drm_device *dev, unsigned int irq, int force_sequence
                DRM_WAIT_ON(ret, cur_irq->irq_queue, 3 * DRM_HZ,
                            ((VIA_READ(masks[irq][2]) & masks[irq][3]) ==
                             masks[irq][4]));
@@ -27390,7 +28962,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/via/via_irq.c linux-3.1.3/drivers/gpu/drm
                              *sequence) <= (1 << 23)));
        }
        *sequence = cur_irq_sequence;
-@@ -285,7 +285,7 @@ void via_driver_irq_preinstall(struct dr
+@@ -285,7 +285,7 @@ void via_driver_irq_preinstall(struct drm_device *dev)
                }
  
                for (i = 0; i < dev_priv->num_irqs; ++i) {
@@ -27399,7 +28971,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/via/via_irq.c linux-3.1.3/drivers/gpu/drm
                        cur_irq->enable_mask = dev_priv->irq_masks[i][0];
                        cur_irq->pending_mask = dev_priv->irq_masks[i][1];
                        DRM_INIT_WAITQUEUE(&cur_irq->irq_queue);
-@@ -367,7 +367,7 @@ int via_wait_irq(struct drm_device *dev,
+@@ -367,7 +367,7 @@ int via_wait_irq(struct drm_device *dev, void *data, struct drm_file *file_priv)
        switch (irqwait->request.type & ~VIA_IRQ_FLAGS_MASK) {
        case VIA_IRQ_RELATIVE:
                irqwait->request.sequence +=
@@ -27408,9 +28980,10 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/via/via_irq.c linux-3.1.3/drivers/gpu/drm
                irqwait->request.type &= ~_DRM_VBLANK_RELATIVE;
        case VIA_IRQ_ABSOLUTE:
                break;
-diff -urNp linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
---- linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h    2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
+index 10fc01f..b4e9822 100644
+--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
 @@ -240,7 +240,7 @@ struct vmw_private {
         * Fencing and IRQs.
         */
@@ -27420,10 +28993,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h linux-3.1.3/drivers/g
        wait_queue_head_t fence_queue;
        wait_queue_head_t fifo_queue;
        atomic_t fence_queue_waiters;
-diff -urNp linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
---- linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c        2011-11-16 18:39:07.000000000 -0500
-@@ -610,7 +610,7 @@ int vmw_execbuf_ioctl(struct drm_device 
+diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
+index 41b95ed..69ea504 100644
+--- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
+@@ -610,7 +610,7 @@ int vmw_execbuf_ioctl(struct drm_device *dev, void *data,
        struct drm_vmw_fence_rep fence_rep;
        struct drm_vmw_fence_rep __user *user_fence_rep;
        int ret;
@@ -27432,10 +29006,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c linux-3.1.3/drive
        void *cmd;
        uint32_t sequence;
        struct vmw_sw_context *sw_context = &dev_priv->ctx;
-diff -urNp linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
---- linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c  2011-11-16 18:39:07.000000000 -0500
-@@ -151,7 +151,7 @@ int vmw_wait_lag(struct vmw_private *dev
+diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
+index 61eacc1..ee38ce8 100644
+--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
+@@ -151,7 +151,7 @@ int vmw_wait_lag(struct vmw_private *dev_priv,
        while (!vmw_lag_lt(queue, us)) {
                spin_lock(&queue->lock);
                if (list_empty(&queue->head))
@@ -27444,10 +29019,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c linux-3.1.3/drivers
                else {
                        fence = list_first_entry(&queue->head,
                                                 struct vmw_fence, head);
-diff -urNp linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
---- linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c   2011-11-16 18:39:07.000000000 -0500
-@@ -137,7 +137,7 @@ int vmw_fifo_init(struct vmw_private *de
+diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
+index 635c0ff..2641bbb 100644
+--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
+@@ -137,7 +137,7 @@ int vmw_fifo_init(struct vmw_private *dev_priv, struct vmw_fifo_state *fifo)
                 (unsigned int) min,
                 (unsigned int) fifo->capabilities);
  
@@ -27456,7 +29032,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c linux-3.1.3/drivers/
        iowrite32(dev_priv->last_read_sequence, fifo_mem + SVGA_FIFO_FENCE);
        vmw_fence_queue_init(&fifo->fence_queue);
        return vmw_fifo_send_fence(dev_priv, &dummy);
-@@ -356,7 +356,7 @@ void *vmw_fifo_reserve(struct vmw_privat
+@@ -356,7 +356,7 @@ void *vmw_fifo_reserve(struct vmw_private *dev_priv, uint32_t bytes)
                                if (reserveable)
                                        iowrite32(bytes, fifo_mem +
                                                  SVGA_FIFO_RESERVED);
@@ -27465,7 +29041,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c linux-3.1.3/drivers/
                        } else {
                                need_bounce = true;
                        }
-@@ -476,7 +476,7 @@ int vmw_fifo_send_fence(struct vmw_priva
+@@ -476,7 +476,7 @@ int vmw_fifo_send_fence(struct vmw_private *dev_priv, uint32_t *sequence)
  
        fm = vmw_fifo_reserve(dev_priv, bytes);
        if (unlikely(fm == NULL)) {
@@ -27474,7 +29050,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c linux-3.1.3/drivers/
                ret = -ENOMEM;
                (void)vmw_fallback_wait(dev_priv, false, true, *sequence,
                                        false, 3*HZ);
-@@ -484,7 +484,7 @@ int vmw_fifo_send_fence(struct vmw_priva
+@@ -484,7 +484,7 @@ int vmw_fifo_send_fence(struct vmw_private *dev_priv, uint32_t *sequence)
        }
  
        do {
@@ -27483,10 +29059,11 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c linux-3.1.3/drivers/
        } while (*sequence == 0);
  
        if (!(fifo_state->capabilities & SVGA_FIFO_CAP_FENCE)) {
-diff -urNp linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c
---- linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c    2011-11-16 18:39:07.000000000 -0500
-@@ -100,7 +100,7 @@ bool vmw_fence_signaled(struct vmw_priva
+diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c b/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c
+index e92298a..f68f2d6 100644
+--- a/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c
++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c
+@@ -100,7 +100,7 @@ bool vmw_fence_signaled(struct vmw_private *dev_priv,
         * emitted. Then the fence is stale and signaled.
         */
  
@@ -27495,7 +29072,7 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c linux-3.1.3/drivers/g
               > VMW_FENCE_WRAP);
  
        return ret;
-@@ -131,7 +131,7 @@ int vmw_fallback_wait(struct vmw_private
+@@ -131,7 +131,7 @@ int vmw_fallback_wait(struct vmw_private *dev_priv,
  
        if (fifo_idle)
                down_read(&fifo_state->rwsem);
@@ -27504,10 +29081,42 @@ diff -urNp linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c linux-3.1.3/drivers/g
        ret = 0;
  
        for (;;) {
-diff -urNp linux-3.1.3/drivers/hid/hid-core.c linux-3.1.3/drivers/hid/hid-core.c
---- linux-3.1.3/drivers/hid/hid-core.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/hid/hid-core.c 2011-11-16 18:39:07.000000000 -0500
-@@ -1951,7 +1951,7 @@ static bool hid_ignore(struct hid_device
+diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c
+index c72f1c0..18376f1 100644
+--- a/drivers/gpu/vga/vgaarb.c
++++ b/drivers/gpu/vga/vgaarb.c
+@@ -993,14 +993,20 @@ static ssize_t vga_arb_write(struct file *file, const char __user * buf,
+                               uc = &priv->cards[i];
+               }
+-              if (!uc)
+-                      return -EINVAL;
++              if (!uc) {
++                      ret_val = -EINVAL;
++                      goto done;
++              }
+-              if (io_state & VGA_RSRC_LEGACY_IO && uc->io_cnt == 0)
+-                      return -EINVAL;
++              if (io_state & VGA_RSRC_LEGACY_IO && uc->io_cnt == 0) {
++                      ret_val = -EINVAL;
++                      goto done;
++              }
+-              if (io_state & VGA_RSRC_LEGACY_MEM && uc->mem_cnt == 0)
+-                      return -EINVAL;
++              if (io_state & VGA_RSRC_LEGACY_MEM && uc->mem_cnt == 0) {
++                      ret_val = -EINVAL;
++                      goto done;
++              }
+               vga_put(pdev, io_state);
+diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
+index f26ae31..721fe1b 100644
+--- a/drivers/hid/hid-core.c
++++ b/drivers/hid/hid-core.c
+@@ -1951,7 +1951,7 @@ static bool hid_ignore(struct hid_device *hdev)
  
  int hid_add_device(struct hid_device *hdev)
  {
@@ -27516,7 +29125,7 @@ diff -urNp linux-3.1.3/drivers/hid/hid-core.c linux-3.1.3/drivers/hid/hid-core.c
        int ret;
  
        if (WARN_ON(hdev->status & HID_STAT_ADDED))
-@@ -1966,7 +1966,7 @@ int hid_add_device(struct hid_device *hd
+@@ -1966,7 +1966,7 @@ int hid_add_device(struct hid_device *hdev)
        /* XXX hack, any other cleaner solution after the driver core
         * is converted to allow more than 20 bytes as the device name? */
        dev_set_name(&hdev->dev, "%04X:%04X:%04X.%04X", hdev->bus,
@@ -27525,10 +29134,11 @@ diff -urNp linux-3.1.3/drivers/hid/hid-core.c linux-3.1.3/drivers/hid/hid-core.c
  
        hid_debug_register(hdev, dev_name(&hdev->dev));
        ret = device_add(&hdev->dev);
-diff -urNp linux-3.1.3/drivers/hid/usbhid/hiddev.c linux-3.1.3/drivers/hid/usbhid/hiddev.c
---- linux-3.1.3/drivers/hid/usbhid/hiddev.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/hid/usbhid/hiddev.c    2011-11-16 18:39:07.000000000 -0500
-@@ -624,7 +624,7 @@ static long hiddev_ioctl(struct file *fi
+diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c
+index 7c1188b..5a64357 100644
+--- a/drivers/hid/usbhid/hiddev.c
++++ b/drivers/hid/usbhid/hiddev.c
+@@ -624,7 +624,7 @@ static long hiddev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                break;
  
        case HIDIOCAPPLICATION:
@@ -27537,10 +29147,11 @@ diff -urNp linux-3.1.3/drivers/hid/usbhid/hiddev.c linux-3.1.3/drivers/hid/usbhi
                        break;
  
                for (i = 0; i < hid->maxcollection; i++)
-diff -urNp linux-3.1.3/drivers/hwmon/acpi_power_meter.c linux-3.1.3/drivers/hwmon/acpi_power_meter.c
---- linux-3.1.3/drivers/hwmon/acpi_power_meter.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/hwmon/acpi_power_meter.c       2011-11-16 18:39:07.000000000 -0500
-@@ -316,8 +316,6 @@ static ssize_t set_trip(struct device *d
+diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_meter.c
+index 66f6729..2d6de0a 100644
+--- a/drivers/hwmon/acpi_power_meter.c
++++ b/drivers/hwmon/acpi_power_meter.c
+@@ -316,8 +316,6 @@ static ssize_t set_trip(struct device *dev, struct device_attribute *devattr,
                return res;
  
        temp /= 1000;
@@ -27549,9 +29160,10 @@ diff -urNp linux-3.1.3/drivers/hwmon/acpi_power_meter.c linux-3.1.3/drivers/hwmo
  
        mutex_lock(&resource->lock);
        resource->trip[attr->index - 7] = temp;
-diff -urNp linux-3.1.3/drivers/hwmon/sht15.c linux-3.1.3/drivers/hwmon/sht15.c
---- linux-3.1.3/drivers/hwmon/sht15.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/hwmon/sht15.c  2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/hwmon/sht15.c b/drivers/hwmon/sht15.c
+index fe4104c..346febb 100644
+--- a/drivers/hwmon/sht15.c
++++ b/drivers/hwmon/sht15.c
 @@ -166,7 +166,7 @@ struct sht15_data {
        int                             supply_uV;
        bool                            supply_uV_valid;
@@ -27561,7 +29173,7 @@ diff -urNp linux-3.1.3/drivers/hwmon/sht15.c linux-3.1.3/drivers/hwmon/sht15.c
  };
  
  /**
-@@ -509,13 +509,13 @@ static int sht15_measurement(struct sht1
+@@ -509,13 +509,13 @@ static int sht15_measurement(struct sht15_data *data,
                return ret;
  
        gpio_direction_input(data->pdata->gpio_data);
@@ -27577,7 +29189,7 @@ diff -urNp linux-3.1.3/drivers/hwmon/sht15.c linux-3.1.3/drivers/hwmon/sht15.c
                        schedule_work(&data->read_work);
        }
        ret = wait_event_timeout(data->wait_queue,
-@@ -782,7 +782,7 @@ static irqreturn_t sht15_interrupt_fired
+@@ -782,7 +782,7 @@ static irqreturn_t sht15_interrupt_fired(int irq, void *d)
  
        /* First disable the interrupt */
        disable_irq_nosync(irq);
@@ -27586,7 +29198,7 @@ diff -urNp linux-3.1.3/drivers/hwmon/sht15.c linux-3.1.3/drivers/hwmon/sht15.c
        /* Then schedule a reading work struct */
        if (data->state != SHT15_READING_NOTHING)
                schedule_work(&data->read_work);
-@@ -804,11 +804,11 @@ static void sht15_bh_read_data(struct wo
+@@ -804,11 +804,11 @@ static void sht15_bh_read_data(struct work_struct *work_s)
                 * If not, then start the interrupt again - care here as could
                 * have gone low in meantime so verify it hasn't!
                 */
@@ -27600,9 +29212,10 @@ diff -urNp linux-3.1.3/drivers/hwmon/sht15.c linux-3.1.3/drivers/hwmon/sht15.c
                        return;
        }
  
-diff -urNp linux-3.1.3/drivers/i2c/busses/i2c-amd756-s4882.c linux-3.1.3/drivers/i2c/busses/i2c-amd756-s4882.c
---- linux-3.1.3/drivers/i2c/busses/i2c-amd756-s4882.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/i2c/busses/i2c-amd756-s4882.c  2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/i2c/busses/i2c-amd756-s4882.c b/drivers/i2c/busses/i2c-amd756-s4882.c
+index 378fcb5..5e91fa8 100644
+--- a/drivers/i2c/busses/i2c-amd756-s4882.c
++++ b/drivers/i2c/busses/i2c-amd756-s4882.c
 @@ -43,7 +43,7 @@
  extern struct i2c_adapter amd756_smbus;
  
@@ -27612,9 +29225,10 @@ diff -urNp linux-3.1.3/drivers/i2c/busses/i2c-amd756-s4882.c linux-3.1.3/drivers
  
  /* Wrapper access functions for multiplexed SMBus */
  static DEFINE_MUTEX(amd756_lock);
-diff -urNp linux-3.1.3/drivers/i2c/busses/i2c-nforce2-s4985.c linux-3.1.3/drivers/i2c/busses/i2c-nforce2-s4985.c
---- linux-3.1.3/drivers/i2c/busses/i2c-nforce2-s4985.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/i2c/busses/i2c-nforce2-s4985.c 2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/i2c/busses/i2c-nforce2-s4985.c b/drivers/i2c/busses/i2c-nforce2-s4985.c
+index 29015eb..af2d8e9 100644
+--- a/drivers/i2c/busses/i2c-nforce2-s4985.c
++++ b/drivers/i2c/busses/i2c-nforce2-s4985.c
 @@ -41,7 +41,7 @@
  extern struct i2c_adapter *nforce2_smbus;
  
@@ -27624,9 +29238,10 @@ diff -urNp linux-3.1.3/drivers/i2c/busses/i2c-nforce2-s4985.c linux-3.1.3/driver
  
  /* Wrapper access functions for multiplexed SMBus */
  static DEFINE_MUTEX(nforce2_lock);
-diff -urNp linux-3.1.3/drivers/i2c/i2c-mux.c linux-3.1.3/drivers/i2c/i2c-mux.c
---- linux-3.1.3/drivers/i2c/i2c-mux.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/i2c/i2c-mux.c  2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c
+index d7a4833..7fae376 100644
+--- a/drivers/i2c/i2c-mux.c
++++ b/drivers/i2c/i2c-mux.c
 @@ -28,7 +28,7 @@
  /* multiplexer per channel data */
  struct i2c_mux_priv {
@@ -27636,10 +29251,11 @@ diff -urNp linux-3.1.3/drivers/i2c/i2c-mux.c linux-3.1.3/drivers/i2c/i2c-mux.c
  
        struct i2c_adapter *parent;
        void *mux_dev;  /* the mux chip/device */
-diff -urNp linux-3.1.3/drivers/ide/aec62xx.c linux-3.1.3/drivers/ide/aec62xx.c
---- linux-3.1.3/drivers/ide/aec62xx.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/aec62xx.c  2011-11-16 18:39:07.000000000 -0500
-@@ -181,7 +181,7 @@ static const struct ide_port_ops atp86x_
+diff --git a/drivers/ide/aec62xx.c b/drivers/ide/aec62xx.c
+index 57d00ca..0145194 100644
+--- a/drivers/ide/aec62xx.c
++++ b/drivers/ide/aec62xx.c
+@@ -181,7 +181,7 @@ static const struct ide_port_ops atp86x_port_ops = {
        .cable_detect           = atp86x_cable_detect,
  };
  
@@ -27648,10 +29264,11 @@ diff -urNp linux-3.1.3/drivers/ide/aec62xx.c linux-3.1.3/drivers/ide/aec62xx.c
        {       /* 0: AEC6210 */
                .name           = DRV_NAME,
                .init_chipset   = init_chipset_aec62xx,
-diff -urNp linux-3.1.3/drivers/ide/alim15x3.c linux-3.1.3/drivers/ide/alim15x3.c
---- linux-3.1.3/drivers/ide/alim15x3.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/alim15x3.c 2011-11-16 18:39:07.000000000 -0500
-@@ -512,7 +512,7 @@ static const struct ide_dma_ops ali_dma_
+diff --git a/drivers/ide/alim15x3.c b/drivers/ide/alim15x3.c
+index 2c8016a..911a27c 100644
+--- a/drivers/ide/alim15x3.c
++++ b/drivers/ide/alim15x3.c
+@@ -512,7 +512,7 @@ static const struct ide_dma_ops ali_dma_ops = {
        .dma_sff_read_status    = ide_dma_sff_read_status,
  };
  
@@ -27660,10 +29277,11 @@ diff -urNp linux-3.1.3/drivers/ide/alim15x3.c linux-3.1.3/drivers/ide/alim15x3.c
        .name           = DRV_NAME,
        .init_chipset   = init_chipset_ali15x3,
        .init_hwif      = init_hwif_ali15x3,
-diff -urNp linux-3.1.3/drivers/ide/amd74xx.c linux-3.1.3/drivers/ide/amd74xx.c
---- linux-3.1.3/drivers/ide/amd74xx.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/amd74xx.c  2011-11-16 18:39:07.000000000 -0500
-@@ -223,7 +223,7 @@ static const struct ide_port_ops amd_por
+diff --git a/drivers/ide/amd74xx.c b/drivers/ide/amd74xx.c
+index 3747b25..56fc995 100644
+--- a/drivers/ide/amd74xx.c
++++ b/drivers/ide/amd74xx.c
+@@ -223,7 +223,7 @@ static const struct ide_port_ops amd_port_ops = {
                .udma_mask      = udma,                                 \
        }
  
@@ -27672,10 +29290,11 @@ diff -urNp linux-3.1.3/drivers/ide/amd74xx.c linux-3.1.3/drivers/ide/amd74xx.c
        /* 0: AMD7401 */        DECLARE_AMD_DEV(0x00, ATA_UDMA2),
        /* 1: AMD7409 */        DECLARE_AMD_DEV(ATA_SWDMA2, ATA_UDMA4),
        /* 2: AMD7411/7441 */   DECLARE_AMD_DEV(ATA_SWDMA2, ATA_UDMA5),
-diff -urNp linux-3.1.3/drivers/ide/atiixp.c linux-3.1.3/drivers/ide/atiixp.c
---- linux-3.1.3/drivers/ide/atiixp.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/atiixp.c   2011-11-16 18:39:07.000000000 -0500
-@@ -139,7 +139,7 @@ static const struct ide_port_ops atiixp_
+diff --git a/drivers/ide/atiixp.c b/drivers/ide/atiixp.c
+index 15f0ead..cb43480 100644
+--- a/drivers/ide/atiixp.c
++++ b/drivers/ide/atiixp.c
+@@ -139,7 +139,7 @@ static const struct ide_port_ops atiixp_port_ops = {
        .cable_detect           = atiixp_cable_detect,
  };
  
@@ -27684,10 +29303,11 @@ diff -urNp linux-3.1.3/drivers/ide/atiixp.c linux-3.1.3/drivers/ide/atiixp.c
        {       /* 0: IXP200/300/400/700 */
                .name           = DRV_NAME,
                .enablebits     = {{0x48,0x01,0x00}, {0x48,0x08,0x00}},
-diff -urNp linux-3.1.3/drivers/ide/cmd64x.c linux-3.1.3/drivers/ide/cmd64x.c
---- linux-3.1.3/drivers/ide/cmd64x.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/cmd64x.c   2011-11-16 18:39:07.000000000 -0500
-@@ -327,7 +327,7 @@ static const struct ide_dma_ops cmd646_r
+diff --git a/drivers/ide/cmd64x.c b/drivers/ide/cmd64x.c
+index 5f80312..d1fc438 100644
+--- a/drivers/ide/cmd64x.c
++++ b/drivers/ide/cmd64x.c
+@@ -327,7 +327,7 @@ static const struct ide_dma_ops cmd646_rev1_dma_ops = {
        .dma_sff_read_status    = ide_dma_sff_read_status,
  };
  
@@ -27696,10 +29316,11 @@ diff -urNp linux-3.1.3/drivers/ide/cmd64x.c linux-3.1.3/drivers/ide/cmd64x.c
        {       /* 0: CMD643 */
                .name           = DRV_NAME,
                .init_chipset   = init_chipset_cmd64x,
-diff -urNp linux-3.1.3/drivers/ide/cs5520.c linux-3.1.3/drivers/ide/cs5520.c
---- linux-3.1.3/drivers/ide/cs5520.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/cs5520.c   2011-11-16 18:39:07.000000000 -0500
-@@ -94,7 +94,7 @@ static const struct ide_port_ops cs5520_
+diff --git a/drivers/ide/cs5520.c b/drivers/ide/cs5520.c
+index 2c1e5f7..1444762 100644
+--- a/drivers/ide/cs5520.c
++++ b/drivers/ide/cs5520.c
+@@ -94,7 +94,7 @@ static const struct ide_port_ops cs5520_port_ops = {
        .set_dma_mode           = cs5520_set_dma_mode,
  };
  
@@ -27708,10 +29329,11 @@ diff -urNp linux-3.1.3/drivers/ide/cs5520.c linux-3.1.3/drivers/ide/cs5520.c
        .name           = DRV_NAME,
        .enablebits     = { { 0x60, 0x01, 0x01 }, { 0x60, 0x02, 0x02 } },
        .port_ops       = &cs5520_port_ops,
-diff -urNp linux-3.1.3/drivers/ide/cs5530.c linux-3.1.3/drivers/ide/cs5530.c
---- linux-3.1.3/drivers/ide/cs5530.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/cs5530.c   2011-11-16 18:39:07.000000000 -0500
-@@ -245,7 +245,7 @@ static const struct ide_port_ops cs5530_
+diff --git a/drivers/ide/cs5530.c b/drivers/ide/cs5530.c
+index 4dc4eb9..49b40ad 100644
+--- a/drivers/ide/cs5530.c
++++ b/drivers/ide/cs5530.c
+@@ -245,7 +245,7 @@ static const struct ide_port_ops cs5530_port_ops = {
        .udma_filter            = cs5530_udma_filter,
  };
  
@@ -27720,10 +29342,11 @@ diff -urNp linux-3.1.3/drivers/ide/cs5530.c linux-3.1.3/drivers/ide/cs5530.c
        .name           = DRV_NAME,
        .init_chipset   = init_chipset_cs5530,
        .init_hwif      = init_hwif_cs5530,
-diff -urNp linux-3.1.3/drivers/ide/cs5535.c linux-3.1.3/drivers/ide/cs5535.c
---- linux-3.1.3/drivers/ide/cs5535.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/cs5535.c   2011-11-16 18:39:07.000000000 -0500
-@@ -170,7 +170,7 @@ static const struct ide_port_ops cs5535_
+diff --git a/drivers/ide/cs5535.c b/drivers/ide/cs5535.c
+index 5059faf..18d4c85 100644
+--- a/drivers/ide/cs5535.c
++++ b/drivers/ide/cs5535.c
+@@ -170,7 +170,7 @@ static const struct ide_port_ops cs5535_port_ops = {
        .cable_detect           = cs5535_cable_detect,
  };
  
@@ -27732,10 +29355,11 @@ diff -urNp linux-3.1.3/drivers/ide/cs5535.c linux-3.1.3/drivers/ide/cs5535.c
        .name           = DRV_NAME,
        .port_ops       = &cs5535_port_ops,
        .host_flags     = IDE_HFLAG_SINGLE | IDE_HFLAG_POST_SET_MODE,
-diff -urNp linux-3.1.3/drivers/ide/cy82c693.c linux-3.1.3/drivers/ide/cy82c693.c
---- linux-3.1.3/drivers/ide/cy82c693.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/cy82c693.c 2011-11-16 18:39:07.000000000 -0500
-@@ -163,7 +163,7 @@ static const struct ide_port_ops cy82c69
+diff --git a/drivers/ide/cy82c693.c b/drivers/ide/cy82c693.c
+index 67cbcfa..37ea151 100644
+--- a/drivers/ide/cy82c693.c
++++ b/drivers/ide/cy82c693.c
+@@ -163,7 +163,7 @@ static const struct ide_port_ops cy82c693_port_ops = {
        .set_dma_mode           = cy82c693_set_dma_mode,
  };
  
@@ -27744,10 +29368,11 @@ diff -urNp linux-3.1.3/drivers/ide/cy82c693.c linux-3.1.3/drivers/ide/cy82c693.c
        .name           = DRV_NAME,
        .init_iops      = init_iops_cy82c693,
        .port_ops       = &cy82c693_port_ops,
-diff -urNp linux-3.1.3/drivers/ide/hpt366.c linux-3.1.3/drivers/ide/hpt366.c
---- linux-3.1.3/drivers/ide/hpt366.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/hpt366.c   2011-11-16 18:39:07.000000000 -0500
-@@ -443,7 +443,7 @@ static struct hpt_timings hpt37x_timings
+diff --git a/drivers/ide/hpt366.c b/drivers/ide/hpt366.c
+index 58c51cd..4aec3b8 100644
+--- a/drivers/ide/hpt366.c
++++ b/drivers/ide/hpt366.c
+@@ -443,7 +443,7 @@ static struct hpt_timings hpt37x_timings = {
        }
  };
  
@@ -27756,7 +29381,7 @@ diff -urNp linux-3.1.3/drivers/ide/hpt366.c linux-3.1.3/drivers/ide/hpt366.c
        .chip_name      = "HPT36x",
        .chip_type      = HPT36x,
        .udma_mask      = HPT366_ALLOW_ATA66_3 ? (HPT366_ALLOW_ATA66_4 ? ATA_UDMA4 : ATA_UDMA3) : ATA_UDMA2,
-@@ -451,7 +451,7 @@ static const struct hpt_info hpt36x __de
+@@ -451,7 +451,7 @@ static const struct hpt_info hpt36x __devinitdata = {
        .timings        = &hpt36x_timings
  };
  
@@ -27765,7 +29390,7 @@ diff -urNp linux-3.1.3/drivers/ide/hpt366.c linux-3.1.3/drivers/ide/hpt366.c
        .chip_name      = "HPT370",
        .chip_type      = HPT370,
        .udma_mask      = HPT370_ALLOW_ATA100_5 ? ATA_UDMA5 : ATA_UDMA4,
-@@ -459,7 +459,7 @@ static const struct hpt_info hpt370 __de
+@@ -459,7 +459,7 @@ static const struct hpt_info hpt370 __devinitdata = {
        .timings        = &hpt37x_timings
  };
  
@@ -27774,7 +29399,7 @@ diff -urNp linux-3.1.3/drivers/ide/hpt366.c linux-3.1.3/drivers/ide/hpt366.c
        .chip_name      = "HPT370A",
        .chip_type      = HPT370A,
        .udma_mask      = HPT370_ALLOW_ATA100_5 ? ATA_UDMA5 : ATA_UDMA4,
-@@ -467,7 +467,7 @@ static const struct hpt_info hpt370a __d
+@@ -467,7 +467,7 @@ static const struct hpt_info hpt370a __devinitdata = {
        .timings        = &hpt37x_timings
  };
  
@@ -27783,7 +29408,7 @@ diff -urNp linux-3.1.3/drivers/ide/hpt366.c linux-3.1.3/drivers/ide/hpt366.c
        .chip_name      = "HPT374",
        .chip_type      = HPT374,
        .udma_mask      = ATA_UDMA5,
-@@ -475,7 +475,7 @@ static const struct hpt_info hpt374 __de
+@@ -475,7 +475,7 @@ static const struct hpt_info hpt374 __devinitdata = {
        .timings        = &hpt37x_timings
  };
  
@@ -27792,7 +29417,7 @@ diff -urNp linux-3.1.3/drivers/ide/hpt366.c linux-3.1.3/drivers/ide/hpt366.c
        .chip_name      = "HPT372",
        .chip_type      = HPT372,
        .udma_mask      = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
-@@ -483,7 +483,7 @@ static const struct hpt_info hpt372 __de
+@@ -483,7 +483,7 @@ static const struct hpt_info hpt372 __devinitdata = {
        .timings        = &hpt37x_timings
  };
  
@@ -27801,7 +29426,7 @@ diff -urNp linux-3.1.3/drivers/ide/hpt366.c linux-3.1.3/drivers/ide/hpt366.c
        .chip_name      = "HPT372A",
        .chip_type      = HPT372A,
        .udma_mask      = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
-@@ -491,7 +491,7 @@ static const struct hpt_info hpt372a __d
+@@ -491,7 +491,7 @@ static const struct hpt_info hpt372a __devinitdata = {
        .timings        = &hpt37x_timings
  };
  
@@ -27810,7 +29435,7 @@ diff -urNp linux-3.1.3/drivers/ide/hpt366.c linux-3.1.3/drivers/ide/hpt366.c
        .chip_name      = "HPT302",
        .chip_type      = HPT302,
        .udma_mask      = HPT302_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
-@@ -499,7 +499,7 @@ static const struct hpt_info hpt302 __de
+@@ -499,7 +499,7 @@ static const struct hpt_info hpt302 __devinitdata = {
        .timings        = &hpt37x_timings
  };
  
@@ -27819,7 +29444,7 @@ diff -urNp linux-3.1.3/drivers/ide/hpt366.c linux-3.1.3/drivers/ide/hpt366.c
        .chip_name      = "HPT371",
        .chip_type      = HPT371,
        .udma_mask      = HPT371_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
-@@ -507,7 +507,7 @@ static const struct hpt_info hpt371 __de
+@@ -507,7 +507,7 @@ static const struct hpt_info hpt371 __devinitdata = {
        .timings        = &hpt37x_timings
  };
  
@@ -27828,7 +29453,7 @@ diff -urNp linux-3.1.3/drivers/ide/hpt366.c linux-3.1.3/drivers/ide/hpt366.c
        .chip_name      = "HPT372N",
        .chip_type      = HPT372N,
        .udma_mask      = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
-@@ -515,7 +515,7 @@ static const struct hpt_info hpt372n __d
+@@ -515,7 +515,7 @@ static const struct hpt_info hpt372n __devinitdata = {
        .timings        = &hpt37x_timings
  };
  
@@ -27837,7 +29462,7 @@ diff -urNp linux-3.1.3/drivers/ide/hpt366.c linux-3.1.3/drivers/ide/hpt366.c
        .chip_name      = "HPT302N",
        .chip_type      = HPT302N,
        .udma_mask      = HPT302_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
-@@ -523,7 +523,7 @@ static const struct hpt_info hpt302n __d
+@@ -523,7 +523,7 @@ static const struct hpt_info hpt302n __devinitdata = {
        .timings        = &hpt37x_timings
  };
  
@@ -27846,7 +29471,7 @@ diff -urNp linux-3.1.3/drivers/ide/hpt366.c linux-3.1.3/drivers/ide/hpt366.c
        .chip_name      = "HPT371N",
        .chip_type      = HPT371N,
        .udma_mask      = HPT371_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
-@@ -1361,7 +1361,7 @@ static const struct ide_dma_ops hpt36x_d
+@@ -1361,7 +1361,7 @@ static const struct ide_dma_ops hpt36x_dma_ops = {
        .dma_sff_read_status    = ide_dma_sff_read_status,
  };
  
@@ -27855,10 +29480,11 @@ diff -urNp linux-3.1.3/drivers/ide/hpt366.c linux-3.1.3/drivers/ide/hpt366.c
        {       /* 0: HPT36x */
                .name           = DRV_NAME,
                .init_chipset   = init_chipset_hpt366,
-diff -urNp linux-3.1.3/drivers/ide/ide-cd.c linux-3.1.3/drivers/ide/ide-cd.c
---- linux-3.1.3/drivers/ide/ide-cd.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/ide-cd.c   2011-11-16 18:39:07.000000000 -0500
-@@ -769,7 +769,7 @@ static void cdrom_do_block_pc(ide_drive_
+diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
+index 04b0956..f5b47dc 100644
+--- a/drivers/ide/ide-cd.c
++++ b/drivers/ide/ide-cd.c
+@@ -769,7 +769,7 @@ static void cdrom_do_block_pc(ide_drive_t *drive, struct request *rq)
                alignment = queue_dma_alignment(q) | q->dma_pad_mask;
                if ((unsigned long)buf & alignment
                    || blk_rq_bytes(rq) & q->dma_pad_mask
@@ -27867,10 +29493,11 @@ diff -urNp linux-3.1.3/drivers/ide/ide-cd.c linux-3.1.3/drivers/ide/ide-cd.c
                        drive->dma = 0;
        }
  }
-diff -urNp linux-3.1.3/drivers/ide/ide-floppy.c linux-3.1.3/drivers/ide/ide-floppy.c
---- linux-3.1.3/drivers/ide/ide-floppy.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/ide-floppy.c       2011-11-16 18:40:10.000000000 -0500
-@@ -379,6 +379,8 @@ static int ide_floppy_get_capacity(ide_d
+diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
+index 61fdf54..2834ea6 100644
+--- a/drivers/ide/ide-floppy.c
++++ b/drivers/ide/ide-floppy.c
+@@ -379,6 +379,8 @@ static int ide_floppy_get_capacity(ide_drive_t *drive)
        u8 pc_buf[256], header_len, desc_cnt;
        int i, rc = 1, blocks, length;
  
@@ -27879,10 +29506,11 @@ diff -urNp linux-3.1.3/drivers/ide/ide-floppy.c linux-3.1.3/drivers/ide/ide-flop
        ide_debug_log(IDE_DBG_FUNC, "enter");
  
        drive->bios_cyl = 0;
-diff -urNp linux-3.1.3/drivers/ide/ide-pci-generic.c linux-3.1.3/drivers/ide/ide-pci-generic.c
---- linux-3.1.3/drivers/ide/ide-pci-generic.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/ide-pci-generic.c  2011-11-16 18:39:07.000000000 -0500
-@@ -53,7 +53,7 @@ static const struct ide_port_ops netcell
+diff --git a/drivers/ide/ide-pci-generic.c b/drivers/ide/ide-pci-generic.c
+index a743e68..1cfd674 100644
+--- a/drivers/ide/ide-pci-generic.c
++++ b/drivers/ide/ide-pci-generic.c
+@@ -53,7 +53,7 @@ static const struct ide_port_ops netcell_port_ops = {
                .udma_mask      = ATA_UDMA6, \
        }
  
@@ -27891,10 +29519,11 @@ diff -urNp linux-3.1.3/drivers/ide/ide-pci-generic.c linux-3.1.3/drivers/ide/ide
        /*  0: Unknown */
        DECLARE_GENERIC_PCI_DEV(0),
  
-diff -urNp linux-3.1.3/drivers/ide/it8172.c linux-3.1.3/drivers/ide/it8172.c
---- linux-3.1.3/drivers/ide/it8172.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/it8172.c   2011-11-16 18:39:07.000000000 -0500
-@@ -115,7 +115,7 @@ static const struct ide_port_ops it8172_
+diff --git a/drivers/ide/it8172.c b/drivers/ide/it8172.c
+index 560e66d..d5dd180 100644
+--- a/drivers/ide/it8172.c
++++ b/drivers/ide/it8172.c
+@@ -115,7 +115,7 @@ static const struct ide_port_ops it8172_port_ops = {
        .set_dma_mode   = it8172_set_dma_mode,
  };
  
@@ -27903,10 +29532,11 @@ diff -urNp linux-3.1.3/drivers/ide/it8172.c linux-3.1.3/drivers/ide/it8172.c
        .name           = DRV_NAME,
        .port_ops       = &it8172_port_ops,
        .enablebits     = { {0x41, 0x80, 0x80}, {0x00, 0x00, 0x00} },
-diff -urNp linux-3.1.3/drivers/ide/it8213.c linux-3.1.3/drivers/ide/it8213.c
---- linux-3.1.3/drivers/ide/it8213.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/it8213.c   2011-11-16 18:39:07.000000000 -0500
-@@ -156,7 +156,7 @@ static const struct ide_port_ops it8213_
+diff --git a/drivers/ide/it8213.c b/drivers/ide/it8213.c
+index 46816ba..1847aeb 100644
+--- a/drivers/ide/it8213.c
++++ b/drivers/ide/it8213.c
+@@ -156,7 +156,7 @@ static const struct ide_port_ops it8213_port_ops = {
        .cable_detect           = it8213_cable_detect,
  };
  
@@ -27915,10 +29545,11 @@ diff -urNp linux-3.1.3/drivers/ide/it8213.c linux-3.1.3/drivers/ide/it8213.c
        .name           = DRV_NAME,
        .enablebits     = { {0x41, 0x80, 0x80} },
        .port_ops       = &it8213_port_ops,
-diff -urNp linux-3.1.3/drivers/ide/it821x.c linux-3.1.3/drivers/ide/it821x.c
---- linux-3.1.3/drivers/ide/it821x.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/it821x.c   2011-11-16 18:39:07.000000000 -0500
-@@ -630,7 +630,7 @@ static const struct ide_port_ops it821x_
+diff --git a/drivers/ide/it821x.c b/drivers/ide/it821x.c
+index 2e3169f..c5611db 100644
+--- a/drivers/ide/it821x.c
++++ b/drivers/ide/it821x.c
+@@ -630,7 +630,7 @@ static const struct ide_port_ops it821x_port_ops = {
        .cable_detect           = it821x_cable_detect,
  };
  
@@ -27927,10 +29558,11 @@ diff -urNp linux-3.1.3/drivers/ide/it821x.c linux-3.1.3/drivers/ide/it821x.c
        .name           = DRV_NAME,
        .init_chipset   = init_chipset_it821x,
        .init_hwif      = init_hwif_it821x,
-diff -urNp linux-3.1.3/drivers/ide/jmicron.c linux-3.1.3/drivers/ide/jmicron.c
---- linux-3.1.3/drivers/ide/jmicron.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/jmicron.c  2011-11-16 18:39:07.000000000 -0500
-@@ -102,7 +102,7 @@ static const struct ide_port_ops jmicron
+diff --git a/drivers/ide/jmicron.c b/drivers/ide/jmicron.c
+index 74c2c4a..efddd7d 100644
+--- a/drivers/ide/jmicron.c
++++ b/drivers/ide/jmicron.c
+@@ -102,7 +102,7 @@ static const struct ide_port_ops jmicron_port_ops = {
        .cable_detect           = jmicron_cable_detect,
  };
  
@@ -27939,10 +29571,11 @@ diff -urNp linux-3.1.3/drivers/ide/jmicron.c linux-3.1.3/drivers/ide/jmicron.c
        .name           = DRV_NAME,
        .enablebits     = { { 0x40, 0x01, 0x01 }, { 0x40, 0x10, 0x10 } },
        .port_ops       = &jmicron_port_ops,
-diff -urNp linux-3.1.3/drivers/ide/ns87415.c linux-3.1.3/drivers/ide/ns87415.c
---- linux-3.1.3/drivers/ide/ns87415.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/ns87415.c  2011-11-16 18:39:07.000000000 -0500
-@@ -293,7 +293,7 @@ static const struct ide_dma_ops ns87415_
+diff --git a/drivers/ide/ns87415.c b/drivers/ide/ns87415.c
+index 95327a2..73f78d8 100644
+--- a/drivers/ide/ns87415.c
++++ b/drivers/ide/ns87415.c
+@@ -293,7 +293,7 @@ static const struct ide_dma_ops ns87415_dma_ops = {
        .dma_sff_read_status    = superio_dma_sff_read_status,
  };
  
@@ -27951,10 +29584,11 @@ diff -urNp linux-3.1.3/drivers/ide/ns87415.c linux-3.1.3/drivers/ide/ns87415.c
        .name           = DRV_NAME,
        .init_hwif      = init_hwif_ns87415,
        .tp_ops         = &ns87415_tp_ops,
-diff -urNp linux-3.1.3/drivers/ide/opti621.c linux-3.1.3/drivers/ide/opti621.c
---- linux-3.1.3/drivers/ide/opti621.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/opti621.c  2011-11-16 18:39:07.000000000 -0500
-@@ -131,7 +131,7 @@ static const struct ide_port_ops opti621
+diff --git a/drivers/ide/opti621.c b/drivers/ide/opti621.c
+index 1a53a4c..39edc66 100644
+--- a/drivers/ide/opti621.c
++++ b/drivers/ide/opti621.c
+@@ -131,7 +131,7 @@ static const struct ide_port_ops opti621_port_ops = {
        .set_pio_mode           = opti621_set_pio_mode,
  };
  
@@ -27963,10 +29597,11 @@ diff -urNp linux-3.1.3/drivers/ide/opti621.c linux-3.1.3/drivers/ide/opti621.c
        .name           = DRV_NAME,
        .enablebits     = { {0x45, 0x80, 0x00}, {0x40, 0x08, 0x00} },
        .port_ops       = &opti621_port_ops,
-diff -urNp linux-3.1.3/drivers/ide/pdc202xx_new.c linux-3.1.3/drivers/ide/pdc202xx_new.c
---- linux-3.1.3/drivers/ide/pdc202xx_new.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/pdc202xx_new.c     2011-11-16 18:39:07.000000000 -0500
-@@ -465,7 +465,7 @@ static const struct ide_port_ops pdcnew_
+diff --git a/drivers/ide/pdc202xx_new.c b/drivers/ide/pdc202xx_new.c
+index 9546fe2..2e5ceb6 100644
+--- a/drivers/ide/pdc202xx_new.c
++++ b/drivers/ide/pdc202xx_new.c
+@@ -465,7 +465,7 @@ static const struct ide_port_ops pdcnew_port_ops = {
                .udma_mask      = udma, \
        }
  
@@ -27975,10 +29610,11 @@ diff -urNp linux-3.1.3/drivers/ide/pdc202xx_new.c linux-3.1.3/drivers/ide/pdc202
        /* 0: PDC202{68,70} */          DECLARE_PDCNEW_DEV(ATA_UDMA5),
        /* 1: PDC202{69,71,75,76,77} */ DECLARE_PDCNEW_DEV(ATA_UDMA6),
  };
-diff -urNp linux-3.1.3/drivers/ide/pdc202xx_old.c linux-3.1.3/drivers/ide/pdc202xx_old.c
---- linux-3.1.3/drivers/ide/pdc202xx_old.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/pdc202xx_old.c     2011-11-16 18:39:07.000000000 -0500
-@@ -270,7 +270,7 @@ static const struct ide_dma_ops pdc2026x
+diff --git a/drivers/ide/pdc202xx_old.c b/drivers/ide/pdc202xx_old.c
+index 3a35ec6..5634510 100644
+--- a/drivers/ide/pdc202xx_old.c
++++ b/drivers/ide/pdc202xx_old.c
+@@ -270,7 +270,7 @@ static const struct ide_dma_ops pdc2026x_dma_ops = {
                .max_sectors    = sectors, \
        }
  
@@ -27987,10 +29623,11 @@ diff -urNp linux-3.1.3/drivers/ide/pdc202xx_old.c linux-3.1.3/drivers/ide/pdc202
        {       /* 0: PDC20246 */
                .name           = DRV_NAME,
                .init_chipset   = init_chipset_pdc202xx,
-diff -urNp linux-3.1.3/drivers/ide/piix.c linux-3.1.3/drivers/ide/piix.c
---- linux-3.1.3/drivers/ide/piix.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/piix.c     2011-11-16 18:39:07.000000000 -0500
-@@ -344,7 +344,7 @@ static const struct ide_port_ops ich_por
+diff --git a/drivers/ide/piix.c b/drivers/ide/piix.c
+index b59d04c..368c2a7 100644
+--- a/drivers/ide/piix.c
++++ b/drivers/ide/piix.c
+@@ -344,7 +344,7 @@ static const struct ide_port_ops ich_port_ops = {
                .udma_mask      = udma, \
        }
  
@@ -27999,10 +29636,11 @@ diff -urNp linux-3.1.3/drivers/ide/piix.c linux-3.1.3/drivers/ide/piix.c
        /* 0: MPIIX */
        {       /*
                 * MPIIX actually has only a single IDE channel mapped to
-diff -urNp linux-3.1.3/drivers/ide/rz1000.c linux-3.1.3/drivers/ide/rz1000.c
---- linux-3.1.3/drivers/ide/rz1000.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/rz1000.c   2011-11-16 18:39:07.000000000 -0500
-@@ -38,7 +38,7 @@ static int __devinit rz1000_disable_read
+diff --git a/drivers/ide/rz1000.c b/drivers/ide/rz1000.c
+index a6414a8..c04173e 100644
+--- a/drivers/ide/rz1000.c
++++ b/drivers/ide/rz1000.c
+@@ -38,7 +38,7 @@ static int __devinit rz1000_disable_readahead(struct pci_dev *dev)
        }
  }
  
@@ -28011,10 +29649,11 @@ diff -urNp linux-3.1.3/drivers/ide/rz1000.c linux-3.1.3/drivers/ide/rz1000.c
        .name           = DRV_NAME,
        .host_flags     = IDE_HFLAG_NO_DMA,
  };
-diff -urNp linux-3.1.3/drivers/ide/sc1200.c linux-3.1.3/drivers/ide/sc1200.c
---- linux-3.1.3/drivers/ide/sc1200.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/sc1200.c   2011-11-16 18:39:07.000000000 -0500
-@@ -291,7 +291,7 @@ static const struct ide_dma_ops sc1200_d
+diff --git a/drivers/ide/sc1200.c b/drivers/ide/sc1200.c
+index 356b9b5..d4758eb 100644
+--- a/drivers/ide/sc1200.c
++++ b/drivers/ide/sc1200.c
+@@ -291,7 +291,7 @@ static const struct ide_dma_ops sc1200_dma_ops = {
        .dma_sff_read_status    = ide_dma_sff_read_status,
  };
  
@@ -28023,10 +29662,11 @@ diff -urNp linux-3.1.3/drivers/ide/sc1200.c linux-3.1.3/drivers/ide/sc1200.c
        .name           = DRV_NAME,
        .port_ops       = &sc1200_port_ops,
        .dma_ops        = &sc1200_dma_ops,
-diff -urNp linux-3.1.3/drivers/ide/scc_pata.c linux-3.1.3/drivers/ide/scc_pata.c
---- linux-3.1.3/drivers/ide/scc_pata.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/scc_pata.c 2011-11-16 18:39:07.000000000 -0500
-@@ -811,7 +811,7 @@ static const struct ide_dma_ops scc_dma_
+diff --git a/drivers/ide/scc_pata.c b/drivers/ide/scc_pata.c
+index b7f5b0c..9701038 100644
+--- a/drivers/ide/scc_pata.c
++++ b/drivers/ide/scc_pata.c
+@@ -811,7 +811,7 @@ static const struct ide_dma_ops scc_dma_ops = {
        .dma_sff_read_status    = scc_dma_sff_read_status,
  };
  
@@ -28035,10 +29675,11 @@ diff -urNp linux-3.1.3/drivers/ide/scc_pata.c linux-3.1.3/drivers/ide/scc_pata.c
        .name           = "sccIDE",
        .init_iops      = init_iops_scc,
        .init_dma       = scc_init_dma,
-diff -urNp linux-3.1.3/drivers/ide/serverworks.c linux-3.1.3/drivers/ide/serverworks.c
---- linux-3.1.3/drivers/ide/serverworks.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/serverworks.c      2011-11-16 18:39:07.000000000 -0500
-@@ -337,7 +337,7 @@ static const struct ide_port_ops svwks_p
+diff --git a/drivers/ide/serverworks.c b/drivers/ide/serverworks.c
+index 35fb8da..24d72ef 100644
+--- a/drivers/ide/serverworks.c
++++ b/drivers/ide/serverworks.c
+@@ -337,7 +337,7 @@ static const struct ide_port_ops svwks_port_ops = {
        .cable_detect           = svwks_cable_detect,
  };
  
@@ -28047,10 +29688,11 @@ diff -urNp linux-3.1.3/drivers/ide/serverworks.c linux-3.1.3/drivers/ide/serverw
        {       /* 0: OSB4 */
                .name           = DRV_NAME,
                .init_chipset   = init_chipset_svwks,
-diff -urNp linux-3.1.3/drivers/ide/setup-pci.c linux-3.1.3/drivers/ide/setup-pci.c
---- linux-3.1.3/drivers/ide/setup-pci.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/setup-pci.c        2011-11-16 18:40:10.000000000 -0500
-@@ -542,6 +542,8 @@ int ide_pci_init_two(struct pci_dev *dev
+diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
+index ab3db61..afed580 100644
+--- a/drivers/ide/setup-pci.c
++++ b/drivers/ide/setup-pci.c
+@@ -542,6 +542,8 @@ int ide_pci_init_two(struct pci_dev *dev1, struct pci_dev *dev2,
        int ret, i, n_ports = dev2 ? 4 : 2;
        struct ide_hw hw[4], *hws[] = { NULL, NULL, NULL, NULL };
  
@@ -28059,10 +29701,11 @@ diff -urNp linux-3.1.3/drivers/ide/setup-pci.c linux-3.1.3/drivers/ide/setup-pci
        for (i = 0; i < n_ports / 2; i++) {
                ret = ide_setup_pci_controller(pdev[i], d, !i);
                if (ret < 0)
-diff -urNp linux-3.1.3/drivers/ide/siimage.c linux-3.1.3/drivers/ide/siimage.c
---- linux-3.1.3/drivers/ide/siimage.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/siimage.c  2011-11-16 18:39:07.000000000 -0500
-@@ -719,7 +719,7 @@ static const struct ide_dma_ops sil_dma_
+diff --git a/drivers/ide/siimage.c b/drivers/ide/siimage.c
+index ddeda44..46f7e30 100644
+--- a/drivers/ide/siimage.c
++++ b/drivers/ide/siimage.c
+@@ -719,7 +719,7 @@ static const struct ide_dma_ops sil_dma_ops = {
                .udma_mask      = ATA_UDMA6,            \
        }
  
@@ -28071,10 +29714,11 @@ diff -urNp linux-3.1.3/drivers/ide/siimage.c linux-3.1.3/drivers/ide/siimage.c
        /* 0: SiI680 */  DECLARE_SII_DEV(&sil_pata_port_ops),
        /* 1: SiI3112 */ DECLARE_SII_DEV(&sil_sata_port_ops)
  };
-diff -urNp linux-3.1.3/drivers/ide/sis5513.c linux-3.1.3/drivers/ide/sis5513.c
---- linux-3.1.3/drivers/ide/sis5513.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/sis5513.c  2011-11-16 18:39:07.000000000 -0500
-@@ -563,7 +563,7 @@ static const struct ide_port_ops sis_ata
+diff --git a/drivers/ide/sis5513.c b/drivers/ide/sis5513.c
+index 4a00225..09e61b4 100644
+--- a/drivers/ide/sis5513.c
++++ b/drivers/ide/sis5513.c
+@@ -563,7 +563,7 @@ static const struct ide_port_ops sis_ata133_port_ops = {
        .cable_detect           = sis_cable_detect,
  };
  
@@ -28083,10 +29727,11 @@ diff -urNp linux-3.1.3/drivers/ide/sis5513.c linux-3.1.3/drivers/ide/sis5513.c
        .name           = DRV_NAME,
        .init_chipset   = init_chipset_sis5513,
        .enablebits     = { {0x4a, 0x02, 0x02}, {0x4a, 0x04, 0x04} },
-diff -urNp linux-3.1.3/drivers/ide/sl82c105.c linux-3.1.3/drivers/ide/sl82c105.c
---- linux-3.1.3/drivers/ide/sl82c105.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/sl82c105.c 2011-11-16 18:39:07.000000000 -0500
-@@ -299,7 +299,7 @@ static const struct ide_dma_ops sl82c105
+diff --git a/drivers/ide/sl82c105.c b/drivers/ide/sl82c105.c
+index f21dc2a..d051cd2 100644
+--- a/drivers/ide/sl82c105.c
++++ b/drivers/ide/sl82c105.c
+@@ -299,7 +299,7 @@ static const struct ide_dma_ops sl82c105_dma_ops = {
        .dma_sff_read_status    = ide_dma_sff_read_status,
  };
  
@@ -28095,10 +29740,11 @@ diff -urNp linux-3.1.3/drivers/ide/sl82c105.c linux-3.1.3/drivers/ide/sl82c105.c
        .name           = DRV_NAME,
        .init_chipset   = init_chipset_sl82c105,
        .enablebits     = {{0x40,0x01,0x01}, {0x40,0x10,0x10}},
-diff -urNp linux-3.1.3/drivers/ide/slc90e66.c linux-3.1.3/drivers/ide/slc90e66.c
---- linux-3.1.3/drivers/ide/slc90e66.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/slc90e66.c 2011-11-16 18:39:07.000000000 -0500
-@@ -132,7 +132,7 @@ static const struct ide_port_ops slc90e6
+diff --git a/drivers/ide/slc90e66.c b/drivers/ide/slc90e66.c
+index 864ffe0..863a5e9 100644
+--- a/drivers/ide/slc90e66.c
++++ b/drivers/ide/slc90e66.c
+@@ -132,7 +132,7 @@ static const struct ide_port_ops slc90e66_port_ops = {
        .cable_detect           = slc90e66_cable_detect,
  };
  
@@ -28107,10 +29753,11 @@ diff -urNp linux-3.1.3/drivers/ide/slc90e66.c linux-3.1.3/drivers/ide/slc90e66.c
        .name           = DRV_NAME,
        .enablebits     = { {0x41, 0x80, 0x80}, {0x43, 0x80, 0x80} },
        .port_ops       = &slc90e66_port_ops,
-diff -urNp linux-3.1.3/drivers/ide/tc86c001.c linux-3.1.3/drivers/ide/tc86c001.c
---- linux-3.1.3/drivers/ide/tc86c001.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/tc86c001.c 2011-11-16 18:39:07.000000000 -0500
-@@ -191,7 +191,7 @@ static const struct ide_dma_ops tc86c001
+diff --git a/drivers/ide/tc86c001.c b/drivers/ide/tc86c001.c
+index e444d24..ba577de 100644
+--- a/drivers/ide/tc86c001.c
++++ b/drivers/ide/tc86c001.c
+@@ -191,7 +191,7 @@ static const struct ide_dma_ops tc86c001_dma_ops = {
        .dma_sff_read_status    = ide_dma_sff_read_status,
  };
  
@@ -28119,10 +29766,11 @@ diff -urNp linux-3.1.3/drivers/ide/tc86c001.c linux-3.1.3/drivers/ide/tc86c001.c
        .name           = DRV_NAME,
        .init_hwif      = init_hwif_tc86c001,
        .port_ops       = &tc86c001_port_ops,
-diff -urNp linux-3.1.3/drivers/ide/triflex.c linux-3.1.3/drivers/ide/triflex.c
---- linux-3.1.3/drivers/ide/triflex.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/triflex.c  2011-11-16 18:39:07.000000000 -0500
-@@ -92,7 +92,7 @@ static const struct ide_port_ops triflex
+diff --git a/drivers/ide/triflex.c b/drivers/ide/triflex.c
+index e53a1b7..d11aff7 100644
+--- a/drivers/ide/triflex.c
++++ b/drivers/ide/triflex.c
+@@ -92,7 +92,7 @@ static const struct ide_port_ops triflex_port_ops = {
        .set_dma_mode           = triflex_set_mode,
  };
  
@@ -28131,10 +29779,11 @@ diff -urNp linux-3.1.3/drivers/ide/triflex.c linux-3.1.3/drivers/ide/triflex.c
        .name           = DRV_NAME,
        .enablebits     = {{0x80, 0x01, 0x01}, {0x80, 0x02, 0x02}},
        .port_ops       = &triflex_port_ops,
-diff -urNp linux-3.1.3/drivers/ide/trm290.c linux-3.1.3/drivers/ide/trm290.c
---- linux-3.1.3/drivers/ide/trm290.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/trm290.c   2011-11-16 18:39:07.000000000 -0500
-@@ -324,7 +324,7 @@ static struct ide_dma_ops trm290_dma_ops
+diff --git a/drivers/ide/trm290.c b/drivers/ide/trm290.c
+index 4b42ca0..e494a98 100644
+--- a/drivers/ide/trm290.c
++++ b/drivers/ide/trm290.c
+@@ -324,7 +324,7 @@ static struct ide_dma_ops trm290_dma_ops = {
        .dma_check              = trm290_dma_check,
  };
  
@@ -28143,10 +29792,11 @@ diff -urNp linux-3.1.3/drivers/ide/trm290.c linux-3.1.3/drivers/ide/trm290.c
        .name           = DRV_NAME,
        .init_hwif      = init_hwif_trm290,
        .tp_ops         = &trm290_tp_ops,
-diff -urNp linux-3.1.3/drivers/ide/via82cxxx.c linux-3.1.3/drivers/ide/via82cxxx.c
---- linux-3.1.3/drivers/ide/via82cxxx.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/ide/via82cxxx.c        2011-11-16 18:39:07.000000000 -0500
-@@ -403,7 +403,7 @@ static const struct ide_port_ops via_por
+diff --git a/drivers/ide/via82cxxx.c b/drivers/ide/via82cxxx.c
+index f46f49c..eb77678 100644
+--- a/drivers/ide/via82cxxx.c
++++ b/drivers/ide/via82cxxx.c
+@@ -403,7 +403,7 @@ static const struct ide_port_ops via_port_ops = {
        .cable_detect           = via82cxxx_cable_detect,
  };
  
@@ -28155,10 +29805,11 @@ diff -urNp linux-3.1.3/drivers/ide/via82cxxx.c linux-3.1.3/drivers/ide/via82cxxx
        .name           = DRV_NAME,
        .init_chipset   = init_chipset_via82cxxx,
        .enablebits     = { { 0x40, 0x02, 0x02 }, { 0x40, 0x01, 0x01 } },
-diff -urNp linux-3.1.3/drivers/infiniband/core/cm.c linux-3.1.3/drivers/infiniband/core/cm.c
---- linux-3.1.3/drivers/infiniband/core/cm.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/infiniband/core/cm.c   2011-11-16 18:39:07.000000000 -0500
-@@ -113,7 +113,7 @@ static char const counter_group_names[CM
+diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
+index fc0f2bd..ac2f8a5 100644
+--- a/drivers/infiniband/core/cm.c
++++ b/drivers/infiniband/core/cm.c
+@@ -113,7 +113,7 @@ static char const counter_group_names[CM_COUNTER_GROUPS]
  
  struct cm_counter_group {
        struct kobject obj;
@@ -28167,7 +29818,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/core/cm.c linux-3.1.3/drivers/infiniba
  };
  
  struct cm_counter_attribute {
-@@ -1387,7 +1387,7 @@ static void cm_dup_req_handler(struct cm
+@@ -1387,7 +1387,7 @@ static void cm_dup_req_handler(struct cm_work *work,
        struct ib_mad_send_buf *msg = NULL;
        int ret;
  
@@ -28176,7 +29827,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/core/cm.c linux-3.1.3/drivers/infiniba
                        counter[CM_REQ_COUNTER]);
  
        /* Quick state check to discard duplicate REQs. */
-@@ -1765,7 +1765,7 @@ static void cm_dup_rep_handler(struct cm
+@@ -1765,7 +1765,7 @@ static void cm_dup_rep_handler(struct cm_work *work)
        if (!cm_id_priv)
                return;
  
@@ -28185,7 +29836,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/core/cm.c linux-3.1.3/drivers/infiniba
                        counter[CM_REP_COUNTER]);
        ret = cm_alloc_response_msg(work->port, work->mad_recv_wc, &msg);
        if (ret)
-@@ -1932,7 +1932,7 @@ static int cm_rtu_handler(struct cm_work
+@@ -1932,7 +1932,7 @@ static int cm_rtu_handler(struct cm_work *work)
        if (cm_id_priv->id.state != IB_CM_REP_SENT &&
            cm_id_priv->id.state != IB_CM_MRA_REP_RCVD) {
                spin_unlock_irq(&cm_id_priv->lock);
@@ -28194,7 +29845,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/core/cm.c linux-3.1.3/drivers/infiniba
                                counter[CM_RTU_COUNTER]);
                goto out;
        }
-@@ -2115,7 +2115,7 @@ static int cm_dreq_handler(struct cm_wor
+@@ -2115,7 +2115,7 @@ static int cm_dreq_handler(struct cm_work *work)
        cm_id_priv = cm_acquire_id(dreq_msg->remote_comm_id,
                                   dreq_msg->local_comm_id);
        if (!cm_id_priv) {
@@ -28203,7 +29854,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/core/cm.c linux-3.1.3/drivers/infiniba
                                counter[CM_DREQ_COUNTER]);
                cm_issue_drep(work->port, work->mad_recv_wc);
                return -EINVAL;
-@@ -2140,7 +2140,7 @@ static int cm_dreq_handler(struct cm_wor
+@@ -2140,7 +2140,7 @@ static int cm_dreq_handler(struct cm_work *work)
        case IB_CM_MRA_REP_RCVD:
                break;
        case IB_CM_TIMEWAIT:
@@ -28212,7 +29863,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/core/cm.c linux-3.1.3/drivers/infiniba
                                counter[CM_DREQ_COUNTER]);
                if (cm_alloc_response_msg(work->port, work->mad_recv_wc, &msg))
                        goto unlock;
-@@ -2154,7 +2154,7 @@ static int cm_dreq_handler(struct cm_wor
+@@ -2154,7 +2154,7 @@ static int cm_dreq_handler(struct cm_work *work)
                        cm_free_msg(msg);
                goto deref;
        case IB_CM_DREQ_RCVD:
@@ -28221,7 +29872,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/core/cm.c linux-3.1.3/drivers/infiniba
                                counter[CM_DREQ_COUNTER]);
                goto unlock;
        default:
-@@ -2521,7 +2521,7 @@ static int cm_mra_handler(struct cm_work
+@@ -2521,7 +2521,7 @@ static int cm_mra_handler(struct cm_work *work)
                    ib_modify_mad(cm_id_priv->av.port->mad_agent,
                                  cm_id_priv->msg, timeout)) {
                        if (cm_id_priv->id.lap_state == IB_CM_MRA_LAP_RCVD)
@@ -28230,7 +29881,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/core/cm.c linux-3.1.3/drivers/infiniba
                                                counter_group[CM_RECV_DUPLICATES].
                                                counter[CM_MRA_COUNTER]);
                        goto out;
-@@ -2530,7 +2530,7 @@ static int cm_mra_handler(struct cm_work
+@@ -2530,7 +2530,7 @@ static int cm_mra_handler(struct cm_work *work)
                break;
        case IB_CM_MRA_REQ_RCVD:
        case IB_CM_MRA_REP_RCVD:
@@ -28239,7 +29890,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/core/cm.c linux-3.1.3/drivers/infiniba
                                counter[CM_MRA_COUNTER]);
                /* fall through */
        default:
-@@ -2692,7 +2692,7 @@ static int cm_lap_handler(struct cm_work
+@@ -2692,7 +2692,7 @@ static int cm_lap_handler(struct cm_work *work)
        case IB_CM_LAP_IDLE:
                break;
        case IB_CM_MRA_LAP_SENT:
@@ -28248,7 +29899,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/core/cm.c linux-3.1.3/drivers/infiniba
                                counter[CM_LAP_COUNTER]);
                if (cm_alloc_response_msg(work->port, work->mad_recv_wc, &msg))
                        goto unlock;
-@@ -2708,7 +2708,7 @@ static int cm_lap_handler(struct cm_work
+@@ -2708,7 +2708,7 @@ static int cm_lap_handler(struct cm_work *work)
                        cm_free_msg(msg);
                goto deref;
        case IB_CM_LAP_RCVD:
@@ -28257,7 +29908,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/core/cm.c linux-3.1.3/drivers/infiniba
                                counter[CM_LAP_COUNTER]);
                goto unlock;
        default:
-@@ -2992,7 +2992,7 @@ static int cm_sidr_req_handler(struct cm
+@@ -2992,7 +2992,7 @@ static int cm_sidr_req_handler(struct cm_work *work)
        cur_cm_id_priv = cm_insert_remote_sidr(cm_id_priv);
        if (cur_cm_id_priv) {
                spin_unlock_irq(&cm.lock);
@@ -28266,7 +29917,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/core/cm.c linux-3.1.3/drivers/infiniba
                                counter[CM_SIDR_REQ_COUNTER]);
                goto out; /* Duplicate message. */
        }
-@@ -3204,10 +3204,10 @@ static void cm_send_handler(struct ib_ma
+@@ -3204,10 +3204,10 @@ static void cm_send_handler(struct ib_mad_agent *mad_agent,
        if (!msg->context[0] && (attr_index != CM_REJ_COUNTER))
                msg->retries = 1;
  
@@ -28279,7 +29930,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/core/cm.c linux-3.1.3/drivers/infiniba
                                &port->counter_group[CM_XMIT_RETRIES].
                                counter[attr_index]);
  
-@@ -3417,7 +3417,7 @@ static void cm_recv_handler(struct ib_ma
+@@ -3417,7 +3417,7 @@ static void cm_recv_handler(struct ib_mad_agent *mad_agent,
        }
  
        attr_id = be16_to_cpu(mad_recv_wc->recv_buf.mad->mad_hdr.attr_id);
@@ -28288,7 +29939,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/core/cm.c linux-3.1.3/drivers/infiniba
                        counter[attr_id - CM_ATTR_ID_OFFSET]);
  
        work = kmalloc(sizeof *work + sizeof(struct ib_sa_path_rec) * paths,
-@@ -3615,7 +3615,7 @@ static ssize_t cm_show_counter(struct ko
+@@ -3615,7 +3615,7 @@ static ssize_t cm_show_counter(struct kobject *obj, struct attribute *attr,
        cm_attr = container_of(attr, struct cm_counter_attribute, attr);
  
        return sprintf(buf, "%ld\n",
@@ -28297,9 +29948,10 @@ diff -urNp linux-3.1.3/drivers/infiniband/core/cm.c linux-3.1.3/drivers/infiniba
  }
  
  static const struct sysfs_ops cm_counter_ops = {
-diff -urNp linux-3.1.3/drivers/infiniband/core/fmr_pool.c linux-3.1.3/drivers/infiniband/core/fmr_pool.c
---- linux-3.1.3/drivers/infiniband/core/fmr_pool.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/infiniband/core/fmr_pool.c     2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/infiniband/core/fmr_pool.c b/drivers/infiniband/core/fmr_pool.c
+index 4507043..14ad522 100644
+--- a/drivers/infiniband/core/fmr_pool.c
++++ b/drivers/infiniband/core/fmr_pool.c
 @@ -97,8 +97,8 @@ struct ib_fmr_pool {
  
        struct task_struct       *thread;
@@ -28311,7 +29963,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/core/fmr_pool.c linux-3.1.3/drivers/in
  
        wait_queue_head_t         force_wait;
  };
-@@ -179,10 +179,10 @@ static int ib_fmr_cleanup_thread(void *p
+@@ -179,10 +179,10 @@ static int ib_fmr_cleanup_thread(void *pool_ptr)
        struct ib_fmr_pool *pool = pool_ptr;
  
        do {
@@ -28324,7 +29976,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/core/fmr_pool.c linux-3.1.3/drivers/in
                        wake_up_interruptible(&pool->force_wait);
  
                        if (pool->flush_function)
-@@ -190,7 +190,7 @@ static int ib_fmr_cleanup_thread(void *p
+@@ -190,7 +190,7 @@ static int ib_fmr_cleanup_thread(void *pool_ptr)
                }
  
                set_current_state(TASK_INTERRUPTIBLE);
@@ -28333,7 +29985,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/core/fmr_pool.c linux-3.1.3/drivers/in
                    !kthread_should_stop())
                        schedule();
                __set_current_state(TASK_RUNNING);
-@@ -282,8 +282,8 @@ struct ib_fmr_pool *ib_create_fmr_pool(s
+@@ -282,8 +282,8 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd             *pd,
        pool->dirty_watermark = params->dirty_watermark;
        pool->dirty_len       = 0;
        spin_lock_init(&pool->pool_lock);
@@ -28344,7 +29996,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/core/fmr_pool.c linux-3.1.3/drivers/in
        init_waitqueue_head(&pool->force_wait);
  
        pool->thread = kthread_run(ib_fmr_cleanup_thread,
-@@ -411,11 +411,11 @@ int ib_flush_fmr_pool(struct ib_fmr_pool
+@@ -411,11 +411,11 @@ int ib_flush_fmr_pool(struct ib_fmr_pool *pool)
        }
        spin_unlock_irq(&pool->pool_lock);
  
@@ -28358,7 +30010,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/core/fmr_pool.c linux-3.1.3/drivers/in
                return -EINTR;
  
        return 0;
-@@ -525,7 +525,7 @@ int ib_fmr_pool_unmap(struct ib_pool_fmr
+@@ -525,7 +525,7 @@ int ib_fmr_pool_unmap(struct ib_pool_fmr *fmr)
                } else {
                        list_add_tail(&fmr->list, &pool->dirty_list);
                        if (++pool->dirty_len >= pool->dirty_watermark) {
@@ -28367,10 +30019,11 @@ diff -urNp linux-3.1.3/drivers/infiniband/core/fmr_pool.c linux-3.1.3/drivers/in
                                wake_up_process(pool->thread);
                        }
                }
-diff -urNp linux-3.1.3/drivers/infiniband/hw/cxgb4/mem.c linux-3.1.3/drivers/infiniband/hw/cxgb4/mem.c
---- linux-3.1.3/drivers/infiniband/hw/cxgb4/mem.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/infiniband/hw/cxgb4/mem.c      2011-11-16 18:39:07.000000000 -0500
-@@ -122,7 +122,7 @@ static int write_tpt_entry(struct c4iw_r
+diff --git a/drivers/infiniband/hw/cxgb4/mem.c b/drivers/infiniband/hw/cxgb4/mem.c
+index 40c8353..946b0e4 100644
+--- a/drivers/infiniband/hw/cxgb4/mem.c
++++ b/drivers/infiniband/hw/cxgb4/mem.c
+@@ -122,7 +122,7 @@ static int write_tpt_entry(struct c4iw_rdev *rdev, u32 reset_tpt_entry,
        int err;
        struct fw_ri_tpte tpt;
        u32 stag_idx;
@@ -28379,7 +30032,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/hw/cxgb4/mem.c linux-3.1.3/drivers/inf
  
        if (c4iw_fatal_error(rdev))
                return -EIO;
-@@ -135,7 +135,7 @@ static int write_tpt_entry(struct c4iw_r
+@@ -135,7 +135,7 @@ static int write_tpt_entry(struct c4iw_rdev *rdev, u32 reset_tpt_entry,
                                             &rdev->resource.tpt_fifo_lock);
                if (!stag_idx)
                        return -ENOMEM;
@@ -28388,10 +30041,11 @@ diff -urNp linux-3.1.3/drivers/infiniband/hw/cxgb4/mem.c linux-3.1.3/drivers/inf
        }
        PDBG("%s stag_state 0x%0x type 0x%0x pdid 0x%0x, stag_idx 0x%x\n",
             __func__, stag_state, type, pdid, stag_idx);
-diff -urNp linux-3.1.3/drivers/infiniband/hw/ipath/ipath_fs.c linux-3.1.3/drivers/infiniband/hw/ipath/ipath_fs.c
---- linux-3.1.3/drivers/infiniband/hw/ipath/ipath_fs.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/infiniband/hw/ipath/ipath_fs.c 2011-11-16 18:40:10.000000000 -0500
-@@ -113,6 +113,8 @@ static ssize_t atomic_counters_read(stru
+diff --git a/drivers/infiniband/hw/ipath/ipath_fs.c b/drivers/infiniband/hw/ipath/ipath_fs.c
+index 31ae1b1..2f5b038 100644
+--- a/drivers/infiniband/hw/ipath/ipath_fs.c
++++ b/drivers/infiniband/hw/ipath/ipath_fs.c
+@@ -113,6 +113,8 @@ static ssize_t atomic_counters_read(struct file *file, char __user *buf,
        struct infinipath_counters counters;
        struct ipath_devdata *dd;
  
@@ -28400,10 +30054,11 @@ diff -urNp linux-3.1.3/drivers/infiniband/hw/ipath/ipath_fs.c linux-3.1.3/driver
        dd = file->f_path.dentry->d_inode->i_private;
        dd->ipath_f_read_counters(dd, &counters);
  
-diff -urNp linux-3.1.3/drivers/infiniband/hw/ipath/ipath_rc.c linux-3.1.3/drivers/infiniband/hw/ipath/ipath_rc.c
---- linux-3.1.3/drivers/infiniband/hw/ipath/ipath_rc.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/infiniband/hw/ipath/ipath_rc.c 2011-11-16 18:39:07.000000000 -0500
-@@ -1868,7 +1868,7 @@ void ipath_rc_rcv(struct ipath_ibdev *de
+diff --git a/drivers/infiniband/hw/ipath/ipath_rc.c b/drivers/infiniband/hw/ipath/ipath_rc.c
+index 79b3dbc..96e5fcc 100644
+--- a/drivers/infiniband/hw/ipath/ipath_rc.c
++++ b/drivers/infiniband/hw/ipath/ipath_rc.c
+@@ -1868,7 +1868,7 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
                struct ib_atomic_eth *ateth;
                struct ipath_ack_entry *e;
                u64 vaddr;
@@ -28412,7 +30067,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/hw/ipath/ipath_rc.c linux-3.1.3/driver
                u64 sdata;
                u32 rkey;
                u8 next;
-@@ -1903,11 +1903,11 @@ void ipath_rc_rcv(struct ipath_ibdev *de
+@@ -1903,11 +1903,11 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
                                            IB_ACCESS_REMOTE_ATOMIC)))
                        goto nack_acc_unlck;
                /* Perform atomic OP and save result. */
@@ -28426,10 +30081,11 @@ diff -urNp linux-3.1.3/drivers/infiniband/hw/ipath/ipath_rc.c linux-3.1.3/driver
                        (u64) cmpxchg((u64 *) qp->r_sge.sge.vaddr,
                                      be64_to_cpu(ateth->compare_data),
                                      sdata);
-diff -urNp linux-3.1.3/drivers/infiniband/hw/ipath/ipath_ruc.c linux-3.1.3/drivers/infiniband/hw/ipath/ipath_ruc.c
---- linux-3.1.3/drivers/infiniband/hw/ipath/ipath_ruc.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/infiniband/hw/ipath/ipath_ruc.c        2011-11-16 18:39:07.000000000 -0500
-@@ -266,7 +266,7 @@ static void ipath_ruc_loopback(struct ip
+diff --git a/drivers/infiniband/hw/ipath/ipath_ruc.c b/drivers/infiniband/hw/ipath/ipath_ruc.c
+index 1f95bba..9530f87 100644
+--- a/drivers/infiniband/hw/ipath/ipath_ruc.c
++++ b/drivers/infiniband/hw/ipath/ipath_ruc.c
+@@ -266,7 +266,7 @@ static void ipath_ruc_loopback(struct ipath_qp *sqp)
        unsigned long flags;
        struct ib_wc wc;
        u64 sdata;
@@ -28452,10 +30108,11 @@ diff -urNp linux-3.1.3/drivers/infiniband/hw/ipath/ipath_ruc.c linux-3.1.3/drive
                        (u64) cmpxchg((u64 *) qp->r_sge.sge.vaddr,
                                      sdata, wqe->wr.wr.atomic.swap);
                goto send_comp;
-diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes.c linux-3.1.3/drivers/infiniband/hw/nes/nes.c
---- linux-3.1.3/drivers/infiniband/hw/nes/nes.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/infiniband/hw/nes/nes.c        2011-11-16 18:39:07.000000000 -0500
-@@ -103,7 +103,7 @@ MODULE_PARM_DESC(limit_maxrdreqsz, "Limi
+diff --git a/drivers/infiniband/hw/nes/nes.c b/drivers/infiniband/hw/nes/nes.c
+index 2d668c6..3312bb7 100644
+--- a/drivers/infiniband/hw/nes/nes.c
++++ b/drivers/infiniband/hw/nes/nes.c
+@@ -103,7 +103,7 @@ MODULE_PARM_DESC(limit_maxrdreqsz, "Limit max read request size to 256 Bytes");
  LIST_HEAD(nes_adapter_list);
  static LIST_HEAD(nes_dev_list);
  
@@ -28464,7 +30121,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes.c linux-3.1.3/drivers/infin
  
  static unsigned int ee_flsh_adapter;
  static unsigned int sysfs_nonidx_addr;
-@@ -275,7 +275,7 @@ static void nes_cqp_rem_ref_callback(str
+@@ -275,7 +275,7 @@ static void nes_cqp_rem_ref_callback(struct nes_device *nesdev, struct nes_cqp_r
        struct nes_qp *nesqp = cqp_request->cqp_callback_pointer;
        struct nes_adapter *nesadapter = nesdev->nesadapter;
  
@@ -28473,9 +30130,65 @@ diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes.c linux-3.1.3/drivers/infin
  
        /* Free the control structures */
  
-diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes_cm.c linux-3.1.3/drivers/infiniband/hw/nes/nes_cm.c
---- linux-3.1.3/drivers/infiniband/hw/nes/nes_cm.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/infiniband/hw/nes/nes_cm.c     2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/infiniband/hw/nes/nes.h b/drivers/infiniband/hw/nes/nes.h
+index 6fe7987..68637b5 100644
+--- a/drivers/infiniband/hw/nes/nes.h
++++ b/drivers/infiniband/hw/nes/nes.h
+@@ -175,17 +175,17 @@ extern unsigned int nes_debug_level;
+ extern unsigned int wqm_quanta;
+ extern struct list_head nes_adapter_list;
+-extern atomic_t cm_connects;
+-extern atomic_t cm_accepts;
+-extern atomic_t cm_disconnects;
+-extern atomic_t cm_closes;
+-extern atomic_t cm_connecteds;
+-extern atomic_t cm_connect_reqs;
+-extern atomic_t cm_rejects;
+-extern atomic_t mod_qp_timouts;
+-extern atomic_t qps_created;
+-extern atomic_t qps_destroyed;
+-extern atomic_t sw_qps_destroyed;
++extern atomic_unchecked_t cm_connects;
++extern atomic_unchecked_t cm_accepts;
++extern atomic_unchecked_t cm_disconnects;
++extern atomic_unchecked_t cm_closes;
++extern atomic_unchecked_t cm_connecteds;
++extern atomic_unchecked_t cm_connect_reqs;
++extern atomic_unchecked_t cm_rejects;
++extern atomic_unchecked_t mod_qp_timouts;
++extern atomic_unchecked_t qps_created;
++extern atomic_unchecked_t qps_destroyed;
++extern atomic_unchecked_t sw_qps_destroyed;
+ extern u32 mh_detected;
+ extern u32 mh_pauses_sent;
+ extern u32 cm_packets_sent;
+@@ -194,14 +194,14 @@ extern u32 cm_packets_created;
+ extern u32 cm_packets_received;
+ extern u32 cm_packets_dropped;
+ extern u32 cm_packets_retrans;
+-extern atomic_t cm_listens_created;
+-extern atomic_t cm_listens_destroyed;
++extern atomic_unchecked_t cm_listens_created;
++extern atomic_unchecked_t cm_listens_destroyed;
+ extern u32 cm_backlog_drops;
+-extern atomic_t cm_loopbacks;
+-extern atomic_t cm_nodes_created;
+-extern atomic_t cm_nodes_destroyed;
+-extern atomic_t cm_accel_dropped_pkts;
+-extern atomic_t cm_resets_recvd;
++extern atomic_unchecked_t cm_loopbacks;
++extern atomic_unchecked_t cm_nodes_created;
++extern atomic_unchecked_t cm_nodes_destroyed;
++extern atomic_unchecked_t cm_accel_dropped_pkts;
++extern atomic_unchecked_t cm_resets_recvd;
+ extern u32 int_mod_timer_init;
+ extern u32 int_mod_cq_depth_256;
+diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
+index a237547..28a9819 100644
+--- a/drivers/infiniband/hw/nes/nes_cm.c
++++ b/drivers/infiniband/hw/nes/nes_cm.c
 @@ -68,14 +68,14 @@ u32 cm_packets_dropped;
  u32 cm_packets_retrans;
  u32 cm_packets_created;
@@ -28519,7 +30232,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes_cm.c linux-3.1.3/drivers/in
  
  
  /**
-@@ -1045,7 +1045,7 @@ static int mini_cm_dec_refcnt_listen(str
+@@ -1045,7 +1045,7 @@ static int mini_cm_dec_refcnt_listen(struct nes_cm_core *cm_core,
                kfree(listener);
                listener = NULL;
                ret = 0;
@@ -28528,7 +30241,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes_cm.c linux-3.1.3/drivers/in
        } else {
                spin_unlock_irqrestore(&cm_core->listen_list_lock, flags);
        }
-@@ -1240,7 +1240,7 @@ static struct nes_cm_node *make_cm_node(
+@@ -1242,7 +1242,7 @@ static struct nes_cm_node *make_cm_node(struct nes_cm_core *cm_core,
                  cm_node->rem_mac);
  
        add_hte_node(cm_core, cm_node);
@@ -28537,7 +30250,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes_cm.c linux-3.1.3/drivers/in
  
        return cm_node;
  }
-@@ -1298,7 +1298,7 @@ static int rem_ref_cm_node(struct nes_cm
+@@ -1300,7 +1300,7 @@ static int rem_ref_cm_node(struct nes_cm_core *cm_core,
        }
  
        atomic_dec(&cm_core->node_cnt);
@@ -28546,7 +30259,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes_cm.c linux-3.1.3/drivers/in
        nesqp = cm_node->nesqp;
        if (nesqp) {
                nesqp->cm_node = NULL;
-@@ -1365,7 +1365,7 @@ static int process_options(struct nes_cm
+@@ -1367,7 +1367,7 @@ static int process_options(struct nes_cm_node *cm_node, u8 *optionsloc,
  
  static void drop_packet(struct sk_buff *skb)
  {
@@ -28555,7 +30268,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes_cm.c linux-3.1.3/drivers/in
        dev_kfree_skb_any(skb);
  }
  
-@@ -1428,7 +1428,7 @@ static void handle_rst_pkt(struct nes_cm
+@@ -1430,7 +1430,7 @@ static void handle_rst_pkt(struct nes_cm_node *cm_node, struct sk_buff *skb,
  {
  
        int     reset = 0;      /* whether to send reset in case of err.. */
@@ -28564,7 +30277,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes_cm.c linux-3.1.3/drivers/in
        nes_debug(NES_DBG_CM, "Received Reset, cm_node = %p, state = %u."
                        " refcnt=%d\n", cm_node, cm_node->state,
                        atomic_read(&cm_node->ref_count));
-@@ -2057,7 +2057,7 @@ static struct nes_cm_node *mini_cm_conne
+@@ -2059,7 +2059,7 @@ static struct nes_cm_node *mini_cm_connect(struct nes_cm_core *cm_core,
                                rem_ref_cm_node(cm_node->cm_core, cm_node);
                                return NULL;
                        }
@@ -28573,7 +30286,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes_cm.c linux-3.1.3/drivers/in
                        loopbackremotenode->loopbackpartner = cm_node;
                        loopbackremotenode->tcp_cntxt.rcv_wscale =
                                NES_CM_DEFAULT_RCV_WND_SCALE;
-@@ -2332,7 +2332,7 @@ static int mini_cm_recv_pkt(struct nes_c
+@@ -2334,7 +2334,7 @@ static int mini_cm_recv_pkt(struct nes_cm_core *cm_core,
                        add_ref_cm_node(cm_node);
                } else if (cm_node->state == NES_CM_STATE_TSA) {
                        rem_ref_cm_node(cm_core, cm_node);
@@ -28582,7 +30295,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes_cm.c linux-3.1.3/drivers/in
                        dev_kfree_skb_any(skb);
                        break;
                }
-@@ -2638,7 +2638,7 @@ static int nes_cm_disconn_true(struct ne
+@@ -2640,7 +2640,7 @@ static int nes_cm_disconn_true(struct nes_qp *nesqp)
  
        if ((cm_id) && (cm_id->event_handler)) {
                if (issue_disconn) {
@@ -28591,7 +30304,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes_cm.c linux-3.1.3/drivers/in
                        cm_event.event = IW_CM_EVENT_DISCONNECT;
                        cm_event.status = disconn_status;
                        cm_event.local_addr = cm_id->local_addr;
-@@ -2660,7 +2660,7 @@ static int nes_cm_disconn_true(struct ne
+@@ -2662,7 +2662,7 @@ static int nes_cm_disconn_true(struct nes_qp *nesqp)
                }
  
                if (issue_close) {
@@ -28600,7 +30313,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes_cm.c linux-3.1.3/drivers/in
                        nes_disconnect(nesqp, 1);
  
                        cm_id->provider_data = nesqp;
-@@ -2791,7 +2791,7 @@ int nes_accept(struct iw_cm_id *cm_id, s
+@@ -2793,7 +2793,7 @@ int nes_accept(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
  
        nes_debug(NES_DBG_CM, "QP%u, cm_node=%p, jiffies = %lu listener = %p\n",
                nesqp->hwqp.qp_id, cm_node, jiffies, cm_node->listener);
@@ -28609,7 +30322,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes_cm.c linux-3.1.3/drivers/in
  
        nes_debug(NES_DBG_CM, "netdev refcnt = %u.\n",
                        netdev_refcnt_read(nesvnic->netdev));
-@@ -3001,7 +3001,7 @@ int nes_reject(struct iw_cm_id *cm_id, c
+@@ -3003,7 +3003,7 @@ int nes_reject(struct iw_cm_id *cm_id, const void *pdata, u8 pdata_len)
  
        struct nes_cm_core *cm_core;
  
@@ -28618,7 +30331,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes_cm.c linux-3.1.3/drivers/in
        cm_node = (struct nes_cm_node *) cm_id->provider_data;
        loopback = cm_node->loopbackpartner;
        cm_core = cm_node->cm_core;
-@@ -3067,7 +3067,7 @@ int nes_connect(struct iw_cm_id *cm_id, 
+@@ -3069,7 +3069,7 @@ int nes_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
                ntohl(cm_id->local_addr.sin_addr.s_addr),
                ntohs(cm_id->local_addr.sin_port));
  
@@ -28627,7 +30340,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes_cm.c linux-3.1.3/drivers/in
        nesqp->active_conn = 1;
  
        /* cache the cm_id in the qp */
-@@ -3173,7 +3173,7 @@ int nes_create_listen(struct iw_cm_id *c
+@@ -3175,7 +3175,7 @@ int nes_create_listen(struct iw_cm_id *cm_id, int backlog)
                        g_cm_core->api->stop_listener(g_cm_core, (void *)cm_node);
                        return err;
                }
@@ -28636,7 +30349,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes_cm.c linux-3.1.3/drivers/in
        }
  
        cm_id->add_ref(cm_id);
-@@ -3278,7 +3278,7 @@ static void cm_event_connected(struct ne
+@@ -3280,7 +3280,7 @@ static void cm_event_connected(struct nes_cm_event *event)
        if (nesqp->destroyed) {
                return;
        }
@@ -28645,7 +30358,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes_cm.c linux-3.1.3/drivers/in
        nes_debug(NES_DBG_CM, "QP%u attempting to connect to  0x%08X:0x%04X on"
                        " local port 0x%04X. jiffies = %lu.\n",
                        nesqp->hwqp.qp_id,
-@@ -3493,7 +3493,7 @@ static void cm_event_reset(struct nes_cm
+@@ -3495,7 +3495,7 @@ static void cm_event_reset(struct nes_cm_event *event)
  
        cm_id->add_ref(cm_id);
        ret = cm_id->event_handler(cm_id, &cm_event);
@@ -28654,7 +30367,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes_cm.c linux-3.1.3/drivers/in
        cm_event.event = IW_CM_EVENT_CLOSE;
        cm_event.status = 0;
        cm_event.provider_data = cm_id->provider_data;
-@@ -3529,7 +3529,7 @@ static void cm_event_mpa_req(struct nes_
+@@ -3531,7 +3531,7 @@ static void cm_event_mpa_req(struct nes_cm_event *event)
                return;
        cm_id = cm_node->cm_id;
  
@@ -28663,7 +30376,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes_cm.c linux-3.1.3/drivers/in
        nes_debug(NES_DBG_CM, "cm_node = %p - cm_id = %p, jiffies = %lu\n",
                        cm_node, cm_id, jiffies);
  
-@@ -3567,7 +3567,7 @@ static void cm_event_mpa_reject(struct n
+@@ -3569,7 +3569,7 @@ static void cm_event_mpa_reject(struct nes_cm_event *event)
                return;
        cm_id = cm_node->cm_id;
  
@@ -28672,64 +30385,11 @@ diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes_cm.c linux-3.1.3/drivers/in
        nes_debug(NES_DBG_CM, "cm_node = %p - cm_id = %p, jiffies = %lu\n",
                        cm_node, cm_id, jiffies);
  
-diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes.h linux-3.1.3/drivers/infiniband/hw/nes/nes.h
---- linux-3.1.3/drivers/infiniband/hw/nes/nes.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/infiniband/hw/nes/nes.h        2011-11-16 18:39:07.000000000 -0500
-@@ -175,17 +175,17 @@ extern unsigned int nes_debug_level;
- extern unsigned int wqm_quanta;
- extern struct list_head nes_adapter_list;
--extern atomic_t cm_connects;
--extern atomic_t cm_accepts;
--extern atomic_t cm_disconnects;
--extern atomic_t cm_closes;
--extern atomic_t cm_connecteds;
--extern atomic_t cm_connect_reqs;
--extern atomic_t cm_rejects;
--extern atomic_t mod_qp_timouts;
--extern atomic_t qps_created;
--extern atomic_t qps_destroyed;
--extern atomic_t sw_qps_destroyed;
-+extern atomic_unchecked_t cm_connects;
-+extern atomic_unchecked_t cm_accepts;
-+extern atomic_unchecked_t cm_disconnects;
-+extern atomic_unchecked_t cm_closes;
-+extern atomic_unchecked_t cm_connecteds;
-+extern atomic_unchecked_t cm_connect_reqs;
-+extern atomic_unchecked_t cm_rejects;
-+extern atomic_unchecked_t mod_qp_timouts;
-+extern atomic_unchecked_t qps_created;
-+extern atomic_unchecked_t qps_destroyed;
-+extern atomic_unchecked_t sw_qps_destroyed;
- extern u32 mh_detected;
- extern u32 mh_pauses_sent;
- extern u32 cm_packets_sent;
-@@ -194,14 +194,14 @@ extern u32 cm_packets_created;
- extern u32 cm_packets_received;
- extern u32 cm_packets_dropped;
- extern u32 cm_packets_retrans;
--extern atomic_t cm_listens_created;
--extern atomic_t cm_listens_destroyed;
-+extern atomic_unchecked_t cm_listens_created;
-+extern atomic_unchecked_t cm_listens_destroyed;
- extern u32 cm_backlog_drops;
--extern atomic_t cm_loopbacks;
--extern atomic_t cm_nodes_created;
--extern atomic_t cm_nodes_destroyed;
--extern atomic_t cm_accel_dropped_pkts;
--extern atomic_t cm_resets_recvd;
-+extern atomic_unchecked_t cm_loopbacks;
-+extern atomic_unchecked_t cm_nodes_created;
-+extern atomic_unchecked_t cm_nodes_destroyed;
-+extern atomic_unchecked_t cm_accel_dropped_pkts;
-+extern atomic_unchecked_t cm_resets_recvd;
- extern u32 int_mod_timer_init;
- extern u32 int_mod_cq_depth_256;
-diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes_nic.c linux-3.1.3/drivers/infiniband/hw/nes/nes_nic.c
---- linux-3.1.3/drivers/infiniband/hw/nes/nes_nic.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/infiniband/hw/nes/nes_nic.c    2011-11-16 18:39:07.000000000 -0500
-@@ -1274,31 +1274,31 @@ static void nes_netdev_get_ethtool_stats
+diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c
+index 9d7ffeb..a95dd7d 100644
+--- a/drivers/infiniband/hw/nes/nes_nic.c
++++ b/drivers/infiniband/hw/nes/nes_nic.c
+@@ -1274,31 +1274,31 @@ static void nes_netdev_get_ethtool_stats(struct net_device *netdev,
        target_stat_values[++index] = mh_detected;
        target_stat_values[++index] = mh_pauses_sent;
        target_stat_values[++index] = nesvnic->endnode_ipv4_tcp_retransmits;
@@ -28779,9 +30439,10 @@ diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes_nic.c linux-3.1.3/drivers/i
        target_stat_values[++index] = nesadapter->free_4kpbl;
        target_stat_values[++index] = nesadapter->free_256pbl;
        target_stat_values[++index] = int_mod_timer_init;
-diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes_verbs.c linux-3.1.3/drivers/infiniband/hw/nes/nes_verbs.c
---- linux-3.1.3/drivers/infiniband/hw/nes/nes_verbs.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/infiniband/hw/nes/nes_verbs.c  2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c
+index 9f2f7d4..6d2fee2 100644
+--- a/drivers/infiniband/hw/nes/nes_verbs.c
++++ b/drivers/infiniband/hw/nes/nes_verbs.c
 @@ -46,9 +46,9 @@
  
  #include <rdma/ib_umem.h>
@@ -28795,7 +30456,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes_verbs.c linux-3.1.3/drivers
  
  static void nes_unregister_ofa_device(struct nes_ib_device *nesibdev);
  
-@@ -1131,7 +1131,7 @@ static struct ib_qp *nes_create_qp(struc
+@@ -1131,7 +1131,7 @@ static struct ib_qp *nes_create_qp(struct ib_pd *ibpd,
        if (init_attr->create_flags)
                return ERR_PTR(-EINVAL);
  
@@ -28804,7 +30465,7 @@ diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes_verbs.c linux-3.1.3/drivers
        switch (init_attr->qp_type) {
                case IB_QPT_RC:
                        if (nes_drv_opt & NES_DRV_OPT_NO_INLINE_DATA) {
-@@ -1460,7 +1460,7 @@ static int nes_destroy_qp(struct ib_qp *
+@@ -1460,7 +1460,7 @@ static int nes_destroy_qp(struct ib_qp *ibqp)
        struct iw_cm_event cm_event;
        int ret;
  
@@ -28813,9 +30474,10 @@ diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes_verbs.c linux-3.1.3/drivers
        nesqp->destroyed = 1;
  
        /* Blow away the connection if it exists. */
-diff -urNp linux-3.1.3/drivers/infiniband/hw/qib/qib.h linux-3.1.3/drivers/infiniband/hw/qib/qib.h
---- linux-3.1.3/drivers/infiniband/hw/qib/qib.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/infiniband/hw/qib/qib.h        2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/infiniband/hw/qib/qib.h b/drivers/infiniband/hw/qib/qib.h
+index c9624ea..e025b66 100644
+--- a/drivers/infiniband/hw/qib/qib.h
++++ b/drivers/infiniband/hw/qib/qib.h
 @@ -51,6 +51,7 @@
  #include <linux/completion.h>
  #include <linux/kref.h>
@@ -28824,9 +30486,10 @@ diff -urNp linux-3.1.3/drivers/infiniband/hw/qib/qib.h linux-3.1.3/drivers/infin
  
  #include "qib_common.h"
  #include "qib_verbs.h"
-diff -urNp linux-3.1.3/drivers/input/gameport/gameport.c linux-3.1.3/drivers/input/gameport/gameport.c
---- linux-3.1.3/drivers/input/gameport/gameport.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/input/gameport/gameport.c      2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c
+index c351aa4..e6967c2 100644
+--- a/drivers/input/gameport/gameport.c
++++ b/drivers/input/gameport/gameport.c
 @@ -488,14 +488,14 @@ EXPORT_SYMBOL(gameport_set_phys);
   */
  static void gameport_init_port(struct gameport *gameport)
@@ -28844,10 +30507,11 @@ diff -urNp linux-3.1.3/drivers/input/gameport/gameport.c linux-3.1.3/drivers/inp
        gameport->dev.bus = &gameport_bus;
        gameport->dev.release = gameport_release_port;
        if (gameport->parent)
-diff -urNp linux-3.1.3/drivers/input/input.c linux-3.1.3/drivers/input/input.c
---- linux-3.1.3/drivers/input/input.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/input/input.c  2011-11-16 18:39:07.000000000 -0500
-@@ -1814,7 +1814,7 @@ static void input_cleanse_bitmasks(struc
+diff --git a/drivers/input/input.c b/drivers/input/input.c
+index da38d97..2aa0b79 100644
+--- a/drivers/input/input.c
++++ b/drivers/input/input.c
+@@ -1814,7 +1814,7 @@ static void input_cleanse_bitmasks(struct input_dev *dev)
   */
  int input_register_device(struct input_dev *dev)
  {
@@ -28856,7 +30520,7 @@ diff -urNp linux-3.1.3/drivers/input/input.c linux-3.1.3/drivers/input/input.c
        struct input_handler *handler;
        const char *path;
        int error;
-@@ -1851,7 +1851,7 @@ int input_register_device(struct input_d
+@@ -1851,7 +1851,7 @@ int input_register_device(struct input_dev *dev)
                dev->setkeycode = input_default_setkeycode;
  
        dev_set_name(&dev->dev, "input%ld",
@@ -28865,9 +30529,10 @@ diff -urNp linux-3.1.3/drivers/input/input.c linux-3.1.3/drivers/input/input.c
  
        error = device_add(&dev->dev);
        if (error)
-diff -urNp linux-3.1.3/drivers/input/joystick/sidewinder.c linux-3.1.3/drivers/input/joystick/sidewinder.c
---- linux-3.1.3/drivers/input/joystick/sidewinder.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/input/joystick/sidewinder.c    2011-11-16 18:40:10.000000000 -0500
+diff --git a/drivers/input/joystick/sidewinder.c b/drivers/input/joystick/sidewinder.c
+index b8d8611..15f8d2c 100644
+--- a/drivers/input/joystick/sidewinder.c
++++ b/drivers/input/joystick/sidewinder.c
 @@ -30,6 +30,7 @@
  #include <linux/kernel.h>
  #include <linux/module.h>
@@ -28885,10 +30550,11 @@ diff -urNp linux-3.1.3/drivers/input/joystick/sidewinder.c linux-3.1.3/drivers/i
        i = sw_read_packet(sw->gameport, buf, sw->length, 0);
  
        if (sw->type == SW_ID_3DP && sw->length == 66 && i != 66) {             /* Broken packet, try to fix */
-diff -urNp linux-3.1.3/drivers/input/joystick/xpad.c linux-3.1.3/drivers/input/joystick/xpad.c
---- linux-3.1.3/drivers/input/joystick/xpad.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/input/joystick/xpad.c  2011-11-16 18:39:07.000000000 -0500
-@@ -710,7 +710,7 @@ static void xpad_led_set(struct led_clas
+diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
+index d728875..844c89b 100644
+--- a/drivers/input/joystick/xpad.c
++++ b/drivers/input/joystick/xpad.c
+@@ -710,7 +710,7 @@ static void xpad_led_set(struct led_classdev *led_cdev,
  
  static int xpad_led_probe(struct usb_xpad *xpad)
  {
@@ -28897,7 +30563,7 @@ diff -urNp linux-3.1.3/drivers/input/joystick/xpad.c linux-3.1.3/drivers/input/j
        long led_no;
        struct xpad_led *led;
        struct led_classdev *led_cdev;
-@@ -723,7 +723,7 @@ static int xpad_led_probe(struct usb_xpa
+@@ -723,7 +723,7 @@ static int xpad_led_probe(struct usb_xpad *xpad)
        if (!led)
                return -ENOMEM;
  
@@ -28906,10 +30572,11 @@ diff -urNp linux-3.1.3/drivers/input/joystick/xpad.c linux-3.1.3/drivers/input/j
  
        snprintf(led->name, sizeof(led->name), "xpad%ld", led_no);
        led->xpad = xpad;
-diff -urNp linux-3.1.3/drivers/input/mousedev.c linux-3.1.3/drivers/input/mousedev.c
---- linux-3.1.3/drivers/input/mousedev.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/input/mousedev.c       2011-11-16 18:39:07.000000000 -0500
-@@ -763,7 +763,7 @@ static ssize_t mousedev_read(struct file
+diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c
+index 0110b5a..d3ad144 100644
+--- a/drivers/input/mousedev.c
++++ b/drivers/input/mousedev.c
+@@ -763,7 +763,7 @@ static ssize_t mousedev_read(struct file *file, char __user *buffer,
  
        spin_unlock_irq(&client->packet_lock);
  
@@ -28918,10 +30585,11 @@ diff -urNp linux-3.1.3/drivers/input/mousedev.c linux-3.1.3/drivers/input/moused
                return -EFAULT;
  
        return count;
-diff -urNp linux-3.1.3/drivers/input/serio/serio.c linux-3.1.3/drivers/input/serio/serio.c
---- linux-3.1.3/drivers/input/serio/serio.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/input/serio/serio.c    2011-11-16 18:39:07.000000000 -0500
-@@ -497,7 +497,7 @@ static void serio_release_port(struct de
+diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
+index ba70058..571d25d 100644
+--- a/drivers/input/serio/serio.c
++++ b/drivers/input/serio/serio.c
+@@ -497,7 +497,7 @@ static void serio_release_port(struct device *dev)
   */
  static void serio_init_port(struct serio *serio)
  {
@@ -28930,7 +30598,7 @@ diff -urNp linux-3.1.3/drivers/input/serio/serio.c linux-3.1.3/drivers/input/ser
  
        __module_get(THIS_MODULE);
  
-@@ -508,7 +508,7 @@ static void serio_init_port(struct serio
+@@ -508,7 +508,7 @@ static void serio_init_port(struct serio *serio)
        mutex_init(&serio->drv_mutex);
        device_initialize(&serio->dev);
        dev_set_name(&serio->dev, "serio%ld",
@@ -28939,9 +30607,10 @@ diff -urNp linux-3.1.3/drivers/input/serio/serio.c linux-3.1.3/drivers/input/ser
        serio->dev.bus = &serio_bus;
        serio->dev.release = serio_release_port;
        serio->dev.groups = serio_device_attr_groups;
-diff -urNp linux-3.1.3/drivers/isdn/capi/capi.c linux-3.1.3/drivers/isdn/capi/capi.c
---- linux-3.1.3/drivers/isdn/capi/capi.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/isdn/capi/capi.c       2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
+index e44933d..9ba484a 100644
+--- a/drivers/isdn/capi/capi.c
++++ b/drivers/isdn/capi/capi.c
 @@ -83,8 +83,8 @@ struct capiminor {
  
        struct capi20_appl      *ap;
@@ -28953,7 +30622,7 @@ diff -urNp linux-3.1.3/drivers/isdn/capi/capi.c linux-3.1.3/drivers/isdn/capi/ca
  
        struct tty_port port;
        int                ttyinstop;
-@@ -397,7 +397,7 @@ gen_data_b3_resp_for(struct capiminor *m
+@@ -397,7 +397,7 @@ gen_data_b3_resp_for(struct capiminor *mp, struct sk_buff *skb)
                capimsg_setu16(s, 2, mp->ap->applid);
                capimsg_setu8 (s, 4, CAPI_DATA_B3);
                capimsg_setu8 (s, 5, CAPI_RESP);
@@ -28962,7 +30631,7 @@ diff -urNp linux-3.1.3/drivers/isdn/capi/capi.c linux-3.1.3/drivers/isdn/capi/ca
                capimsg_setu32(s, 8, mp->ncci);
                capimsg_setu16(s, 12, datahandle);
        }
-@@ -518,14 +518,14 @@ static void handle_minor_send(struct cap
+@@ -518,14 +518,14 @@ static void handle_minor_send(struct capiminor *mp)
                mp->outbytes -= len;
                spin_unlock_bh(&mp->outlock);
  
@@ -28979,10 +30648,11 @@ diff -urNp linux-3.1.3/drivers/isdn/capi/capi.c linux-3.1.3/drivers/isdn/capi/ca
                capimsg_setu32(skb->data, 8, mp->ncci); /* NCCI */
                capimsg_setu32(skb->data, 12, (u32)(long)skb->data);/* Data32 */
                capimsg_setu16(skb->data, 16, len);     /* Data length */
-diff -urNp linux-3.1.3/drivers/isdn/gigaset/common.c linux-3.1.3/drivers/isdn/gigaset/common.c
---- linux-3.1.3/drivers/isdn/gigaset/common.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/isdn/gigaset/common.c  2011-11-16 18:39:07.000000000 -0500
-@@ -723,7 +723,7 @@ struct cardstate *gigaset_initcs(struct 
+diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c
+index db621db..825ea1a 100644
+--- a/drivers/isdn/gigaset/common.c
++++ b/drivers/isdn/gigaset/common.c
+@@ -723,7 +723,7 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
        cs->commands_pending = 0;
        cs->cur_at_seq = 0;
        cs->gotfwver = -1;
@@ -28991,9 +30661,10 @@ diff -urNp linux-3.1.3/drivers/isdn/gigaset/common.c linux-3.1.3/drivers/isdn/gi
        cs->dev = NULL;
        cs->tty = NULL;
        cs->tty_dev = NULL;
-diff -urNp linux-3.1.3/drivers/isdn/gigaset/gigaset.h linux-3.1.3/drivers/isdn/gigaset/gigaset.h
---- linux-3.1.3/drivers/isdn/gigaset/gigaset.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/isdn/gigaset/gigaset.h 2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/isdn/gigaset/gigaset.h b/drivers/isdn/gigaset/gigaset.h
+index 212efaf..f187c6b 100644
+--- a/drivers/isdn/gigaset/gigaset.h
++++ b/drivers/isdn/gigaset/gigaset.h
 @@ -35,6 +35,7 @@
  #include <linux/tty_driver.h>
  #include <linux/list.h>
@@ -29011,10 +30682,11 @@ diff -urNp linux-3.1.3/drivers/isdn/gigaset/gigaset.h linux-3.1.3/drivers/isdn/g
        struct tty_struct *tty;
        struct tasklet_struct if_wake_tasklet;
        unsigned control_state;
-diff -urNp linux-3.1.3/drivers/isdn/gigaset/interface.c linux-3.1.3/drivers/isdn/gigaset/interface.c
---- linux-3.1.3/drivers/isdn/gigaset/interface.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/isdn/gigaset/interface.c       2011-11-16 18:39:07.000000000 -0500
-@@ -162,9 +162,7 @@ static int if_open(struct tty_struct *tt
+diff --git a/drivers/isdn/gigaset/interface.c b/drivers/isdn/gigaset/interface.c
+index e35058b..5898a8b 100644
+--- a/drivers/isdn/gigaset/interface.c
++++ b/drivers/isdn/gigaset/interface.c
+@@ -162,9 +162,7 @@ static int if_open(struct tty_struct *tty, struct file *filp)
        }
        tty->driver_data = cs;
  
@@ -29025,7 +30697,7 @@ diff -urNp linux-3.1.3/drivers/isdn/gigaset/interface.c linux-3.1.3/drivers/isdn
                spin_lock_irqsave(&cs->lock, flags);
                cs->tty = tty;
                spin_unlock_irqrestore(&cs->lock, flags);
-@@ -192,10 +190,10 @@ static void if_close(struct tty_struct *
+@@ -192,10 +190,10 @@ static void if_close(struct tty_struct *tty, struct file *filp)
  
        if (!cs->connected)
                gig_dbg(DEBUG_IF, "not connected");     /* nothing to do */
@@ -29038,7 +30710,7 @@ diff -urNp linux-3.1.3/drivers/isdn/gigaset/interface.c linux-3.1.3/drivers/isdn
                        spin_lock_irqsave(&cs->lock, flags);
                        cs->tty = NULL;
                        spin_unlock_irqrestore(&cs->lock, flags);
-@@ -230,7 +228,7 @@ static int if_ioctl(struct tty_struct *t
+@@ -230,7 +228,7 @@ static int if_ioctl(struct tty_struct *tty,
        if (!cs->connected) {
                gig_dbg(DEBUG_IF, "not connected");
                retval = -ENODEV;
@@ -29047,7 +30719,7 @@ diff -urNp linux-3.1.3/drivers/isdn/gigaset/interface.c linux-3.1.3/drivers/isdn
                dev_warn(cs->dev, "%s: device not opened\n", __func__);
        else {
                retval = 0;
-@@ -360,7 +358,7 @@ static int if_write(struct tty_struct *t
+@@ -360,7 +358,7 @@ static int if_write(struct tty_struct *tty, const unsigned char *buf, int count)
                retval = -ENODEV;
                goto done;
        }
@@ -29056,7 +30728,7 @@ diff -urNp linux-3.1.3/drivers/isdn/gigaset/interface.c linux-3.1.3/drivers/isdn
                dev_warn(cs->dev, "%s: device not opened\n", __func__);
                retval = -ENODEV;
                goto done;
-@@ -413,7 +411,7 @@ static int if_write_room(struct tty_stru
+@@ -413,7 +411,7 @@ static int if_write_room(struct tty_struct *tty)
        if (!cs->connected) {
                gig_dbg(DEBUG_IF, "not connected");
                retval = -ENODEV;
@@ -29065,7 +30737,7 @@ diff -urNp linux-3.1.3/drivers/isdn/gigaset/interface.c linux-3.1.3/drivers/isdn
                dev_warn(cs->dev, "%s: device not opened\n", __func__);
        else if (cs->mstate != MS_LOCKED) {
                dev_warn(cs->dev, "can't write to unlocked device\n");
-@@ -443,7 +441,7 @@ static int if_chars_in_buffer(struct tty
+@@ -443,7 +441,7 @@ static int if_chars_in_buffer(struct tty_struct *tty)
  
        if (!cs->connected)
                gig_dbg(DEBUG_IF, "not connected");
@@ -29074,7 +30746,7 @@ diff -urNp linux-3.1.3/drivers/isdn/gigaset/interface.c linux-3.1.3/drivers/isdn
                dev_warn(cs->dev, "%s: device not opened\n", __func__);
        else if (cs->mstate != MS_LOCKED)
                dev_warn(cs->dev, "can't write to unlocked device\n");
-@@ -471,7 +469,7 @@ static void if_throttle(struct tty_struc
+@@ -471,7 +469,7 @@ static void if_throttle(struct tty_struct *tty)
  
        if (!cs->connected)
                gig_dbg(DEBUG_IF, "not connected");     /* nothing to do */
@@ -29083,7 +30755,7 @@ diff -urNp linux-3.1.3/drivers/isdn/gigaset/interface.c linux-3.1.3/drivers/isdn
                dev_warn(cs->dev, "%s: device not opened\n", __func__);
        else
                gig_dbg(DEBUG_IF, "%s: not implemented\n", __func__);
-@@ -495,7 +493,7 @@ static void if_unthrottle(struct tty_str
+@@ -495,7 +493,7 @@ static void if_unthrottle(struct tty_struct *tty)
  
        if (!cs->connected)
                gig_dbg(DEBUG_IF, "not connected");     /* nothing to do */
@@ -29092,7 +30764,7 @@ diff -urNp linux-3.1.3/drivers/isdn/gigaset/interface.c linux-3.1.3/drivers/isdn
                dev_warn(cs->dev, "%s: device not opened\n", __func__);
        else
                gig_dbg(DEBUG_IF, "%s: not implemented\n", __func__);
-@@ -526,7 +524,7 @@ static void if_set_termios(struct tty_st
+@@ -526,7 +524,7 @@ static void if_set_termios(struct tty_struct *tty, struct ktermios *old)
                goto out;
        }
  
@@ -29101,10 +30773,11 @@ diff -urNp linux-3.1.3/drivers/isdn/gigaset/interface.c linux-3.1.3/drivers/isdn
                dev_warn(cs->dev, "%s: device not opened\n", __func__);
                goto out;
        }
-diff -urNp linux-3.1.3/drivers/isdn/hardware/avm/b1.c linux-3.1.3/drivers/isdn/hardware/avm/b1.c
---- linux-3.1.3/drivers/isdn/hardware/avm/b1.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/isdn/hardware/avm/b1.c 2011-11-16 18:39:07.000000000 -0500
-@@ -176,7 +176,7 @@ int b1_load_t4file(avmcard *card, capilo
+diff --git a/drivers/isdn/hardware/avm/b1.c b/drivers/isdn/hardware/avm/b1.c
+index 2a57da59..e7a12ed 100644
+--- a/drivers/isdn/hardware/avm/b1.c
++++ b/drivers/isdn/hardware/avm/b1.c
+@@ -176,7 +176,7 @@ int b1_load_t4file(avmcard *card, capiloaddatapart * t4file)
        }
        if (left) {
                if (t4file->user) {
@@ -29113,7 +30786,7 @@ diff -urNp linux-3.1.3/drivers/isdn/hardware/avm/b1.c linux-3.1.3/drivers/isdn/h
                                return -EFAULT;
                } else {
                        memcpy(buf, dp, left);
-@@ -224,7 +224,7 @@ int b1_load_config(avmcard *card, capilo
+@@ -224,7 +224,7 @@ int b1_load_config(avmcard *card, capiloaddatapart * config)
        }
        if (left) {
                if (config->user) {
@@ -29122,10 +30795,11 @@ diff -urNp linux-3.1.3/drivers/isdn/hardware/avm/b1.c linux-3.1.3/drivers/isdn/h
                                return -EFAULT;
                } else {
                        memcpy(buf, dp, left);
-diff -urNp linux-3.1.3/drivers/isdn/hardware/eicon/capidtmf.c linux-3.1.3/drivers/isdn/hardware/eicon/capidtmf.c
---- linux-3.1.3/drivers/isdn/hardware/eicon/capidtmf.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/isdn/hardware/eicon/capidtmf.c 2011-11-16 18:40:10.000000000 -0500
-@@ -498,6 +498,7 @@ void capidtmf_recv_block (t_capidtmf_sta
+diff --git a/drivers/isdn/hardware/eicon/capidtmf.c b/drivers/isdn/hardware/eicon/capidtmf.c
+index f130724..c373c68 100644
+--- a/drivers/isdn/hardware/eicon/capidtmf.c
++++ b/drivers/isdn/hardware/eicon/capidtmf.c
+@@ -498,6 +498,7 @@ void capidtmf_recv_block (t_capidtmf_state   *p_state, byte   *buffer, word leng
    byte goertzel_result_buffer[CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT];
      short windowed_sample_buffer[CAPIDTMF_RECV_WINDOWED_SAMPLES];
  
@@ -29133,9 +30807,10 @@ diff -urNp linux-3.1.3/drivers/isdn/hardware/eicon/capidtmf.c linux-3.1.3/driver
  
    if (p_state->recv.state & CAPIDTMF_RECV_STATE_DTMF_ACTIVE)
    {
-diff -urNp linux-3.1.3/drivers/isdn/hardware/eicon/capifunc.c linux-3.1.3/drivers/isdn/hardware/eicon/capifunc.c
---- linux-3.1.3/drivers/isdn/hardware/eicon/capifunc.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/isdn/hardware/eicon/capifunc.c 2011-11-16 18:40:10.000000000 -0500
+diff --git a/drivers/isdn/hardware/eicon/capifunc.c b/drivers/isdn/hardware/eicon/capifunc.c
+index 4d425c6..a9be6c4 100644
+--- a/drivers/isdn/hardware/eicon/capifunc.c
++++ b/drivers/isdn/hardware/eicon/capifunc.c
 @@ -1055,6 +1055,8 @@ static int divacapi_connect_didd(void)
        IDI_SYNC_REQ req;
        DESCRIPTOR DIDD_Table[MAX_DESCRIPTORS];
@@ -29145,10 +30820,11 @@ diff -urNp linux-3.1.3/drivers/isdn/hardware/eicon/capifunc.c linux-3.1.3/driver
        DIVA_DIDD_Read(DIDD_Table, sizeof(DIDD_Table));
  
        for (x = 0; x < MAX_DESCRIPTORS; x++) {
-diff -urNp linux-3.1.3/drivers/isdn/hardware/eicon/diddfunc.c linux-3.1.3/drivers/isdn/hardware/eicon/diddfunc.c
---- linux-3.1.3/drivers/isdn/hardware/eicon/diddfunc.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/isdn/hardware/eicon/diddfunc.c 2011-11-16 18:40:10.000000000 -0500
-@@ -54,6 +54,8 @@ static int DIVA_INIT_FUNCTION connect_di
+diff --git a/drivers/isdn/hardware/eicon/diddfunc.c b/drivers/isdn/hardware/eicon/diddfunc.c
+index 3029234..ef0d9e2 100644
+--- a/drivers/isdn/hardware/eicon/diddfunc.c
++++ b/drivers/isdn/hardware/eicon/diddfunc.c
+@@ -54,6 +54,8 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
        IDI_SYNC_REQ req;
        DESCRIPTOR DIDD_Table[MAX_DESCRIPTORS];
  
@@ -29157,10 +30833,11 @@ diff -urNp linux-3.1.3/drivers/isdn/hardware/eicon/diddfunc.c linux-3.1.3/driver
        DIVA_DIDD_Read(DIDD_Table, sizeof(DIDD_Table));
  
        for (x = 0; x < MAX_DESCRIPTORS; x++) {
-diff -urNp linux-3.1.3/drivers/isdn/hardware/eicon/divasfunc.c linux-3.1.3/drivers/isdn/hardware/eicon/divasfunc.c
---- linux-3.1.3/drivers/isdn/hardware/eicon/divasfunc.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/isdn/hardware/eicon/divasfunc.c        2011-11-16 18:40:10.000000000 -0500
-@@ -160,6 +160,8 @@ static int DIVA_INIT_FUNCTION connect_di
+diff --git a/drivers/isdn/hardware/eicon/divasfunc.c b/drivers/isdn/hardware/eicon/divasfunc.c
+index 0bbee78..a0d0a01 100644
+--- a/drivers/isdn/hardware/eicon/divasfunc.c
++++ b/drivers/isdn/hardware/eicon/divasfunc.c
+@@ -160,6 +160,8 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
        IDI_SYNC_REQ req;
        DESCRIPTOR DIDD_Table[MAX_DESCRIPTORS];
  
@@ -29169,9 +30846,10 @@ diff -urNp linux-3.1.3/drivers/isdn/hardware/eicon/divasfunc.c linux-3.1.3/drive
        DIVA_DIDD_Read(DIDD_Table, sizeof(DIDD_Table));
  
        for (x = 0; x < MAX_DESCRIPTORS; x++) {
-diff -urNp linux-3.1.3/drivers/isdn/hardware/eicon/divasync.h linux-3.1.3/drivers/isdn/hardware/eicon/divasync.h
---- linux-3.1.3/drivers/isdn/hardware/eicon/divasync.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/isdn/hardware/eicon/divasync.h 2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/isdn/hardware/eicon/divasync.h b/drivers/isdn/hardware/eicon/divasync.h
+index 85784a7..a19ca98 100644
+--- a/drivers/isdn/hardware/eicon/divasync.h
++++ b/drivers/isdn/hardware/eicon/divasync.h
 @@ -146,7 +146,7 @@ typedef struct _diva_didd_add_adapter {
  } diva_didd_add_adapter_t;
  typedef struct _diva_didd_remove_adapter {
@@ -29181,10 +30859,11 @@ diff -urNp linux-3.1.3/drivers/isdn/hardware/eicon/divasync.h linux-3.1.3/driver
  typedef struct _diva_didd_read_adapter_array {
   void   * buffer;
   dword length;
-diff -urNp linux-3.1.3/drivers/isdn/hardware/eicon/idifunc.c linux-3.1.3/drivers/isdn/hardware/eicon/idifunc.c
---- linux-3.1.3/drivers/isdn/hardware/eicon/idifunc.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/isdn/hardware/eicon/idifunc.c  2011-11-16 18:40:10.000000000 -0500
-@@ -188,6 +188,8 @@ static int DIVA_INIT_FUNCTION connect_di
+diff --git a/drivers/isdn/hardware/eicon/idifunc.c b/drivers/isdn/hardware/eicon/idifunc.c
+index db87d51..7d09acf 100644
+--- a/drivers/isdn/hardware/eicon/idifunc.c
++++ b/drivers/isdn/hardware/eicon/idifunc.c
+@@ -188,6 +188,8 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
        IDI_SYNC_REQ req;
        DESCRIPTOR DIDD_Table[MAX_DESCRIPTORS];
  
@@ -29193,9 +30872,10 @@ diff -urNp linux-3.1.3/drivers/isdn/hardware/eicon/idifunc.c linux-3.1.3/drivers
        DIVA_DIDD_Read(DIDD_Table, sizeof(DIDD_Table));
  
        for (x = 0; x < MAX_DESCRIPTORS; x++) {
-diff -urNp linux-3.1.3/drivers/isdn/hardware/eicon/message.c linux-3.1.3/drivers/isdn/hardware/eicon/message.c
---- linux-3.1.3/drivers/isdn/hardware/eicon/message.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/isdn/hardware/eicon/message.c  2011-11-16 18:40:10.000000000 -0500
+diff --git a/drivers/isdn/hardware/eicon/message.c b/drivers/isdn/hardware/eicon/message.c
+index a339598..b6a8bfc 100644
+--- a/drivers/isdn/hardware/eicon/message.c
++++ b/drivers/isdn/hardware/eicon/message.c
 @@ -4886,6 +4886,8 @@ static void sig_ind(PLCI *plci)
    dword d;
    word w;
@@ -29205,7 +30885,7 @@ diff -urNp linux-3.1.3/drivers/isdn/hardware/eicon/message.c linux-3.1.3/drivers
    a = plci->adapter;
    Id = ((word)plci->Id<<8)|a->Id;
    PUT_WORD(&SS_Ind[4],0x0000);
-@@ -7480,6 +7482,8 @@ static word add_b1(PLCI *plci, API_PARSE
+@@ -7480,6 +7482,8 @@ static word add_b1(PLCI *plci, API_PARSE *bp, word b_channel_info,
    word j, n, w;
    dword d;
  
@@ -29214,7 +30894,7 @@ diff -urNp linux-3.1.3/drivers/isdn/hardware/eicon/message.c linux-3.1.3/drivers
  
    for(i=0;i<8;i++) bp_parms[i].length = 0;
    for(i=0;i<2;i++) global_config[i].length = 0;
-@@ -7954,6 +7958,8 @@ static word add_b23(PLCI *plci, API_PARS
+@@ -7954,6 +7958,8 @@ static word add_b23(PLCI *plci, API_PARSE *bp)
    const byte llc3[] = {4,3,2,2,6,6,0};
    const byte header[] = {0,2,3,3,0,0,0};
  
@@ -29223,7 +30903,7 @@ diff -urNp linux-3.1.3/drivers/isdn/hardware/eicon/message.c linux-3.1.3/drivers
    for(i=0;i<8;i++) bp_parms[i].length = 0;
    for(i=0;i<6;i++) b2_config_parms[i].length = 0;
    for(i=0;i<5;i++) b3_config_parms[i].length = 0;
-@@ -14741,6 +14747,8 @@ static void group_optimization(DIVA_CAPI
+@@ -14741,6 +14747,8 @@ static void group_optimization(DIVA_CAPI_ADAPTER   * a, PLCI   * plci)
    word appl_number_group_type[MAX_APPL];
    PLCI   *auxplci;
  
@@ -29232,10 +30912,11 @@ diff -urNp linux-3.1.3/drivers/isdn/hardware/eicon/message.c linux-3.1.3/drivers
    set_group_ind_mask (plci); /* all APPLs within this inc. call are allowed to dial in */
  
    if(!a->group_optimization_enabled)
-diff -urNp linux-3.1.3/drivers/isdn/hardware/eicon/mntfunc.c linux-3.1.3/drivers/isdn/hardware/eicon/mntfunc.c
---- linux-3.1.3/drivers/isdn/hardware/eicon/mntfunc.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/isdn/hardware/eicon/mntfunc.c  2011-11-16 18:40:10.000000000 -0500
-@@ -79,6 +79,8 @@ static int DIVA_INIT_FUNCTION connect_di
+diff --git a/drivers/isdn/hardware/eicon/mntfunc.c b/drivers/isdn/hardware/eicon/mntfunc.c
+index a564b75..f3cf8b5 100644
+--- a/drivers/isdn/hardware/eicon/mntfunc.c
++++ b/drivers/isdn/hardware/eicon/mntfunc.c
+@@ -79,6 +79,8 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
        IDI_SYNC_REQ req;
        DESCRIPTOR DIDD_Table[MAX_DESCRIPTORS];
  
@@ -29244,9 +30925,10 @@ diff -urNp linux-3.1.3/drivers/isdn/hardware/eicon/mntfunc.c linux-3.1.3/drivers
        DIVA_DIDD_Read(DIDD_Table, sizeof(DIDD_Table));
  
        for (x = 0; x < MAX_DESCRIPTORS; x++) {
-diff -urNp linux-3.1.3/drivers/isdn/hardware/eicon/xdi_adapter.h linux-3.1.3/drivers/isdn/hardware/eicon/xdi_adapter.h
---- linux-3.1.3/drivers/isdn/hardware/eicon/xdi_adapter.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/isdn/hardware/eicon/xdi_adapter.h      2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/isdn/hardware/eicon/xdi_adapter.h b/drivers/isdn/hardware/eicon/xdi_adapter.h
+index a3bd163..8956575 100644
+--- a/drivers/isdn/hardware/eicon/xdi_adapter.h
++++ b/drivers/isdn/hardware/eicon/xdi_adapter.h
 @@ -44,7 +44,7 @@ typedef struct _xdi_mbox_t {
  typedef struct _diva_os_idi_adapter_interface {
        diva_init_card_proc_t cleanup_adapter_proc;
@@ -29256,10 +30938,11 @@ diff -urNp linux-3.1.3/drivers/isdn/hardware/eicon/xdi_adapter.h linux-3.1.3/dri
  
  typedef struct _diva_os_xdi_adapter {
        struct list_head link;
-diff -urNp linux-3.1.3/drivers/isdn/i4l/isdn_common.c linux-3.1.3/drivers/isdn/i4l/isdn_common.c
---- linux-3.1.3/drivers/isdn/i4l/isdn_common.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/isdn/i4l/isdn_common.c 2011-11-16 18:40:10.000000000 -0500
-@@ -1286,6 +1286,8 @@ isdn_ioctl(struct file *file, uint cmd, 
+diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
+index 6ed82ad..b05ac05 100644
+--- a/drivers/isdn/i4l/isdn_common.c
++++ b/drivers/isdn/i4l/isdn_common.c
+@@ -1286,6 +1286,8 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg)
        } iocpar;
        void __user *argp = (void __user *)arg;
  
@@ -29268,10 +30951,11 @@ diff -urNp linux-3.1.3/drivers/isdn/i4l/isdn_common.c linux-3.1.3/drivers/isdn/i
  #define name  iocpar.name
  #define bname iocpar.bname
  #define iocts iocpar.iocts
-diff -urNp linux-3.1.3/drivers/isdn/icn/icn.c linux-3.1.3/drivers/isdn/icn/icn.c
---- linux-3.1.3/drivers/isdn/icn/icn.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/isdn/icn/icn.c 2011-11-16 18:39:07.000000000 -0500
-@@ -1045,7 +1045,7 @@ icn_writecmd(const u_char * buf, int len
+diff --git a/drivers/isdn/icn/icn.c b/drivers/isdn/icn/icn.c
+index 1f355bb..43f1fea 100644
+--- a/drivers/isdn/icn/icn.c
++++ b/drivers/isdn/icn/icn.c
+@@ -1045,7 +1045,7 @@ icn_writecmd(const u_char * buf, int len, int user, icn_card * card)
                if (count > len)
                        count = len;
                if (user) {
@@ -29280,9 +30964,10 @@ diff -urNp linux-3.1.3/drivers/isdn/icn/icn.c linux-3.1.3/drivers/isdn/icn/icn.c
                                return -EFAULT;
                } else
                        memcpy(msg, buf, count);
-diff -urNp linux-3.1.3/drivers/lguest/core.c linux-3.1.3/drivers/lguest/core.c
---- linux-3.1.3/drivers/lguest/core.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/lguest/core.c  2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/lguest/core.c b/drivers/lguest/core.c
+index 2535933..09a8e86 100644
+--- a/drivers/lguest/core.c
++++ b/drivers/lguest/core.c
 @@ -92,9 +92,17 @@ static __init int map_switcher(void)
         * it's worked so far.  The end address needs +1 because __get_vm_area
         * allocates an extra guard page, so we need space for that.
@@ -29310,9 +30995,10 @@ diff -urNp linux-3.1.3/drivers/lguest/core.c linux-3.1.3/drivers/lguest/core.c
               end_switcher_text - start_switcher_text);
  
        printk(KERN_INFO "lguest: mapped switcher at %p\n",
-diff -urNp linux-3.1.3/drivers/lguest/x86/core.c linux-3.1.3/drivers/lguest/x86/core.c
---- linux-3.1.3/drivers/lguest/x86/core.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/lguest/x86/core.c      2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/lguest/x86/core.c b/drivers/lguest/x86/core.c
+index 65af42f..530c87a 100644
+--- a/drivers/lguest/x86/core.c
++++ b/drivers/lguest/x86/core.c
 @@ -59,7 +59,7 @@ static struct {
  /* Offset from where switcher.S was compiled to where we've copied it */
  static unsigned long switcher_offset(void)
@@ -29322,7 +31008,7 @@ diff -urNp linux-3.1.3/drivers/lguest/x86/core.c linux-3.1.3/drivers/lguest/x86/
  }
  
  /* This cpu's struct lguest_pages. */
-@@ -100,7 +100,13 @@ static void copy_in_guest_info(struct lg
+@@ -100,7 +100,13 @@ static void copy_in_guest_info(struct lg_cpu *cpu, struct lguest_pages *pages)
         * These copies are pretty cheap, so we do them unconditionally: */
        /* Save the current Host top-level page directory.
         */
@@ -29354,9 +31040,10 @@ diff -urNp linux-3.1.3/drivers/lguest/x86/core.c linux-3.1.3/drivers/lguest/x86/
        lguest_entry.segment = LGUEST_CS;
  
        /*
-diff -urNp linux-3.1.3/drivers/lguest/x86/switcher_32.S linux-3.1.3/drivers/lguest/x86/switcher_32.S
---- linux-3.1.3/drivers/lguest/x86/switcher_32.S       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/lguest/x86/switcher_32.S       2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/lguest/x86/switcher_32.S b/drivers/lguest/x86/switcher_32.S
+index 40634b0..4f5855e 100644
+--- a/drivers/lguest/x86/switcher_32.S
++++ b/drivers/lguest/x86/switcher_32.S
 @@ -87,6 +87,7 @@
  #include <asm/page.h>
  #include <asm/segment.h>
@@ -29415,10 +31102,11 @@ diff -urNp linux-3.1.3/drivers/lguest/x86/switcher_32.S linux-3.1.3/drivers/lgue
  
  // Every interrupt can come to us here
  // But we must truly tell each apart.
-diff -urNp linux-3.1.3/drivers/macintosh/macio_asic.c linux-3.1.3/drivers/macintosh/macio_asic.c
---- linux-3.1.3/drivers/macintosh/macio_asic.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/macintosh/macio_asic.c 2011-11-16 18:39:07.000000000 -0500
-@@ -748,7 +748,7 @@ static void __devexit macio_pci_remove(s
+diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c
+index 4daf9e5..b8d1d0f 100644
+--- a/drivers/macintosh/macio_asic.c
++++ b/drivers/macintosh/macio_asic.c
+@@ -748,7 +748,7 @@ static void __devexit macio_pci_remove(struct pci_dev* pdev)
   * MacIO is matched against any Apple ID, it's probe() function
   * will then decide wether it applies or not
   */
@@ -29427,67 +31115,11 @@ diff -urNp linux-3.1.3/drivers/macintosh/macio_asic.c linux-3.1.3/drivers/macint
        .vendor         = PCI_VENDOR_ID_APPLE,
        .device         = PCI_ANY_ID,
        .subvendor      = PCI_ANY_ID,
-diff -urNp linux-3.1.3/drivers/md/dm.c linux-3.1.3/drivers/md/dm.c
---- linux-3.1.3/drivers/md/dm.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/md/dm.c        2011-11-16 18:39:07.000000000 -0500
-@@ -165,9 +165,9 @@ struct mapped_device {
-       /*
-        * Event handling.
-        */
--      atomic_t event_nr;
-+      atomic_unchecked_t event_nr;
-       wait_queue_head_t eventq;
--      atomic_t uevent_seq;
-+      atomic_unchecked_t uevent_seq;
-       struct list_head uevent_list;
-       spinlock_t uevent_lock; /* Protect access to uevent_list */
-@@ -1843,8 +1843,8 @@ static struct mapped_device *alloc_dev(i
-       rwlock_init(&md->map_lock);
-       atomic_set(&md->holders, 1);
-       atomic_set(&md->open_count, 0);
--      atomic_set(&md->event_nr, 0);
--      atomic_set(&md->uevent_seq, 0);
-+      atomic_set_unchecked(&md->event_nr, 0);
-+      atomic_set_unchecked(&md->uevent_seq, 0);
-       INIT_LIST_HEAD(&md->uevent_list);
-       spin_lock_init(&md->uevent_lock);
-@@ -1978,7 +1978,7 @@ static void event_callback(void *context
-       dm_send_uevents(&uevents, &disk_to_dev(md->disk)->kobj);
--      atomic_inc(&md->event_nr);
-+      atomic_inc_unchecked(&md->event_nr);
-       wake_up(&md->eventq);
- }
-@@ -2614,18 +2614,18 @@ int dm_kobject_uevent(struct mapped_devi
- uint32_t dm_next_uevent_seq(struct mapped_device *md)
- {
--      return atomic_add_return(1, &md->uevent_seq);
-+      return atomic_add_return_unchecked(1, &md->uevent_seq);
- }
- uint32_t dm_get_event_nr(struct mapped_device *md)
- {
--      return atomic_read(&md->event_nr);
-+      return atomic_read_unchecked(&md->event_nr);
- }
- int dm_wait_event(struct mapped_device *md, int event_nr)
- {
-       return wait_event_interruptible(md->eventq,
--                      (event_nr != atomic_read(&md->event_nr)));
-+                      (event_nr != atomic_read_unchecked(&md->event_nr)));
- }
- void dm_uevent_add(struct mapped_device *md, struct list_head *elist)
-diff -urNp linux-3.1.3/drivers/md/dm-ioctl.c linux-3.1.3/drivers/md/dm-ioctl.c
---- linux-3.1.3/drivers/md/dm-ioctl.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/md/dm-ioctl.c  2011-11-16 18:39:07.000000000 -0500
-@@ -1578,7 +1578,7 @@ static int validate_params(uint cmd, str
+diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
+index 2e9a3ca..c2fb229 100644
+--- a/drivers/md/dm-ioctl.c
++++ b/drivers/md/dm-ioctl.c
+@@ -1578,7 +1578,7 @@ static int validate_params(uint cmd, struct dm_ioctl *param)
            cmd == DM_LIST_VERSIONS_CMD)
                return 0;
  
@@ -29496,9 +31128,10 @@ diff -urNp linux-3.1.3/drivers/md/dm-ioctl.c linux-3.1.3/drivers/md/dm-ioctl.c
                if (!*param->name) {
                        DMWARN("name not supplied when creating device");
                        return -EINVAL;
-diff -urNp linux-3.1.3/drivers/md/dm-raid1.c linux-3.1.3/drivers/md/dm-raid1.c
---- linux-3.1.3/drivers/md/dm-raid1.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/md/dm-raid1.c  2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c
+index 9bfd057..01180bc 100644
+--- a/drivers/md/dm-raid1.c
++++ b/drivers/md/dm-raid1.c
 @@ -40,7 +40,7 @@ enum dm_raid1_error {
  
  struct mirror {
@@ -29508,7 +31141,7 @@ diff -urNp linux-3.1.3/drivers/md/dm-raid1.c linux-3.1.3/drivers/md/dm-raid1.c
        unsigned long error_type;
        struct dm_dev *dev;
        sector_t offset;
-@@ -185,7 +185,7 @@ static struct mirror *get_valid_mirror(s
+@@ -185,7 +185,7 @@ static struct mirror *get_valid_mirror(struct mirror_set *ms)
        struct mirror *m;
  
        for (m = ms->mirror; m < ms->mirror + ms->nr_mirrors; m++)
@@ -29517,7 +31150,7 @@ diff -urNp linux-3.1.3/drivers/md/dm-raid1.c linux-3.1.3/drivers/md/dm-raid1.c
                        return m;
  
        return NULL;
-@@ -217,7 +217,7 @@ static void fail_mirror(struct mirror *m
+@@ -217,7 +217,7 @@ static void fail_mirror(struct mirror *m, enum dm_raid1_error error_type)
         * simple way to tell if a device has encountered
         * errors.
         */
@@ -29526,7 +31159,7 @@ diff -urNp linux-3.1.3/drivers/md/dm-raid1.c linux-3.1.3/drivers/md/dm-raid1.c
  
        if (test_and_set_bit(error_type, &m->error_type))
                return;
-@@ -408,7 +408,7 @@ static struct mirror *choose_mirror(stru
+@@ -408,7 +408,7 @@ static struct mirror *choose_mirror(struct mirror_set *ms, sector_t sector)
        struct mirror *m = get_default_mirror(ms);
  
        do {
@@ -29544,7 +31177,7 @@ diff -urNp linux-3.1.3/drivers/md/dm-raid1.c linux-3.1.3/drivers/md/dm-raid1.c
  }
  
  static int mirror_available(struct mirror_set *ms, struct bio *bio)
-@@ -559,7 +559,7 @@ static void do_reads(struct mirror_set *
+@@ -559,7 +559,7 @@ static void do_reads(struct mirror_set *ms, struct bio_list *reads)
                 */
                if (likely(region_in_sync(ms, region, 1)))
                        m = choose_mirror(ms, bio->bi_sector);
@@ -29553,7 +31186,7 @@ diff -urNp linux-3.1.3/drivers/md/dm-raid1.c linux-3.1.3/drivers/md/dm-raid1.c
                        m = NULL;
  
                if (likely(m))
-@@ -937,7 +937,7 @@ static int get_mirror(struct mirror_set 
+@@ -937,7 +937,7 @@ static int get_mirror(struct mirror_set *ms, struct dm_target *ti,
        }
  
        ms->mirror[mirror].ms = ms;
@@ -29562,7 +31195,7 @@ diff -urNp linux-3.1.3/drivers/md/dm-raid1.c linux-3.1.3/drivers/md/dm-raid1.c
        ms->mirror[mirror].error_type = 0;
        ms->mirror[mirror].offset = offset;
  
-@@ -1347,7 +1347,7 @@ static void mirror_resume(struct dm_targ
+@@ -1347,7 +1347,7 @@ static void mirror_resume(struct dm_target *ti)
   */
  static char device_status_char(struct mirror *m)
  {
@@ -29571,9 +31204,10 @@ diff -urNp linux-3.1.3/drivers/md/dm-raid1.c linux-3.1.3/drivers/md/dm-raid1.c
                return 'A';
  
        return (test_bit(DM_RAID1_FLUSH_ERROR, &(m->error_type))) ? 'F' :
-diff -urNp linux-3.1.3/drivers/md/dm-stripe.c linux-3.1.3/drivers/md/dm-stripe.c
---- linux-3.1.3/drivers/md/dm-stripe.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/md/dm-stripe.c 2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c
+index 3d80cf0..b77cc47 100644
+--- a/drivers/md/dm-stripe.c
++++ b/drivers/md/dm-stripe.c
 @@ -20,7 +20,7 @@ struct stripe {
        struct dm_dev *dev;
        sector_t physical_start;
@@ -29583,7 +31217,7 @@ diff -urNp linux-3.1.3/drivers/md/dm-stripe.c linux-3.1.3/drivers/md/dm-stripe.c
  };
  
  struct stripe_c {
-@@ -192,7 +192,7 @@ static int stripe_ctr(struct dm_target *
+@@ -192,7 +192,7 @@ static int stripe_ctr(struct dm_target *ti, unsigned int argc, char **argv)
                        kfree(sc);
                        return r;
                }
@@ -29592,7 +31226,7 @@ diff -urNp linux-3.1.3/drivers/md/dm-stripe.c linux-3.1.3/drivers/md/dm-stripe.c
        }
  
        ti->private = sc;
-@@ -314,7 +314,7 @@ static int stripe_status(struct dm_targe
+@@ -314,7 +314,7 @@ static int stripe_status(struct dm_target *ti,
                DMEMIT("%d ", sc->stripes);
                for (i = 0; i < sc->stripes; i++)  {
                        DMEMIT("%s ", sc->stripe[i].dev->name);
@@ -29601,7 +31235,7 @@ diff -urNp linux-3.1.3/drivers/md/dm-stripe.c linux-3.1.3/drivers/md/dm-stripe.c
                                'D' : 'A';
                }
                buffer[i] = '\0';
-@@ -361,8 +361,8 @@ static int stripe_end_io(struct dm_targe
+@@ -361,8 +361,8 @@ static int stripe_end_io(struct dm_target *ti, struct bio *bio,
         */
        for (i = 0; i < sc->stripes; i++)
                if (!strcmp(sc->stripe[i].dev->name, major_minor)) {
@@ -29612,10 +31246,11 @@ diff -urNp linux-3.1.3/drivers/md/dm-stripe.c linux-3.1.3/drivers/md/dm-stripe.c
                            DM_IO_ERROR_THRESHOLD)
                                schedule_work(&sc->trigger_event);
                }
-diff -urNp linux-3.1.3/drivers/md/dm-table.c linux-3.1.3/drivers/md/dm-table.c
---- linux-3.1.3/drivers/md/dm-table.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/md/dm-table.c  2011-11-16 18:39:07.000000000 -0500
-@@ -389,7 +389,7 @@ static int device_area_is_invalid(struct
+diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
+index bc04518..7a83b81 100644
+--- a/drivers/md/dm-table.c
++++ b/drivers/md/dm-table.c
+@@ -389,7 +389,7 @@ static int device_area_is_invalid(struct dm_target *ti, struct dm_dev *dev,
        if (!dev_size)
                return 0;
  
@@ -29624,9 +31259,68 @@ diff -urNp linux-3.1.3/drivers/md/dm-table.c linux-3.1.3/drivers/md/dm-table.c
                DMWARN("%s: %s too small for target: "
                       "start=%llu, len=%llu, dev_size=%llu",
                       dm_device_name(ti->table->md), bdevname(bdev, b),
-diff -urNp linux-3.1.3/drivers/md/md.c linux-3.1.3/drivers/md/md.c
---- linux-3.1.3/drivers/md/md.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/md/md.c        2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/md/dm.c b/drivers/md/dm.c
+index 52b39f3..83a8b6b 100644
+--- a/drivers/md/dm.c
++++ b/drivers/md/dm.c
+@@ -165,9 +165,9 @@ struct mapped_device {
+       /*
+        * Event handling.
+        */
+-      atomic_t event_nr;
++      atomic_unchecked_t event_nr;
+       wait_queue_head_t eventq;
+-      atomic_t uevent_seq;
++      atomic_unchecked_t uevent_seq;
+       struct list_head uevent_list;
+       spinlock_t uevent_lock; /* Protect access to uevent_list */
+@@ -1843,8 +1843,8 @@ static struct mapped_device *alloc_dev(int minor)
+       rwlock_init(&md->map_lock);
+       atomic_set(&md->holders, 1);
+       atomic_set(&md->open_count, 0);
+-      atomic_set(&md->event_nr, 0);
+-      atomic_set(&md->uevent_seq, 0);
++      atomic_set_unchecked(&md->event_nr, 0);
++      atomic_set_unchecked(&md->uevent_seq, 0);
+       INIT_LIST_HEAD(&md->uevent_list);
+       spin_lock_init(&md->uevent_lock);
+@@ -1978,7 +1978,7 @@ static void event_callback(void *context)
+       dm_send_uevents(&uevents, &disk_to_dev(md->disk)->kobj);
+-      atomic_inc(&md->event_nr);
++      atomic_inc_unchecked(&md->event_nr);
+       wake_up(&md->eventq);
+ }
+@@ -2614,18 +2614,18 @@ int dm_kobject_uevent(struct mapped_device *md, enum kobject_action action,
+ uint32_t dm_next_uevent_seq(struct mapped_device *md)
+ {
+-      return atomic_add_return(1, &md->uevent_seq);
++      return atomic_add_return_unchecked(1, &md->uevent_seq);
+ }
+ uint32_t dm_get_event_nr(struct mapped_device *md)
+ {
+-      return atomic_read(&md->event_nr);
++      return atomic_read_unchecked(&md->event_nr);
+ }
+ int dm_wait_event(struct mapped_device *md, int event_nr)
+ {
+       return wait_event_interruptible(md->eventq,
+-                      (event_nr != atomic_read(&md->event_nr)));
++                      (event_nr != atomic_read_unchecked(&md->event_nr)));
+ }
+ void dm_uevent_add(struct mapped_device *md, struct list_head *elist)
+diff --git a/drivers/md/md.c b/drivers/md/md.c
+index 5c95ccb..217fa57 100644
+--- a/drivers/md/md.c
++++ b/drivers/md/md.c
 @@ -280,10 +280,10 @@ EXPORT_SYMBOL_GPL(md_trim_bio);
   *  start build, activate spare
   */
@@ -29649,7 +31343,7 @@ diff -urNp linux-3.1.3/drivers/md/md.c linux-3.1.3/drivers/md/md.c
        wake_up(&md_event_waiters);
  }
  
-@@ -1531,7 +1531,7 @@ static int super_1_load(mdk_rdev_t *rdev
+@@ -1531,7 +1531,7 @@ static int super_1_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version)
  
        rdev->preferred_minor = 0xffff;
        rdev->data_offset = le64_to_cpu(sb->data_offset);
@@ -29658,7 +31352,7 @@ diff -urNp linux-3.1.3/drivers/md/md.c linux-3.1.3/drivers/md/md.c
  
        rdev->sb_size = le32_to_cpu(sb->max_dev) * 2 + 256;
        bmask = queue_logical_block_size(rdev->bdev->bd_disk->queue)-1;
-@@ -1748,7 +1748,7 @@ static void super_1_sync(mddev_t *mddev,
+@@ -1748,7 +1748,7 @@ static void super_1_sync(mddev_t *mddev, mdk_rdev_t *rdev)
        else
                sb->resync_offset = cpu_to_le64(0);
  
@@ -29667,7 +31361,7 @@ diff -urNp linux-3.1.3/drivers/md/md.c linux-3.1.3/drivers/md/md.c
  
        sb->raid_disks = cpu_to_le32(mddev->raid_disks);
        sb->size = cpu_to_le64(mddev->dev_sectors);
-@@ -2643,7 +2643,7 @@ __ATTR(state, S_IRUGO|S_IWUSR, state_sho
+@@ -2643,7 +2643,7 @@ __ATTR(state, S_IRUGO|S_IWUSR, state_show, state_store);
  static ssize_t
  errors_show(mdk_rdev_t *rdev, char *page)
  {
@@ -29676,7 +31370,7 @@ diff -urNp linux-3.1.3/drivers/md/md.c linux-3.1.3/drivers/md/md.c
  }
  
  static ssize_t
-@@ -2652,7 +2652,7 @@ errors_store(mdk_rdev_t *rdev, const cha
+@@ -2652,7 +2652,7 @@ errors_store(mdk_rdev_t *rdev, const char *buf, size_t len)
        char *e;
        unsigned long n = simple_strtoul(buf, &e, 10);
        if (*buf && (*e == 0 || *e == '\n')) {
@@ -29696,7 +31390,7 @@ diff -urNp linux-3.1.3/drivers/md/md.c linux-3.1.3/drivers/md/md.c
  
        INIT_LIST_HEAD(&rdev->same_set);
        init_waitqueue_head(&rdev->blocked_wait);
-@@ -6667,7 +6667,7 @@ static int md_seq_show(struct seq_file *
+@@ -6667,7 +6667,7 @@ static int md_seq_show(struct seq_file *seq, void *v)
  
                spin_unlock(&pers_lock);
                seq_printf(seq, "\n");
@@ -29705,7 +31399,7 @@ diff -urNp linux-3.1.3/drivers/md/md.c linux-3.1.3/drivers/md/md.c
                return 0;
        }
        if (v == (void*)2) {
-@@ -6756,7 +6756,7 @@ static int md_seq_show(struct seq_file *
+@@ -6756,7 +6756,7 @@ static int md_seq_show(struct seq_file *seq, void *v)
                                chunk_kb ? "KB" : "B");
                        if (bitmap->file) {
                                seq_printf(seq, ", file: ");
@@ -29714,7 +31408,7 @@ diff -urNp linux-3.1.3/drivers/md/md.c linux-3.1.3/drivers/md/md.c
                        }
  
                        seq_printf(seq, "\n");
-@@ -6787,7 +6787,7 @@ static int md_seq_open(struct inode *ino
+@@ -6787,7 +6787,7 @@ static int md_seq_open(struct inode *inode, struct file *file)
                return error;
  
        seq = file->private_data;
@@ -29723,7 +31417,7 @@ diff -urNp linux-3.1.3/drivers/md/md.c linux-3.1.3/drivers/md/md.c
        return error;
  }
  
-@@ -6801,7 +6801,7 @@ static unsigned int mdstat_poll(struct f
+@@ -6801,7 +6801,7 @@ static unsigned int mdstat_poll(struct file *filp, poll_table *wait)
        /* always allow read */
        mask = POLLIN | POLLRDNORM;
  
@@ -29732,7 +31426,7 @@ diff -urNp linux-3.1.3/drivers/md/md.c linux-3.1.3/drivers/md/md.c
                mask |= POLLERR | POLLPRI;
        return mask;
  }
-@@ -6845,7 +6845,7 @@ static int is_mddev_idle(mddev_t *mddev,
+@@ -6845,7 +6845,7 @@ static int is_mddev_idle(mddev_t *mddev, int init)
                struct gendisk *disk = rdev->bdev->bd_contains->bd_disk;
                curr_events = (int)part_stat_read(&disk->part0, sectors[0]) +
                              (int)part_stat_read(&disk->part0, sectors[1]) -
@@ -29741,9 +31435,10 @@ diff -urNp linux-3.1.3/drivers/md/md.c linux-3.1.3/drivers/md/md.c
                /* sync IO will cause sync_io to increase before the disk_stats
                 * as sync_io is counted when a request starts, and
                 * disk_stats is counted when it completes.
-diff -urNp linux-3.1.3/drivers/md/md.h linux-3.1.3/drivers/md/md.h
---- linux-3.1.3/drivers/md/md.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/md/md.h        2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/md/md.h b/drivers/md/md.h
+index 0a309dc..7e01d7f 100644
+--- a/drivers/md/md.h
++++ b/drivers/md/md.h
 @@ -124,13 +124,13 @@ struct mdk_rdev_s
                                         * only maintained for arrays that
                                         * support hot removal
@@ -29760,7 +31455,7 @@ diff -urNp linux-3.1.3/drivers/md/md.h linux-3.1.3/drivers/md/md.h
                                           * for reporting to userspace and storing
                                           * in superblock.
                                           */
-@@ -415,7 +415,7 @@ static inline void rdev_dec_pending(mdk_
+@@ -415,7 +415,7 @@ static inline void rdev_dec_pending(mdk_rdev_t *rdev, mddev_t *mddev)
  
  static inline void md_sync_acct(struct block_device *bdev, unsigned long nr_sectors)
  {
@@ -29769,10 +31464,33 @@ diff -urNp linux-3.1.3/drivers/md/md.h linux-3.1.3/drivers/md/md.h
  }
  
  struct mdk_personality
-diff -urNp linux-3.1.3/drivers/md/raid10.c linux-3.1.3/drivers/md/raid10.c
---- linux-3.1.3/drivers/md/raid10.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/md/raid10.c    2011-11-16 18:39:07.000000000 -0500
-@@ -1423,7 +1423,7 @@ static void end_sync_read(struct bio *bi
+diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
+index d9587df..83a0dc3 100644
+--- a/drivers/md/raid1.c
++++ b/drivers/md/raid1.c
+@@ -1541,7 +1541,7 @@ static int fix_sync_read_error(r1bio_t *r1_bio)
+                       if (r1_sync_page_io(rdev, sect, s,
+                                           bio->bi_io_vec[idx].bv_page,
+                                           READ) != 0)
+-                              atomic_add(s, &rdev->corrected_errors);
++                              atomic_add_unchecked(s, &rdev->corrected_errors);
+               }
+               sectors -= s;
+               sect += s;
+@@ -1754,7 +1754,7 @@ static void fix_read_error(conf_t *conf, int read_disk,
+                           test_bit(In_sync, &rdev->flags)) {
+                               if (r1_sync_page_io(rdev, sect, s,
+                                                   conf->tmppage, READ)) {
+-                                      atomic_add(s, &rdev->corrected_errors);
++                                      atomic_add_unchecked(s, &rdev->corrected_errors);
+                                       printk(KERN_INFO
+                                              "md/raid1:%s: read error corrected "
+                                              "(%d sectors at %llu on %s)\n",
+diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
+index 1d44228..98db57d 100644
+--- a/drivers/md/raid10.c
++++ b/drivers/md/raid10.c
+@@ -1423,7 +1423,7 @@ static void end_sync_read(struct bio *bio, int error)
                /* The write handler will notice the lack of
                 * R10BIO_Uptodate and record any errors etc
                 */
@@ -29781,7 +31499,7 @@ diff -urNp linux-3.1.3/drivers/md/raid10.c linux-3.1.3/drivers/md/raid10.c
                           &conf->mirrors[d].rdev->corrected_errors);
  
        /* for reconstruct, we always reschedule after a read.
-@@ -1723,7 +1723,7 @@ static void check_decay_read_errors(mdde
+@@ -1723,7 +1723,7 @@ static void check_decay_read_errors(mddev_t *mddev, mdk_rdev_t *rdev)
  {
        struct timespec cur_time_mon;
        unsigned long hours_since_last;
@@ -29790,7 +31508,7 @@ diff -urNp linux-3.1.3/drivers/md/raid10.c linux-3.1.3/drivers/md/raid10.c
  
        ktime_get_ts(&cur_time_mon);
  
-@@ -1745,9 +1745,9 @@ static void check_decay_read_errors(mdde
+@@ -1745,9 +1745,9 @@ static void check_decay_read_errors(mddev_t *mddev, mdk_rdev_t *rdev)
         * overflowing the shift of read_errors by hours_since_last.
         */
        if (hours_since_last >= 8 * sizeof(read_errors))
@@ -29802,7 +31520,7 @@ diff -urNp linux-3.1.3/drivers/md/raid10.c linux-3.1.3/drivers/md/raid10.c
  }
  
  static int r10_sync_page_io(mdk_rdev_t *rdev, sector_t sector,
-@@ -1797,8 +1797,8 @@ static void fix_read_error(conf_t *conf,
+@@ -1797,8 +1797,8 @@ static void fix_read_error(conf_t *conf, mddev_t *mddev, r10bio_t *r10_bio)
                return;
  
        check_decay_read_errors(mddev, rdev);
@@ -29813,7 +31531,7 @@ diff -urNp linux-3.1.3/drivers/md/raid10.c linux-3.1.3/drivers/md/raid10.c
                char b[BDEVNAME_SIZE];
                bdevname(rdev->bdev, b);
  
-@@ -1806,7 +1806,7 @@ static void fix_read_error(conf_t *conf,
+@@ -1806,7 +1806,7 @@ static void fix_read_error(conf_t *conf, mddev_t *mddev, r10bio_t *r10_bio)
                       "md/raid10:%s: %s: Raid device exceeded "
                       "read_error threshold [cur %d:max %d]\n",
                       mdname(mddev), b,
@@ -29822,7 +31540,7 @@ diff -urNp linux-3.1.3/drivers/md/raid10.c linux-3.1.3/drivers/md/raid10.c
                printk(KERN_NOTICE
                       "md/raid10:%s: %s: Failing raid device\n",
                       mdname(mddev), b);
-@@ -1951,7 +1951,7 @@ static void fix_read_error(conf_t *conf,
+@@ -1951,7 +1951,7 @@ static void fix_read_error(conf_t *conf, mddev_t *mddev, r10bio_t *r10_bio)
                                       (unsigned long long)(
                                               sect + rdev->data_offset),
                                       bdevname(rdev->bdev, b));
@@ -29831,31 +31549,11 @@ diff -urNp linux-3.1.3/drivers/md/raid10.c linux-3.1.3/drivers/md/raid10.c
                        }
  
                        rdev_dec_pending(rdev, mddev);
-diff -urNp linux-3.1.3/drivers/md/raid1.c linux-3.1.3/drivers/md/raid1.c
---- linux-3.1.3/drivers/md/raid1.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/md/raid1.c     2011-11-16 18:39:07.000000000 -0500
-@@ -1541,7 +1541,7 @@ static int fix_sync_read_error(r1bio_t *
-                       if (r1_sync_page_io(rdev, sect, s,
-                                           bio->bi_io_vec[idx].bv_page,
-                                           READ) != 0)
--                              atomic_add(s, &rdev->corrected_errors);
-+                              atomic_add_unchecked(s, &rdev->corrected_errors);
-               }
-               sectors -= s;
-               sect += s;
-@@ -1754,7 +1754,7 @@ static void fix_read_error(conf_t *conf,
-                           test_bit(In_sync, &rdev->flags)) {
-                               if (r1_sync_page_io(rdev, sect, s,
-                                                   conf->tmppage, READ)) {
--                                      atomic_add(s, &rdev->corrected_errors);
-+                                      atomic_add_unchecked(s, &rdev->corrected_errors);
-                                       printk(KERN_INFO
-                                              "md/raid1:%s: read error corrected "
-                                              "(%d sectors at %llu on %s)\n",
-diff -urNp linux-3.1.3/drivers/md/raid5.c linux-3.1.3/drivers/md/raid5.c
---- linux-3.1.3/drivers/md/raid5.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/md/raid5.c     2011-11-16 18:40:10.000000000 -0500
-@@ -1616,19 +1616,19 @@ static void raid5_end_read_request(struc
+diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
+index b6200c3..02e8702 100644
+--- a/drivers/md/raid5.c
++++ b/drivers/md/raid5.c
+@@ -1616,19 +1616,19 @@ static void raid5_end_read_request(struct bio * bi, int error)
                                (unsigned long long)(sh->sector
                                                     + rdev->data_offset),
                                bdevname(rdev->bdev, b));
@@ -29879,7 +31577,7 @@ diff -urNp linux-3.1.3/drivers/md/raid5.c linux-3.1.3/drivers/md/raid5.c
                if (conf->mddev->degraded >= conf->max_degraded)
                        printk_ratelimited(
                                KERN_WARNING
-@@ -1648,7 +1648,7 @@ static void raid5_end_read_request(struc
+@@ -1648,7 +1648,7 @@ static void raid5_end_read_request(struct bio * bi, int error)
                                (unsigned long long)(sh->sector
                                                     + rdev->data_offset),
                                bdn);
@@ -29888,7 +31586,7 @@ diff -urNp linux-3.1.3/drivers/md/raid5.c linux-3.1.3/drivers/md/raid5.c
                         > conf->max_nr_stripes)
                        printk(KERN_WARNING
                               "md/raid:%s: Too many read errors, failing device %s.\n",
-@@ -1978,6 +1978,7 @@ static sector_t compute_blocknr(struct s
+@@ -1978,6 +1978,7 @@ static sector_t compute_blocknr(struct stripe_head *sh, int i, int previous)
        sector_t r_sector;
        struct stripe_head sh2;
  
@@ -29896,10 +31594,11 @@ diff -urNp linux-3.1.3/drivers/md/raid5.c linux-3.1.3/drivers/md/raid5.c
  
        chunk_offset = sector_div(new_sector, sectors_per_chunk);
        stripe = new_sector;
-diff -urNp linux-3.1.3/drivers/media/common/saa7146_hlp.c linux-3.1.3/drivers/media/common/saa7146_hlp.c
---- linux-3.1.3/drivers/media/common/saa7146_hlp.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/media/common/saa7146_hlp.c     2011-11-16 18:40:10.000000000 -0500
-@@ -353,6 +353,8 @@ static void calculate_clipping_registers
+diff --git a/drivers/media/common/saa7146_hlp.c b/drivers/media/common/saa7146_hlp.c
+index 1d1d8d2..6c6837a 100644
+--- a/drivers/media/common/saa7146_hlp.c
++++ b/drivers/media/common/saa7146_hlp.c
+@@ -353,6 +353,8 @@ static void calculate_clipping_registers_rect(struct saa7146_dev *dev, struct sa
  
        int x[32], y[32], w[32], h[32];
  
@@ -29908,9 +31607,10 @@ diff -urNp linux-3.1.3/drivers/media/common/saa7146_hlp.c linux-3.1.3/drivers/me
        /* clear out memory */
        memset(&line_list[0],  0x00, sizeof(u32)*32);
        memset(&pixel_list[0], 0x00, sizeof(u32)*32);
-diff -urNp linux-3.1.3/drivers/media/dvb/ddbridge/ddbridge-core.c linux-3.1.3/drivers/media/dvb/ddbridge/ddbridge-core.c
---- linux-3.1.3/drivers/media/dvb/ddbridge/ddbridge-core.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/media/dvb/ddbridge/ddbridge-core.c     2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/media/dvb/ddbridge/ddbridge-core.c b/drivers/media/dvb/ddbridge/ddbridge-core.c
+index 573d540..16f78f3 100644
+--- a/drivers/media/dvb/ddbridge/ddbridge-core.c
++++ b/drivers/media/dvb/ddbridge/ddbridge-core.c
 @@ -1675,7 +1675,7 @@ static struct ddb_info ddb_v6 = {
        .subvendor   = _subvend, .subdevice = _subdev, \
        .driver_data = (unsigned long)&_driverdata }
@@ -29920,10 +31620,11 @@ diff -urNp linux-3.1.3/drivers/media/dvb/ddbridge/ddbridge-core.c linux-3.1.3/dr
        DDB_ID(DDVID, 0x0002, DDVID, 0x0001, ddb_octopus),
        DDB_ID(DDVID, 0x0003, DDVID, 0x0001, ddb_octopus),
        DDB_ID(DDVID, 0x0003, DDVID, 0x0002, ddb_octopus_le),
-diff -urNp linux-3.1.3/drivers/media/dvb/dvb-core/dvb_ca_en50221.c linux-3.1.3/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
---- linux-3.1.3/drivers/media/dvb/dvb-core/dvb_ca_en50221.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/media/dvb/dvb-core/dvb_ca_en50221.c    2011-11-16 18:40:10.000000000 -0500
-@@ -590,6 +590,8 @@ static int dvb_ca_en50221_read_data(stru
+diff --git a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
+index 7ea517b..252fe54 100644
+--- a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
++++ b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
+@@ -590,6 +590,8 @@ static int dvb_ca_en50221_read_data(struct dvb_ca_private *ca, int slot, u8 * eb
        u8 buf[HOST_LINK_BUF_SIZE];
        int i;
  
@@ -29932,7 +31633,7 @@ diff -urNp linux-3.1.3/drivers/media/dvb/dvb-core/dvb_ca_en50221.c linux-3.1.3/d
        dprintk("%s\n", __func__);
  
        /* check if we have space for a link buf in the rx_buffer */
-@@ -1285,6 +1287,8 @@ static ssize_t dvb_ca_en50221_io_write(s
+@@ -1285,6 +1287,8 @@ static ssize_t dvb_ca_en50221_io_write(struct file *file,
        unsigned long timeout;
        int written;
  
@@ -29941,9 +31642,10 @@ diff -urNp linux-3.1.3/drivers/media/dvb/dvb-core/dvb_ca_en50221.c linux-3.1.3/d
        dprintk("%s\n", __func__);
  
        /* Incoming packet has a 2 byte header. hdr[0] = slot_id, hdr[1] = connection_id */
-diff -urNp linux-3.1.3/drivers/media/dvb/dvb-core/dvb_demux.h linux-3.1.3/drivers/media/dvb/dvb-core/dvb_demux.h
---- linux-3.1.3/drivers/media/dvb/dvb-core/dvb_demux.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/media/dvb/dvb-core/dvb_demux.h 2011-11-17 18:34:32.000000000 -0500
+diff --git a/drivers/media/dvb/dvb-core/dvb_demux.h b/drivers/media/dvb/dvb-core/dvb_demux.h
+index a7d876f..8c21b61 100644
+--- a/drivers/media/dvb/dvb-core/dvb_demux.h
++++ b/drivers/media/dvb/dvb-core/dvb_demux.h
 @@ -73,7 +73,7 @@ struct dvb_demux_feed {
        union {
                dmx_ts_cb ts;
@@ -29953,10 +31655,11 @@ diff -urNp linux-3.1.3/drivers/media/dvb/dvb-core/dvb_demux.h linux-3.1.3/driver
  
        struct dvb_demux *demux;
        void *priv;
-diff -urNp linux-3.1.3/drivers/media/dvb/dvb-core/dvbdev.c linux-3.1.3/drivers/media/dvb/dvb-core/dvbdev.c
---- linux-3.1.3/drivers/media/dvb/dvb-core/dvbdev.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/media/dvb/dvb-core/dvbdev.c    2011-11-16 18:39:07.000000000 -0500
-@@ -192,7 +192,7 @@ int dvb_register_device(struct dvb_adapt
+diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c
+index f732877..d38c35a 100644
+--- a/drivers/media/dvb/dvb-core/dvbdev.c
++++ b/drivers/media/dvb/dvb-core/dvbdev.c
+@@ -192,7 +192,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
                        const struct dvb_device *template, void *priv, int type)
  {
        struct dvb_device *dvbdev;
@@ -29965,10 +31668,11 @@ diff -urNp linux-3.1.3/drivers/media/dvb/dvb-core/dvbdev.c linux-3.1.3/drivers/m
        struct device *clsdev;
        int minor;
        int id;
-diff -urNp linux-3.1.3/drivers/media/dvb/dvb-usb/cxusb.c linux-3.1.3/drivers/media/dvb/dvb-usb/cxusb.c
---- linux-3.1.3/drivers/media/dvb/dvb-usb/cxusb.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/media/dvb/dvb-usb/cxusb.c      2011-11-16 18:39:07.000000000 -0500
-@@ -1059,7 +1059,7 @@ static struct dib0070_config dib7070p_di
+diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c
+index acb5fb2..2413f1d 100644
+--- a/drivers/media/dvb/dvb-usb/cxusb.c
++++ b/drivers/media/dvb/dvb-usb/cxusb.c
+@@ -1059,7 +1059,7 @@ static struct dib0070_config dib7070p_dib0070_config = {
  struct dib0700_adapter_state {
        int (*set_param_save) (struct dvb_frontend *,
                               struct dvb_frontend_parameters *);
@@ -29977,10 +31681,11 @@ diff -urNp linux-3.1.3/drivers/media/dvb/dvb-usb/cxusb.c linux-3.1.3/drivers/med
  
  static int dib7070_set_param_override(struct dvb_frontend *fe,
                                      struct dvb_frontend_parameters *fep)
-diff -urNp linux-3.1.3/drivers/media/dvb/dvb-usb/dib0700_core.c linux-3.1.3/drivers/media/dvb/dvb-usb/dib0700_core.c
---- linux-3.1.3/drivers/media/dvb/dvb-usb/dib0700_core.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/media/dvb/dvb-usb/dib0700_core.c       2011-11-16 18:40:10.000000000 -0500
-@@ -478,6 +478,8 @@ int dib0700_download_firmware(struct usb
+diff --git a/drivers/media/dvb/dvb-usb/dib0700_core.c b/drivers/media/dvb/dvb-usb/dib0700_core.c
+index a224e94..503b76a 100644
+--- a/drivers/media/dvb/dvb-usb/dib0700_core.c
++++ b/drivers/media/dvb/dvb-usb/dib0700_core.c
+@@ -478,6 +478,8 @@ int dib0700_download_firmware(struct usb_device *udev, const struct firmware *fw
        if (!buf)
                return -ENOMEM;
  
@@ -29989,9 +31694,10 @@ diff -urNp linux-3.1.3/drivers/media/dvb/dvb-usb/dib0700_core.c linux-3.1.3/driv
        while ((ret = dvb_usb_get_hexline(fw, &hx, &pos)) > 0) {
                deb_fwdata("writing to address 0x%08x (buffer: 0x%02x %02x)\n",
                                hx.addr, hx.len, hx.chk);
-diff -urNp linux-3.1.3/drivers/media/dvb/dvb-usb/dw2102.c linux-3.1.3/drivers/media/dvb/dvb-usb/dw2102.c
---- linux-3.1.3/drivers/media/dvb/dvb-usb/dw2102.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/media/dvb/dvb-usb/dw2102.c     2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/media/dvb/dvb-usb/dw2102.c b/drivers/media/dvb/dvb-usb/dw2102.c
+index 058b231..183d2b3 100644
+--- a/drivers/media/dvb/dvb-usb/dw2102.c
++++ b/drivers/media/dvb/dvb-usb/dw2102.c
 @@ -95,7 +95,7 @@ struct su3000_state {
  
  struct s6x0_state {
@@ -30001,10 +31707,11 @@ diff -urNp linux-3.1.3/drivers/media/dvb/dvb-usb/dw2102.c linux-3.1.3/drivers/me
  
  /* debug */
  static int dvb_usb_dw2102_debug;
-diff -urNp linux-3.1.3/drivers/media/dvb/dvb-usb/lmedm04.c linux-3.1.3/drivers/media/dvb/dvb-usb/lmedm04.c
---- linux-3.1.3/drivers/media/dvb/dvb-usb/lmedm04.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/media/dvb/dvb-usb/lmedm04.c    2011-11-16 18:40:10.000000000 -0500
-@@ -742,6 +742,7 @@ static int lme2510_download_firmware(str
+diff --git a/drivers/media/dvb/dvb-usb/lmedm04.c b/drivers/media/dvb/dvb-usb/lmedm04.c
+index 37b1469..28a6f6f 100644
+--- a/drivers/media/dvb/dvb-usb/lmedm04.c
++++ b/drivers/media/dvb/dvb-usb/lmedm04.c
+@@ -742,6 +742,7 @@ static int lme2510_download_firmware(struct usb_device *dev,
        usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
                        0x06, 0x80, 0x0200, 0x00, data, 0x0109, 1000);
  
@@ -30012,7 +31719,7 @@ diff -urNp linux-3.1.3/drivers/media/dvb/dvb-usb/lmedm04.c linux-3.1.3/drivers/m
  
        data[0] = 0x8a;
        len_in = 1;
-@@ -764,6 +765,8 @@ static void lme_coldreset(struct usb_dev
+@@ -764,6 +765,8 @@ static void lme_coldreset(struct usb_device *dev)
        int ret = 0, len_in;
        u8 data[512] = {0};
  
@@ -30021,9 +31728,10 @@ diff -urNp linux-3.1.3/drivers/media/dvb/dvb-usb/lmedm04.c linux-3.1.3/drivers/m
        data[0] = 0x0a;
        len_in = 1;
        info("FRM Firmware Cold Reset");
-diff -urNp linux-3.1.3/drivers/media/dvb/frontends/dib3000.h linux-3.1.3/drivers/media/dvb/frontends/dib3000.h
---- linux-3.1.3/drivers/media/dvb/frontends/dib3000.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/media/dvb/frontends/dib3000.h  2011-11-17 18:38:05.000000000 -0500
+diff --git a/drivers/media/dvb/frontends/dib3000.h b/drivers/media/dvb/frontends/dib3000.h
+index ba91735..4261d84 100644
+--- a/drivers/media/dvb/frontends/dib3000.h
++++ b/drivers/media/dvb/frontends/dib3000.h
 @@ -39,7 +39,7 @@ struct dib_fe_xfer_ops
        int (*fifo_ctrl)(struct dvb_frontend *fe, int onoff);
        int (*pid_ctrl)(struct dvb_frontend *fe, int index, int pid, int onoff);
@@ -30033,10 +31741,11 @@ diff -urNp linux-3.1.3/drivers/media/dvb/frontends/dib3000.h linux-3.1.3/drivers
  
  #if defined(CONFIG_DVB_DIB3000MB) || (defined(CONFIG_DVB_DIB3000MB_MODULE) && defined(MODULE))
  extern struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config,
-diff -urNp linux-3.1.3/drivers/media/dvb/frontends/mb86a16.c linux-3.1.3/drivers/media/dvb/frontends/mb86a16.c
---- linux-3.1.3/drivers/media/dvb/frontends/mb86a16.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/media/dvb/frontends/mb86a16.c  2011-11-16 18:40:10.000000000 -0500
-@@ -1060,6 +1060,8 @@ static int mb86a16_set_fe(struct mb86a16
+diff --git a/drivers/media/dvb/frontends/mb86a16.c b/drivers/media/dvb/frontends/mb86a16.c
+index c283112..7f367a7 100644
+--- a/drivers/media/dvb/frontends/mb86a16.c
++++ b/drivers/media/dvb/frontends/mb86a16.c
+@@ -1060,6 +1060,8 @@ static int mb86a16_set_fe(struct mb86a16_state *state)
        int ret = -1;
        int sync;
  
@@ -30045,10 +31754,11 @@ diff -urNp linux-3.1.3/drivers/media/dvb/frontends/mb86a16.c linux-3.1.3/drivers
        dprintk(verbose, MB86A16_INFO, 1, "freq=%d Mhz, symbrt=%d Ksps", state->frequency, state->srate);
  
        fcp = 3000;
-diff -urNp linux-3.1.3/drivers/media/dvb/frontends/or51211.c linux-3.1.3/drivers/media/dvb/frontends/or51211.c
---- linux-3.1.3/drivers/media/dvb/frontends/or51211.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/media/dvb/frontends/or51211.c  2011-11-16 18:40:10.000000000 -0500
-@@ -113,6 +113,8 @@ static int or51211_load_firmware (struct
+diff --git a/drivers/media/dvb/frontends/or51211.c b/drivers/media/dvb/frontends/or51211.c
+index c709ce6..b3fe620 100644
+--- a/drivers/media/dvb/frontends/or51211.c
++++ b/drivers/media/dvb/frontends/or51211.c
+@@ -113,6 +113,8 @@ static int or51211_load_firmware (struct dvb_frontend* fe,
        u8 tudata[585];
        int i;
  
@@ -30057,10 +31767,11 @@ diff -urNp linux-3.1.3/drivers/media/dvb/frontends/or51211.c linux-3.1.3/drivers
        dprintk("Firmware is %zd bytes\n",fw->size);
  
        /* Get eprom data */
-diff -urNp linux-3.1.3/drivers/media/dvb/ngene/ngene-cards.c linux-3.1.3/drivers/media/dvb/ngene/ngene-cards.c
---- linux-3.1.3/drivers/media/dvb/ngene/ngene-cards.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/media/dvb/ngene/ngene-cards.c  2011-11-16 18:39:07.000000000 -0500
-@@ -477,7 +477,7 @@ static struct ngene_info ngene_info_m780
+diff --git a/drivers/media/dvb/ngene/ngene-cards.c b/drivers/media/dvb/ngene/ngene-cards.c
+index 0564192..75b16f5 100644
+--- a/drivers/media/dvb/ngene/ngene-cards.c
++++ b/drivers/media/dvb/ngene/ngene-cards.c
+@@ -477,7 +477,7 @@ static struct ngene_info ngene_info_m780 = {
  
  /****************************************************************************/
  
@@ -30069,10 +31780,11 @@ diff -urNp linux-3.1.3/drivers/media/dvb/ngene/ngene-cards.c linux-3.1.3/drivers
        NGENE_ID(0x18c3, 0xabc3, ngene_info_cineS2),
        NGENE_ID(0x18c3, 0xabc4, ngene_info_cineS2),
        NGENE_ID(0x18c3, 0xdb01, ngene_info_satixS2),
-diff -urNp linux-3.1.3/drivers/media/radio/radio-cadet.c linux-3.1.3/drivers/media/radio/radio-cadet.c
---- linux-3.1.3/drivers/media/radio/radio-cadet.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/media/radio/radio-cadet.c      2011-11-16 18:39:07.000000000 -0500
-@@ -326,6 +326,8 @@ static ssize_t cadet_read(struct file *f
+diff --git a/drivers/media/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c
+index 16a089f..ab1667d 100644
+--- a/drivers/media/radio/radio-cadet.c
++++ b/drivers/media/radio/radio-cadet.c
+@@ -326,6 +326,8 @@ static ssize_t cadet_read(struct file *file, char __user *data, size_t count, lo
        unsigned char readbuf[RDS_BUFFER];
        int i = 0;
  
@@ -30081,9 +31793,10 @@ diff -urNp linux-3.1.3/drivers/media/radio/radio-cadet.c linux-3.1.3/drivers/med
        mutex_lock(&dev->lock);
        if (dev->rdsstat == 0) {
                dev->rdsstat = 1;
-diff -urNp linux-3.1.3/drivers/media/video/au0828/au0828.h linux-3.1.3/drivers/media/video/au0828/au0828.h
---- linux-3.1.3/drivers/media/video/au0828/au0828.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/media/video/au0828/au0828.h    2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/media/video/au0828/au0828.h b/drivers/media/video/au0828/au0828.h
+index 9cde353..8c6a1c3 100644
+--- a/drivers/media/video/au0828/au0828.h
++++ b/drivers/media/video/au0828/au0828.h
 @@ -191,7 +191,7 @@ struct au0828_dev {
  
        /* I2C */
@@ -30093,10 +31806,11 @@ diff -urNp linux-3.1.3/drivers/media/video/au0828/au0828.h linux-3.1.3/drivers/m
        struct i2c_client               i2c_client;
        u32                             i2c_rc;
  
-diff -urNp linux-3.1.3/drivers/media/video/cx18/cx18-driver.c linux-3.1.3/drivers/media/video/cx18/cx18-driver.c
---- linux-3.1.3/drivers/media/video/cx18/cx18-driver.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/media/video/cx18/cx18-driver.c 2011-11-16 18:40:10.000000000 -0500
-@@ -327,6 +327,8 @@ void cx18_read_eeprom(struct cx18 *cx, s
+diff --git a/drivers/media/video/cx18/cx18-driver.c b/drivers/media/video/cx18/cx18-driver.c
+index 9e2f870..22e3a08 100644
+--- a/drivers/media/video/cx18/cx18-driver.c
++++ b/drivers/media/video/cx18/cx18-driver.c
+@@ -327,6 +327,8 @@ void cx18_read_eeprom(struct cx18 *cx, struct tveeprom *tv)
        struct i2c_client c;
        u8 eedata[256];
  
@@ -30105,10 +31819,11 @@ diff -urNp linux-3.1.3/drivers/media/video/cx18/cx18-driver.c linux-3.1.3/driver
        memset(&c, 0, sizeof(c));
        strlcpy(c.name, "cx18 tveeprom tmp", sizeof(c.name));
        c.adapter = &cx->i2c_adap[0];
-diff -urNp linux-3.1.3/drivers/media/video/cx23885/cx23885-input.c linux-3.1.3/drivers/media/video/cx23885/cx23885-input.c
---- linux-3.1.3/drivers/media/video/cx23885/cx23885-input.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/media/video/cx23885/cx23885-input.c    2011-11-16 18:40:10.000000000 -0500
-@@ -53,6 +53,8 @@ static void cx23885_input_process_measur
+diff --git a/drivers/media/video/cx23885/cx23885-input.c b/drivers/media/video/cx23885/cx23885-input.c
+index ce765e3..f9e1b04 100644
+--- a/drivers/media/video/cx23885/cx23885-input.c
++++ b/drivers/media/video/cx23885/cx23885-input.c
+@@ -53,6 +53,8 @@ static void cx23885_input_process_measurements(struct cx23885_dev *dev,
        bool handle = false;
        struct ir_raw_event ir_core_event[64];
  
@@ -30117,10 +31832,11 @@ diff -urNp linux-3.1.3/drivers/media/video/cx23885/cx23885-input.c linux-3.1.3/d
        do {
                num = 0;
                v4l2_subdev_call(dev->sd_ir, ir, rx_read, (u8 *) ir_core_event,
-diff -urNp linux-3.1.3/drivers/media/video/cx88/cx88-alsa.c linux-3.1.3/drivers/media/video/cx88/cx88-alsa.c
---- linux-3.1.3/drivers/media/video/cx88/cx88-alsa.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/media/video/cx88/cx88-alsa.c   2011-11-16 18:39:07.000000000 -0500
-@@ -766,7 +766,7 @@ static struct snd_kcontrol_new snd_cx88_
+diff --git a/drivers/media/video/cx88/cx88-alsa.c b/drivers/media/video/cx88/cx88-alsa.c
+index 68d1240..46b32eb 100644
+--- a/drivers/media/video/cx88/cx88-alsa.c
++++ b/drivers/media/video/cx88/cx88-alsa.c
+@@ -766,7 +766,7 @@ static struct snd_kcontrol_new snd_cx88_alc_switch = {
   * Only boards with eeprom and byte 1 at eeprom=1 have it
   */
  
@@ -30129,10 +31845,11 @@ diff -urNp linux-3.1.3/drivers/media/video/cx88/cx88-alsa.c linux-3.1.3/drivers/
        {0x14f1,0x8801,PCI_ANY_ID,PCI_ANY_ID,0,0,0},
        {0x14f1,0x8811,PCI_ANY_ID,PCI_ANY_ID,0,0,0},
        {0, }
-diff -urNp linux-3.1.3/drivers/media/video/pvrusb2/pvrusb2-eeprom.c linux-3.1.3/drivers/media/video/pvrusb2/pvrusb2-eeprom.c
---- linux-3.1.3/drivers/media/video/pvrusb2/pvrusb2-eeprom.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/media/video/pvrusb2/pvrusb2-eeprom.c   2011-11-16 18:40:10.000000000 -0500
-@@ -120,6 +120,8 @@ int pvr2_eeprom_analyze(struct pvr2_hdw 
+diff --git a/drivers/media/video/pvrusb2/pvrusb2-eeprom.c b/drivers/media/video/pvrusb2/pvrusb2-eeprom.c
+index 9515f3a..c9ecb85 100644
+--- a/drivers/media/video/pvrusb2/pvrusb2-eeprom.c
++++ b/drivers/media/video/pvrusb2/pvrusb2-eeprom.c
+@@ -120,6 +120,8 @@ int pvr2_eeprom_analyze(struct pvr2_hdw *hdw)
        u8 *eeprom;
        struct tveeprom tvdata;
  
@@ -30141,9 +31858,10 @@ diff -urNp linux-3.1.3/drivers/media/video/pvrusb2/pvrusb2-eeprom.c linux-3.1.3/
        memset(&tvdata,0,sizeof(tvdata));
  
        eeprom = pvr2_eeprom_fetch(hdw);
-diff -urNp linux-3.1.3/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h linux-3.1.3/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h
---- linux-3.1.3/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h     2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h b/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h
+index 305e6aa..0143317 100644
+--- a/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h
++++ b/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h
 @@ -196,7 +196,7 @@ struct pvr2_hdw {
  
        /* I2C stuff */
@@ -30153,10 +31871,11 @@ diff -urNp linux-3.1.3/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h linux-
        pvr2_i2c_func i2c_func[PVR2_I2C_FUNC_CNT];
        int i2c_cx25840_hack_state;
        int i2c_linked;
-diff -urNp linux-3.1.3/drivers/media/video/saa7134/saa6752hs.c linux-3.1.3/drivers/media/video/saa7134/saa6752hs.c
---- linux-3.1.3/drivers/media/video/saa7134/saa6752hs.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/media/video/saa7134/saa6752hs.c        2011-11-16 18:40:10.000000000 -0500
-@@ -682,6 +682,8 @@ static int saa6752hs_init(struct v4l2_su
+diff --git a/drivers/media/video/saa7134/saa6752hs.c b/drivers/media/video/saa7134/saa6752hs.c
+index f9f29cc..5a2e330 100644
+--- a/drivers/media/video/saa7134/saa6752hs.c
++++ b/drivers/media/video/saa7134/saa6752hs.c
+@@ -682,6 +682,8 @@ static int saa6752hs_init(struct v4l2_subdev *sd, u32 leading_null_bytes)
        unsigned char localPAT[256];
        unsigned char localPMT[256];
  
@@ -30165,10 +31884,11 @@ diff -urNp linux-3.1.3/drivers/media/video/saa7134/saa6752hs.c linux-3.1.3/drive
        /* Set video format - must be done first as it resets other settings */
        set_reg8(client, 0x41, h->video_format);
  
-diff -urNp linux-3.1.3/drivers/media/video/saa7164/saa7164-cmd.c linux-3.1.3/drivers/media/video/saa7164/saa7164-cmd.c
---- linux-3.1.3/drivers/media/video/saa7164/saa7164-cmd.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/media/video/saa7164/saa7164-cmd.c      2011-11-16 18:40:10.000000000 -0500
-@@ -88,6 +88,8 @@ int saa7164_irq_dequeue(struct saa7164_d
+diff --git a/drivers/media/video/saa7164/saa7164-cmd.c b/drivers/media/video/saa7164/saa7164-cmd.c
+index 62fac7f..f29e0b9 100644
+--- a/drivers/media/video/saa7164/saa7164-cmd.c
++++ b/drivers/media/video/saa7164/saa7164-cmd.c
+@@ -88,6 +88,8 @@ int saa7164_irq_dequeue(struct saa7164_dev *dev)
        u8 tmp[512];
        dprintk(DBGLVL_CMD, "%s()\n", __func__);
  
@@ -30177,7 +31897,7 @@ diff -urNp linux-3.1.3/drivers/media/video/saa7164/saa7164-cmd.c linux-3.1.3/dri
        /* While any outstand message on the bus exists... */
        do {
  
-@@ -141,6 +143,8 @@ int saa7164_cmd_dequeue(struct saa7164_d
+@@ -141,6 +143,8 @@ int saa7164_cmd_dequeue(struct saa7164_dev *dev)
        u8 tmp[512];
        dprintk(DBGLVL_CMD, "%s()\n", __func__);
  
@@ -30186,10 +31906,11 @@ diff -urNp linux-3.1.3/drivers/media/video/saa7164/saa7164-cmd.c linux-3.1.3/dri
        while (loop) {
  
                struct tmComResInfo tRsp = { 0, 0, 0, 0, 0, 0 };
-diff -urNp linux-3.1.3/drivers/media/video/timblogiw.c linux-3.1.3/drivers/media/video/timblogiw.c
---- linux-3.1.3/drivers/media/video/timblogiw.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/media/video/timblogiw.c        2011-11-17 18:36:32.000000000 -0500
-@@ -744,7 +744,7 @@ static int timblogiw_mmap(struct file *f
+diff --git a/drivers/media/video/timblogiw.c b/drivers/media/video/timblogiw.c
+index 84cd1b6..f741e07 100644
+--- a/drivers/media/video/timblogiw.c
++++ b/drivers/media/video/timblogiw.c
+@@ -744,7 +744,7 @@ static int timblogiw_mmap(struct file *file, struct vm_area_struct *vma)
  
  /* Platform device functions */
  
@@ -30198,7 +31919,7 @@ diff -urNp linux-3.1.3/drivers/media/video/timblogiw.c linux-3.1.3/drivers/media
        .vidioc_querycap                = timblogiw_querycap,
        .vidioc_enum_fmt_vid_cap        = timblogiw_enum_fmt,
        .vidioc_g_fmt_vid_cap           = timblogiw_g_fmt,
-@@ -766,7 +766,7 @@ static __devinitconst struct v4l2_ioctl_
+@@ -766,7 +766,7 @@ static __devinitconst struct v4l2_ioctl_ops timblogiw_ioctl_ops = {
        .vidioc_enum_framesizes         = timblogiw_enum_framesizes,
  };
  
@@ -30207,10 +31928,11 @@ diff -urNp linux-3.1.3/drivers/media/video/timblogiw.c linux-3.1.3/drivers/media
        .owner          = THIS_MODULE,
        .open           = timblogiw_open,
        .release        = timblogiw_close,
-diff -urNp linux-3.1.3/drivers/media/video/usbvision/usbvision-core.c linux-3.1.3/drivers/media/video/usbvision/usbvision-core.c
---- linux-3.1.3/drivers/media/video/usbvision/usbvision-core.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/media/video/usbvision/usbvision-core.c 2011-11-16 18:40:10.000000000 -0500
-@@ -707,6 +707,8 @@ static enum parse_state usbvision_parse_
+diff --git a/drivers/media/video/usbvision/usbvision-core.c b/drivers/media/video/usbvision/usbvision-core.c
+index f344411..6ae9974 100644
+--- a/drivers/media/video/usbvision/usbvision-core.c
++++ b/drivers/media/video/usbvision/usbvision-core.c
+@@ -707,6 +707,8 @@ static enum parse_state usbvision_parse_compress(struct usb_usbvision *usbvision
        unsigned char rv, gv, bv;
        static unsigned char *Y, *U, *V;
  
@@ -30219,9 +31941,10 @@ diff -urNp linux-3.1.3/drivers/media/video/usbvision/usbvision-core.c linux-3.1.
        frame = usbvision->cur_frame;
        image_size = frame->frmwidth * frame->frmheight;
        if ((frame->v4l2_format.format == V4L2_PIX_FMT_YUV422P) ||
-diff -urNp linux-3.1.3/drivers/media/video/videobuf-dma-sg.c linux-3.1.3/drivers/media/video/videobuf-dma-sg.c
---- linux-3.1.3/drivers/media/video/videobuf-dma-sg.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/media/video/videobuf-dma-sg.c  2011-11-16 18:40:10.000000000 -0500
+diff --git a/drivers/media/video/videobuf-dma-sg.c b/drivers/media/video/videobuf-dma-sg.c
+index f300dea..04834ba 100644
+--- a/drivers/media/video/videobuf-dma-sg.c
++++ b/drivers/media/video/videobuf-dma-sg.c
 @@ -607,6 +607,8 @@ void *videobuf_sg_alloc(size_t size)
  {
        struct videobuf_queue q;
@@ -30231,10 +31954,11 @@ diff -urNp linux-3.1.3/drivers/media/video/videobuf-dma-sg.c linux-3.1.3/drivers
        /* Required to make generic handler to call __videobuf_alloc */
        q.int_ops = &sg_ops;
  
-diff -urNp linux-3.1.3/drivers/message/fusion/mptbase.c linux-3.1.3/drivers/message/fusion/mptbase.c
---- linux-3.1.3/drivers/message/fusion/mptbase.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/message/fusion/mptbase.c       2011-11-16 18:40:10.000000000 -0500
-@@ -6681,8 +6681,13 @@ static int mpt_iocinfo_proc_show(struct 
+diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
+index 7956a10..f39232f 100644
+--- a/drivers/message/fusion/mptbase.c
++++ b/drivers/message/fusion/mptbase.c
+@@ -6681,8 +6681,13 @@ static int mpt_iocinfo_proc_show(struct seq_file *m, void *v)
        seq_printf(m, "  MaxChainDepth = 0x%02x frames\n", ioc->facts.MaxChainDepth);
        seq_printf(m, "  MinBlockSize = 0x%02x bytes\n", 4*ioc->facts.BlockSize);
  
@@ -30248,10 +31972,11 @@ diff -urNp linux-3.1.3/drivers/message/fusion/mptbase.c linux-3.1.3/drivers/mess
        /*
         *  Rounding UP to nearest 4-kB boundary here...
         */
-diff -urNp linux-3.1.3/drivers/message/fusion/mptsas.c linux-3.1.3/drivers/message/fusion/mptsas.c
---- linux-3.1.3/drivers/message/fusion/mptsas.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/message/fusion/mptsas.c        2011-11-16 18:39:07.000000000 -0500
-@@ -439,6 +439,23 @@ mptsas_is_end_device(struct mptsas_devin
+diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
+index 7596aec..f7ae9aa 100644
+--- a/drivers/message/fusion/mptsas.c
++++ b/drivers/message/fusion/mptsas.c
+@@ -439,6 +439,23 @@ mptsas_is_end_device(struct mptsas_devinfo * attached)
                return 0;
  }
  
@@ -30275,7 +32000,7 @@ diff -urNp linux-3.1.3/drivers/message/fusion/mptsas.c linux-3.1.3/drivers/messa
  /* no mutex */
  static void
  mptsas_port_delete(MPT_ADAPTER *ioc, struct mptsas_portinfo_details * port_details)
-@@ -477,23 +494,6 @@ mptsas_get_rphy(struct mptsas_phyinfo *p
+@@ -477,23 +494,6 @@ mptsas_get_rphy(struct mptsas_phyinfo *phy_info)
                return NULL;
  }
  
@@ -30299,9 +32024,10 @@ diff -urNp linux-3.1.3/drivers/message/fusion/mptsas.c linux-3.1.3/drivers/messa
  static inline struct sas_port *
  mptsas_get_port(struct mptsas_phyinfo *phy_info)
  {
-diff -urNp linux-3.1.3/drivers/message/fusion/mptscsih.c linux-3.1.3/drivers/message/fusion/mptscsih.c
---- linux-3.1.3/drivers/message/fusion/mptscsih.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/message/fusion/mptscsih.c      2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
+index ce61a57..3da8862 100644
+--- a/drivers/message/fusion/mptscsih.c
++++ b/drivers/message/fusion/mptscsih.c
 @@ -1268,15 +1268,16 @@ mptscsih_info(struct Scsi_Host *SChost)
  
        h = shost_priv(SChost);
@@ -30327,10 +32053,11 @@ diff -urNp linux-3.1.3/drivers/message/fusion/mptscsih.c linux-3.1.3/drivers/mes
  
        return h->info_kbuf;
  }
-diff -urNp linux-3.1.3/drivers/message/i2o/i2o_config.c linux-3.1.3/drivers/message/i2o/i2o_config.c
---- linux-3.1.3/drivers/message/i2o/i2o_config.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/message/i2o/i2o_config.c       2011-11-16 18:40:10.000000000 -0500
-@@ -781,6 +781,8 @@ static int i2o_cfg_passthru(unsigned lon
+diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c
+index 098de2b..fbb922c 100644
+--- a/drivers/message/i2o/i2o_config.c
++++ b/drivers/message/i2o/i2o_config.c
+@@ -781,6 +781,8 @@ static int i2o_cfg_passthru(unsigned long arg)
        struct i2o_message *msg;
        unsigned int iop;
  
@@ -30339,9 +32066,10 @@ diff -urNp linux-3.1.3/drivers/message/i2o/i2o_config.c linux-3.1.3/drivers/mess
        if (get_user(iop, &cmd->iop) || get_user(user_msg, &cmd->msg))
                return -EFAULT;
  
-diff -urNp linux-3.1.3/drivers/message/i2o/i2o_proc.c linux-3.1.3/drivers/message/i2o/i2o_proc.c
---- linux-3.1.3/drivers/message/i2o/i2o_proc.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/message/i2o/i2o_proc.c 2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/message/i2o/i2o_proc.c b/drivers/message/i2o/i2o_proc.c
+index 07dbeaf..5533142 100644
+--- a/drivers/message/i2o/i2o_proc.c
++++ b/drivers/message/i2o/i2o_proc.c
 @@ -255,13 +255,6 @@ static char *scsi_devices[] = {
        "Array Controller Device"
  };
@@ -30356,7 +32084,7 @@ diff -urNp linux-3.1.3/drivers/message/i2o/i2o_proc.c linux-3.1.3/drivers/messag
  static int i2o_report_query_status(struct seq_file *seq, int block_status,
                                   char *group)
  {
-@@ -838,8 +831,7 @@ static int i2o_seq_show_ddm_table(struct
+@@ -838,8 +831,7 @@ static int i2o_seq_show_ddm_table(struct seq_file *seq, void *v)
  
                seq_printf(seq, "%-#7x", ddm_table.i2o_vendor_id);
                seq_printf(seq, "%-#8x", ddm_table.module_id);
@@ -30366,7 +32094,7 @@ diff -urNp linux-3.1.3/drivers/message/i2o/i2o_proc.c linux-3.1.3/drivers/messag
                seq_printf(seq, "%9d  ", ddm_table.data_size);
                seq_printf(seq, "%8d", ddm_table.code_size);
  
-@@ -940,8 +932,8 @@ static int i2o_seq_show_drivers_stored(s
+@@ -940,8 +932,8 @@ static int i2o_seq_show_drivers_stored(struct seq_file *seq, void *v)
  
                seq_printf(seq, "%-#7x", dst->i2o_vendor_id);
                seq_printf(seq, "%-#8x", dst->module_id);
@@ -30377,7 +32105,7 @@ diff -urNp linux-3.1.3/drivers/message/i2o/i2o_proc.c linux-3.1.3/drivers/messag
                seq_printf(seq, "%8d ", dst->module_size);
                seq_printf(seq, "%8d ", dst->mpb_size);
                seq_printf(seq, "0x%04x", dst->module_flags);
-@@ -1272,14 +1264,10 @@ static int i2o_seq_show_dev_identity(str
+@@ -1272,14 +1264,10 @@ static int i2o_seq_show_dev_identity(struct seq_file *seq, void *v)
        seq_printf(seq, "Device Class  : %s\n", i2o_get_class_name(work16[0]));
        seq_printf(seq, "Owner TID     : %0#5x\n", work16[2]);
        seq_printf(seq, "Parent TID    : %0#5x\n", work16[3]);
@@ -30396,7 +32124,7 @@ diff -urNp linux-3.1.3/drivers/message/i2o/i2o_proc.c linux-3.1.3/drivers/messag
  
        seq_printf(seq, "Serial number : ");
        print_serial_number(seq, (u8 *) (work32 + 16),
-@@ -1324,10 +1312,8 @@ static int i2o_seq_show_ddm_identity(str
+@@ -1324,10 +1312,8 @@ static int i2o_seq_show_ddm_identity(struct seq_file *seq, void *v)
        }
  
        seq_printf(seq, "Registering DDM TID : 0x%03x\n", result.ddm_tid);
@@ -30409,7 +32137,7 @@ diff -urNp linux-3.1.3/drivers/message/i2o/i2o_proc.c linux-3.1.3/drivers/messag
  
        seq_printf(seq, "Serial number       : ");
        print_serial_number(seq, result.serial_number, sizeof(result) - 36);
-@@ -1358,14 +1344,10 @@ static int i2o_seq_show_uinfo(struct seq
+@@ -1358,14 +1344,10 @@ static int i2o_seq_show_uinfo(struct seq_file *seq, void *v)
                return 0;
        }
  
@@ -30428,10 +32156,11 @@ diff -urNp linux-3.1.3/drivers/message/i2o/i2o_proc.c linux-3.1.3/drivers/messag
  
        return 0;
  }
-diff -urNp linux-3.1.3/drivers/message/i2o/iop.c linux-3.1.3/drivers/message/i2o/iop.c
---- linux-3.1.3/drivers/message/i2o/iop.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/message/i2o/iop.c      2011-11-16 18:39:07.000000000 -0500
-@@ -111,10 +111,10 @@ u32 i2o_cntxt_list_add(struct i2o_contro
+diff --git a/drivers/message/i2o/iop.c b/drivers/message/i2o/iop.c
+index a8c08f3..155fe3d 100644
+--- a/drivers/message/i2o/iop.c
++++ b/drivers/message/i2o/iop.c
+@@ -111,10 +111,10 @@ u32 i2o_cntxt_list_add(struct i2o_controller * c, void *ptr)
  
        spin_lock_irqsave(&c->context_list_lock, flags);
  
@@ -30445,7 +32174,7 @@ diff -urNp linux-3.1.3/drivers/message/i2o/iop.c linux-3.1.3/drivers/message/i2o
  
        list_add(&entry->list, &c->context_list);
  
-@@ -1077,7 +1077,7 @@ struct i2o_controller *i2o_iop_alloc(voi
+@@ -1077,7 +1077,7 @@ struct i2o_controller *i2o_iop_alloc(void)
  
  #if BITS_PER_LONG == 64
        spin_lock_init(&c->context_list_lock);
@@ -30454,9 +32183,10 @@ diff -urNp linux-3.1.3/drivers/message/i2o/iop.c linux-3.1.3/drivers/message/i2o
        INIT_LIST_HEAD(&c->context_list);
  #endif
  
-diff -urNp linux-3.1.3/drivers/mfd/ab3100-core.c linux-3.1.3/drivers/mfd/ab3100-core.c
---- linux-3.1.3/drivers/mfd/ab3100-core.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/mfd/ab3100-core.c      2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/mfd/ab3100-core.c b/drivers/mfd/ab3100-core.c
+index a20e1c4..4f57255 100644
+--- a/drivers/mfd/ab3100-core.c
++++ b/drivers/mfd/ab3100-core.c
 @@ -809,7 +809,7 @@ struct ab_family_id {
        char    *name;
  };
@@ -30466,9 +32196,10 @@ diff -urNp linux-3.1.3/drivers/mfd/ab3100-core.c linux-3.1.3/drivers/mfd/ab3100-
        /* AB3100 */
        {
                .id = 0xc0,
-diff -urNp linux-3.1.3/drivers/mfd/abx500-core.c linux-3.1.3/drivers/mfd/abx500-core.c
---- linux-3.1.3/drivers/mfd/abx500-core.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/mfd/abx500-core.c      2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/mfd/abx500-core.c b/drivers/mfd/abx500-core.c
+index f12720d..3c251fd 100644
+--- a/drivers/mfd/abx500-core.c
++++ b/drivers/mfd/abx500-core.c
 @@ -14,7 +14,7 @@ static LIST_HEAD(abx500_list);
  
  struct abx500_device_entry {
@@ -30478,9 +32209,10 @@ diff -urNp linux-3.1.3/drivers/mfd/abx500-core.c linux-3.1.3/drivers/mfd/abx500-
        struct device *dev;
  };
  
-diff -urNp linux-3.1.3/drivers/mfd/janz-cmodio.c linux-3.1.3/drivers/mfd/janz-cmodio.c
---- linux-3.1.3/drivers/mfd/janz-cmodio.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/mfd/janz-cmodio.c      2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/mfd/janz-cmodio.c b/drivers/mfd/janz-cmodio.c
+index 5c2a06a..8fa077c 100644
+--- a/drivers/mfd/janz-cmodio.c
++++ b/drivers/mfd/janz-cmodio.c
 @@ -13,6 +13,7 @@
  
  #include <linux/kernel.h>
@@ -30489,10 +32221,11 @@ diff -urNp linux-3.1.3/drivers/mfd/janz-cmodio.c linux-3.1.3/drivers/mfd/janz-cm
  #include <linux/init.h>
  #include <linux/pci.h>
  #include <linux/interrupt.h>
-diff -urNp linux-3.1.3/drivers/mfd/wm8350-i2c.c linux-3.1.3/drivers/mfd/wm8350-i2c.c
---- linux-3.1.3/drivers/mfd/wm8350-i2c.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/mfd/wm8350-i2c.c       2011-11-16 18:40:10.000000000 -0500
-@@ -44,6 +44,8 @@ static int wm8350_i2c_write_device(struc
+diff --git a/drivers/mfd/wm8350-i2c.c b/drivers/mfd/wm8350-i2c.c
+index 5fe5de1..af64f53 100644
+--- a/drivers/mfd/wm8350-i2c.c
++++ b/drivers/mfd/wm8350-i2c.c
+@@ -44,6 +44,8 @@ static int wm8350_i2c_write_device(struct wm8350 *wm8350, char reg,
        u8 msg[(WM8350_MAX_REGISTER << 1) + 1];
        int ret;
  
@@ -30501,10 +32234,11 @@ diff -urNp linux-3.1.3/drivers/mfd/wm8350-i2c.c linux-3.1.3/drivers/mfd/wm8350-i
        if (bytes > ((WM8350_MAX_REGISTER << 1) + 1))
                return -EINVAL;
  
-diff -urNp linux-3.1.3/drivers/misc/lis3lv02d/lis3lv02d.c linux-3.1.3/drivers/misc/lis3lv02d/lis3lv02d.c
---- linux-3.1.3/drivers/misc/lis3lv02d/lis3lv02d.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/misc/lis3lv02d/lis3lv02d.c     2011-11-16 18:39:07.000000000 -0500
-@@ -437,7 +437,7 @@ static irqreturn_t lis302dl_interrupt(in
+diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c b/drivers/misc/lis3lv02d/lis3lv02d.c
+index 8b51cd6..f628f8d 100644
+--- a/drivers/misc/lis3lv02d/lis3lv02d.c
++++ b/drivers/misc/lis3lv02d/lis3lv02d.c
+@@ -437,7 +437,7 @@ static irqreturn_t lis302dl_interrupt(int irq, void *dummy)
         * the lid is closed. This leads to interrupts as soon as a little move
         * is done.
         */
@@ -30513,7 +32247,7 @@ diff -urNp linux-3.1.3/drivers/misc/lis3lv02d/lis3lv02d.c linux-3.1.3/drivers/mi
  
        wake_up_interruptible(&lis3_dev.misc_wait);
        kill_fasync(&lis3_dev.async_queue, SIGIO, POLL_IN);
-@@ -520,7 +520,7 @@ static int lis3lv02d_misc_open(struct in
+@@ -520,7 +520,7 @@ static int lis3lv02d_misc_open(struct inode *inode, struct file *file)
        if (lis3_dev.pm_dev)
                pm_runtime_get_sync(lis3_dev.pm_dev);
  
@@ -30522,7 +32256,7 @@ diff -urNp linux-3.1.3/drivers/misc/lis3lv02d/lis3lv02d.c linux-3.1.3/drivers/mi
        return 0;
  }
  
-@@ -547,7 +547,7 @@ static ssize_t lis3lv02d_misc_read(struc
+@@ -547,7 +547,7 @@ static ssize_t lis3lv02d_misc_read(struct file *file, char __user *buf,
        add_wait_queue(&lis3_dev.misc_wait, &wait);
        while (true) {
                set_current_state(TASK_INTERRUPTIBLE);
@@ -30540,9 +32274,10 @@ diff -urNp linux-3.1.3/drivers/misc/lis3lv02d/lis3lv02d.c linux-3.1.3/drivers/mi
                return POLLIN | POLLRDNORM;
        return 0;
  }
-diff -urNp linux-3.1.3/drivers/misc/lis3lv02d/lis3lv02d.h linux-3.1.3/drivers/misc/lis3lv02d/lis3lv02d.h
---- linux-3.1.3/drivers/misc/lis3lv02d/lis3lv02d.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/misc/lis3lv02d/lis3lv02d.h     2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/misc/lis3lv02d/lis3lv02d.h b/drivers/misc/lis3lv02d/lis3lv02d.h
+index a193958..4d7ecd2 100644
+--- a/drivers/misc/lis3lv02d/lis3lv02d.h
++++ b/drivers/misc/lis3lv02d/lis3lv02d.h
 @@ -265,7 +265,7 @@ struct lis3lv02d {
        struct input_polled_dev *idev;     /* input device */
        struct platform_device  *pdev;     /* platform device */
@@ -30552,10 +32287,11 @@ diff -urNp linux-3.1.3/drivers/misc/lis3lv02d/lis3lv02d.h linux-3.1.3/drivers/mi
        union axis_conversion   ac;        /* hw -> logical axis */
        int                     mapped_btns[3];
  
-diff -urNp linux-3.1.3/drivers/misc/sgi-gru/gruhandles.c linux-3.1.3/drivers/misc/sgi-gru/gruhandles.c
---- linux-3.1.3/drivers/misc/sgi-gru/gruhandles.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/misc/sgi-gru/gruhandles.c      2011-11-16 18:39:07.000000000 -0500
-@@ -44,8 +44,8 @@ static void update_mcs_stats(enum mcs_op
+diff --git a/drivers/misc/sgi-gru/gruhandles.c b/drivers/misc/sgi-gru/gruhandles.c
+index 2f30bad..c4c13d0 100644
+--- a/drivers/misc/sgi-gru/gruhandles.c
++++ b/drivers/misc/sgi-gru/gruhandles.c
+@@ -44,8 +44,8 @@ static void update_mcs_stats(enum mcs_op op, unsigned long clks)
        unsigned long nsec;
  
        nsec = CLKS2NSEC(clks);
@@ -30566,9 +32302,10 @@ diff -urNp linux-3.1.3/drivers/misc/sgi-gru/gruhandles.c linux-3.1.3/drivers/mis
        if (mcs_op_statistics[op].max < nsec)
                mcs_op_statistics[op].max = nsec;
  }
-diff -urNp linux-3.1.3/drivers/misc/sgi-gru/gruprocfs.c linux-3.1.3/drivers/misc/sgi-gru/gruprocfs.c
---- linux-3.1.3/drivers/misc/sgi-gru/gruprocfs.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/misc/sgi-gru/gruprocfs.c       2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/misc/sgi-gru/gruprocfs.c b/drivers/misc/sgi-gru/gruprocfs.c
+index 7768b87..f8aac38 100644
+--- a/drivers/misc/sgi-gru/gruprocfs.c
++++ b/drivers/misc/sgi-gru/gruprocfs.c
 @@ -32,9 +32,9 @@
  
  #define printstat(s, f)               printstat_val(s, &gru_stats.f, #f)
@@ -30581,7 +32318,7 @@ diff -urNp linux-3.1.3/drivers/misc/sgi-gru/gruprocfs.c linux-3.1.3/drivers/misc
  
        seq_printf(s, "%16lu %s\n", val, id);
  }
-@@ -134,8 +134,8 @@ static int mcs_statistics_show(struct se
+@@ -134,8 +134,8 @@ static int mcs_statistics_show(struct seq_file *s, void *p)
  
        seq_printf(s, "%-20s%12s%12s%12s\n", "#id", "count", "aver-clks", "max-clks");
        for (op = 0; op < mcsop_last; op++) {
@@ -30592,9 +32329,10 @@ diff -urNp linux-3.1.3/drivers/misc/sgi-gru/gruprocfs.c linux-3.1.3/drivers/misc
                max = mcs_op_statistics[op].max;
                seq_printf(s, "%-20s%12ld%12ld%12ld\n", id[op], count,
                           count ? total / count : 0, max);
-diff -urNp linux-3.1.3/drivers/misc/sgi-gru/grutables.h linux-3.1.3/drivers/misc/sgi-gru/grutables.h
---- linux-3.1.3/drivers/misc/sgi-gru/grutables.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/misc/sgi-gru/grutables.h       2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/misc/sgi-gru/grutables.h b/drivers/misc/sgi-gru/grutables.h
+index 5c3ce24..4915ccb 100644
+--- a/drivers/misc/sgi-gru/grutables.h
++++ b/drivers/misc/sgi-gru/grutables.h
 @@ -167,82 +167,82 @@ extern unsigned int gru_max_gids;
   * GRU statistics.
   */
@@ -30650,31 +32388,6 @@ diff -urNp linux-3.1.3/drivers/misc/sgi-gru/grutables.h linux-3.1.3/drivers/misc
 -      atomic_long_t flush_tlb_gru;
 -      atomic_long_t flush_tlb_gru_tgh;
 -      atomic_long_t flush_tlb_gru_zero_asid;
--
--      atomic_long_t copy_gpa;
--      atomic_long_t read_gpa;
--
--      atomic_long_t mesq_receive;
--      atomic_long_t mesq_receive_none;
--      atomic_long_t mesq_send;
--      atomic_long_t mesq_send_failed;
--      atomic_long_t mesq_noop;
--      atomic_long_t mesq_send_unexpected_error;
--      atomic_long_t mesq_send_lb_overflow;
--      atomic_long_t mesq_send_qlimit_reached;
--      atomic_long_t mesq_send_amo_nacked;
--      atomic_long_t mesq_send_put_nacked;
--      atomic_long_t mesq_page_overflow;
--      atomic_long_t mesq_qf_locked;
--      atomic_long_t mesq_qf_noop_not_full;
--      atomic_long_t mesq_qf_switch_head_failed;
--      atomic_long_t mesq_qf_unexpected_error;
--      atomic_long_t mesq_noop_unexpected_error;
--      atomic_long_t mesq_noop_lb_overflow;
--      atomic_long_t mesq_noop_qlimit_reached;
--      atomic_long_t mesq_noop_amo_nacked;
--      atomic_long_t mesq_noop_put_nacked;
--      atomic_long_t mesq_noop_page_overflow;
 +      atomic_long_unchecked_t vdata_alloc;
 +      atomic_long_unchecked_t vdata_free;
 +      atomic_long_unchecked_t gts_alloc;
@@ -30726,10 +32439,33 @@ diff -urNp linux-3.1.3/drivers/misc/sgi-gru/grutables.h linux-3.1.3/drivers/misc
 +      atomic_long_unchecked_t flush_tlb_gru;
 +      atomic_long_unchecked_t flush_tlb_gru_tgh;
 +      atomic_long_unchecked_t flush_tlb_gru_zero_asid;
-+
+-      atomic_long_t copy_gpa;
+-      atomic_long_t read_gpa;
 +      atomic_long_unchecked_t copy_gpa;
 +      atomic_long_unchecked_t read_gpa;
-+
+-      atomic_long_t mesq_receive;
+-      atomic_long_t mesq_receive_none;
+-      atomic_long_t mesq_send;
+-      atomic_long_t mesq_send_failed;
+-      atomic_long_t mesq_noop;
+-      atomic_long_t mesq_send_unexpected_error;
+-      atomic_long_t mesq_send_lb_overflow;
+-      atomic_long_t mesq_send_qlimit_reached;
+-      atomic_long_t mesq_send_amo_nacked;
+-      atomic_long_t mesq_send_put_nacked;
+-      atomic_long_t mesq_page_overflow;
+-      atomic_long_t mesq_qf_locked;
+-      atomic_long_t mesq_qf_noop_not_full;
+-      atomic_long_t mesq_qf_switch_head_failed;
+-      atomic_long_t mesq_qf_unexpected_error;
+-      atomic_long_t mesq_noop_unexpected_error;
+-      atomic_long_t mesq_noop_lb_overflow;
+-      atomic_long_t mesq_noop_qlimit_reached;
+-      atomic_long_t mesq_noop_amo_nacked;
+-      atomic_long_t mesq_noop_put_nacked;
+-      atomic_long_t mesq_noop_page_overflow;
 +      atomic_long_unchecked_t mesq_receive;
 +      atomic_long_unchecked_t mesq_receive_none;
 +      atomic_long_unchecked_t mesq_send;
@@ -30754,7 +32490,7 @@ diff -urNp linux-3.1.3/drivers/misc/sgi-gru/grutables.h linux-3.1.3/drivers/misc
  
  };
  
-@@ -251,8 +251,8 @@ enum mcs_op {cchop_allocate, cchop_start
+@@ -251,8 +251,8 @@ enum mcs_op {cchop_allocate, cchop_start, cchop_interrupt, cchop_interrupt_sync,
        tghop_invalidate, mcsop_last};
  
  struct mcs_op_statistic {
@@ -30765,7 +32501,7 @@ diff -urNp linux-3.1.3/drivers/misc/sgi-gru/grutables.h linux-3.1.3/drivers/misc
        unsigned long   max;
  };
  
-@@ -275,7 +275,7 @@ extern struct mcs_op_statistic mcs_op_st
+@@ -275,7 +275,7 @@ extern struct mcs_op_statistic mcs_op_statistics[mcsop_last];
  
  #define STAT(id)      do {                                            \
                                if (gru_options & OPT_STATS)            \
@@ -30774,9 +32510,23 @@ diff -urNp linux-3.1.3/drivers/misc/sgi-gru/grutables.h linux-3.1.3/drivers/misc
                        } while (0)
  
  #ifdef CONFIG_SGI_GRU_DEBUG
-diff -urNp linux-3.1.3/drivers/misc/sgi-xp/xpc.h linux-3.1.3/drivers/misc/sgi-xp/xpc.h
---- linux-3.1.3/drivers/misc/sgi-xp/xpc.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/misc/sgi-xp/xpc.h      2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/misc/sgi-xp/xp.h b/drivers/misc/sgi-xp/xp.h
+index 851b2f2..a4ec097 100644
+--- a/drivers/misc/sgi-xp/xp.h
++++ b/drivers/misc/sgi-xp/xp.h
+@@ -289,7 +289,7 @@ struct xpc_interface {
+                                       xpc_notify_func, void *);
+       void (*received) (short, int, void *);
+       enum xp_retval (*partid_to_nasids) (short, void *);
+-};
++} __no_const;
+ extern struct xpc_interface xpc_interface;
+diff --git a/drivers/misc/sgi-xp/xpc.h b/drivers/misc/sgi-xp/xpc.h
+index b94d5f7..7f494c5 100644
+--- a/drivers/misc/sgi-xp/xpc.h
++++ b/drivers/misc/sgi-xp/xpc.h
 @@ -835,6 +835,7 @@ struct xpc_arch_operations {
        void (*received_payload) (struct xpc_channel *, void *);
        void (*notify_senders_of_disconnect) (struct xpc_channel *);
@@ -30785,7 +32535,7 @@ diff -urNp linux-3.1.3/drivers/misc/sgi-xp/xpc.h linux-3.1.3/drivers/misc/sgi-xp
  
  /* struct xpc_partition act_state values (for XPC HB) */
  
-@@ -876,7 +877,7 @@ extern struct xpc_registration xpc_regis
+@@ -876,7 +877,7 @@ extern struct xpc_registration xpc_registrations[];
  /* found in xpc_main.c */
  extern struct device *xpc_part;
  extern struct device *xpc_chan;
@@ -30794,10 +32544,11 @@ diff -urNp linux-3.1.3/drivers/misc/sgi-xp/xpc.h linux-3.1.3/drivers/misc/sgi-xp
  extern int xpc_disengage_timelimit;
  extern int xpc_disengage_timedout;
  extern int xpc_activate_IRQ_rcvd;
-diff -urNp linux-3.1.3/drivers/misc/sgi-xp/xpc_main.c linux-3.1.3/drivers/misc/sgi-xp/xpc_main.c
---- linux-3.1.3/drivers/misc/sgi-xp/xpc_main.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/misc/sgi-xp/xpc_main.c 2011-11-16 18:39:07.000000000 -0500
-@@ -162,7 +162,7 @@ static struct notifier_block xpc_die_not
+diff --git a/drivers/misc/sgi-xp/xpc_main.c b/drivers/misc/sgi-xp/xpc_main.c
+index 8d082b4..aa749ae 100644
+--- a/drivers/misc/sgi-xp/xpc_main.c
++++ b/drivers/misc/sgi-xp/xpc_main.c
+@@ -162,7 +162,7 @@ static struct notifier_block xpc_die_notifier = {
        .notifier_call = xpc_system_die,
  };
  
@@ -30806,22 +32557,11 @@ diff -urNp linux-3.1.3/drivers/misc/sgi-xp/xpc_main.c linux-3.1.3/drivers/misc/s
  
  /*
   * Timer function to enforce the timelimit on the partition disengage.
-diff -urNp linux-3.1.3/drivers/misc/sgi-xp/xp.h linux-3.1.3/drivers/misc/sgi-xp/xp.h
---- linux-3.1.3/drivers/misc/sgi-xp/xp.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/misc/sgi-xp/xp.h       2011-11-16 18:39:07.000000000 -0500
-@@ -289,7 +289,7 @@ struct xpc_interface {
-                                       xpc_notify_func, void *);
-       void (*received) (short, int, void *);
-       enum xp_retval (*partid_to_nasids) (short, void *);
--};
-+} __no_const;
- extern struct xpc_interface xpc_interface;
-diff -urNp linux-3.1.3/drivers/mmc/host/sdhci-pci.c linux-3.1.3/drivers/mmc/host/sdhci-pci.c
---- linux-3.1.3/drivers/mmc/host/sdhci-pci.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/mmc/host/sdhci-pci.c   2011-11-16 18:39:07.000000000 -0500
-@@ -542,7 +542,7 @@ static const struct sdhci_pci_fixes sdhc
+diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c
+index 26c5286..292d261 100644
+--- a/drivers/mmc/host/sdhci-pci.c
++++ b/drivers/mmc/host/sdhci-pci.c
+@@ -542,7 +542,7 @@ static const struct sdhci_pci_fixes sdhci_via = {
        .probe          = via_probe,
  };
  
@@ -30830,10 +32570,11 @@ diff -urNp linux-3.1.3/drivers/mmc/host/sdhci-pci.c linux-3.1.3/drivers/mmc/host
        {
                .vendor         = PCI_VENDOR_ID_RICOH,
                .device         = PCI_DEVICE_ID_RICOH_R5C822,
-diff -urNp linux-3.1.3/drivers/mtd/chips/cfi_cmdset_0001.c linux-3.1.3/drivers/mtd/chips/cfi_cmdset_0001.c
---- linux-3.1.3/drivers/mtd/chips/cfi_cmdset_0001.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/mtd/chips/cfi_cmdset_0001.c    2011-11-16 18:40:10.000000000 -0500
-@@ -757,6 +757,8 @@ static int chip_ready (struct map_info *
+diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
+index e1e122f..d99a6ea 100644
+--- a/drivers/mtd/chips/cfi_cmdset_0001.c
++++ b/drivers/mtd/chips/cfi_cmdset_0001.c
+@@ -757,6 +757,8 @@ static int chip_ready (struct map_info *map, struct flchip *chip, unsigned long
        struct cfi_pri_intelext *cfip = cfi->cmdset_priv;
        unsigned long timeo = jiffies + HZ;
  
@@ -30842,7 +32583,7 @@ diff -urNp linux-3.1.3/drivers/mtd/chips/cfi_cmdset_0001.c linux-3.1.3/drivers/m
        /* Prevent setting state FL_SYNCING for chip in suspended state. */
        if (mode == FL_SYNCING && chip->oldstate != FL_READY)
                goto sleep;
-@@ -1653,6 +1655,8 @@ static int __xipram do_write_buffer(stru
+@@ -1653,6 +1655,8 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
        unsigned long initial_adr;
        int initial_len = len;
  
@@ -30851,7 +32592,7 @@ diff -urNp linux-3.1.3/drivers/mtd/chips/cfi_cmdset_0001.c linux-3.1.3/drivers/m
        wbufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize;
        adr += chip->start;
        initial_adr = adr;
-@@ -1871,6 +1875,8 @@ static int __xipram do_erase_oneblock(st
+@@ -1871,6 +1875,8 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip,
        int retries = 3;
        int ret;
  
@@ -30860,10 +32601,11 @@ diff -urNp linux-3.1.3/drivers/mtd/chips/cfi_cmdset_0001.c linux-3.1.3/drivers/m
        adr += chip->start;
  
   retry:
-diff -urNp linux-3.1.3/drivers/mtd/chips/cfi_cmdset_0020.c linux-3.1.3/drivers/mtd/chips/cfi_cmdset_0020.c
---- linux-3.1.3/drivers/mtd/chips/cfi_cmdset_0020.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/mtd/chips/cfi_cmdset_0020.c    2011-11-16 18:40:10.000000000 -0500
-@@ -255,6 +255,8 @@ static inline int do_read_onechip(struct
+diff --git a/drivers/mtd/chips/cfi_cmdset_0020.c b/drivers/mtd/chips/cfi_cmdset_0020.c
+index 179814a..abe9d60 100644
+--- a/drivers/mtd/chips/cfi_cmdset_0020.c
++++ b/drivers/mtd/chips/cfi_cmdset_0020.c
+@@ -255,6 +255,8 @@ static inline int do_read_onechip(struct map_info *map, struct flchip *chip, lof
        unsigned long cmd_addr;
        struct cfi_private *cfi = map->fldrv_priv;
  
@@ -30872,7 +32614,7 @@ diff -urNp linux-3.1.3/drivers/mtd/chips/cfi_cmdset_0020.c linux-3.1.3/drivers/m
        adr += chip->start;
  
        /* Ensure cmd read/writes are aligned. */
-@@ -429,6 +431,8 @@ static inline int do_write_buffer(struct
+@@ -429,6 +431,8 @@ static inline int do_write_buffer(struct map_info *map, struct flchip *chip,
        DECLARE_WAITQUEUE(wait, current);
        int wbufsize, z;
  
@@ -30881,7 +32623,7 @@ diff -urNp linux-3.1.3/drivers/mtd/chips/cfi_cmdset_0020.c linux-3.1.3/drivers/m
          /* M58LW064A requires bus alignment for buffer wriets -- saw */
          if (adr & (map_bankwidth(map)-1))
              return -EINVAL;
-@@ -743,6 +747,8 @@ static inline int do_erase_oneblock(stru
+@@ -743,6 +747,8 @@ static inline int do_erase_oneblock(struct map_info *map, struct flchip *chip, u
        DECLARE_WAITQUEUE(wait, current);
        int ret = 0;
  
@@ -30890,7 +32632,7 @@ diff -urNp linux-3.1.3/drivers/mtd/chips/cfi_cmdset_0020.c linux-3.1.3/drivers/m
        adr += chip->start;
  
        /* Let's determine this according to the interleave only once */
-@@ -1048,6 +1054,8 @@ static inline int do_lock_oneblock(struc
+@@ -1048,6 +1054,8 @@ static inline int do_lock_oneblock(struct map_info *map, struct flchip *chip, un
        unsigned long timeo = jiffies + HZ;
        DECLARE_WAITQUEUE(wait, current);
  
@@ -30899,7 +32641,7 @@ diff -urNp linux-3.1.3/drivers/mtd/chips/cfi_cmdset_0020.c linux-3.1.3/drivers/m
        adr += chip->start;
  
        /* Let's determine this according to the interleave only once */
-@@ -1197,6 +1205,8 @@ static inline int do_unlock_oneblock(str
+@@ -1197,6 +1205,8 @@ static inline int do_unlock_oneblock(struct map_info *map, struct flchip *chip,
        unsigned long timeo = jiffies + HZ;
        DECLARE_WAITQUEUE(wait, current);
  
@@ -30908,10 +32650,11 @@ diff -urNp linux-3.1.3/drivers/mtd/chips/cfi_cmdset_0020.c linux-3.1.3/drivers/m
        adr += chip->start;
  
        /* Let's determine this according to the interleave only once */
-diff -urNp linux-3.1.3/drivers/mtd/devices/doc2000.c linux-3.1.3/drivers/mtd/devices/doc2000.c
---- linux-3.1.3/drivers/mtd/devices/doc2000.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/mtd/devices/doc2000.c  2011-11-16 18:39:07.000000000 -0500
-@@ -776,7 +776,7 @@ static int doc_write(struct mtd_info *mt
+diff --git a/drivers/mtd/devices/doc2000.c b/drivers/mtd/devices/doc2000.c
+index f7fbf60..9866457 100644
+--- a/drivers/mtd/devices/doc2000.c
++++ b/drivers/mtd/devices/doc2000.c
+@@ -776,7 +776,7 @@ static int doc_write(struct mtd_info *mtd, loff_t to, size_t len,
  
                /* The ECC will not be calculated correctly if less than 512 is written */
  /* DBB-
@@ -30920,10 +32663,11 @@ diff -urNp linux-3.1.3/drivers/mtd/devices/doc2000.c linux-3.1.3/drivers/mtd/dev
                        printk(KERN_WARNING
                               "ECC needs a full sector write (adr: %lx size %lx)\n",
                               (long) to, (long) len);
-diff -urNp linux-3.1.3/drivers/mtd/devices/doc2001.c linux-3.1.3/drivers/mtd/devices/doc2001.c
---- linux-3.1.3/drivers/mtd/devices/doc2001.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/mtd/devices/doc2001.c  2011-11-16 18:39:07.000000000 -0500
-@@ -393,7 +393,7 @@ static int doc_read (struct mtd_info *mt
+diff --git a/drivers/mtd/devices/doc2001.c b/drivers/mtd/devices/doc2001.c
+index 241192f..d0c35a3 100644
+--- a/drivers/mtd/devices/doc2001.c
++++ b/drivers/mtd/devices/doc2001.c
+@@ -393,7 +393,7 @@ static int doc_read (struct mtd_info *mtd, loff_t from, size_t len,
        struct Nand *mychip = &this->chips[from >> (this->chipshift)];
  
        /* Don't allow read past end of device */
@@ -30932,10 +32676,11 @@ diff -urNp linux-3.1.3/drivers/mtd/devices/doc2001.c linux-3.1.3/drivers/mtd/dev
                return -EINVAL;
  
        /* Don't allow a single read to cross a 512-byte block boundary */
-diff -urNp linux-3.1.3/drivers/mtd/ftl.c linux-3.1.3/drivers/mtd/ftl.c
---- linux-3.1.3/drivers/mtd/ftl.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/mtd/ftl.c      2011-11-16 18:40:10.000000000 -0500
-@@ -474,6 +474,8 @@ static int copy_erase_unit(partition_t *
+diff --git a/drivers/mtd/ftl.c b/drivers/mtd/ftl.c
+index 037b399..225a71d 100644
+--- a/drivers/mtd/ftl.c
++++ b/drivers/mtd/ftl.c
+@@ -474,6 +474,8 @@ static int copy_erase_unit(partition_t *part, uint16_t srcunit,
      loff_t offset;
      uint16_t srcunitswap = cpu_to_le16(srcunit);
  
@@ -30944,10 +32689,11 @@ diff -urNp linux-3.1.3/drivers/mtd/ftl.c linux-3.1.3/drivers/mtd/ftl.c
      eun = &part->EUNInfo[srcunit];
      xfer = &part->XferInfo[xferunit];
      DEBUG(2, "ftl_cs: copying block 0x%x to 0x%x\n",
-diff -urNp linux-3.1.3/drivers/mtd/inftlcore.c linux-3.1.3/drivers/mtd/inftlcore.c
---- linux-3.1.3/drivers/mtd/inftlcore.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/mtd/inftlcore.c        2011-11-16 18:40:10.000000000 -0500
-@@ -259,6 +259,8 @@ static u16 INFTL_foldchain(struct INFTLr
+diff --git a/drivers/mtd/inftlcore.c b/drivers/mtd/inftlcore.c
+index d7592e6..31c505c 100644
+--- a/drivers/mtd/inftlcore.c
++++ b/drivers/mtd/inftlcore.c
+@@ -259,6 +259,8 @@ static u16 INFTL_foldchain(struct INFTLrecord *inftl, unsigned thisVUC, unsigned
        struct inftl_oob oob;
        size_t retlen;
  
@@ -30956,10 +32702,11 @@ diff -urNp linux-3.1.3/drivers/mtd/inftlcore.c linux-3.1.3/drivers/mtd/inftlcore
        DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_foldchain(inftl=%p,thisVUC=%d,"
                "pending=%d)\n", inftl, thisVUC, pendingblock);
  
-diff -urNp linux-3.1.3/drivers/mtd/inftlmount.c linux-3.1.3/drivers/mtd/inftlmount.c
---- linux-3.1.3/drivers/mtd/inftlmount.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/mtd/inftlmount.c       2011-11-16 18:40:10.000000000 -0500
-@@ -53,6 +53,8 @@ static int find_boot_record(struct INFTL
+diff --git a/drivers/mtd/inftlmount.c b/drivers/mtd/inftlmount.c
+index 104052e..6232be5 100644
+--- a/drivers/mtd/inftlmount.c
++++ b/drivers/mtd/inftlmount.c
+@@ -53,6 +53,8 @@ static int find_boot_record(struct INFTLrecord *inftl)
        struct INFTLPartition *ip;
        size_t retlen;
  
@@ -30968,10 +32715,11 @@ diff -urNp linux-3.1.3/drivers/mtd/inftlmount.c linux-3.1.3/drivers/mtd/inftlmou
        DEBUG(MTD_DEBUG_LEVEL3, "INFTL: find_boot_record(inftl=%p)\n", inftl);
  
          /*
-diff -urNp linux-3.1.3/drivers/mtd/lpddr/qinfo_probe.c linux-3.1.3/drivers/mtd/lpddr/qinfo_probe.c
---- linux-3.1.3/drivers/mtd/lpddr/qinfo_probe.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/mtd/lpddr/qinfo_probe.c        2011-11-16 18:40:10.000000000 -0500
-@@ -106,6 +106,8 @@ static int lpddr_pfow_present(struct map
+diff --git a/drivers/mtd/lpddr/qinfo_probe.c b/drivers/mtd/lpddr/qinfo_probe.c
+index dbfe17b..c7b0918 100644
+--- a/drivers/mtd/lpddr/qinfo_probe.c
++++ b/drivers/mtd/lpddr/qinfo_probe.c
+@@ -106,6 +106,8 @@ static int lpddr_pfow_present(struct map_info *map, struct lpddr_private *lpddr)
  {
        map_word pfow_val[4];
  
@@ -30980,10 +32728,11 @@ diff -urNp linux-3.1.3/drivers/mtd/lpddr/qinfo_probe.c linux-3.1.3/drivers/mtd/l
        /* Check identification string */
        pfow_val[0] = map_read(map, map->pfow_base + PFOW_QUERY_STRING_P);
        pfow_val[1] = map_read(map, map->pfow_base + PFOW_QUERY_STRING_F);
-diff -urNp linux-3.1.3/drivers/mtd/mtdchar.c linux-3.1.3/drivers/mtd/mtdchar.c
---- linux-3.1.3/drivers/mtd/mtdchar.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/mtd/mtdchar.c  2011-11-16 18:40:10.000000000 -0500
-@@ -554,6 +554,8 @@ static int mtd_ioctl(struct file *file, 
+diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
+index 49e20a4..60fbfa5 100644
+--- a/drivers/mtd/mtdchar.c
++++ b/drivers/mtd/mtdchar.c
+@@ -554,6 +554,8 @@ static int mtd_ioctl(struct file *file, u_int cmd, u_long arg)
        u_long size;
        struct mtd_info_user info;
  
@@ -30992,9 +32741,10 @@ diff -urNp linux-3.1.3/drivers/mtd/mtdchar.c linux-3.1.3/drivers/mtd/mtdchar.c
        DEBUG(MTD_DEBUG_LEVEL0, "MTD_ioctl\n");
  
        size = (cmd & IOCSIZE_MASK) >> IOCSIZE_SHIFT;
-diff -urNp linux-3.1.3/drivers/mtd/nand/denali.c linux-3.1.3/drivers/mtd/nand/denali.c
---- linux-3.1.3/drivers/mtd/nand/denali.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/mtd/nand/denali.c      2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
+index d527621..2491fab 100644
+--- a/drivers/mtd/nand/denali.c
++++ b/drivers/mtd/nand/denali.c
 @@ -26,6 +26,7 @@
  #include <linux/pci.h>
  #include <linux/mtd/mtd.h>
@@ -31003,10 +32753,11 @@ diff -urNp linux-3.1.3/drivers/mtd/nand/denali.c linux-3.1.3/drivers/mtd/nand/de
  
  #include "denali.h"
  
-diff -urNp linux-3.1.3/drivers/mtd/nftlcore.c linux-3.1.3/drivers/mtd/nftlcore.c
---- linux-3.1.3/drivers/mtd/nftlcore.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/mtd/nftlcore.c 2011-11-16 18:40:10.000000000 -0500
-@@ -264,6 +264,8 @@ static u16 NFTL_foldchain (struct NFTLre
+diff --git a/drivers/mtd/nftlcore.c b/drivers/mtd/nftlcore.c
+index b155666..611b801 100644
+--- a/drivers/mtd/nftlcore.c
++++ b/drivers/mtd/nftlcore.c
+@@ -264,6 +264,8 @@ static u16 NFTL_foldchain (struct NFTLrecord *nftl, unsigned thisVUC, unsigned p
        int inplace = 1;
        size_t retlen;
  
@@ -31015,9 +32766,10 @@ diff -urNp linux-3.1.3/drivers/mtd/nftlcore.c linux-3.1.3/drivers/mtd/nftlcore.c
        memset(BlockMap, 0xff, sizeof(BlockMap));
        memset(BlockFreeFound, 0, sizeof(BlockFreeFound));
  
-diff -urNp linux-3.1.3/drivers/mtd/nftlmount.c linux-3.1.3/drivers/mtd/nftlmount.c
---- linux-3.1.3/drivers/mtd/nftlmount.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/mtd/nftlmount.c        2011-11-16 18:40:10.000000000 -0500
+diff --git a/drivers/mtd/nftlmount.c b/drivers/mtd/nftlmount.c
+index e3cd1ff..0ea79a3 100644
+--- a/drivers/mtd/nftlmount.c
++++ b/drivers/mtd/nftlmount.c
 @@ -24,6 +24,7 @@
  #include <asm/errno.h>
  #include <linux/delay.h>
@@ -31026,7 +32778,7 @@ diff -urNp linux-3.1.3/drivers/mtd/nftlmount.c linux-3.1.3/drivers/mtd/nftlmount
  #include <linux/mtd/mtd.h>
  #include <linux/mtd/nand.h>
  #include <linux/mtd/nftl.h>
-@@ -45,6 +46,8 @@ static int find_boot_record(struct NFTLr
+@@ -45,6 +46,8 @@ static int find_boot_record(struct NFTLrecord *nftl)
        struct mtd_info *mtd = nftl->mbd.mtd;
        unsigned int i;
  
@@ -31035,9 +32787,10 @@ diff -urNp linux-3.1.3/drivers/mtd/nftlmount.c linux-3.1.3/drivers/mtd/nftlmount
          /* Assume logical EraseSize == physical erasesize for starting the scan.
           We'll sort it out later if we find a MediaHeader which says otherwise */
        /* Actually, we won't.  The new DiskOnChip driver has already scanned
-diff -urNp linux-3.1.3/drivers/mtd/ubi/build.c linux-3.1.3/drivers/mtd/ubi/build.c
---- linux-3.1.3/drivers/mtd/ubi/build.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/mtd/ubi/build.c        2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
+index 6c3fb5a..c542a81 100644
+--- a/drivers/mtd/ubi/build.c
++++ b/drivers/mtd/ubi/build.c
 @@ -1311,7 +1311,7 @@ module_exit(ubi_exit);
  static int __init bytes_str_to_int(const char *str)
  {
@@ -31047,7 +32800,7 @@ diff -urNp linux-3.1.3/drivers/mtd/ubi/build.c linux-3.1.3/drivers/mtd/ubi/build
  
        result = simple_strtoul(str, &endp, 0);
        if (str == endp || result >= INT_MAX) {
-@@ -1322,11 +1322,11 @@ static int __init bytes_str_to_int(const
+@@ -1322,11 +1322,11 @@ static int __init bytes_str_to_int(const char *str)
  
        switch (*endp) {
        case 'G':
@@ -31062,7 +32815,7 @@ diff -urNp linux-3.1.3/drivers/mtd/ubi/build.c linux-3.1.3/drivers/mtd/ubi/build
                if (endp[1] == 'i' && endp[2] == 'B')
                        endp += 2;
        case '\0':
-@@ -1337,7 +1337,13 @@ static int __init bytes_str_to_int(const
+@@ -1337,7 +1337,13 @@ static int __init bytes_str_to_int(const char *str)
                return -EINVAL;
        }
  
@@ -31077,10 +32830,11 @@ diff -urNp linux-3.1.3/drivers/mtd/ubi/build.c linux-3.1.3/drivers/mtd/ubi/build
  }
  
  /**
-diff -urNp linux-3.1.3/drivers/net/atlx/atl2.c linux-3.1.3/drivers/net/atlx/atl2.c
---- linux-3.1.3/drivers/net/atlx/atl2.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/atlx/atl2.c        2011-11-16 18:39:07.000000000 -0500
-@@ -2857,7 +2857,7 @@ static void atl2_force_ps(struct atl2_hw
+diff --git a/drivers/net/atlx/atl2.c b/drivers/net/atlx/atl2.c
+index d4f7dda..d627d46 100644
+--- a/drivers/net/atlx/atl2.c
++++ b/drivers/net/atlx/atl2.c
+@@ -2857,7 +2857,7 @@ static void atl2_force_ps(struct atl2_hw *hw)
   */
  
  #define ATL2_PARAM(X, desc) \
@@ -31089,10 +32843,11 @@ diff -urNp linux-3.1.3/drivers/net/atlx/atl2.c linux-3.1.3/drivers/net/atlx/atl2
      MODULE_PARM(X, "1-" __MODULE_STRING(ATL2_MAX_NIC) "i"); \
      MODULE_PARM_DESC(X, desc);
  #else
-diff -urNp linux-3.1.3/drivers/net/bna/bfa_ioc_ct.c linux-3.1.3/drivers/net/bna/bfa_ioc_ct.c
---- linux-3.1.3/drivers/net/bna/bfa_ioc_ct.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/bna/bfa_ioc_ct.c   2011-11-16 18:39:07.000000000 -0500
-@@ -48,7 +48,21 @@ static void bfa_ioc_ct_sync_ack(struct b
+diff --git a/drivers/net/bna/bfa_ioc_ct.c b/drivers/net/bna/bfa_ioc_ct.c
+index 87aecdf..ec23470 100644
+--- a/drivers/net/bna/bfa_ioc_ct.c
++++ b/drivers/net/bna/bfa_ioc_ct.c
+@@ -48,7 +48,21 @@ static void bfa_ioc_ct_sync_ack(struct bfa_ioc *ioc);
  static bool bfa_ioc_ct_sync_complete(struct bfa_ioc *ioc);
  static enum bfa_status bfa_ioc_ct_pll_init(void __iomem *rb, bool fcmode);
  
@@ -31136,10 +32891,11 @@ diff -urNp linux-3.1.3/drivers/net/bna/bfa_ioc_ct.c linux-3.1.3/drivers/net/bna/
        ioc->ioc_hwif = &nw_hwif_ct;
  }
  
-diff -urNp linux-3.1.3/drivers/net/bna/bnad.c linux-3.1.3/drivers/net/bna/bnad.c
---- linux-3.1.3/drivers/net/bna/bnad.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/bna/bnad.c 2011-11-16 18:39:07.000000000 -0500
-@@ -1673,7 +1673,14 @@ bnad_setup_tx(struct bnad *bnad, uint tx
+diff --git a/drivers/net/bna/bnad.c b/drivers/net/bna/bnad.c
+index 8e35b25..c39f205 100644
+--- a/drivers/net/bna/bnad.c
++++ b/drivers/net/bna/bnad.c
+@@ -1673,7 +1673,14 @@ bnad_setup_tx(struct bnad *bnad, uint tx_id)
        struct bna_intr_info *intr_info =
                        &res_info[BNA_TX_RES_INTR_T_TXCMPL].res_u.intr_info;
        struct bna_tx_config *tx_config = &bnad->tx_config[tx_id];
@@ -31155,7 +32911,7 @@ diff -urNp linux-3.1.3/drivers/net/bna/bnad.c linux-3.1.3/drivers/net/bna/bnad.c
        struct bna_tx *tx;
        unsigned long flags;
  
-@@ -1682,13 +1689,6 @@ bnad_setup_tx(struct bnad *bnad, uint tx
+@@ -1682,13 +1689,6 @@ bnad_setup_tx(struct bnad *bnad, uint tx_id)
        tx_config->txq_depth = bnad->txq_depth;
        tx_config->tx_type = BNA_TX_T_REGULAR;
  
@@ -31169,7 +32925,7 @@ diff -urNp linux-3.1.3/drivers/net/bna/bnad.c linux-3.1.3/drivers/net/bna/bnad.c
        /* Get BNA's resource requirement for one tx object */
        spin_lock_irqsave(&bnad->bna_lock, flags);
        bna_tx_res_req(bnad->num_txq_per_tx,
-@@ -1819,21 +1819,21 @@ bnad_setup_rx(struct bnad *bnad, uint rx
+@@ -1819,21 +1819,21 @@ bnad_setup_rx(struct bnad *bnad, uint rx_id)
        struct bna_intr_info *intr_info =
                        &res_info[BNA_RX_RES_T_INTR].res_u.intr_info;
        struct bna_rx_config *rx_config = &bnad->rx_config[rx_id];
@@ -31200,9 +32956,10 @@ diff -urNp linux-3.1.3/drivers/net/bna/bnad.c linux-3.1.3/drivers/net/bna/bnad.c
        /* Get BNA's resource requirement for one Rx object */
        spin_lock_irqsave(&bnad->bna_lock, flags);
        bna_rx_res_req(rx_config, res_info);
-diff -urNp linux-3.1.3/drivers/net/bnx2.c linux-3.1.3/drivers/net/bnx2.c
---- linux-3.1.3/drivers/net/bnx2.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/bnx2.c     2011-11-16 18:40:11.000000000 -0500
+diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
+index 4b2b570..31033f4 100644
+--- a/drivers/net/bnx2.c
++++ b/drivers/net/bnx2.c
 @@ -5877,6 +5877,8 @@ bnx2_test_nvram(struct bnx2 *bp)
        int rc = 0;
        u32 magic, csum;
@@ -31212,10 +32969,11 @@ diff -urNp linux-3.1.3/drivers/net/bnx2.c linux-3.1.3/drivers/net/bnx2.c
        if ((rc = bnx2_nvram_read(bp, 0, data, 4)) != 0)
                goto test_nvram_done;
  
-diff -urNp linux-3.1.3/drivers/net/bnx2x/bnx2x_ethtool.c linux-3.1.3/drivers/net/bnx2x/bnx2x_ethtool.c
---- linux-3.1.3/drivers/net/bnx2x/bnx2x_ethtool.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/bnx2x/bnx2x_ethtool.c      2011-11-16 18:40:11.000000000 -0500
-@@ -1943,6 +1943,8 @@ static int bnx2x_test_nvram(struct bnx2x
+diff --git a/drivers/net/bnx2x/bnx2x_ethtool.c b/drivers/net/bnx2x/bnx2x_ethtool.c
+index cf3e479..5dc0ecc 100644
+--- a/drivers/net/bnx2x/bnx2x_ethtool.c
++++ b/drivers/net/bnx2x/bnx2x_ethtool.c
+@@ -1943,6 +1943,8 @@ static int bnx2x_test_nvram(struct bnx2x *bp)
        int i, rc;
        u32 magic, crc;
  
@@ -31224,9 +32982,10 @@ diff -urNp linux-3.1.3/drivers/net/bnx2x/bnx2x_ethtool.c linux-3.1.3/drivers/net
        if (BP_NOMCP(bp))
                return 0;
  
-diff -urNp linux-3.1.3/drivers/net/bnx2x/bnx2x_sp.h linux-3.1.3/drivers/net/bnx2x/bnx2x_sp.h
---- linux-3.1.3/drivers/net/bnx2x/bnx2x_sp.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/bnx2x/bnx2x_sp.h   2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/net/bnx2x/bnx2x_sp.h b/drivers/net/bnx2x/bnx2x_sp.h
+index 9a517c2..a50cfcb 100644
+--- a/drivers/net/bnx2x/bnx2x_sp.h
++++ b/drivers/net/bnx2x/bnx2x_sp.h
 @@ -449,7 +449,7 @@ struct bnx2x_rx_mode_obj {
  
        int (*wait_comp)(struct bnx2x *bp,
@@ -31236,10 +32995,11 @@ diff -urNp linux-3.1.3/drivers/net/bnx2x/bnx2x_sp.h linux-3.1.3/drivers/net/bnx2
  
  /********************** Set multicast group ***********************************/
  
-diff -urNp linux-3.1.3/drivers/net/cxgb3/l2t.h linux-3.1.3/drivers/net/cxgb3/l2t.h
---- linux-3.1.3/drivers/net/cxgb3/l2t.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/cxgb3/l2t.h        2011-11-16 18:39:07.000000000 -0500
-@@ -87,7 +87,7 @@ typedef void (*arp_failure_handler_func)
+diff --git a/drivers/net/cxgb3/l2t.h b/drivers/net/cxgb3/l2t.h
+index c5f5479..2e8c260 100644
+--- a/drivers/net/cxgb3/l2t.h
++++ b/drivers/net/cxgb3/l2t.h
+@@ -87,7 +87,7 @@ typedef void (*arp_failure_handler_func)(struct t3cdev * dev,
   */
  struct l2t_skb_cb {
        arp_failure_handler_func arp_failure_handler;
@@ -31248,10 +33008,11 @@ diff -urNp linux-3.1.3/drivers/net/cxgb3/l2t.h linux-3.1.3/drivers/net/cxgb3/l2t
  
  #define L2T_SKB_CB(skb) ((struct l2t_skb_cb *)(skb)->cb)
  
-diff -urNp linux-3.1.3/drivers/net/cxgb4/cxgb4_main.c linux-3.1.3/drivers/net/cxgb4/cxgb4_main.c
---- linux-3.1.3/drivers/net/cxgb4/cxgb4_main.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/cxgb4/cxgb4_main.c 2011-11-16 18:40:22.000000000 -0500
-@@ -3396,6 +3396,8 @@ static int __devinit enable_msix(struct 
+diff --git a/drivers/net/cxgb4/cxgb4_main.c b/drivers/net/cxgb4/cxgb4_main.c
+index b4efa29..c5f2703 100644
+--- a/drivers/net/cxgb4/cxgb4_main.c
++++ b/drivers/net/cxgb4/cxgb4_main.c
+@@ -3396,6 +3396,8 @@ static int __devinit enable_msix(struct adapter *adap)
        unsigned int nchan = adap->params.nports;
        struct msix_entry entries[MAX_INGQ + 1];
  
@@ -31260,10 +33021,11 @@ diff -urNp linux-3.1.3/drivers/net/cxgb4/cxgb4_main.c linux-3.1.3/drivers/net/cx
        for (i = 0; i < ARRAY_SIZE(entries); ++i)
                entries[i].entry = i;
  
-diff -urNp linux-3.1.3/drivers/net/cxgb4/t4_hw.c linux-3.1.3/drivers/net/cxgb4/t4_hw.c
---- linux-3.1.3/drivers/net/cxgb4/t4_hw.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/cxgb4/t4_hw.c      2011-11-16 18:40:22.000000000 -0500
-@@ -362,6 +362,8 @@ static int get_vpd_params(struct adapter
+diff --git a/drivers/net/cxgb4/t4_hw.c b/drivers/net/cxgb4/t4_hw.c
+index d1ec111..12735bc 100644
+--- a/drivers/net/cxgb4/t4_hw.c
++++ b/drivers/net/cxgb4/t4_hw.c
+@@ -362,6 +362,8 @@ static int get_vpd_params(struct adapter *adapter, struct vpd_params *p)
        u8 vpd[VPD_LEN], csum;
        unsigned int vpdr_len, kw_offset, id_len;
  
@@ -31272,10 +33034,11 @@ diff -urNp linux-3.1.3/drivers/net/cxgb4/t4_hw.c linux-3.1.3/drivers/net/cxgb4/t
        ret = pci_read_vpd(adapter->pdev, VPD_BASE, sizeof(vpd), vpd);
        if (ret < 0)
                return ret;
-diff -urNp linux-3.1.3/drivers/net/e1000e/82571.c linux-3.1.3/drivers/net/e1000e/82571.c
---- linux-3.1.3/drivers/net/e1000e/82571.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/e1000e/82571.c     2011-11-16 18:39:07.000000000 -0500
-@@ -239,7 +239,7 @@ static s32 e1000_init_mac_params_82571(s
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index 536b3a5..e6f8dcc 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -239,7 +239,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
  {
        struct e1000_hw *hw = &adapter->hw;
        struct e1000_mac_info *mac = &hw->mac;
@@ -31284,10 +33047,11 @@ diff -urNp linux-3.1.3/drivers/net/e1000e/82571.c linux-3.1.3/drivers/net/e1000e
        u32 swsm = 0;
        u32 swsm2 = 0;
        bool force_clear_smbi = false;
-diff -urNp linux-3.1.3/drivers/net/e1000e/es2lan.c linux-3.1.3/drivers/net/e1000e/es2lan.c
---- linux-3.1.3/drivers/net/e1000e/es2lan.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/e1000e/es2lan.c    2011-11-16 18:39:07.000000000 -0500
-@@ -205,7 +205,7 @@ static s32 e1000_init_mac_params_80003es
+diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
+index e4f4225..24da2ea 100644
+--- a/drivers/net/e1000e/es2lan.c
++++ b/drivers/net/e1000e/es2lan.c
+@@ -205,7 +205,7 @@ static s32 e1000_init_mac_params_80003es2lan(struct e1000_adapter *adapter)
  {
        struct e1000_hw *hw = &adapter->hw;
        struct e1000_mac_info *mac = &hw->mac;
@@ -31296,9 +33060,10 @@ diff -urNp linux-3.1.3/drivers/net/e1000e/es2lan.c linux-3.1.3/drivers/net/e1000
  
        /* Set media type */
        switch (adapter->pdev->device) {
-diff -urNp linux-3.1.3/drivers/net/e1000e/hw.h linux-3.1.3/drivers/net/e1000e/hw.h
---- linux-3.1.3/drivers/net/e1000e/hw.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/e1000e/hw.h        2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
+index 2967039..ca8c40c 100644
+--- a/drivers/net/e1000e/hw.h
++++ b/drivers/net/e1000e/hw.h
 @@ -778,6 +778,7 @@ struct e1000_mac_operations {
        void (*write_vfta)(struct e1000_hw *, u32, u32);
        s32  (*read_mac_addr)(struct e1000_hw *);
@@ -31345,9 +33110,10 @@ diff -urNp linux-3.1.3/drivers/net/e1000e/hw.h linux-3.1.3/drivers/net/e1000e/hw
  
        enum e1000_nvm_type type;
        enum e1000_nvm_override override;
-diff -urNp linux-3.1.3/drivers/net/fealnx.c linux-3.1.3/drivers/net/fealnx.c
---- linux-3.1.3/drivers/net/fealnx.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/fealnx.c   2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/net/fealnx.c b/drivers/net/fealnx.c
+index fa8677c..196356f 100644
+--- a/drivers/net/fealnx.c
++++ b/drivers/net/fealnx.c
 @@ -150,7 +150,7 @@ struct chip_info {
        int flags;
  };
@@ -31357,10 +33123,11 @@ diff -urNp linux-3.1.3/drivers/net/fealnx.c linux-3.1.3/drivers/net/fealnx.c
        { "100/10M Ethernet PCI Adapter",       HAS_MII_XCVR },
        { "100/10M Ethernet PCI Adapter",       HAS_CHIP_XCVR },
        { "1000/100/10M Ethernet PCI Adapter",  HAS_MII_XCVR },
-diff -urNp linux-3.1.3/drivers/net/hamradio/6pack.c linux-3.1.3/drivers/net/hamradio/6pack.c
---- linux-3.1.3/drivers/net/hamradio/6pack.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/hamradio/6pack.c   2011-11-16 18:40:22.000000000 -0500
-@@ -463,6 +463,8 @@ static void sixpack_receive_buf(struct t
+diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c
+index 2a5a34d..be871cc 100644
+--- a/drivers/net/hamradio/6pack.c
++++ b/drivers/net/hamradio/6pack.c
+@@ -463,6 +463,8 @@ static void sixpack_receive_buf(struct tty_struct *tty,
        unsigned char buf[512];
        int count1;
  
@@ -31369,9 +33136,10 @@ diff -urNp linux-3.1.3/drivers/net/hamradio/6pack.c linux-3.1.3/drivers/net/hamr
        if (!count)
                return;
  
-diff -urNp linux-3.1.3/drivers/net/igb/e1000_hw.h linux-3.1.3/drivers/net/igb/e1000_hw.h
---- linux-3.1.3/drivers/net/igb/e1000_hw.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/igb/e1000_hw.h     2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h
+index 4519a13..f97fcd0 100644
+--- a/drivers/net/igb/e1000_hw.h
++++ b/drivers/net/igb/e1000_hw.h
 @@ -314,6 +314,7 @@ struct e1000_mac_operations {
        s32  (*read_mac_addr)(struct e1000_hw *);
        s32  (*get_speed_and_duplex)(struct e1000_hw *, u16 *, u16 *);
@@ -31440,9 +33208,10 @@ diff -urNp linux-3.1.3/drivers/net/igb/e1000_hw.h linux-3.1.3/drivers/net/igb/e1
        struct e1000_mbx_stats stats;
        u32 timeout;
        u32 usec_delay;
-diff -urNp linux-3.1.3/drivers/net/igbvf/vf.h linux-3.1.3/drivers/net/igbvf/vf.h
---- linux-3.1.3/drivers/net/igbvf/vf.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/igbvf/vf.h 2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/net/igbvf/vf.h b/drivers/net/igbvf/vf.h
+index d7ed58f..64cde36 100644
+--- a/drivers/net/igbvf/vf.h
++++ b/drivers/net/igbvf/vf.h
 @@ -189,9 +189,10 @@ struct e1000_mac_operations {
        s32  (*read_mac_addr)(struct e1000_hw *);
        s32  (*set_vfta)(struct e1000_hw *, u16, bool);
@@ -31472,10 +33241,11 @@ diff -urNp linux-3.1.3/drivers/net/igbvf/vf.h linux-3.1.3/drivers/net/igbvf/vf.h
        struct e1000_mbx_stats stats;
        u32 timeout;
        u32 usec_delay;
-diff -urNp linux-3.1.3/drivers/net/ixgb/ixgb_main.c linux-3.1.3/drivers/net/ixgb/ixgb_main.c
---- linux-3.1.3/drivers/net/ixgb/ixgb_main.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/ixgb/ixgb_main.c   2011-11-16 18:40:22.000000000 -0500
-@@ -1070,6 +1070,8 @@ ixgb_set_multi(struct net_device *netdev
+diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
+index 6a130eb..1aeb9e4 100644
+--- a/drivers/net/ixgb/ixgb_main.c
++++ b/drivers/net/ixgb/ixgb_main.c
+@@ -1070,6 +1070,8 @@ ixgb_set_multi(struct net_device *netdev)
        u32 rctl;
        int i;
  
@@ -31484,9 +33254,10 @@ diff -urNp linux-3.1.3/drivers/net/ixgb/ixgb_main.c linux-3.1.3/drivers/net/ixgb
        /* Check for Promiscuous and All Multicast modes */
  
        rctl = IXGB_READ_REG(hw, RCTL);
-diff -urNp linux-3.1.3/drivers/net/ixgb/ixgb_param.c linux-3.1.3/drivers/net/ixgb/ixgb_param.c
---- linux-3.1.3/drivers/net/ixgb/ixgb_param.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/ixgb/ixgb_param.c  2011-11-16 18:40:22.000000000 -0500
+diff --git a/drivers/net/ixgb/ixgb_param.c b/drivers/net/ixgb/ixgb_param.c
+index dd7fbeb..44b9bbf 100644
+--- a/drivers/net/ixgb/ixgb_param.c
++++ b/drivers/net/ixgb/ixgb_param.c
 @@ -261,6 +261,9 @@ void __devinit
  ixgb_check_options(struct ixgb_adapter *adapter)
  {
@@ -31497,9 +33268,10 @@ diff -urNp linux-3.1.3/drivers/net/ixgb/ixgb_param.c linux-3.1.3/drivers/net/ixg
        if (bd >= IXGB_MAX_NIC) {
                pr_notice("Warning: no configuration for board #%i\n", bd);
                pr_notice("Using defaults for all values\n");
-diff -urNp linux-3.1.3/drivers/net/ixgbe/ixgbe_type.h linux-3.1.3/drivers/net/ixgbe/ixgbe_type.h
---- linux-3.1.3/drivers/net/ixgbe/ixgbe_type.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/ixgbe/ixgbe_type.h 2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h
+index e0d970e..1cfdea5 100644
+--- a/drivers/net/ixgbe/ixgbe_type.h
++++ b/drivers/net/ixgbe/ixgbe_type.h
 @@ -2642,6 +2642,7 @@ struct ixgbe_eeprom_operations {
        s32 (*update_checksum)(struct ixgbe_hw *);
        u16 (*calc_checksum)(struct ixgbe_hw *);
@@ -31563,9 +33335,10 @@ diff -urNp linux-3.1.3/drivers/net/ixgbe/ixgbe_type.h linux-3.1.3/drivers/net/ix
        struct ixgbe_mbx_stats stats;
        u32 timeout;
        u32 usec_delay;
-diff -urNp linux-3.1.3/drivers/net/ixgbevf/vf.h linux-3.1.3/drivers/net/ixgbevf/vf.h
---- linux-3.1.3/drivers/net/ixgbevf/vf.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/ixgbevf/vf.h       2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/net/ixgbevf/vf.h b/drivers/net/ixgbevf/vf.h
+index 10306b4..28df758 100644
+--- a/drivers/net/ixgbevf/vf.h
++++ b/drivers/net/ixgbevf/vf.h
 @@ -70,6 +70,7 @@ struct ixgbe_mac_operations {
        s32 (*clear_vfta)(struct ixgbe_hw *);
        s32 (*set_vfta)(struct ixgbe_hw *, u32, u32, bool);
@@ -31600,10 +33373,11 @@ diff -urNp linux-3.1.3/drivers/net/ixgbevf/vf.h linux-3.1.3/drivers/net/ixgbevf/
        struct ixgbe_mbx_stats stats;
        u32 timeout;
        u32 udelay;
-diff -urNp linux-3.1.3/drivers/net/ksz884x.c linux-3.1.3/drivers/net/ksz884x.c
---- linux-3.1.3/drivers/net/ksz884x.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/ksz884x.c  2011-11-16 18:40:22.000000000 -0500
-@@ -6533,6 +6533,8 @@ static void netdev_get_ethtool_stats(str
+diff --git a/drivers/net/ksz884x.c b/drivers/net/ksz884x.c
+index 27418d3..adf15bb 100644
+--- a/drivers/net/ksz884x.c
++++ b/drivers/net/ksz884x.c
+@@ -6533,6 +6533,8 @@ static void netdev_get_ethtool_stats(struct net_device *dev,
        int rc;
        u64 counter[TOTAL_PORT_COUNTER_NUM];
  
@@ -31612,9 +33386,10 @@ diff -urNp linux-3.1.3/drivers/net/ksz884x.c linux-3.1.3/drivers/net/ksz884x.c
        mutex_lock(&hw_priv->lock);
        n = SWITCH_PORT_NUM;
        for (i = 0, p = port->first_port; i < port->mib_port_cnt; i++, p++) {
-diff -urNp linux-3.1.3/drivers/net/mlx4/main.c linux-3.1.3/drivers/net/mlx4/main.c
---- linux-3.1.3/drivers/net/mlx4/main.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/mlx4/main.c        2011-11-16 18:40:22.000000000 -0500
+diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c
+index f0ee35d..3831c8a 100644
+--- a/drivers/net/mlx4/main.c
++++ b/drivers/net/mlx4/main.c
 @@ -40,6 +40,7 @@
  #include <linux/dma-mapping.h>
  #include <linux/slab.h>
@@ -31623,7 +33398,7 @@ diff -urNp linux-3.1.3/drivers/net/mlx4/main.c linux-3.1.3/drivers/net/mlx4/main
  
  #include <linux/mlx4/device.h>
  #include <linux/mlx4/doorbell.h>
-@@ -762,6 +763,8 @@ static int mlx4_init_hca(struct mlx4_dev
+@@ -762,6 +763,8 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
        u64 icm_size;
        int err;
  
@@ -31632,10 +33407,11 @@ diff -urNp linux-3.1.3/drivers/net/mlx4/main.c linux-3.1.3/drivers/net/mlx4/main
        err = mlx4_QUERY_FW(dev);
        if (err) {
                if (err == -EACCES)
-diff -urNp linux-3.1.3/drivers/net/niu.c linux-3.1.3/drivers/net/niu.c
---- linux-3.1.3/drivers/net/niu.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/niu.c      2011-11-16 18:40:22.000000000 -0500
-@@ -9061,6 +9061,8 @@ static void __devinit niu_try_msix(struc
+diff --git a/drivers/net/niu.c b/drivers/net/niu.c
+index ed47585..5e5be8f 100644
+--- a/drivers/net/niu.c
++++ b/drivers/net/niu.c
+@@ -9061,6 +9061,8 @@ static void __devinit niu_try_msix(struct niu *np, u8 *ldg_num_map)
        int i, num_irqs, err;
        u8 first_ldg;
  
@@ -31644,9 +33420,10 @@ diff -urNp linux-3.1.3/drivers/net/niu.c linux-3.1.3/drivers/net/niu.c
        first_ldg = (NIU_NUM_LDG / parent->num_ports) * np->port;
        for (i = 0; i < (NIU_NUM_LDG / parent->num_ports); i++)
                ldg_num_map[i] = first_ldg + i;
-diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
---- linux-3.1.3/drivers/net/pcnet32.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/pcnet32.c  2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
+index 80b6f36..5cd8938 100644
+--- a/drivers/net/pcnet32.c
++++ b/drivers/net/pcnet32.c
 @@ -270,7 +270,7 @@ struct pcnet32_private {
        struct sk_buff          **rx_skbuff;
        dma_addr_t              *tx_dma_addr;
@@ -31656,7 +33433,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
        spinlock_t              lock;           /* Guard lock */
        unsigned int            cur_rx, cur_tx; /* The next free ring entry */
        unsigned int            rx_ring_size;   /* current rx ring size */
-@@ -460,9 +460,9 @@ static void pcnet32_netif_start(struct n
+@@ -460,9 +460,9 @@ static void pcnet32_netif_start(struct net_device *dev)
        u16 val;
  
        netif_wake_queue(dev);
@@ -31668,7 +33445,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
        napi_enable(&lp->napi);
  }
  
-@@ -730,7 +730,7 @@ static u32 pcnet32_get_link(struct net_d
+@@ -730,7 +730,7 @@ static u32 pcnet32_get_link(struct net_device *dev)
                r = mii_link_ok(&lp->mii_if);
        } else if (lp->chip_version >= PCNET32_79C970A) {
                ulong ioaddr = dev->base_addr;  /* card base I/O address */
@@ -31677,7 +33454,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
        } else {        /* can not detect link on really old chips */
                r = 1;
        }
-@@ -792,7 +792,7 @@ static int pcnet32_set_ringparam(struct 
+@@ -792,7 +792,7 @@ static int pcnet32_set_ringparam(struct net_device *dev,
                pcnet32_netif_stop(dev);
  
        spin_lock_irqsave(&lp->lock, flags);
@@ -31686,7 +33463,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
  
        size = min(ering->tx_pending, (unsigned int)TX_MAX_RING_SIZE);
  
-@@ -868,7 +868,7 @@ static void pcnet32_ethtool_test(struct 
+@@ -868,7 +868,7 @@ static void pcnet32_ethtool_test(struct net_device *dev,
  static int pcnet32_loopback_test(struct net_device *dev, uint64_t * data1)
  {
        struct pcnet32_private *lp = netdev_priv(dev);
@@ -31695,7 +33472,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
        ulong ioaddr = dev->base_addr;  /* card base I/O address */
        struct sk_buff *skb;    /* sk buff */
        int x, i;               /* counters */
-@@ -888,21 +888,21 @@ static int pcnet32_loopback_test(struct 
+@@ -888,21 +888,21 @@ static int pcnet32_loopback_test(struct net_device *dev, uint64_t * data1)
                pcnet32_netif_stop(dev);
  
        spin_lock_irqsave(&lp->lock, flags);
@@ -31722,7 +33499,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
  
        /* Initialize Transmit buffers. */
        size = data_len + 15;
-@@ -947,10 +947,10 @@ static int pcnet32_loopback_test(struct 
+@@ -947,10 +947,10 @@ static int pcnet32_loopback_test(struct net_device *dev, uint64_t * data1)
  
        /* set int loopback in CSR15 */
        x = a->read_csr(ioaddr, CSR15) & 0xfffc;
@@ -31735,7 +33512,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
  
        /* Check status of descriptors */
        for (x = 0; x < numbuffs; x++) {
-@@ -969,7 +969,7 @@ static int pcnet32_loopback_test(struct 
+@@ -969,7 +969,7 @@ static int pcnet32_loopback_test(struct net_device *dev, uint64_t * data1)
                }
        }
  
@@ -31753,7 +33530,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
        }
        spin_unlock_irqrestore(&lp->lock, flags);
  
-@@ -1026,7 +1026,7 @@ static int pcnet32_set_phys_id(struct ne
+@@ -1026,7 +1026,7 @@ static int pcnet32_set_phys_id(struct net_device *dev,
                               enum ethtool_phys_id_state state)
  {
        struct pcnet32_private *lp = netdev_priv(dev);
@@ -31762,7 +33539,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
        ulong ioaddr = dev->base_addr;
        unsigned long flags;
        int i;
-@@ -1067,7 +1067,7 @@ static int pcnet32_suspend(struct net_de
+@@ -1067,7 +1067,7 @@ static int pcnet32_suspend(struct net_device *dev, unsigned long *flags,
  {
        int csr5;
        struct pcnet32_private *lp = netdev_priv(dev);
@@ -31771,7 +33548,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
        ulong ioaddr = dev->base_addr;
        int ticks;
  
-@@ -1324,8 +1324,8 @@ static int pcnet32_poll(struct napi_stru
+@@ -1324,8 +1324,8 @@ static int pcnet32_poll(struct napi_struct *napi, int budget)
        spin_lock_irqsave(&lp->lock, flags);
        if (pcnet32_tx(dev)) {
                /* reset the chip to clear the error condition, then restart */
@@ -31782,7 +33559,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
                pcnet32_restart(dev, CSR0_START);
                netif_wake_queue(dev);
        }
-@@ -1337,12 +1337,12 @@ static int pcnet32_poll(struct napi_stru
+@@ -1337,12 +1337,12 @@ static int pcnet32_poll(struct napi_struct *napi, int budget)
                __napi_complete(napi);
  
                /* clear interrupt masks */
@@ -31798,7 +33575,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
  
                spin_unlock_irqrestore(&lp->lock, flags);
        }
-@@ -1365,7 +1365,7 @@ static void pcnet32_get_regs(struct net_
+@@ -1365,7 +1365,7 @@ static void pcnet32_get_regs(struct net_device *dev, struct ethtool_regs *regs,
        int i, csr0;
        u16 *buff = ptr;
        struct pcnet32_private *lp = netdev_priv(dev);
@@ -31807,7 +33584,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
        ulong ioaddr = dev->base_addr;
        unsigned long flags;
  
-@@ -1401,9 +1401,9 @@ static void pcnet32_get_regs(struct net_
+@@ -1401,9 +1401,9 @@ static void pcnet32_get_regs(struct net_device *dev, struct ethtool_regs *regs,
                for (j = 0; j < PCNET32_MAX_PHYS; j++) {
                        if (lp->phymask & (1 << j)) {
                                for (i = 0; i < PCNET32_REGS_PER_PHY; i++) {
@@ -31819,7 +33596,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
                                }
                        }
                }
-@@ -1785,7 +1785,7 @@ pcnet32_probe1(unsigned long ioaddr, int
+@@ -1785,7 +1785,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
            ((cards_found >= MAX_UNITS) || full_duplex[cards_found]))
                lp->options |= PCNET32_PORT_FD;
  
@@ -31828,7 +33605,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
  
        /* prior to register_netdev, dev->name is not yet correct */
        if (pcnet32_alloc_ring(dev, pci_name(lp->pci_dev))) {
-@@ -1844,7 +1844,7 @@ pcnet32_probe1(unsigned long ioaddr, int
+@@ -1844,7 +1844,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
        if (lp->mii) {
                /* lp->phycount and lp->phymask are set to 0 by memset above */
  
@@ -31837,7 +33614,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
                /* scan for PHYs */
                for (i = 0; i < PCNET32_MAX_PHYS; i++) {
                        unsigned short id1, id2;
-@@ -1864,7 +1864,7 @@ pcnet32_probe1(unsigned long ioaddr, int
+@@ -1864,7 +1864,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
                                pr_info("Found PHY %04x:%04x at address %d\n",
                                        id1, id2, i);
                }
@@ -31846,7 +33623,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
                if (lp->phycount > 1)
                        lp->options |= PCNET32_PORT_MII;
        }
-@@ -2020,10 +2020,10 @@ static int pcnet32_open(struct net_devic
+@@ -2020,10 +2020,10 @@ static int pcnet32_open(struct net_device *dev)
        }
  
        /* Reset the PCNET32 */
@@ -31859,7 +33636,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
  
        netif_printk(lp, ifup, KERN_DEBUG, dev,
                     "%s() irq %d tx/rx rings %#x/%#x init %#x\n",
-@@ -2032,14 +2032,14 @@ static int pcnet32_open(struct net_devic
+@@ -2032,14 +2032,14 @@ static int pcnet32_open(struct net_device *dev)
                     (u32) (lp->init_dma_addr));
  
        /* set/reset autoselect bit */
@@ -31877,7 +33654,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
                if (lp->options & PCNET32_PORT_FD) {
                        val |= 1;
                        if (lp->options == (PCNET32_PORT_FD | PCNET32_PORT_AUI))
-@@ -2049,14 +2049,14 @@ static int pcnet32_open(struct net_devic
+@@ -2049,14 +2049,14 @@ static int pcnet32_open(struct net_device *dev)
                        if (lp->chip_version == 0x2627)
                                val |= 3;
                }
@@ -31895,7 +33672,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
  
        /* Allied Telesyn AT 2700/2701 FX are 100Mbit only and do not negotiate */
        if (pdev && pdev->subsystem_vendor == PCI_VENDOR_ID_AT &&
-@@ -2075,24 +2075,24 @@ static int pcnet32_open(struct net_devic
+@@ -2075,24 +2075,24 @@ static int pcnet32_open(struct net_device *dev)
                 * duplex, and/or enable auto negotiation, and clear DANAS
                 */
                if (lp->mii && !(lp->options & PCNET32_PORT_ASEL)) {
@@ -31928,7 +33705,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
                        }
                }
        } else {
-@@ -2105,10 +2105,10 @@ static int pcnet32_open(struct net_devic
+@@ -2105,10 +2105,10 @@ static int pcnet32_open(struct net_device *dev)
                 * There is really no good other way to handle multiple PHYs
                 * other than turning off all automatics
                 */
@@ -31943,7 +33720,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
  
                if (!(lp->options & PCNET32_PORT_ASEL)) {
                        /* setup ecmd */
-@@ -2118,7 +2118,7 @@ static int pcnet32_open(struct net_devic
+@@ -2118,7 +2118,7 @@ static int pcnet32_open(struct net_device *dev)
                        ethtool_cmd_speed_set(&ecmd,
                                              (lp->options & PCNET32_PORT_100) ?
                                              SPEED_100 : SPEED_10);
@@ -31952,7 +33729,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
  
                        if (lp->options & PCNET32_PORT_FD) {
                                ecmd.duplex = DUPLEX_FULL;
-@@ -2127,7 +2127,7 @@ static int pcnet32_open(struct net_devic
+@@ -2127,7 +2127,7 @@ static int pcnet32_open(struct net_device *dev)
                                ecmd.duplex = DUPLEX_HALF;
                                bcr9 |= ~(1 << 0);
                        }
@@ -31961,7 +33738,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
                }
  
                for (i = 0; i < PCNET32_MAX_PHYS; i++) {
-@@ -2158,9 +2158,9 @@ static int pcnet32_open(struct net_devic
+@@ -2158,9 +2158,9 @@ static int pcnet32_open(struct net_device *dev)
  
  #ifdef DO_DXSUFLO
        if (lp->dxsuflo) {      /* Disable transmit stop on underflow */
@@ -31973,7 +33750,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
        }
  #endif
  
-@@ -2176,11 +2176,11 @@ static int pcnet32_open(struct net_devic
+@@ -2176,11 +2176,11 @@ static int pcnet32_open(struct net_device *dev)
        napi_enable(&lp->napi);
  
        /* Re-initialize the PCNET32, and start it when done. */
@@ -31989,7 +33766,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
  
        netif_start_queue(dev);
  
-@@ -2192,19 +2192,19 @@ static int pcnet32_open(struct net_devic
+@@ -2192,19 +2192,19 @@ static int pcnet32_open(struct net_device *dev)
  
        i = 0;
        while (i++ < 100)
@@ -32021,7 +33798,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
  
  err_free_irq:
        spin_unlock_irqrestore(&lp->lock, flags);
-@@ -2323,7 +2323,7 @@ static void pcnet32_restart(struct net_d
+@@ -2323,7 +2323,7 @@ static void pcnet32_restart(struct net_device *dev, unsigned int csr0_bits)
  
        /* wait for stop */
        for (i = 0; i < 100; i++)
@@ -32030,7 +33807,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
                        break;
  
        if (i >= 100)
-@@ -2335,13 +2335,13 @@ static void pcnet32_restart(struct net_d
+@@ -2335,13 +2335,13 @@ static void pcnet32_restart(struct net_device *dev, unsigned int csr0_bits)
                return;
  
        /* ReInit Ring */
@@ -32047,7 +33824,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
  }
  
  static void pcnet32_tx_timeout(struct net_device *dev)
-@@ -2353,8 +2353,8 @@ static void pcnet32_tx_timeout(struct ne
+@@ -2353,8 +2353,8 @@ static void pcnet32_tx_timeout(struct net_device *dev)
        /* Transmitter timeout, serious problems. */
        if (pcnet32_debug & NETIF_MSG_DRV)
                pr_err("%s: transmit timed out, status %4.4x, resetting\n",
@@ -32058,7 +33835,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
        dev->stats.tx_errors++;
        if (netif_msg_tx_err(lp)) {
                int i;
-@@ -2397,7 +2397,7 @@ static netdev_tx_t pcnet32_start_xmit(st
+@@ -2397,7 +2397,7 @@ static netdev_tx_t pcnet32_start_xmit(struct sk_buff *skb,
  
        netif_printk(lp, tx_queued, KERN_DEBUG, dev,
                     "%s() called, csr0 %4.4x\n",
@@ -32067,7 +33844,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
  
        /* Default status -- will not enable Successful-TxDone
         * interrupt when that option is available to us.
-@@ -2427,7 +2427,7 @@ static netdev_tx_t pcnet32_start_xmit(st
+@@ -2427,7 +2427,7 @@ static netdev_tx_t pcnet32_start_xmit(struct sk_buff *skb,
        dev->stats.tx_bytes += skb->len;
  
        /* Trigger an immediate send poll. */
@@ -32120,7 +33897,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
  
        spin_unlock(&lp->lock);
  
-@@ -2520,20 +2520,20 @@ static int pcnet32_close(struct net_devi
+@@ -2520,20 +2520,20 @@ static int pcnet32_close(struct net_device *dev)
  
        spin_lock_irqsave(&lp->lock, flags);
  
@@ -32145,7 +33922,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
  
        spin_unlock_irqrestore(&lp->lock, flags);
  
-@@ -2556,7 +2556,7 @@ static struct net_device_stats *pcnet32_
+@@ -2556,7 +2556,7 @@ static struct net_device_stats *pcnet32_get_stats(struct net_device *dev)
        unsigned long flags;
  
        spin_lock_irqsave(&lp->lock, flags);
@@ -32154,7 +33931,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
        spin_unlock_irqrestore(&lp->lock, flags);
  
        return &dev->stats;
-@@ -2577,10 +2577,10 @@ static void pcnet32_load_multicast(struc
+@@ -2577,10 +2577,10 @@ static void pcnet32_load_multicast(struct net_device *dev)
        if (dev->flags & IFF_ALLMULTI) {
                ib->filter[0] = cpu_to_le32(~0U);
                ib->filter[1] = cpu_to_le32(~0U);
@@ -32169,7 +33946,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
                return;
        }
        /* clear the multicast filter */
-@@ -2594,7 +2594,7 @@ static void pcnet32_load_multicast(struc
+@@ -2594,7 +2594,7 @@ static void pcnet32_load_multicast(struct net_device *dev)
                mcast_table[crc >> 4] |= cpu_to_le16(1 << (crc & 0xf));
        }
        for (i = 0; i < 4; i++)
@@ -32178,7 +33955,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
                                le16_to_cpu(mcast_table[i]));
  }
  
-@@ -2609,28 +2609,28 @@ static void pcnet32_set_multicast_list(s
+@@ -2609,28 +2609,28 @@ static void pcnet32_set_multicast_list(struct net_device *dev)
  
        spin_lock_irqsave(&lp->lock, flags);
        suspended = pcnet32_suspend(dev, &flags, 0);
@@ -32213,7 +33990,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
                pcnet32_restart(dev, CSR0_NORMAL);
                netif_wake_queue(dev);
        }
-@@ -2648,8 +2648,8 @@ static int mdio_read(struct net_device *
+@@ -2648,8 +2648,8 @@ static int mdio_read(struct net_device *dev, int phy_id, int reg_num)
        if (!lp->mii)
                return 0;
  
@@ -32224,7 +34001,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
  
        return val_out;
  }
-@@ -2663,8 +2663,8 @@ static void mdio_write(struct net_device
+@@ -2663,8 +2663,8 @@ static void mdio_write(struct net_device *dev, int phy_id, int reg_num, int val)
        if (!lp->mii)
                return;
  
@@ -32235,7 +34012,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
  }
  
  static int pcnet32_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
-@@ -2741,7 +2741,7 @@ static void pcnet32_check_media(struct n
+@@ -2741,7 +2741,7 @@ static void pcnet32_check_media(struct net_device *dev, int verbose)
                curr_link = mii_link_ok(&lp->mii_if);
        } else {
                ulong ioaddr = dev->base_addr;  /* card base I/O address */
@@ -32244,7 +34021,7 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
        }
        if (!curr_link) {
                if (prev_link || verbose) {
-@@ -2764,13 +2764,13 @@ static void pcnet32_check_media(struct n
+@@ -2764,13 +2764,13 @@ static void pcnet32_check_media(struct net_device *dev, int verbose)
                                            (ecmd.duplex == DUPLEX_FULL)
                                            ? "full" : "half");
                        }
@@ -32260,10 +34037,11 @@ diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
                        }
                } else {
                        netif_info(lp, link, dev, "link up\n");
-diff -urNp linux-3.1.3/drivers/net/ppp_generic.c linux-3.1.3/drivers/net/ppp_generic.c
---- linux-3.1.3/drivers/net/ppp_generic.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/ppp_generic.c      2011-11-16 18:39:07.000000000 -0500
-@@ -987,7 +987,6 @@ ppp_net_ioctl(struct net_device *dev, st
+diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
+index edfa15d..002bfa9 100644
+--- a/drivers/net/ppp_generic.c
++++ b/drivers/net/ppp_generic.c
+@@ -987,7 +987,6 @@ ppp_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
        void __user *addr = (void __user *) ifr->ifr_ifru.ifru_data;
        struct ppp_stats stats;
        struct ppp_comp_stats cstats;
@@ -32271,7 +34049,7 @@ diff -urNp linux-3.1.3/drivers/net/ppp_generic.c linux-3.1.3/drivers/net/ppp_gen
  
        switch (cmd) {
        case SIOCGPPPSTATS:
-@@ -1009,8 +1008,7 @@ ppp_net_ioctl(struct net_device *dev, st
+@@ -1009,8 +1008,7 @@ ppp_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
                break;
  
        case SIOCGPPPVER:
@@ -32281,9 +34059,10 @@ diff -urNp linux-3.1.3/drivers/net/ppp_generic.c linux-3.1.3/drivers/net/ppp_gen
                        break;
                err = 0;
                break;
-diff -urNp linux-3.1.3/drivers/net/r8169.c linux-3.1.3/drivers/net/r8169.c
---- linux-3.1.3/drivers/net/r8169.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/r8169.c    2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 6d657ca..d1be94b 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
 @@ -663,12 +663,12 @@ struct rtl8169_private {
        struct mdio_ops {
                void (*write)(void __iomem *, int, int);
@@ -32299,10 +34078,11 @@ diff -urNp linux-3.1.3/drivers/net/r8169.c linux-3.1.3/drivers/net/r8169.c
  
        int (*set_speed)(struct net_device *, u8 aneg, u16 sp, u8 dpx, u32 adv);
        int (*get_settings)(struct net_device *, struct ethtool_cmd *);
-diff -urNp linux-3.1.3/drivers/net/sis190.c linux-3.1.3/drivers/net/sis190.c
---- linux-3.1.3/drivers/net/sis190.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/sis190.c   2011-11-16 18:39:07.000000000 -0500
-@@ -1624,7 +1624,7 @@ static int __devinit sis190_get_mac_addr
+diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
+index 3c0f131..17f8b02 100644
+--- a/drivers/net/sis190.c
++++ b/drivers/net/sis190.c
+@@ -1624,7 +1624,7 @@ static int __devinit sis190_get_mac_addr_from_eeprom(struct pci_dev *pdev,
  static int __devinit sis190_get_mac_addr_from_apc(struct pci_dev *pdev,
                                                  struct net_device *dev)
  {
@@ -32311,9 +34091,10 @@ diff -urNp linux-3.1.3/drivers/net/sis190.c linux-3.1.3/drivers/net/sis190.c
        struct sis190_private *tp = netdev_priv(dev);
        struct pci_dev *isa_bridge;
        u8 reg, tmp8;
-diff -urNp linux-3.1.3/drivers/net/sundance.c linux-3.1.3/drivers/net/sundance.c
---- linux-3.1.3/drivers/net/sundance.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/sundance.c 2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c
+index 4793df8..44c9849 100644
+--- a/drivers/net/sundance.c
++++ b/drivers/net/sundance.c
 @@ -218,7 +218,7 @@ enum {
  struct pci_id_info {
          const char *name;
@@ -32323,9 +34104,10 @@ diff -urNp linux-3.1.3/drivers/net/sundance.c linux-3.1.3/drivers/net/sundance.c
        {"D-Link DFE-550TX FAST Ethernet Adapter"},
        {"D-Link DFE-550FX 100Mbps Fiber-optics Adapter"},
        {"D-Link DFE-580TX 4 port Server Adapter"},
-diff -urNp linux-3.1.3/drivers/net/tg3.h linux-3.1.3/drivers/net/tg3.h
---- linux-3.1.3/drivers/net/tg3.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/tg3.h      2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 2ea456d..3ad9523 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
 @@ -134,6 +134,7 @@
  #define  CHIPREV_ID_5750_A0            0x4000
  #define  CHIPREV_ID_5750_A1            0x4001
@@ -32334,10 +34116,11 @@ diff -urNp linux-3.1.3/drivers/net/tg3.h linux-3.1.3/drivers/net/tg3.h
  #define  CHIPREV_ID_5750_C2            0x4202
  #define  CHIPREV_ID_5752_A0_HW                 0x5000
  #define  CHIPREV_ID_5752_A0            0x6000
-diff -urNp linux-3.1.3/drivers/net/tokenring/abyss.c linux-3.1.3/drivers/net/tokenring/abyss.c
---- linux-3.1.3/drivers/net/tokenring/abyss.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/tokenring/abyss.c  2011-11-16 18:39:07.000000000 -0500
-@@ -451,10 +451,12 @@ static struct pci_driver abyss_driver = 
+diff --git a/drivers/net/tokenring/abyss.c b/drivers/net/tokenring/abyss.c
+index 515f122..41dd273 100644
+--- a/drivers/net/tokenring/abyss.c
++++ b/drivers/net/tokenring/abyss.c
+@@ -451,10 +451,12 @@ static struct pci_driver abyss_driver = {
  
  static int __init abyss_init (void)
  {
@@ -32353,10 +34136,11 @@ diff -urNp linux-3.1.3/drivers/net/tokenring/abyss.c linux-3.1.3/drivers/net/tok
  
        return pci_register_driver(&abyss_driver);
  }
-diff -urNp linux-3.1.3/drivers/net/tokenring/madgemc.c linux-3.1.3/drivers/net/tokenring/madgemc.c
---- linux-3.1.3/drivers/net/tokenring/madgemc.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/tokenring/madgemc.c        2011-11-16 18:39:07.000000000 -0500
-@@ -744,9 +744,11 @@ static struct mca_driver madgemc_driver 
+diff --git a/drivers/net/tokenring/madgemc.c b/drivers/net/tokenring/madgemc.c
+index 6153cfd..cf69c1c 100644
+--- a/drivers/net/tokenring/madgemc.c
++++ b/drivers/net/tokenring/madgemc.c
+@@ -744,9 +744,11 @@ static struct mca_driver madgemc_driver = {
  
  static int __init madgemc_init (void)
  {
@@ -32371,9 +34155,10 @@ diff -urNp linux-3.1.3/drivers/net/tokenring/madgemc.c linux-3.1.3/drivers/net/t
  
        return mca_register_driver (&madgemc_driver);
  }
-diff -urNp linux-3.1.3/drivers/net/tokenring/proteon.c linux-3.1.3/drivers/net/tokenring/proteon.c
---- linux-3.1.3/drivers/net/tokenring/proteon.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/tokenring/proteon.c        2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/net/tokenring/proteon.c b/drivers/net/tokenring/proteon.c
+index 8d362e6..f91cc52 100644
+--- a/drivers/net/tokenring/proteon.c
++++ b/drivers/net/tokenring/proteon.c
 @@ -353,9 +353,11 @@ static int __init proteon_init(void)
        struct platform_device *pdev;
        int i, num = 0, err = 0;
@@ -32389,9 +34174,10 @@ diff -urNp linux-3.1.3/drivers/net/tokenring/proteon.c linux-3.1.3/drivers/net/t
  
        err = platform_driver_register(&proteon_driver);
        if (err)
-diff -urNp linux-3.1.3/drivers/net/tokenring/skisa.c linux-3.1.3/drivers/net/tokenring/skisa.c
---- linux-3.1.3/drivers/net/tokenring/skisa.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/tokenring/skisa.c  2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/net/tokenring/skisa.c b/drivers/net/tokenring/skisa.c
+index 46db5c5..37c1536 100644
+--- a/drivers/net/tokenring/skisa.c
++++ b/drivers/net/tokenring/skisa.c
 @@ -363,9 +363,11 @@ static int __init sk_isa_init(void)
        struct platform_device *pdev;
        int i, num = 0, err = 0;
@@ -32407,10 +34193,11 @@ diff -urNp linux-3.1.3/drivers/net/tokenring/skisa.c linux-3.1.3/drivers/net/tok
  
        err = platform_driver_register(&sk_isa_driver);
        if (err)
-diff -urNp linux-3.1.3/drivers/net/tulip/de2104x.c linux-3.1.3/drivers/net/tulip/de2104x.c
---- linux-3.1.3/drivers/net/tulip/de2104x.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/tulip/de2104x.c    2011-11-16 18:40:22.000000000 -0500
-@@ -1795,6 +1795,8 @@ static void __devinit de21041_get_srom_i
+diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
+index ce90efc..2676f89 100644
+--- a/drivers/net/tulip/de2104x.c
++++ b/drivers/net/tulip/de2104x.c
+@@ -1795,6 +1795,8 @@ static void __devinit de21041_get_srom_info (struct de_private *de)
        struct de_srom_info_leaf *il;
        void *bufp;
  
@@ -32419,10 +34206,11 @@ diff -urNp linux-3.1.3/drivers/net/tulip/de2104x.c linux-3.1.3/drivers/net/tulip
        /* download entire eeprom */
        for (i = 0; i < DE_EEPROM_WORDS; i++)
                ((__le16 *)ee_data)[i] =
-diff -urNp linux-3.1.3/drivers/net/tulip/de4x5.c linux-3.1.3/drivers/net/tulip/de4x5.c
---- linux-3.1.3/drivers/net/tulip/de4x5.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/tulip/de4x5.c      2011-11-16 18:39:07.000000000 -0500
-@@ -5397,7 +5397,7 @@ de4x5_ioctl(struct net_device *dev, stru
+diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c
+index 959b410..c97fac2 100644
+--- a/drivers/net/tulip/de4x5.c
++++ b/drivers/net/tulip/de4x5.c
+@@ -5397,7 +5397,7 @@ de4x5_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
        for (i=0; i<ETH_ALEN; i++) {
            tmp.addr[i] = dev->dev_addr[i];
        }
@@ -32431,7 +34219,7 @@ diff -urNp linux-3.1.3/drivers/net/tulip/de4x5.c linux-3.1.3/drivers/net/tulip/d
        break;
  
      case DE4X5_SET_HWADDR:           /* Set the hardware address */
-@@ -5437,7 +5437,7 @@ de4x5_ioctl(struct net_device *dev, stru
+@@ -5437,7 +5437,7 @@ de4x5_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
        spin_lock_irqsave(&lp->lock, flags);
        memcpy(&statbuf, &lp->pktStats, ioc->len);
        spin_unlock_irqrestore(&lp->lock, flags);
@@ -32440,10 +34228,11 @@ diff -urNp linux-3.1.3/drivers/net/tulip/de4x5.c linux-3.1.3/drivers/net/tulip/d
                return -EFAULT;
        break;
      }
-diff -urNp linux-3.1.3/drivers/net/tulip/eeprom.c linux-3.1.3/drivers/net/tulip/eeprom.c
---- linux-3.1.3/drivers/net/tulip/eeprom.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/tulip/eeprom.c     2011-11-16 18:39:07.000000000 -0500
-@@ -81,7 +81,7 @@ static struct eeprom_fixup eeprom_fixups
+diff --git a/drivers/net/tulip/eeprom.c b/drivers/net/tulip/eeprom.c
+index fa5eee9..e074432 100644
+--- a/drivers/net/tulip/eeprom.c
++++ b/drivers/net/tulip/eeprom.c
+@@ -81,7 +81,7 @@ static struct eeprom_fixup eeprom_fixups[] __devinitdata = {
    {NULL}};
  
  
@@ -32452,9 +34241,10 @@ diff -urNp linux-3.1.3/drivers/net/tulip/eeprom.c linux-3.1.3/drivers/net/tulip/
        "21140 non-MII",
        "21140 MII PHY",
        "21142 Serial PHY",
-diff -urNp linux-3.1.3/drivers/net/tulip/winbond-840.c linux-3.1.3/drivers/net/tulip/winbond-840.c
---- linux-3.1.3/drivers/net/tulip/winbond-840.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/tulip/winbond-840.c        2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c
+index 862eadf..3eee1e6 100644
+--- a/drivers/net/tulip/winbond-840.c
++++ b/drivers/net/tulip/winbond-840.c
 @@ -236,7 +236,7 @@ struct pci_id_info {
          int drv_flags;                /* Driver use, intended as capability flags. */
  };
@@ -32464,9 +34254,10 @@ diff -urNp linux-3.1.3/drivers/net/tulip/winbond-840.c linux-3.1.3/drivers/net/t
        {                               /* Sometime a Level-One switch card. */
          "Winbond W89c840",    CanHaveMII | HasBrokenTx | FDXOnNoMII},
        { "Winbond W89c840",    CanHaveMII | HasBrokenTx},
-diff -urNp linux-3.1.3/drivers/net/usb/hso.c linux-3.1.3/drivers/net/usb/hso.c
---- linux-3.1.3/drivers/net/usb/hso.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/usb/hso.c  2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
+index 304fe78..db112fa 100644
+--- a/drivers/net/usb/hso.c
++++ b/drivers/net/usb/hso.c
 @@ -71,7 +71,7 @@
  #include <asm/byteorder.h>
  #include <linux/serial_core.h>
@@ -32485,7 +34276,7 @@ diff -urNp linux-3.1.3/drivers/net/usb/hso.c linux-3.1.3/drivers/net/usb/hso.c
        spinlock_t serial_lock;
  
        int (*write_data) (struct hso_serial *serial);
-@@ -1190,7 +1190,7 @@ static void put_rxbuf_data_and_resubmit_
+@@ -1190,7 +1190,7 @@ static void put_rxbuf_data_and_resubmit_ctrl_urb(struct hso_serial *serial)
        struct urb *urb;
  
        urb = serial->rx_urb[0];
@@ -32494,7 +34285,7 @@ diff -urNp linux-3.1.3/drivers/net/usb/hso.c linux-3.1.3/drivers/net/usb/hso.c
                count = put_rxbuf_data(urb, serial);
                if (count == -1)
                        return;
-@@ -1226,7 +1226,7 @@ static void hso_std_serial_read_bulk_cal
+@@ -1226,7 +1226,7 @@ static void hso_std_serial_read_bulk_callback(struct urb *urb)
        DUMP1(urb->transfer_buffer, urb->actual_length);
  
        /* Anyone listening? */
@@ -32503,7 +34294,7 @@ diff -urNp linux-3.1.3/drivers/net/usb/hso.c linux-3.1.3/drivers/net/usb/hso.c
                return;
  
        if (status == 0) {
-@@ -1311,8 +1311,7 @@ static int hso_serial_open(struct tty_st
+@@ -1311,8 +1311,7 @@ static int hso_serial_open(struct tty_struct *tty, struct file *filp)
        spin_unlock_irq(&serial->serial_lock);
  
        /* check for port already opened, if not set the termios */
@@ -32513,7 +34304,7 @@ diff -urNp linux-3.1.3/drivers/net/usb/hso.c linux-3.1.3/drivers/net/usb/hso.c
                serial->rx_state = RX_IDLE;
                /* Force default termio settings */
                _hso_serial_set_termios(tty, NULL);
-@@ -1324,7 +1323,7 @@ static int hso_serial_open(struct tty_st
+@@ -1324,7 +1323,7 @@ static int hso_serial_open(struct tty_struct *tty, struct file *filp)
                result = hso_start_serial_device(serial->parent, GFP_KERNEL);
                if (result) {
                        hso_stop_serial_device(serial->parent);
@@ -32522,7 +34313,7 @@ diff -urNp linux-3.1.3/drivers/net/usb/hso.c linux-3.1.3/drivers/net/usb/hso.c
                        kref_put(&serial->parent->ref, hso_serial_ref_free);
                }
        } else {
-@@ -1361,10 +1360,10 @@ static void hso_serial_close(struct tty_
+@@ -1361,10 +1360,10 @@ static void hso_serial_close(struct tty_struct *tty, struct file *filp)
  
        /* reset the rts and dtr */
        /* do the actual close */
@@ -32536,7 +34327,7 @@ diff -urNp linux-3.1.3/drivers/net/usb/hso.c linux-3.1.3/drivers/net/usb/hso.c
                spin_lock_irq(&serial->serial_lock);
                if (serial->tty == tty) {
                        serial->tty->driver_data = NULL;
-@@ -1446,7 +1445,7 @@ static void hso_serial_set_termios(struc
+@@ -1446,7 +1445,7 @@ static void hso_serial_set_termios(struct tty_struct *tty, struct ktermios *old)
  
        /* the actual setup */
        spin_lock_irqsave(&serial->serial_lock, flags);
@@ -32545,7 +34336,7 @@ diff -urNp linux-3.1.3/drivers/net/usb/hso.c linux-3.1.3/drivers/net/usb/hso.c
                _hso_serial_set_termios(tty, old);
        else
                tty->termios = old;
-@@ -1905,7 +1904,7 @@ static void intr_callback(struct urb *ur
+@@ -1905,7 +1904,7 @@ static void intr_callback(struct urb *urb)
                                D1("Pending read interrupt on port %d\n", i);
                                spin_lock(&serial->serial_lock);
                                if (serial->rx_state == RX_IDLE &&
@@ -32554,7 +34345,7 @@ diff -urNp linux-3.1.3/drivers/net/usb/hso.c linux-3.1.3/drivers/net/usb/hso.c
                                        /* Setup and send a ctrl req read on
                                         * port i */
                                        if (!serial->rx_urb_filled[0]) {
-@@ -3098,7 +3097,7 @@ static int hso_resume(struct usb_interfa
+@@ -3098,7 +3097,7 @@ static int hso_resume(struct usb_interface *iface)
        /* Start all serial ports */
        for (i = 0; i < HSO_SERIAL_TTY_MINORS; i++) {
                if (serial_table[i] && (serial_table[i]->interface == iface)) {
@@ -32563,10 +34354,11 @@ diff -urNp linux-3.1.3/drivers/net/usb/hso.c linux-3.1.3/drivers/net/usb/hso.c
                                result =
                                    hso_start_serial_device(serial_table[i], GFP_NOIO);
                                hso_kick_transmit(dev2ser(serial_table[i]));
-diff -urNp linux-3.1.3/drivers/net/vmxnet3/vmxnet3_ethtool.c linux-3.1.3/drivers/net/vmxnet3/vmxnet3_ethtool.c
---- linux-3.1.3/drivers/net/vmxnet3/vmxnet3_ethtool.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/vmxnet3/vmxnet3_ethtool.c  2011-11-16 18:39:07.000000000 -0500
-@@ -601,8 +601,7 @@ vmxnet3_set_rss_indir(struct net_device 
+diff --git a/drivers/net/vmxnet3/vmxnet3_ethtool.c b/drivers/net/vmxnet3/vmxnet3_ethtool.c
+index 27400ed..c796e05 100644
+--- a/drivers/net/vmxnet3/vmxnet3_ethtool.c
++++ b/drivers/net/vmxnet3/vmxnet3_ethtool.c
+@@ -601,8 +601,7 @@ vmxnet3_set_rss_indir(struct net_device *netdev,
                 * Return with error code if any of the queue indices
                 * is out of range
                 */
@@ -32576,9 +34368,10 @@ diff -urNp linux-3.1.3/drivers/net/vmxnet3/vmxnet3_ethtool.c linux-3.1.3/drivers
                        return -EINVAL;
        }
  
-diff -urNp linux-3.1.3/drivers/net/vxge/vxge-config.h linux-3.1.3/drivers/net/vxge/vxge-config.h
---- linux-3.1.3/drivers/net/vxge/vxge-config.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/vxge/vxge-config.h 2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/net/vxge/vxge-config.h b/drivers/net/vxge/vxge-config.h
+index dd36258..e47fd31 100644
+--- a/drivers/net/vxge/vxge-config.h
++++ b/drivers/net/vxge/vxge-config.h
 @@ -514,7 +514,7 @@ struct vxge_hw_uld_cbs {
        void (*link_down)(struct __vxge_hw_device *devh);
        void (*crit_err)(struct __vxge_hw_device *devh,
@@ -32588,10 +34381,11 @@ diff -urNp linux-3.1.3/drivers/net/vxge/vxge-config.h linux-3.1.3/drivers/net/vx
  
  /*
   * struct __vxge_hw_blockpool_entry - Block private data structure
-diff -urNp linux-3.1.3/drivers/net/vxge/vxge-main.c linux-3.1.3/drivers/net/vxge/vxge-main.c
---- linux-3.1.3/drivers/net/vxge/vxge-main.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/vxge/vxge-main.c   2011-11-16 18:40:22.000000000 -0500
-@@ -100,6 +100,8 @@ static inline void VXGE_COMPLETE_VPATH_T
+diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c
+index 178348a2..18bb433 100644
+--- a/drivers/net/vxge/vxge-main.c
++++ b/drivers/net/vxge/vxge-main.c
+@@ -100,6 +100,8 @@ static inline void VXGE_COMPLETE_VPATH_TX(struct vxge_fifo *fifo)
        struct sk_buff *completed[NR_SKB_COMPLETED];
        int more;
  
@@ -32600,7 +34394,7 @@ diff -urNp linux-3.1.3/drivers/net/vxge/vxge-main.c linux-3.1.3/drivers/net/vxge
        do {
                more = 0;
                skb_ptr = completed;
-@@ -1915,6 +1917,8 @@ static enum vxge_hw_status vxge_rth_conf
+@@ -1915,6 +1917,8 @@ static enum vxge_hw_status vxge_rth_configure(struct vxgedev *vdev)
        u8 mtable[256] = {0}; /* CPU to vpath mapping  */
        int index;
  
@@ -32609,9 +34403,10 @@ diff -urNp linux-3.1.3/drivers/net/vxge/vxge-main.c linux-3.1.3/drivers/net/vxge
        /*
         * Filling
         *      - itable with bucket numbers
-diff -urNp linux-3.1.3/drivers/net/vxge/vxge-traffic.h linux-3.1.3/drivers/net/vxge/vxge-traffic.h
---- linux-3.1.3/drivers/net/vxge/vxge-traffic.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/vxge/vxge-traffic.h        2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/net/vxge/vxge-traffic.h b/drivers/net/vxge/vxge-traffic.h
+index 4a518a3..936b334 100644
+--- a/drivers/net/vxge/vxge-traffic.h
++++ b/drivers/net/vxge/vxge-traffic.h
 @@ -2088,7 +2088,7 @@ struct vxge_hw_mempool_cbs {
                        struct vxge_hw_mempool_dma      *dma_object,
                        u32                     index,
@@ -32621,10 +34416,11 @@ diff -urNp linux-3.1.3/drivers/net/vxge/vxge-traffic.h linux-3.1.3/drivers/net/v
  
  #define VXGE_HW_VIRTUAL_PATH_HANDLE(vpath)                            \
                ((struct __vxge_hw_vpath_handle *)(vpath)->vpath_handles.next)
-diff -urNp linux-3.1.3/drivers/net/wan/hdlc_x25.c linux-3.1.3/drivers/net/wan/hdlc_x25.c
---- linux-3.1.3/drivers/net/wan/hdlc_x25.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/wan/hdlc_x25.c     2011-11-16 18:39:07.000000000 -0500
-@@ -134,16 +134,16 @@ static netdev_tx_t x25_xmit(struct sk_bu
+diff --git a/drivers/net/wan/hdlc_x25.c b/drivers/net/wan/hdlc_x25.c
+index 56aeb01..547f71f 100644
+--- a/drivers/net/wan/hdlc_x25.c
++++ b/drivers/net/wan/hdlc_x25.c
+@@ -134,16 +134,16 @@ static netdev_tx_t x25_xmit(struct sk_buff *skb, struct net_device *dev)
  
  static int x25_open(struct net_device *dev)
  {
@@ -32649,10 +34445,11 @@ diff -urNp linux-3.1.3/drivers/net/wan/hdlc_x25.c linux-3.1.3/drivers/net/wan/hd
        result = lapb_register(dev, &cb);
        if (result != LAPB_OK)
                return result;
-diff -urNp linux-3.1.3/drivers/net/wimax/i2400m/usb-fw.c linux-3.1.3/drivers/net/wimax/i2400m/usb-fw.c
---- linux-3.1.3/drivers/net/wimax/i2400m/usb-fw.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/wimax/i2400m/usb-fw.c      2011-11-16 18:40:22.000000000 -0500
-@@ -287,6 +287,8 @@ ssize_t i2400mu_bus_bm_wait_for_ack(stru
+diff --git a/drivers/net/wimax/i2400m/usb-fw.c b/drivers/net/wimax/i2400m/usb-fw.c
+index 1fda46c..f2858f2 100644
+--- a/drivers/net/wimax/i2400m/usb-fw.c
++++ b/drivers/net/wimax/i2400m/usb-fw.c
+@@ -287,6 +287,8 @@ ssize_t i2400mu_bus_bm_wait_for_ack(struct i2400m *i2400m,
        int do_autopm = 1;
        DECLARE_COMPLETION_ONSTACK(notif_completion);
  
@@ -32661,10 +34458,11 @@ diff -urNp linux-3.1.3/drivers/net/wimax/i2400m/usb-fw.c linux-3.1.3/drivers/net
        d_fnstart(8, dev, "(i2400m %p ack %p size %zu)\n",
                  i2400m, ack, ack_size);
        BUG_ON(_ack == i2400m->bm_ack_buf);
-diff -urNp linux-3.1.3/drivers/net/wireless/airo.c linux-3.1.3/drivers/net/wireless/airo.c
---- linux-3.1.3/drivers/net/wireless/airo.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/wireless/airo.c    2011-11-16 18:40:22.000000000 -0500
-@@ -3003,6 +3003,8 @@ static void airo_process_scan_results (s
+diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
+index e1b3e3c..e413f18 100644
+--- a/drivers/net/wireless/airo.c
++++ b/drivers/net/wireless/airo.c
+@@ -3003,6 +3003,8 @@ static void airo_process_scan_results (struct airo_info *ai) {
        BSSListElement * loop_net;
        BSSListElement * tmp_net;
  
@@ -32673,7 +34471,7 @@ diff -urNp linux-3.1.3/drivers/net/wireless/airo.c linux-3.1.3/drivers/net/wirel
        /* Blow away current list of scan results */
        list_for_each_entry_safe (loop_net, tmp_net, &ai->network_list, list) {
                list_move_tail (&loop_net->list, &ai->network_free_list);
-@@ -3794,6 +3796,8 @@ static u16 setup_card(struct airo_info *
+@@ -3794,6 +3796,8 @@ static u16 setup_card(struct airo_info *ai, u8 *mac, int lock)
        WepKeyRid wkr;
        int rc;
  
@@ -32682,7 +34480,7 @@ diff -urNp linux-3.1.3/drivers/net/wireless/airo.c linux-3.1.3/drivers/net/wirel
        memset( &mySsid, 0, sizeof( mySsid ) );
        kfree (ai->flash);
        ai->flash = NULL;
-@@ -4753,6 +4757,8 @@ static int proc_stats_rid_open( struct i
+@@ -4753,6 +4757,8 @@ static int proc_stats_rid_open( struct inode *inode,
        __le32 *vals = stats.vals;
        int len;
  
@@ -32691,7 +34489,7 @@ diff -urNp linux-3.1.3/drivers/net/wireless/airo.c linux-3.1.3/drivers/net/wirel
        if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
                return -ENOMEM;
        data = file->private_data;
-@@ -5476,6 +5482,8 @@ static int proc_BSSList_open( struct ino
+@@ -5476,6 +5482,8 @@ static int proc_BSSList_open( struct inode *inode, struct file *file ) {
        /* If doLoseSync is not 1, we won't do a Lose Sync */
        int doLoseSync = -1;
  
@@ -32700,7 +34498,7 @@ diff -urNp linux-3.1.3/drivers/net/wireless/airo.c linux-3.1.3/drivers/net/wirel
        if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
                return -ENOMEM;
        data = file->private_data;
-@@ -7181,6 +7189,8 @@ static int airo_get_aplist(struct net_de
+@@ -7181,6 +7189,8 @@ static int airo_get_aplist(struct net_device *dev,
        int i;
        int loseSync = capable(CAP_NET_ADMIN) ? 1: -1;
  
@@ -32709,7 +34507,7 @@ diff -urNp linux-3.1.3/drivers/net/wireless/airo.c linux-3.1.3/drivers/net/wirel
        qual = kmalloc(IW_MAX_AP * sizeof(*qual), GFP_KERNEL);
        if (!qual)
                return -ENOMEM;
-@@ -7741,6 +7751,8 @@ static void airo_read_wireless_stats(str
+@@ -7741,6 +7751,8 @@ static void airo_read_wireless_stats(struct airo_info *local)
        CapabilityRid cap_rid;
        __le32 *vals = stats_rid.vals;
  
@@ -32718,10 +34516,23 @@ diff -urNp linux-3.1.3/drivers/net/wireless/airo.c linux-3.1.3/drivers/net/wirel
        /* Get stats out of the card */
        clear_bit(JOB_WSTATS, &local->jobs);
        if (local->power.event) {
-diff -urNp linux-3.1.3/drivers/net/wireless/ath/ath5k/debug.c linux-3.1.3/drivers/net/wireless/ath/ath5k/debug.c
---- linux-3.1.3/drivers/net/wireless/ath/ath5k/debug.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/wireless/ath/ath5k/debug.c 2011-11-16 19:08:21.000000000 -0500
-@@ -203,6 +203,8 @@ static ssize_t read_file_beacon(struct f
+diff --git a/drivers/net/wireless/ath/ath.h b/drivers/net/wireless/ath/ath.h
+index 17c4b56..00d836f 100644
+--- a/drivers/net/wireless/ath/ath.h
++++ b/drivers/net/wireless/ath/ath.h
+@@ -121,6 +121,7 @@ struct ath_ops {
+       void (*write_flush) (void *);
+       u32 (*rmw)(void *, u32 reg_offset, u32 set, u32 clr);
+ };
++typedef struct ath_ops __no_const ath_ops_no_const;
+ struct ath_common;
+ struct ath_bus_ops;
+diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c
+index ccca724..7afbadc 100644
+--- a/drivers/net/wireless/ath/ath5k/debug.c
++++ b/drivers/net/wireless/ath/ath5k/debug.c
+@@ -203,6 +203,8 @@ static ssize_t read_file_beacon(struct file *file, char __user *user_buf,
        unsigned int v;
        u64 tsf;
  
@@ -32730,7 +34541,7 @@ diff -urNp linux-3.1.3/drivers/net/wireless/ath/ath5k/debug.c linux-3.1.3/driver
        v = ath5k_hw_reg_read(ah, AR5K_BEACON);
        len += snprintf(buf + len, sizeof(buf) - len,
                "%-24s0x%08x\tintval: %d\tTIM: 0x%x\n",
-@@ -321,6 +323,8 @@ static ssize_t read_file_debug(struct fi
+@@ -321,6 +323,8 @@ static ssize_t read_file_debug(struct file *file, char __user *user_buf,
        unsigned int len = 0;
        unsigned int i;
  
@@ -32739,7 +34550,7 @@ diff -urNp linux-3.1.3/drivers/net/wireless/ath/ath5k/debug.c linux-3.1.3/driver
        len += snprintf(buf + len, sizeof(buf) - len,
                "DEBUG LEVEL: 0x%08x\n\n", ah->debug.level);
  
-@@ -492,6 +496,8 @@ static ssize_t read_file_misc(struct fil
+@@ -492,6 +496,8 @@ static ssize_t read_file_misc(struct file *file, char __user *user_buf,
        unsigned int len = 0;
        u32 filt = ath5k_hw_get_rx_filter(ah);
  
@@ -32748,7 +34559,7 @@ diff -urNp linux-3.1.3/drivers/net/wireless/ath/ath5k/debug.c linux-3.1.3/driver
        len += snprintf(buf + len, sizeof(buf) - len, "bssid-mask: %pM\n",
                        ah->bssidmask);
        len += snprintf(buf + len, sizeof(buf) - len, "filter-flags: 0x%x ",
-@@ -548,6 +554,8 @@ static ssize_t read_file_frameerrors(str
+@@ -548,6 +554,8 @@ static ssize_t read_file_frameerrors(struct file *file, char __user *user_buf,
        unsigned int len = 0;
        int i;
  
@@ -32757,7 +34568,7 @@ diff -urNp linux-3.1.3/drivers/net/wireless/ath/ath5k/debug.c linux-3.1.3/driver
        len += snprintf(buf + len, sizeof(buf) - len,
                        "RX\n---------------------\n");
        len += snprintf(buf + len, sizeof(buf) - len, "CRC\t%u\t(%u%%)\n",
-@@ -665,6 +673,8 @@ static ssize_t read_file_ani(struct file
+@@ -665,6 +673,8 @@ static ssize_t read_file_ani(struct file *file, char __user *user_buf,
        char buf[700];
        unsigned int len = 0;
  
@@ -32766,7 +34577,7 @@ diff -urNp linux-3.1.3/drivers/net/wireless/ath/ath5k/debug.c linux-3.1.3/driver
        len += snprintf(buf + len, sizeof(buf) - len,
                        "HW has PHY error counters:\t%s\n",
                        ah->ah_capabilities.cap_has_phyerr_counters ?
-@@ -829,6 +839,8 @@ static ssize_t read_file_queue(struct fi
+@@ -829,6 +839,8 @@ static ssize_t read_file_queue(struct file *file, char __user *user_buf,
        struct ath5k_buf *bf, *bf0;
        int i, n;
  
@@ -32775,10 +34586,11 @@ diff -urNp linux-3.1.3/drivers/net/wireless/ath/ath5k/debug.c linux-3.1.3/driver
        len += snprintf(buf + len, sizeof(buf) - len,
                        "available txbuffers: %d\n", ah->txbuf_len);
  
-diff -urNp linux-3.1.3/drivers/net/wireless/ath/ath9k/ar9003_calib.c linux-3.1.3/drivers/net/wireless/ath/ath9k/ar9003_calib.c
---- linux-3.1.3/drivers/net/wireless/ath/ath9k/ar9003_calib.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/wireless/ath/ath9k/ar9003_calib.c  2011-11-16 18:40:22.000000000 -0500
-@@ -758,6 +758,8 @@ static void ar9003_hw_tx_iq_cal_post_pro
+diff --git a/drivers/net/wireless/ath/ath9k/ar9003_calib.c b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
+index 7c2aaad..ad14dee 100644
+--- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c
++++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
+@@ -758,6 +758,8 @@ static void ar9003_hw_tx_iq_cal_post_proc(struct ath_hw *ah)
        int i, im, j;
        int nmeasurement;
  
@@ -32787,10 +34599,11 @@ diff -urNp linux-3.1.3/drivers/net/wireless/ath/ath9k/ar9003_calib.c linux-3.1.3
        for (i = 0; i < AR9300_MAX_CHAINS; i++) {
                if (ah->txchainmask & (1 << i))
                        num_chains++;
-diff -urNp linux-3.1.3/drivers/net/wireless/ath/ath9k/ar9003_paprd.c linux-3.1.3/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
---- linux-3.1.3/drivers/net/wireless/ath/ath9k/ar9003_paprd.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/wireless/ath/ath9k/ar9003_paprd.c  2011-11-16 18:40:22.000000000 -0500
-@@ -406,6 +406,8 @@ static bool create_pa_curve(u32 *data_L,
+diff --git a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
+index f80d1d6..08b773d 100644
+--- a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
++++ b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
+@@ -406,6 +406,8 @@ static bool create_pa_curve(u32 *data_L, u32 *data_U, u32 *pa_table, u16 *gain)
        int theta_low_bin = 0;
        int i;
  
@@ -32799,10 +34612,11 @@ diff -urNp linux-3.1.3/drivers/net/wireless/ath/ath9k/ar9003_paprd.c linux-3.1.3
        /* disregard any bin that contains <= 16 samples */
        thresh_accum_cnt = 16;
        scale_factor = 5;
-diff -urNp linux-3.1.3/drivers/net/wireless/ath/ath9k/debug.c linux-3.1.3/drivers/net/wireless/ath/ath9k/debug.c
---- linux-3.1.3/drivers/net/wireless/ath/ath9k/debug.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/wireless/ath/ath9k/debug.c 2011-11-16 18:40:22.000000000 -0500
-@@ -387,6 +387,8 @@ static ssize_t read_file_interrupt(struc
+diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
+index d1eb896..8b67cd4 100644
+--- a/drivers/net/wireless/ath/ath9k/debug.c
++++ b/drivers/net/wireless/ath/ath9k/debug.c
+@@ -387,6 +387,8 @@ static ssize_t read_file_interrupt(struct file *file, char __user *user_buf,
        char buf[512];
        unsigned int len = 0;
  
@@ -32811,7 +34625,7 @@ diff -urNp linux-3.1.3/drivers/net/wireless/ath/ath9k/debug.c linux-3.1.3/driver
        if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) {
                len += snprintf(buf + len, sizeof(buf) - len,
                        "%8s: %10u\n", "RXLP", sc->debug.stats.istats.rxlp);
-@@ -477,6 +479,8 @@ static ssize_t read_file_wiphy(struct fi
+@@ -477,6 +479,8 @@ static ssize_t read_file_wiphy(struct file *file, char __user *user_buf,
        u8 addr[ETH_ALEN];
        u32 tmp;
  
@@ -32820,10 +34634,11 @@ diff -urNp linux-3.1.3/drivers/net/wireless/ath/ath9k/debug.c linux-3.1.3/driver
        len += snprintf(buf + len, sizeof(buf) - len,
                        "%s (chan=%d  center-freq: %d MHz  channel-type: %d (%s))\n",
                        wiphy_name(sc->hw->wiphy),
-diff -urNp linux-3.1.3/drivers/net/wireless/ath/ath9k/htc_drv_debug.c linux-3.1.3/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
---- linux-3.1.3/drivers/net/wireless/ath/ath9k/htc_drv_debug.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/wireless/ath/ath9k/htc_drv_debug.c 2011-11-16 18:40:22.000000000 -0500
-@@ -31,6 +31,8 @@ static ssize_t read_file_tgt_int_stats(s
+diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
+index d3ff33c..309398e 100644
+--- a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
++++ b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
+@@ -31,6 +31,8 @@ static ssize_t read_file_tgt_int_stats(struct file *file, char __user *user_buf,
        unsigned int len = 0;
        int ret = 0;
  
@@ -32832,7 +34647,7 @@ diff -urNp linux-3.1.3/drivers/net/wireless/ath/ath9k/htc_drv_debug.c linux-3.1.
        memset(&cmd_rsp, 0, sizeof(cmd_rsp));
  
        ath9k_htc_ps_wakeup(priv);
-@@ -89,6 +91,8 @@ static ssize_t read_file_tgt_tx_stats(st
+@@ -89,6 +91,8 @@ static ssize_t read_file_tgt_tx_stats(struct file *file, char __user *user_buf,
        unsigned int len = 0;
        int ret = 0;
  
@@ -32841,7 +34656,7 @@ diff -urNp linux-3.1.3/drivers/net/wireless/ath/ath9k/htc_drv_debug.c linux-3.1.
        memset(&cmd_rsp, 0, sizeof(cmd_rsp));
  
        ath9k_htc_ps_wakeup(priv);
-@@ -159,6 +163,8 @@ static ssize_t read_file_tgt_rx_stats(st
+@@ -159,6 +163,8 @@ static ssize_t read_file_tgt_rx_stats(struct file *file, char __user *user_buf,
        unsigned int len = 0;
        int ret = 0;
  
@@ -32850,7 +34665,7 @@ diff -urNp linux-3.1.3/drivers/net/wireless/ath/ath9k/htc_drv_debug.c linux-3.1.
        memset(&cmd_rsp, 0, sizeof(cmd_rsp));
  
        ath9k_htc_ps_wakeup(priv);
-@@ -203,6 +209,8 @@ static ssize_t read_file_xmit(struct fil
+@@ -203,6 +209,8 @@ static ssize_t read_file_xmit(struct file *file, char __user *user_buf,
        char buf[512];
        unsigned int len = 0;
  
@@ -32859,7 +34674,7 @@ diff -urNp linux-3.1.3/drivers/net/wireless/ath/ath9k/htc_drv_debug.c linux-3.1.
        len += snprintf(buf + len, sizeof(buf) - len,
                        "%20s : %10u\n", "Buffers queued",
                        priv->debug.tx_stats.buf_queued);
-@@ -376,6 +384,8 @@ static ssize_t read_file_slot(struct fil
+@@ -376,6 +384,8 @@ static ssize_t read_file_slot(struct file *file, char __user *user_buf,
        char buf[512];
        unsigned int len = 0;
  
@@ -32868,7 +34683,7 @@ diff -urNp linux-3.1.3/drivers/net/wireless/ath/ath9k/htc_drv_debug.c linux-3.1.
        spin_lock_bh(&priv->tx.tx_lock);
  
        len += snprintf(buf + len, sizeof(buf) - len, "TX slot bitmap : ");
-@@ -411,6 +421,8 @@ static ssize_t read_file_queue(struct fi
+@@ -411,6 +421,8 @@ static ssize_t read_file_queue(struct file *file, char __user *user_buf,
        char buf[512];
        unsigned int len = 0;
  
@@ -32877,9 +34692,10 @@ diff -urNp linux-3.1.3/drivers/net/wireless/ath/ath9k/htc_drv_debug.c linux-3.1.
        len += snprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n",
                        "Mgmt endpoint", skb_queue_len(&priv->tx.mgmt_ep_queue));
  
-diff -urNp linux-3.1.3/drivers/net/wireless/ath/ath9k/hw.h linux-3.1.3/drivers/net/wireless/ath/ath9k/hw.h
---- linux-3.1.3/drivers/net/wireless/ath/ath9k/hw.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/wireless/ath/ath9k/hw.h    2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
+index c798890..c19a8fb 100644
+--- a/drivers/net/wireless/ath/ath9k/hw.h
++++ b/drivers/net/wireless/ath/ath9k/hw.h
 @@ -588,7 +588,7 @@ struct ath_hw_private_ops {
  
        /* ANI */
@@ -32907,21 +34723,11 @@ diff -urNp linux-3.1.3/drivers/net/wireless/ath/ath9k/hw.h linux-3.1.3/drivers/n
  
        struct ieee80211_hw *hw;
        struct ath_common common;
-diff -urNp linux-3.1.3/drivers/net/wireless/ath/ath.h linux-3.1.3/drivers/net/wireless/ath/ath.h
---- linux-3.1.3/drivers/net/wireless/ath/ath.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/wireless/ath/ath.h 2011-11-16 18:39:07.000000000 -0500
-@@ -121,6 +121,7 @@ struct ath_ops {
-       void (*write_flush) (void *);
-       u32 (*rmw)(void *, u32 reg_offset, u32 set, u32 clr);
- };
-+typedef struct ath_ops __no_const ath_ops_no_const;
- struct ath_common;
- struct ath_bus_ops;
-diff -urNp linux-3.1.3/drivers/net/wireless/ipw2x00/ipw2100.c linux-3.1.3/drivers/net/wireless/ipw2x00/ipw2100.c
---- linux-3.1.3/drivers/net/wireless/ipw2x00/ipw2100.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/wireless/ipw2x00/ipw2100.c 2011-11-16 18:40:22.000000000 -0500
-@@ -2102,6 +2102,8 @@ static int ipw2100_set_essid(struct ipw2
+diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
+index ef9ad79..f5f8d80 100644
+--- a/drivers/net/wireless/ipw2x00/ipw2100.c
++++ b/drivers/net/wireless/ipw2x00/ipw2100.c
+@@ -2102,6 +2102,8 @@ static int ipw2100_set_essid(struct ipw2100_priv *priv, char *essid,
        int err;
        DECLARE_SSID_BUF(ssid);
  
@@ -32930,7 +34736,7 @@ diff -urNp linux-3.1.3/drivers/net/wireless/ipw2x00/ipw2100.c linux-3.1.3/driver
        IPW_DEBUG_HC("SSID: '%s'\n", print_ssid(ssid, essid, ssid_len));
  
        if (ssid_len)
-@@ -5451,6 +5453,8 @@ static int ipw2100_set_key(struct ipw210
+@@ -5451,6 +5453,8 @@ static int ipw2100_set_key(struct ipw2100_priv *priv,
        struct ipw2100_wep_key *wep_key = (void *)cmd.host_command_parameters;
        int err;
  
@@ -32939,10 +34745,11 @@ diff -urNp linux-3.1.3/drivers/net/wireless/ipw2x00/ipw2100.c linux-3.1.3/driver
        IPW_DEBUG_HC("WEP_KEY_INFO: index = %d, len = %d/%d\n",
                     idx, keylen, len);
  
-diff -urNp linux-3.1.3/drivers/net/wireless/ipw2x00/libipw_rx.c linux-3.1.3/drivers/net/wireless/ipw2x00/libipw_rx.c
---- linux-3.1.3/drivers/net/wireless/ipw2x00/libipw_rx.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/wireless/ipw2x00/libipw_rx.c       2011-11-16 18:40:22.000000000 -0500
-@@ -1565,6 +1565,8 @@ static void libipw_process_probe_respons
+diff --git a/drivers/net/wireless/ipw2x00/libipw_rx.c b/drivers/net/wireless/ipw2x00/libipw_rx.c
+index 32a9966..de69787 100644
+--- a/drivers/net/wireless/ipw2x00/libipw_rx.c
++++ b/drivers/net/wireless/ipw2x00/libipw_rx.c
+@@ -1565,6 +1565,8 @@ static void libipw_process_probe_response(struct libipw_device
        unsigned long flags;
        DECLARE_SSID_BUF(ssid);
  
@@ -32951,10 +34758,11 @@ diff -urNp linux-3.1.3/drivers/net/wireless/ipw2x00/libipw_rx.c linux-3.1.3/driv
        LIBIPW_DEBUG_SCAN("'%s' (%pM"
                     "): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n",
                     print_ssid(ssid, info_element->data, info_element->len),
-diff -urNp linux-3.1.3/drivers/net/wireless/iwlegacy/iwl3945-base.c linux-3.1.3/drivers/net/wireless/iwlegacy/iwl3945-base.c
---- linux-3.1.3/drivers/net/wireless/iwlegacy/iwl3945-base.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/wireless/iwlegacy/iwl3945-base.c   2011-11-16 18:39:07.000000000 -0500
-@@ -3687,7 +3687,9 @@ static int iwl3945_pci_probe(struct pci_
+diff --git a/drivers/net/wireless/iwlegacy/iwl3945-base.c b/drivers/net/wireless/iwlegacy/iwl3945-base.c
+index 66ee1562..b90412b 100644
+--- a/drivers/net/wireless/iwlegacy/iwl3945-base.c
++++ b/drivers/net/wireless/iwlegacy/iwl3945-base.c
+@@ -3687,7 +3687,9 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
         */
        if (iwl3945_mod_params.disable_hw_scan) {
                IWL_DEBUG_INFO(priv, "Disabling hw_scan\n");
@@ -32965,10 +34773,11 @@ diff -urNp linux-3.1.3/drivers/net/wireless/iwlegacy/iwl3945-base.c linux-3.1.3/
        }
  
        IWL_DEBUG_INFO(priv, "*** LOAD DRIVER ***\n");
-diff -urNp linux-3.1.3/drivers/net/wireless/iwlwifi/iwl-agn-rs.c linux-3.1.3/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
---- linux-3.1.3/drivers/net/wireless/iwlwifi/iwl-agn-rs.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/wireless/iwlwifi/iwl-agn-rs.c      2011-11-16 18:40:22.000000000 -0500
-@@ -920,6 +920,8 @@ static void rs_tx_status(void *priv_r, s
+diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+index 3789ff4..22ab151 100644
+--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
++++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+@@ -920,6 +920,8 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband,
        struct iwl_station_priv *sta_priv = (void *)sta->drv_priv;
        struct iwl_rxon_context *ctx = sta_priv->common.ctx;
  
@@ -32977,7 +34786,7 @@ diff -urNp linux-3.1.3/drivers/net/wireless/iwlwifi/iwl-agn-rs.c linux-3.1.3/dri
        IWL_DEBUG_RATE_LIMIT(priv, "get frame ack response, update rate scale window\n");
  
        /* Treat uninitialized rate scaling data same as non-existing. */
-@@ -2931,6 +2933,8 @@ static void rs_fill_link_cmd(struct iwl_
+@@ -2931,6 +2933,8 @@ static void rs_fill_link_cmd(struct iwl_priv *priv,
                container_of(lq_sta, struct iwl_station_priv, lq_sta);
        struct iwl_link_quality_cmd *lq_cmd = &lq_sta->lq;
  
@@ -32986,10 +34795,26 @@ diff -urNp linux-3.1.3/drivers/net/wireless/iwlwifi/iwl-agn-rs.c linux-3.1.3/dri
        /* Override starting rate (index 0) if needed for debug purposes */
        rs_dbgfs_set_mcs(lq_sta, &new_rate, index);
  
-diff -urNp linux-3.1.3/drivers/net/wireless/iwlwifi/iwl-debugfs.c linux-3.1.3/drivers/net/wireless/iwlwifi/iwl-debugfs.c
---- linux-3.1.3/drivers/net/wireless/iwlwifi/iwl-debugfs.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/wireless/iwlwifi/iwl-debugfs.c     2011-11-16 18:40:22.000000000 -0500
-@@ -561,6 +561,8 @@ static ssize_t iwl_dbgfs_status_read(str
+diff --git a/drivers/net/wireless/iwlwifi/iwl-debug.h b/drivers/net/wireless/iwlwifi/iwl-debug.h
+index f9a407e..a6f2bb7 100644
+--- a/drivers/net/wireless/iwlwifi/iwl-debug.h
++++ b/drivers/net/wireless/iwlwifi/iwl-debug.h
+@@ -68,8 +68,8 @@ do {                                                                 \
+ } while (0)
+ #else
+-#define IWL_DEBUG(__priv, level, fmt, args...)
+-#define IWL_DEBUG_LIMIT(__priv, level, fmt, args...)
++#define IWL_DEBUG(__priv, level, fmt, args...) do {} while (0)
++#define IWL_DEBUG_LIMIT(__priv, level, fmt, args...) do {} while (0)
+ static inline void iwl_print_hex_dump(struct iwl_priv *priv, int level,
+                                     const void *p, u32 len)
+ {}
+diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+index ec1485b..900c3bd 100644
+--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
++++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+@@ -561,6 +561,8 @@ static ssize_t iwl_dbgfs_status_read(struct file *file,
        int pos = 0;
        const size_t bufsz = sizeof(buf);
  
@@ -32998,7 +34823,7 @@ diff -urNp linux-3.1.3/drivers/net/wireless/iwlwifi/iwl-debugfs.c linux-3.1.3/dr
        pos += scnprintf(buf + pos, bufsz - pos, "STATUS_HCMD_ACTIVE:\t %d\n",
                test_bit(STATUS_HCMD_ACTIVE, &priv->status));
        pos += scnprintf(buf + pos, bufsz - pos, "STATUS_INT_ENABLED:\t %d\n",
-@@ -693,6 +695,8 @@ static ssize_t iwl_dbgfs_qos_read(struct
+@@ -693,6 +695,8 @@ static ssize_t iwl_dbgfs_qos_read(struct file *file, char __user *user_buf,
        char buf[256 * NUM_IWL_RXON_CTX];
        const size_t bufsz = sizeof(buf);
  
@@ -33007,24 +34832,11 @@ diff -urNp linux-3.1.3/drivers/net/wireless/iwlwifi/iwl-debugfs.c linux-3.1.3/dr
        for_each_context(priv, ctx) {
                pos += scnprintf(buf + pos, bufsz - pos, "context %d:\n",
                                 ctx->ctxid);
-diff -urNp linux-3.1.3/drivers/net/wireless/iwlwifi/iwl-debug.h linux-3.1.3/drivers/net/wireless/iwlwifi/iwl-debug.h
---- linux-3.1.3/drivers/net/wireless/iwlwifi/iwl-debug.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/wireless/iwlwifi/iwl-debug.h       2011-11-16 18:39:07.000000000 -0500
-@@ -68,8 +68,8 @@ do {                                    
- } while (0)
- #else
--#define IWL_DEBUG(__priv, level, fmt, args...)
--#define IWL_DEBUG_LIMIT(__priv, level, fmt, args...)
-+#define IWL_DEBUG(__priv, level, fmt, args...) do {} while (0)
-+#define IWL_DEBUG_LIMIT(__priv, level, fmt, args...) do {} while (0)
- static inline void iwl_print_hex_dump(struct iwl_priv *priv, int level,
-                                     const void *p, u32 len)
- {}
-diff -urNp linux-3.1.3/drivers/net/wireless/iwmc3200wifi/debugfs.c linux-3.1.3/drivers/net/wireless/iwmc3200wifi/debugfs.c
---- linux-3.1.3/drivers/net/wireless/iwmc3200wifi/debugfs.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/wireless/iwmc3200wifi/debugfs.c    2011-11-16 18:40:22.000000000 -0500
-@@ -327,6 +327,8 @@ static ssize_t iwm_debugfs_fw_err_read(s
+diff --git a/drivers/net/wireless/iwmc3200wifi/debugfs.c b/drivers/net/wireless/iwmc3200wifi/debugfs.c
+index 0a0cc96..fd49ad8 100644
+--- a/drivers/net/wireless/iwmc3200wifi/debugfs.c
++++ b/drivers/net/wireless/iwmc3200wifi/debugfs.c
+@@ -327,6 +327,8 @@ static ssize_t iwm_debugfs_fw_err_read(struct file *filp,
        int buf_len = 512;
        size_t len = 0;
  
@@ -33033,10 +34845,11 @@ diff -urNp linux-3.1.3/drivers/net/wireless/iwmc3200wifi/debugfs.c linux-3.1.3/d
        if (*ppos != 0)
                return 0;
        if (count < sizeof(buf))
-diff -urNp linux-3.1.3/drivers/net/wireless/mac80211_hwsim.c linux-3.1.3/drivers/net/wireless/mac80211_hwsim.c
---- linux-3.1.3/drivers/net/wireless/mac80211_hwsim.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/wireless/mac80211_hwsim.c  2011-11-16 18:39:07.000000000 -0500
-@@ -1670,9 +1670,11 @@ static int __init init_mac80211_hwsim(vo
+diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
+index 031cd89..bdc8435 100644
+--- a/drivers/net/wireless/mac80211_hwsim.c
++++ b/drivers/net/wireless/mac80211_hwsim.c
+@@ -1670,9 +1670,11 @@ static int __init init_mac80211_hwsim(void)
                return -EINVAL;
  
        if (fake_hw_scan) {
@@ -33051,9 +34864,10 @@ diff -urNp linux-3.1.3/drivers/net/wireless/mac80211_hwsim.c linux-3.1.3/drivers
        }
  
        spin_lock_init(&hwsim_radio_lock);
-diff -urNp linux-3.1.3/drivers/net/wireless/mwifiex/main.h linux-3.1.3/drivers/net/wireless/mwifiex/main.h
---- linux-3.1.3/drivers/net/wireless/mwifiex/main.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/wireless/mwifiex/main.h    2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
+index 2215c3c..64e6a47 100644
+--- a/drivers/net/wireless/mwifiex/main.h
++++ b/drivers/net/wireless/mwifiex/main.h
 @@ -560,7 +560,7 @@ struct mwifiex_if_ops {
  
        void (*update_mp_end_port) (struct mwifiex_adapter *, u16);
@@ -33063,10 +34877,11 @@ diff -urNp linux-3.1.3/drivers/net/wireless/mwifiex/main.h linux-3.1.3/drivers/n
  
  struct mwifiex_adapter {
        struct mwifiex_private *priv[MWIFIEX_MAX_BSS_NUM];
-diff -urNp linux-3.1.3/drivers/net/wireless/rndis_wlan.c linux-3.1.3/drivers/net/wireless/rndis_wlan.c
---- linux-3.1.3/drivers/net/wireless/rndis_wlan.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/wireless/rndis_wlan.c      2011-11-16 18:39:07.000000000 -0500
-@@ -1277,7 +1277,7 @@ static int set_rts_threshold(struct usbn
+diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
+index 29f9389..f6d2ce0 100644
+--- a/drivers/net/wireless/rndis_wlan.c
++++ b/drivers/net/wireless/rndis_wlan.c
+@@ -1277,7 +1277,7 @@ static int set_rts_threshold(struct usbnet *usbdev, u32 rts_threshold)
  
        netdev_dbg(usbdev->net, "%s(): %i\n", __func__, rts_threshold);
  
@@ -33075,10 +34890,11 @@ diff -urNp linux-3.1.3/drivers/net/wireless/rndis_wlan.c linux-3.1.3/drivers/net
                rts_threshold = 2347;
  
        tmp = cpu_to_le32(rts_threshold);
-diff -urNp linux-3.1.3/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c linux-3.1.3/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c
---- linux-3.1.3/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c     2011-11-16 18:40:22.000000000 -0500
-@@ -837,6 +837,8 @@ bool _rtl92c_phy_sw_chnl_step_by_step(st
+diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c
+index 3b11642..d6bb049 100644
+--- a/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c
++++ b/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c
+@@ -837,6 +837,8 @@ bool _rtl92c_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
        u8 rfpath;
        u8 num_total_rfpath = rtlphy->num_total_rfpath;
  
@@ -33087,9 +34903,10 @@ diff -urNp linux-3.1.3/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c linux-
        precommoncmdcnt = 0;
        _rtl92c_phy_set_sw_chnl_cmdarray(precommoncmd, precommoncmdcnt++,
                                         MAX_PRECMD_CNT,
-diff -urNp linux-3.1.3/drivers/net/wireless/wl1251/wl1251.h linux-3.1.3/drivers/net/wireless/wl1251/wl1251.h
---- linux-3.1.3/drivers/net/wireless/wl1251/wl1251.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/wireless/wl1251/wl1251.h   2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/net/wireless/wl1251/wl1251.h b/drivers/net/wireless/wl1251/wl1251.h
+index a77f1bb..c608b2b 100644
+--- a/drivers/net/wireless/wl1251/wl1251.h
++++ b/drivers/net/wireless/wl1251/wl1251.h
 @@ -266,7 +266,7 @@ struct wl1251_if_operations {
        void (*reset)(struct wl1251 *wl);
        void (*enable_irq)(struct wl1251 *wl);
@@ -33099,10 +34916,11 @@ diff -urNp linux-3.1.3/drivers/net/wireless/wl1251/wl1251.h linux-3.1.3/drivers/
  
  struct wl1251 {
        struct ieee80211_hw *hw;
-diff -urNp linux-3.1.3/drivers/net/wireless/wl12xx/spi.c linux-3.1.3/drivers/net/wireless/wl12xx/spi.c
---- linux-3.1.3/drivers/net/wireless/wl12xx/spi.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/net/wireless/wl12xx/spi.c      2011-11-16 18:40:22.000000000 -0500
-@@ -281,6 +281,8 @@ static void wl1271_spi_raw_write(struct 
+diff --git a/drivers/net/wireless/wl12xx/spi.c b/drivers/net/wireless/wl12xx/spi.c
+index e0b3736..4b466e6 100644
+--- a/drivers/net/wireless/wl12xx/spi.c
++++ b/drivers/net/wireless/wl12xx/spi.c
+@@ -281,6 +281,8 @@ static void wl1271_spi_raw_write(struct wl1271 *wl, int addr, void *buf,
        u32 chunk_len;
        int i;
  
@@ -33111,10 +34929,11 @@ diff -urNp linux-3.1.3/drivers/net/wireless/wl12xx/spi.c linux-3.1.3/drivers/net
        WARN_ON(len > WL1271_AGGR_BUFFER_SIZE);
  
        spi_message_init(&m);
-diff -urNp linux-3.1.3/drivers/oprofile/buffer_sync.c linux-3.1.3/drivers/oprofile/buffer_sync.c
---- linux-3.1.3/drivers/oprofile/buffer_sync.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/oprofile/buffer_sync.c 2011-11-16 18:39:07.000000000 -0500
-@@ -343,7 +343,7 @@ static void add_data(struct op_entry *en
+diff --git a/drivers/oprofile/buffer_sync.c b/drivers/oprofile/buffer_sync.c
+index f34b5b2..b5abb9f 100644
+--- a/drivers/oprofile/buffer_sync.c
++++ b/drivers/oprofile/buffer_sync.c
+@@ -343,7 +343,7 @@ static void add_data(struct op_entry *entry, struct mm_struct *mm)
                if (cookie == NO_COOKIE)
                        offset = pc;
                if (cookie == INVALID_COOKIE) {
@@ -33123,7 +34942,7 @@ diff -urNp linux-3.1.3/drivers/oprofile/buffer_sync.c linux-3.1.3/drivers/oprofi
                        offset = pc;
                }
                if (cookie != last_cookie) {
-@@ -387,14 +387,14 @@ add_sample(struct mm_struct *mm, struct 
+@@ -387,14 +387,14 @@ add_sample(struct mm_struct *mm, struct op_sample *s, int in_kernel)
        /* add userspace sample */
  
        if (!mm) {
@@ -33149,10 +34968,11 @@ diff -urNp linux-3.1.3/drivers/oprofile/buffer_sync.c linux-3.1.3/drivers/oprofi
                }
        }
        release_mm(mm);
-diff -urNp linux-3.1.3/drivers/oprofile/event_buffer.c linux-3.1.3/drivers/oprofile/event_buffer.c
---- linux-3.1.3/drivers/oprofile/event_buffer.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/oprofile/event_buffer.c        2011-11-16 18:39:07.000000000 -0500
-@@ -53,7 +53,7 @@ void add_event_entry(unsigned long value
+diff --git a/drivers/oprofile/event_buffer.c b/drivers/oprofile/event_buffer.c
+index dd87e86..bc0148c 100644
+--- a/drivers/oprofile/event_buffer.c
++++ b/drivers/oprofile/event_buffer.c
+@@ -53,7 +53,7 @@ void add_event_entry(unsigned long value)
        }
  
        if (buffer_pos == buffer_size) {
@@ -33161,10 +34981,11 @@ diff -urNp linux-3.1.3/drivers/oprofile/event_buffer.c linux-3.1.3/drivers/oprof
                return;
        }
  
-diff -urNp linux-3.1.3/drivers/oprofile/oprof.c linux-3.1.3/drivers/oprofile/oprof.c
---- linux-3.1.3/drivers/oprofile/oprof.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/oprofile/oprof.c       2011-11-16 18:39:07.000000000 -0500
-@@ -110,7 +110,7 @@ static void switch_worker(struct work_st
+diff --git a/drivers/oprofile/oprof.c b/drivers/oprofile/oprof.c
+index f8c752e..28bf4fc 100644
+--- a/drivers/oprofile/oprof.c
++++ b/drivers/oprofile/oprof.c
+@@ -110,7 +110,7 @@ static void switch_worker(struct work_struct *work)
        if (oprofile_ops.switch_events())
                return;
  
@@ -33173,21 +34994,10 @@ diff -urNp linux-3.1.3/drivers/oprofile/oprof.c linux-3.1.3/drivers/oprofile/opr
        start_switch_worker();
  }
  
-diff -urNp linux-3.1.3/drivers/oprofile/oprofilefs.c linux-3.1.3/drivers/oprofile/oprofilefs.c
---- linux-3.1.3/drivers/oprofile/oprofilefs.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/oprofile/oprofilefs.c  2011-11-16 18:39:07.000000000 -0500
-@@ -186,7 +186,7 @@ static const struct file_operations atom
- int oprofilefs_create_ro_atomic(struct super_block *sb, struct dentry *root,
--      char const *name, atomic_t *val)
-+      char const *name, atomic_unchecked_t *val)
- {
-       return __oprofilefs_create_file(sb, root, name,
-                                       &atomic_ro_fops, 0444, val);
-diff -urNp linux-3.1.3/drivers/oprofile/oprofile_stats.c linux-3.1.3/drivers/oprofile/oprofile_stats.c
---- linux-3.1.3/drivers/oprofile/oprofile_stats.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/oprofile/oprofile_stats.c      2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/oprofile/oprofile_stats.c b/drivers/oprofile/oprofile_stats.c
+index 917d28e..d62d981 100644
+--- a/drivers/oprofile/oprofile_stats.c
++++ b/drivers/oprofile/oprofile_stats.c
 @@ -30,11 +30,11 @@ void oprofile_reset_stats(void)
                cpu_buf->sample_invalid_eip = 0;
        }
@@ -33205,9 +35015,10 @@ diff -urNp linux-3.1.3/drivers/oprofile/oprofile_stats.c linux-3.1.3/drivers/opr
  }
  
  
-diff -urNp linux-3.1.3/drivers/oprofile/oprofile_stats.h linux-3.1.3/drivers/oprofile/oprofile_stats.h
---- linux-3.1.3/drivers/oprofile/oprofile_stats.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/oprofile/oprofile_stats.h      2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/oprofile/oprofile_stats.h b/drivers/oprofile/oprofile_stats.h
+index 38b6fc0..b5cbfce 100644
+--- a/drivers/oprofile/oprofile_stats.h
++++ b/drivers/oprofile/oprofile_stats.h
 @@ -13,11 +13,11 @@
  #include <linux/atomic.h>
  
@@ -33225,10 +35036,24 @@ diff -urNp linux-3.1.3/drivers/oprofile/oprofile_stats.h linux-3.1.3/drivers/opr
  };
  
  extern struct oprofile_stat_struct oprofile_stats;
-diff -urNp linux-3.1.3/drivers/parport/procfs.c linux-3.1.3/drivers/parport/procfs.c
---- linux-3.1.3/drivers/parport/procfs.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/parport/procfs.c       2011-11-16 18:39:07.000000000 -0500
-@@ -64,7 +64,7 @@ static int do_active_device(ctl_table *t
+diff --git a/drivers/oprofile/oprofilefs.c b/drivers/oprofile/oprofilefs.c
+index e9ff6f7..28e259a 100644
+--- a/drivers/oprofile/oprofilefs.c
++++ b/drivers/oprofile/oprofilefs.c
+@@ -186,7 +186,7 @@ static const struct file_operations atomic_ro_fops = {
+ int oprofilefs_create_ro_atomic(struct super_block *sb, struct dentry *root,
+-      char const *name, atomic_t *val)
++      char const *name, atomic_unchecked_t *val)
+ {
+       return __oprofilefs_create_file(sb, root, name,
+                                       &atomic_ro_fops, 0444, val);
+diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c
+index 3f56bc0..707d642 100644
+--- a/drivers/parport/procfs.c
++++ b/drivers/parport/procfs.c
+@@ -64,7 +64,7 @@ static int do_active_device(ctl_table *table, int write,
  
        *ppos += len;
  
@@ -33237,7 +35062,7 @@ diff -urNp linux-3.1.3/drivers/parport/procfs.c linux-3.1.3/drivers/parport/proc
  }
  
  #ifdef CONFIG_PARPORT_1284
-@@ -106,7 +106,7 @@ static int do_autoprobe(ctl_table *table
+@@ -106,7 +106,7 @@ static int do_autoprobe(ctl_table *table, int write,
  
        *ppos += len;
  
@@ -33246,9 +35071,10 @@ diff -urNp linux-3.1.3/drivers/parport/procfs.c linux-3.1.3/drivers/parport/proc
  }
  #endif /* IEEE1284.3 support. */
  
-diff -urNp linux-3.1.3/drivers/pci/hotplug/cpci_hotplug.h linux-3.1.3/drivers/pci/hotplug/cpci_hotplug.h
---- linux-3.1.3/drivers/pci/hotplug/cpci_hotplug.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/pci/hotplug/cpci_hotplug.h     2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/pci/hotplug/cpci_hotplug.h b/drivers/pci/hotplug/cpci_hotplug.h
+index 9fff878..ad0ad53 100644
+--- a/drivers/pci/hotplug/cpci_hotplug.h
++++ b/drivers/pci/hotplug/cpci_hotplug.h
 @@ -59,7 +59,7 @@ struct cpci_hp_controller_ops {
        int (*hardware_test) (struct slot* slot, u32 value);
        u8  (*get_power) (struct slot* slot);
@@ -33258,10 +35084,11 @@ diff -urNp linux-3.1.3/drivers/pci/hotplug/cpci_hotplug.h linux-3.1.3/drivers/pc
  
  struct cpci_hp_controller {
        unsigned int irq;
-diff -urNp linux-3.1.3/drivers/pci/hotplug/cpqphp_nvram.c linux-3.1.3/drivers/pci/hotplug/cpqphp_nvram.c
---- linux-3.1.3/drivers/pci/hotplug/cpqphp_nvram.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/pci/hotplug/cpqphp_nvram.c     2011-11-16 18:39:07.000000000 -0500
-@@ -428,9 +428,13 @@ static u32 store_HRT (void __iomem *rom_
+diff --git a/drivers/pci/hotplug/cpqphp_nvram.c b/drivers/pci/hotplug/cpqphp_nvram.c
+index 76ba8a1..20ca857 100644
+--- a/drivers/pci/hotplug/cpqphp_nvram.c
++++ b/drivers/pci/hotplug/cpqphp_nvram.c
+@@ -428,9 +428,13 @@ static u32 store_HRT (void __iomem *rom_start)
  
  void compaq_nvram_init (void __iomem *rom_start)
  {
@@ -33275,9 +35102,10 @@ diff -urNp linux-3.1.3/drivers/pci/hotplug/cpqphp_nvram.c linux-3.1.3/drivers/pc
        dbg("int15 entry  = %p\n", compaq_int15_entry_point);
  
        /* initialize our int15 lock */
-diff -urNp linux-3.1.3/drivers/pci/pcie/aspm.c linux-3.1.3/drivers/pci/pcie/aspm.c
---- linux-3.1.3/drivers/pci/pcie/aspm.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/pci/pcie/aspm.c        2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
+index cbfbab1..6a9fced 100644
+--- a/drivers/pci/pcie/aspm.c
++++ b/drivers/pci/pcie/aspm.c
 @@ -27,9 +27,9 @@
  #define MODULE_PARAM_PREFIX "pcie_aspm."
  
@@ -33291,10 +35119,11 @@ diff -urNp linux-3.1.3/drivers/pci/pcie/aspm.c linux-3.1.3/drivers/pci/pcie/aspm
  #define ASPM_STATE_L0S                (ASPM_STATE_L0S_UP | ASPM_STATE_L0S_DW)
  #define ASPM_STATE_ALL                (ASPM_STATE_L0S | ASPM_STATE_L1)
  
-diff -urNp linux-3.1.3/drivers/pci/probe.c linux-3.1.3/drivers/pci/probe.c
---- linux-3.1.3/drivers/pci/probe.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/pci/probe.c    2011-11-16 18:39:07.000000000 -0500
-@@ -136,7 +136,7 @@ int __pci_read_base(struct pci_dev *dev,
+diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
+index 6ab6bd3..72bdc69 100644
+--- a/drivers/pci/probe.c
++++ b/drivers/pci/probe.c
+@@ -136,7 +136,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
        u32 l, sz, mask;
        u16 orig_cmd;
  
@@ -33303,10 +35132,11 @@ diff -urNp linux-3.1.3/drivers/pci/probe.c linux-3.1.3/drivers/pci/probe.c
  
        if (!dev->mmio_always_on) {
                pci_read_config_word(dev, PCI_COMMAND, &orig_cmd);
-diff -urNp linux-3.1.3/drivers/pci/proc.c linux-3.1.3/drivers/pci/proc.c
---- linux-3.1.3/drivers/pci/proc.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/pci/proc.c     2011-11-16 18:40:22.000000000 -0500
-@@ -476,7 +476,16 @@ static const struct file_operations proc
+diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c
+index 27911b5..5b6db88 100644
+--- a/drivers/pci/proc.c
++++ b/drivers/pci/proc.c
+@@ -476,7 +476,16 @@ static const struct file_operations proc_bus_pci_dev_operations = {
  static int __init pci_proc_init(void)
  {
        struct pci_dev *dev = NULL;
@@ -33323,10 +35153,11 @@ diff -urNp linux-3.1.3/drivers/pci/proc.c linux-3.1.3/drivers/pci/proc.c
        proc_create("devices", 0, proc_bus_pci_dir,
                    &proc_bus_pci_dev_operations);
        proc_initialized = 1;
-diff -urNp linux-3.1.3/drivers/pci/xen-pcifront.c linux-3.1.3/drivers/pci/xen-pcifront.c
---- linux-3.1.3/drivers/pci/xen-pcifront.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/pci/xen-pcifront.c     2011-11-16 18:40:22.000000000 -0500
-@@ -187,6 +187,8 @@ static int pcifront_bus_read(struct pci_
+diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c
+index 90832a9..419089a 100644
+--- a/drivers/pci/xen-pcifront.c
++++ b/drivers/pci/xen-pcifront.c
+@@ -187,6 +187,8 @@ static int pcifront_bus_read(struct pci_bus *bus, unsigned int devfn,
        struct pcifront_sd *sd = bus->sysdata;
        struct pcifront_device *pdev = pcifront_get_pdev(sd);
  
@@ -33335,7 +35166,7 @@ diff -urNp linux-3.1.3/drivers/pci/xen-pcifront.c linux-3.1.3/drivers/pci/xen-pc
        if (verbose_request)
                dev_info(&pdev->xdev->dev,
                         "read dev=%04x:%02x:%02x.%01x - offset %x size %d\n",
-@@ -226,6 +228,8 @@ static int pcifront_bus_write(struct pci
+@@ -226,6 +228,8 @@ static int pcifront_bus_write(struct pci_bus *bus, unsigned int devfn,
        struct pcifront_sd *sd = bus->sysdata;
        struct pcifront_device *pdev = pcifront_get_pdev(sd);
  
@@ -33344,7 +35175,7 @@ diff -urNp linux-3.1.3/drivers/pci/xen-pcifront.c linux-3.1.3/drivers/pci/xen-pc
        if (verbose_request)
                dev_info(&pdev->xdev->dev,
                         "write dev=%04x:%02x:%02x.%01x - "
-@@ -258,6 +262,8 @@ static int pci_frontend_enable_msix(stru
+@@ -258,6 +262,8 @@ static int pci_frontend_enable_msix(struct pci_dev *dev,
        struct pcifront_device *pdev = pcifront_get_pdev(sd);
        struct msi_desc *entry;
  
@@ -33353,7 +35184,7 @@ diff -urNp linux-3.1.3/drivers/pci/xen-pcifront.c linux-3.1.3/drivers/pci/xen-pc
        if (nvec > SH_INFO_MAX_VEC) {
                dev_err(&dev->dev, "too much vector for pci frontend: %x."
                                   " Increase SH_INFO_MAX_VEC.\n", nvec);
-@@ -309,6 +315,8 @@ static void pci_frontend_disable_msix(st
+@@ -309,6 +315,8 @@ static void pci_frontend_disable_msix(struct pci_dev *dev)
        struct pcifront_sd *sd = dev->bus->sysdata;
        struct pcifront_device *pdev = pcifront_get_pdev(sd);
  
@@ -33362,7 +35193,7 @@ diff -urNp linux-3.1.3/drivers/pci/xen-pcifront.c linux-3.1.3/drivers/pci/xen-pc
        err = do_pci_op(pdev, &op);
  
        /* What should do for error ? */
-@@ -328,6 +336,8 @@ static int pci_frontend_enable_msi(struc
+@@ -328,6 +336,8 @@ static int pci_frontend_enable_msi(struct pci_dev *dev, int vector[])
        struct pcifront_sd *sd = dev->bus->sysdata;
        struct pcifront_device *pdev = pcifront_get_pdev(sd);
  
@@ -33371,9 +35202,10 @@ diff -urNp linux-3.1.3/drivers/pci/xen-pcifront.c linux-3.1.3/drivers/pci/xen-pc
        err = do_pci_op(pdev, &op);
        if (likely(!err)) {
                vector[0] = op.value;
-diff -urNp linux-3.1.3/drivers/platform/x86/thinkpad_acpi.c linux-3.1.3/drivers/platform/x86/thinkpad_acpi.c
---- linux-3.1.3/drivers/platform/x86/thinkpad_acpi.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/platform/x86/thinkpad_acpi.c   2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
+index 7bd829f..a3237ad 100644
+--- a/drivers/platform/x86/thinkpad_acpi.c
++++ b/drivers/platform/x86/thinkpad_acpi.c
 @@ -2094,7 +2094,7 @@ static int hotkey_mask_get(void)
        return 0;
  }
@@ -33383,9 +35215,129 @@ diff -urNp linux-3.1.3/drivers/platform/x86/thinkpad_acpi.c linux-3.1.3/drivers/
  {
        /* log only what the user can fix... */
        const u32 wantedmask = hotkey_driver_mask &
-diff -urNp linux-3.1.3/drivers/pnp/pnpbios/bioscalls.c linux-3.1.3/drivers/pnp/pnpbios/bioscalls.c
---- linux-3.1.3/drivers/pnp/pnpbios/bioscalls.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/pnp/pnpbios/bioscalls.c        2011-11-16 18:39:07.000000000 -0500
+@@ -2325,11 +2325,6 @@ static void hotkey_read_nvram(struct tp_nvram_state *n, const u32 m)
+       }
+ }
+-static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn,
+-                                         struct tp_nvram_state *newn,
+-                                         const u32 event_mask)
+-{
+-
+ #define TPACPI_COMPARE_KEY(__scancode, __member) \
+       do { \
+               if ((event_mask & (1 << __scancode)) && \
+@@ -2343,36 +2338,42 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn,
+                       tpacpi_hotkey_send_key(__scancode); \
+       } while (0)
+-      void issue_volchange(const unsigned int oldvol,
+-                           const unsigned int newvol)
+-      {
+-              unsigned int i = oldvol;
++static void issue_volchange(const unsigned int oldvol,
++                          const unsigned int newvol,
++                          const u32 event_mask)
++{
++      unsigned int i = oldvol;
+-              while (i > newvol) {
+-                      TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_VOLUMEDOWN);
+-                      i--;
+-              }
+-              while (i < newvol) {
+-                      TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_VOLUMEUP);
+-                      i++;
+-              }
++      while (i > newvol) {
++              TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_VOLUMEDOWN);
++              i--;
+       }
++      while (i < newvol) {
++              TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_VOLUMEUP);
++              i++;
++      }
++}
+-      void issue_brightnesschange(const unsigned int oldbrt,
+-                                  const unsigned int newbrt)
+-      {
+-              unsigned int i = oldbrt;
++static void issue_brightnesschange(const unsigned int oldbrt,
++                                 const unsigned int newbrt,
++                                 const u32 event_mask)
++{
++      unsigned int i = oldbrt;
+-              while (i > newbrt) {
+-                      TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_FNEND);
+-                      i--;
+-              }
+-              while (i < newbrt) {
+-                      TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_FNHOME);
+-                      i++;
+-              }
++      while (i > newbrt) {
++              TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_FNEND);
++              i--;
++      }
++      while (i < newbrt) {
++              TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_FNHOME);
++              i++;
+       }
++}
++static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn,
++                                         struct tp_nvram_state *newn,
++                                         const u32 event_mask)
++{
+       TPACPI_COMPARE_KEY(TP_ACPI_HOTKEYSCAN_THINKPAD, thinkpad_toggle);
+       TPACPI_COMPARE_KEY(TP_ACPI_HOTKEYSCAN_FNSPACE, zoom_toggle);
+       TPACPI_COMPARE_KEY(TP_ACPI_HOTKEYSCAN_FNF7, display_toggle);
+@@ -2406,7 +2407,7 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn,
+                   oldn->volume_level != newn->volume_level) {
+                       /* recently muted, or repeated mute keypress, or
+                        * multiple presses ending in mute */
+-                      issue_volchange(oldn->volume_level, newn->volume_level);
++                      issue_volchange(oldn->volume_level, newn->volume_level, event_mask);
+                       TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_MUTE);
+               }
+       } else {
+@@ -2416,7 +2417,7 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn,
+                       TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_VOLUMEUP);
+               }
+               if (oldn->volume_level != newn->volume_level) {
+-                      issue_volchange(oldn->volume_level, newn->volume_level);
++                      issue_volchange(oldn->volume_level, newn->volume_level, event_mask);
+               } else if (oldn->volume_toggle != newn->volume_toggle) {
+                       /* repeated vol up/down keypress at end of scale ? */
+                       if (newn->volume_level == 0)
+@@ -2429,7 +2430,8 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn,
+       /* handle brightness */
+       if (oldn->brightness_level != newn->brightness_level) {
+               issue_brightnesschange(oldn->brightness_level,
+-                                     newn->brightness_level);
++                                     newn->brightness_level,
++                                     event_mask);
+       } else if (oldn->brightness_toggle != newn->brightness_toggle) {
+               /* repeated key presses that didn't change state */
+               if (newn->brightness_level == 0)
+@@ -2438,10 +2440,10 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn,
+                               && !tp_features.bright_unkfw)
+                       TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_FNHOME);
+       }
++}
+ #undef TPACPI_COMPARE_KEY
+ #undef TPACPI_MAY_SEND_KEY
+-}
+ /*
+  * Polling driver
+diff --git a/drivers/pnp/pnpbios/bioscalls.c b/drivers/pnp/pnpbios/bioscalls.c
+index b859d16..5cc6b1a 100644
+--- a/drivers/pnp/pnpbios/bioscalls.c
++++ b/drivers/pnp/pnpbios/bioscalls.c
 @@ -59,7 +59,7 @@ do { \
        set_desc_limit(&gdt[(selname) >> 3], (size) - 1); \
  } while(0)
@@ -33395,7 +35347,7 @@ diff -urNp linux-3.1.3/drivers/pnp/pnpbios/bioscalls.c linux-3.1.3/drivers/pnp/p
                        (unsigned long)__va(0x400UL), PAGE_SIZE - 0x400 - 1);
  
  /*
-@@ -96,7 +96,10 @@ static inline u16 call_pnp_bios(u16 func
+@@ -96,7 +96,10 @@ static inline u16 call_pnp_bios(u16 func, u16 arg1, u16 arg2, u16 arg3,
  
        cpu = get_cpu();
        save_desc_40 = get_cpu_gdt_table(cpu)[0x40 / 8];
@@ -33406,7 +35358,7 @@ diff -urNp linux-3.1.3/drivers/pnp/pnpbios/bioscalls.c linux-3.1.3/drivers/pnp/p
  
        /* On some boxes IRQ's during PnP BIOS calls are deadly.  */
        spin_lock_irqsave(&pnp_bios_lock, flags);
-@@ -134,7 +137,10 @@ static inline u16 call_pnp_bios(u16 func
+@@ -134,7 +137,10 @@ static inline u16 call_pnp_bios(u16 func, u16 arg1, u16 arg2, u16 arg3,
                             :"memory");
        spin_unlock_irqrestore(&pnp_bios_lock, flags);
  
@@ -33417,7 +35369,7 @@ diff -urNp linux-3.1.3/drivers/pnp/pnpbios/bioscalls.c linux-3.1.3/drivers/pnp/p
        put_cpu();
  
        /* If we get here and this is set then the PnP BIOS faulted on us. */
-@@ -468,7 +474,7 @@ int pnp_bios_read_escd(char *data, u32 n
+@@ -468,7 +474,7 @@ int pnp_bios_read_escd(char *data, u32 nvram_base)
        return status;
  }
  
@@ -33426,7 +35378,7 @@ diff -urNp linux-3.1.3/drivers/pnp/pnpbios/bioscalls.c linux-3.1.3/drivers/pnp/p
  {
        int i;
  
-@@ -476,6 +482,8 @@ void pnpbios_calls_init(union pnp_bios_i
+@@ -476,6 +482,8 @@ void pnpbios_calls_init(union pnp_bios_install_struct *header)
        pnp_bios_callpoint.offset = header->fields.pm16offset;
        pnp_bios_callpoint.segment = PNP_CS16;
  
@@ -33435,17 +35387,18 @@ diff -urNp linux-3.1.3/drivers/pnp/pnpbios/bioscalls.c linux-3.1.3/drivers/pnp/p
        for_each_possible_cpu(i) {
                struct desc_struct *gdt = get_cpu_gdt_table(i);
                if (!gdt)
-@@ -487,4 +495,6 @@ void pnpbios_calls_init(union pnp_bios_i
+@@ -487,4 +495,6 @@ void pnpbios_calls_init(union pnp_bios_install_struct *header)
                set_desc_base(&gdt[GDT_ENTRY_PNPBIOS_DS],
                         (unsigned long)__va(header->fields.pm16dseg));
        }
 +
 +      pax_close_kernel();
  }
-diff -urNp linux-3.1.3/drivers/pnp/resource.c linux-3.1.3/drivers/pnp/resource.c
---- linux-3.1.3/drivers/pnp/resource.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/pnp/resource.c 2011-11-16 18:39:07.000000000 -0500
-@@ -360,7 +360,7 @@ int pnp_check_irq(struct pnp_dev *dev, s
+diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c
+index b0ecacb..7c9da2e 100644
+--- a/drivers/pnp/resource.c
++++ b/drivers/pnp/resource.c
+@@ -360,7 +360,7 @@ int pnp_check_irq(struct pnp_dev *dev, struct resource *res)
                return 1;
  
        /* check if the resource is valid */
@@ -33454,7 +35407,7 @@ diff -urNp linux-3.1.3/drivers/pnp/resource.c linux-3.1.3/drivers/pnp/resource.c
                return 0;
  
        /* check if the resource is reserved */
-@@ -424,7 +424,7 @@ int pnp_check_dma(struct pnp_dev *dev, s
+@@ -424,7 +424,7 @@ int pnp_check_dma(struct pnp_dev *dev, struct resource *res)
                return 1;
  
        /* check if the resource is valid */
@@ -33463,9 +35416,10 @@ diff -urNp linux-3.1.3/drivers/pnp/resource.c linux-3.1.3/drivers/pnp/resource.c
                return 0;
  
        /* check if the resource is reserved */
-diff -urNp linux-3.1.3/drivers/power/bq27x00_battery.c linux-3.1.3/drivers/power/bq27x00_battery.c
---- linux-3.1.3/drivers/power/bq27x00_battery.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/power/bq27x00_battery.c        2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/power/bq27x00_battery.c b/drivers/power/bq27x00_battery.c
+index bb16f5b..c751eef 100644
+--- a/drivers/power/bq27x00_battery.c
++++ b/drivers/power/bq27x00_battery.c
 @@ -67,7 +67,7 @@
  struct bq27x00_device_info;
  struct bq27x00_access_methods {
@@ -33475,10 +35429,11 @@ diff -urNp linux-3.1.3/drivers/power/bq27x00_battery.c linux-3.1.3/drivers/power
  
  enum bq27x00_chip { BQ27000, BQ27500 };
  
-diff -urNp linux-3.1.3/drivers/regulator/max8660.c linux-3.1.3/drivers/regulator/max8660.c
---- linux-3.1.3/drivers/regulator/max8660.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/regulator/max8660.c    2011-11-16 18:39:07.000000000 -0500
-@@ -383,8 +383,10 @@ static int __devinit max8660_probe(struc
+diff --git a/drivers/regulator/max8660.c b/drivers/regulator/max8660.c
+index 33f5d9a..d957d3f 100644
+--- a/drivers/regulator/max8660.c
++++ b/drivers/regulator/max8660.c
+@@ -383,8 +383,10 @@ static int __devinit max8660_probe(struct i2c_client *client,
                max8660->shadow_regs[MAX8660_OVER1] = 5;
        } else {
                /* Otherwise devices can be toggled via software */
@@ -33491,10 +35446,11 @@ diff -urNp linux-3.1.3/drivers/regulator/max8660.c linux-3.1.3/drivers/regulator
        }
  
        /*
-diff -urNp linux-3.1.3/drivers/regulator/mc13892-regulator.c linux-3.1.3/drivers/regulator/mc13892-regulator.c
---- linux-3.1.3/drivers/regulator/mc13892-regulator.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/regulator/mc13892-regulator.c  2011-11-16 18:39:07.000000000 -0500
-@@ -564,10 +564,12 @@ static int __devinit mc13892_regulator_p
+diff --git a/drivers/regulator/mc13892-regulator.c b/drivers/regulator/mc13892-regulator.c
+index 3285d41..ab7c22a 100644
+--- a/drivers/regulator/mc13892-regulator.c
++++ b/drivers/regulator/mc13892-regulator.c
+@@ -564,10 +564,12 @@ static int __devinit mc13892_regulator_probe(struct platform_device *pdev)
        }
        mc13xxx_unlock(mc13892);
  
@@ -33509,9 +35465,10 @@ diff -urNp linux-3.1.3/drivers/regulator/mc13892-regulator.c linux-3.1.3/drivers
        for (i = 0; i < pdata->num_regulators; i++) {
                init_data = &pdata->regulators[i];
                priv->regulators[i] = regulator_register(
-diff -urNp linux-3.1.3/drivers/rtc/rtc-dev.c linux-3.1.3/drivers/rtc/rtc-dev.c
---- linux-3.1.3/drivers/rtc/rtc-dev.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/rtc/rtc-dev.c  2011-11-16 18:40:22.000000000 -0500
+diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c
+index cace6d3..f623fda 100644
+--- a/drivers/rtc/rtc-dev.c
++++ b/drivers/rtc/rtc-dev.c
 @@ -14,6 +14,7 @@
  #include <linux/module.h>
  #include <linux/rtc.h>
@@ -33520,7 +35477,7 @@ diff -urNp linux-3.1.3/drivers/rtc/rtc-dev.c linux-3.1.3/drivers/rtc/rtc-dev.c
  #include "rtc-core.h"
  
  static dev_t rtc_devt;
-@@ -345,6 +346,8 @@ static long rtc_dev_ioctl(struct file *f
+@@ -345,6 +346,8 @@ static long rtc_dev_ioctl(struct file *file,
                if (copy_from_user(&tm, uarg, sizeof(tm)))
                        return -EFAULT;
  
@@ -33529,9 +35486,23 @@ diff -urNp linux-3.1.3/drivers/rtc/rtc-dev.c linux-3.1.3/drivers/rtc/rtc-dev.c
                return rtc_set_time(rtc, &tm);
  
        case RTC_PIE_ON:
-diff -urNp linux-3.1.3/drivers/scsi/aacraid/aacraid.h linux-3.1.3/drivers/scsi/aacraid/aacraid.h
---- linux-3.1.3/drivers/scsi/aacraid/aacraid.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/aacraid/aacraid.h 2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c
+index f66c33b..7ae5823 100644
+--- a/drivers/scsi/BusLogic.c
++++ b/drivers/scsi/BusLogic.c
+@@ -962,6 +962,8 @@ static int __init BusLogic_InitializeFlashPointProbeInfo(struct BusLogic_HostAda
+ static void __init BusLogic_InitializeProbeInfoList(struct BusLogic_HostAdapter
+                                                   *PrototypeHostAdapter)
+ {
++      pax_track_stack();
++
+       /*
+          If a PCI BIOS is present, interrogate it for MultiMaster and FlashPoint
+          Host Adapters; otherwise, default to the standard ISA MultiMaster probe.
+diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
+index ffb5878..e6d785c 100644
+--- a/drivers/scsi/aacraid/aacraid.h
++++ b/drivers/scsi/aacraid/aacraid.h
 @@ -492,7 +492,7 @@ struct adapter_ops
        int  (*adapter_scsi)(struct fib * fib, struct scsi_cmnd * cmd);
        /* Administrative operations */
@@ -33541,10 +35512,11 @@ diff -urNp linux-3.1.3/drivers/scsi/aacraid/aacraid.h linux-3.1.3/drivers/scsi/a
  
  /*
   *    Define which interrupt handler needs to be installed
-diff -urNp linux-3.1.3/drivers/scsi/aacraid/commctrl.c linux-3.1.3/drivers/scsi/aacraid/commctrl.c
---- linux-3.1.3/drivers/scsi/aacraid/commctrl.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/aacraid/commctrl.c        2011-11-16 18:40:22.000000000 -0500
-@@ -482,6 +482,7 @@ static int aac_send_raw_srb(struct aac_d
+diff --git a/drivers/scsi/aacraid/commctrl.c b/drivers/scsi/aacraid/commctrl.c
+index 8a0b330..b4286de 100644
+--- a/drivers/scsi/aacraid/commctrl.c
++++ b/drivers/scsi/aacraid/commctrl.c
+@@ -482,6 +482,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
        u32 actual_fibsize64, actual_fibsize = 0;
        int i;
  
@@ -33552,10 +35524,11 @@ diff -urNp linux-3.1.3/drivers/scsi/aacraid/commctrl.c linux-3.1.3/drivers/scsi/
  
        if (dev->in_reset) {
                dprintk((KERN_DEBUG"aacraid: send raw srb -EBUSY\n"));
-diff -urNp linux-3.1.3/drivers/scsi/aacraid/linit.c linux-3.1.3/drivers/scsi/aacraid/linit.c
---- linux-3.1.3/drivers/scsi/aacraid/linit.c   2011-11-26 19:57:29.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/aacraid/linit.c   2011-11-26 20:00:43.000000000 -0500
-@@ -93,7 +93,7 @@ static DECLARE_PCI_DEVICE_TABLE(aac_pci_
+diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
+index c7b6fed..4db0569 100644
+--- a/drivers/scsi/aacraid/linit.c
++++ b/drivers/scsi/aacraid/linit.c
+@@ -93,7 +93,7 @@ static DECLARE_PCI_DEVICE_TABLE(aac_pci_tbl) = {
  #elif defined(__devinitconst)
  static const struct pci_device_id aac_pci_tbl[] __devinitconst = {
  #else
@@ -33564,10 +35537,11 @@ diff -urNp linux-3.1.3/drivers/scsi/aacraid/linit.c linux-3.1.3/drivers/scsi/aac
  #endif
        { 0x1028, 0x0001, 0x1028, 0x0001, 0, 0, 0 }, /* PERC 2/Si (Iguana/PERC2Si) */
        { 0x1028, 0x0002, 0x1028, 0x0002, 0, 0, 1 }, /* PERC 3/Di (Opal/PERC3Di) */
-diff -urNp linux-3.1.3/drivers/scsi/aic94xx/aic94xx_init.c linux-3.1.3/drivers/scsi/aic94xx/aic94xx_init.c
---- linux-3.1.3/drivers/scsi/aic94xx/aic94xx_init.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/aic94xx/aic94xx_init.c    2011-11-16 18:39:07.000000000 -0500
-@@ -1012,7 +1012,7 @@ static struct sas_domain_function_templa
+diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c
+index d5ff142..49c0ebb 100644
+--- a/drivers/scsi/aic94xx/aic94xx_init.c
++++ b/drivers/scsi/aic94xx/aic94xx_init.c
+@@ -1012,7 +1012,7 @@ static struct sas_domain_function_template aic94xx_transport_functions = {
        .lldd_control_phy       = asd_control_phy,
  };
  
@@ -33576,22 +35550,24 @@ diff -urNp linux-3.1.3/drivers/scsi/aic94xx/aic94xx_init.c linux-3.1.3/drivers/s
        {PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, 0x410),0, 0, 1},
        {PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, 0x412),0, 0, 1},
        {PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, 0x416),0, 0, 1},
-diff -urNp linux-3.1.3/drivers/scsi/bfa/bfad.c linux-3.1.3/drivers/scsi/bfa/bfad.c
---- linux-3.1.3/drivers/scsi/bfa/bfad.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/bfa/bfad.c        2011-11-16 19:01:15.000000000 -0500
-@@ -1019,6 +1019,8 @@ bfad_start_ops(struct bfad_s *bfad) {
-       struct bfad_vport_s *vport, *vport_new;
-       struct bfa_fcs_driver_info_s driver_info;
+diff --git a/drivers/scsi/bfa/bfa.h b/drivers/scsi/bfa/bfa.h
+index a796de9..1ef20e1 100644
+--- a/drivers/scsi/bfa/bfa.h
++++ b/drivers/scsi/bfa/bfa.h
+@@ -196,7 +196,7 @@ struct bfa_hwif_s {
+                                      u32 *end);
+       int     cpe_vec_q0;
+       int     rme_vec_q0;
+-};
++} __no_const;
+ typedef void (*bfa_cb_iocfc_t) (void *cbarg, enum bfa_status status);
  
-+      pax_track_stack();
-+
-       /* Limit min/max. xfer size to [64k-32MB] */
-       if (max_xfer_size < BFAD_MIN_SECTORS >> 1)
-               max_xfer_size = BFAD_MIN_SECTORS >> 1;
-diff -urNp linux-3.1.3/drivers/scsi/bfa/bfa_fcpim.c linux-3.1.3/drivers/scsi/bfa/bfa_fcpim.c
---- linux-3.1.3/drivers/scsi/bfa/bfa_fcpim.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/bfa/bfa_fcpim.c   2011-11-16 18:39:07.000000000 -0500
-@@ -4179,7 +4179,7 @@ bfa_itn_create(struct bfa_s *bfa, struct
+ struct bfa_faa_cbfn_s {
+diff --git a/drivers/scsi/bfa/bfa_fcpim.c b/drivers/scsi/bfa/bfa_fcpim.c
+index e07bd47..dbd260a 100644
+--- a/drivers/scsi/bfa/bfa_fcpim.c
++++ b/drivers/scsi/bfa/bfa_fcpim.c
+@@ -4179,7 +4179,7 @@ bfa_itn_create(struct bfa_s *bfa, struct bfa_rport_s *rport,
                void (*isr)(struct bfa_s *bfa, struct bfi_msg_s *m))
  {
        struct bfa_fcp_mod_s *fcp = BFA_FCP_MOD(bfa);
@@ -33600,9 +35576,10 @@ diff -urNp linux-3.1.3/drivers/scsi/bfa/bfa_fcpim.c linux-3.1.3/drivers/scsi/bfa
  
        itn =  BFA_ITN_FROM_TAG(fcp, rport->rport_tag);
        itn->isr = isr;
-diff -urNp linux-3.1.3/drivers/scsi/bfa/bfa_fcpim.h linux-3.1.3/drivers/scsi/bfa/bfa_fcpim.h
---- linux-3.1.3/drivers/scsi/bfa/bfa_fcpim.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/bfa/bfa_fcpim.h   2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/scsi/bfa/bfa_fcpim.h b/drivers/scsi/bfa/bfa_fcpim.h
+index 1080bcb..a3b39e3 100644
+--- a/drivers/scsi/bfa/bfa_fcpim.h
++++ b/drivers/scsi/bfa/bfa_fcpim.h
 @@ -37,6 +37,7 @@ struct bfa_iotag_s {
  struct bfa_itn_s {
        bfa_isr_func_t isr;
@@ -33620,10 +35597,11 @@ diff -urNp linux-3.1.3/drivers/scsi/bfa/bfa_fcpim.h linux-3.1.3/drivers/scsi/bfa
        int                     num_ioim_reqs;
        int                     num_fwtio_reqs;
        int                     num_itns;
-diff -urNp linux-3.1.3/drivers/scsi/bfa/bfa_fcs_lport.c linux-3.1.3/drivers/scsi/bfa/bfa_fcs_lport.c
---- linux-3.1.3/drivers/scsi/bfa/bfa_fcs_lport.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/bfa/bfa_fcs_lport.c       2011-11-16 18:40:22.000000000 -0500
-@@ -1700,6 +1700,8 @@ bfa_fcs_lport_fdmi_build_rhba_pyld(struc
+diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c
+index d4f951f..197c350 100644
+--- a/drivers/scsi/bfa/bfa_fcs_lport.c
++++ b/drivers/scsi/bfa/bfa_fcs_lport.c
+@@ -1700,6 +1700,8 @@ bfa_fcs_lport_fdmi_build_rhba_pyld(struct bfa_fcs_lport_fdmi_s *fdmi, u8 *pyld)
        u16        len, count;
        u16     templen;
  
@@ -33632,7 +35610,7 @@ diff -urNp linux-3.1.3/drivers/scsi/bfa/bfa_fcs_lport.c linux-3.1.3/drivers/scsi
        /*
         * get hba attributes
         */
-@@ -1977,6 +1979,8 @@ bfa_fcs_lport_fdmi_build_portattr_block(
+@@ -1977,6 +1979,8 @@ bfa_fcs_lport_fdmi_build_portattr_block(struct bfa_fcs_lport_fdmi_s *fdmi,
        u8      count = 0;
        u16     templen;
  
@@ -33641,10 +35619,11 @@ diff -urNp linux-3.1.3/drivers/scsi/bfa/bfa_fcs_lport.c linux-3.1.3/drivers/scsi
        /*
         * get port attributes
         */
-diff -urNp linux-3.1.3/drivers/scsi/bfa/bfa_fcs_rport.c linux-3.1.3/drivers/scsi/bfa/bfa_fcs_rport.c
---- linux-3.1.3/drivers/scsi/bfa/bfa_fcs_rport.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/bfa/bfa_fcs_rport.c       2011-11-16 18:40:22.000000000 -0500
-@@ -1871,6 +1871,8 @@ bfa_fcs_rport_process_rpsc(struct bfa_fc
+diff --git a/drivers/scsi/bfa/bfa_fcs_rport.c b/drivers/scsi/bfa/bfa_fcs_rport.c
+index 52628d5..f89d033 100644
+--- a/drivers/scsi/bfa/bfa_fcs_rport.c
++++ b/drivers/scsi/bfa/bfa_fcs_rport.c
+@@ -1871,6 +1871,8 @@ bfa_fcs_rport_process_rpsc(struct bfa_fcs_rport_s *rport,
        struct fc_rpsc_speed_info_s speeds;
        struct bfa_port_attr_s pport_attr;
  
@@ -33653,21 +35632,10 @@ diff -urNp linux-3.1.3/drivers/scsi/bfa/bfa_fcs_rport.c linux-3.1.3/drivers/scsi
        bfa_trc(port->fcs, rx_fchs->s_id);
        bfa_trc(port->fcs, rx_fchs->d_id);
  
-diff -urNp linux-3.1.3/drivers/scsi/bfa/bfa.h linux-3.1.3/drivers/scsi/bfa/bfa.h
---- linux-3.1.3/drivers/scsi/bfa/bfa.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/bfa/bfa.h 2011-11-16 18:39:07.000000000 -0500
-@@ -196,7 +196,7 @@ struct bfa_hwif_s {
-                                      u32 *end);
-       int     cpe_vec_q0;
-       int     rme_vec_q0;
--};
-+} __no_const;
- typedef void (*bfa_cb_iocfc_t) (void *cbarg, enum bfa_status status);
- struct bfa_faa_cbfn_s {
-diff -urNp linux-3.1.3/drivers/scsi/bfa/bfa_ioc.h linux-3.1.3/drivers/scsi/bfa/bfa_ioc.h
---- linux-3.1.3/drivers/scsi/bfa/bfa_ioc.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/bfa/bfa_ioc.h     2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/scsi/bfa/bfa_ioc.h b/drivers/scsi/bfa/bfa_ioc.h
+index 546d46b..642fa5b 100644
+--- a/drivers/scsi/bfa/bfa_ioc.h
++++ b/drivers/scsi/bfa/bfa_ioc.h
 @@ -258,7 +258,7 @@ struct bfa_ioc_cbfn_s {
        bfa_ioc_disable_cbfn_t  disable_cbfn;
        bfa_ioc_hbfail_cbfn_t   hbfail_cbfn;
@@ -33686,22 +35654,24 @@ diff -urNp linux-3.1.3/drivers/scsi/bfa/bfa_ioc.h linux-3.1.3/drivers/scsi/bfa/b
  
  /*
   * Queue element to wait for room in request queue. FIFO order is
-diff -urNp linux-3.1.3/drivers/scsi/BusLogic.c linux-3.1.3/drivers/scsi/BusLogic.c
---- linux-3.1.3/drivers/scsi/BusLogic.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/BusLogic.c        2011-11-16 18:40:22.000000000 -0500
-@@ -962,6 +962,8 @@ static int __init BusLogic_InitializeFla
- static void __init BusLogic_InitializeProbeInfoList(struct BusLogic_HostAdapter
-                                                   *PrototypeHostAdapter)
- {
+diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
+index 66fb725..0fe05ab 100644
+--- a/drivers/scsi/bfa/bfad.c
++++ b/drivers/scsi/bfa/bfad.c
+@@ -1019,6 +1019,8 @@ bfad_start_ops(struct bfad_s *bfad) {
+       struct bfad_vport_s *vport, *vport_new;
+       struct bfa_fcs_driver_info_s driver_info;
 +      pax_track_stack();
 +
-       /*
-          If a PCI BIOS is present, interrogate it for MultiMaster and FlashPoint
-          Host Adapters; otherwise, default to the standard ISA MultiMaster probe.
-diff -urNp linux-3.1.3/drivers/scsi/dpt_i2o.c linux-3.1.3/drivers/scsi/dpt_i2o.c
---- linux-3.1.3/drivers/scsi/dpt_i2o.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/dpt_i2o.c 2011-11-16 18:40:22.000000000 -0500
-@@ -1811,6 +1811,8 @@ static int adpt_i2o_passthru(adpt_hba* p
+       /* Limit min/max. xfer size to [64k-32MB] */
+       if (max_xfer_size < BFAD_MIN_SECTORS >> 1)
+               max_xfer_size = BFAD_MIN_SECTORS >> 1;
+diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
+index b4f6c9a..0eb1938 100644
+--- a/drivers/scsi/dpt_i2o.c
++++ b/drivers/scsi/dpt_i2o.c
+@@ -1811,6 +1811,8 @@ static int adpt_i2o_passthru(adpt_hba* pHba, u32 __user *arg)
        dma_addr_t addr;
        ulong flags = 0;
  
@@ -33710,7 +35680,7 @@ diff -urNp linux-3.1.3/drivers/scsi/dpt_i2o.c linux-3.1.3/drivers/scsi/dpt_i2o.c
        memset(&msg, 0, MAX_MESSAGE_SIZE*4);
        // get user msg size in u32s 
        if(get_user(size, &user_msg[0])){
-@@ -2317,6 +2319,8 @@ static s32 adpt_scsi_to_i2o(adpt_hba* pH
+@@ -2317,6 +2319,8 @@ static s32 adpt_scsi_to_i2o(adpt_hba* pHba, struct scsi_cmnd* cmd, struct adpt_d
        s32 rcode;
        dma_addr_t addr;
  
@@ -33719,10 +35689,11 @@ diff -urNp linux-3.1.3/drivers/scsi/dpt_i2o.c linux-3.1.3/drivers/scsi/dpt_i2o.c
        memset(msg, 0 , sizeof(msg));
        len = scsi_bufflen(cmd);
        direction = 0x00000000; 
-diff -urNp linux-3.1.3/drivers/scsi/eata.c linux-3.1.3/drivers/scsi/eata.c
---- linux-3.1.3/drivers/scsi/eata.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/eata.c    2011-11-16 18:40:22.000000000 -0500
-@@ -1087,6 +1087,8 @@ static int port_detect(unsigned long por
+diff --git a/drivers/scsi/eata.c b/drivers/scsi/eata.c
+index 94de889..ca4f0cf 100644
+--- a/drivers/scsi/eata.c
++++ b/drivers/scsi/eata.c
+@@ -1087,6 +1087,8 @@ static int port_detect(unsigned long port_base, unsigned int j,
        struct hostdata *ha;
        char name[16];
  
@@ -33731,10 +35702,11 @@ diff -urNp linux-3.1.3/drivers/scsi/eata.c linux-3.1.3/drivers/scsi/eata.c
        sprintf(name, "%s%d", driver_name, j);
  
        if (!request_region(port_base, REGION_SIZE, driver_name)) {
-diff -urNp linux-3.1.3/drivers/scsi/fcoe/fcoe_ctlr.c linux-3.1.3/drivers/scsi/fcoe/fcoe_ctlr.c
---- linux-3.1.3/drivers/scsi/fcoe/fcoe_ctlr.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/fcoe/fcoe_ctlr.c  2011-11-16 18:40:22.000000000 -0500
-@@ -2503,6 +2503,8 @@ static int fcoe_ctlr_vn_recv(struct fcoe
+diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c
+index c74c4b8..c41ca3f 100644
+--- a/drivers/scsi/fcoe/fcoe_ctlr.c
++++ b/drivers/scsi/fcoe/fcoe_ctlr.c
+@@ -2503,6 +2503,8 @@ static int fcoe_ctlr_vn_recv(struct fcoe_ctlr *fip, struct sk_buff *skb)
        } buf;
        int rc;
  
@@ -33743,9 +35715,10 @@ diff -urNp linux-3.1.3/drivers/scsi/fcoe/fcoe_ctlr.c linux-3.1.3/drivers/scsi/fc
        fiph = (struct fip_header *)skb->data;
        sub = fiph->fip_subcode;
  
-diff -urNp linux-3.1.3/drivers/scsi/gdth.c linux-3.1.3/drivers/scsi/gdth.c
---- linux-3.1.3/drivers/scsi/gdth.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/gdth.c    2011-11-16 18:40:22.000000000 -0500
+diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
+index 3242bca..45a83e7 100644
+--- a/drivers/scsi/gdth.c
++++ b/drivers/scsi/gdth.c
 @@ -4107,6 +4107,8 @@ static int ioc_lockdrv(void __user *arg)
      unsigned long flags;
      gdth_ha_str *ha;
@@ -33755,7 +35728,7 @@ diff -urNp linux-3.1.3/drivers/scsi/gdth.c linux-3.1.3/drivers/scsi/gdth.c
      if (copy_from_user(&ldrv, arg, sizeof(gdth_ioctl_lockdrv)))
          return -EFAULT;
      ha = gdth_find_ha(ldrv.ionode);
-@@ -4139,6 +4141,8 @@ static int ioc_resetdrv(void __user *arg
+@@ -4139,6 +4141,8 @@ static int ioc_resetdrv(void __user *arg, char *cmnd)
      gdth_ha_str *ha;
      int rval;
  
@@ -33764,7 +35737,7 @@ diff -urNp linux-3.1.3/drivers/scsi/gdth.c linux-3.1.3/drivers/scsi/gdth.c
      if (copy_from_user(&res, arg, sizeof(gdth_ioctl_reset)) ||
          res.number >= MAX_HDRIVES)
          return -EFAULT;
-@@ -4174,6 +4178,8 @@ static int ioc_general(void __user *arg,
+@@ -4174,6 +4178,8 @@ static int ioc_general(void __user *arg, char *cmnd)
      gdth_ha_str *ha;
      int rval;
  
@@ -33783,10 +35756,11 @@ diff -urNp linux-3.1.3/drivers/scsi/gdth.c linux-3.1.3/drivers/scsi/gdth.c
      memset(cmnd, 0xff, MAX_COMMAND_SIZE);
  
      TRACE2(("gdth_flush() hanum %d\n", ha->hanum));
-diff -urNp linux-3.1.3/drivers/scsi/gdth_proc.c linux-3.1.3/drivers/scsi/gdth_proc.c
---- linux-3.1.3/drivers/scsi/gdth_proc.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/gdth_proc.c       2011-11-16 18:40:22.000000000 -0500
-@@ -47,6 +47,9 @@ static int gdth_set_asc_info(struct Scsi
+diff --git a/drivers/scsi/gdth_proc.c b/drivers/scsi/gdth_proc.c
+index 6527543..81e4fe2 100644
+--- a/drivers/scsi/gdth_proc.c
++++ b/drivers/scsi/gdth_proc.c
+@@ -47,6 +47,9 @@ static int gdth_set_asc_info(struct Scsi_Host *host, char *buffer,
      u64         paddr;
  
      char            cmnd[MAX_COMMAND_SIZE];
@@ -33796,7 +35770,7 @@ diff -urNp linux-3.1.3/drivers/scsi/gdth_proc.c linux-3.1.3/drivers/scsi/gdth_pr
      memset(cmnd, 0xff, 12);
      memset(&gdtcmd, 0, sizeof(gdth_cmd_str));
  
-@@ -175,6 +178,8 @@ static int gdth_get_info(char *buffer,ch
+@@ -175,6 +178,8 @@ static int gdth_get_info(char *buffer,char **start,off_t offset,int length,
      gdth_hget_str *phg;
      char cmnd[MAX_COMMAND_SIZE];
  
@@ -33805,9 +35779,10 @@ diff -urNp linux-3.1.3/drivers/scsi/gdth_proc.c linux-3.1.3/drivers/scsi/gdth_pr
      gdtcmd = kmalloc(sizeof(*gdtcmd), GFP_KERNEL);
      estr = kmalloc(sizeof(*estr), GFP_KERNEL);
      if (!gdtcmd || !estr)
-diff -urNp linux-3.1.3/drivers/scsi/hosts.c linux-3.1.3/drivers/scsi/hosts.c
---- linux-3.1.3/drivers/scsi/hosts.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/hosts.c   2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
+index 351dc0b..951dc32 100644
+--- a/drivers/scsi/hosts.c
++++ b/drivers/scsi/hosts.c
 @@ -42,7 +42,7 @@
  #include "scsi_logging.h"
  
@@ -33817,7 +35792,7 @@ diff -urNp linux-3.1.3/drivers/scsi/hosts.c linux-3.1.3/drivers/scsi/hosts.c
  
  
  static void scsi_host_cls_release(struct device *dev)
-@@ -357,7 +357,7 @@ struct Scsi_Host *scsi_host_alloc(struct
+@@ -357,7 +357,7 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
         * subtract one because we increment first then return, but we need to
         * know what the next host number was before increment
         */
@@ -33826,10 +35801,11 @@ diff -urNp linux-3.1.3/drivers/scsi/hosts.c linux-3.1.3/drivers/scsi/hosts.c
        shost->dma_channel = 0xff;
  
        /* These three are default values which can be overridden */
-diff -urNp linux-3.1.3/drivers/scsi/hpsa.c linux-3.1.3/drivers/scsi/hpsa.c
---- linux-3.1.3/drivers/scsi/hpsa.c    2011-11-26 19:57:29.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/hpsa.c    2011-11-26 20:00:43.000000000 -0500
-@@ -499,7 +499,7 @@ static inline u32 next_command(struct ct
+diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
+index 418ce83..7ee1225 100644
+--- a/drivers/scsi/hpsa.c
++++ b/drivers/scsi/hpsa.c
+@@ -499,7 +499,7 @@ static inline u32 next_command(struct ctlr_info *h)
        u32 a;
  
        if (unlikely(!(h->transMethod & CFGTBL_Trans_Performant)))
@@ -33838,7 +35814,7 @@ diff -urNp linux-3.1.3/drivers/scsi/hpsa.c linux-3.1.3/drivers/scsi/hpsa.c
  
        if ((*(h->reply_pool_head) & 1) == (h->reply_pool_wraparound)) {
                a = *(h->reply_pool_head); /* Next cmd in ring buffer */
-@@ -2956,7 +2956,7 @@ static void start_io(struct ctlr_info *h
+@@ -2956,7 +2956,7 @@ static void start_io(struct ctlr_info *h)
        while (!list_empty(&h->reqQ)) {
                c = list_entry(h->reqQ.next, struct CommandList, list);
                /* can't do anything if fifo is full */
@@ -33847,7 +35823,7 @@ diff -urNp linux-3.1.3/drivers/scsi/hpsa.c linux-3.1.3/drivers/scsi/hpsa.c
                        dev_warn(&h->pdev->dev, "fifo full\n");
                        break;
                }
-@@ -2966,7 +2966,7 @@ static void start_io(struct ctlr_info *h
+@@ -2966,7 +2966,7 @@ static void start_io(struct ctlr_info *h)
                h->Qdepth--;
  
                /* Tell the controller execute command */
@@ -33856,7 +35832,7 @@ diff -urNp linux-3.1.3/drivers/scsi/hpsa.c linux-3.1.3/drivers/scsi/hpsa.c
  
                /* Put job onto the completed Q */
                addQ(&h->cmpQ, c);
-@@ -2975,17 +2975,17 @@ static void start_io(struct ctlr_info *h
+@@ -2975,17 +2975,17 @@ static void start_io(struct ctlr_info *h)
  
  static inline unsigned long get_next_completion(struct ctlr_info *h)
  {
@@ -33877,7 +35853,7 @@ diff -urNp linux-3.1.3/drivers/scsi/hpsa.c linux-3.1.3/drivers/scsi/hpsa.c
                (h->interrupts_enabled == 0);
  }
  
-@@ -3882,7 +3882,7 @@ static int __devinit hpsa_pci_init(struc
+@@ -3882,7 +3882,7 @@ static int __devinit hpsa_pci_init(struct ctlr_info *h)
        if (prod_index < 0)
                return -ENODEV;
        h->product_name = products[prod_index].product_name;
@@ -33925,7 +35901,7 @@ diff -urNp linux-3.1.3/drivers/scsi/hpsa.c linux-3.1.3/drivers/scsi/hpsa.c
  
        hpsa_hba_inquiry(h);
        hpsa_register_scsi(h);  /* hook ourselves into SCSI subsystem */
-@@ -4292,7 +4292,7 @@ static void hpsa_shutdown(struct pci_dev
+@@ -4292,7 +4292,7 @@ static void hpsa_shutdown(struct pci_dev *pdev)
         * To write all data in the battery backed cache to disks
         */
        hpsa_flush_cache(h);
@@ -33934,7 +35910,7 @@ diff -urNp linux-3.1.3/drivers/scsi/hpsa.c linux-3.1.3/drivers/scsi/hpsa.c
        free_irq(h->intr[h->intr_mode], h);
  #ifdef CONFIG_PCI_MSI
        if (h->msix_vector)
-@@ -4455,7 +4455,7 @@ static __devinit void hpsa_enter_perform
+@@ -4455,7 +4455,7 @@ static __devinit void hpsa_enter_performant_mode(struct ctlr_info *h,
                return;
        }
        /* Change the access methods to the performant access methods */
@@ -33943,9 +35919,10 @@ diff -urNp linux-3.1.3/drivers/scsi/hpsa.c linux-3.1.3/drivers/scsi/hpsa.c
        h->transMethod = CFGTBL_Trans_Performant;
  }
  
-diff -urNp linux-3.1.3/drivers/scsi/hpsa.h linux-3.1.3/drivers/scsi/hpsa.h
---- linux-3.1.3/drivers/scsi/hpsa.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/hpsa.h    2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h
+index 7f53cea..a8c7188 100644
+--- a/drivers/scsi/hpsa.h
++++ b/drivers/scsi/hpsa.h
 @@ -73,7 +73,7 @@ struct ctlr_info {
        unsigned int msix_vector;
        unsigned int msi_vector;
@@ -33955,9 +35932,10 @@ diff -urNp linux-3.1.3/drivers/scsi/hpsa.h linux-3.1.3/drivers/scsi/hpsa.h
  
        /* queue and queue Info */
        struct list_head reqQ;
-diff -urNp linux-3.1.3/drivers/scsi/ips.h linux-3.1.3/drivers/scsi/ips.h
---- linux-3.1.3/drivers/scsi/ips.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/ips.h     2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/scsi/ips.h b/drivers/scsi/ips.h
+index f2df059..a3a9930 100644
+--- a/drivers/scsi/ips.h
++++ b/drivers/scsi/ips.h
 @@ -1027,7 +1027,7 @@ typedef struct {
     int       (*intr)(struct ips_ha *);
     void      (*enableint)(struct ips_ha *);
@@ -33967,9 +35945,10 @@ diff -urNp linux-3.1.3/drivers/scsi/ips.h linux-3.1.3/drivers/scsi/ips.h
  
  typedef struct ips_ha {
     uint8_t            ha_id[IPS_MAX_CHANNELS+1];
-diff -urNp linux-3.1.3/drivers/scsi/libfc/fc_exch.c linux-3.1.3/drivers/scsi/libfc/fc_exch.c
---- linux-3.1.3/drivers/scsi/libfc/fc_exch.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/libfc/fc_exch.c   2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
+index d261e98..1e00f35 100644
+--- a/drivers/scsi/libfc/fc_exch.c
++++ b/drivers/scsi/libfc/fc_exch.c
 @@ -105,12 +105,12 @@ struct fc_exch_mgr {
         * all together if not used XXX
         */
@@ -33989,7 +35968,7 @@ diff -urNp linux-3.1.3/drivers/scsi/libfc/fc_exch.c linux-3.1.3/drivers/scsi/lib
        } stats;
  };
  
-@@ -718,7 +718,7 @@ static struct fc_exch *fc_exch_em_alloc(
+@@ -718,7 +718,7 @@ static struct fc_exch *fc_exch_em_alloc(struct fc_lport *lport,
        /* allocate memory for exchange */
        ep = mempool_alloc(mp->ep_pool, GFP_ATOMIC);
        if (!ep) {
@@ -34007,7 +35986,7 @@ diff -urNp linux-3.1.3/drivers/scsi/libfc/fc_exch.c linux-3.1.3/drivers/scsi/lib
        mempool_free(ep, mp->ep_pool);
        return NULL;
  }
-@@ -922,7 +922,7 @@ static enum fc_pf_rjt_reason fc_seq_look
+@@ -922,7 +922,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport,
                xid = ntohs(fh->fh_ox_id);      /* we originated exch */
                ep = fc_exch_find(mp, xid);
                if (!ep) {
@@ -34016,7 +35995,7 @@ diff -urNp linux-3.1.3/drivers/scsi/libfc/fc_exch.c linux-3.1.3/drivers/scsi/lib
                        reject = FC_RJT_OX_ID;
                        goto out;
                }
-@@ -952,7 +952,7 @@ static enum fc_pf_rjt_reason fc_seq_look
+@@ -952,7 +952,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport,
                ep = fc_exch_find(mp, xid);
                if ((f_ctl & FC_FC_FIRST_SEQ) && fc_sof_is_init(fr_sof(fp))) {
                        if (ep) {
@@ -34025,7 +36004,7 @@ diff -urNp linux-3.1.3/drivers/scsi/libfc/fc_exch.c linux-3.1.3/drivers/scsi/lib
                                reject = FC_RJT_RX_ID;
                                goto rel;
                        }
-@@ -963,7 +963,7 @@ static enum fc_pf_rjt_reason fc_seq_look
+@@ -963,7 +963,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport,
                        }
                        xid = ep->xid;  /* get our XID */
                } else if (!ep) {
@@ -34034,7 +36013,7 @@ diff -urNp linux-3.1.3/drivers/scsi/libfc/fc_exch.c linux-3.1.3/drivers/scsi/lib
                        reject = FC_RJT_RX_ID;  /* XID not found */
                        goto out;
                }
-@@ -980,7 +980,7 @@ static enum fc_pf_rjt_reason fc_seq_look
+@@ -980,7 +980,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport,
        } else {
                sp = &ep->seq;
                if (sp->id != fh->fh_seq_id) {
@@ -34043,7 +36022,7 @@ diff -urNp linux-3.1.3/drivers/scsi/libfc/fc_exch.c linux-3.1.3/drivers/scsi/lib
                        if (f_ctl & FC_FC_END_SEQ) {
                                /*
                                 * Update sequence_id based on incoming last
-@@ -1430,22 +1430,22 @@ static void fc_exch_recv_seq_resp(struct
+@@ -1430,22 +1430,22 @@ static void fc_exch_recv_seq_resp(struct fc_exch_mgr *mp, struct fc_frame *fp)
  
        ep = fc_exch_find(mp, ntohs(fh->fh_ox_id));
        if (!ep) {
@@ -34070,7 +36049,7 @@ diff -urNp linux-3.1.3/drivers/scsi/libfc/fc_exch.c linux-3.1.3/drivers/scsi/lib
                goto rel;
        }
        sof = fr_sof(fp);
-@@ -1454,7 +1454,7 @@ static void fc_exch_recv_seq_resp(struct
+@@ -1454,7 +1454,7 @@ static void fc_exch_recv_seq_resp(struct fc_exch_mgr *mp, struct fc_frame *fp)
                sp->ssb_stat |= SSB_ST_RESP;
                sp->id = fh->fh_seq_id;
        } else if (sp->id != fh->fh_seq_id) {
@@ -34079,7 +36058,7 @@ diff -urNp linux-3.1.3/drivers/scsi/libfc/fc_exch.c linux-3.1.3/drivers/scsi/lib
                goto rel;
        }
  
-@@ -1518,9 +1518,9 @@ static void fc_exch_recv_resp(struct fc_
+@@ -1518,9 +1518,9 @@ static void fc_exch_recv_resp(struct fc_exch_mgr *mp, struct fc_frame *fp)
        sp = fc_seq_lookup_orig(mp, fp);        /* doesn't hold sequence */
  
        if (!sp)
@@ -34091,10 +36070,11 @@ diff -urNp linux-3.1.3/drivers/scsi/libfc/fc_exch.c linux-3.1.3/drivers/scsi/lib
  
        fc_frame_free(fp);
  }
-diff -urNp linux-3.1.3/drivers/scsi/libsas/sas_ata.c linux-3.1.3/drivers/scsi/libsas/sas_ata.c
---- linux-3.1.3/drivers/scsi/libsas/sas_ata.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/libsas/sas_ata.c  2011-11-16 18:39:07.000000000 -0500
-@@ -368,7 +368,7 @@ static struct ata_port_operations sas_sa
+diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
+index db9238f..4378ed2 100644
+--- a/drivers/scsi/libsas/sas_ata.c
++++ b/drivers/scsi/libsas/sas_ata.c
+@@ -368,7 +368,7 @@ static struct ata_port_operations sas_sata_ops = {
        .postreset              = ata_std_postreset,
        .error_handler          = ata_std_error_handler,
        .post_internal_cmd      = sas_ata_post_internal,
@@ -34103,10 +36083,44 @@ diff -urNp linux-3.1.3/drivers/scsi/libsas/sas_ata.c linux-3.1.3/drivers/scsi/li
        .qc_prep                = ata_noop_qc_prep,
        .qc_issue               = sas_ata_qc_issue,
        .qc_fill_rtf            = sas_ata_qc_fill_rtf,
-diff -urNp linux-3.1.3/drivers/scsi/lpfc/lpfc_debugfs.c linux-3.1.3/drivers/scsi/lpfc/lpfc_debugfs.c
---- linux-3.1.3/drivers/scsi/lpfc/lpfc_debugfs.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/lpfc/lpfc_debugfs.c       2011-11-16 18:40:22.000000000 -0500
-@@ -105,7 +105,7 @@ MODULE_PARM_DESC(lpfc_debugfs_mask_disc_
+diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h
+index c088a36..01c73b0 100644
+--- a/drivers/scsi/lpfc/lpfc.h
++++ b/drivers/scsi/lpfc/lpfc.h
+@@ -425,7 +425,7 @@ struct lpfc_vport {
+       struct dentry *debug_nodelist;
+       struct dentry *vport_debugfs_root;
+       struct lpfc_debugfs_trc *disc_trc;
+-      atomic_t disc_trc_cnt;
++      atomic_unchecked_t disc_trc_cnt;
+ #endif
+       uint8_t stat_data_enabled;
+       uint8_t stat_data_blocked;
+@@ -835,8 +835,8 @@ struct lpfc_hba {
+       struct timer_list fabric_block_timer;
+       unsigned long bit_flags;
+ #define       FABRIC_COMANDS_BLOCKED  0
+-      atomic_t num_rsrc_err;
+-      atomic_t num_cmd_success;
++      atomic_unchecked_t num_rsrc_err;
++      atomic_unchecked_t num_cmd_success;
+       unsigned long last_rsrc_error_time;
+       unsigned long last_ramp_down_time;
+       unsigned long last_ramp_up_time;
+@@ -850,7 +850,7 @@ struct lpfc_hba {
+       struct dentry *debug_dumpDif;    /* BlockGuard BPL*/
+       struct dentry *debug_slow_ring_trc;
+       struct lpfc_debugfs_trc *slow_ring_trc;
+-      atomic_t slow_ring_trc_cnt;
++      atomic_unchecked_t slow_ring_trc_cnt;
+       /* iDiag debugfs sub-directory */
+       struct dentry *idiag_root;
+       struct dentry *idiag_pci_cfg;
+diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c
+index a0424dd..2499b6b 100644
+--- a/drivers/scsi/lpfc/lpfc_debugfs.c
++++ b/drivers/scsi/lpfc/lpfc_debugfs.c
+@@ -105,7 +105,7 @@ MODULE_PARM_DESC(lpfc_debugfs_mask_disc_trc,
  
  #include <linux/debugfs.h>
  
@@ -34115,7 +36129,7 @@ diff -urNp linux-3.1.3/drivers/scsi/lpfc/lpfc_debugfs.c linux-3.1.3/drivers/scsi
  static unsigned long lpfc_debugfs_start_time = 0L;
  
  /* iDiag */
-@@ -146,7 +146,7 @@ lpfc_debugfs_disc_trc_data(struct lpfc_v
+@@ -146,7 +146,7 @@ lpfc_debugfs_disc_trc_data(struct lpfc_vport *vport, char *buf, int size)
        lpfc_debugfs_enable = 0;
  
        len = 0;
@@ -34124,7 +36138,7 @@ diff -urNp linux-3.1.3/drivers/scsi/lpfc/lpfc_debugfs.c linux-3.1.3/drivers/scsi
                (lpfc_debugfs_max_disc_trc - 1);
        for (i = index; i < lpfc_debugfs_max_disc_trc; i++) {
                dtp = vport->disc_trc + i;
-@@ -212,7 +212,7 @@ lpfc_debugfs_slow_ring_trc_data(struct l
+@@ -212,7 +212,7 @@ lpfc_debugfs_slow_ring_trc_data(struct lpfc_hba *phba, char *buf, int size)
        lpfc_debugfs_enable = 0;
  
        len = 0;
@@ -34133,7 +36147,7 @@ diff -urNp linux-3.1.3/drivers/scsi/lpfc/lpfc_debugfs.c linux-3.1.3/drivers/scsi
                (lpfc_debugfs_max_slow_ring_trc - 1);
        for (i = index; i < lpfc_debugfs_max_slow_ring_trc; i++) {
                dtp = phba->slow_ring_trc + i;
-@@ -635,14 +635,14 @@ lpfc_debugfs_disc_trc(struct lpfc_vport 
+@@ -635,14 +635,14 @@ lpfc_debugfs_disc_trc(struct lpfc_vport *vport, int mask, char *fmt,
                !vport || !vport->disc_trc)
                return;
  
@@ -34150,7 +36164,7 @@ diff -urNp linux-3.1.3/drivers/scsi/lpfc/lpfc_debugfs.c linux-3.1.3/drivers/scsi
        dtp->jif = jiffies;
  #endif
        return;
-@@ -673,14 +673,14 @@ lpfc_debugfs_slow_ring_trc(struct lpfc_h
+@@ -673,14 +673,14 @@ lpfc_debugfs_slow_ring_trc(struct lpfc_hba *phba, char *fmt,
                !phba || !phba->slow_ring_trc)
                return;
  
@@ -34167,7 +36181,7 @@ diff -urNp linux-3.1.3/drivers/scsi/lpfc/lpfc_debugfs.c linux-3.1.3/drivers/scsi
        dtp->jif = jiffies;
  #endif
        return;
-@@ -3828,7 +3828,7 @@ lpfc_debugfs_initialize(struct lpfc_vpor
+@@ -3828,7 +3828,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
                                                 "slow_ring buffer\n");
                                goto debug_failed;
                        }
@@ -34176,7 +36190,7 @@ diff -urNp linux-3.1.3/drivers/scsi/lpfc/lpfc_debugfs.c linux-3.1.3/drivers/scsi
                        memset(phba->slow_ring_trc, 0,
                                (sizeof(struct lpfc_debugfs_trc) *
                                lpfc_debugfs_max_slow_ring_trc));
-@@ -3874,7 +3874,7 @@ lpfc_debugfs_initialize(struct lpfc_vpor
+@@ -3874,7 +3874,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
                                 "buffer\n");
                goto debug_failed;
        }
@@ -34185,41 +36199,10 @@ diff -urNp linux-3.1.3/drivers/scsi/lpfc/lpfc_debugfs.c linux-3.1.3/drivers/scsi
  
        snprintf(name, sizeof(name), "discovery_trace");
        vport->debug_disc_trc =
-diff -urNp linux-3.1.3/drivers/scsi/lpfc/lpfc.h linux-3.1.3/drivers/scsi/lpfc/lpfc.h
---- linux-3.1.3/drivers/scsi/lpfc/lpfc.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/lpfc/lpfc.h       2011-11-16 18:39:07.000000000 -0500
-@@ -425,7 +425,7 @@ struct lpfc_vport {
-       struct dentry *debug_nodelist;
-       struct dentry *vport_debugfs_root;
-       struct lpfc_debugfs_trc *disc_trc;
--      atomic_t disc_trc_cnt;
-+      atomic_unchecked_t disc_trc_cnt;
- #endif
-       uint8_t stat_data_enabled;
-       uint8_t stat_data_blocked;
-@@ -835,8 +835,8 @@ struct lpfc_hba {
-       struct timer_list fabric_block_timer;
-       unsigned long bit_flags;
- #define       FABRIC_COMANDS_BLOCKED  0
--      atomic_t num_rsrc_err;
--      atomic_t num_cmd_success;
-+      atomic_unchecked_t num_rsrc_err;
-+      atomic_unchecked_t num_cmd_success;
-       unsigned long last_rsrc_error_time;
-       unsigned long last_ramp_down_time;
-       unsigned long last_ramp_up_time;
-@@ -850,7 +850,7 @@ struct lpfc_hba {
-       struct dentry *debug_dumpDif;    /* BlockGuard BPL*/
-       struct dentry *debug_slow_ring_trc;
-       struct lpfc_debugfs_trc *slow_ring_trc;
--      atomic_t slow_ring_trc_cnt;
-+      atomic_unchecked_t slow_ring_trc_cnt;
-       /* iDiag debugfs sub-directory */
-       struct dentry *idiag_root;
-       struct dentry *idiag_pci_cfg;
-diff -urNp linux-3.1.3/drivers/scsi/lpfc/lpfc_init.c linux-3.1.3/drivers/scsi/lpfc/lpfc_init.c
---- linux-3.1.3/drivers/scsi/lpfc/lpfc_init.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/lpfc/lpfc_init.c  2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
+index a3c8200..31e562e 100644
+--- a/drivers/scsi/lpfc/lpfc_init.c
++++ b/drivers/scsi/lpfc/lpfc_init.c
 @@ -9969,8 +9969,10 @@ lpfc_init(void)
        printk(LPFC_COPYRIGHT "\n");
  
@@ -34233,10 +36216,11 @@ diff -urNp linux-3.1.3/drivers/scsi/lpfc/lpfc_init.c linux-3.1.3/drivers/scsi/lp
        }
        lpfc_transport_template =
                                fc_attach_transport(&lpfc_transport_functions);
-diff -urNp linux-3.1.3/drivers/scsi/lpfc/lpfc_scsi.c linux-3.1.3/drivers/scsi/lpfc/lpfc_scsi.c
---- linux-3.1.3/drivers/scsi/lpfc/lpfc_scsi.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/lpfc/lpfc_scsi.c  2011-11-16 18:39:07.000000000 -0500
-@@ -297,7 +297,7 @@ lpfc_rampdown_queue_depth(struct lpfc_hb
+diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
+index eadd241..26c8e0f 100644
+--- a/drivers/scsi/lpfc/lpfc_scsi.c
++++ b/drivers/scsi/lpfc/lpfc_scsi.c
+@@ -297,7 +297,7 @@ lpfc_rampdown_queue_depth(struct lpfc_hba *phba)
        uint32_t evt_posted;
  
        spin_lock_irqsave(&phba->hbalock, flags);
@@ -34245,7 +36229,7 @@ diff -urNp linux-3.1.3/drivers/scsi/lpfc/lpfc_scsi.c linux-3.1.3/drivers/scsi/lp
        phba->last_rsrc_error_time = jiffies;
  
        if ((phba->last_ramp_down_time + QUEUE_RAMP_DOWN_INTERVAL) > jiffies) {
-@@ -338,7 +338,7 @@ lpfc_rampup_queue_depth(struct lpfc_vpor
+@@ -338,7 +338,7 @@ lpfc_rampup_queue_depth(struct lpfc_vport  *vport,
        unsigned long flags;
        struct lpfc_hba *phba = vport->phba;
        uint32_t evt_posted;
@@ -34254,7 +36238,7 @@ diff -urNp linux-3.1.3/drivers/scsi/lpfc/lpfc_scsi.c linux-3.1.3/drivers/scsi/lp
  
        if (vport->cfg_lun_queue_depth <= queue_depth)
                return;
-@@ -382,8 +382,8 @@ lpfc_ramp_down_queue_handler(struct lpfc
+@@ -382,8 +382,8 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba)
        unsigned long num_rsrc_err, num_cmd_success;
        int i;
  
@@ -34265,7 +36249,7 @@ diff -urNp linux-3.1.3/drivers/scsi/lpfc/lpfc_scsi.c linux-3.1.3/drivers/scsi/lp
  
        vports = lpfc_create_vport_work_array(phba);
        if (vports != NULL)
-@@ -403,8 +403,8 @@ lpfc_ramp_down_queue_handler(struct lpfc
+@@ -403,8 +403,8 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba)
                        }
                }
        lpfc_destroy_vport_work_array(phba, vports);
@@ -34276,7 +36260,7 @@ diff -urNp linux-3.1.3/drivers/scsi/lpfc/lpfc_scsi.c linux-3.1.3/drivers/scsi/lp
  }
  
  /**
-@@ -438,8 +438,8 @@ lpfc_ramp_up_queue_handler(struct lpfc_h
+@@ -438,8 +438,8 @@ lpfc_ramp_up_queue_handler(struct lpfc_hba *phba)
                        }
                }
        lpfc_destroy_vport_work_array(phba, vports);
@@ -34287,10 +36271,11 @@ diff -urNp linux-3.1.3/drivers/scsi/lpfc/lpfc_scsi.c linux-3.1.3/drivers/scsi/lp
  }
  
  /**
-diff -urNp linux-3.1.3/drivers/scsi/megaraid/megaraid_mbox.c linux-3.1.3/drivers/scsi/megaraid/megaraid_mbox.c
---- linux-3.1.3/drivers/scsi/megaraid/megaraid_mbox.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/megaraid/megaraid_mbox.c  2011-11-16 18:40:22.000000000 -0500
-@@ -3503,6 +3503,8 @@ megaraid_cmm_register(adapter_t *adapter
+diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c
+index 2e6619e..fa64494 100644
+--- a/drivers/scsi/megaraid/megaraid_mbox.c
++++ b/drivers/scsi/megaraid/megaraid_mbox.c
+@@ -3503,6 +3503,8 @@ megaraid_cmm_register(adapter_t *adapter)
        int             rval;
        int             i;
  
@@ -34299,10 +36284,11 @@ diff -urNp linux-3.1.3/drivers/scsi/megaraid/megaraid_mbox.c linux-3.1.3/drivers
        // Allocate memory for the base list of scb for management module.
        adapter->uscb_list = kcalloc(MBOX_MAX_USER_CMDS, sizeof(scb_t), GFP_KERNEL);
  
-diff -urNp linux-3.1.3/drivers/scsi/osd/osd_initiator.c linux-3.1.3/drivers/scsi/osd/osd_initiator.c
---- linux-3.1.3/drivers/scsi/osd/osd_initiator.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/osd/osd_initiator.c       2011-11-16 18:40:22.000000000 -0500
-@@ -97,6 +97,8 @@ static int _osd_get_print_system_info(st
+diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c
+index 86afb13f..c912398 100644
+--- a/drivers/scsi/osd/osd_initiator.c
++++ b/drivers/scsi/osd/osd_initiator.c
+@@ -97,6 +97,8 @@ static int _osd_get_print_system_info(struct osd_dev *od,
        int nelem = ARRAY_SIZE(get_attrs), a = 0;
        int ret;
  
@@ -34311,10 +36297,11 @@ diff -urNp linux-3.1.3/drivers/scsi/osd/osd_initiator.c linux-3.1.3/drivers/scsi
        or = osd_start_request(od, GFP_KERNEL);
        if (!or)
                return -ENOMEM;
-diff -urNp linux-3.1.3/drivers/scsi/pmcraid.c linux-3.1.3/drivers/scsi/pmcraid.c
---- linux-3.1.3/drivers/scsi/pmcraid.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/pmcraid.c 2011-11-16 18:39:07.000000000 -0500
-@@ -201,8 +201,8 @@ static int pmcraid_slave_alloc(struct sc
+diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
+index d079f9a..d26072c 100644
+--- a/drivers/scsi/pmcraid.c
++++ b/drivers/scsi/pmcraid.c
+@@ -201,8 +201,8 @@ static int pmcraid_slave_alloc(struct scsi_device *scsi_dev)
                res->scsi_dev = scsi_dev;
                scsi_dev->hostdata = res;
                res->change_detected = 0;
@@ -34325,7 +36312,7 @@ diff -urNp linux-3.1.3/drivers/scsi/pmcraid.c linux-3.1.3/drivers/scsi/pmcraid.c
                rc = 0;
        }
        spin_unlock_irqrestore(&pinstance->resource_lock, lock_flags);
-@@ -2677,9 +2677,9 @@ static int pmcraid_error_handler(struct 
+@@ -2677,9 +2677,9 @@ static int pmcraid_error_handler(struct pmcraid_cmd *cmd)
  
        /* If this was a SCSI read/write command keep count of errors */
        if (SCSI_CMD_TYPE(scsi_cmd->cmnd[0]) == SCSI_READ_CMD)
@@ -34355,7 +36342,7 @@ diff -urNp linux-3.1.3/drivers/scsi/pmcraid.c linux-3.1.3/drivers/scsi/pmcraid.c
                          pinstance->num_hrrq;
  
        if (request_size) {
-@@ -4498,7 +4498,7 @@ static void pmcraid_worker_function(stru
+@@ -4498,7 +4498,7 @@ static void pmcraid_worker_function(struct work_struct *workp)
  
        pinstance = container_of(workp, struct pmcraid_instance, worker_q);
        /* add resources only after host is added into system */
@@ -34364,7 +36351,7 @@ diff -urNp linux-3.1.3/drivers/scsi/pmcraid.c linux-3.1.3/drivers/scsi/pmcraid.c
                return;
  
        fw_version = be16_to_cpu(pinstance->inq_data->fw_version);
-@@ -5332,8 +5332,8 @@ static int __devinit pmcraid_init_instan
+@@ -5332,8 +5332,8 @@ static int __devinit pmcraid_init_instance(
        init_waitqueue_head(&pinstance->reset_wait_q);
  
        atomic_set(&pinstance->outstanding_cmds, 0);
@@ -34384,9 +36371,10 @@ diff -urNp linux-3.1.3/drivers/scsi/pmcraid.c linux-3.1.3/drivers/scsi/pmcraid.c
        schedule_work(&pinstance->worker_q);
        return rc;
  
-diff -urNp linux-3.1.3/drivers/scsi/pmcraid.h linux-3.1.3/drivers/scsi/pmcraid.h
---- linux-3.1.3/drivers/scsi/pmcraid.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/pmcraid.h 2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/scsi/pmcraid.h b/drivers/scsi/pmcraid.h
+index f920baf..4417389 100644
+--- a/drivers/scsi/pmcraid.h
++++ b/drivers/scsi/pmcraid.h
 @@ -749,7 +749,7 @@ struct pmcraid_instance {
        struct pmcraid_isr_param hrrq_vector[PMCRAID_NUM_MSIX_VECTORS];
  
@@ -34416,9 +36404,10 @@ diff -urNp linux-3.1.3/drivers/scsi/pmcraid.h linux-3.1.3/drivers/scsi/pmcraid.h
  
        /* To indicate add/delete/modify during CCN */
        u8 change_detected;
-diff -urNp linux-3.1.3/drivers/scsi/qla2xxx/qla_def.h linux-3.1.3/drivers/scsi/qla2xxx/qla_def.h
---- linux-3.1.3/drivers/scsi/qla2xxx/qla_def.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/qla2xxx/qla_def.h 2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
+index a03eaf4..a6b3fd9 100644
+--- a/drivers/scsi/qla2xxx/qla_def.h
++++ b/drivers/scsi/qla2xxx/qla_def.h
 @@ -2244,7 +2244,7 @@ struct isp_operations {
        int (*get_flash_version) (struct scsi_qla_host *, void *);
        int (*start_scsi) (srb_t *);
@@ -34428,9 +36417,10 @@ diff -urNp linux-3.1.3/drivers/scsi/qla2xxx/qla_def.h linux-3.1.3/drivers/scsi/q
  
  /* MSI-X Support *************************************************************/
  
-diff -urNp linux-3.1.3/drivers/scsi/qla4xxx/ql4_def.h linux-3.1.3/drivers/scsi/qla4xxx/ql4_def.h
---- linux-3.1.3/drivers/scsi/qla4xxx/ql4_def.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/qla4xxx/ql4_def.h 2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h
+index 473c5c8..4e2f24a 100644
+--- a/drivers/scsi/qla4xxx/ql4_def.h
++++ b/drivers/scsi/qla4xxx/ql4_def.h
 @@ -256,7 +256,7 @@ struct ddb_entry {
        atomic_t retry_relogin_timer; /* Min Time between relogins
                                       * (4000 only) */
@@ -34440,10 +36430,11 @@ diff -urNp linux-3.1.3/drivers/scsi/qla4xxx/ql4_def.h linux-3.1.3/drivers/scsi/q
                                       * retried */
  
        uint16_t port;
-diff -urNp linux-3.1.3/drivers/scsi/qla4xxx/ql4_init.c linux-3.1.3/drivers/scsi/qla4xxx/ql4_init.c
---- linux-3.1.3/drivers/scsi/qla4xxx/ql4_init.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/qla4xxx/ql4_init.c        2011-11-16 18:39:07.000000000 -0500
-@@ -680,7 +680,7 @@ static struct ddb_entry * qla4xxx_alloc_
+diff --git a/drivers/scsi/qla4xxx/ql4_init.c b/drivers/scsi/qla4xxx/ql4_init.c
+index 42ed5db..0262f9e 100644
+--- a/drivers/scsi/qla4xxx/ql4_init.c
++++ b/drivers/scsi/qla4xxx/ql4_init.c
+@@ -680,7 +680,7 @@ static struct ddb_entry * qla4xxx_alloc_ddb(struct scsi_qla_host *ha,
        ddb_entry->fw_ddb_index = fw_ddb_index;
        atomic_set(&ddb_entry->retry_relogin_timer, INVALID_ENTRY);
        atomic_set(&ddb_entry->relogin_timer, 0);
@@ -34452,7 +36443,7 @@ diff -urNp linux-3.1.3/drivers/scsi/qla4xxx/ql4_init.c linux-3.1.3/drivers/scsi/
        atomic_set(&ddb_entry->state, DDB_STATE_ONLINE);
        list_add_tail(&ddb_entry->list, &ha->ddb_list);
        ha->fw_ddb_index_map[fw_ddb_index] = ddb_entry;
-@@ -1433,7 +1433,7 @@ int qla4xxx_process_ddb_changed(struct s
+@@ -1433,7 +1433,7 @@ int qla4xxx_process_ddb_changed(struct scsi_qla_host *ha, uint32_t fw_ddb_index,
        if ((ddb_entry->fw_ddb_device_state == DDB_DS_SESSION_ACTIVE) &&
           (atomic_read(&ddb_entry->state) != DDB_STATE_ONLINE)) {
                atomic_set(&ddb_entry->state, DDB_STATE_ONLINE);
@@ -34461,10 +36452,11 @@ diff -urNp linux-3.1.3/drivers/scsi/qla4xxx/ql4_init.c linux-3.1.3/drivers/scsi/
                atomic_set(&ddb_entry->relogin_timer, 0);
                clear_bit(DF_RELOGIN, &ddb_entry->flags);
                iscsi_unblock_session(ddb_entry->sess);
-diff -urNp linux-3.1.3/drivers/scsi/qla4xxx/ql4_os.c linux-3.1.3/drivers/scsi/qla4xxx/ql4_os.c
---- linux-3.1.3/drivers/scsi/qla4xxx/ql4_os.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/qla4xxx/ql4_os.c  2011-11-16 18:39:07.000000000 -0500
-@@ -811,13 +811,13 @@ static void qla4xxx_timer(struct scsi_ql
+diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
+index f2364ec..44c42b1 100644
+--- a/drivers/scsi/qla4xxx/ql4_os.c
++++ b/drivers/scsi/qla4xxx/ql4_os.c
+@@ -811,13 +811,13 @@ static void qla4xxx_timer(struct scsi_qla_host *ha)
                            ddb_entry->fw_ddb_device_state ==
                            DDB_DS_SESSION_FAILED) {
                                /* Reset retry relogin timer */
@@ -34480,10 +36472,11 @@ diff -urNp linux-3.1.3/drivers/scsi/qla4xxx/ql4_os.c linux-3.1.3/drivers/scsi/ql
                                                          relogin_retry_count))
                                        );
                                start_dpc++;
-diff -urNp linux-3.1.3/drivers/scsi/scsi.c linux-3.1.3/drivers/scsi/scsi.c
---- linux-3.1.3/drivers/scsi/scsi.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/scsi.c    2011-11-16 18:39:07.000000000 -0500
-@@ -655,7 +655,7 @@ int scsi_dispatch_cmd(struct scsi_cmnd *
+diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
+index 2aeb2e9..46e3925 100644
+--- a/drivers/scsi/scsi.c
++++ b/drivers/scsi/scsi.c
+@@ -655,7 +655,7 @@ int scsi_dispatch_cmd(struct scsi_cmnd *cmd)
        unsigned long timeout;
        int rtn = 0;
  
@@ -34492,10 +36485,11 @@ diff -urNp linux-3.1.3/drivers/scsi/scsi.c linux-3.1.3/drivers/scsi/scsi.c
  
        /* check if the device is still usable */
        if (unlikely(cmd->device->sdev_state == SDEV_DEL)) {
-diff -urNp linux-3.1.3/drivers/scsi/scsi_debug.c linux-3.1.3/drivers/scsi/scsi_debug.c
---- linux-3.1.3/drivers/scsi/scsi_debug.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/scsi_debug.c      2011-11-16 18:40:22.000000000 -0500
-@@ -1493,6 +1493,8 @@ static int resp_mode_select(struct scsi_
+diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
+index 6888b2c..45befa1 100644
+--- a/drivers/scsi/scsi_debug.c
++++ b/drivers/scsi/scsi_debug.c
+@@ -1493,6 +1493,8 @@ static int resp_mode_select(struct scsi_cmnd * scp, int mselect6,
        unsigned char arr[SDEBUG_MAX_MSELECT_SZ];
        unsigned char *cmd = (unsigned char *)scp->cmnd;
  
@@ -34504,7 +36498,7 @@ diff -urNp linux-3.1.3/drivers/scsi/scsi_debug.c linux-3.1.3/drivers/scsi/scsi_d
        if ((errsts = check_readiness(scp, 1, devip)))
                return errsts;
        memset(arr, 0, sizeof(arr));
-@@ -1590,6 +1592,8 @@ static int resp_log_sense(struct scsi_cm
+@@ -1590,6 +1592,8 @@ static int resp_log_sense(struct scsi_cmnd * scp,
        unsigned char arr[SDEBUG_MAX_LSENSE_SZ];
        unsigned char *cmd = (unsigned char *)scp->cmnd;
  
@@ -34513,10 +36507,11 @@ diff -urNp linux-3.1.3/drivers/scsi/scsi_debug.c linux-3.1.3/drivers/scsi/scsi_d
        if ((errsts = check_readiness(scp, 1, devip)))
                return errsts;
        memset(arr, 0, sizeof(arr));
-diff -urNp linux-3.1.3/drivers/scsi/scsi_lib.c linux-3.1.3/drivers/scsi/scsi_lib.c
---- linux-3.1.3/drivers/scsi/scsi_lib.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/scsi_lib.c        2011-11-16 18:39:07.000000000 -0500
-@@ -1413,7 +1413,7 @@ static void scsi_kill_request(struct req
+diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
+index 6d219e4..eb3ded3 100644
+--- a/drivers/scsi/scsi_lib.c
++++ b/drivers/scsi/scsi_lib.c
+@@ -1415,7 +1415,7 @@ static void scsi_kill_request(struct request *req, struct request_queue *q)
        shost = sdev->host;
        scsi_init_cmd_errh(cmd);
        cmd->result = DID_NO_CONNECT << 16;
@@ -34525,7 +36520,7 @@ diff -urNp linux-3.1.3/drivers/scsi/scsi_lib.c linux-3.1.3/drivers/scsi/scsi_lib
  
        /*
         * SCSI request completion path will do scsi_device_unbusy(),
-@@ -1439,9 +1439,9 @@ static void scsi_softirq_done(struct req
+@@ -1441,9 +1441,9 @@ static void scsi_softirq_done(struct request *rq)
  
        INIT_LIST_HEAD(&cmd->eh_entry);
  
@@ -34537,10 +36532,11 @@ diff -urNp linux-3.1.3/drivers/scsi/scsi_lib.c linux-3.1.3/drivers/scsi/scsi_lib
  
        disposition = scsi_decide_disposition(cmd);
        if (disposition != SUCCESS &&
-diff -urNp linux-3.1.3/drivers/scsi/scsi_sysfs.c linux-3.1.3/drivers/scsi/scsi_sysfs.c
---- linux-3.1.3/drivers/scsi/scsi_sysfs.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/scsi_sysfs.c      2011-11-16 18:39:07.000000000 -0500
-@@ -622,7 +622,7 @@ show_iostat_##field(struct device *dev, 
+diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
+index e0bd3f7..816b8a6 100644
+--- a/drivers/scsi/scsi_sysfs.c
++++ b/drivers/scsi/scsi_sysfs.c
+@@ -622,7 +622,7 @@ show_iostat_##field(struct device *dev, struct device_attribute *attr,     \
                    char *buf)                                          \
  {                                                                     \
        struct scsi_device *sdev = to_scsi_device(dev);                 \
@@ -34549,10 +36545,11 @@ diff -urNp linux-3.1.3/drivers/scsi/scsi_sysfs.c linux-3.1.3/drivers/scsi/scsi_s
        return snprintf(buf, 20, "0x%llx\n", count);                    \
  }                                                                     \
  static DEVICE_ATTR(field, S_IRUGO, show_iostat_##field, NULL)
-diff -urNp linux-3.1.3/drivers/scsi/scsi_tgt_lib.c linux-3.1.3/drivers/scsi/scsi_tgt_lib.c
---- linux-3.1.3/drivers/scsi/scsi_tgt_lib.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/scsi_tgt_lib.c    2011-11-16 18:39:07.000000000 -0500
-@@ -362,7 +362,7 @@ static int scsi_map_user_pages(struct sc
+diff --git a/drivers/scsi/scsi_tgt_lib.c b/drivers/scsi/scsi_tgt_lib.c
+index 84a1fdf..693b0d6 100644
+--- a/drivers/scsi/scsi_tgt_lib.c
++++ b/drivers/scsi/scsi_tgt_lib.c
+@@ -362,7 +362,7 @@ static int scsi_map_user_pages(struct scsi_tgt_cmd *tcmd, struct scsi_cmnd *cmd,
        int err;
  
        dprintk("%lx %u\n", uaddr, len);
@@ -34561,10 +36558,11 @@ diff -urNp linux-3.1.3/drivers/scsi/scsi_tgt_lib.c linux-3.1.3/drivers/scsi/scsi
        if (err) {
                /*
                 * TODO: need to fixup sg_tablesize, max_segment_size,
-diff -urNp linux-3.1.3/drivers/scsi/scsi_transport_fc.c linux-3.1.3/drivers/scsi/scsi_transport_fc.c
---- linux-3.1.3/drivers/scsi/scsi_transport_fc.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/scsi_transport_fc.c       2011-11-16 18:39:07.000000000 -0500
-@@ -484,7 +484,7 @@ static DECLARE_TRANSPORT_CLASS(fc_vport_
+diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
+index 1b21491..1b7f60e 100644
+--- a/drivers/scsi/scsi_transport_fc.c
++++ b/drivers/scsi/scsi_transport_fc.c
+@@ -484,7 +484,7 @@ static DECLARE_TRANSPORT_CLASS(fc_vport_class,
   * Netlink Infrastructure
   */
  
@@ -34582,7 +36580,7 @@ diff -urNp linux-3.1.3/drivers/scsi/scsi_transport_fc.c linux-3.1.3/drivers/scsi
  }
  EXPORT_SYMBOL(fc_get_event_number);
  
-@@ -645,7 +645,7 @@ static __init int fc_transport_init(void
+@@ -645,7 +645,7 @@ static __init int fc_transport_init(void)
  {
        int error;
  
@@ -34591,7 +36589,7 @@ diff -urNp linux-3.1.3/drivers/scsi/scsi_transport_fc.c linux-3.1.3/drivers/scsi
  
        error = transport_class_register(&fc_host_class);
        if (error)
-@@ -835,7 +835,7 @@ static int fc_str_to_dev_loss(const char
+@@ -835,7 +835,7 @@ static int fc_str_to_dev_loss(const char *buf, unsigned long *val)
        char *cp;
  
        *val = simple_strtoul(buf, &cp, 0);
@@ -34600,9 +36598,10 @@ diff -urNp linux-3.1.3/drivers/scsi/scsi_transport_fc.c linux-3.1.3/drivers/scsi
                return -EINVAL;
        /*
         * Check for overflow; dev_loss_tmo is u32
-diff -urNp linux-3.1.3/drivers/scsi/scsi_transport_iscsi.c linux-3.1.3/drivers/scsi/scsi_transport_iscsi.c
---- linux-3.1.3/drivers/scsi/scsi_transport_iscsi.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/scsi_transport_iscsi.c    2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
+index 3fd16d7..ba0871f 100644
+--- a/drivers/scsi/scsi_transport_iscsi.c
++++ b/drivers/scsi/scsi_transport_iscsi.c
 @@ -83,7 +83,7 @@ struct iscsi_internal {
        struct device_attribute *session_attrs[ISCSI_SESSION_ATTRS + 1];
  };
@@ -34612,7 +36611,7 @@ diff -urNp linux-3.1.3/drivers/scsi/scsi_transport_iscsi.c linux-3.1.3/drivers/s
  static struct workqueue_struct *iscsi_eh_timer_workq;
  
  /*
-@@ -761,7 +761,7 @@ int iscsi_add_session(struct iscsi_cls_s
+@@ -761,7 +761,7 @@ int iscsi_add_session(struct iscsi_cls_session *session, unsigned int target_id)
        int err;
  
        ihost = shost->shost_data;
@@ -34621,7 +36620,7 @@ diff -urNp linux-3.1.3/drivers/scsi/scsi_transport_iscsi.c linux-3.1.3/drivers/s
  
        if (id == ISCSI_MAX_TARGET) {
                for (id = 0; id < ISCSI_MAX_TARGET; id++) {
-@@ -2200,7 +2200,7 @@ static __init int iscsi_transport_init(v
+@@ -2200,7 +2200,7 @@ static __init int iscsi_transport_init(void)
        printk(KERN_INFO "Loading iSCSI transport class v%s.\n",
                ISCSI_TRANSPORT_VERSION);
  
@@ -34630,9 +36629,10 @@ diff -urNp linux-3.1.3/drivers/scsi/scsi_transport_iscsi.c linux-3.1.3/drivers/s
  
        err = class_register(&iscsi_transport_class);
        if (err)
-diff -urNp linux-3.1.3/drivers/scsi/scsi_transport_srp.c linux-3.1.3/drivers/scsi/scsi_transport_srp.c
---- linux-3.1.3/drivers/scsi/scsi_transport_srp.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/scsi_transport_srp.c      2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/scsi/scsi_transport_srp.c b/drivers/scsi/scsi_transport_srp.c
+index 21a045e..ec89e03 100644
+--- a/drivers/scsi/scsi_transport_srp.c
++++ b/drivers/scsi/scsi_transport_srp.c
 @@ -33,7 +33,7 @@
  #include "scsi_transport_srp_internal.h"
  
@@ -34642,7 +36642,7 @@ diff -urNp linux-3.1.3/drivers/scsi/scsi_transport_srp.c linux-3.1.3/drivers/scs
  };
  #define to_srp_host_attrs(host)       ((struct srp_host_attrs *)(host)->shost_data)
  
-@@ -62,7 +62,7 @@ static int srp_host_setup(struct transpo
+@@ -62,7 +62,7 @@ static int srp_host_setup(struct transport_container *tc, struct device *dev,
        struct Scsi_Host *shost = dev_to_shost(dev);
        struct srp_host_attrs *srp_host = to_srp_host_attrs(shost);
  
@@ -34651,7 +36651,7 @@ diff -urNp linux-3.1.3/drivers/scsi/scsi_transport_srp.c linux-3.1.3/drivers/scs
        return 0;
  }
  
-@@ -211,7 +211,7 @@ struct srp_rport *srp_rport_add(struct S
+@@ -211,7 +211,7 @@ struct srp_rport *srp_rport_add(struct Scsi_Host *shost,
        memcpy(rport->port_id, ids->port_id, sizeof(rport->port_id));
        rport->roles = ids->roles;
  
@@ -34660,10 +36660,11 @@ diff -urNp linux-3.1.3/drivers/scsi/scsi_transport_srp.c linux-3.1.3/drivers/scs
        dev_set_name(&rport->dev, "port-%d:%d", shost->host_no, id);
  
        transport_setup_device(&rport->dev);
-diff -urNp linux-3.1.3/drivers/scsi/sg.c linux-3.1.3/drivers/scsi/sg.c
---- linux-3.1.3/drivers/scsi/sg.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/sg.c      2011-11-16 18:39:07.000000000 -0500
-@@ -1075,7 +1075,7 @@ sg_ioctl(struct file *filp, unsigned int
+diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
+index 909ed9e..1ae290a 100644
+--- a/drivers/scsi/sg.c
++++ b/drivers/scsi/sg.c
+@@ -1075,7 +1075,7 @@ sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg)
                                       sdp->disk->disk_name,
                                       MKDEV(SCSI_GENERIC_MAJOR, sdp->index),
                                       NULL,
@@ -34690,10 +36691,11 @@ diff -urNp linux-3.1.3/drivers/scsi/sg.c linux-3.1.3/drivers/scsi/sg.c
  
        sg_proc_sgp = proc_mkdir(sg_proc_sg_dirname, NULL);
        if (!sg_proc_sgp)
-diff -urNp linux-3.1.3/drivers/scsi/sym53c8xx_2/sym_glue.c linux-3.1.3/drivers/scsi/sym53c8xx_2/sym_glue.c
---- linux-3.1.3/drivers/scsi/sym53c8xx_2/sym_glue.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/sym53c8xx_2/sym_glue.c    2011-11-16 18:40:22.000000000 -0500
-@@ -1756,6 +1756,8 @@ static int __devinit sym2_probe(struct p
+diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c
+index b4543f5..e1b34b8 100644
+--- a/drivers/scsi/sym53c8xx_2/sym_glue.c
++++ b/drivers/scsi/sym53c8xx_2/sym_glue.c
+@@ -1756,6 +1756,8 @@ static int __devinit sym2_probe(struct pci_dev *pdev,
        int do_iounmap = 0;
        int do_disable_device = 1;
  
@@ -34702,10 +36704,11 @@ diff -urNp linux-3.1.3/drivers/scsi/sym53c8xx_2/sym_glue.c linux-3.1.3/drivers/s
        memset(&sym_dev, 0, sizeof(sym_dev));
        memset(&nvram, 0, sizeof(nvram));
        sym_dev.pdev = pdev;
-diff -urNp linux-3.1.3/drivers/scsi/vmw_pvscsi.c linux-3.1.3/drivers/scsi/vmw_pvscsi.c
---- linux-3.1.3/drivers/scsi/vmw_pvscsi.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/scsi/vmw_pvscsi.c      2011-11-16 18:40:22.000000000 -0500
-@@ -447,6 +447,8 @@ static void pvscsi_setup_all_rings(const
+diff --git a/drivers/scsi/vmw_pvscsi.c b/drivers/scsi/vmw_pvscsi.c
+index a18996d..fe993cb 100644
+--- a/drivers/scsi/vmw_pvscsi.c
++++ b/drivers/scsi/vmw_pvscsi.c
+@@ -447,6 +447,8 @@ static void pvscsi_setup_all_rings(const struct pvscsi_adapter *adapter)
        dma_addr_t base;
        unsigned i;
  
@@ -34714,22 +36717,11 @@ diff -urNp linux-3.1.3/drivers/scsi/vmw_pvscsi.c linux-3.1.3/drivers/scsi/vmw_pv
        cmd.ringsStatePPN   = adapter->ringStatePA >> PAGE_SHIFT;
        cmd.reqRingNumPages = adapter->req_pages;
        cmd.cmpRingNumPages = adapter->cmp_pages;
-diff -urNp linux-3.1.3/drivers/spi/spi.c linux-3.1.3/drivers/spi/spi.c
---- linux-3.1.3/drivers/spi/spi.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/spi/spi.c      2011-11-16 18:39:07.000000000 -0500
-@@ -1023,7 +1023,7 @@ int spi_bus_unlock(struct spi_master *ma
- EXPORT_SYMBOL_GPL(spi_bus_unlock);
- /* portable code must never pass more than 32 bytes */
--#define       SPI_BUFSIZ      max(32,SMP_CACHE_BYTES)
-+#define       SPI_BUFSIZ      max(32UL,SMP_CACHE_BYTES)
- static u8     *buf;
-diff -urNp linux-3.1.3/drivers/spi/spi-dw-pci.c linux-3.1.3/drivers/spi/spi-dw-pci.c
---- linux-3.1.3/drivers/spi/spi-dw-pci.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/spi/spi-dw-pci.c       2011-11-16 18:39:07.000000000 -0500
-@@ -148,7 +148,7 @@ static int spi_resume(struct pci_dev *pd
+diff --git a/drivers/spi/spi-dw-pci.c b/drivers/spi/spi-dw-pci.c
+index c5f37f0..898d202 100644
+--- a/drivers/spi/spi-dw-pci.c
++++ b/drivers/spi/spi-dw-pci.c
+@@ -148,7 +148,7 @@ static int spi_resume(struct pci_dev *pdev)
  #define spi_resume    NULL
  #endif
  
@@ -34738,10 +36730,24 @@ diff -urNp linux-3.1.3/drivers/spi/spi-dw-pci.c linux-3.1.3/drivers/spi/spi-dw-p
        /* Intel MID platform SPI controller 0 */
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x0800) },
        {},
-diff -urNp linux-3.1.3/drivers/staging/ath6kl/os/linux/ar6000_drv.c linux-3.1.3/drivers/staging/ath6kl/os/linux/ar6000_drv.c
---- linux-3.1.3/drivers/staging/ath6kl/os/linux/ar6000_drv.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/ath6kl/os/linux/ar6000_drv.c   2011-11-16 18:39:07.000000000 -0500
-@@ -362,7 +362,7 @@ static struct ar_cookie s_ar_cookie_mem[
+diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
+index 4d1b9f5..8408fe3 100644
+--- a/drivers/spi/spi.c
++++ b/drivers/spi/spi.c
+@@ -1023,7 +1023,7 @@ int spi_bus_unlock(struct spi_master *master)
+ EXPORT_SYMBOL_GPL(spi_bus_unlock);
+ /* portable code must never pass more than 32 bytes */
+-#define       SPI_BUFSIZ      max(32,SMP_CACHE_BYTES)
++#define       SPI_BUFSIZ      max(32UL,SMP_CACHE_BYTES)
+ static u8     *buf;
+diff --git a/drivers/staging/ath6kl/os/linux/ar6000_drv.c b/drivers/staging/ath6kl/os/linux/ar6000_drv.c
+index 32ee39a..3004c3d 100644
+--- a/drivers/staging/ath6kl/os/linux/ar6000_drv.c
++++ b/drivers/staging/ath6kl/os/linux/ar6000_drv.c
+@@ -362,7 +362,7 @@ static struct ar_cookie s_ar_cookie_mem[MAX_COOKIE_NUM];
          (((ar)->arTargetType == TARGET_TYPE_AR6003) ? AR6003_HOST_INTEREST_ITEM_ADDRESS(item) : 0))
  
  
@@ -34750,10 +36756,11 @@ diff -urNp linux-3.1.3/drivers/staging/ath6kl/os/linux/ar6000_drv.c linux-3.1.3/
      .ndo_init               = NULL,
      .ndo_open               = ar6000_open,
      .ndo_stop               = ar6000_close,
-diff -urNp linux-3.1.3/drivers/staging/ath6kl/os/linux/include/ar6k_pal.h linux-3.1.3/drivers/staging/ath6kl/os/linux/include/ar6k_pal.h
---- linux-3.1.3/drivers/staging/ath6kl/os/linux/include/ar6k_pal.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/ath6kl/os/linux/include/ar6k_pal.h     2011-11-16 18:39:07.000000000 -0500
-@@ -30,7 +30,7 @@ typedef bool (*ar6k_pal_recv_pkt_t)(void
+diff --git a/drivers/staging/ath6kl/os/linux/include/ar6k_pal.h b/drivers/staging/ath6kl/os/linux/include/ar6k_pal.h
+index 39e0873..0925710 100644
+--- a/drivers/staging/ath6kl/os/linux/include/ar6k_pal.h
++++ b/drivers/staging/ath6kl/os/linux/include/ar6k_pal.h
+@@ -30,7 +30,7 @@ typedef bool (*ar6k_pal_recv_pkt_t)(void *pHciPalInfo, void *skb);
  typedef struct ar6k_pal_config_s
  {
        ar6k_pal_recv_pkt_t fpar6k_pal_recv_pkt;
@@ -34762,10 +36769,11 @@ diff -urNp linux-3.1.3/drivers/staging/ath6kl/os/linux/include/ar6k_pal.h linux-
  
  void register_pal_cb(ar6k_pal_config_t *palConfig_p);
  #endif /* _AR6K_PAL_H_ */
-diff -urNp linux-3.1.3/drivers/staging/brcm80211/brcmfmac/dhd_linux.c linux-3.1.3/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
---- linux-3.1.3/drivers/staging/brcm80211/brcmfmac/dhd_linux.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/brcm80211/brcmfmac/dhd_linux.c 2011-11-16 18:39:07.000000000 -0500
-@@ -451,14 +451,14 @@ static void brcmf_op_if(struct brcmf_if 
+diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+index 05dada9..96171c6 100644
+--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
++++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+@@ -451,14 +451,14 @@ static void brcmf_op_if(struct brcmf_if *ifp)
                        free_netdev(ifp->net);
                }
                /* Allocate etherdev, including space for private structure */
@@ -34782,7 +36790,7 @@ diff -urNp linux-3.1.3/drivers/staging/brcm80211/brcmfmac/dhd_linux.c linux-3.1.
                        err = brcmf_net_attach(&drvr_priv->pub, ifp->idx);
                        if (err != 0) {
                                BRCMF_ERROR(("%s: brcmf_net_attach failed, "
-@@ -1279,7 +1279,7 @@ struct brcmf_pub *brcmf_attach(struct br
+@@ -1279,7 +1279,7 @@ struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus, uint bus_hdrlen)
        BRCMF_TRACE(("%s: Enter\n", __func__));
  
        /* Allocate etherdev, including space for private structure */
@@ -34791,7 +36799,7 @@ diff -urNp linux-3.1.3/drivers/staging/brcm80211/brcmfmac/dhd_linux.c linux-3.1.
        if (!net) {
                BRCMF_ERROR(("%s: OOM - alloc_etherdev\n", __func__));
                goto fail;
-@@ -1295,7 +1295,7 @@ struct brcmf_pub *brcmf_attach(struct br
+@@ -1295,7 +1295,7 @@ struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus, uint bus_hdrlen)
        /*
         * Save the brcmf_info into the priv
         */
@@ -34800,7 +36808,7 @@ diff -urNp linux-3.1.3/drivers/staging/brcm80211/brcmfmac/dhd_linux.c linux-3.1.
  
        /* Set network interface name if it was provided as module parameter */
        if (iface_name[0]) {
-@@ -1352,7 +1352,7 @@ struct brcmf_pub *brcmf_attach(struct br
+@@ -1352,7 +1352,7 @@ struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus, uint bus_hdrlen)
        /*
         * Save the brcmf_info into the priv
         */
@@ -34809,9 +36817,10 @@ diff -urNp linux-3.1.3/drivers/staging/brcm80211/brcmfmac/dhd_linux.c linux-3.1.
  
  #if defined(CONFIG_PM_SLEEP)
        atomic_set(&brcmf_mmc_suspend, false);
-diff -urNp linux-3.1.3/drivers/staging/brcm80211/brcmfmac/sdio_host.h linux-3.1.3/drivers/staging/brcm80211/brcmfmac/sdio_host.h
---- linux-3.1.3/drivers/staging/brcm80211/brcmfmac/sdio_host.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/brcm80211/brcmfmac/sdio_host.h 2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/staging/brcm80211/brcmfmac/sdio_host.h b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
+index d345472..cedb19e 100644
+--- a/drivers/staging/brcm80211/brcmfmac/sdio_host.h
++++ b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
 @@ -263,7 +263,7 @@ struct brcmf_sdioh_driver {
                         u16 func, uint bustype, u32 regsva, void *param);
        /* detach from device */
@@ -34821,9 +36830,10 @@ diff -urNp linux-3.1.3/drivers/staging/brcm80211/brcmfmac/sdio_host.h linux-3.1.
  
  struct sdioh_info;
  
-diff -urNp linux-3.1.3/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h linux-3.1.3/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
---- linux-3.1.3/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h       2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h b/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
+index a01b01c..b3f721c 100644
+--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
++++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
 @@ -591,7 +591,7 @@ struct phy_func_ptr {
        initfn_t carrsuppr;
        rxsigpwrfn_t rxsigpwr;
@@ -34833,10 +36843,11 @@ diff -urNp linux-3.1.3/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h linux-3.
  
  struct brcms_phy {
        struct brcms_phy_pub pubpi_ro;
-diff -urNp linux-3.1.3/drivers/staging/et131x/et1310_tx.c linux-3.1.3/drivers/staging/et131x/et1310_tx.c
---- linux-3.1.3/drivers/staging/et131x/et1310_tx.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/et131x/et1310_tx.c     2011-11-16 18:39:07.000000000 -0500
-@@ -635,11 +635,11 @@ inline void et131x_free_send_packet(stru
+diff --git a/drivers/staging/et131x/et1310_tx.c b/drivers/staging/et131x/et1310_tx.c
+index 8fb3051..a8b6c67 100644
+--- a/drivers/staging/et131x/et1310_tx.c
++++ b/drivers/staging/et131x/et1310_tx.c
+@@ -635,11 +635,11 @@ inline void et131x_free_send_packet(struct et131x_adapter *etdev,
        struct net_device_stats *stats = &etdev->net_stats;
  
        if (tcb->flags & fMP_DEST_BROAD)
@@ -34851,9 +36862,10 @@ diff -urNp linux-3.1.3/drivers/staging/et131x/et1310_tx.c linux-3.1.3/drivers/st
  
        if (tcb->skb) {
                stats->tx_bytes += tcb->skb->len;
-diff -urNp linux-3.1.3/drivers/staging/et131x/et131x_adapter.h linux-3.1.3/drivers/staging/et131x/et131x_adapter.h
---- linux-3.1.3/drivers/staging/et131x/et131x_adapter.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/et131x/et131x_adapter.h        2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/staging/et131x/et131x_adapter.h b/drivers/staging/et131x/et131x_adapter.h
+index 408c50b..fd65e9f 100644
+--- a/drivers/staging/et131x/et131x_adapter.h
++++ b/drivers/staging/et131x/et131x_adapter.h
 @@ -106,11 +106,11 @@ struct ce_stats {
         * operations
         */
@@ -34869,10 +36881,11 @@ diff -urNp linux-3.1.3/drivers/staging/et131x/et131x_adapter.h linux-3.1.3/drive
        u32 norcvbuf;   /* # Rx packets discarded */
        u32 noxmtbuf;   /* # Tx packets discarded */
  
-diff -urNp linux-3.1.3/drivers/staging/hv/channel.c linux-3.1.3/drivers/staging/hv/channel.c
---- linux-3.1.3/drivers/staging/hv/channel.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/hv/channel.c   2011-11-16 18:39:07.000000000 -0500
-@@ -447,8 +447,8 @@ int vmbus_establish_gpadl(struct vmbus_c
+diff --git a/drivers/staging/hv/channel.c b/drivers/staging/hv/channel.c
+index 455f47a..86205ff 100644
+--- a/drivers/staging/hv/channel.c
++++ b/drivers/staging/hv/channel.c
+@@ -447,8 +447,8 @@ int vmbus_establish_gpadl(struct vmbus_channel *channel, void *kbuffer,
        int ret = 0;
        int t;
  
@@ -34883,10 +36896,11 @@ diff -urNp linux-3.1.3/drivers/staging/hv/channel.c linux-3.1.3/drivers/staging/
  
        ret = create_gpadl_header(kbuffer, size, &msginfo, &msgcount);
        if (ret)
-diff -urNp linux-3.1.3/drivers/staging/hv/hv.c linux-3.1.3/drivers/staging/hv/hv.c
---- linux-3.1.3/drivers/staging/hv/hv.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/hv/hv.c        2011-11-16 18:39:07.000000000 -0500
-@@ -132,7 +132,7 @@ static u64 do_hypercall(u64 control, voi
+diff --git a/drivers/staging/hv/hv.c b/drivers/staging/hv/hv.c
+index 824f816..a800af7 100644
+--- a/drivers/staging/hv/hv.c
++++ b/drivers/staging/hv/hv.c
+@@ -132,7 +132,7 @@ static u64 do_hypercall(u64 control, void *input, void *output)
        u64 output_address = (output) ? virt_to_phys(output) : 0;
        u32 output_address_hi = output_address >> 32;
        u32 output_address_lo = output_address & 0xFFFFFFFF;
@@ -34895,10 +36909,11 @@ diff -urNp linux-3.1.3/drivers/staging/hv/hv.c linux-3.1.3/drivers/staging/hv/hv
  
        __asm__ __volatile__ ("call *%8" : "=d"(hv_status_hi),
                              "=a"(hv_status_lo) : "d" (control_hi),
-diff -urNp linux-3.1.3/drivers/staging/hv/hv_mouse.c linux-3.1.3/drivers/staging/hv/hv_mouse.c
---- linux-3.1.3/drivers/staging/hv/hv_mouse.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/hv/hv_mouse.c  2011-11-16 18:39:07.000000000 -0500
-@@ -878,8 +878,10 @@ static void reportdesc_callback(struct h
+diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
+index d957fc2..43cedd9 100644
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -878,8 +878,10 @@ static void reportdesc_callback(struct hv_device *dev, void *packet, u32 len)
        if (hid_dev) {
                DPRINT_INFO(INPUTVSC_DRV, "hid_device created");
  
@@ -34911,9 +36926,10 @@ diff -urNp linux-3.1.3/drivers/staging/hv/hv_mouse.c linux-3.1.3/drivers/staging
  
                hid_dev->bus = BUS_VIRTUAL;
                hid_dev->vendor = input_device_ctx->device_info.vendor;
-diff -urNp linux-3.1.3/drivers/staging/hv/hyperv_vmbus.h linux-3.1.3/drivers/staging/hv/hyperv_vmbus.h
---- linux-3.1.3/drivers/staging/hv/hyperv_vmbus.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/hv/hyperv_vmbus.h      2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/staging/hv/hyperv_vmbus.h b/drivers/staging/hv/hyperv_vmbus.h
+index 349ad80..3f75719 100644
+--- a/drivers/staging/hv/hyperv_vmbus.h
++++ b/drivers/staging/hv/hyperv_vmbus.h
 @@ -559,7 +559,7 @@ enum vmbus_connect_state {
  struct vmbus_connection {
        enum vmbus_connect_state conn_state;
@@ -34923,9 +36939,10 @@ diff -urNp linux-3.1.3/drivers/staging/hv/hyperv_vmbus.h linux-3.1.3/drivers/sta
  
        /*
         * Represents channel interrupts. Each bit position represents a
-diff -urNp linux-3.1.3/drivers/staging/hv/rndis_filter.c linux-3.1.3/drivers/staging/hv/rndis_filter.c
---- linux-3.1.3/drivers/staging/hv/rndis_filter.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/hv/rndis_filter.c      2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c
+index dbb5201..d6047c6 100644
+--- a/drivers/staging/hv/rndis_filter.c
++++ b/drivers/staging/hv/rndis_filter.c
 @@ -43,7 +43,7 @@ struct rndis_device {
  
        enum rndis_device_state state;
@@ -34935,7 +36952,7 @@ diff -urNp linux-3.1.3/drivers/staging/hv/rndis_filter.c linux-3.1.3/drivers/sta
  
        spinlock_t request_lock;
        struct list_head req_list;
-@@ -117,7 +117,7 @@ static struct rndis_request *get_rndis_r
+@@ -117,7 +117,7 @@ static struct rndis_request *get_rndis_request(struct rndis_device *dev,
         * template
         */
        set = &rndis_msg->msg.set_req;
@@ -34944,7 +36961,7 @@ diff -urNp linux-3.1.3/drivers/staging/hv/rndis_filter.c linux-3.1.3/drivers/sta
  
        /* Add to the request list */
        spin_lock_irqsave(&dev->request_lock, flags);
-@@ -622,7 +622,7 @@ static void rndis_filter_halt_device(str
+@@ -622,7 +622,7 @@ static void rndis_filter_halt_device(struct rndis_device *dev)
  
        /* Setup the rndis set */
        halt = &request->request_msg.msg.halt_req;
@@ -34953,10 +36970,11 @@ diff -urNp linux-3.1.3/drivers/staging/hv/rndis_filter.c linux-3.1.3/drivers/sta
  
        /* Ignore return since this msg is optional. */
        rndis_filter_send_request(dev, request);
-diff -urNp linux-3.1.3/drivers/staging/hv/vmbus_drv.c linux-3.1.3/drivers/staging/hv/vmbus_drv.c
---- linux-3.1.3/drivers/staging/hv/vmbus_drv.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/hv/vmbus_drv.c 2011-11-16 18:39:07.000000000 -0500
-@@ -660,11 +660,11 @@ int vmbus_child_device_register(struct h
+diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
+index 1c949f5..7a8b104 100644
+--- a/drivers/staging/hv/vmbus_drv.c
++++ b/drivers/staging/hv/vmbus_drv.c
+@@ -660,11 +660,11 @@ int vmbus_child_device_register(struct hv_device *child_device_obj)
  {
        int ret = 0;
  
@@ -34970,9 +36988,10 @@ diff -urNp linux-3.1.3/drivers/staging/hv/vmbus_drv.c linux-3.1.3/drivers/stagin
  
        /* The new device belongs to this bus */
        child_device_obj->device.bus = &hv_bus; /* device->dev.bus; */
-diff -urNp linux-3.1.3/drivers/staging/iio/ring_generic.h linux-3.1.3/drivers/staging/iio/ring_generic.h
---- linux-3.1.3/drivers/staging/iio/ring_generic.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/iio/ring_generic.h     2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/staging/iio/ring_generic.h b/drivers/staging/iio/ring_generic.h
+index 3f26f71..fb5c787 100644
+--- a/drivers/staging/iio/ring_generic.h
++++ b/drivers/staging/iio/ring_generic.h
 @@ -62,7 +62,7 @@ struct iio_ring_access_funcs {
  
        int (*is_enabled)(struct iio_ring_buffer *ring);
@@ -34982,10 +37001,11 @@ diff -urNp linux-3.1.3/drivers/staging/iio/ring_generic.h linux-3.1.3/drivers/st
  
  struct iio_ring_setup_ops {
        int                             (*preenable)(struct iio_dev *);
-diff -urNp linux-3.1.3/drivers/staging/mei/interface.c linux-3.1.3/drivers/staging/mei/interface.c
---- linux-3.1.3/drivers/staging/mei/interface.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/mei/interface.c        2011-11-17 18:39:18.000000000 -0500
-@@ -332,7 +332,7 @@ int mei_send_flow_control(struct mei_dev
+diff --git a/drivers/staging/mei/interface.c b/drivers/staging/mei/interface.c
+index cfec92d..a65dacf 100644
+--- a/drivers/staging/mei/interface.c
++++ b/drivers/staging/mei/interface.c
+@@ -332,7 +332,7 @@ int mei_send_flow_control(struct mei_device *dev, struct mei_cl *cl)
        mei_hdr->reserved = 0;
  
        mei_flow_control = (struct hbm_flow_control *) &dev->wr_msg_buf[1];
@@ -34994,7 +37014,7 @@ diff -urNp linux-3.1.3/drivers/staging/mei/interface.c linux-3.1.3/drivers/stagi
        mei_flow_control->host_addr = cl->host_client_id;
        mei_flow_control->me_addr = cl->me_client_id;
        mei_flow_control->cmd.cmd = MEI_FLOW_CONTROL_CMD;
-@@ -396,7 +396,7 @@ int mei_disconnect(struct mei_device *de
+@@ -396,7 +396,7 @@ int mei_disconnect(struct mei_device *dev, struct mei_cl *cl)
  
        mei_cli_disconnect =
            (struct hbm_client_disconnect_request *) &dev->wr_msg_buf[1];
@@ -35003,29 +37023,11 @@ diff -urNp linux-3.1.3/drivers/staging/mei/interface.c linux-3.1.3/drivers/stagi
        mei_cli_disconnect->host_addr = cl->host_client_id;
        mei_cli_disconnect->me_addr = cl->me_client_id;
        mei_cli_disconnect->cmd.cmd = CLIENT_DISCONNECT_REQ_CMD;
-diff -urNp linux-3.1.3/drivers/staging/octeon/ethernet.c linux-3.1.3/drivers/staging/octeon/ethernet.c
---- linux-3.1.3/drivers/staging/octeon/ethernet.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/octeon/ethernet.c      2011-11-16 18:39:07.000000000 -0500
-@@ -258,11 +258,11 @@ static struct net_device_stats *cvm_oct_
-                * since the RX tasklet also increments it.
-                */
- #ifdef CONFIG_64BIT
--              atomic64_add(rx_status.dropped_packets,
--                           (atomic64_t *)&priv->stats.rx_dropped);
-+              atomic64_add_unchecked(rx_status.dropped_packets,
-+                           (atomic64_unchecked_t *)&priv->stats.rx_dropped);
- #else
--              atomic_add(rx_status.dropped_packets,
--                           (atomic_t *)&priv->stats.rx_dropped);
-+              atomic_add_unchecked(rx_status.dropped_packets,
-+                           (atomic_unchecked_t *)&priv->stats.rx_dropped);
- #endif
-       }
-diff -urNp linux-3.1.3/drivers/staging/octeon/ethernet-rx.c linux-3.1.3/drivers/staging/octeon/ethernet-rx.c
---- linux-3.1.3/drivers/staging/octeon/ethernet-rx.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/octeon/ethernet-rx.c   2011-11-16 18:39:07.000000000 -0500
-@@ -420,11 +420,11 @@ static int cvm_oct_napi_poll(struct napi
+diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c
+index 8b307b4..a97ac91 100644
+--- a/drivers/staging/octeon/ethernet-rx.c
++++ b/drivers/staging/octeon/ethernet-rx.c
+@@ -420,11 +420,11 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
                                /* Increment RX stats for virtual ports */
                                if (work->ipprt >= CVMX_PIP_NUM_INPUT_PORTS) {
  #ifdef CONFIG_64BIT
@@ -35041,7 +37043,7 @@ diff -urNp linux-3.1.3/drivers/staging/octeon/ethernet-rx.c linux-3.1.3/drivers/
  #endif
                                }
                                netif_receive_skb(skb);
-@@ -436,9 +436,9 @@ static int cvm_oct_napi_poll(struct napi
+@@ -436,9 +436,9 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
                                           dev->name);
                                */
  #ifdef CONFIG_64BIT
@@ -35053,10 +37055,31 @@ diff -urNp linux-3.1.3/drivers/staging/octeon/ethernet-rx.c linux-3.1.3/drivers/
  #endif
                                dev_kfree_skb_irq(skb);
                        }
-diff -urNp linux-3.1.3/drivers/staging/pohmelfs/inode.c linux-3.1.3/drivers/staging/pohmelfs/inode.c
---- linux-3.1.3/drivers/staging/pohmelfs/inode.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/pohmelfs/inode.c       2011-11-16 18:39:07.000000000 -0500
-@@ -1861,7 +1861,7 @@ static int pohmelfs_fill_super(struct su
+diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
+index a8f780e..aef1098 100644
+--- a/drivers/staging/octeon/ethernet.c
++++ b/drivers/staging/octeon/ethernet.c
+@@ -258,11 +258,11 @@ static struct net_device_stats *cvm_oct_common_get_stats(struct net_device *dev)
+                * since the RX tasklet also increments it.
+                */
+ #ifdef CONFIG_64BIT
+-              atomic64_add(rx_status.dropped_packets,
+-                           (atomic64_t *)&priv->stats.rx_dropped);
++              atomic64_add_unchecked(rx_status.dropped_packets,
++                           (atomic64_unchecked_t *)&priv->stats.rx_dropped);
+ #else
+-              atomic_add(rx_status.dropped_packets,
+-                           (atomic_t *)&priv->stats.rx_dropped);
++              atomic_add_unchecked(rx_status.dropped_packets,
++                           (atomic_unchecked_t *)&priv->stats.rx_dropped);
+ #endif
+       }
+diff --git a/drivers/staging/pohmelfs/inode.c b/drivers/staging/pohmelfs/inode.c
+index f3c6060..56bf826 100644
+--- a/drivers/staging/pohmelfs/inode.c
++++ b/drivers/staging/pohmelfs/inode.c
+@@ -1861,7 +1861,7 @@ static int pohmelfs_fill_super(struct super_block *sb, void *data, int silent)
        mutex_init(&psb->mcache_lock);
        psb->mcache_root = RB_ROOT;
        psb->mcache_timeout = msecs_to_jiffies(5000);
@@ -35065,7 +37088,7 @@ diff -urNp linux-3.1.3/drivers/staging/pohmelfs/inode.c linux-3.1.3/drivers/stag
  
        psb->trans_max_pages = 100;
  
-@@ -1876,7 +1876,7 @@ static int pohmelfs_fill_super(struct su
+@@ -1876,7 +1876,7 @@ static int pohmelfs_fill_super(struct super_block *sb, void *data, int silent)
        INIT_LIST_HEAD(&psb->crypto_ready_list);
        INIT_LIST_HEAD(&psb->crypto_active_list);
  
@@ -35074,10 +37097,11 @@ diff -urNp linux-3.1.3/drivers/staging/pohmelfs/inode.c linux-3.1.3/drivers/stag
        atomic_long_set(&psb->total_inodes, 0);
  
        mutex_init(&psb->state_lock);
-diff -urNp linux-3.1.3/drivers/staging/pohmelfs/mcache.c linux-3.1.3/drivers/staging/pohmelfs/mcache.c
---- linux-3.1.3/drivers/staging/pohmelfs/mcache.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/pohmelfs/mcache.c      2011-11-16 18:39:07.000000000 -0500
-@@ -121,7 +121,7 @@ struct pohmelfs_mcache *pohmelfs_mcache_
+diff --git a/drivers/staging/pohmelfs/mcache.c b/drivers/staging/pohmelfs/mcache.c
+index e22665c..a2a9390 100644
+--- a/drivers/staging/pohmelfs/mcache.c
++++ b/drivers/staging/pohmelfs/mcache.c
+@@ -121,7 +121,7 @@ struct pohmelfs_mcache *pohmelfs_mcache_alloc(struct pohmelfs_sb *psb, u64 start
        m->data = data;
        m->start = start;
        m->size = size;
@@ -35086,9 +37110,10 @@ diff -urNp linux-3.1.3/drivers/staging/pohmelfs/mcache.c linux-3.1.3/drivers/sta
  
        mutex_lock(&psb->mcache_lock);
        err = pohmelfs_mcache_insert(psb, m);
-diff -urNp linux-3.1.3/drivers/staging/pohmelfs/netfs.h linux-3.1.3/drivers/staging/pohmelfs/netfs.h
---- linux-3.1.3/drivers/staging/pohmelfs/netfs.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/pohmelfs/netfs.h       2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/staging/pohmelfs/netfs.h b/drivers/staging/pohmelfs/netfs.h
+index 985b6b7..7699e05 100644
+--- a/drivers/staging/pohmelfs/netfs.h
++++ b/drivers/staging/pohmelfs/netfs.h
 @@ -571,14 +571,14 @@ struct pohmelfs_config;
  struct pohmelfs_sb {
        struct rb_root          mcache_root;
@@ -35106,10 +37131,11 @@ diff -urNp linux-3.1.3/drivers/staging/pohmelfs/netfs.h linux-3.1.3/drivers/stag
  
        unsigned int            crypto_attached_size;
        unsigned int            crypto_align_size;
-diff -urNp linux-3.1.3/drivers/staging/pohmelfs/trans.c linux-3.1.3/drivers/staging/pohmelfs/trans.c
---- linux-3.1.3/drivers/staging/pohmelfs/trans.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/pohmelfs/trans.c       2011-11-16 18:39:07.000000000 -0500
-@@ -492,7 +492,7 @@ int netfs_trans_finish(struct netfs_tran
+diff --git a/drivers/staging/pohmelfs/trans.c b/drivers/staging/pohmelfs/trans.c
+index 36a2535..0591bf4 100644
+--- a/drivers/staging/pohmelfs/trans.c
++++ b/drivers/staging/pohmelfs/trans.c
+@@ -492,7 +492,7 @@ int netfs_trans_finish(struct netfs_trans *t, struct pohmelfs_sb *psb)
        int err;
        struct netfs_cmd *cmd = t->iovec.iov_base;
  
@@ -35118,9 +37144,10 @@ diff -urNp linux-3.1.3/drivers/staging/pohmelfs/trans.c linux-3.1.3/drivers/stag
  
        cmd->size = t->iovec.iov_len - sizeof(struct netfs_cmd) +
                t->attached_size + t->attached_pages * sizeof(struct netfs_cmd);
-diff -urNp linux-3.1.3/drivers/staging/rtl8712/rtl871x_io.h linux-3.1.3/drivers/staging/rtl8712/rtl871x_io.h
---- linux-3.1.3/drivers/staging/rtl8712/rtl871x_io.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/rtl8712/rtl871x_io.h   2011-11-16 18:39:07.000000000 -0500
+diff --git a/drivers/staging/rtl8712/rtl871x_io.h b/drivers/staging/rtl8712/rtl871x_io.h
+index b70cb2b..4db41a7 100644
+--- a/drivers/staging/rtl8712/rtl871x_io.h
++++ b/drivers/staging/rtl8712/rtl871x_io.h
 @@ -83,7 +83,7 @@ struct       _io_ops {
                          u8 *pmem);
        u32 (*_write_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt,
@@ -35130,10 +37157,11 @@ diff -urNp linux-3.1.3/drivers/staging/rtl8712/rtl871x_io.h linux-3.1.3/drivers/
  
  struct io_req {
        struct list_head list;
-diff -urNp linux-3.1.3/drivers/staging/sbe-2t3e3/netdev.c linux-3.1.3/drivers/staging/sbe-2t3e3/netdev.c
---- linux-3.1.3/drivers/staging/sbe-2t3e3/netdev.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/sbe-2t3e3/netdev.c     2011-11-16 18:39:08.000000000 -0500
-@@ -51,7 +51,7 @@ int t3e3_ioctl(struct net_device *dev, s
+diff --git a/drivers/staging/sbe-2t3e3/netdev.c b/drivers/staging/sbe-2t3e3/netdev.c
+index c7b5e8b..783d6cb 100644
+--- a/drivers/staging/sbe-2t3e3/netdev.c
++++ b/drivers/staging/sbe-2t3e3/netdev.c
+@@ -51,7 +51,7 @@ int t3e3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
        t3e3_if_config(sc, cmd_2t3e3, (char *)&param, &resp, &rlen);
  
        if (rlen)
@@ -35142,9 +37170,10 @@ diff -urNp linux-3.1.3/drivers/staging/sbe-2t3e3/netdev.c linux-3.1.3/drivers/st
                        return -EFAULT;
  
        return 0;
-diff -urNp linux-3.1.3/drivers/staging/usbip/usbip_common.h linux-3.1.3/drivers/staging/usbip/usbip_common.h
---- linux-3.1.3/drivers/staging/usbip/usbip_common.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/usbip/usbip_common.h   2011-11-16 18:39:08.000000000 -0500
+diff --git a/drivers/staging/usbip/usbip_common.h b/drivers/staging/usbip/usbip_common.h
+index be21617..0954e45 100644
+--- a/drivers/staging/usbip/usbip_common.h
++++ b/drivers/staging/usbip/usbip_common.h
 @@ -289,7 +289,7 @@ struct usbip_device {
                void (*shutdown)(struct usbip_device *);
                void (*reset)(struct usbip_device *);
@@ -35154,9 +37183,10 @@ diff -urNp linux-3.1.3/drivers/staging/usbip/usbip_common.h linux-3.1.3/drivers/
  };
  
  #if 0
-diff -urNp linux-3.1.3/drivers/staging/usbip/vhci.h linux-3.1.3/drivers/staging/usbip/vhci.h
---- linux-3.1.3/drivers/staging/usbip/vhci.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/usbip/vhci.h   2011-11-16 18:39:08.000000000 -0500
+diff --git a/drivers/staging/usbip/vhci.h b/drivers/staging/usbip/vhci.h
+index 71a586e..4d8a91a 100644
+--- a/drivers/staging/usbip/vhci.h
++++ b/drivers/staging/usbip/vhci.h
 @@ -85,7 +85,7 @@ struct vhci_hcd {
        unsigned resuming:1;
        unsigned long re_timeout;
@@ -35166,9 +37196,10 @@ diff -urNp linux-3.1.3/drivers/staging/usbip/vhci.h linux-3.1.3/drivers/staging/
  
        /*
         * NOTE:
-diff -urNp linux-3.1.3/drivers/staging/usbip/vhci_hcd.c linux-3.1.3/drivers/staging/usbip/vhci_hcd.c
---- linux-3.1.3/drivers/staging/usbip/vhci_hcd.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/usbip/vhci_hcd.c       2011-11-16 18:39:08.000000000 -0500
+diff --git a/drivers/staging/usbip/vhci_hcd.c b/drivers/staging/usbip/vhci_hcd.c
+index 2ee97e2..0420b86 100644
+--- a/drivers/staging/usbip/vhci_hcd.c
++++ b/drivers/staging/usbip/vhci_hcd.c
 @@ -527,7 +527,7 @@ static void vhci_tx_urb(struct urb *urb)
                return;
        }
@@ -35178,7 +37209,7 @@ diff -urNp linux-3.1.3/drivers/staging/usbip/vhci_hcd.c linux-3.1.3/drivers/stag
        if (priv->seqnum == 0xffff)
                dev_info(&urb->dev->dev, "seqnum max\n");
  
-@@ -779,7 +779,7 @@ static int vhci_urb_dequeue(struct usb_h
+@@ -779,7 +779,7 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
                        return -ENOMEM;
                }
  
@@ -35187,7 +37218,7 @@ diff -urNp linux-3.1.3/drivers/staging/usbip/vhci_hcd.c linux-3.1.3/drivers/stag
                if (unlink->seqnum == 0xffff)
                        pr_info("seqnum max\n");
  
-@@ -969,7 +969,7 @@ static int vhci_start(struct usb_hcd *hc
+@@ -969,7 +969,7 @@ static int vhci_start(struct usb_hcd *hcd)
                vdev->rhport = rhport;
        }
  
@@ -35196,10 +37227,11 @@ diff -urNp linux-3.1.3/drivers/staging/usbip/vhci_hcd.c linux-3.1.3/drivers/stag
        spin_lock_init(&vhci->lock);
  
        hcd->power_budget = 0; /* no limit */
-diff -urNp linux-3.1.3/drivers/staging/usbip/vhci_rx.c linux-3.1.3/drivers/staging/usbip/vhci_rx.c
---- linux-3.1.3/drivers/staging/usbip/vhci_rx.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/usbip/vhci_rx.c        2011-11-16 18:39:08.000000000 -0500
-@@ -76,7 +76,7 @@ static void vhci_recv_ret_submit(struct 
+diff --git a/drivers/staging/usbip/vhci_rx.c b/drivers/staging/usbip/vhci_rx.c
+index 3872b8c..fe6d2f4 100644
+--- a/drivers/staging/usbip/vhci_rx.c
++++ b/drivers/staging/usbip/vhci_rx.c
+@@ -77,7 +77,7 @@ static void vhci_recv_ret_submit(struct vhci_device *vdev,
        if (!urb) {
                pr_err("cannot find a urb of seqnum %u\n", pdu->base.seqnum);
                pr_info("max seqnum %d\n",
@@ -35208,10 +37240,11 @@ diff -urNp linux-3.1.3/drivers/staging/usbip/vhci_rx.c linux-3.1.3/drivers/stagi
                usbip_event_add(ud, VDEV_EVENT_ERROR_TCP);
                return;
        }
-diff -urNp linux-3.1.3/drivers/staging/vt6655/hostap.c linux-3.1.3/drivers/staging/vt6655/hostap.c
---- linux-3.1.3/drivers/staging/vt6655/hostap.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/vt6655/hostap.c        2011-11-16 18:39:08.000000000 -0500
-@@ -79,14 +79,13 @@ static int          msglevel            
+diff --git a/drivers/staging/vt6655/hostap.c b/drivers/staging/vt6655/hostap.c
+index 7735027..30eed13 100644
+--- a/drivers/staging/vt6655/hostap.c
++++ b/drivers/staging/vt6655/hostap.c
+@@ -79,14 +79,13 @@ static int          msglevel                =MSG_LEVEL_INFO;
   *
   */
  
@@ -35228,7 +37261,7 @@ diff -urNp linux-3.1.3/drivers/staging/vt6655/hostap.c linux-3.1.3/drivers/stagi
  
      DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: Enabling hostapd mode\n", dev->name);
  
-@@ -98,6 +97,8 @@ static int hostap_enable_hostapd(PSDevic
+@@ -98,6 +97,8 @@ static int hostap_enable_hostapd(PSDevice pDevice, int rtnl_locked)
      *apdev_priv = *pDevice;
        memcpy(pDevice->apdev->dev_addr, dev->dev_addr, ETH_ALEN);
  
@@ -35237,10 +37270,11 @@ diff -urNp linux-3.1.3/drivers/staging/vt6655/hostap.c linux-3.1.3/drivers/stagi
        pDevice->apdev->netdev_ops = &apdev_netdev_ops;
  
        pDevice->apdev->type = ARPHRD_IEEE80211;
-diff -urNp linux-3.1.3/drivers/staging/vt6656/hostap.c linux-3.1.3/drivers/staging/vt6656/hostap.c
---- linux-3.1.3/drivers/staging/vt6656/hostap.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/vt6656/hostap.c        2011-11-16 18:39:08.000000000 -0500
-@@ -80,14 +80,13 @@ static int          msglevel            
+diff --git a/drivers/staging/vt6656/hostap.c b/drivers/staging/vt6656/hostap.c
+index 51b5adf..098e320 100644
+--- a/drivers/staging/vt6656/hostap.c
++++ b/drivers/staging/vt6656/hostap.c
+@@ -80,14 +80,13 @@ static int          msglevel                =MSG_LEVEL_INFO;
   *
   */
  
@@ -35257,7 +37291,7 @@ diff -urNp linux-3.1.3/drivers/staging/vt6656/hostap.c linux-3.1.3/drivers/stagi
  
      DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: Enabling hostapd mode\n", dev->name);
  
-@@ -99,6 +98,8 @@ static int hostap_enable_hostapd(PSDevic
+@@ -99,6 +98,8 @@ static int hostap_enable_hostapd(PSDevice pDevice, int rtnl_locked)
      *apdev_priv = *pDevice;
        memcpy(pDevice->apdev->dev_addr, dev->dev_addr, ETH_ALEN);
  
@@ -35266,10 +37300,11 @@ diff -urNp linux-3.1.3/drivers/staging/vt6656/hostap.c linux-3.1.3/drivers/stagi
        pDevice->apdev->netdev_ops = &apdev_netdev_ops;
  
        pDevice->apdev->type = ARPHRD_IEEE80211;
-diff -urNp linux-3.1.3/drivers/staging/wlan-ng/hfa384x_usb.c linux-3.1.3/drivers/staging/wlan-ng/hfa384x_usb.c
---- linux-3.1.3/drivers/staging/wlan-ng/hfa384x_usb.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/wlan-ng/hfa384x_usb.c  2011-11-16 18:39:08.000000000 -0500
-@@ -204,7 +204,7 @@ static void unlocked_usbctlx_complete(hf
+diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
+index 7843dfd..3db105f 100644
+--- a/drivers/staging/wlan-ng/hfa384x_usb.c
++++ b/drivers/staging/wlan-ng/hfa384x_usb.c
+@@ -204,7 +204,7 @@ static void unlocked_usbctlx_complete(hfa384x_t *hw, hfa384x_usbctlx_t *ctlx);
  
  struct usbctlx_completor {
        int (*complete) (struct usbctlx_completor *);
@@ -35278,9 +37313,10 @@ diff -urNp linux-3.1.3/drivers/staging/wlan-ng/hfa384x_usb.c linux-3.1.3/drivers
  
  static int
  hfa384x_usbctlx_complete_sync(hfa384x_t *hw,
-diff -urNp linux-3.1.3/drivers/staging/zcache/tmem.c linux-3.1.3/drivers/staging/zcache/tmem.c
---- linux-3.1.3/drivers/staging/zcache/tmem.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/zcache/tmem.c  2011-11-16 18:39:08.000000000 -0500
+diff --git a/drivers/staging/zcache/tmem.c b/drivers/staging/zcache/tmem.c
+index 1ca66ea..76f1343 100644
+--- a/drivers/staging/zcache/tmem.c
++++ b/drivers/staging/zcache/tmem.c
 @@ -39,7 +39,7 @@
   * A tmem host implementation must use this function to register callbacks
   * for memory allocation.
@@ -35290,7 +37326,7 @@ diff -urNp linux-3.1.3/drivers/staging/zcache/tmem.c linux-3.1.3/drivers/staging
  
  static void tmem_objnode_tree_init(void);
  
-@@ -53,7 +53,7 @@ void tmem_register_hostops(struct tmem_h
+@@ -53,7 +53,7 @@ void tmem_register_hostops(struct tmem_hostops *m)
   * A tmem host implementation must use this function to register
   * callbacks for a page-accessible memory (PAM) implementation
   */
@@ -35299,9 +37335,10 @@ diff -urNp linux-3.1.3/drivers/staging/zcache/tmem.c linux-3.1.3/drivers/staging
  
  void tmem_register_pamops(struct tmem_pamops *m)
  {
-diff -urNp linux-3.1.3/drivers/staging/zcache/tmem.h linux-3.1.3/drivers/staging/zcache/tmem.h
---- linux-3.1.3/drivers/staging/zcache/tmem.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/staging/zcache/tmem.h  2011-11-16 18:39:08.000000000 -0500
+diff --git a/drivers/staging/zcache/tmem.h b/drivers/staging/zcache/tmem.h
+index ed147c4..94fc3c6 100644
+--- a/drivers/staging/zcache/tmem.h
++++ b/drivers/staging/zcache/tmem.h
 @@ -180,6 +180,7 @@ struct tmem_pamops {
        void (*new_obj)(struct tmem_obj *);
        int (*replace_in_obj)(void *, struct tmem_obj *);
@@ -35318,10 +37355,11 @@ diff -urNp linux-3.1.3/drivers/staging/zcache/tmem.h linux-3.1.3/drivers/staging
  extern void tmem_register_hostops(struct tmem_hostops *m);
  
  /* core tmem accessor functions */
-diff -urNp linux-3.1.3/drivers/target/iscsi/iscsi_target.c linux-3.1.3/drivers/target/iscsi/iscsi_target.c
---- linux-3.1.3/drivers/target/iscsi/iscsi_target.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/target/iscsi/iscsi_target.c    2011-11-16 18:39:08.000000000 -0500
-@@ -1368,7 +1368,7 @@ static int iscsit_handle_data_out(struct
+diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
+index 26a5d8b..74434f8 100644
+--- a/drivers/target/iscsi/iscsi_target.c
++++ b/drivers/target/iscsi/iscsi_target.c
+@@ -1368,7 +1368,7 @@ static int iscsit_handle_data_out(struct iscsi_conn *conn, unsigned char *buf)
                 * outstanding_r2ts reaches zero, go ahead and send the delayed
                 * TASK_ABORTED status.
                 */
@@ -35330,10 +37368,11 @@ diff -urNp linux-3.1.3/drivers/target/iscsi/iscsi_target.c linux-3.1.3/drivers/t
                        if (hdr->flags & ISCSI_FLAG_CMD_FINAL)
                                if (--cmd->outstanding_r2ts < 1) {
                                        iscsit_stop_dataout_timer(cmd);
-diff -urNp linux-3.1.3/drivers/target/target_core_alua.c linux-3.1.3/drivers/target/target_core_alua.c
---- linux-3.1.3/drivers/target/target_core_alua.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/target/target_core_alua.c      2011-11-16 18:40:29.000000000 -0500
-@@ -723,6 +723,8 @@ static int core_alua_update_tpg_primary_
+diff --git a/drivers/target/target_core_alua.c b/drivers/target/target_core_alua.c
+index 8badcb4..94c9ac6 100644
+--- a/drivers/target/target_core_alua.c
++++ b/drivers/target/target_core_alua.c
+@@ -723,6 +723,8 @@ static int core_alua_update_tpg_primary_metadata(
        char path[ALUA_METADATA_PATH_LEN];
        int len;
  
@@ -35342,7 +37381,7 @@ diff -urNp linux-3.1.3/drivers/target/target_core_alua.c linux-3.1.3/drivers/tar
        memset(path, 0, ALUA_METADATA_PATH_LEN);
  
        len = snprintf(md_buf, tg_pt_gp->tg_pt_gp_md_buf_len,
-@@ -986,6 +988,8 @@ static int core_alua_update_tpg_secondar
+@@ -986,6 +988,8 @@ static int core_alua_update_tpg_secondary_metadata(
        char path[ALUA_METADATA_PATH_LEN], wwn[ALUA_SECONDARY_METADATA_WWN_LEN];
        int len;
  
@@ -35351,10 +37390,11 @@ diff -urNp linux-3.1.3/drivers/target/target_core_alua.c linux-3.1.3/drivers/tar
        memset(path, 0, ALUA_METADATA_PATH_LEN);
        memset(wwn, 0, ALUA_SECONDARY_METADATA_WWN_LEN);
  
-diff -urNp linux-3.1.3/drivers/target/target_core_cdb.c linux-3.1.3/drivers/target/target_core_cdb.c
---- linux-3.1.3/drivers/target/target_core_cdb.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/target/target_core_cdb.c       2011-11-16 18:40:29.000000000 -0500
-@@ -933,6 +933,8 @@ target_emulate_modesense(struct se_cmd *
+diff --git a/drivers/target/target_core_cdb.c b/drivers/target/target_core_cdb.c
+index f04d4ef..7de212b 100644
+--- a/drivers/target/target_core_cdb.c
++++ b/drivers/target/target_core_cdb.c
+@@ -933,6 +933,8 @@ target_emulate_modesense(struct se_cmd *cmd, int ten)
        int length = 0;
        unsigned char buf[SE_MODE_PAGE_BUF];
  
@@ -35363,10 +37403,11 @@ diff -urNp linux-3.1.3/drivers/target/target_core_cdb.c linux-3.1.3/drivers/targ
        memset(buf, 0, SE_MODE_PAGE_BUF);
  
        switch (cdb[2] & 0x3f) {
-diff -urNp linux-3.1.3/drivers/target/target_core_configfs.c linux-3.1.3/drivers/target/target_core_configfs.c
---- linux-3.1.3/drivers/target/target_core_configfs.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/target/target_core_configfs.c  2011-11-16 19:04:37.000000000 -0500
-@@ -1267,6 +1267,8 @@ static ssize_t target_core_dev_pr_show_a
+diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c
+index b2575d8..b6b28fd 100644
+--- a/drivers/target/target_core_configfs.c
++++ b/drivers/target/target_core_configfs.c
+@@ -1267,6 +1267,8 @@ static ssize_t target_core_dev_pr_show_attr_res_pr_registered_i_pts(
        ssize_t len = 0;
        int reg_count = 0, prf_isid;
  
@@ -35375,10 +37416,11 @@ diff -urNp linux-3.1.3/drivers/target/target_core_configfs.c linux-3.1.3/drivers
        if (!su_dev->se_dev_ptr)
                return -ENODEV;
  
-diff -urNp linux-3.1.3/drivers/target/target_core_pr.c linux-3.1.3/drivers/target/target_core_pr.c
---- linux-3.1.3/drivers/target/target_core_pr.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/target/target_core_pr.c        2011-11-16 18:40:29.000000000 -0500
-@@ -918,6 +918,8 @@ static int __core_scsi3_check_aptpl_regi
+diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c
+index 7fd3a16..bc2fb3e 100644
+--- a/drivers/target/target_core_pr.c
++++ b/drivers/target/target_core_pr.c
+@@ -918,6 +918,8 @@ static int __core_scsi3_check_aptpl_registration(
        unsigned char t_port[PR_APTPL_MAX_TPORT_LEN];
        u16 tpgt;
  
@@ -35387,7 +37429,7 @@ diff -urNp linux-3.1.3/drivers/target/target_core_pr.c linux-3.1.3/drivers/targe
        memset(i_port, 0, PR_APTPL_MAX_IPORT_LEN);
        memset(t_port, 0, PR_APTPL_MAX_TPORT_LEN);
        /*
-@@ -1867,6 +1869,8 @@ static int __core_scsi3_update_aptpl_buf
+@@ -1867,6 +1869,8 @@ static int __core_scsi3_update_aptpl_buf(
        ssize_t len = 0;
        int reg_count = 0;
  
@@ -35396,7 +37438,7 @@ diff -urNp linux-3.1.3/drivers/target/target_core_pr.c linux-3.1.3/drivers/targe
        memset(buf, 0, pr_aptpl_buf_len);
        /*
         * Called to clear metadata once APTPL has been deactivated.
-@@ -1989,6 +1993,8 @@ static int __core_scsi3_write_aptpl_to_f
+@@ -1989,6 +1993,8 @@ static int __core_scsi3_write_aptpl_to_file(
        char path[512];
        int ret;
  
@@ -35405,9 +37447,10 @@ diff -urNp linux-3.1.3/drivers/target/target_core_pr.c linux-3.1.3/drivers/targe
        memset(iov, 0, sizeof(struct iovec));
        memset(path, 0, 512);
  
-diff -urNp linux-3.1.3/drivers/target/target_core_tmr.c linux-3.1.3/drivers/target/target_core_tmr.c
---- linux-3.1.3/drivers/target/target_core_tmr.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/target/target_core_tmr.c       2011-11-16 18:39:08.000000000 -0500
+diff --git a/drivers/target/target_core_tmr.c b/drivers/target/target_core_tmr.c
+index 5c1b8c5..0cb7d0e 100644
+--- a/drivers/target/target_core_tmr.c
++++ b/drivers/target/target_core_tmr.c
 @@ -255,7 +255,7 @@ static void core_tmr_drain_task_list(
                        cmd->se_tfo->get_task_tag(cmd), cmd->pr_res_key,
                        cmd->t_task_list_num,
@@ -35435,10 +37478,11 @@ diff -urNp linux-3.1.3/drivers/target/target_core_tmr.c linux-3.1.3/drivers/targ
                spin_unlock_irqrestore(&cmd->t_state_lock, flags);
  
                core_tmr_handle_tas_abort(tmr_nacl, cmd, tas, fe_count);
-diff -urNp linux-3.1.3/drivers/target/target_core_transport.c linux-3.1.3/drivers/target/target_core_transport.c
---- linux-3.1.3/drivers/target/target_core_transport.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/target/target_core_transport.c 2011-11-16 18:39:08.000000000 -0500
-@@ -1445,7 +1445,7 @@ struct se_device *transport_add_device_t
+diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
+index 013c100..8fd2e57 100644
+--- a/drivers/target/target_core_transport.c
++++ b/drivers/target/target_core_transport.c
+@@ -1445,7 +1445,7 @@ struct se_device *transport_add_device_to_core_hba(
  
        dev->queue_depth        = dev_limits->queue_depth;
        atomic_set(&dev->depth_left, dev->queue_depth);
@@ -35447,7 +37491,7 @@ diff -urNp linux-3.1.3/drivers/target/target_core_transport.c linux-3.1.3/driver
  
        se_dev_set_default_attribs(dev, dev_limits);
  
-@@ -1633,7 +1633,7 @@ static int transport_check_alloc_task_at
+@@ -1633,7 +1633,7 @@ static int transport_check_alloc_task_attr(struct se_cmd *cmd)
         * Used to determine when ORDERED commands should go from
         * Dormant to Active status.
         */
@@ -35456,7 +37500,7 @@ diff -urNp linux-3.1.3/drivers/target/target_core_transport.c linux-3.1.3/driver
        smp_mb__after_atomic_inc();
        pr_debug("Allocated se_ordered_id: %u for Task Attr: 0x%02x on %s\n",
                        cmd->se_ordered_id, cmd->sam_task_attr,
-@@ -1960,7 +1960,7 @@ static void transport_generic_request_fa
+@@ -1960,7 +1960,7 @@ static void transport_generic_request_failure(
                " t_transport_active: %d t_transport_stop: %d"
                " t_transport_sent: %d\n", cmd->t_task_list_num,
                atomic_read(&cmd->t_task_cdbs_left),
@@ -35477,7 +37521,7 @@ diff -urNp linux-3.1.3/drivers/target/target_core_transport.c linux-3.1.3/driver
            cmd->t_task_list_num)
                atomic_set(&cmd->transport_sent, 1);
  
-@@ -4665,7 +4665,7 @@ static void transport_generic_wait_for_t
+@@ -4665,7 +4665,7 @@ static void transport_generic_wait_for_tasks(
                atomic_set(&cmd->transport_lun_stop, 0);
        }
        if (!atomic_read(&cmd->t_transport_active) ||
@@ -35486,7 +37530,7 @@ diff -urNp linux-3.1.3/drivers/target/target_core_transport.c linux-3.1.3/driver
                goto remove;
  
        atomic_set(&cmd->t_transport_stop, 1);
-@@ -4900,7 +4900,7 @@ int transport_check_aborted_status(struc
+@@ -4900,7 +4900,7 @@ int transport_check_aborted_status(struct se_cmd *cmd, int send_status)
  {
        int ret = 0;
  
@@ -35495,7 +37539,7 @@ diff -urNp linux-3.1.3/drivers/target/target_core_transport.c linux-3.1.3/driver
                if (!send_status ||
                     (cmd->se_cmd_flags & SCF_SENT_DELAYED_TAS))
                        return 1;
-@@ -4937,7 +4937,7 @@ void transport_send_task_abort(struct se
+@@ -4937,7 +4937,7 @@ void transport_send_task_abort(struct se_cmd *cmd)
         */
        if (cmd->data_direction == DMA_TO_DEVICE) {
                if (cmd->se_tfo->write_pending_status(cmd) != 0) {
@@ -35504,7 +37548,7 @@ diff -urNp linux-3.1.3/drivers/target/target_core_transport.c linux-3.1.3/driver
                        smp_mb__after_atomic_inc();
                        cmd->scsi_status = SAM_STAT_TASK_ABORTED;
                        transport_new_cmd_failure(cmd);
-@@ -5051,7 +5051,7 @@ static void transport_processing_shutdow
+@@ -5051,7 +5051,7 @@ static void transport_processing_shutdown(struct se_device *dev)
                        cmd->se_tfo->get_task_tag(cmd),
                        cmd->t_task_list_num,
                        atomic_read(&cmd->t_task_cdbs_left),
@@ -35513,9 +37557,10 @@ diff -urNp linux-3.1.3/drivers/target/target_core_transport.c linux-3.1.3/driver
                        atomic_read(&cmd->t_transport_active),
                        atomic_read(&cmd->t_transport_stop),
                        atomic_read(&cmd->t_transport_sent));
-diff -urNp linux-3.1.3/drivers/telephony/ixj.c linux-3.1.3/drivers/telephony/ixj.c
---- linux-3.1.3/drivers/telephony/ixj.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/telephony/ixj.c        2011-11-16 18:40:29.000000000 -0500
+diff --git a/drivers/telephony/ixj.c b/drivers/telephony/ixj.c
+index d5f923b..9c78228 100644
+--- a/drivers/telephony/ixj.c
++++ b/drivers/telephony/ixj.c
 @@ -4976,6 +4976,8 @@ static int ixj_daa_cid_read(IXJ *j)
        bool mContinue;
        char *pIn, *pOut;
@@ -35525,9 +37570,10 @@ diff -urNp linux-3.1.3/drivers/telephony/ixj.c linux-3.1.3/drivers/telephony/ixj
        if (!SCI_Prepare(j))
                return 0;
  
-diff -urNp linux-3.1.3/drivers/tty/hvc/hvcs.c linux-3.1.3/drivers/tty/hvc/hvcs.c
---- linux-3.1.3/drivers/tty/hvc/hvcs.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/tty/hvc/hvcs.c 2011-11-16 18:39:08.000000000 -0500
+diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c
+index 4c8b665..1d931eb 100644
+--- a/drivers/tty/hvc/hvcs.c
++++ b/drivers/tty/hvc/hvcs.c
 @@ -83,6 +83,7 @@
  #include <asm/hvcserver.h>
  #include <asm/uaccess.h>
@@ -35545,7 +37591,7 @@ diff -urNp linux-3.1.3/drivers/tty/hvc/hvcs.c linux-3.1.3/drivers/tty/hvc/hvcs.c
  
        /*
         * Used to tell the driver kernel_thread what operations need to take
-@@ -422,7 +423,7 @@ static ssize_t hvcs_vterm_state_store(st
+@@ -422,7 +423,7 @@ static ssize_t hvcs_vterm_state_store(struct device *dev, struct device_attribut
  
        spin_lock_irqsave(&hvcsd->lock, flags);
  
@@ -35554,7 +37600,7 @@ diff -urNp linux-3.1.3/drivers/tty/hvc/hvcs.c linux-3.1.3/drivers/tty/hvc/hvcs.c
                spin_unlock_irqrestore(&hvcsd->lock, flags);
                printk(KERN_INFO "HVCS: vterm state unchanged.  "
                                "The hvcs device node is still in use.\n");
-@@ -1145,7 +1146,7 @@ static int hvcs_open(struct tty_struct *
+@@ -1145,7 +1146,7 @@ static int hvcs_open(struct tty_struct *tty, struct file *filp)
                if ((retval = hvcs_partner_connect(hvcsd)))
                        goto error_release;
  
@@ -35572,7 +37618,7 @@ diff -urNp linux-3.1.3/drivers/tty/hvc/hvcs.c linux-3.1.3/drivers/tty/hvc/hvcs.c
        hvcsd->todo_mask |= HVCS_SCHED_READ;
        spin_unlock_irqrestore(&hvcsd->lock, flags);
  
-@@ -1223,7 +1224,7 @@ static void hvcs_close(struct tty_struct
+@@ -1223,7 +1224,7 @@ static void hvcs_close(struct tty_struct *tty, struct file *filp)
        hvcsd = tty->driver_data;
  
        spin_lock_irqsave(&hvcsd->lock, flags);
@@ -35581,7 +37627,7 @@ diff -urNp linux-3.1.3/drivers/tty/hvc/hvcs.c linux-3.1.3/drivers/tty/hvc/hvcs.c
  
                vio_disable_interrupts(hvcsd->vdev);
  
-@@ -1249,10 +1250,10 @@ static void hvcs_close(struct tty_struct
+@@ -1249,10 +1250,10 @@ static void hvcs_close(struct tty_struct *tty, struct file *filp)
                free_irq(irq, hvcsd);
                kref_put(&hvcsd->kref, destroy_hvcs_struct);
                return;
@@ -35594,7 +37640,7 @@ diff -urNp linux-3.1.3/drivers/tty/hvc/hvcs.c linux-3.1.3/drivers/tty/hvc/hvcs.c
        }
  
        spin_unlock_irqrestore(&hvcsd->lock, flags);
-@@ -1268,7 +1269,7 @@ static void hvcs_hangup(struct tty_struc
+@@ -1268,7 +1269,7 @@ static void hvcs_hangup(struct tty_struct * tty)
  
        spin_lock_irqsave(&hvcsd->lock, flags);
        /* Preserve this so that we know how many kref refs to put */
@@ -35603,7 +37649,7 @@ diff -urNp linux-3.1.3/drivers/tty/hvc/hvcs.c linux-3.1.3/drivers/tty/hvc/hvcs.c
  
        /*
         * Don't kref put inside the spinlock because the destruction
-@@ -1283,7 +1284,7 @@ static void hvcs_hangup(struct tty_struc
+@@ -1283,7 +1284,7 @@ static void hvcs_hangup(struct tty_struct * tty)
        hvcsd->tty->driver_data = NULL;
        hvcsd->tty = NULL;
  
@@ -35612,7 +37658,7 @@ diff -urNp linux-3.1.3/drivers/tty/hvc/hvcs.c linux-3.1.3/drivers/tty/hvc/hvcs.c
  
        /* This will drop any buffered data on the floor which is OK in a hangup
         * scenario. */
-@@ -1354,7 +1355,7 @@ static int hvcs_write(struct tty_struct 
+@@ -1354,7 +1355,7 @@ static int hvcs_write(struct tty_struct *tty,
         * the middle of a write operation?  This is a crummy place to do this
         * but we want to keep it all in the spinlock.
         */
@@ -35621,7 +37667,7 @@ diff -urNp linux-3.1.3/drivers/tty/hvc/hvcs.c linux-3.1.3/drivers/tty/hvc/hvcs.c
                spin_unlock_irqrestore(&hvcsd->lock, flags);
                return -ENODEV;
        }
-@@ -1428,7 +1429,7 @@ static int hvcs_write_room(struct tty_st
+@@ -1428,7 +1429,7 @@ static int hvcs_write_room(struct tty_struct *tty)
  {
        struct hvcs_struct *hvcsd = tty->driver_data;
  
@@ -35630,9 +37676,10 @@ diff -urNp linux-3.1.3/drivers/tty/hvc/hvcs.c linux-3.1.3/drivers/tty/hvc/hvcs.c
                return 0;
  
        return HVCS_BUFF_LEN - hvcsd->chars_in_buffer;
-diff -urNp linux-3.1.3/drivers/tty/ipwireless/tty.c linux-3.1.3/drivers/tty/ipwireless/tty.c
---- linux-3.1.3/drivers/tty/ipwireless/tty.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/tty/ipwireless/tty.c   2011-11-16 18:39:08.000000000 -0500
+diff --git a/drivers/tty/ipwireless/tty.c b/drivers/tty/ipwireless/tty.c
+index ef92869..f4ebd88 100644
+--- a/drivers/tty/ipwireless/tty.c
++++ b/drivers/tty/ipwireless/tty.c
 @@ -29,6 +29,7 @@
  #include <linux/tty_driver.h>
  #include <linux/tty_flip.h>
@@ -35650,7 +37697,7 @@ diff -urNp linux-3.1.3/drivers/tty/ipwireless/tty.c linux-3.1.3/drivers/tty/ipwi
        unsigned int control_lines;
        struct mutex ipw_tty_mutex;
        int tx_bytes_queued;
-@@ -127,10 +128,10 @@ static int ipw_open(struct tty_struct *l
+@@ -127,10 +128,10 @@ static int ipw_open(struct tty_struct *linux_tty, struct file *filp)
                mutex_unlock(&tty->ipw_tty_mutex);
                return -ENODEV;
        }
@@ -35663,7 +37710,7 @@ diff -urNp linux-3.1.3/drivers/tty/ipwireless/tty.c linux-3.1.3/drivers/tty/ipwi
  
        tty->linux_tty = linux_tty;
        linux_tty->driver_data = tty;
-@@ -146,9 +147,7 @@ static int ipw_open(struct tty_struct *l
+@@ -146,9 +147,7 @@ static int ipw_open(struct tty_struct *linux_tty, struct file *filp)
  
  static void do_ipw_close(struct ipw_tty *tty)
  {
@@ -35674,7 +37721,7 @@ diff -urNp linux-3.1.3/drivers/tty/ipwireless/tty.c linux-3.1.3/drivers/tty/ipwi
                struct tty_struct *linux_tty = tty->linux_tty;
  
                if (linux_tty != NULL) {
-@@ -169,7 +168,7 @@ static void ipw_hangup(struct tty_struct
+@@ -169,7 +168,7 @@ static void ipw_hangup(struct tty_struct *linux_tty)
                return;
  
        mutex_lock(&tty->ipw_tty_mutex);
@@ -35683,7 +37730,7 @@ diff -urNp linux-3.1.3/drivers/tty/ipwireless/tty.c linux-3.1.3/drivers/tty/ipwi
                mutex_unlock(&tty->ipw_tty_mutex);
                return;
        }
-@@ -198,7 +197,7 @@ void ipwireless_tty_received(struct ipw_
+@@ -198,7 +197,7 @@ void ipwireless_tty_received(struct ipw_tty *tty, unsigned char *data,
                return;
        }
  
@@ -35692,7 +37739,7 @@ diff -urNp linux-3.1.3/drivers/tty/ipwireless/tty.c linux-3.1.3/drivers/tty/ipwi
                mutex_unlock(&tty->ipw_tty_mutex);
                return;
        }
-@@ -240,7 +239,7 @@ static int ipw_write(struct tty_struct *
+@@ -240,7 +239,7 @@ static int ipw_write(struct tty_struct *linux_tty,
                return -ENODEV;
  
        mutex_lock(&tty->ipw_tty_mutex);
@@ -35701,7 +37748,7 @@ diff -urNp linux-3.1.3/drivers/tty/ipwireless/tty.c linux-3.1.3/drivers/tty/ipwi
                mutex_unlock(&tty->ipw_tty_mutex);
                return -EINVAL;
        }
-@@ -280,7 +279,7 @@ static int ipw_write_room(struct tty_str
+@@ -280,7 +279,7 @@ static int ipw_write_room(struct tty_struct *linux_tty)
        if (!tty)
                return -ENODEV;
  
@@ -35710,7 +37757,7 @@ diff -urNp linux-3.1.3/drivers/tty/ipwireless/tty.c linux-3.1.3/drivers/tty/ipwi
                return -EINVAL;
  
        room = IPWIRELESS_TX_QUEUE_SIZE - tty->tx_bytes_queued;
-@@ -322,7 +321,7 @@ static int ipw_chars_in_buffer(struct tt
+@@ -322,7 +321,7 @@ static int ipw_chars_in_buffer(struct tty_struct *linux_tty)
        if (!tty)
                return 0;
  
@@ -35719,7 +37766,7 @@ diff -urNp linux-3.1.3/drivers/tty/ipwireless/tty.c linux-3.1.3/drivers/tty/ipwi
                return 0;
  
        return tty->tx_bytes_queued;
-@@ -403,7 +402,7 @@ static int ipw_tiocmget(struct tty_struc
+@@ -403,7 +402,7 @@ static int ipw_tiocmget(struct tty_struct *linux_tty)
        if (!tty)
                return -ENODEV;
  
@@ -35728,7 +37775,7 @@ diff -urNp linux-3.1.3/drivers/tty/ipwireless/tty.c linux-3.1.3/drivers/tty/ipwi
                return -EINVAL;
  
        return get_control_lines(tty);
-@@ -419,7 +418,7 @@ ipw_tiocmset(struct tty_struct *linux_tt
+@@ -419,7 +418,7 @@ ipw_tiocmset(struct tty_struct *linux_tty,
        if (!tty)
                return -ENODEV;
  
@@ -35737,7 +37784,7 @@ diff -urNp linux-3.1.3/drivers/tty/ipwireless/tty.c linux-3.1.3/drivers/tty/ipwi
                return -EINVAL;
  
        return set_control_lines(tty, set, clear);
-@@ -433,7 +432,7 @@ static int ipw_ioctl(struct tty_struct *
+@@ -433,7 +432,7 @@ static int ipw_ioctl(struct tty_struct *linux_tty,
        if (!tty)
                return -ENODEV;
  
@@ -35746,7 +37793,7 @@ diff -urNp linux-3.1.3/drivers/tty/ipwireless/tty.c linux-3.1.3/drivers/tty/ipwi
                return -EINVAL;
  
        /* FIXME: Exactly how is the tty object locked here .. */
-@@ -582,7 +581,7 @@ void ipwireless_tty_free(struct ipw_tty 
+@@ -582,7 +581,7 @@ void ipwireless_tty_free(struct ipw_tty *tty)
                                   against a parallel ioctl etc */
                                mutex_lock(&ttyj->ipw_tty_mutex);
                        }
@@ -35755,10 +37802,11 @@ diff -urNp linux-3.1.3/drivers/tty/ipwireless/tty.c linux-3.1.3/drivers/tty/ipwi
                                do_ipw_close(ttyj);
                        ipwireless_disassociate_network_ttys(network,
                                                             ttyj->channel_idx);
-diff -urNp linux-3.1.3/drivers/tty/n_gsm.c linux-3.1.3/drivers/tty/n_gsm.c
---- linux-3.1.3/drivers/tty/n_gsm.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/tty/n_gsm.c    2011-11-16 18:39:08.000000000 -0500
-@@ -1625,7 +1625,7 @@ static struct gsm_dlci *gsm_dlci_alloc(s
+diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
+index 8a50e4e..7d9ca3d 100644
+--- a/drivers/tty/n_gsm.c
++++ b/drivers/tty/n_gsm.c
+@@ -1625,7 +1625,7 @@ static struct gsm_dlci *gsm_dlci_alloc(struct gsm_mux *gsm, int addr)
        kref_init(&dlci->ref);
        mutex_init(&dlci->mutex);
        dlci->fifo = &dlci->_fifo;
@@ -35767,10 +37815,11 @@ diff -urNp linux-3.1.3/drivers/tty/n_gsm.c linux-3.1.3/drivers/tty/n_gsm.c
                kfree(dlci);
                return NULL;
        }
-diff -urNp linux-3.1.3/drivers/tty/n_tty.c linux-3.1.3/drivers/tty/n_tty.c
---- linux-3.1.3/drivers/tty/n_tty.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/tty/n_tty.c    2011-11-16 18:39:08.000000000 -0500
-@@ -2123,6 +2123,7 @@ void n_tty_inherit_ops(struct tty_ldisc_
+diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
+index 39d6ab6..eb97f41 100644
+--- a/drivers/tty/n_tty.c
++++ b/drivers/tty/n_tty.c
+@@ -2123,6 +2123,7 @@ void n_tty_inherit_ops(struct tty_ldisc_ops *ops)
  {
        *ops = tty_ldisc_N_TTY;
        ops->owner = NULL;
@@ -35779,9 +37828,10 @@ diff -urNp linux-3.1.3/drivers/tty/n_tty.c linux-3.1.3/drivers/tty/n_tty.c
 +      ops->flags = 0;
  }
  EXPORT_SYMBOL_GPL(n_tty_inherit_ops);
-diff -urNp linux-3.1.3/drivers/tty/pty.c linux-3.1.3/drivers/tty/pty.c
---- linux-3.1.3/drivers/tty/pty.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/tty/pty.c      2011-11-16 18:39:08.000000000 -0500
+diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
+index e18604b..a7d5a11 100644
+--- a/drivers/tty/pty.c
++++ b/drivers/tty/pty.c
 @@ -773,8 +773,10 @@ static void __init unix98_pty_init(void)
        register_sysctl_table(pty_root_table);
  
@@ -35794,10 +37844,11 @@ diff -urNp linux-3.1.3/drivers/tty/pty.c linux-3.1.3/drivers/tty/pty.c
  
        cdev_init(&ptmx_cdev, &ptmx_fops);
        if (cdev_add(&ptmx_cdev, MKDEV(TTYAUX_MAJOR, 2), 1) ||
-diff -urNp linux-3.1.3/drivers/tty/rocket.c linux-3.1.3/drivers/tty/rocket.c
---- linux-3.1.3/drivers/tty/rocket.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/tty/rocket.c   2011-11-16 18:40:29.000000000 -0500
-@@ -1277,6 +1277,8 @@ static int get_ports(struct r_port *info
+diff --git a/drivers/tty/rocket.c b/drivers/tty/rocket.c
+index 6a1241c..d04ab0d 100644
+--- a/drivers/tty/rocket.c
++++ b/drivers/tty/rocket.c
+@@ -1277,6 +1277,8 @@ static int get_ports(struct r_port *info, struct rocket_ports __user *retports)
        struct rocket_ports tmp;
        int board;
  
@@ -35806,9 +37857,10 @@ diff -urNp linux-3.1.3/drivers/tty/rocket.c linux-3.1.3/drivers/tty/rocket.c
        if (!retports)
                return -EFAULT;
        memset(&tmp, 0, sizeof (tmp));
-diff -urNp linux-3.1.3/drivers/tty/serial/kgdboc.c linux-3.1.3/drivers/tty/serial/kgdboc.c
---- linux-3.1.3/drivers/tty/serial/kgdboc.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/tty/serial/kgdboc.c    2011-11-16 18:39:08.000000000 -0500
+diff --git a/drivers/tty/serial/kgdboc.c b/drivers/tty/serial/kgdboc.c
+index 87e7e6c..89744e0 100644
+--- a/drivers/tty/serial/kgdboc.c
++++ b/drivers/tty/serial/kgdboc.c
 @@ -23,8 +23,9 @@
  #define MAX_CONFIG_LEN                40
  
@@ -35882,7 +37934,7 @@ diff -urNp linux-3.1.3/drivers/tty/serial/kgdboc.c linux-3.1.3/drivers/tty/seria
                return 0;
  
        return configure_kgdboc();
-@@ -261,7 +268,7 @@ static int param_set_kgdboc_var(const ch
+@@ -261,7 +268,7 @@ static int param_set_kgdboc_var(const char *kmessage, struct kernel_param *kp)
        if (config[len - 1] == '\n')
                config[len - 1] = '\0';
  
@@ -35907,10 +37959,11 @@ diff -urNp linux-3.1.3/drivers/tty/serial/kgdboc.c linux-3.1.3/drivers/tty/seria
  #ifdef CONFIG_KGDB_SERIAL_CONSOLE
  /* This is only available if kgdboc is a built in for early debugging */
  static int __init kgdboc_early_init(char *opt)
-diff -urNp linux-3.1.3/drivers/tty/serial/mfd.c linux-3.1.3/drivers/tty/serial/mfd.c
---- linux-3.1.3/drivers/tty/serial/mfd.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/tty/serial/mfd.c       2011-11-16 18:39:08.000000000 -0500
-@@ -1423,7 +1423,7 @@ static void serial_hsu_remove(struct pci
+diff --git a/drivers/tty/serial/mfd.c b/drivers/tty/serial/mfd.c
+index cab52f4..29fc6aa 100644
+--- a/drivers/tty/serial/mfd.c
++++ b/drivers/tty/serial/mfd.c
+@@ -1423,7 +1423,7 @@ static void serial_hsu_remove(struct pci_dev *pdev)
  }
  
  /* First 3 are UART ports, and the 4th is the DMA */
@@ -35919,10 +37972,11 @@ diff -urNp linux-3.1.3/drivers/tty/serial/mfd.c linux-3.1.3/drivers/tty/serial/m
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x081B) },
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x081C) },
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x081D) },
-diff -urNp linux-3.1.3/drivers/tty/serial/mrst_max3110.c linux-3.1.3/drivers/tty/serial/mrst_max3110.c
---- linux-3.1.3/drivers/tty/serial/mrst_max3110.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/tty/serial/mrst_max3110.c      2011-11-16 18:40:29.000000000 -0500
-@@ -393,6 +393,8 @@ static void max3110_con_receive(struct u
+diff --git a/drivers/tty/serial/mrst_max3110.c b/drivers/tty/serial/mrst_max3110.c
+index 23bc743..d425c07 100644
+--- a/drivers/tty/serial/mrst_max3110.c
++++ b/drivers/tty/serial/mrst_max3110.c
+@@ -393,6 +393,8 @@ static void max3110_con_receive(struct uart_max3110 *max)
        int loop = 1, num, total = 0;
        u8 recv_buf[512], *pbuf;
  
@@ -35931,9 +37985,10 @@ diff -urNp linux-3.1.3/drivers/tty/serial/mrst_max3110.c linux-3.1.3/drivers/tty
        pbuf = recv_buf;
        do {
                num = max3110_read_multi(max, pbuf);
-diff -urNp linux-3.1.3/drivers/tty/tty_io.c linux-3.1.3/drivers/tty/tty_io.c
---- linux-3.1.3/drivers/tty/tty_io.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/tty/tty_io.c   2011-11-16 18:39:08.000000000 -0500
+diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
+index 1a890e2..1d8139c 100644
+--- a/drivers/tty/tty_io.c
++++ b/drivers/tty/tty_io.c
 @@ -3238,7 +3238,7 @@ EXPORT_SYMBOL_GPL(get_current_tty);
  
  void tty_default_fops(struct file_operations *fops)
@@ -35943,10 +37998,11 @@ diff -urNp linux-3.1.3/drivers/tty/tty_io.c linux-3.1.3/drivers/tty/tty_io.c
  }
  
  /*
-diff -urNp linux-3.1.3/drivers/tty/tty_ldisc.c linux-3.1.3/drivers/tty/tty_ldisc.c
---- linux-3.1.3/drivers/tty/tty_ldisc.c        2011-11-26 19:57:29.000000000 -0500
-+++ linux-3.1.3/drivers/tty/tty_ldisc.c        2011-11-26 20:00:43.000000000 -0500
-@@ -75,7 +75,7 @@ static void put_ldisc(struct tty_ldisc *
+diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
+index a76c808..ecbc743 100644
+--- a/drivers/tty/tty_ldisc.c
++++ b/drivers/tty/tty_ldisc.c
+@@ -75,7 +75,7 @@ static void put_ldisc(struct tty_ldisc *ld)
        if (atomic_dec_and_lock(&ld->users, &tty_ldisc_lock)) {
                struct tty_ldisc_ops *ldo = ld->ops;
  
@@ -35955,7 +38011,7 @@ diff -urNp linux-3.1.3/drivers/tty/tty_ldisc.c linux-3.1.3/drivers/tty/tty_ldisc
                module_put(ldo->owner);
                spin_unlock_irqrestore(&tty_ldisc_lock, flags);
  
-@@ -110,7 +110,7 @@ int tty_register_ldisc(int disc, struct 
+@@ -110,7 +110,7 @@ int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc)
        spin_lock_irqsave(&tty_ldisc_lock, flags);
        tty_ldiscs[disc] = new_ldisc;
        new_ldisc->num = disc;
@@ -35973,7 +38029,7 @@ diff -urNp linux-3.1.3/drivers/tty/tty_ldisc.c linux-3.1.3/drivers/tty/tty_ldisc
                ret = -EBUSY;
        else
                tty_ldiscs[disc] = NULL;
-@@ -159,7 +159,7 @@ static struct tty_ldisc_ops *get_ldops(i
+@@ -159,7 +159,7 @@ static struct tty_ldisc_ops *get_ldops(int disc)
        if (ldops) {
                ret = ERR_PTR(-EAGAIN);
                if (try_module_get(ldops->owner)) {
@@ -35982,7 +38038,7 @@ diff -urNp linux-3.1.3/drivers/tty/tty_ldisc.c linux-3.1.3/drivers/tty/tty_ldisc
                        ret = ldops;
                }
        }
-@@ -172,7 +172,7 @@ static void put_ldops(struct tty_ldisc_o
+@@ -172,7 +172,7 @@ static void put_ldops(struct tty_ldisc_ops *ldops)
        unsigned long flags;
  
        spin_lock_irqsave(&tty_ldisc_lock, flags);
@@ -35991,10 +38047,11 @@ diff -urNp linux-3.1.3/drivers/tty/tty_ldisc.c linux-3.1.3/drivers/tty/tty_ldisc
        module_put(ldops->owner);
        spin_unlock_irqrestore(&tty_ldisc_lock, flags);
  }
-diff -urNp linux-3.1.3/drivers/tty/vt/keyboard.c linux-3.1.3/drivers/tty/vt/keyboard.c
---- linux-3.1.3/drivers/tty/vt/keyboard.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/tty/vt/keyboard.c      2011-11-16 18:40:29.000000000 -0500
-@@ -656,6 +656,16 @@ static void k_spec(struct vc_data *vc, u
+diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c
+index 3761ccf..2c613b3 100644
+--- a/drivers/tty/vt/keyboard.c
++++ b/drivers/tty/vt/keyboard.c
+@@ -656,6 +656,16 @@ static void k_spec(struct vc_data *vc, unsigned char value, char up_flag)
             kbd->kbdmode == VC_OFF) &&
             value != KVAL(K_SAK))
                return;         /* SAK is allowed even in raw mode */
@@ -36011,10 +38068,11 @@ diff -urNp linux-3.1.3/drivers/tty/vt/keyboard.c linux-3.1.3/drivers/tty/vt/keyb
        fn_handler[value](vc);
  }
  
-diff -urNp linux-3.1.3/drivers/tty/vt/vt.c linux-3.1.3/drivers/tty/vt/vt.c
---- linux-3.1.3/drivers/tty/vt/vt.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/tty/vt/vt.c    2011-11-16 18:39:08.000000000 -0500
-@@ -259,7 +259,7 @@ EXPORT_SYMBOL_GPL(unregister_vt_notifier
+diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
+index b3915b7..e716839 100644
+--- a/drivers/tty/vt/vt.c
++++ b/drivers/tty/vt/vt.c
+@@ -259,7 +259,7 @@ EXPORT_SYMBOL_GPL(unregister_vt_notifier);
  
  static void notify_write(struct vc_data *vc, unsigned int unicode)
  {
@@ -36023,10 +38081,11 @@ diff -urNp linux-3.1.3/drivers/tty/vt/vt.c linux-3.1.3/drivers/tty/vt/vt.c
        atomic_notifier_call_chain(&vt_notifier_list, VT_WRITE, &param);
  }
  
-diff -urNp linux-3.1.3/drivers/tty/vt/vt_ioctl.c linux-3.1.3/drivers/tty/vt/vt_ioctl.c
---- linux-3.1.3/drivers/tty/vt/vt_ioctl.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/tty/vt/vt_ioctl.c      2011-11-16 18:40:29.000000000 -0500
-@@ -207,9 +207,6 @@ do_kdsk_ioctl(int cmd, struct kbentry __
+diff --git a/drivers/tty/vt/vt_ioctl.c b/drivers/tty/vt/vt_ioctl.c
+index 5e096f4..0da1363 100644
+--- a/drivers/tty/vt/vt_ioctl.c
++++ b/drivers/tty/vt/vt_ioctl.c
+@@ -207,9 +207,6 @@ do_kdsk_ioctl(int cmd, struct kbentry __user *user_kbe, int perm, struct kbd_str
        if (copy_from_user(&tmp, user_kbe, sizeof(struct kbentry)))
                return -EFAULT;
  
@@ -36036,7 +38095,7 @@ diff -urNp linux-3.1.3/drivers/tty/vt/vt_ioctl.c linux-3.1.3/drivers/tty/vt/vt_i
        switch (cmd) {
        case KDGKBENT:
                key_map = key_maps[s];
-@@ -221,6 +218,9 @@ do_kdsk_ioctl(int cmd, struct kbentry __
+@@ -221,6 +218,9 @@ do_kdsk_ioctl(int cmd, struct kbentry __user *user_kbe, int perm, struct kbd_str
                    val = (i ? K_HOLE : K_NOSUCHMAP);
                return put_user(val, &user_kbe->kb_value);
        case KDSKBENT:
@@ -36046,7 +38105,7 @@ diff -urNp linux-3.1.3/drivers/tty/vt/vt_ioctl.c linux-3.1.3/drivers/tty/vt/vt_i
                if (!perm)
                        return -EPERM;
                if (!i && v == K_NOSUCHMAP) {
-@@ -322,9 +322,6 @@ do_kdgkb_ioctl(int cmd, struct kbsentry 
+@@ -322,9 +322,6 @@ do_kdgkb_ioctl(int cmd, struct kbsentry __user *user_kdgkb, int perm)
        int i, j, k;
        int ret;
  
@@ -36056,7 +38115,7 @@ diff -urNp linux-3.1.3/drivers/tty/vt/vt_ioctl.c linux-3.1.3/drivers/tty/vt/vt_i
        kbs = kmalloc(sizeof(*kbs), GFP_KERNEL);
        if (!kbs) {
                ret = -ENOMEM;
-@@ -358,6 +355,9 @@ do_kdgkb_ioctl(int cmd, struct kbsentry 
+@@ -358,6 +355,9 @@ do_kdgkb_ioctl(int cmd, struct kbsentry __user *user_kdgkb, int perm)
                kfree(kbs);
                return ((p && *p) ? -EOVERFLOW : 0);
        case KDSKBSENT:
@@ -36066,9 +38125,10 @@ diff -urNp linux-3.1.3/drivers/tty/vt/vt_ioctl.c linux-3.1.3/drivers/tty/vt/vt_i
                if (!perm) {
                        ret = -EPERM;
                        goto reterr;
-diff -urNp linux-3.1.3/drivers/uio/uio.c linux-3.1.3/drivers/uio/uio.c
---- linux-3.1.3/drivers/uio/uio.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/uio/uio.c      2011-11-16 18:39:08.000000000 -0500
+diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
+index d2efe82..9440ab6 100644
+--- a/drivers/uio/uio.c
++++ b/drivers/uio/uio.c
 @@ -25,6 +25,7 @@
  #include <linux/kobject.h>
  #include <linux/cdev.h>
@@ -36090,7 +38150,7 @@ diff -urNp linux-3.1.3/drivers/uio/uio.c linux-3.1.3/drivers/uio/uio.c
        struct uio_info         *info;
        struct kobject          *map_dir;
        struct kobject          *portio_dir;
-@@ -242,7 +243,7 @@ static ssize_t show_event(struct device 
+@@ -242,7 +243,7 @@ static ssize_t show_event(struct device *dev,
                          struct device_attribute *attr, char *buf)
  {
        struct uio_device *idev = dev_get_drvdata(dev);
@@ -36099,7 +38159,7 @@ diff -urNp linux-3.1.3/drivers/uio/uio.c linux-3.1.3/drivers/uio/uio.c
  }
  
  static struct device_attribute uio_class_attributes[] = {
-@@ -408,7 +409,7 @@ void uio_event_notify(struct uio_info *i
+@@ -408,7 +409,7 @@ void uio_event_notify(struct uio_info *info)
  {
        struct uio_device *idev = info->uio_dev;
  
@@ -36108,7 +38168,7 @@ diff -urNp linux-3.1.3/drivers/uio/uio.c linux-3.1.3/drivers/uio/uio.c
        wake_up_interruptible(&idev->wait);
        kill_fasync(&idev->async_queue, SIGIO, POLL_IN);
  }
-@@ -461,7 +462,7 @@ static int uio_open(struct inode *inode,
+@@ -461,7 +462,7 @@ static int uio_open(struct inode *inode, struct file *filep)
        }
  
        listener->dev = idev;
@@ -36117,7 +38177,7 @@ diff -urNp linux-3.1.3/drivers/uio/uio.c linux-3.1.3/drivers/uio/uio.c
        filep->private_data = listener;
  
        if (idev->info->open) {
-@@ -512,7 +513,7 @@ static unsigned int uio_poll(struct file
+@@ -512,7 +513,7 @@ static unsigned int uio_poll(struct file *filep, poll_table *wait)
                return -EIO;
  
        poll_wait(filep, &idev->wait, wait);
@@ -36126,7 +38186,7 @@ diff -urNp linux-3.1.3/drivers/uio/uio.c linux-3.1.3/drivers/uio/uio.c
                return POLLIN | POLLRDNORM;
        return 0;
  }
-@@ -537,7 +538,7 @@ static ssize_t uio_read(struct file *fil
+@@ -537,7 +538,7 @@ static ssize_t uio_read(struct file *filep, char __user *buf,
        do {
                set_current_state(TASK_INTERRUPTIBLE);
  
@@ -36135,7 +38195,7 @@ diff -urNp linux-3.1.3/drivers/uio/uio.c linux-3.1.3/drivers/uio/uio.c
                if (event_count != listener->event_count) {
                        if (copy_to_user(buf, &event_count, count))
                                retval = -EFAULT;
-@@ -606,13 +607,13 @@ static int uio_find_mem_index(struct vm_
+@@ -606,13 +607,13 @@ static int uio_find_mem_index(struct vm_area_struct *vma)
  static void uio_vma_open(struct vm_area_struct *vma)
  {
        struct uio_device *idev = vma->vm_private_data;
@@ -36151,7 +38211,7 @@ diff -urNp linux-3.1.3/drivers/uio/uio.c linux-3.1.3/drivers/uio/uio.c
  }
  
  static int uio_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
-@@ -823,7 +824,7 @@ int __uio_register_device(struct module 
+@@ -823,7 +824,7 @@ int __uio_register_device(struct module *owner,
        idev->owner = owner;
        idev->info = info;
        init_waitqueue_head(&idev->wait);
@@ -36160,10 +38220,11 @@ diff -urNp linux-3.1.3/drivers/uio/uio.c linux-3.1.3/drivers/uio/uio.c
  
        ret = uio_get_minor(idev);
        if (ret)
-diff -urNp linux-3.1.3/drivers/usb/atm/cxacru.c linux-3.1.3/drivers/usb/atm/cxacru.c
---- linux-3.1.3/drivers/usb/atm/cxacru.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/usb/atm/cxacru.c       2011-11-16 18:39:08.000000000 -0500
-@@ -473,7 +473,7 @@ static ssize_t cxacru_sysfs_store_adsl_c
+diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c
+index a845f8b..4f54072 100644
+--- a/drivers/usb/atm/cxacru.c
++++ b/drivers/usb/atm/cxacru.c
+@@ -473,7 +473,7 @@ static ssize_t cxacru_sysfs_store_adsl_config(struct device *dev,
                ret = sscanf(buf + pos, "%x=%x%n", &index, &value, &tmp);
                if (ret < 2)
                        return -EINVAL;
@@ -36172,10 +38233,11 @@ diff -urNp linux-3.1.3/drivers/usb/atm/cxacru.c linux-3.1.3/drivers/usb/atm/cxac
                        return -EINVAL;
                pos += tmp;
  
-diff -urNp linux-3.1.3/drivers/usb/atm/usbatm.c linux-3.1.3/drivers/usb/atm/usbatm.c
---- linux-3.1.3/drivers/usb/atm/usbatm.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/usb/atm/usbatm.c       2011-11-16 18:39:08.000000000 -0500
-@@ -333,7 +333,7 @@ static void usbatm_extract_one_cell(stru
+diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c
+index d3448ca..d2864ca 100644
+--- a/drivers/usb/atm/usbatm.c
++++ b/drivers/usb/atm/usbatm.c
+@@ -333,7 +333,7 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char
                if (printk_ratelimit())
                        atm_warn(instance, "%s: OAM not supported (vpi %d, vci %d)!\n",
                                __func__, vpi, vci);
@@ -36184,7 +38246,7 @@ diff -urNp linux-3.1.3/drivers/usb/atm/usbatm.c linux-3.1.3/drivers/usb/atm/usba
                return;
        }
  
-@@ -361,7 +361,7 @@ static void usbatm_extract_one_cell(stru
+@@ -361,7 +361,7 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char
                if (length > ATM_MAX_AAL5_PDU) {
                        atm_rldbg(instance, "%s: bogus length %u (vcc: 0x%p)!\n",
                                  __func__, length, vcc);
@@ -36193,7 +38255,7 @@ diff -urNp linux-3.1.3/drivers/usb/atm/usbatm.c linux-3.1.3/drivers/usb/atm/usba
                        goto out;
                }
  
-@@ -370,14 +370,14 @@ static void usbatm_extract_one_cell(stru
+@@ -370,14 +370,14 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char
                if (sarb->len < pdu_length) {
                        atm_rldbg(instance, "%s: bogus pdu_length %u (sarb->len: %u, vcc: 0x%p)!\n",
                                  __func__, pdu_length, sarb->len, vcc);
@@ -36210,7 +38272,7 @@ diff -urNp linux-3.1.3/drivers/usb/atm/usbatm.c linux-3.1.3/drivers/usb/atm/usba
                        goto out;
                }
  
-@@ -387,7 +387,7 @@ static void usbatm_extract_one_cell(stru
+@@ -387,7 +387,7 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char
                        if (printk_ratelimit())
                                atm_err(instance, "%s: no memory for skb (length: %u)!\n",
                                        __func__, length);
@@ -36219,7 +38281,7 @@ diff -urNp linux-3.1.3/drivers/usb/atm/usbatm.c linux-3.1.3/drivers/usb/atm/usba
                        goto out;
                }
  
-@@ -412,7 +412,7 @@ static void usbatm_extract_one_cell(stru
+@@ -412,7 +412,7 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char
  
                vcc->push(vcc, skb);
  
@@ -36228,7 +38290,7 @@ diff -urNp linux-3.1.3/drivers/usb/atm/usbatm.c linux-3.1.3/drivers/usb/atm/usba
        out:
                skb_trim(sarb, 0);
        }
-@@ -615,7 +615,7 @@ static void usbatm_tx_process(unsigned l
+@@ -615,7 +615,7 @@ static void usbatm_tx_process(unsigned long data)
                        struct atm_vcc *vcc = UDSL_SKB(skb)->atm.vcc;
  
                        usbatm_pop(vcc, skb);
@@ -36237,7 +38299,7 @@ diff -urNp linux-3.1.3/drivers/usb/atm/usbatm.c linux-3.1.3/drivers/usb/atm/usba
  
                        skb = skb_dequeue(&instance->sndqueue);
                }
-@@ -773,11 +773,11 @@ static int usbatm_atm_proc_read(struct a
+@@ -773,11 +773,11 @@ static int usbatm_atm_proc_read(struct atm_dev *atm_dev, loff_t * pos, char *pag
        if (!left--)
                return sprintf(page,
                               "AAL5: tx %d ( %d err ), rx %d ( %d err, %d drop )\n",
@@ -36254,9 +38316,10 @@ diff -urNp linux-3.1.3/drivers/usb/atm/usbatm.c linux-3.1.3/drivers/usb/atm/usba
  
        if (!left--) {
                if (instance->disconnected)
-diff -urNp linux-3.1.3/drivers/usb/core/devices.c linux-3.1.3/drivers/usb/core/devices.c
---- linux-3.1.3/drivers/usb/core/devices.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/usb/core/devices.c     2011-11-16 18:39:08.000000000 -0500
+diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c
+index 0149c09..f108812 100644
+--- a/drivers/usb/core/devices.c
++++ b/drivers/usb/core/devices.c
 @@ -126,7 +126,7 @@ static const char format_endpt[] =
   * time it gets called.
   */
@@ -36266,7 +38329,7 @@ diff -urNp linux-3.1.3/drivers/usb/core/devices.c linux-3.1.3/drivers/usb/core/d
        wait_queue_head_t wait;
  } device_event = {
        .count = ATOMIC_INIT(1),
-@@ -164,7 +164,7 @@ static const struct class_info clas_info
+@@ -164,7 +164,7 @@ static const struct class_info clas_info[] = {
  
  void usbfs_conn_disc_event(void)
  {
@@ -36275,7 +38338,7 @@ diff -urNp linux-3.1.3/drivers/usb/core/devices.c linux-3.1.3/drivers/usb/core/d
        wake_up(&device_event.wait);
  }
  
-@@ -648,7 +648,7 @@ static unsigned int usb_device_poll(stru
+@@ -648,7 +648,7 @@ static unsigned int usb_device_poll(struct file *file,
  
        poll_wait(file, &device_event.wait, wait);
  
@@ -36284,10 +38347,11 @@ diff -urNp linux-3.1.3/drivers/usb/core/devices.c linux-3.1.3/drivers/usb/core/d
        if (file->f_version != event_count) {
                file->f_version = event_count;
                return POLLIN | POLLRDNORM;
-diff -urNp linux-3.1.3/drivers/usb/core/message.c linux-3.1.3/drivers/usb/core/message.c
---- linux-3.1.3/drivers/usb/core/message.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/usb/core/message.c     2011-11-16 18:39:08.000000000 -0500
-@@ -869,8 +869,8 @@ char *usb_cache_string(struct usb_device
+diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
+index 0b5ec23..0da3d76 100644
+--- a/drivers/usb/core/message.c
++++ b/drivers/usb/core/message.c
+@@ -869,8 +869,8 @@ char *usb_cache_string(struct usb_device *udev, int index)
        buf = kmalloc(MAX_USB_STRING_SIZE, GFP_NOIO);
        if (buf) {
                len = usb_string(udev, index, buf, MAX_USB_STRING_SIZE);
@@ -36298,10 +38362,11 @@ diff -urNp linux-3.1.3/drivers/usb/core/message.c linux-3.1.3/drivers/usb/core/m
                        if (!smallbuf)
                                return buf;
                        memcpy(smallbuf, buf, len);
-diff -urNp linux-3.1.3/drivers/usb/early/ehci-dbgp.c linux-3.1.3/drivers/usb/early/ehci-dbgp.c
---- linux-3.1.3/drivers/usb/early/ehci-dbgp.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/usb/early/ehci-dbgp.c  2011-11-16 18:39:08.000000000 -0500
-@@ -97,7 +97,8 @@ static inline u32 dbgp_len_update(u32 x,
+diff --git a/drivers/usb/early/ehci-dbgp.c b/drivers/usb/early/ehci-dbgp.c
+index 1fc8f12..20647c1 100644
+--- a/drivers/usb/early/ehci-dbgp.c
++++ b/drivers/usb/early/ehci-dbgp.c
+@@ -97,7 +97,8 @@ static inline u32 dbgp_len_update(u32 x, u32 len)
  
  #ifdef CONFIG_KGDB
  static struct kgdb_io kgdbdbgp_io_ops;
@@ -36311,7 +38376,7 @@ diff -urNp linux-3.1.3/drivers/usb/early/ehci-dbgp.c linux-3.1.3/drivers/usb/ear
  #else
  #define dbgp_kgdb_mode (0)
  #endif
-@@ -1035,6 +1036,13 @@ static struct kgdb_io kgdbdbgp_io_ops = 
+@@ -1035,6 +1036,13 @@ static struct kgdb_io kgdbdbgp_io_ops = {
        .write_char = kgdbdbgp_write_char,
  };
  
@@ -36325,7 +38390,7 @@ diff -urNp linux-3.1.3/drivers/usb/early/ehci-dbgp.c linux-3.1.3/drivers/usb/ear
  static int kgdbdbgp_wait_time;
  
  static int __init kgdbdbgp_parse_config(char *str)
-@@ -1050,8 +1058,10 @@ static int __init kgdbdbgp_parse_config(
+@@ -1050,8 +1058,10 @@ static int __init kgdbdbgp_parse_config(char *str)
                ptr++;
                kgdbdbgp_wait_time = simple_strtoul(ptr, &ptr, 10);
        }
@@ -36338,10 +38403,11 @@ diff -urNp linux-3.1.3/drivers/usb/early/ehci-dbgp.c linux-3.1.3/drivers/usb/ear
  
        return 0;
  }
-diff -urNp linux-3.1.3/drivers/usb/host/xhci-mem.c linux-3.1.3/drivers/usb/host/xhci-mem.c
---- linux-3.1.3/drivers/usb/host/xhci-mem.c    2011-11-26 19:57:29.000000000 -0500
-+++ linux-3.1.3/drivers/usb/host/xhci-mem.c    2011-11-26 20:00:43.000000000 -0500
-@@ -1685,6 +1685,8 @@ static int xhci_check_trb_in_td_math(str
+diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
+index d718033..6075579 100644
+--- a/drivers/usb/host/xhci-mem.c
++++ b/drivers/usb/host/xhci-mem.c
+@@ -1685,6 +1685,8 @@ static int xhci_check_trb_in_td_math(struct xhci_hcd *xhci, gfp_t mem_flags)
        unsigned int num_tests;
        int i, ret;
  
@@ -36350,9 +38416,10 @@ diff -urNp linux-3.1.3/drivers/usb/host/xhci-mem.c linux-3.1.3/drivers/usb/host/
        num_tests = ARRAY_SIZE(simple_test_vector);
        for (i = 0; i < num_tests; i++) {
                ret = xhci_test_trb_in_td(xhci,
-diff -urNp linux-3.1.3/drivers/usb/wusbcore/wa-hc.h linux-3.1.3/drivers/usb/wusbcore/wa-hc.h
---- linux-3.1.3/drivers/usb/wusbcore/wa-hc.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/usb/wusbcore/wa-hc.h   2011-11-16 18:39:08.000000000 -0500
+diff --git a/drivers/usb/wusbcore/wa-hc.h b/drivers/usb/wusbcore/wa-hc.h
+index d6bea3e..60b250e 100644
+--- a/drivers/usb/wusbcore/wa-hc.h
++++ b/drivers/usb/wusbcore/wa-hc.h
 @@ -192,7 +192,7 @@ struct wahc {
        struct list_head xfer_delayed_list;
        spinlock_t xfer_list_lock;
@@ -36362,7 +38429,7 @@ diff -urNp linux-3.1.3/drivers/usb/wusbcore/wa-hc.h linux-3.1.3/drivers/usb/wusb
  };
  
  
-@@ -246,7 +246,7 @@ static inline void wa_init(struct wahc *
+@@ -246,7 +246,7 @@ static inline void wa_init(struct wahc *wa)
        INIT_LIST_HEAD(&wa->xfer_delayed_list);
        spin_lock_init(&wa->xfer_list_lock);
        INIT_WORK(&wa->xfer_work, wa_urb_enqueue_run);
@@ -36371,9 +38438,10 @@ diff -urNp linux-3.1.3/drivers/usb/wusbcore/wa-hc.h linux-3.1.3/drivers/usb/wusb
  }
  
  /**
-diff -urNp linux-3.1.3/drivers/usb/wusbcore/wa-xfer.c linux-3.1.3/drivers/usb/wusbcore/wa-xfer.c
---- linux-3.1.3/drivers/usb/wusbcore/wa-xfer.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/usb/wusbcore/wa-xfer.c 2011-11-16 18:39:08.000000000 -0500
+diff --git a/drivers/usb/wusbcore/wa-xfer.c b/drivers/usb/wusbcore/wa-xfer.c
+index 4193345..49ae93d 100644
+--- a/drivers/usb/wusbcore/wa-xfer.c
++++ b/drivers/usb/wusbcore/wa-xfer.c
 @@ -295,7 +295,7 @@ out:
   */
  static void wa_xfer_id_init(struct wa_xfer *xfer)
@@ -36383,10 +38451,11 @@ diff -urNp linux-3.1.3/drivers/usb/wusbcore/wa-xfer.c linux-3.1.3/drivers/usb/wu
  }
  
  /*
-diff -urNp linux-3.1.3/drivers/vhost/vhost.c linux-3.1.3/drivers/vhost/vhost.c
---- linux-3.1.3/drivers/vhost/vhost.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/vhost/vhost.c  2011-11-16 18:39:08.000000000 -0500
-@@ -629,7 +629,7 @@ static long vhost_set_memory(struct vhos
+diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
+index c14c42b..f955cc2 100644
+--- a/drivers/vhost/vhost.c
++++ b/drivers/vhost/vhost.c
+@@ -629,7 +629,7 @@ static long vhost_set_memory(struct vhost_dev *d, struct vhost_memory __user *m)
        return 0;
  }
  
@@ -36395,9 +38464,10 @@ diff -urNp linux-3.1.3/drivers/vhost/vhost.c linux-3.1.3/drivers/vhost/vhost.c
  {
        struct file *eventfp, *filep = NULL,
                    *pollstart = NULL, *pollstop = NULL;
-diff -urNp linux-3.1.3/drivers/video/aty/aty128fb.c linux-3.1.3/drivers/video/aty/aty128fb.c
---- linux-3.1.3/drivers/video/aty/aty128fb.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/video/aty/aty128fb.c   2011-11-16 18:39:08.000000000 -0500
+diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
+index b0b2ac3..89a4399 100644
+--- a/drivers/video/aty/aty128fb.c
++++ b/drivers/video/aty/aty128fb.c
 @@ -148,7 +148,7 @@ enum {
  };
  
@@ -36407,10 +38477,11 @@ diff -urNp linux-3.1.3/drivers/video/aty/aty128fb.c linux-3.1.3/drivers/video/at
        "AGP",
        "PCI",
        "PRO AGP",
-diff -urNp linux-3.1.3/drivers/video/fbcmap.c linux-3.1.3/drivers/video/fbcmap.c
---- linux-3.1.3/drivers/video/fbcmap.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/video/fbcmap.c 2011-11-16 18:39:08.000000000 -0500
-@@ -285,8 +285,7 @@ int fb_set_user_cmap(struct fb_cmap_user
+diff --git a/drivers/video/fbcmap.c b/drivers/video/fbcmap.c
+index 5c3960d..15cf8fc 100644
+--- a/drivers/video/fbcmap.c
++++ b/drivers/video/fbcmap.c
+@@ -285,8 +285,7 @@ int fb_set_user_cmap(struct fb_cmap_user *cmap, struct fb_info *info)
                rc = -ENODEV;
                goto out;
        }
@@ -36420,10 +38491,11 @@ diff -urNp linux-3.1.3/drivers/video/fbcmap.c linux-3.1.3/drivers/video/fbcmap.c
                rc = -EINVAL;
                goto out1;
        }
-diff -urNp linux-3.1.3/drivers/video/fbmem.c linux-3.1.3/drivers/video/fbmem.c
---- linux-3.1.3/drivers/video/fbmem.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/video/fbmem.c  2011-11-16 18:40:29.000000000 -0500
-@@ -428,7 +428,7 @@ static void fb_do_show_logo(struct fb_in
+diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
+index ad93629..ca6a218 100644
+--- a/drivers/video/fbmem.c
++++ b/drivers/video/fbmem.c
+@@ -428,7 +428,7 @@ static void fb_do_show_logo(struct fb_info *info, struct fb_image *image,
                        image->dx += image->width + 8;
                }
        } else if (rotate == FB_ROTATE_UD) {
@@ -36432,7 +38504,7 @@ diff -urNp linux-3.1.3/drivers/video/fbmem.c linux-3.1.3/drivers/video/fbmem.c
                        info->fbops->fb_imageblit(info, image);
                        image->dx -= image->width + 8;
                }
-@@ -440,7 +440,7 @@ static void fb_do_show_logo(struct fb_in
+@@ -440,7 +440,7 @@ static void fb_do_show_logo(struct fb_info *info, struct fb_image *image,
                        image->dy += image->height + 8;
                }
        } else if (rotate == FB_ROTATE_CCW) {
@@ -36441,7 +38513,7 @@ diff -urNp linux-3.1.3/drivers/video/fbmem.c linux-3.1.3/drivers/video/fbmem.c
                        info->fbops->fb_imageblit(info, image);
                        image->dy -= image->height + 8;
                }
-@@ -939,6 +939,8 @@ fb_set_var(struct fb_info *info, struct 
+@@ -939,6 +939,8 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
        int flags = info->flags;
        int ret = 0;
  
@@ -36450,7 +38522,7 @@ diff -urNp linux-3.1.3/drivers/video/fbmem.c linux-3.1.3/drivers/video/fbmem.c
        if (var->activate & FB_ACTIVATE_INV_MODE) {
                struct fb_videomode mode1, mode2;
  
-@@ -1064,6 +1066,8 @@ static long do_fb_ioctl(struct fb_info *
+@@ -1064,6 +1066,8 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd,
        void __user *argp = (void __user *)arg;
        long ret = 0;
  
@@ -36459,7 +38531,7 @@ diff -urNp linux-3.1.3/drivers/video/fbmem.c linux-3.1.3/drivers/video/fbmem.c
        switch (cmd) {
        case FBIOGET_VSCREENINFO:
                if (!lock_fb_info(info))
-@@ -1143,7 +1147,7 @@ static long do_fb_ioctl(struct fb_info *
+@@ -1143,7 +1147,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd,
                        return -EFAULT;
                if (con2fb.console < 1 || con2fb.console > MAX_NR_CONSOLES)
                        return -EINVAL;
@@ -36468,9 +38540,10 @@ diff -urNp linux-3.1.3/drivers/video/fbmem.c linux-3.1.3/drivers/video/fbmem.c
                        return -EINVAL;
                if (!registered_fb[con2fb.framebuffer])
                        request_module("fb%d", con2fb.framebuffer);
-diff -urNp linux-3.1.3/drivers/video/geode/gx1fb_core.c linux-3.1.3/drivers/video/geode/gx1fb_core.c
---- linux-3.1.3/drivers/video/geode/gx1fb_core.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/video/geode/gx1fb_core.c       2011-11-16 18:39:08.000000000 -0500
+diff --git a/drivers/video/geode/gx1fb_core.c b/drivers/video/geode/gx1fb_core.c
+index 5a5d092..265c5ed 100644
+--- a/drivers/video/geode/gx1fb_core.c
++++ b/drivers/video/geode/gx1fb_core.c
 @@ -29,7 +29,7 @@ static int  crt_option = 1;
  static char panel_option[32] = "";
  
@@ -36480,9 +38553,10 @@ diff -urNp linux-3.1.3/drivers/video/geode/gx1fb_core.c linux-3.1.3/drivers/vide
        /* 640x480-60 VESA */
        { NULL, 60, 640, 480, 39682,  48, 16, 33, 10, 96, 2,
          0, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA },
-diff -urNp linux-3.1.3/drivers/video/gxt4500.c linux-3.1.3/drivers/video/gxt4500.c
---- linux-3.1.3/drivers/video/gxt4500.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/video/gxt4500.c        2011-11-16 18:39:08.000000000 -0500
+diff --git a/drivers/video/gxt4500.c b/drivers/video/gxt4500.c
+index 896e53d..4d87d0b 100644
+--- a/drivers/video/gxt4500.c
++++ b/drivers/video/gxt4500.c
 @@ -156,7 +156,7 @@ struct gxt4500_par {
  static char *mode_option;
  
@@ -36492,7 +38566,7 @@ diff -urNp linux-3.1.3/drivers/video/gxt4500.c linux-3.1.3/drivers/video/gxt4500
        .refresh = 60,
        .xres = 1280,
        .yres = 1024,
-@@ -581,7 +581,7 @@ static int gxt4500_blank(int blank, stru
+@@ -581,7 +581,7 @@ static int gxt4500_blank(int blank, struct fb_info *info)
        return 0;
  }
  
@@ -36501,10 +38575,11 @@ diff -urNp linux-3.1.3/drivers/video/gxt4500.c linux-3.1.3/drivers/video/gxt4500
        .id = "IBM GXT4500P",
        .type = FB_TYPE_PACKED_PIXELS,
        .visual = FB_VISUAL_PSEUDOCOLOR,
-diff -urNp linux-3.1.3/drivers/video/i810/i810_accel.c linux-3.1.3/drivers/video/i810/i810_accel.c
---- linux-3.1.3/drivers/video/i810/i810_accel.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/video/i810/i810_accel.c        2011-11-16 18:39:08.000000000 -0500
-@@ -73,6 +73,7 @@ static inline int wait_for_space(struct 
+diff --git a/drivers/video/i810/i810_accel.c b/drivers/video/i810/i810_accel.c
+index 7672d2e..b56437f 100644
+--- a/drivers/video/i810/i810_accel.c
++++ b/drivers/video/i810/i810_accel.c
+@@ -73,6 +73,7 @@ static inline int wait_for_space(struct fb_info *info, u32 space)
                }
        }
        printk("ringbuffer lockup!!!\n");
@@ -36512,10 +38587,11 @@ diff -urNp linux-3.1.3/drivers/video/i810/i810_accel.c linux-3.1.3/drivers/video
        i810_report_error(mmio); 
        par->dev_flags |= LOCKUP;
        info->pixmap.scan_align = 1;
-diff -urNp linux-3.1.3/drivers/video/i810/i810_main.c linux-3.1.3/drivers/video/i810/i810_main.c
---- linux-3.1.3/drivers/video/i810/i810_main.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/video/i810/i810_main.c 2011-11-16 18:39:08.000000000 -0500
-@@ -97,7 +97,7 @@ static int i810fb_blank      (int blank_
+diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c
+index 318f6fb..9a389c1 100644
+--- a/drivers/video/i810/i810_main.c
++++ b/drivers/video/i810/i810_main.c
+@@ -97,7 +97,7 @@ static int i810fb_blank      (int blank_mode, struct fb_info *info);
  static void i810fb_release_resource       (struct fb_info *info, struct i810fb_par *par);
  
  /* PCI */
@@ -36524,9 +38600,10 @@ diff -urNp linux-3.1.3/drivers/video/i810/i810_main.c linux-3.1.3/drivers/video/
        "Intel(R) 810 Framebuffer Device"                                 ,
        "Intel(R) 810-DC100 Framebuffer Device"                           ,
        "Intel(R) 810E Framebuffer Device"                                ,
-diff -urNp linux-3.1.3/drivers/video/jz4740_fb.c linux-3.1.3/drivers/video/jz4740_fb.c
---- linux-3.1.3/drivers/video/jz4740_fb.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/video/jz4740_fb.c      2011-11-16 18:39:08.000000000 -0500
+diff --git a/drivers/video/jz4740_fb.c b/drivers/video/jz4740_fb.c
+index de36693..3c63fc2 100644
+--- a/drivers/video/jz4740_fb.c
++++ b/drivers/video/jz4740_fb.c
 @@ -136,7 +136,7 @@ struct jzfb {
        uint32_t pseudo_palette[16];
  };
@@ -36536,9 +38613,10 @@ diff -urNp linux-3.1.3/drivers/video/jz4740_fb.c linux-3.1.3/drivers/video/jz474
        .id             = "JZ4740 FB",
        .type           = FB_TYPE_PACKED_PIXELS,
        .visual         = FB_VISUAL_TRUECOLOR,
-diff -urNp linux-3.1.3/drivers/video/logo/logo_linux_clut224.ppm linux-3.1.3/drivers/video/logo/logo_linux_clut224.ppm
---- linux-3.1.3/drivers/video/logo/logo_linux_clut224.ppm      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/video/logo/logo_linux_clut224.ppm      2011-11-16 18:40:29.000000000 -0500
+diff --git a/drivers/video/logo/logo_linux_clut224.ppm b/drivers/video/logo/logo_linux_clut224.ppm
+index 3c14e43..eafa544 100644
+--- a/drivers/video/logo/logo_linux_clut224.ppm
++++ b/drivers/video/logo/logo_linux_clut224.ppm
 @@ -1,1604 +1,1123 @@
  P3
 -# Standard 224-color Linux logo
@@ -39264,10 +41342,11 @@ diff -urNp linux-3.1.3/drivers/video/logo/logo_linux_clut224.ppm linux-3.1.3/dri
 +4 4 4  4 4 4  4 4 4  4 4 4  4 4 4  4 4 4
 +4 4 4  4 4 4  4 4 4  4 4 4  4 4 4  4 4 4
 +4 4 4  4 4 4
-diff -urNp linux-3.1.3/drivers/video/udlfb.c linux-3.1.3/drivers/video/udlfb.c
---- linux-3.1.3/drivers/video/udlfb.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/video/udlfb.c  2011-11-16 18:39:08.000000000 -0500
-@@ -585,11 +585,11 @@ int dlfb_handle_damage(struct dlfb_data 
+diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c
+index 087fc99..f85ed76 100644
+--- a/drivers/video/udlfb.c
++++ b/drivers/video/udlfb.c
+@@ -585,11 +585,11 @@ int dlfb_handle_damage(struct dlfb_data *dev, int x, int y,
                dlfb_urb_completion(urb);
  
  error:
@@ -39283,7 +41362,7 @@ diff -urNp linux-3.1.3/drivers/video/udlfb.c linux-3.1.3/drivers/video/udlfb.c
                    >> 10)), /* Kcycles */
                   &dev->cpu_kcycles_used);
  
-@@ -710,11 +710,11 @@ static void dlfb_dpy_deferred_io(struct 
+@@ -710,11 +710,11 @@ static void dlfb_dpy_deferred_io(struct fb_info *info,
                dlfb_urb_completion(urb);
  
  error:
@@ -39299,7 +41378,7 @@ diff -urNp linux-3.1.3/drivers/video/udlfb.c linux-3.1.3/drivers/video/udlfb.c
                    >> 10)), /* Kcycles */
                   &dev->cpu_kcycles_used);
  }
-@@ -1306,7 +1306,7 @@ static ssize_t metrics_bytes_rendered_sh
+@@ -1306,7 +1306,7 @@ static ssize_t metrics_bytes_rendered_show(struct device *fbdev,
        struct fb_info *fb_info = dev_get_drvdata(fbdev);
        struct dlfb_data *dev = fb_info->par;
        return snprintf(buf, PAGE_SIZE, "%u\n",
@@ -39308,7 +41387,7 @@ diff -urNp linux-3.1.3/drivers/video/udlfb.c linux-3.1.3/drivers/video/udlfb.c
  }
  
  static ssize_t metrics_bytes_identical_show(struct device *fbdev,
-@@ -1314,7 +1314,7 @@ static ssize_t metrics_bytes_identical_s
+@@ -1314,7 +1314,7 @@ static ssize_t metrics_bytes_identical_show(struct device *fbdev,
        struct fb_info *fb_info = dev_get_drvdata(fbdev);
        struct dlfb_data *dev = fb_info->par;
        return snprintf(buf, PAGE_SIZE, "%u\n",
@@ -39317,7 +41396,7 @@ diff -urNp linux-3.1.3/drivers/video/udlfb.c linux-3.1.3/drivers/video/udlfb.c
  }
  
  static ssize_t metrics_bytes_sent_show(struct device *fbdev,
-@@ -1322,7 +1322,7 @@ static ssize_t metrics_bytes_sent_show(s
+@@ -1322,7 +1322,7 @@ static ssize_t metrics_bytes_sent_show(struct device *fbdev,
        struct fb_info *fb_info = dev_get_drvdata(fbdev);
        struct dlfb_data *dev = fb_info->par;
        return snprintf(buf, PAGE_SIZE, "%u\n",
@@ -39326,7 +41405,7 @@ diff -urNp linux-3.1.3/drivers/video/udlfb.c linux-3.1.3/drivers/video/udlfb.c
  }
  
  static ssize_t metrics_cpu_kcycles_used_show(struct device *fbdev,
-@@ -1330,7 +1330,7 @@ static ssize_t metrics_cpu_kcycles_used_
+@@ -1330,7 +1330,7 @@ static ssize_t metrics_cpu_kcycles_used_show(struct device *fbdev,
        struct fb_info *fb_info = dev_get_drvdata(fbdev);
        struct dlfb_data *dev = fb_info->par;
        return snprintf(buf, PAGE_SIZE, "%u\n",
@@ -39335,7 +41414,7 @@ diff -urNp linux-3.1.3/drivers/video/udlfb.c linux-3.1.3/drivers/video/udlfb.c
  }
  
  static ssize_t edid_show(
-@@ -1387,10 +1387,10 @@ static ssize_t metrics_reset_store(struc
+@@ -1387,10 +1387,10 @@ static ssize_t metrics_reset_store(struct device *fbdev,
        struct fb_info *fb_info = dev_get_drvdata(fbdev);
        struct dlfb_data *dev = fb_info->par;
  
@@ -39350,9 +41429,10 @@ diff -urNp linux-3.1.3/drivers/video/udlfb.c linux-3.1.3/drivers/video/udlfb.c
  
        return count;
  }
-diff -urNp linux-3.1.3/drivers/video/uvesafb.c linux-3.1.3/drivers/video/uvesafb.c
---- linux-3.1.3/drivers/video/uvesafb.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/video/uvesafb.c        2011-11-16 18:39:08.000000000 -0500
+diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c
+index 7f8472c..9842e87 100644
+--- a/drivers/video/uvesafb.c
++++ b/drivers/video/uvesafb.c
 @@ -19,6 +19,7 @@
  #include <linux/io.h>
  #include <linux/mutex.h>
@@ -39370,7 +41450,7 @@ diff -urNp linux-3.1.3/drivers/video/uvesafb.c linux-3.1.3/drivers/video/uvesafb
  }
  
  /*
-@@ -569,10 +570,32 @@ static int __devinit uvesafb_vbe_getpmi(
+@@ -569,10 +570,32 @@ static int __devinit uvesafb_vbe_getpmi(struct uvesafb_ktask *task,
        if ((task->t.regs.eax & 0xffff) != 0x4f || task->t.regs.es < 0xc000) {
                par->pmi_setpal = par->ypan = 0;
        } else {
@@ -39415,7 +41495,7 @@ diff -urNp linux-3.1.3/drivers/video/uvesafb.c linux-3.1.3/drivers/video/uvesafb
        framebuffer_release(info);
        return err;
  }
-@@ -1847,6 +1875,12 @@ static int uvesafb_remove(struct platfor
+@@ -1847,6 +1875,12 @@ static int uvesafb_remove(struct platform_device *dev)
                                kfree(par->vbe_state_orig);
                        if (par->vbe_state_saved)
                                kfree(par->vbe_state_saved);
@@ -39428,9 +41508,10 @@ diff -urNp linux-3.1.3/drivers/video/uvesafb.c linux-3.1.3/drivers/video/uvesafb
                }
  
                framebuffer_release(info);
-diff -urNp linux-3.1.3/drivers/video/vesafb.c linux-3.1.3/drivers/video/vesafb.c
---- linux-3.1.3/drivers/video/vesafb.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/video/vesafb.c 2011-11-16 18:39:08.000000000 -0500
+diff --git a/drivers/video/vesafb.c b/drivers/video/vesafb.c
+index 501b340..86bd4cf 100644
+--- a/drivers/video/vesafb.c
++++ b/drivers/video/vesafb.c
 @@ -9,6 +9,7 @@
   */
  
@@ -39439,7 +41520,7 @@ diff -urNp linux-3.1.3/drivers/video/vesafb.c linux-3.1.3/drivers/video/vesafb.c
  #include <linux/kernel.h>
  #include <linux/errno.h>
  #include <linux/string.h>
-@@ -52,8 +53,8 @@ static int   vram_remap __initdata;          /* 
+@@ -52,8 +53,8 @@ static int   vram_remap __initdata;          /* Set amount of memory to be used */
  static int   vram_total __initdata;           /* Set total amount of memory */
  static int   pmi_setpal __read_mostly = 1;    /* pmi for palette changes ??? */
  static int   ypan       __read_mostly;                /* 0..nothing, 1..ypan, 2..ywrap */
@@ -39450,7 +41531,7 @@ diff -urNp linux-3.1.3/drivers/video/vesafb.c linux-3.1.3/drivers/video/vesafb.c
  static int   depth      __read_mostly;
  static int   vga_compat __read_mostly;
  /* --------------------------------------------------------------------- */
-@@ -233,6 +234,7 @@ static int __init vesafb_probe(struct pl
+@@ -233,6 +234,7 @@ static int __init vesafb_probe(struct platform_device *dev)
        unsigned int size_vmode;
        unsigned int size_remap;
        unsigned int size_total;
@@ -39458,7 +41539,7 @@ diff -urNp linux-3.1.3/drivers/video/vesafb.c linux-3.1.3/drivers/video/vesafb.c
  
        if (screen_info.orig_video_isVGA != VIDEO_TYPE_VLFB)
                return -ENODEV;
-@@ -275,10 +277,6 @@ static int __init vesafb_probe(struct pl
+@@ -275,10 +277,6 @@ static int __init vesafb_probe(struct platform_device *dev)
                size_remap = size_total;
        vesafb_fix.smem_len = size_remap;
  
@@ -39469,7 +41550,7 @@ diff -urNp linux-3.1.3/drivers/video/vesafb.c linux-3.1.3/drivers/video/vesafb.c
        if (!request_mem_region(vesafb_fix.smem_start, size_total, "vesafb")) {
                printk(KERN_WARNING
                       "vesafb: cannot reserve video memory at 0x%lx\n",
-@@ -307,9 +305,21 @@ static int __init vesafb_probe(struct pl
+@@ -307,9 +305,21 @@ static int __init vesafb_probe(struct platform_device *dev)
        printk(KERN_INFO "vesafb: mode is %dx%dx%d, linelength=%d, pages=%d\n",
               vesafb_defined.xres, vesafb_defined.yres, vesafb_defined.bits_per_pixel, vesafb_fix.line_length, screen_info.pages);
  
@@ -39493,7 +41574,7 @@ diff -urNp linux-3.1.3/drivers/video/vesafb.c linux-3.1.3/drivers/video/vesafb.c
        }
  
        if (screen_info.vesapm_seg < 0xc000)
-@@ -317,9 +327,25 @@ static int __init vesafb_probe(struct pl
+@@ -317,9 +327,25 @@ static int __init vesafb_probe(struct platform_device *dev)
  
        if (ypan || pmi_setpal) {
                unsigned short *pmi_base;
@@ -39521,7 +41602,7 @@ diff -urNp linux-3.1.3/drivers/video/vesafb.c linux-3.1.3/drivers/video/vesafb.c
                printk(KERN_INFO "vesafb: pmi: set display start = %p, set palette = %p\n",pmi_start,pmi_pal);
                if (pmi_base[3]) {
                        printk(KERN_INFO "vesafb: pmi: ports = ");
-@@ -488,6 +514,11 @@ static int __init vesafb_probe(struct pl
+@@ -488,6 +514,11 @@ static int __init vesafb_probe(struct platform_device *dev)
               info->node, info->fix.id);
        return 0;
  err:
@@ -39533,9 +41614,10 @@ diff -urNp linux-3.1.3/drivers/video/vesafb.c linux-3.1.3/drivers/video/vesafb.c
        if (info->screen_base)
                iounmap(info->screen_base);
        framebuffer_release(info);
-diff -urNp linux-3.1.3/drivers/video/via/via_clock.h linux-3.1.3/drivers/video/via/via_clock.h
---- linux-3.1.3/drivers/video/via/via_clock.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/video/via/via_clock.h  2011-11-16 18:39:08.000000000 -0500
+diff --git a/drivers/video/via/via_clock.h b/drivers/video/via/via_clock.h
+index 88714ae..16c2e11 100644
+--- a/drivers/video/via/via_clock.h
++++ b/drivers/video/via/via_clock.h
 @@ -56,7 +56,7 @@ struct via_clock {
  
        void (*set_engine_pll_state)(u8 state);
@@ -39545,10 +41627,11 @@ diff -urNp linux-3.1.3/drivers/video/via/via_clock.h linux-3.1.3/drivers/video/v
  
  
  static inline u32 get_pll_internal_frequency(u32 ref_freq,
-diff -urNp linux-3.1.3/drivers/virtio/virtio_balloon.c linux-3.1.3/drivers/virtio/virtio_balloon.c
---- linux-3.1.3/drivers/virtio/virtio_balloon.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/virtio/virtio_balloon.c        2011-11-16 18:40:29.000000000 -0500
-@@ -174,6 +174,8 @@ static void update_balloon_stats(struct 
+diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
+index e058ace..2424d93 100644
+--- a/drivers/virtio/virtio_balloon.c
++++ b/drivers/virtio/virtio_balloon.c
+@@ -174,6 +174,8 @@ static void update_balloon_stats(struct virtio_balloon *vb)
        struct sysinfo i;
        int idx = 0;
  
@@ -39557,9 +41640,10 @@ diff -urNp linux-3.1.3/drivers/virtio/virtio_balloon.c linux-3.1.3/drivers/virti
        all_vm_events(events);
        si_meminfo(&i);
  
-diff -urNp linux-3.1.3/drivers/xen/xen-pciback/conf_space.h linux-3.1.3/drivers/xen/xen-pciback/conf_space.h
---- linux-3.1.3/drivers/xen/xen-pciback/conf_space.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/drivers/xen/xen-pciback/conf_space.h   2011-11-16 18:39:08.000000000 -0500
+diff --git a/drivers/xen/xen-pciback/conf_space.h b/drivers/xen/xen-pciback/conf_space.h
+index e56c934..fc22f4b 100644
+--- a/drivers/xen/xen-pciback/conf_space.h
++++ b/drivers/xen/xen-pciback/conf_space.h
 @@ -44,15 +44,15 @@ struct config_field {
                struct {
                        conf_dword_write write;
@@ -39579,10 +41663,11 @@ diff -urNp linux-3.1.3/drivers/xen/xen-pciback/conf_space.h linux-3.1.3/drivers/
        } u;
        struct list_head list;
  };
-diff -urNp linux-3.1.3/fs/9p/vfs_inode.c linux-3.1.3/fs/9p/vfs_inode.c
---- linux-3.1.3/fs/9p/vfs_inode.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/9p/vfs_inode.c      2011-11-16 18:39:08.000000000 -0500
-@@ -1288,7 +1288,7 @@ static void *v9fs_vfs_follow_link(struct
+diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
+index e3c03db..93b0172 100644
+--- a/fs/9p/vfs_inode.c
++++ b/fs/9p/vfs_inode.c
+@@ -1288,7 +1288,7 @@ static void *v9fs_vfs_follow_link(struct dentry *dentry, struct nameidata *nd)
  void
  v9fs_vfs_put_link(struct dentry *dentry, struct nameidata *nd, void *p)
  {
@@ -39591,10 +41676,24 @@ diff -urNp linux-3.1.3/fs/9p/vfs_inode.c linux-3.1.3/fs/9p/vfs_inode.c
  
        P9_DPRINTK(P9_DEBUG_VFS, " %s %s\n", dentry->d_name.name,
                IS_ERR(s) ? "<error>" : s);
-diff -urNp linux-3.1.3/fs/aio.c linux-3.1.3/fs/aio.c
---- linux-3.1.3/fs/aio.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/aio.c       2011-11-16 18:40:29.000000000 -0500
-@@ -119,7 +119,7 @@ static int aio_setup_ring(struct kioctx 
+diff --git a/fs/Kconfig.binfmt b/fs/Kconfig.binfmt
+index 79e2ca7..5828ad1 100644
+--- a/fs/Kconfig.binfmt
++++ b/fs/Kconfig.binfmt
+@@ -86,7 +86,7 @@ config HAVE_AOUT
+ config BINFMT_AOUT
+       tristate "Kernel support for a.out and ECOFF binaries"
+-      depends on HAVE_AOUT
++      depends on HAVE_AOUT && BROKEN
+       ---help---
+         A.out (Assembler.OUTput) is a set of formats for libraries and
+         executables used in the earliest versions of UNIX.  Linux used
+diff --git a/fs/aio.c b/fs/aio.c
+index e29ec48..f083e5e 100644
+--- a/fs/aio.c
++++ b/fs/aio.c
+@@ -119,7 +119,7 @@ static int aio_setup_ring(struct kioctx *ctx)
        size += sizeof(struct io_event) * nr_events;
        nr_pages = (size + PAGE_SIZE-1) >> PAGE_SHIFT;
  
@@ -39603,7 +41702,7 @@ diff -urNp linux-3.1.3/fs/aio.c linux-3.1.3/fs/aio.c
                return -EINVAL;
  
        nr_events = (PAGE_SIZE * nr_pages - sizeof(struct aio_ring)) / sizeof(struct io_event);
-@@ -1088,6 +1088,8 @@ static int read_events(struct kioctx *ct
+@@ -1088,6 +1088,8 @@ static int read_events(struct kioctx *ctx,
        struct aio_timeout      to;
        int                     retry = 0;
  
@@ -39612,7 +41711,7 @@ diff -urNp linux-3.1.3/fs/aio.c linux-3.1.3/fs/aio.c
        /* needed to zero any padding within an entry (there shouldn't be 
         * any, but C is fun!
         */
-@@ -1381,22 +1383,27 @@ static ssize_t aio_fsync(struct kiocb *i
+@@ -1381,22 +1383,27 @@ static ssize_t aio_fsync(struct kiocb *iocb)
  static ssize_t aio_setup_vectored_rw(int type, struct kiocb *kiocb, bool compat)
  {
        ssize_t ret;
@@ -39642,10 +41741,11 @@ diff -urNp linux-3.1.3/fs/aio.c linux-3.1.3/fs/aio.c
        kiocb->ki_nr_segs = kiocb->ki_nbytes;
        kiocb->ki_cur_seg = 0;
        /* ki_nbytes/left now reflect bytes instead of segs */
-diff -urNp linux-3.1.3/fs/attr.c linux-3.1.3/fs/attr.c
---- linux-3.1.3/fs/attr.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/attr.c      2011-11-16 18:40:29.000000000 -0500
-@@ -98,6 +98,7 @@ int inode_newsize_ok(const struct inode 
+diff --git a/fs/attr.c b/fs/attr.c
+index 538e279..046cc6d 100644
+--- a/fs/attr.c
++++ b/fs/attr.c
+@@ -98,6 +98,7 @@ int inode_newsize_ok(const struct inode *inode, loff_t offset)
                unsigned long limit;
  
                limit = rlimit(RLIMIT_FSIZE);
@@ -39653,10 +41753,11 @@ diff -urNp linux-3.1.3/fs/attr.c linux-3.1.3/fs/attr.c
                if (limit != RLIM_INFINITY && offset > limit)
                        goto out_sig;
                if (offset > inode->i_sb->s_maxbytes)
-diff -urNp linux-3.1.3/fs/autofs4/waitq.c linux-3.1.3/fs/autofs4/waitq.c
---- linux-3.1.3/fs/autofs4/waitq.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/autofs4/waitq.c     2011-11-16 18:39:08.000000000 -0500
-@@ -60,7 +60,7 @@ static int autofs4_write(struct file *fi
+diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c
+index e1fbdee..cd5ea56 100644
+--- a/fs/autofs4/waitq.c
++++ b/fs/autofs4/waitq.c
+@@ -60,7 +60,7 @@ static int autofs4_write(struct file *file, const void *addr, int bytes)
  {
        unsigned long sigpipe, flags;
        mm_segment_t fs;
@@ -39665,10 +41766,11 @@ diff -urNp linux-3.1.3/fs/autofs4/waitq.c linux-3.1.3/fs/autofs4/waitq.c
        ssize_t wr = 0;
  
        /** WARNING: this is not safe for writing more than PIPE_BUF bytes! **/
-diff -urNp linux-3.1.3/fs/befs/linuxvfs.c linux-3.1.3/fs/befs/linuxvfs.c
---- linux-3.1.3/fs/befs/linuxvfs.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/befs/linuxvfs.c     2011-11-16 18:39:08.000000000 -0500
-@@ -503,7 +503,7 @@ static void befs_put_link(struct dentry 
+diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
+index 720d885..012e7f0 100644
+--- a/fs/befs/linuxvfs.c
++++ b/fs/befs/linuxvfs.c
+@@ -503,7 +503,7 @@ static void befs_put_link(struct dentry *dentry, struct nameidata *nd, void *p)
  {
        befs_inode_info *befs_ino = BEFS_I(dentry->d_inode);
        if (befs_ino->i_flags & BEFS_LONG_SYMLINK) {
@@ -39677,9 +41779,10 @@ diff -urNp linux-3.1.3/fs/befs/linuxvfs.c linux-3.1.3/fs/befs/linuxvfs.c
                if (!IS_ERR(link))
                        kfree(link);
        }
-diff -urNp linux-3.1.3/fs/binfmt_aout.c linux-3.1.3/fs/binfmt_aout.c
---- linux-3.1.3/fs/binfmt_aout.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/binfmt_aout.c       2011-11-16 18:40:29.000000000 -0500
+diff --git a/fs/binfmt_aout.c b/fs/binfmt_aout.c
+index a6395bd..a5b24c4 100644
+--- a/fs/binfmt_aout.c
++++ b/fs/binfmt_aout.c
 @@ -16,6 +16,7 @@
  #include <linux/string.h>
  #include <linux/fs.h>
@@ -39688,7 +41791,7 @@ diff -urNp linux-3.1.3/fs/binfmt_aout.c linux-3.1.3/fs/binfmt_aout.c
  #include <linux/stat.h>
  #include <linux/fcntl.h>
  #include <linux/ptrace.h>
-@@ -86,6 +87,8 @@ static int aout_core_dump(struct coredum
+@@ -86,6 +87,8 @@ static int aout_core_dump(struct coredump_params *cprm)
  #endif
  #       define START_STACK(u)   ((void __user *)u.start_stack)
  
@@ -39697,7 +41800,7 @@ diff -urNp linux-3.1.3/fs/binfmt_aout.c linux-3.1.3/fs/binfmt_aout.c
        fs = get_fs();
        set_fs(KERNEL_DS);
        has_dumped = 1;
-@@ -97,10 +100,12 @@ static int aout_core_dump(struct coredum
+@@ -97,10 +100,12 @@ static int aout_core_dump(struct coredump_params *cprm)
  
  /* If the size of the dump file exceeds the rlimit, then see what would happen
     if we wrote the stack, but not the data area.  */
@@ -39710,7 +41813,7 @@ diff -urNp linux-3.1.3/fs/binfmt_aout.c linux-3.1.3/fs/binfmt_aout.c
        if ((dump.u_ssize + 1) * PAGE_SIZE > cprm->limit)
                dump.u_ssize = 0;
  
-@@ -234,6 +239,8 @@ static int load_aout_binary(struct linux
+@@ -234,6 +239,8 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
        rlim = rlimit(RLIMIT_DATA);
        if (rlim >= RLIM_INFINITY)
                rlim = ~0;
@@ -39719,7 +41822,7 @@ diff -urNp linux-3.1.3/fs/binfmt_aout.c linux-3.1.3/fs/binfmt_aout.c
        if (ex.a_data + ex.a_bss > rlim)
                return -ENOMEM;
  
-@@ -262,6 +269,27 @@ static int load_aout_binary(struct linux
+@@ -262,6 +269,27 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
        install_exec_creds(bprm);
        current->flags &= ~PF_FORKNOEXEC;
  
@@ -39747,7 +41850,7 @@ diff -urNp linux-3.1.3/fs/binfmt_aout.c linux-3.1.3/fs/binfmt_aout.c
        if (N_MAGIC(ex) == OMAGIC) {
                unsigned long text_addr, map_size;
                loff_t pos;
-@@ -334,7 +362,7 @@ static int load_aout_binary(struct linux
+@@ -334,7 +362,7 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
  
                down_write(&current->mm->mmap_sem);
                error = do_mmap(bprm->file, N_DATADDR(ex), ex.a_data,
@@ -39756,10 +41859,11 @@ diff -urNp linux-3.1.3/fs/binfmt_aout.c linux-3.1.3/fs/binfmt_aout.c
                                MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE | MAP_EXECUTABLE,
                                fd_offset + ex.a_text);
                up_write(&current->mm->mmap_sem);
-diff -urNp linux-3.1.3/fs/binfmt_elf.c linux-3.1.3/fs/binfmt_elf.c
---- linux-3.1.3/fs/binfmt_elf.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/binfmt_elf.c        2011-11-16 18:40:29.000000000 -0500
-@@ -51,6 +51,10 @@ static int elf_core_dump(struct coredump
+diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
+index 21ac5ee..171b1d0 100644
+--- a/fs/binfmt_elf.c
++++ b/fs/binfmt_elf.c
+@@ -51,6 +51,10 @@ static int elf_core_dump(struct coredump_params *cprm);
  #define elf_core_dump NULL
  #endif
  
@@ -39770,7 +41874,7 @@ diff -urNp linux-3.1.3/fs/binfmt_elf.c linux-3.1.3/fs/binfmt_elf.c
  #if ELF_EXEC_PAGESIZE > PAGE_SIZE
  #define ELF_MIN_ALIGN ELF_EXEC_PAGESIZE
  #else
-@@ -70,6 +74,11 @@ static struct linux_binfmt elf_format = 
+@@ -70,6 +74,11 @@ static struct linux_binfmt elf_format = {
        .load_binary    = load_elf_binary,
        .load_shlib     = load_elf_library,
        .core_dump      = elf_core_dump,
@@ -39782,7 +41886,7 @@ diff -urNp linux-3.1.3/fs/binfmt_elf.c linux-3.1.3/fs/binfmt_elf.c
        .min_coredump   = ELF_EXEC_PAGESIZE,
  };
  
-@@ -77,6 +86,8 @@ static struct linux_binfmt elf_format = 
+@@ -77,6 +86,8 @@ static struct linux_binfmt elf_format = {
  
  static int set_brk(unsigned long start, unsigned long end)
  {
@@ -39791,7 +41895,7 @@ diff -urNp linux-3.1.3/fs/binfmt_elf.c linux-3.1.3/fs/binfmt_elf.c
        start = ELF_PAGEALIGN(start);
        end = ELF_PAGEALIGN(end);
        if (end > start) {
-@@ -87,7 +98,7 @@ static int set_brk(unsigned long start, 
+@@ -87,7 +98,7 @@ static int set_brk(unsigned long start, unsigned long end)
                if (BAD_ADDR(addr))
                        return addr;
        }
@@ -39800,7 +41904,7 @@ diff -urNp linux-3.1.3/fs/binfmt_elf.c linux-3.1.3/fs/binfmt_elf.c
        return 0;
  }
  
-@@ -148,12 +159,15 @@ create_elf_tables(struct linux_binprm *b
+@@ -148,12 +159,15 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec,
        elf_addr_t __user *u_rand_bytes;
        const char *k_platform = ELF_PLATFORM;
        const char *k_base_platform = ELF_BASE_PLATFORM;
@@ -39817,7 +41921,7 @@ diff -urNp linux-3.1.3/fs/binfmt_elf.c linux-3.1.3/fs/binfmt_elf.c
  
        /*
         * In some cases (e.g. Hyper-Threading), we want to avoid L1
-@@ -195,8 +209,12 @@ create_elf_tables(struct linux_binprm *b
+@@ -195,8 +209,12 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec,
         * Generate 16 random bytes for userspace PRNG seeding.
         */
        get_random_bytes(k_rand_bytes, sizeof(k_rand_bytes));
@@ -39832,7 +41936,7 @@ diff -urNp linux-3.1.3/fs/binfmt_elf.c linux-3.1.3/fs/binfmt_elf.c
        if (__copy_to_user(u_rand_bytes, k_rand_bytes, sizeof(k_rand_bytes)))
                return -EFAULT;
  
-@@ -308,9 +326,11 @@ create_elf_tables(struct linux_binprm *b
+@@ -308,9 +326,11 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec,
                return -EFAULT;
        current->mm->env_end = p;
  
@@ -39845,7 +41949,7 @@ diff -urNp linux-3.1.3/fs/binfmt_elf.c linux-3.1.3/fs/binfmt_elf.c
                return -EFAULT;
        return 0;
  }
-@@ -381,10 +401,10 @@ static unsigned long load_elf_interp(str
+@@ -381,10 +401,10 @@ static unsigned long load_elf_interp(struct elfhdr *interp_elf_ex,
  {
        struct elf_phdr *elf_phdata;
        struct elf_phdr *eppnt;
@@ -39858,7 +41962,7 @@ diff -urNp linux-3.1.3/fs/binfmt_elf.c linux-3.1.3/fs/binfmt_elf.c
        unsigned long total_size;
        int retval, i, size;
  
-@@ -430,6 +450,11 @@ static unsigned long load_elf_interp(str
+@@ -430,6 +450,11 @@ static unsigned long load_elf_interp(struct elfhdr *interp_elf_ex,
                goto out_close;
        }
  
@@ -39870,7 +41974,7 @@ diff -urNp linux-3.1.3/fs/binfmt_elf.c linux-3.1.3/fs/binfmt_elf.c
        eppnt = elf_phdata;
        for (i = 0; i < interp_elf_ex->e_phnum; i++, eppnt++) {
                if (eppnt->p_type == PT_LOAD) {
-@@ -473,8 +498,8 @@ static unsigned long load_elf_interp(str
+@@ -473,8 +498,8 @@ static unsigned long load_elf_interp(struct elfhdr *interp_elf_ex,
                        k = load_addr + eppnt->p_vaddr;
                        if (BAD_ADDR(k) ||
                            eppnt->p_filesz > eppnt->p_memsz ||
@@ -40075,7 +42179,7 @@ diff -urNp linux-3.1.3/fs/binfmt_elf.c linux-3.1.3/fs/binfmt_elf.c
  /*
   * These are the functions used to load ELF style executables and shared
   * libraries.  There is no binary dependent code anywhere else.
-@@ -544,6 +756,11 @@ static unsigned long randomize_stack_top
+@@ -544,6 +756,11 @@ static unsigned long randomize_stack_top(unsigned long stack_top)
  {
        unsigned int random_variable = 0;
  
@@ -40087,7 +42191,7 @@ diff -urNp linux-3.1.3/fs/binfmt_elf.c linux-3.1.3/fs/binfmt_elf.c
        if ((current->flags & PF_RANDOMIZE) &&
                !(current->personality & ADDR_NO_RANDOMIZE)) {
                random_variable = get_random_int() & STACK_RND_MASK;
-@@ -562,7 +779,7 @@ static int load_elf_binary(struct linux_
+@@ -562,7 +779,7 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
        unsigned long load_addr = 0, load_bias = 0;
        int load_addr_set = 0;
        char * elf_interpreter = NULL;
@@ -40096,7 +42200,7 @@ diff -urNp linux-3.1.3/fs/binfmt_elf.c linux-3.1.3/fs/binfmt_elf.c
        struct elf_phdr *elf_ppnt, *elf_phdata;
        unsigned long elf_bss, elf_brk;
        int retval, i;
-@@ -572,11 +789,11 @@ static int load_elf_binary(struct linux_
+@@ -572,11 +789,11 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
        unsigned long start_code, end_code, start_data, end_data;
        unsigned long reloc_func_desc __maybe_unused = 0;
        int executable_stack = EXSTACK_DEFAULT;
@@ -40109,7 +42213,7 @@ diff -urNp linux-3.1.3/fs/binfmt_elf.c linux-3.1.3/fs/binfmt_elf.c
  
        loc = kmalloc(sizeof(*loc), GFP_KERNEL);
        if (!loc) {
-@@ -713,11 +930,81 @@ static int load_elf_binary(struct linux_
+@@ -713,11 +930,81 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
  
        /* OK, This is the point of no return */
        current->flags &= ~PF_FORKNOEXEC;
@@ -40192,7 +42296,7 @@ diff -urNp linux-3.1.3/fs/binfmt_elf.c linux-3.1.3/fs/binfmt_elf.c
        if (elf_read_implies_exec(loc->elf_ex, executable_stack))
                current->personality |= READ_IMPLIES_EXEC;
  
-@@ -808,6 +1095,20 @@ static int load_elf_binary(struct linux_
+@@ -808,6 +1095,20 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
  #else
                        load_bias = ELF_PAGESTART(ELF_ET_DYN_BASE - vaddr);
  #endif
@@ -40213,7 +42317,7 @@ diff -urNp linux-3.1.3/fs/binfmt_elf.c linux-3.1.3/fs/binfmt_elf.c
                }
  
                error = elf_map(bprm->file, load_bias + vaddr, elf_ppnt,
-@@ -840,9 +1141,9 @@ static int load_elf_binary(struct linux_
+@@ -840,9 +1141,9 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
                 * allowed task size. Note that p_filesz must always be
                 * <= p_memsz so it is only necessary to check p_memsz.
                 */
@@ -40226,7 +42330,7 @@ diff -urNp linux-3.1.3/fs/binfmt_elf.c linux-3.1.3/fs/binfmt_elf.c
                        /* set_brk can never work. Avoid overflows. */
                        send_sig(SIGKILL, current, 0);
                        retval = -EINVAL;
-@@ -870,6 +1171,11 @@ static int load_elf_binary(struct linux_
+@@ -870,6 +1171,11 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
        start_data += load_bias;
        end_data += load_bias;
  
@@ -40238,7 +42342,7 @@ diff -urNp linux-3.1.3/fs/binfmt_elf.c linux-3.1.3/fs/binfmt_elf.c
        /* Calling set_brk effectively mmaps the pages that we need
         * for the bss and break sections.  We must do this before
         * mapping in the interpreter, to make sure it doesn't wind
-@@ -881,9 +1187,11 @@ static int load_elf_binary(struct linux_
+@@ -881,9 +1187,11 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
                goto out_free_dentry;
        }
        if (likely(elf_bss != elf_brk) && unlikely(padzero(elf_bss))) {
@@ -40262,7 +42366,7 @@ diff -urNp linux-3.1.3/fs/binfmt_elf.c linux-3.1.3/fs/binfmt_elf.c
  {
  #define FILTER(type)  (mm_flags & (1UL << MMF_DUMP_##type))
  
-@@ -1132,7 +1440,7 @@ static unsigned long vma_dump_size(struc
+@@ -1132,7 +1440,7 @@ static unsigned long vma_dump_size(struct vm_area_struct *vma,
        if (vma->vm_file == NULL)
                return 0;
  
@@ -40271,7 +42375,7 @@ diff -urNp linux-3.1.3/fs/binfmt_elf.c linux-3.1.3/fs/binfmt_elf.c
                goto whole;
  
        /*
-@@ -1354,9 +1662,9 @@ static void fill_auxv_note(struct memelf
+@@ -1354,9 +1662,9 @@ static void fill_auxv_note(struct memelfnote *note, struct mm_struct *mm)
  {
        elf_addr_t *auxv = (elf_addr_t *) mm->saved_auxv;
        int i = 0;
@@ -40283,7 +42387,7 @@ diff -urNp linux-3.1.3/fs/binfmt_elf.c linux-3.1.3/fs/binfmt_elf.c
        fill_note(note, "CORE", NT_AUXV, i * sizeof(elf_addr_t), auxv);
  }
  
-@@ -1862,14 +2170,14 @@ static void fill_extnum_info(struct elfh
+@@ -1862,14 +2170,14 @@ static void fill_extnum_info(struct elfhdr *elf, struct elf_shdr *shdr4extnum,
  }
  
  static size_t elf_core_vma_data_size(struct vm_area_struct *gate_vma,
@@ -40300,7 +42404,7 @@ diff -urNp linux-3.1.3/fs/binfmt_elf.c linux-3.1.3/fs/binfmt_elf.c
        return size;
  }
  
-@@ -1963,7 +2271,7 @@ static int elf_core_dump(struct coredump
+@@ -1963,7 +2271,7 @@ static int elf_core_dump(struct coredump_params *cprm)
  
        dataoff = offset = roundup(offset, ELF_EXEC_PAGESIZE);
  
@@ -40309,7 +42413,7 @@ diff -urNp linux-3.1.3/fs/binfmt_elf.c linux-3.1.3/fs/binfmt_elf.c
        offset += elf_core_extra_data_size();
        e_shoff = offset;
  
-@@ -1977,10 +2285,12 @@ static int elf_core_dump(struct coredump
+@@ -1977,10 +2285,12 @@ static int elf_core_dump(struct coredump_params *cprm)
        offset = dataoff;
  
        size += sizeof(*elf);
@@ -40322,7 +42426,7 @@ diff -urNp linux-3.1.3/fs/binfmt_elf.c linux-3.1.3/fs/binfmt_elf.c
        if (size > cprm->limit
            || !dump_write(cprm->file, phdr4note, sizeof(*phdr4note)))
                goto end_coredump;
-@@ -1994,7 +2304,7 @@ static int elf_core_dump(struct coredump
+@@ -1994,7 +2304,7 @@ static int elf_core_dump(struct coredump_params *cprm)
                phdr.p_offset = offset;
                phdr.p_vaddr = vma->vm_start;
                phdr.p_paddr = 0;
@@ -40331,7 +42435,7 @@ diff -urNp linux-3.1.3/fs/binfmt_elf.c linux-3.1.3/fs/binfmt_elf.c
                phdr.p_memsz = vma->vm_end - vma->vm_start;
                offset += phdr.p_filesz;
                phdr.p_flags = vma->vm_flags & VM_READ ? PF_R : 0;
-@@ -2005,6 +2315,7 @@ static int elf_core_dump(struct coredump
+@@ -2005,6 +2315,7 @@ static int elf_core_dump(struct coredump_params *cprm)
                phdr.p_align = ELF_EXEC_PAGESIZE;
  
                size += sizeof(phdr);
@@ -40339,7 +42443,7 @@ diff -urNp linux-3.1.3/fs/binfmt_elf.c linux-3.1.3/fs/binfmt_elf.c
                if (size > cprm->limit
                    || !dump_write(cprm->file, &phdr, sizeof(phdr)))
                        goto end_coredump;
-@@ -2029,7 +2340,7 @@ static int elf_core_dump(struct coredump
+@@ -2029,7 +2340,7 @@ static int elf_core_dump(struct coredump_params *cprm)
                unsigned long addr;
                unsigned long end;
  
@@ -40348,7 +42452,7 @@ diff -urNp linux-3.1.3/fs/binfmt_elf.c linux-3.1.3/fs/binfmt_elf.c
  
                for (addr = vma->vm_start; addr < end; addr += PAGE_SIZE) {
                        struct page *page;
-@@ -2038,6 +2349,7 @@ static int elf_core_dump(struct coredump
+@@ -2038,6 +2349,7 @@ static int elf_core_dump(struct coredump_params *cprm)
                        page = get_dump_page(addr);
                        if (page) {
                                void *kaddr = kmap(page);
@@ -40356,7 +42460,7 @@ diff -urNp linux-3.1.3/fs/binfmt_elf.c linux-3.1.3/fs/binfmt_elf.c
                                stop = ((size += PAGE_SIZE) > cprm->limit) ||
                                        !dump_write(cprm->file, kaddr,
                                                    PAGE_SIZE);
-@@ -2055,6 +2367,7 @@ static int elf_core_dump(struct coredump
+@@ -2055,6 +2367,7 @@ static int elf_core_dump(struct coredump_params *cprm)
  
        if (e_phnum == PN_XNUM) {
                size += sizeof(*shdr4extnum);
@@ -40462,10 +42566,11 @@ diff -urNp linux-3.1.3/fs/binfmt_elf.c linux-3.1.3/fs/binfmt_elf.c
  static int __init init_elf_binfmt(void)
  {
        return register_binfmt(&elf_format);
-diff -urNp linux-3.1.3/fs/binfmt_flat.c linux-3.1.3/fs/binfmt_flat.c
---- linux-3.1.3/fs/binfmt_flat.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/binfmt_flat.c       2011-11-16 18:39:08.000000000 -0500
-@@ -567,7 +567,9 @@ static int load_flat_file(struct linux_b
+diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c
+index 1bffbe0..c8c283e 100644
+--- a/fs/binfmt_flat.c
++++ b/fs/binfmt_flat.c
+@@ -567,7 +567,9 @@ static int load_flat_file(struct linux_binprm * bprm,
                                realdatastart = (unsigned long) -ENOMEM;
                        printk("Unable to allocate RAM for process data, errno %d\n",
                                        (int)-realdatastart);
@@ -40475,7 +42580,7 @@ diff -urNp linux-3.1.3/fs/binfmt_flat.c linux-3.1.3/fs/binfmt_flat.c
                        ret = realdatastart;
                        goto err;
                }
-@@ -591,8 +593,10 @@ static int load_flat_file(struct linux_b
+@@ -591,8 +593,10 @@ static int load_flat_file(struct linux_binprm * bprm,
                }
                if (IS_ERR_VALUE(result)) {
                        printk("Unable to read data+bss, errno %d\n", (int)-result);
@@ -40486,7 +42591,7 @@ diff -urNp linux-3.1.3/fs/binfmt_flat.c linux-3.1.3/fs/binfmt_flat.c
                        ret = result;
                        goto err;
                }
-@@ -661,8 +665,10 @@ static int load_flat_file(struct linux_b
+@@ -661,8 +665,10 @@ static int load_flat_file(struct linux_binprm * bprm,
                }
                if (IS_ERR_VALUE(result)) {
                        printk("Unable to read code+data+bss, errno %d\n",(int)-result);
@@ -40497,10 +42602,11 @@ diff -urNp linux-3.1.3/fs/binfmt_flat.c linux-3.1.3/fs/binfmt_flat.c
                        ret = result;
                        goto err;
                }
-diff -urNp linux-3.1.3/fs/bio.c linux-3.1.3/fs/bio.c
---- linux-3.1.3/fs/bio.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/bio.c       2011-11-16 18:39:08.000000000 -0500
-@@ -1233,7 +1233,7 @@ static void bio_copy_kern_endio(struct b
+diff --git a/fs/bio.c b/fs/bio.c
+index 9bfade8..782f3b9 100644
+--- a/fs/bio.c
++++ b/fs/bio.c
+@@ -1233,7 +1233,7 @@ static void bio_copy_kern_endio(struct bio *bio, int err)
        const int read = bio_data_dir(bio) == READ;
        struct bio_map_data *bmd = bio->bi_private;
        int i;
@@ -40509,10 +42615,11 @@ diff -urNp linux-3.1.3/fs/bio.c linux-3.1.3/fs/bio.c
  
        __bio_for_each_segment(bvec, bio, i, 0) {
                char *addr = page_address(bvec->bv_page);
-diff -urNp linux-3.1.3/fs/block_dev.c linux-3.1.3/fs/block_dev.c
---- linux-3.1.3/fs/block_dev.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/block_dev.c 2011-11-16 18:39:08.000000000 -0500
-@@ -681,7 +681,7 @@ static bool bd_may_claim(struct block_de
+diff --git a/fs/block_dev.c b/fs/block_dev.c
+index 1c44b8d..e2507b4 100644
+--- a/fs/block_dev.c
++++ b/fs/block_dev.c
+@@ -681,7 +681,7 @@ static bool bd_may_claim(struct block_device *bdev, struct block_device *whole,
        else if (bdev->bd_contains == bdev)
                return true;     /* is a whole device which isn't held */
  
@@ -40521,10 +42628,11 @@ diff -urNp linux-3.1.3/fs/block_dev.c linux-3.1.3/fs/block_dev.c
                return true;     /* is a partition of a device that is being partitioned */
        else if (whole->bd_holder != NULL)
                return false;    /* is a partition of a held device */
-diff -urNp linux-3.1.3/fs/btrfs/ctree.c linux-3.1.3/fs/btrfs/ctree.c
---- linux-3.1.3/fs/btrfs/ctree.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/btrfs/ctree.c       2011-11-16 18:39:08.000000000 -0500
-@@ -488,9 +488,12 @@ static noinline int __btrfs_cow_block(st
+diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
+index 011cab3..9ace713 100644
+--- a/fs/btrfs/ctree.c
++++ b/fs/btrfs/ctree.c
+@@ -488,9 +488,12 @@ static noinline int __btrfs_cow_block(struct btrfs_trans_handle *trans,
                free_extent_buffer(buf);
                add_root_to_dirty_list(root);
        } else {
@@ -40540,9 +42648,10 @@ diff -urNp linux-3.1.3/fs/btrfs/ctree.c linux-3.1.3/fs/btrfs/ctree.c
                        parent_start = 0;
  
                WARN_ON(trans->transid != btrfs_header_generation(parent));
-diff -urNp linux-3.1.3/fs/btrfs/inode.c linux-3.1.3/fs/btrfs/inode.c
---- linux-3.1.3/fs/btrfs/inode.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/btrfs/inode.c       2011-11-17 18:12:11.000000000 -0500
+diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
+index b2d004a..6bb543d 100644
+--- a/fs/btrfs/inode.c
++++ b/fs/btrfs/inode.c
 @@ -6922,7 +6922,7 @@ fail:
        return -ENOMEM;
  }
@@ -40552,7 +42661,7 @@ diff -urNp linux-3.1.3/fs/btrfs/inode.c linux-3.1.3/fs/btrfs/inode.c
                         struct dentry *dentry, struct kstat *stat)
  {
        struct inode *inode = dentry->d_inode;
-@@ -6934,6 +6934,14 @@ static int btrfs_getattr(struct vfsmount
+@@ -6934,6 +6934,14 @@ static int btrfs_getattr(struct vfsmount *mnt,
        return 0;
  }
  
@@ -40567,10 +42676,11 @@ diff -urNp linux-3.1.3/fs/btrfs/inode.c linux-3.1.3/fs/btrfs/inode.c
  /*
   * If a file is moved, it will inherit the cow and compression flags of the new
   * directory.
-diff -urNp linux-3.1.3/fs/btrfs/ioctl.c linux-3.1.3/fs/btrfs/ioctl.c
---- linux-3.1.3/fs/btrfs/ioctl.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/btrfs/ioctl.c       2011-11-16 18:40:29.000000000 -0500
-@@ -2704,9 +2704,12 @@ long btrfs_ioctl_space_info(struct btrfs
+diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
+index dae5dfe..6aa01b1 100644
+--- a/fs/btrfs/ioctl.c
++++ b/fs/btrfs/ioctl.c
+@@ -2704,9 +2704,12 @@ long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg)
        for (i = 0; i < num_types; i++) {
                struct btrfs_space_info *tmp;
  
@@ -40583,7 +42693,7 @@ diff -urNp linux-3.1.3/fs/btrfs/ioctl.c linux-3.1.3/fs/btrfs/ioctl.c
                info = NULL;
                rcu_read_lock();
                list_for_each_entry_rcu(tmp, &root->fs_info->space_info,
-@@ -2728,15 +2731,12 @@ long btrfs_ioctl_space_info(struct btrfs
+@@ -2728,15 +2731,12 @@ long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg)
                                memcpy(dest, &space, sizeof(space));
                                dest++;
                                space_args.total_spaces++;
@@ -40600,10 +42710,11 @@ diff -urNp linux-3.1.3/fs/btrfs/ioctl.c linux-3.1.3/fs/btrfs/ioctl.c
                (arg + sizeof(struct btrfs_ioctl_space_args));
  
        if (copy_to_user(user_dest, dest_orig, alloc_size))
-diff -urNp linux-3.1.3/fs/btrfs/relocation.c linux-3.1.3/fs/btrfs/relocation.c
---- linux-3.1.3/fs/btrfs/relocation.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/btrfs/relocation.c  2011-11-16 18:39:08.000000000 -0500
-@@ -1242,7 +1242,7 @@ static int __update_reloc_root(struct bt
+diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
+index 59bb176..be9977d 100644
+--- a/fs/btrfs/relocation.c
++++ b/fs/btrfs/relocation.c
+@@ -1242,7 +1242,7 @@ static int __update_reloc_root(struct btrfs_root *root, int del)
        }
        spin_unlock(&rc->reloc_root_tree.lock);
  
@@ -40612,10 +42723,11 @@ diff -urNp linux-3.1.3/fs/btrfs/relocation.c linux-3.1.3/fs/btrfs/relocation.c
  
        if (!del) {
                spin_lock(&rc->reloc_root_tree.lock);
-diff -urNp linux-3.1.3/fs/cachefiles/bind.c linux-3.1.3/fs/cachefiles/bind.c
---- linux-3.1.3/fs/cachefiles/bind.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/cachefiles/bind.c   2011-11-16 18:39:08.000000000 -0500
-@@ -39,13 +39,11 @@ int cachefiles_daemon_bind(struct cachef
+diff --git a/fs/cachefiles/bind.c b/fs/cachefiles/bind.c
+index 622f469..e8d2d55 100644
+--- a/fs/cachefiles/bind.c
++++ b/fs/cachefiles/bind.c
+@@ -39,13 +39,11 @@ int cachefiles_daemon_bind(struct cachefiles_cache *cache, char *args)
               args);
  
        /* start by checking things over */
@@ -40631,10 +42743,11 @@ diff -urNp linux-3.1.3/fs/cachefiles/bind.c linux-3.1.3/fs/cachefiles/bind.c
               cache->bcull_percent < cache->brun_percent &&
               cache->brun_percent  < 100);
  
-diff -urNp linux-3.1.3/fs/cachefiles/daemon.c linux-3.1.3/fs/cachefiles/daemon.c
---- linux-3.1.3/fs/cachefiles/daemon.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/cachefiles/daemon.c 2011-11-16 18:39:08.000000000 -0500
-@@ -196,7 +196,7 @@ static ssize_t cachefiles_daemon_read(st
+diff --git a/fs/cachefiles/daemon.c b/fs/cachefiles/daemon.c
+index 0a1467b..6a53245 100644
+--- a/fs/cachefiles/daemon.c
++++ b/fs/cachefiles/daemon.c
+@@ -196,7 +196,7 @@ static ssize_t cachefiles_daemon_read(struct file *file, char __user *_buffer,
        if (n > buflen)
                return -EMSGSIZE;
  
@@ -40643,7 +42756,7 @@ diff -urNp linux-3.1.3/fs/cachefiles/daemon.c linux-3.1.3/fs/cachefiles/daemon.c
                return -EFAULT;
  
        return n;
-@@ -222,7 +222,7 @@ static ssize_t cachefiles_daemon_write(s
+@@ -222,7 +222,7 @@ static ssize_t cachefiles_daemon_write(struct file *file,
        if (test_bit(CACHEFILES_DEAD, &cache->flags))
                return -EIO;
  
@@ -40652,7 +42765,7 @@ diff -urNp linux-3.1.3/fs/cachefiles/daemon.c linux-3.1.3/fs/cachefiles/daemon.c
                return -EOPNOTSUPP;
  
        /* drag the command string into the kernel so we can parse it */
-@@ -386,7 +386,7 @@ static int cachefiles_daemon_fstop(struc
+@@ -386,7 +386,7 @@ static int cachefiles_daemon_fstop(struct cachefiles_cache *cache, char *args)
        if (args[0] != '%' || args[1] != '\0')
                return -EINVAL;
  
@@ -40661,7 +42774,7 @@ diff -urNp linux-3.1.3/fs/cachefiles/daemon.c linux-3.1.3/fs/cachefiles/daemon.c
                return cachefiles_daemon_range_error(cache, args);
  
        cache->fstop_percent = fstop;
-@@ -458,7 +458,7 @@ static int cachefiles_daemon_bstop(struc
+@@ -458,7 +458,7 @@ static int cachefiles_daemon_bstop(struct cachefiles_cache *cache, char *args)
        if (args[0] != '%' || args[1] != '\0')
                return -EINVAL;
  
@@ -40670,9 +42783,10 @@ diff -urNp linux-3.1.3/fs/cachefiles/daemon.c linux-3.1.3/fs/cachefiles/daemon.c
                return cachefiles_daemon_range_error(cache, args);
  
        cache->bstop_percent = bstop;
-diff -urNp linux-3.1.3/fs/cachefiles/internal.h linux-3.1.3/fs/cachefiles/internal.h
---- linux-3.1.3/fs/cachefiles/internal.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/cachefiles/internal.h       2011-11-16 18:39:08.000000000 -0500
+diff --git a/fs/cachefiles/internal.h b/fs/cachefiles/internal.h
+index bd6bc1b..b627b53 100644
+--- a/fs/cachefiles/internal.h
++++ b/fs/cachefiles/internal.h
 @@ -57,7 +57,7 @@ struct cachefiles_cache {
        wait_queue_head_t               daemon_pollwq;  /* poll waitqueue for daemon */
        struct rb_root                  active_nodes;   /* active nodes (can't be culled) */
@@ -40682,7 +42796,7 @@ diff -urNp linux-3.1.3/fs/cachefiles/internal.h linux-3.1.3/fs/cachefiles/intern
        unsigned                        frun_percent;   /* when to stop culling (% files) */
        unsigned                        fcull_percent;  /* when to start culling (% files) */
        unsigned                        fstop_percent;  /* when to stop allocating (% files) */
-@@ -169,19 +169,19 @@ extern int cachefiles_check_in_use(struc
+@@ -169,19 +169,19 @@ extern int cachefiles_check_in_use(struct cachefiles_cache *cache,
   * proc.c
   */
  #ifdef CONFIG_CACHEFILES_HISTOGRAM
@@ -40707,9 +42821,10 @@ diff -urNp linux-3.1.3/fs/cachefiles/internal.h linux-3.1.3/fs/cachefiles/intern
  }
  
  #else
-diff -urNp linux-3.1.3/fs/cachefiles/namei.c linux-3.1.3/fs/cachefiles/namei.c
---- linux-3.1.3/fs/cachefiles/namei.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/cachefiles/namei.c  2011-11-16 18:39:08.000000000 -0500
+diff --git a/fs/cachefiles/namei.c b/fs/cachefiles/namei.c
+index a0358c2..d6137f2 100644
+--- a/fs/cachefiles/namei.c
++++ b/fs/cachefiles/namei.c
 @@ -318,7 +318,7 @@ try_again:
        /* first step is to make up a grave dentry in the graveyard */
        sprintf(nbuffer, "%08x%08x",
@@ -40719,9 +42834,10 @@ diff -urNp linux-3.1.3/fs/cachefiles/namei.c linux-3.1.3/fs/cachefiles/namei.c
  
        /* do the multiway lock magic */
        trap = lock_rename(cache->graveyard, dir);
-diff -urNp linux-3.1.3/fs/cachefiles/proc.c linux-3.1.3/fs/cachefiles/proc.c
---- linux-3.1.3/fs/cachefiles/proc.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/cachefiles/proc.c   2011-11-16 18:39:08.000000000 -0500
+diff --git a/fs/cachefiles/proc.c b/fs/cachefiles/proc.c
+index eccd339..4c1d995 100644
+--- a/fs/cachefiles/proc.c
++++ b/fs/cachefiles/proc.c
 @@ -14,9 +14,9 @@
  #include <linux/seq_file.h>
  #include "internal.h"
@@ -40735,7 +42851,7 @@ diff -urNp linux-3.1.3/fs/cachefiles/proc.c linux-3.1.3/fs/cachefiles/proc.c
  
  /*
   * display the latency histogram
-@@ -35,9 +35,9 @@ static int cachefiles_histogram_show(str
+@@ -35,9 +35,9 @@ static int cachefiles_histogram_show(struct seq_file *m, void *v)
                return 0;
        default:
                index = (unsigned long) v - 3;
@@ -40748,10 +42864,11 @@ diff -urNp linux-3.1.3/fs/cachefiles/proc.c linux-3.1.3/fs/cachefiles/proc.c
                if (x == 0 && y == 0 && z == 0)
                        return 0;
  
-diff -urNp linux-3.1.3/fs/cachefiles/rdwr.c linux-3.1.3/fs/cachefiles/rdwr.c
---- linux-3.1.3/fs/cachefiles/rdwr.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/cachefiles/rdwr.c   2011-11-16 18:39:08.000000000 -0500
-@@ -945,7 +945,7 @@ int cachefiles_write_page(struct fscache
+diff --git a/fs/cachefiles/rdwr.c b/fs/cachefiles/rdwr.c
+index 0e3c092..818480e 100644
+--- a/fs/cachefiles/rdwr.c
++++ b/fs/cachefiles/rdwr.c
+@@ -945,7 +945,7 @@ int cachefiles_write_page(struct fscache_storage *op, struct page *page)
                        old_fs = get_fs();
                        set_fs(KERNEL_DS);
                        ret = file->f_op->write(
@@ -40760,10 +42877,11 @@ diff -urNp linux-3.1.3/fs/cachefiles/rdwr.c linux-3.1.3/fs/cachefiles/rdwr.c
                        set_fs(old_fs);
                        kunmap(page);
                        if (ret != len)
-diff -urNp linux-3.1.3/fs/ceph/dir.c linux-3.1.3/fs/ceph/dir.c
---- linux-3.1.3/fs/ceph/dir.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/ceph/dir.c  2011-11-16 18:39:08.000000000 -0500
-@@ -244,7 +244,7 @@ static int ceph_readdir(struct file *fil
+diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
+index 382abc9..bd89646 100644
+--- a/fs/ceph/dir.c
++++ b/fs/ceph/dir.c
+@@ -244,7 +244,7 @@ static int ceph_readdir(struct file *filp, void *dirent, filldir_t filldir)
        struct ceph_fs_client *fsc = ceph_inode_to_client(inode);
        struct ceph_mds_client *mdsc = fsc->mdsc;
        unsigned frag = fpos_frag(filp->f_pos);
@@ -40772,10 +42890,11 @@ diff -urNp linux-3.1.3/fs/ceph/dir.c linux-3.1.3/fs/ceph/dir.c
        int err;
        u32 ftype;
        struct ceph_mds_reply_info_parsed *rinfo;
-diff -urNp linux-3.1.3/fs/cifs/cifs_debug.c linux-3.1.3/fs/cifs/cifs_debug.c
---- linux-3.1.3/fs/cifs/cifs_debug.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/cifs/cifs_debug.c   2011-11-16 18:39:08.000000000 -0500
-@@ -265,8 +265,8 @@ static ssize_t cifs_stats_proc_write(str
+diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
+index 6d40656..bc1f825 100644
+--- a/fs/cifs/cifs_debug.c
++++ b/fs/cifs/cifs_debug.c
+@@ -265,8 +265,8 @@ static ssize_t cifs_stats_proc_write(struct file *file,
  
        if (c == '1' || c == 'y' || c == 'Y' || c == '0') {
  #ifdef CONFIG_CIFS_STATS2
@@ -40786,7 +42905,7 @@ diff -urNp linux-3.1.3/fs/cifs/cifs_debug.c linux-3.1.3/fs/cifs/cifs_debug.c
  #endif /* CONFIG_CIFS_STATS2 */
                spin_lock(&cifs_tcp_ses_lock);
                list_for_each(tmp1, &cifs_tcp_ses_list) {
-@@ -279,25 +279,25 @@ static ssize_t cifs_stats_proc_write(str
+@@ -279,25 +279,25 @@ static ssize_t cifs_stats_proc_write(struct file *file,
                                        tcon = list_entry(tmp3,
                                                          struct cifs_tcon,
                                                          tcon_list);
@@ -40831,7 +42950,7 @@ diff -urNp linux-3.1.3/fs/cifs/cifs_debug.c linux-3.1.3/fs/cifs/cifs_debug.c
                                }
                        }
                }
-@@ -327,8 +327,8 @@ static int cifs_stats_proc_show(struct s
+@@ -327,8 +327,8 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v)
                        smBufAllocCount.counter, cifs_min_small);
  #ifdef CONFIG_CIFS_STATS2
        seq_printf(m, "Total Large %d Small %d Allocations\n",
@@ -40842,7 +42961,7 @@ diff -urNp linux-3.1.3/fs/cifs/cifs_debug.c linux-3.1.3/fs/cifs/cifs_debug.c
  #endif /* CONFIG_CIFS_STATS2 */
  
        seq_printf(m, "Operations (MIDs): %d\n", atomic_read(&midCount));
-@@ -357,41 +357,41 @@ static int cifs_stats_proc_show(struct s
+@@ -357,41 +357,41 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v)
                                if (tcon->need_reconnect)
                                        seq_puts(m, "\tDISCONNECTED ");
                                seq_printf(m, "\nSMBs: %d Oplock Breaks: %d",
@@ -40904,9 +43023,10 @@ diff -urNp linux-3.1.3/fs/cifs/cifs_debug.c linux-3.1.3/fs/cifs/cifs_debug.c
                        }
                }
        }
-diff -urNp linux-3.1.3/fs/cifs/cifsfs.c linux-3.1.3/fs/cifs/cifsfs.c
---- linux-3.1.3/fs/cifs/cifsfs.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/cifs/cifsfs.c       2011-11-16 18:39:08.000000000 -0500
+diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
+index 54b8f1e..f6a4c00 100644
+--- a/fs/cifs/cifsfs.c
++++ b/fs/cifs/cifsfs.c
 @@ -981,7 +981,7 @@ cifs_init_request_bufs(void)
        cifs_req_cachep = kmem_cache_create("cifs_request",
                                            CIFSMaxBufSize +
@@ -40936,9 +43056,10 @@ diff -urNp linux-3.1.3/fs/cifs/cifsfs.c linux-3.1.3/fs/cifs/cifsfs.c
  #endif /* CONFIG_CIFS_STATS2 */
  
        atomic_set(&midCount, 0);
-diff -urNp linux-3.1.3/fs/cifs/cifsglob.h linux-3.1.3/fs/cifs/cifsglob.h
---- linux-3.1.3/fs/cifs/cifsglob.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/cifs/cifsglob.h     2011-11-16 18:39:08.000000000 -0500
+diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
+index 95dad9d..fe7af1a 100644
+--- a/fs/cifs/cifsglob.h
++++ b/fs/cifs/cifsglob.h
 @@ -381,28 +381,28 @@ struct cifs_tcon {
        __u16 Flags;            /* optional support bits */
        enum statusEnum tidStatus;
@@ -40990,7 +43111,7 @@ diff -urNp linux-3.1.3/fs/cifs/cifsglob.h linux-3.1.3/fs/cifs/cifsglob.h
  #ifdef CONFIG_CIFS_STATS2
        unsigned long long time_writes;
        unsigned long long time_reads;
-@@ -613,7 +613,7 @@ convert_delimiter(char *path, char delim
+@@ -613,7 +613,7 @@ convert_delimiter(char *path, char delim)
  }
  
  #ifdef CONFIG_CIFS_STATS
@@ -40999,7 +43120,7 @@ diff -urNp linux-3.1.3/fs/cifs/cifsglob.h linux-3.1.3/fs/cifs/cifsglob.h
  
  static inline void cifs_stats_bytes_written(struct cifs_tcon *tcon,
                                            unsigned int bytes)
-@@ -953,8 +953,8 @@ GLOBAL_EXTERN atomic_t tconInfoReconnect
+@@ -953,8 +953,8 @@ GLOBAL_EXTERN atomic_t tconInfoReconnectCount;
  /* Various Debug counters */
  GLOBAL_EXTERN atomic_t bufAllocCount;    /* current number allocated  */
  #ifdef CONFIG_CIFS_STATS2
@@ -41010,9 +43131,10 @@ diff -urNp linux-3.1.3/fs/cifs/cifsglob.h linux-3.1.3/fs/cifs/cifsglob.h
  #endif
  GLOBAL_EXTERN atomic_t smBufAllocCount;
  GLOBAL_EXTERN atomic_t midCount;
-diff -urNp linux-3.1.3/fs/cifs/link.c linux-3.1.3/fs/cifs/link.c
---- linux-3.1.3/fs/cifs/link.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/cifs/link.c 2011-11-16 18:39:08.000000000 -0500
+diff --git a/fs/cifs/link.c b/fs/cifs/link.c
+index db3f18c..1f5955e 100644
+--- a/fs/cifs/link.c
++++ b/fs/cifs/link.c
 @@ -593,7 +593,7 @@ symlink_exit:
  
  void cifs_put_link(struct dentry *direntry, struct nameidata *nd, void *cookie)
@@ -41022,9 +43144,10 @@ diff -urNp linux-3.1.3/fs/cifs/link.c linux-3.1.3/fs/cifs/link.c
        if (!IS_ERR(p))
                kfree(p);
  }
-diff -urNp linux-3.1.3/fs/cifs/misc.c linux-3.1.3/fs/cifs/misc.c
---- linux-3.1.3/fs/cifs/misc.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/cifs/misc.c 2011-11-16 18:39:08.000000000 -0500
+diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
+index 7c16933..c8212b5 100644
+--- a/fs/cifs/misc.c
++++ b/fs/cifs/misc.c
 @@ -156,7 +156,7 @@ cifs_buf_get(void)
                memset(ret_buf, 0, sizeof(struct smb_hdr) + 3);
                atomic_inc(&bufAllocCount);
@@ -41043,9 +43166,10 @@ diff -urNp linux-3.1.3/fs/cifs/misc.c linux-3.1.3/fs/cifs/misc.c
  #endif /* CONFIG_CIFS_STATS2 */
  
        }
-diff -urNp linux-3.1.3/fs/coda/cache.c linux-3.1.3/fs/coda/cache.c
---- linux-3.1.3/fs/coda/cache.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/coda/cache.c        2011-11-16 18:39:08.000000000 -0500
+diff --git a/fs/coda/cache.c b/fs/coda/cache.c
+index 6901578..d402eb5 100644
+--- a/fs/coda/cache.c
++++ b/fs/coda/cache.c
 @@ -24,7 +24,7 @@
  #include "coda_linux.h"
  #include "coda_cache.h"
@@ -41055,7 +43179,7 @@ diff -urNp linux-3.1.3/fs/coda/cache.c linux-3.1.3/fs/coda/cache.c
  
  /* replace or extend an acl cache hit */
  void coda_cache_enter(struct inode *inode, int mask)
-@@ -32,7 +32,7 @@ void coda_cache_enter(struct inode *inod
+@@ -32,7 +32,7 @@ void coda_cache_enter(struct inode *inode, int mask)
        struct coda_inode_info *cii = ITOC(inode);
  
        spin_lock(&cii->c_lock);
@@ -41064,7 +43188,7 @@ diff -urNp linux-3.1.3/fs/coda/cache.c linux-3.1.3/fs/coda/cache.c
        if (cii->c_uid != current_fsuid()) {
                cii->c_uid = current_fsuid();
                  cii->c_cached_perm = mask;
-@@ -46,14 +46,14 @@ void coda_cache_clear_inode(struct inode
+@@ -46,14 +46,14 @@ void coda_cache_clear_inode(struct inode *inode)
  {
        struct coda_inode_info *cii = ITOC(inode);
        spin_lock(&cii->c_lock);
@@ -41081,7 +43205,7 @@ diff -urNp linux-3.1.3/fs/coda/cache.c linux-3.1.3/fs/coda/cache.c
  }
  
  
-@@ -66,7 +66,7 @@ int coda_cache_check(struct inode *inode
+@@ -66,7 +66,7 @@ int coda_cache_check(struct inode *inode, int mask)
        spin_lock(&cii->c_lock);
        hit = (mask & cii->c_cached_perm) == mask &&
            cii->c_uid == current_fsuid() &&
@@ -41090,27 +43214,11 @@ diff -urNp linux-3.1.3/fs/coda/cache.c linux-3.1.3/fs/coda/cache.c
        spin_unlock(&cii->c_lock);
  
        return hit;
-diff -urNp linux-3.1.3/fs/compat_binfmt_elf.c linux-3.1.3/fs/compat_binfmt_elf.c
---- linux-3.1.3/fs/compat_binfmt_elf.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/compat_binfmt_elf.c 2011-11-16 18:39:08.000000000 -0500
-@@ -30,11 +30,13 @@
- #undef        elf_phdr
- #undef        elf_shdr
- #undef        elf_note
-+#undef        elf_dyn
- #undef        elf_addr_t
- #define elfhdr                elf32_hdr
- #define elf_phdr      elf32_phdr
- #define elf_shdr      elf32_shdr
- #define elf_note      elf32_note
-+#define elf_dyn               Elf32_Dyn
- #define elf_addr_t    Elf32_Addr
- /*
-diff -urNp linux-3.1.3/fs/compat.c linux-3.1.3/fs/compat.c
---- linux-3.1.3/fs/compat.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/compat.c    2011-11-16 18:40:29.000000000 -0500
-@@ -133,8 +133,8 @@ asmlinkage long compat_sys_utimes(const 
+diff --git a/fs/compat.c b/fs/compat.c
+index 58b1da4..afcd9b8 100644
+--- a/fs/compat.c
++++ b/fs/compat.c
+@@ -133,8 +133,8 @@ asmlinkage long compat_sys_utimes(const char __user *filename, struct compat_tim
  static int cp_compat_stat(struct kstat *stat, struct compat_stat __user *ubuf)
  {
        compat_ino_t ino = stat->ino;
@@ -41121,7 +43229,7 @@ diff -urNp linux-3.1.3/fs/compat.c linux-3.1.3/fs/compat.c
        int err;
  
        SET_UID(uid, stat->uid);
-@@ -508,7 +508,7 @@ compat_sys_io_setup(unsigned nr_reqs, u3
+@@ -508,7 +508,7 @@ compat_sys_io_setup(unsigned nr_reqs, u32 __user *ctx32p)
  
        set_fs(KERNEL_DS);
        /* The __user pointer cast is valid because of the set_fs() */
@@ -41130,7 +43238,7 @@ diff -urNp linux-3.1.3/fs/compat.c linux-3.1.3/fs/compat.c
        set_fs(oldfs);
        /* truncating is ok because it's a user address */
        if (!ret)
-@@ -566,7 +566,7 @@ ssize_t compat_rw_copy_check_uvector(int
+@@ -566,7 +566,7 @@ ssize_t compat_rw_copy_check_uvector(int type,
                goto out;
  
        ret = -EINVAL;
@@ -41147,7 +43255,7 @@ diff -urNp linux-3.1.3/fs/compat.c linux-3.1.3/fs/compat.c
        int result;
  };
  
-@@ -865,6 +866,10 @@ static int compat_fillonedir(void *__buf
+@@ -865,6 +866,10 @@ static int compat_fillonedir(void *__buf, const char *name, int namlen,
                buf->result = -EOVERFLOW;
                return -EOVERFLOW;
        }
@@ -41158,7 +43266,7 @@ diff -urNp linux-3.1.3/fs/compat.c linux-3.1.3/fs/compat.c
        buf->result++;
        dirent = buf->dirent;
        if (!access_ok(VERIFY_WRITE, dirent,
-@@ -897,6 +902,7 @@ asmlinkage long compat_sys_old_readdir(u
+@@ -897,6 +902,7 @@ asmlinkage long compat_sys_old_readdir(unsigned int fd,
  
        buf.result = 0;
        buf.dirent = dirent;
@@ -41174,7 +43282,7 @@ diff -urNp linux-3.1.3/fs/compat.c linux-3.1.3/fs/compat.c
        int count;
        int error;
  };
-@@ -938,6 +945,10 @@ static int compat_filldir(void *__buf, c
+@@ -938,6 +945,10 @@ static int compat_filldir(void *__buf, const char *name, int namlen,
                buf->error = -EOVERFLOW;
                return -EOVERFLOW;
        }
@@ -41185,7 +43293,7 @@ diff -urNp linux-3.1.3/fs/compat.c linux-3.1.3/fs/compat.c
        dirent = buf->previous;
        if (dirent) {
                if (__put_user(offset, &dirent->d_off))
-@@ -985,6 +996,7 @@ asmlinkage long compat_sys_getdents(unsi
+@@ -985,6 +996,7 @@ asmlinkage long compat_sys_getdents(unsigned int fd,
        buf.previous = NULL;
        buf.count = count;
        buf.error = 0;
@@ -41201,7 +43309,7 @@ diff -urNp linux-3.1.3/fs/compat.c linux-3.1.3/fs/compat.c
        int count;
        int error;
  };
-@@ -1022,6 +1035,10 @@ static int compat_filldir64(void * __buf
+@@ -1022,6 +1035,10 @@ static int compat_filldir64(void * __buf, const char * name, int namlen, loff_t
        buf->error = -EINVAL;   /* only used if we fail.. */
        if (reclen > buf->count)
                return -EINVAL;
@@ -41212,7 +43320,7 @@ diff -urNp linux-3.1.3/fs/compat.c linux-3.1.3/fs/compat.c
        dirent = buf->previous;
  
        if (dirent) {
-@@ -1073,13 +1090,14 @@ asmlinkage long compat_sys_getdents64(un
+@@ -1073,13 +1090,14 @@ asmlinkage long compat_sys_getdents64(unsigned int fd,
        buf.previous = NULL;
        buf.count = count;
        buf.error = 0;
@@ -41228,7 +43336,7 @@ diff -urNp linux-3.1.3/fs/compat.c linux-3.1.3/fs/compat.c
                if (__put_user_unaligned(d_off, &lastdirent->d_off))
                        error = -EFAULT;
                else
-@@ -1446,6 +1464,8 @@ int compat_core_sys_select(int n, compat
+@@ -1446,6 +1464,8 @@ int compat_core_sys_select(int n, compat_ulong_t __user *inp,
        struct fdtable *fdt;
        long stack_fds[SELECT_STACK_ALLOC/sizeof(long)];
  
@@ -41237,10 +43345,29 @@ diff -urNp linux-3.1.3/fs/compat.c linux-3.1.3/fs/compat.c
        if (n < 0)
                goto out_nofds;
  
-diff -urNp linux-3.1.3/fs/compat_ioctl.c linux-3.1.3/fs/compat_ioctl.c
---- linux-3.1.3/fs/compat_ioctl.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/compat_ioctl.c      2011-11-16 18:39:08.000000000 -0500
-@@ -210,6 +210,8 @@ static int do_video_set_spu_palette(unsi
+diff --git a/fs/compat_binfmt_elf.c b/fs/compat_binfmt_elf.c
+index 112e45a..b59845b 100644
+--- a/fs/compat_binfmt_elf.c
++++ b/fs/compat_binfmt_elf.c
+@@ -30,11 +30,13 @@
+ #undef        elf_phdr
+ #undef        elf_shdr
+ #undef        elf_note
++#undef        elf_dyn
+ #undef        elf_addr_t
+ #define elfhdr                elf32_hdr
+ #define elf_phdr      elf32_phdr
+ #define elf_shdr      elf32_shdr
+ #define elf_note      elf32_note
++#define elf_dyn               Elf32_Dyn
+ #define elf_addr_t    Elf32_Addr
+ /*
+diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
+index 51352de..93292ff 100644
+--- a/fs/compat_ioctl.c
++++ b/fs/compat_ioctl.c
+@@ -210,6 +210,8 @@ static int do_video_set_spu_palette(unsigned int fd, unsigned int cmd,
  
        err  = get_user(palp, &up->palette);
        err |= get_user(length, &up->length);
@@ -41249,7 +43376,7 @@ diff -urNp linux-3.1.3/fs/compat_ioctl.c linux-3.1.3/fs/compat_ioctl.c
  
        up_native = compat_alloc_user_space(sizeof(struct video_spu_palette));
        err  = put_user(compat_ptr(palp), &up_native->palette);
-@@ -621,7 +623,7 @@ static int serial_struct_ioctl(unsigned 
+@@ -621,7 +623,7 @@ static int serial_struct_ioctl(unsigned fd, unsigned cmd,
                        return -EFAULT;
                  if (__get_user(udata, &ss32->iomem_base))
                        return -EFAULT;
@@ -41258,7 +43385,7 @@ diff -urNp linux-3.1.3/fs/compat_ioctl.c linux-3.1.3/fs/compat_ioctl.c
                  if (__get_user(ss.iomem_reg_shift, &ss32->iomem_reg_shift) ||
                    __get_user(ss.port_high, &ss32->port_high))
                        return -EFAULT;
-@@ -796,7 +798,7 @@ static int compat_ioctl_preallocate(stru
+@@ -796,7 +798,7 @@ static int compat_ioctl_preallocate(struct file *file,
            copy_in_user(&p->l_len,     &p32->l_len,    sizeof(s64)) ||
            copy_in_user(&p->l_sysid,   &p32->l_sysid,  sizeof(s32)) ||
            copy_in_user(&p->l_pid,     &p32->l_pid,    sizeof(u32)) ||
@@ -41267,7 +43394,7 @@ diff -urNp linux-3.1.3/fs/compat_ioctl.c linux-3.1.3/fs/compat_ioctl.c
                return -EFAULT;
  
        return ioctl_preallocate(file, p);
-@@ -1644,8 +1646,8 @@ asmlinkage long compat_sys_ioctl(unsigne
+@@ -1644,8 +1646,8 @@ asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd,
  static int __init init_sys32_ioctl_cmp(const void *p, const void *q)
  {
        unsigned int a, b;
@@ -41278,10 +43405,11 @@ diff -urNp linux-3.1.3/fs/compat_ioctl.c linux-3.1.3/fs/compat_ioctl.c
        if (a > b)
                return 1;
        if (a < b)
-diff -urNp linux-3.1.3/fs/configfs/dir.c linux-3.1.3/fs/configfs/dir.c
---- linux-3.1.3/fs/configfs/dir.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/configfs/dir.c      2011-11-16 18:39:08.000000000 -0500
-@@ -1575,7 +1575,8 @@ static int configfs_readdir(struct file 
+diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c
+index 9a37a9b..35792b6 100644
+--- a/fs/configfs/dir.c
++++ b/fs/configfs/dir.c
+@@ -1575,7 +1575,8 @@ static int configfs_readdir(struct file * filp, void * dirent, filldir_t filldir
                        }
                        for (p=q->next; p!= &parent_sd->s_children; p=p->next) {
                                struct configfs_dirent *next;
@@ -41291,7 +43419,7 @@ diff -urNp linux-3.1.3/fs/configfs/dir.c linux-3.1.3/fs/configfs/dir.c
                                int len;
                                struct inode *inode = NULL;
  
-@@ -1585,7 +1586,12 @@ static int configfs_readdir(struct file 
+@@ -1585,7 +1586,12 @@ static int configfs_readdir(struct file * filp, void * dirent, filldir_t filldir
                                        continue;
  
                                name = configfs_get_name(next);
@@ -41305,10 +43433,11 @@ diff -urNp linux-3.1.3/fs/configfs/dir.c linux-3.1.3/fs/configfs/dir.c
  
                                /*
                                 * We'll have a dentry and an inode for
-diff -urNp linux-3.1.3/fs/dcache.c linux-3.1.3/fs/dcache.c
---- linux-3.1.3/fs/dcache.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/dcache.c    2011-11-16 18:39:08.000000000 -0500
-@@ -2998,7 +2998,7 @@ void __init vfs_caches_init(unsigned lon
+diff --git a/fs/dcache.c b/fs/dcache.c
+index a88948b..1e32160 100644
+--- a/fs/dcache.c
++++ b/fs/dcache.c
+@@ -2998,7 +2998,7 @@ void __init vfs_caches_init(unsigned long mempages)
        mempages -= reserve;
  
        names_cachep = kmem_cache_create("names_cache", PATH_MAX, 0,
@@ -41317,10 +43446,11 @@ diff -urNp linux-3.1.3/fs/dcache.c linux-3.1.3/fs/dcache.c
  
        dcache_init();
        inode_init();
-diff -urNp linux-3.1.3/fs/ecryptfs/inode.c linux-3.1.3/fs/ecryptfs/inode.c
---- linux-3.1.3/fs/ecryptfs/inode.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/ecryptfs/inode.c    2011-11-16 18:39:08.000000000 -0500
-@@ -681,7 +681,7 @@ static int ecryptfs_readlink_lower(struc
+diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
+index 528da01..bd8c23d 100644
+--- a/fs/ecryptfs/inode.c
++++ b/fs/ecryptfs/inode.c
+@@ -691,7 +691,7 @@ static int ecryptfs_readlink_lower(struct dentry *dentry, char **buf,
        old_fs = get_fs();
        set_fs(get_ds());
        rc = lower_dentry->d_inode->i_op->readlink(lower_dentry,
@@ -41329,7 +43459,7 @@ diff -urNp linux-3.1.3/fs/ecryptfs/inode.c linux-3.1.3/fs/ecryptfs/inode.c
                                                   lower_bufsiz);
        set_fs(old_fs);
        if (rc < 0)
-@@ -727,7 +727,7 @@ static void *ecryptfs_follow_link(struct
+@@ -737,7 +737,7 @@ static void *ecryptfs_follow_link(struct dentry *dentry, struct nameidata *nd)
        }
        old_fs = get_fs();
        set_fs(get_ds());
@@ -41338,7 +43468,7 @@ diff -urNp linux-3.1.3/fs/ecryptfs/inode.c linux-3.1.3/fs/ecryptfs/inode.c
        set_fs(old_fs);
        if (rc < 0) {
                kfree(buf);
-@@ -742,7 +742,7 @@ out:
+@@ -752,7 +752,7 @@ out:
  static void
  ecryptfs_put_link(struct dentry *dentry, struct nameidata *nd, void *ptr)
  {
@@ -41347,9 +43477,10 @@ diff -urNp linux-3.1.3/fs/ecryptfs/inode.c linux-3.1.3/fs/ecryptfs/inode.c
        if (!IS_ERR(buf)) {
                /* Free the char* */
                kfree(buf);
-diff -urNp linux-3.1.3/fs/ecryptfs/miscdev.c linux-3.1.3/fs/ecryptfs/miscdev.c
---- linux-3.1.3/fs/ecryptfs/miscdev.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/ecryptfs/miscdev.c  2011-11-16 18:39:08.000000000 -0500
+diff --git a/fs/ecryptfs/miscdev.c b/fs/ecryptfs/miscdev.c
+index 940a82e..63af89e 100644
+--- a/fs/ecryptfs/miscdev.c
++++ b/fs/ecryptfs/miscdev.c
 @@ -328,7 +328,7 @@ check_list:
                goto out_unlock_msg_ctx;
        i = 5;
@@ -41359,10 +43490,11 @@ diff -urNp linux-3.1.3/fs/ecryptfs/miscdev.c linux-3.1.3/fs/ecryptfs/miscdev.c
                        goto out_unlock_msg_ctx;
                i += packet_length_size;
                if (copy_to_user(&buf[i], msg_ctx->msg, msg_ctx->msg_size))
-diff -urNp linux-3.1.3/fs/ecryptfs/read_write.c linux-3.1.3/fs/ecryptfs/read_write.c
---- linux-3.1.3/fs/ecryptfs/read_write.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/ecryptfs/read_write.c       2011-11-16 18:39:08.000000000 -0500
-@@ -48,7 +48,7 @@ int ecryptfs_write_lower(struct inode *e
+diff --git a/fs/ecryptfs/read_write.c b/fs/ecryptfs/read_write.c
+index 3745f7c..89cc7a3 100644
+--- a/fs/ecryptfs/read_write.c
++++ b/fs/ecryptfs/read_write.c
+@@ -48,7 +48,7 @@ int ecryptfs_write_lower(struct inode *ecryptfs_inode, char *data,
                return -EIO;
        fs_save = get_fs();
        set_fs(get_ds());
@@ -41371,7 +43503,7 @@ diff -urNp linux-3.1.3/fs/ecryptfs/read_write.c linux-3.1.3/fs/ecryptfs/read_wri
        set_fs(fs_save);
        mark_inode_dirty_sync(ecryptfs_inode);
        return rc;
-@@ -235,7 +235,7 @@ int ecryptfs_read_lower(char *data, loff
+@@ -235,7 +235,7 @@ int ecryptfs_read_lower(char *data, loff_t offset, size_t size,
                return -EIO;
        fs_save = get_fs();
        set_fs(get_ds());
@@ -41380,9 +43512,10 @@ diff -urNp linux-3.1.3/fs/ecryptfs/read_write.c linux-3.1.3/fs/ecryptfs/read_wri
        set_fs(fs_save);
        return rc;
  }
-diff -urNp linux-3.1.3/fs/exec.c linux-3.1.3/fs/exec.c
---- linux-3.1.3/fs/exec.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/exec.c      2011-11-17 18:40:47.000000000 -0500
+diff --git a/fs/exec.c b/fs/exec.c
+index 25dcbe5..4ffaa78 100644
+--- a/fs/exec.c
++++ b/fs/exec.c
 @@ -55,12 +55,24 @@
  #include <linux/pipe_fs_i.h>
  #include <linux/oom.h>
@@ -41417,7 +43550,7 @@ diff -urNp linux-3.1.3/fs/exec.c linux-3.1.3/fs/exec.c
  
  /* The maximal length of core_pattern is also specified in sysctl.c */
  
-@@ -188,18 +200,10 @@ static struct page *get_arg_page(struct 
+@@ -188,18 +200,10 @@ static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos,
                int write)
  {
        struct page *page;
@@ -41439,7 +43572,7 @@ diff -urNp linux-3.1.3/fs/exec.c linux-3.1.3/fs/exec.c
                return NULL;
  
        if (write) {
-@@ -274,6 +278,11 @@ static int __bprm_mm_init(struct linux_b
+@@ -274,6 +278,11 @@ static int __bprm_mm_init(struct linux_binprm *bprm)
        vma->vm_end = STACK_TOP_MAX;
        vma->vm_start = vma->vm_end - PAGE_SIZE;
        vma->vm_flags = VM_STACK_FLAGS | VM_STACK_INCOMPLETE_SETUP;
@@ -41451,7 +43584,7 @@ diff -urNp linux-3.1.3/fs/exec.c linux-3.1.3/fs/exec.c
        vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
        INIT_LIST_HEAD(&vma->anon_vma_chain);
  
-@@ -288,6 +297,12 @@ static int __bprm_mm_init(struct linux_b
+@@ -288,6 +297,12 @@ static int __bprm_mm_init(struct linux_binprm *bprm)
        mm->stack_vm = mm->total_vm = 1;
        up_write(&mm->mmap_sem);
        bprm->p = vma->vm_end - sizeof(void *);
@@ -41485,7 +43618,7 @@ diff -urNp linux-3.1.3/fs/exec.c linux-3.1.3/fs/exec.c
  {
        const char __user *native;
  
-@@ -417,14 +420,14 @@ static const char __user *get_user_arg_p
+@@ -417,14 +420,14 @@ static const char __user *get_user_arg_ptr(struct user_arg_ptr argv, int nr)
                compat_uptr_t compat;
  
                if (get_user(compat, argv.ptr.compat + nr))
@@ -41502,7 +43635,7 @@ diff -urNp linux-3.1.3/fs/exec.c linux-3.1.3/fs/exec.c
  
        return native;
  }
-@@ -443,7 +446,7 @@ static int count(struct user_arg_ptr arg
+@@ -443,7 +446,7 @@ static int count(struct user_arg_ptr argv, int max)
                        if (!p)
                                break;
  
@@ -41511,7 +43644,7 @@ diff -urNp linux-3.1.3/fs/exec.c linux-3.1.3/fs/exec.c
                                return -EFAULT;
  
                        if (i++ >= max)
-@@ -477,7 +480,7 @@ static int copy_strings(int argc, struct
+@@ -477,7 +480,7 @@ static int copy_strings(int argc, struct user_arg_ptr argv,
  
                ret = -EFAULT;
                str = get_user_arg_ptr(argv, argc);
@@ -41520,7 +43653,7 @@ diff -urNp linux-3.1.3/fs/exec.c linux-3.1.3/fs/exec.c
                        goto out;
  
                len = strnlen_user(str, MAX_ARG_STRLEN);
-@@ -559,7 +562,7 @@ int copy_strings_kernel(int argc, const 
+@@ -559,7 +562,7 @@ int copy_strings_kernel(int argc, const char *const *__argv,
        int r;
        mm_segment_t oldfs = get_fs();
        struct user_arg_ptr argv = {
@@ -41529,7 +43662,7 @@ diff -urNp linux-3.1.3/fs/exec.c linux-3.1.3/fs/exec.c
        };
  
        set_fs(KERNEL_DS);
-@@ -594,7 +597,8 @@ static int shift_arg_pages(struct vm_are
+@@ -594,7 +597,8 @@ static int shift_arg_pages(struct vm_area_struct *vma, unsigned long shift)
        unsigned long new_end = old_end - shift;
        struct mmu_gather tlb;
  
@@ -41539,7 +43672,7 @@ diff -urNp linux-3.1.3/fs/exec.c linux-3.1.3/fs/exec.c
  
        /*
         * ensure there are no vmas between where we want to go
-@@ -603,6 +607,10 @@ static int shift_arg_pages(struct vm_are
+@@ -603,6 +607,10 @@ static int shift_arg_pages(struct vm_area_struct *vma, unsigned long shift)
        if (vma != find_vma(mm, new_start))
                return -EFAULT;
  
@@ -41550,7 +43683,7 @@ diff -urNp linux-3.1.3/fs/exec.c linux-3.1.3/fs/exec.c
        /*
         * cover the whole range: [new_start, old_end)
         */
-@@ -683,10 +691,6 @@ int setup_arg_pages(struct linux_binprm 
+@@ -683,10 +691,6 @@ int setup_arg_pages(struct linux_binprm *bprm,
        stack_top = arch_align_stack(stack_top);
        stack_top = PAGE_ALIGN(stack_top);
  
@@ -41561,7 +43694,7 @@ diff -urNp linux-3.1.3/fs/exec.c linux-3.1.3/fs/exec.c
        stack_shift = vma->vm_end - stack_top;
  
        bprm->p -= stack_shift;
-@@ -698,8 +702,28 @@ int setup_arg_pages(struct linux_binprm 
+@@ -698,8 +702,28 @@ int setup_arg_pages(struct linux_binprm *bprm,
        bprm->exec -= stack_shift;
  
        down_write(&mm->mmap_sem);
@@ -41590,7 +43723,7 @@ diff -urNp linux-3.1.3/fs/exec.c linux-3.1.3/fs/exec.c
        /*
         * Adjust stack execute permissions; explicitly enable for
         * EXSTACK_ENABLE_X, disable for EXSTACK_DISABLE_X and leave alone
-@@ -718,13 +742,6 @@ int setup_arg_pages(struct linux_binprm 
+@@ -718,13 +742,6 @@ int setup_arg_pages(struct linux_binprm *bprm,
                goto out_unlock;
        BUG_ON(prev != vma);
  
@@ -41604,7 +43737,7 @@ diff -urNp linux-3.1.3/fs/exec.c linux-3.1.3/fs/exec.c
        /* mprotect_fixup is overkill to remove the temporary stack flags */
        vma->vm_flags &= ~VM_STACK_INCOMPLETE_SETUP;
  
-@@ -805,7 +822,7 @@ int kernel_read(struct file *file, loff_
+@@ -805,7 +822,7 @@ int kernel_read(struct file *file, loff_t offset,
        old_fs = get_fs();
        set_fs(get_ds());
        /* The cast to a user pointer is valid due to the set_fs() */
@@ -41613,7 +43746,7 @@ diff -urNp linux-3.1.3/fs/exec.c linux-3.1.3/fs/exec.c
        set_fs(old_fs);
        return result;
  }
-@@ -1251,7 +1268,7 @@ int check_unsafe_exec(struct linux_binpr
+@@ -1251,7 +1268,7 @@ int check_unsafe_exec(struct linux_binprm *bprm)
        }
        rcu_read_unlock();
  
@@ -41622,7 +43755,7 @@ diff -urNp linux-3.1.3/fs/exec.c linux-3.1.3/fs/exec.c
                bprm->unsafe |= LSM_UNSAFE_SHARE;
        } else {
                res = -EAGAIN;
-@@ -1454,6 +1471,11 @@ static int do_execve_common(const char *
+@@ -1454,6 +1471,11 @@ static int do_execve_common(const char *filename,
                                struct user_arg_ptr envp,
                                struct pt_regs *regs)
  {
@@ -41634,7 +43767,7 @@ diff -urNp linux-3.1.3/fs/exec.c linux-3.1.3/fs/exec.c
        struct linux_binprm *bprm;
        struct file *file;
        struct files_struct *displaced;
-@@ -1461,6 +1483,8 @@ static int do_execve_common(const char *
+@@ -1461,6 +1483,8 @@ static int do_execve_common(const char *filename,
        int retval;
        const struct cred *cred = current_cred();
  
@@ -41643,7 +43776,7 @@ diff -urNp linux-3.1.3/fs/exec.c linux-3.1.3/fs/exec.c
        /*
         * We move the actual failure in case of RLIMIT_NPROC excess from
         * set*uid() to execve() because too many poorly written programs
-@@ -1507,6 +1531,16 @@ static int do_execve_common(const char *
+@@ -1507,6 +1531,16 @@ static int do_execve_common(const char *filename,
        bprm->filename = filename;
        bprm->interp = filename;
  
@@ -41660,7 +43793,7 @@ diff -urNp linux-3.1.3/fs/exec.c linux-3.1.3/fs/exec.c
        retval = bprm_mm_init(bprm);
        if (retval)
                goto out_file;
-@@ -1536,9 +1570,40 @@ static int do_execve_common(const char *
+@@ -1536,9 +1570,40 @@ static int do_execve_common(const char *filename,
        if (retval < 0)
                goto out;
  
@@ -41702,7 +43835,7 @@ diff -urNp linux-3.1.3/fs/exec.c linux-3.1.3/fs/exec.c
  
        /* execve succeeded */
        current->fs->in_exec = 0;
-@@ -1549,6 +1614,14 @@ static int do_execve_common(const char *
+@@ -1549,6 +1614,14 @@ static int do_execve_common(const char *filename,
                put_files_struct(displaced);
        return retval;
  
@@ -41717,7 +43850,7 @@ diff -urNp linux-3.1.3/fs/exec.c linux-3.1.3/fs/exec.c
  out:
        if (bprm->mm) {
                acct_arg_size(bprm, 0);
-@@ -1622,7 +1695,7 @@ static int expand_corename(struct core_n
+@@ -1622,7 +1695,7 @@ static int expand_corename(struct core_name *cn)
  {
        char *old_corename = cn->corename;
  
@@ -41726,7 +43859,7 @@ diff -urNp linux-3.1.3/fs/exec.c linux-3.1.3/fs/exec.c
        cn->corename = krealloc(old_corename, cn->size, GFP_KERNEL);
  
        if (!cn->corename) {
-@@ -1719,7 +1792,7 @@ static int format_corename(struct core_n
+@@ -1719,7 +1792,7 @@ static int format_corename(struct core_name *cn, long signr)
        int pid_in_pattern = 0;
        int err = 0;
  
@@ -41954,7 +44087,7 @@ diff -urNp linux-3.1.3/fs/exec.c linux-3.1.3/fs/exec.c
  static int zap_process(struct task_struct *start, int exit_code)
  {
        struct task_struct *t;
-@@ -2027,17 +2312,17 @@ static void wait_for_dump_helpers(struct
+@@ -2027,17 +2312,17 @@ static void wait_for_dump_helpers(struct file *file)
        pipe = file->f_path.dentry->d_inode->i_pipe;
  
        pipe_lock(pipe);
@@ -41977,7 +44110,7 @@ diff -urNp linux-3.1.3/fs/exec.c linux-3.1.3/fs/exec.c
        pipe_unlock(pipe);
  
  }
-@@ -2098,7 +2383,7 @@ void do_coredump(long signr, int exit_co
+@@ -2098,7 +2383,7 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs)
        int retval = 0;
        int flag = 0;
        int ispipe;
@@ -41986,7 +44119,7 @@ diff -urNp linux-3.1.3/fs/exec.c linux-3.1.3/fs/exec.c
        struct coredump_params cprm = {
                .signr = signr,
                .regs = regs,
-@@ -2113,6 +2398,9 @@ void do_coredump(long signr, int exit_co
+@@ -2113,6 +2398,9 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs)
  
        audit_core_dumps(signr);
  
@@ -41996,7 +44129,7 @@ diff -urNp linux-3.1.3/fs/exec.c linux-3.1.3/fs/exec.c
        binfmt = mm->binfmt;
        if (!binfmt || !binfmt->core_dump)
                goto fail;
-@@ -2180,7 +2468,7 @@ void do_coredump(long signr, int exit_co
+@@ -2180,7 +2468,7 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs)
                }
                cprm.limit = RLIM_INFINITY;
  
@@ -42005,7 +44138,7 @@ diff -urNp linux-3.1.3/fs/exec.c linux-3.1.3/fs/exec.c
                if (core_pipe_limit && (core_pipe_limit < dump_count)) {
                        printk(KERN_WARNING "Pid %d(%s) over core_pipe_limit\n",
                               task_tgid_vnr(current), current->comm);
-@@ -2207,6 +2495,8 @@ void do_coredump(long signr, int exit_co
+@@ -2207,6 +2495,8 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs)
        } else {
                struct inode *inode;
  
@@ -42032,10 +44165,11 @@ diff -urNp linux-3.1.3/fs/exec.c linux-3.1.3/fs/exec.c
  }
  EXPORT_SYMBOL(dump_write);
  
-diff -urNp linux-3.1.3/fs/ext2/balloc.c linux-3.1.3/fs/ext2/balloc.c
---- linux-3.1.3/fs/ext2/balloc.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/ext2/balloc.c       2011-11-16 18:40:29.000000000 -0500
-@@ -1192,7 +1192,7 @@ static int ext2_has_free_blocks(struct e
+diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c
+index 8f44cef..cb07120 100644
+--- a/fs/ext2/balloc.c
++++ b/fs/ext2/balloc.c
+@@ -1192,7 +1192,7 @@ static int ext2_has_free_blocks(struct ext2_sb_info *sbi)
  
        free_blocks = percpu_counter_read_positive(&sbi->s_freeblocks_counter);
        root_blocks = le32_to_cpu(sbi->s_es->s_r_blocks_count);
@@ -42044,10 +44178,11 @@ diff -urNp linux-3.1.3/fs/ext2/balloc.c linux-3.1.3/fs/ext2/balloc.c
                sbi->s_resuid != current_fsuid() &&
                (sbi->s_resgid == 0 || !in_group_p (sbi->s_resgid))) {
                return 0;
-diff -urNp linux-3.1.3/fs/ext3/balloc.c linux-3.1.3/fs/ext3/balloc.c
---- linux-3.1.3/fs/ext3/balloc.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/ext3/balloc.c       2011-11-16 18:40:29.000000000 -0500
-@@ -1446,7 +1446,7 @@ static int ext3_has_free_blocks(struct e
+diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c
+index 6386d76..0a266b1 100644
+--- a/fs/ext3/balloc.c
++++ b/fs/ext3/balloc.c
+@@ -1446,7 +1446,7 @@ static int ext3_has_free_blocks(struct ext3_sb_info *sbi)
  
        free_blocks = percpu_counter_read_positive(&sbi->s_freeblocks_counter);
        root_blocks = le32_to_cpu(sbi->s_es->s_r_blocks_count);
@@ -42056,10 +44191,11 @@ diff -urNp linux-3.1.3/fs/ext3/balloc.c linux-3.1.3/fs/ext3/balloc.c
                sbi->s_resuid != current_fsuid() &&
                (sbi->s_resgid == 0 || !in_group_p (sbi->s_resgid))) {
                return 0;
-diff -urNp linux-3.1.3/fs/ext4/balloc.c linux-3.1.3/fs/ext4/balloc.c
---- linux-3.1.3/fs/ext4/balloc.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/ext4/balloc.c       2011-11-16 18:40:29.000000000 -0500
-@@ -394,8 +394,8 @@ static int ext4_has_free_blocks(struct e
+diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
+index f8224ad..fbef97c 100644
+--- a/fs/ext4/balloc.c
++++ b/fs/ext4/balloc.c
+@@ -394,8 +394,8 @@ static int ext4_has_free_blocks(struct ext4_sb_info *sbi,
        /* Hm, nope.  Are (enough) root reserved blocks available? */
        if (sbi->s_resuid == current_fsuid() ||
            ((sbi->s_resgid != 0) && in_group_p(sbi->s_resgid)) ||
@@ -42070,9 +44206,10 @@ diff -urNp linux-3.1.3/fs/ext4/balloc.c linux-3.1.3/fs/ext4/balloc.c
  
                if (free_blocks >= (nblocks + dirty_blocks))
                        return 1;
-diff -urNp linux-3.1.3/fs/ext4/ext4.h linux-3.1.3/fs/ext4/ext4.h
---- linux-3.1.3/fs/ext4/ext4.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/ext4/ext4.h 2011-11-16 18:39:08.000000000 -0500
+diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
+index 5c38120..2291d18 100644
+--- a/fs/ext4/ext4.h
++++ b/fs/ext4/ext4.h
 @@ -1180,19 +1180,19 @@ struct ext4_sb_info {
        unsigned long s_mb_last_start;
  
@@ -42103,10 +44240,11 @@ diff -urNp linux-3.1.3/fs/ext4/ext4.h linux-3.1.3/fs/ext4/ext4.h
        atomic_t s_lock_busy;
  
        /* locality groups */
-diff -urNp linux-3.1.3/fs/ext4/file.c linux-3.1.3/fs/ext4/file.c
---- linux-3.1.3/fs/ext4/file.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/ext4/file.c 2011-11-16 18:40:29.000000000 -0500
-@@ -181,8 +181,8 @@ static int ext4_file_open(struct inode *
+diff --git a/fs/ext4/file.c b/fs/ext4/file.c
+index e4095e9..1c006c5 100644
+--- a/fs/ext4/file.c
++++ b/fs/ext4/file.c
+@@ -181,8 +181,8 @@ static int ext4_file_open(struct inode * inode, struct file * filp)
                path.dentry = mnt->mnt_root;
                cp = d_path(&path, buf, sizeof(buf));
                if (!IS_ERR(cp)) {
@@ -42117,9 +44255,10 @@ diff -urNp linux-3.1.3/fs/ext4/file.c linux-3.1.3/fs/ext4/file.c
                        ext4_mark_super_dirty(sb);
                }
        }
-diff -urNp linux-3.1.3/fs/ext4/ioctl.c linux-3.1.3/fs/ext4/ioctl.c
---- linux-3.1.3/fs/ext4/ioctl.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/ext4/ioctl.c        2011-11-16 18:39:08.000000000 -0500
+diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
+index f18bfe3..43759b1 100644
+--- a/fs/ext4/ioctl.c
++++ b/fs/ext4/ioctl.c
 @@ -348,7 +348,7 @@ mext_out:
                if (!blk_queue_discard(q))
                        return -EOPNOTSUPP;
@@ -42138,10 +44277,11 @@ diff -urNp linux-3.1.3/fs/ext4/ioctl.c linux-3.1.3/fs/ext4/ioctl.c
                    sizeof(range)))
                        return -EFAULT;
  
-diff -urNp linux-3.1.3/fs/ext4/mballoc.c linux-3.1.3/fs/ext4/mballoc.c
---- linux-3.1.3/fs/ext4/mballoc.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/ext4/mballoc.c      2011-11-16 18:40:29.000000000 -0500
-@@ -1795,7 +1795,7 @@ void ext4_mb_simple_scan_group(struct ex
+diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
+index 17a5a57..b6be3c5 100644
+--- a/fs/ext4/mballoc.c
++++ b/fs/ext4/mballoc.c
+@@ -1795,7 +1795,7 @@ void ext4_mb_simple_scan_group(struct ext4_allocation_context *ac,
                BUG_ON(ac->ac_b_ex.fe_len != ac->ac_g_ex.fe_len);
  
                if (EXT4_SB(sb)->s_mb_stats)
@@ -42159,7 +44299,7 @@ diff -urNp linux-3.1.3/fs/ext4/mballoc.c linux-3.1.3/fs/ext4/mballoc.c
                        goto repeat;
                }
        }
-@@ -2132,6 +2132,8 @@ static int ext4_mb_seq_groups_show(struc
+@@ -2132,6 +2132,8 @@ static int ext4_mb_seq_groups_show(struct seq_file *seq, void *v)
                ext4_grpblk_t counters[16];
        } sg;
  
@@ -42168,7 +44308,7 @@ diff -urNp linux-3.1.3/fs/ext4/mballoc.c linux-3.1.3/fs/ext4/mballoc.c
        group--;
        if (group == 0)
                seq_printf(seq, "#%-5s: %-5s %-5s %-5s "
-@@ -2573,25 +2575,25 @@ int ext4_mb_release(struct super_block *
+@@ -2573,25 +2575,25 @@ int ext4_mb_release(struct super_block *sb)
        if (sbi->s_mb_stats) {
                ext4_msg(sb, KERN_INFO,
                       "mballoc: %u blocks %u reqs (%u success)",
@@ -42204,7 +44344,7 @@ diff -urNp linux-3.1.3/fs/ext4/mballoc.c linux-3.1.3/fs/ext4/mballoc.c
        }
  
        free_percpu(sbi->s_locality_groups);
-@@ -3070,16 +3072,16 @@ static void ext4_mb_collect_stats(struct
+@@ -3070,16 +3072,16 @@ static void ext4_mb_collect_stats(struct ext4_allocation_context *ac)
        struct ext4_sb_info *sbi = EXT4_SB(ac->ac_sb);
  
        if (sbi->s_mb_stats && ac->ac_g_ex.fe_len > 1) {
@@ -42227,7 +44367,7 @@ diff -urNp linux-3.1.3/fs/ext4/mballoc.c linux-3.1.3/fs/ext4/mballoc.c
        }
  
        if (ac->ac_op == EXT4_MB_HISTORY_ALLOC)
-@@ -3477,7 +3479,7 @@ ext4_mb_new_inode_pa(struct ext4_allocat
+@@ -3477,7 +3479,7 @@ ext4_mb_new_inode_pa(struct ext4_allocation_context *ac)
        trace_ext4_mb_new_inode_pa(ac, pa);
  
        ext4_mb_use_inode_pa(ac, pa);
@@ -42236,7 +44376,7 @@ diff -urNp linux-3.1.3/fs/ext4/mballoc.c linux-3.1.3/fs/ext4/mballoc.c
  
        ei = EXT4_I(ac->ac_inode);
        grp = ext4_get_group_info(sb, ac->ac_b_ex.fe_group);
-@@ -3537,7 +3539,7 @@ ext4_mb_new_group_pa(struct ext4_allocat
+@@ -3537,7 +3539,7 @@ ext4_mb_new_group_pa(struct ext4_allocation_context *ac)
        trace_ext4_mb_new_group_pa(ac, pa);
  
        ext4_mb_use_group_pa(ac, pa);
@@ -42245,7 +44385,7 @@ diff -urNp linux-3.1.3/fs/ext4/mballoc.c linux-3.1.3/fs/ext4/mballoc.c
  
        grp = ext4_get_group_info(sb, ac->ac_b_ex.fe_group);
        lg = ac->ac_lg;
-@@ -3625,7 +3627,7 @@ ext4_mb_release_inode_pa(struct ext4_bud
+@@ -3625,7 +3627,7 @@ ext4_mb_release_inode_pa(struct ext4_buddy *e4b, struct buffer_head *bitmap_bh,
                 * from the bitmap and continue.
                 */
        }
@@ -42254,7 +44394,7 @@ diff -urNp linux-3.1.3/fs/ext4/mballoc.c linux-3.1.3/fs/ext4/mballoc.c
  
        return err;
  }
-@@ -3643,7 +3645,7 @@ ext4_mb_release_group_pa(struct ext4_bud
+@@ -3643,7 +3645,7 @@ ext4_mb_release_group_pa(struct ext4_buddy *e4b,
        ext4_get_group_no_and_offset(sb, pa->pa_pstart, &group, &bit);
        BUG_ON(group != e4b->bd_group && pa->pa_len != 0);
        mb_free_blocks(pa->pa_inode, e4b, bit, pa->pa_len);
@@ -42263,10 +44403,11 @@ diff -urNp linux-3.1.3/fs/ext4/mballoc.c linux-3.1.3/fs/ext4/mballoc.c
        trace_ext4_mballoc_discard(sb, NULL, group, bit, pa->pa_len);
  
        return 0;
-diff -urNp linux-3.1.3/fs/fcntl.c linux-3.1.3/fs/fcntl.c
---- linux-3.1.3/fs/fcntl.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/fcntl.c     2011-11-16 23:40:25.000000000 -0500
-@@ -224,6 +224,11 @@ int __f_setown(struct file *filp, struct
+diff --git a/fs/fcntl.c b/fs/fcntl.c
+index 22764c7..86372c9 100644
+--- a/fs/fcntl.c
++++ b/fs/fcntl.c
+@@ -224,6 +224,11 @@ int __f_setown(struct file *filp, struct pid *pid, enum pid_type type,
        if (err)
                return err;
  
@@ -42287,7 +44428,7 @@ diff -urNp linux-3.1.3/fs/fcntl.c linux-3.1.3/fs/fcntl.c
        struct f_owner_ex owner;
        struct pid *pid;
        int type;
-@@ -306,7 +311,7 @@ static int f_setown_ex(struct file *filp
+@@ -306,7 +311,7 @@ static int f_setown_ex(struct file *filp, unsigned long arg)
  
  static int f_getown_ex(struct file *filp, unsigned long arg)
  {
@@ -42296,7 +44437,7 @@ diff -urNp linux-3.1.3/fs/fcntl.c linux-3.1.3/fs/fcntl.c
        struct f_owner_ex owner;
        int ret = 0;
  
-@@ -348,6 +353,7 @@ static long do_fcntl(int fd, unsigned in
+@@ -348,6 +353,7 @@ static long do_fcntl(int fd, unsigned int cmd, unsigned long arg,
        switch (cmd) {
        case F_DUPFD:
        case F_DUPFD_CLOEXEC:
@@ -42304,10 +44445,11 @@ diff -urNp linux-3.1.3/fs/fcntl.c linux-3.1.3/fs/fcntl.c
                if (arg >= rlimit(RLIMIT_NOFILE))
                        break;
                err = alloc_fd(arg, cmd == F_DUPFD_CLOEXEC ? O_CLOEXEC : 0);
-diff -urNp linux-3.1.3/fs/fifo.c linux-3.1.3/fs/fifo.c
---- linux-3.1.3/fs/fifo.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/fifo.c      2011-11-16 18:39:08.000000000 -0500
-@@ -58,10 +58,10 @@ static int fifo_open(struct inode *inode
+diff --git a/fs/fifo.c b/fs/fifo.c
+index b1a524d..4ee270e 100644
+--- a/fs/fifo.c
++++ b/fs/fifo.c
+@@ -58,10 +58,10 @@ static int fifo_open(struct inode *inode, struct file *filp)
         */
                filp->f_op = &read_pipefifo_fops;
                pipe->r_counter++;
@@ -42320,7 +44462,7 @@ diff -urNp linux-3.1.3/fs/fifo.c linux-3.1.3/fs/fifo.c
                        if ((filp->f_flags & O_NONBLOCK)) {
                                /* suppress POLLHUP until we have
                                 * seen a writer */
-@@ -81,15 +81,15 @@ static int fifo_open(struct inode *inode
+@@ -81,15 +81,15 @@ static int fifo_open(struct inode *inode, struct file *filp)
         *  errno=ENXIO when there is no process reading the FIFO.
         */
                ret = -ENXIO;
@@ -42339,7 +44481,7 @@ diff -urNp linux-3.1.3/fs/fifo.c linux-3.1.3/fs/fifo.c
                        wait_for_partner(inode, &pipe->r_counter);
                        if (signal_pending(current))
                                goto err_wr;
-@@ -105,11 +105,11 @@ static int fifo_open(struct inode *inode
+@@ -105,11 +105,11 @@ static int fifo_open(struct inode *inode, struct file *filp)
         */
                filp->f_op = &rdwr_pipefifo_fops;
  
@@ -42354,7 +44496,7 @@ diff -urNp linux-3.1.3/fs/fifo.c linux-3.1.3/fs/fifo.c
                        wake_up_partner(inode);
                break;
  
-@@ -123,19 +123,19 @@ static int fifo_open(struct inode *inode
+@@ -123,19 +123,19 @@ static int fifo_open(struct inode *inode, struct file *filp)
        return 0;
  
  err_rd:
@@ -42377,9 +44519,10 @@ diff -urNp linux-3.1.3/fs/fifo.c linux-3.1.3/fs/fifo.c
                free_pipe_info(inode);
  
  err_nocleanup:
-diff -urNp linux-3.1.3/fs/file.c linux-3.1.3/fs/file.c
---- linux-3.1.3/fs/file.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/file.c      2011-11-16 18:40:29.000000000 -0500
+diff --git a/fs/file.c b/fs/file.c
+index 4c6992d..104cdea 100644
+--- a/fs/file.c
++++ b/fs/file.c
 @@ -15,6 +15,7 @@
  #include <linux/slab.h>
  #include <linux/vmalloc.h>
@@ -42388,7 +44531,7 @@ diff -urNp linux-3.1.3/fs/file.c linux-3.1.3/fs/file.c
  #include <linux/fdtable.h>
  #include <linux/bitops.h>
  #include <linux/interrupt.h>
-@@ -254,6 +255,7 @@ int expand_files(struct files_struct *fi
+@@ -254,6 +255,7 @@ int expand_files(struct files_struct *files, int nr)
         * N.B. For clone tasks sharing a files structure, this test
         * will limit the total number of files that can be opened.
         */
@@ -42396,10 +44539,11 @@ diff -urNp linux-3.1.3/fs/file.c linux-3.1.3/fs/file.c
        if (nr >= rlimit(RLIMIT_NOFILE))
                return -EMFILE;
  
-diff -urNp linux-3.1.3/fs/filesystems.c linux-3.1.3/fs/filesystems.c
---- linux-3.1.3/fs/filesystems.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/filesystems.c       2011-11-16 18:40:29.000000000 -0500
-@@ -274,7 +274,12 @@ struct file_system_type *get_fs_type(con
+diff --git a/fs/filesystems.c b/fs/filesystems.c
+index 0845f84..7b4ebef 100644
+--- a/fs/filesystems.c
++++ b/fs/filesystems.c
+@@ -274,7 +274,12 @@ struct file_system_type *get_fs_type(const char *name)
        int len = dot ? dot - name : strlen(name);
  
        fs = __get_fs_type(name, len);
@@ -42412,10 +44556,104 @@ diff -urNp linux-3.1.3/fs/filesystems.c linux-3.1.3/fs/filesystems.c
                fs = __get_fs_type(name, len);
  
        if (dot && fs && !(fs->fs_flags & FS_HAS_SUBTYPE)) {
-diff -urNp linux-3.1.3/fs/fscache/cookie.c linux-3.1.3/fs/fscache/cookie.c
---- linux-3.1.3/fs/fscache/cookie.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/fscache/cookie.c    2011-11-16 18:39:08.000000000 -0500
-@@ -68,11 +68,11 @@ struct fscache_cookie *__fscache_acquire
+diff --git a/fs/fs_struct.c b/fs/fs_struct.c
+index 78b519c..212c0d0 100644
+--- a/fs/fs_struct.c
++++ b/fs/fs_struct.c
+@@ -4,6 +4,7 @@
+ #include <linux/path.h>
+ #include <linux/slab.h>
+ #include <linux/fs_struct.h>
++#include <linux/grsecurity.h>
+ #include "internal.h"
+ static inline void path_get_longterm(struct path *path)
+@@ -31,6 +32,7 @@ void set_fs_root(struct fs_struct *fs, struct path *path)
+       old_root = fs->root;
+       fs->root = *path;
+       path_get_longterm(path);
++      gr_set_chroot_entries(current, path);
+       write_seqcount_end(&fs->seq);
+       spin_unlock(&fs->lock);
+       if (old_root.dentry)
+@@ -74,6 +76,7 @@ void chroot_fs_refs(struct path *old_root, struct path *new_root)
+                           && fs->root.mnt == old_root->mnt) {
+                               path_get_longterm(new_root);
+                               fs->root = *new_root;
++                              gr_set_chroot_entries(p, new_root);
+                               count++;
+                       }
+                       if (fs->pwd.dentry == old_root->dentry
+@@ -109,7 +112,8 @@ void exit_fs(struct task_struct *tsk)
+               spin_lock(&fs->lock);
+               write_seqcount_begin(&fs->seq);
+               tsk->fs = NULL;
+-              kill = !--fs->users;
++              gr_clear_chroot_entries(tsk);
++              kill = !atomic_dec_return(&fs->users);
+               write_seqcount_end(&fs->seq);
+               spin_unlock(&fs->lock);
+               task_unlock(tsk);
+@@ -123,7 +127,7 @@ struct fs_struct *copy_fs_struct(struct fs_struct *old)
+       struct fs_struct *fs = kmem_cache_alloc(fs_cachep, GFP_KERNEL);
+       /* We don't need to lock fs - think why ;-) */
+       if (fs) {
+-              fs->users = 1;
++              atomic_set(&fs->users, 1);
+               fs->in_exec = 0;
+               spin_lock_init(&fs->lock);
+               seqcount_init(&fs->seq);
+@@ -132,6 +136,9 @@ struct fs_struct *copy_fs_struct(struct fs_struct *old)
+               spin_lock(&old->lock);
+               fs->root = old->root;
+               path_get_longterm(&fs->root);
++              /* instead of calling gr_set_chroot_entries here,
++                 we call it from every caller of this function
++              */
+               fs->pwd = old->pwd;
+               path_get_longterm(&fs->pwd);
+               spin_unlock(&old->lock);
+@@ -150,8 +157,9 @@ int unshare_fs_struct(void)
+       task_lock(current);
+       spin_lock(&fs->lock);
+-      kill = !--fs->users;
++      kill = !atomic_dec_return(&fs->users);
+       current->fs = new_fs;
++      gr_set_chroot_entries(current, &new_fs->root);
+       spin_unlock(&fs->lock);
+       task_unlock(current);
+@@ -170,7 +178,7 @@ EXPORT_SYMBOL(current_umask);
+ /* to be mentioned only in INIT_TASK */
+ struct fs_struct init_fs = {
+-      .users          = 1,
++      .users          = ATOMIC_INIT(1),
+       .lock           = __SPIN_LOCK_UNLOCKED(init_fs.lock),
+       .seq            = SEQCNT_ZERO,
+       .umask          = 0022,
+@@ -186,12 +194,13 @@ void daemonize_fs_struct(void)
+               task_lock(current);
+               spin_lock(&init_fs.lock);
+-              init_fs.users++;
++              atomic_inc(&init_fs.users);
+               spin_unlock(&init_fs.lock);
+               spin_lock(&fs->lock);
+               current->fs = &init_fs;
+-              kill = !--fs->users;
++              gr_set_chroot_entries(current, &current->fs->root);
++              kill = !atomic_dec_return(&fs->users);
+               spin_unlock(&fs->lock);
+               task_unlock(current);
+diff --git a/fs/fscache/cookie.c b/fs/fscache/cookie.c
+index 9905350..02eaec4 100644
+--- a/fs/fscache/cookie.c
++++ b/fs/fscache/cookie.c
+@@ -68,11 +68,11 @@ struct fscache_cookie *__fscache_acquire_cookie(
               parent ? (char *) parent->def->name : "<no-parent>",
               def->name, netfs_data);
  
@@ -42429,7 +44667,7 @@ diff -urNp linux-3.1.3/fs/fscache/cookie.c linux-3.1.3/fs/fscache/cookie.c
                _leave(" [no parent]");
                return NULL;
        }
-@@ -87,7 +87,7 @@ struct fscache_cookie *__fscache_acquire
+@@ -87,7 +87,7 @@ struct fscache_cookie *__fscache_acquire_cookie(
        /* allocate and initialise a cookie */
        cookie = kmem_cache_alloc(fscache_cookie_jar, GFP_KERNEL);
        if (!cookie) {
@@ -42438,7 +44676,7 @@ diff -urNp linux-3.1.3/fs/fscache/cookie.c linux-3.1.3/fs/fscache/cookie.c
                _leave(" [ENOMEM]");
                return NULL;
        }
-@@ -109,13 +109,13 @@ struct fscache_cookie *__fscache_acquire
+@@ -109,13 +109,13 @@ struct fscache_cookie *__fscache_acquire_cookie(
  
        switch (cookie->def->type) {
        case FSCACHE_COOKIE_TYPE_INDEX:
@@ -42455,7 +44693,7 @@ diff -urNp linux-3.1.3/fs/fscache/cookie.c linux-3.1.3/fs/fscache/cookie.c
                break;
        }
  
-@@ -126,13 +126,13 @@ struct fscache_cookie *__fscache_acquire
+@@ -126,13 +126,13 @@ struct fscache_cookie *__fscache_acquire_cookie(
                if (fscache_acquire_non_index_cookie(cookie) < 0) {
                        atomic_dec(&parent->n_children);
                        __fscache_cookie_put(cookie);
@@ -42471,7 +44709,7 @@ diff -urNp linux-3.1.3/fs/fscache/cookie.c linux-3.1.3/fs/fscache/cookie.c
        _leave(" = %p", cookie);
        return cookie;
  }
-@@ -168,7 +168,7 @@ static int fscache_acquire_non_index_coo
+@@ -168,7 +168,7 @@ static int fscache_acquire_non_index_cookie(struct fscache_cookie *cookie)
        cache = fscache_select_cache_for_object(cookie->parent);
        if (!cache) {
                up_read(&fscache_addremove_sem);
@@ -42480,7 +44718,7 @@ diff -urNp linux-3.1.3/fs/fscache/cookie.c linux-3.1.3/fs/fscache/cookie.c
                _leave(" = -ENOMEDIUM [no cache]");
                return -ENOMEDIUM;
        }
-@@ -256,12 +256,12 @@ static int fscache_alloc_object(struct f
+@@ -256,12 +256,12 @@ static int fscache_alloc_object(struct fscache_cache *cache,
        object = cache->ops->alloc_object(cache, cookie);
        fscache_stat_d(&fscache_n_cop_alloc_object);
        if (IS_ERR(object)) {
@@ -42495,7 +44733,7 @@ diff -urNp linux-3.1.3/fs/fscache/cookie.c linux-3.1.3/fs/fscache/cookie.c
  
        object->debug_id = atomic_inc_return(&fscache_object_debug_id);
  
-@@ -377,10 +377,10 @@ void __fscache_update_cookie(struct fsca
+@@ -377,10 +377,10 @@ void __fscache_update_cookie(struct fscache_cookie *cookie)
        struct fscache_object *object;
        struct hlist_node *_p;
  
@@ -42508,7 +44746,7 @@ diff -urNp linux-3.1.3/fs/fscache/cookie.c linux-3.1.3/fs/fscache/cookie.c
                _leave(" [no cookie]");
                return;
        }
-@@ -414,12 +414,12 @@ void __fscache_relinquish_cookie(struct 
+@@ -414,12 +414,12 @@ void __fscache_relinquish_cookie(struct fscache_cookie *cookie, int retire)
        struct fscache_object *object;
        unsigned long event;
  
@@ -42524,7 +44762,7 @@ diff -urNp linux-3.1.3/fs/fscache/cookie.c linux-3.1.3/fs/fscache/cookie.c
                _leave(" [no cookie]");
                return;
        }
-@@ -435,7 +435,7 @@ void __fscache_relinquish_cookie(struct 
+@@ -435,7 +435,7 @@ void __fscache_relinquish_cookie(struct fscache_cookie *cookie, int retire)
  
        /* wait for the cookie to finish being instantiated (or to fail) */
        if (test_bit(FSCACHE_COOKIE_CREATING, &cookie->flags)) {
@@ -42533,9 +44771,10 @@ diff -urNp linux-3.1.3/fs/fscache/cookie.c linux-3.1.3/fs/fscache/cookie.c
                wait_on_bit(&cookie->flags, FSCACHE_COOKIE_CREATING,
                            fscache_wait_bit, TASK_UNINTERRUPTIBLE);
        }
-diff -urNp linux-3.1.3/fs/fscache/internal.h linux-3.1.3/fs/fscache/internal.h
---- linux-3.1.3/fs/fscache/internal.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/fscache/internal.h  2011-11-16 18:39:08.000000000 -0500
+diff --git a/fs/fscache/internal.h b/fs/fscache/internal.h
+index f6aad48..88dcf26 100644
+--- a/fs/fscache/internal.h
++++ b/fs/fscache/internal.h
 @@ -144,94 +144,94 @@ extern void fscache_proc_cleanup(void);
  extern atomic_t fscache_n_ops_processed[FSCACHE_MAX_THREADS];
  extern atomic_t fscache_n_objs_processed[FSCACHE_MAX_THREADS];
@@ -42548,13 +44787,26 @@ diff -urNp linux-3.1.3/fs/fscache/internal.h linux-3.1.3/fs/fscache/internal.h
 -extern atomic_t fscache_n_op_gc;
 -extern atomic_t fscache_n_op_cancelled;
 -extern atomic_t fscache_n_op_rejected;
--
++extern atomic_unchecked_t fscache_n_op_pend;
++extern atomic_unchecked_t fscache_n_op_run;
++extern atomic_unchecked_t fscache_n_op_enqueue;
++extern atomic_unchecked_t fscache_n_op_deferred_release;
++extern atomic_unchecked_t fscache_n_op_release;
++extern atomic_unchecked_t fscache_n_op_gc;
++extern atomic_unchecked_t fscache_n_op_cancelled;
++extern atomic_unchecked_t fscache_n_op_rejected;
 -extern atomic_t fscache_n_attr_changed;
 -extern atomic_t fscache_n_attr_changed_ok;
 -extern atomic_t fscache_n_attr_changed_nobufs;
 -extern atomic_t fscache_n_attr_changed_nomem;
 -extern atomic_t fscache_n_attr_changed_calls;
--
++extern atomic_unchecked_t fscache_n_attr_changed;
++extern atomic_unchecked_t fscache_n_attr_changed_ok;
++extern atomic_unchecked_t fscache_n_attr_changed_nobufs;
++extern atomic_unchecked_t fscache_n_attr_changed_nomem;
++extern atomic_unchecked_t fscache_n_attr_changed_calls;
 -extern atomic_t fscache_n_allocs;
 -extern atomic_t fscache_n_allocs_ok;
 -extern atomic_t fscache_n_allocs_wait;
@@ -42563,7 +44815,15 @@ diff -urNp linux-3.1.3/fs/fscache/internal.h linux-3.1.3/fs/fscache/internal.h
 -extern atomic_t fscache_n_allocs_object_dead;
 -extern atomic_t fscache_n_alloc_ops;
 -extern atomic_t fscache_n_alloc_op_waits;
--
++extern atomic_unchecked_t fscache_n_allocs;
++extern atomic_unchecked_t fscache_n_allocs_ok;
++extern atomic_unchecked_t fscache_n_allocs_wait;
++extern atomic_unchecked_t fscache_n_allocs_nobufs;
++extern atomic_unchecked_t fscache_n_allocs_intr;
++extern atomic_unchecked_t fscache_n_allocs_object_dead;
++extern atomic_unchecked_t fscache_n_alloc_ops;
++extern atomic_unchecked_t fscache_n_alloc_op_waits;
 -extern atomic_t fscache_n_retrievals;
 -extern atomic_t fscache_n_retrievals_ok;
 -extern atomic_t fscache_n_retrievals_wait;
@@ -42574,84 +44834,6 @@ diff -urNp linux-3.1.3/fs/fscache/internal.h linux-3.1.3/fs/fscache/internal.h
 -extern atomic_t fscache_n_retrievals_object_dead;
 -extern atomic_t fscache_n_retrieval_ops;
 -extern atomic_t fscache_n_retrieval_op_waits;
--
--extern atomic_t fscache_n_stores;
--extern atomic_t fscache_n_stores_ok;
--extern atomic_t fscache_n_stores_again;
--extern atomic_t fscache_n_stores_nobufs;
--extern atomic_t fscache_n_stores_oom;
--extern atomic_t fscache_n_store_ops;
--extern atomic_t fscache_n_store_calls;
--extern atomic_t fscache_n_store_pages;
--extern atomic_t fscache_n_store_radix_deletes;
--extern atomic_t fscache_n_store_pages_over_limit;
--
--extern atomic_t fscache_n_store_vmscan_not_storing;
--extern atomic_t fscache_n_store_vmscan_gone;
--extern atomic_t fscache_n_store_vmscan_busy;
--extern atomic_t fscache_n_store_vmscan_cancelled;
--
--extern atomic_t fscache_n_marks;
--extern atomic_t fscache_n_uncaches;
--
--extern atomic_t fscache_n_acquires;
--extern atomic_t fscache_n_acquires_null;
--extern atomic_t fscache_n_acquires_no_cache;
--extern atomic_t fscache_n_acquires_ok;
--extern atomic_t fscache_n_acquires_nobufs;
--extern atomic_t fscache_n_acquires_oom;
--
--extern atomic_t fscache_n_updates;
--extern atomic_t fscache_n_updates_null;
--extern atomic_t fscache_n_updates_run;
--
--extern atomic_t fscache_n_relinquishes;
--extern atomic_t fscache_n_relinquishes_null;
--extern atomic_t fscache_n_relinquishes_waitcrt;
--extern atomic_t fscache_n_relinquishes_retire;
--
--extern atomic_t fscache_n_cookie_index;
--extern atomic_t fscache_n_cookie_data;
--extern atomic_t fscache_n_cookie_special;
--
--extern atomic_t fscache_n_object_alloc;
--extern atomic_t fscache_n_object_no_alloc;
--extern atomic_t fscache_n_object_lookups;
--extern atomic_t fscache_n_object_lookups_negative;
--extern atomic_t fscache_n_object_lookups_positive;
--extern atomic_t fscache_n_object_lookups_timed_out;
--extern atomic_t fscache_n_object_created;
--extern atomic_t fscache_n_object_avail;
--extern atomic_t fscache_n_object_dead;
--
--extern atomic_t fscache_n_checkaux_none;
--extern atomic_t fscache_n_checkaux_okay;
--extern atomic_t fscache_n_checkaux_update;
--extern atomic_t fscache_n_checkaux_obsolete;
-+extern atomic_unchecked_t fscache_n_op_pend;
-+extern atomic_unchecked_t fscache_n_op_run;
-+extern atomic_unchecked_t fscache_n_op_enqueue;
-+extern atomic_unchecked_t fscache_n_op_deferred_release;
-+extern atomic_unchecked_t fscache_n_op_release;
-+extern atomic_unchecked_t fscache_n_op_gc;
-+extern atomic_unchecked_t fscache_n_op_cancelled;
-+extern atomic_unchecked_t fscache_n_op_rejected;
-+
-+extern atomic_unchecked_t fscache_n_attr_changed;
-+extern atomic_unchecked_t fscache_n_attr_changed_ok;
-+extern atomic_unchecked_t fscache_n_attr_changed_nobufs;
-+extern atomic_unchecked_t fscache_n_attr_changed_nomem;
-+extern atomic_unchecked_t fscache_n_attr_changed_calls;
-+
-+extern atomic_unchecked_t fscache_n_allocs;
-+extern atomic_unchecked_t fscache_n_allocs_ok;
-+extern atomic_unchecked_t fscache_n_allocs_wait;
-+extern atomic_unchecked_t fscache_n_allocs_nobufs;
-+extern atomic_unchecked_t fscache_n_allocs_intr;
-+extern atomic_unchecked_t fscache_n_allocs_object_dead;
-+extern atomic_unchecked_t fscache_n_alloc_ops;
-+extern atomic_unchecked_t fscache_n_alloc_op_waits;
-+
 +extern atomic_unchecked_t fscache_n_retrievals;
 +extern atomic_unchecked_t fscache_n_retrievals_ok;
 +extern atomic_unchecked_t fscache_n_retrievals_wait;
@@ -42662,7 +44844,17 @@ diff -urNp linux-3.1.3/fs/fscache/internal.h linux-3.1.3/fs/fscache/internal.h
 +extern atomic_unchecked_t fscache_n_retrievals_object_dead;
 +extern atomic_unchecked_t fscache_n_retrieval_ops;
 +extern atomic_unchecked_t fscache_n_retrieval_op_waits;
-+
+-extern atomic_t fscache_n_stores;
+-extern atomic_t fscache_n_stores_ok;
+-extern atomic_t fscache_n_stores_again;
+-extern atomic_t fscache_n_stores_nobufs;
+-extern atomic_t fscache_n_stores_oom;
+-extern atomic_t fscache_n_store_ops;
+-extern atomic_t fscache_n_store_calls;
+-extern atomic_t fscache_n_store_pages;
+-extern atomic_t fscache_n_store_radix_deletes;
+-extern atomic_t fscache_n_store_pages_over_limit;
 +extern atomic_unchecked_t fscache_n_stores;
 +extern atomic_unchecked_t fscache_n_stores_ok;
 +extern atomic_unchecked_t fscache_n_stores_again;
@@ -42673,35 +44865,66 @@ diff -urNp linux-3.1.3/fs/fscache/internal.h linux-3.1.3/fs/fscache/internal.h
 +extern atomic_unchecked_t fscache_n_store_pages;
 +extern atomic_unchecked_t fscache_n_store_radix_deletes;
 +extern atomic_unchecked_t fscache_n_store_pages_over_limit;
-+
+-extern atomic_t fscache_n_store_vmscan_not_storing;
+-extern atomic_t fscache_n_store_vmscan_gone;
+-extern atomic_t fscache_n_store_vmscan_busy;
+-extern atomic_t fscache_n_store_vmscan_cancelled;
 +extern atomic_unchecked_t fscache_n_store_vmscan_not_storing;
 +extern atomic_unchecked_t fscache_n_store_vmscan_gone;
 +extern atomic_unchecked_t fscache_n_store_vmscan_busy;
 +extern atomic_unchecked_t fscache_n_store_vmscan_cancelled;
-+
+-extern atomic_t fscache_n_marks;
+-extern atomic_t fscache_n_uncaches;
 +extern atomic_unchecked_t fscache_n_marks;
 +extern atomic_unchecked_t fscache_n_uncaches;
-+
+-extern atomic_t fscache_n_acquires;
+-extern atomic_t fscache_n_acquires_null;
+-extern atomic_t fscache_n_acquires_no_cache;
+-extern atomic_t fscache_n_acquires_ok;
+-extern atomic_t fscache_n_acquires_nobufs;
+-extern atomic_t fscache_n_acquires_oom;
 +extern atomic_unchecked_t fscache_n_acquires;
 +extern atomic_unchecked_t fscache_n_acquires_null;
 +extern atomic_unchecked_t fscache_n_acquires_no_cache;
 +extern atomic_unchecked_t fscache_n_acquires_ok;
 +extern atomic_unchecked_t fscache_n_acquires_nobufs;
 +extern atomic_unchecked_t fscache_n_acquires_oom;
-+
+-extern atomic_t fscache_n_updates;
+-extern atomic_t fscache_n_updates_null;
+-extern atomic_t fscache_n_updates_run;
 +extern atomic_unchecked_t fscache_n_updates;
 +extern atomic_unchecked_t fscache_n_updates_null;
 +extern atomic_unchecked_t fscache_n_updates_run;
-+
+-extern atomic_t fscache_n_relinquishes;
+-extern atomic_t fscache_n_relinquishes_null;
+-extern atomic_t fscache_n_relinquishes_waitcrt;
+-extern atomic_t fscache_n_relinquishes_retire;
 +extern atomic_unchecked_t fscache_n_relinquishes;
 +extern atomic_unchecked_t fscache_n_relinquishes_null;
 +extern atomic_unchecked_t fscache_n_relinquishes_waitcrt;
 +extern atomic_unchecked_t fscache_n_relinquishes_retire;
-+
+-extern atomic_t fscache_n_cookie_index;
+-extern atomic_t fscache_n_cookie_data;
+-extern atomic_t fscache_n_cookie_special;
 +extern atomic_unchecked_t fscache_n_cookie_index;
 +extern atomic_unchecked_t fscache_n_cookie_data;
 +extern atomic_unchecked_t fscache_n_cookie_special;
-+
+-extern atomic_t fscache_n_object_alloc;
+-extern atomic_t fscache_n_object_no_alloc;
+-extern atomic_t fscache_n_object_lookups;
+-extern atomic_t fscache_n_object_lookups_negative;
+-extern atomic_t fscache_n_object_lookups_positive;
+-extern atomic_t fscache_n_object_lookups_timed_out;
+-extern atomic_t fscache_n_object_created;
+-extern atomic_t fscache_n_object_avail;
+-extern atomic_t fscache_n_object_dead;
 +extern atomic_unchecked_t fscache_n_object_alloc;
 +extern atomic_unchecked_t fscache_n_object_no_alloc;
 +extern atomic_unchecked_t fscache_n_object_lookups;
@@ -42711,7 +44934,11 @@ diff -urNp linux-3.1.3/fs/fscache/internal.h linux-3.1.3/fs/fscache/internal.h
 +extern atomic_unchecked_t fscache_n_object_created;
 +extern atomic_unchecked_t fscache_n_object_avail;
 +extern atomic_unchecked_t fscache_n_object_dead;
-+
+-extern atomic_t fscache_n_checkaux_none;
+-extern atomic_t fscache_n_checkaux_okay;
+-extern atomic_t fscache_n_checkaux_update;
+-extern atomic_t fscache_n_checkaux_obsolete;
 +extern atomic_unchecked_t fscache_n_checkaux_none;
 +extern atomic_unchecked_t fscache_n_checkaux_okay;
 +extern atomic_unchecked_t fscache_n_checkaux_update;
@@ -42719,7 +44946,7 @@ diff -urNp linux-3.1.3/fs/fscache/internal.h linux-3.1.3/fs/fscache/internal.h
  
  extern atomic_t fscache_n_cop_alloc_object;
  extern atomic_t fscache_n_cop_lookup_object;
-@@ -255,6 +255,11 @@ static inline void fscache_stat(atomic_t
+@@ -255,6 +255,11 @@ static inline void fscache_stat(atomic_t *stat)
        atomic_inc(stat);
  }
  
@@ -42731,7 +44958,7 @@ diff -urNp linux-3.1.3/fs/fscache/internal.h linux-3.1.3/fs/fscache/internal.h
  static inline void fscache_stat_d(atomic_t *stat)
  {
        atomic_dec(stat);
-@@ -267,6 +272,7 @@ extern const struct file_operations fsca
+@@ -267,6 +272,7 @@ extern const struct file_operations fscache_stats_fops;
  
  #define __fscache_stat(stat) (NULL)
  #define fscache_stat(stat) do {} while (0)
@@ -42739,10 +44966,11 @@ diff -urNp linux-3.1.3/fs/fscache/internal.h linux-3.1.3/fs/fscache/internal.h
  #define fscache_stat_d(stat) do {} while (0)
  #endif
  
-diff -urNp linux-3.1.3/fs/fscache/object.c linux-3.1.3/fs/fscache/object.c
---- linux-3.1.3/fs/fscache/object.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/fscache/object.c    2011-11-16 18:39:08.000000000 -0500
-@@ -128,7 +128,7 @@ static void fscache_object_state_machine
+diff --git a/fs/fscache/object.c b/fs/fscache/object.c
+index b6b897c..0ffff9c 100644
+--- a/fs/fscache/object.c
++++ b/fs/fscache/object.c
+@@ -128,7 +128,7 @@ static void fscache_object_state_machine(struct fscache_object *object)
                /* update the object metadata on disk */
        case FSCACHE_OBJECT_UPDATING:
                clear_bit(FSCACHE_OBJECT_EV_UPDATE, &object->events);
@@ -42751,7 +44979,7 @@ diff -urNp linux-3.1.3/fs/fscache/object.c linux-3.1.3/fs/fscache/object.c
                fscache_stat(&fscache_n_cop_update_object);
                object->cache->ops->update_object(object);
                fscache_stat_d(&fscache_n_cop_update_object);
-@@ -217,7 +217,7 @@ static void fscache_object_state_machine
+@@ -217,7 +217,7 @@ static void fscache_object_state_machine(struct fscache_object *object)
                spin_lock(&object->lock);
                object->state = FSCACHE_OBJECT_DEAD;
                spin_unlock(&object->lock);
@@ -42760,7 +44988,7 @@ diff -urNp linux-3.1.3/fs/fscache/object.c linux-3.1.3/fs/fscache/object.c
                goto terminal_transit;
  
                /* handle the parent cache of this object being withdrawn from
-@@ -232,7 +232,7 @@ static void fscache_object_state_machine
+@@ -232,7 +232,7 @@ static void fscache_object_state_machine(struct fscache_object *object)
                spin_lock(&object->lock);
                object->state = FSCACHE_OBJECT_DEAD;
                spin_unlock(&object->lock);
@@ -42769,7 +44997,7 @@ diff -urNp linux-3.1.3/fs/fscache/object.c linux-3.1.3/fs/fscache/object.c
                goto terminal_transit;
  
                /* complain about the object being woken up once it is
-@@ -461,7 +461,7 @@ static void fscache_lookup_object(struct
+@@ -461,7 +461,7 @@ static void fscache_lookup_object(struct fscache_object *object)
               parent->cookie->def->name, cookie->def->name,
               object->cache->tag->name);
  
@@ -42778,7 +45006,7 @@ diff -urNp linux-3.1.3/fs/fscache/object.c linux-3.1.3/fs/fscache/object.c
        fscache_stat(&fscache_n_cop_lookup_object);
        ret = object->cache->ops->lookup_object(object);
        fscache_stat_d(&fscache_n_cop_lookup_object);
-@@ -472,7 +472,7 @@ static void fscache_lookup_object(struct
+@@ -472,7 +472,7 @@ static void fscache_lookup_object(struct fscache_object *object)
        if (ret == -ETIMEDOUT) {
                /* probably stuck behind another object, so move this one to
                 * the back of the queue */
@@ -42787,7 +45015,7 @@ diff -urNp linux-3.1.3/fs/fscache/object.c linux-3.1.3/fs/fscache/object.c
                set_bit(FSCACHE_OBJECT_EV_REQUEUE, &object->events);
        }
  
-@@ -495,7 +495,7 @@ void fscache_object_lookup_negative(stru
+@@ -495,7 +495,7 @@ void fscache_object_lookup_negative(struct fscache_object *object)
  
        spin_lock(&object->lock);
        if (object->state == FSCACHE_OBJECT_LOOKING_UP) {
@@ -42796,7 +45024,7 @@ diff -urNp linux-3.1.3/fs/fscache/object.c linux-3.1.3/fs/fscache/object.c
  
                /* transit here to allow write requests to begin stacking up
                 * and read requests to begin returning ENODATA */
-@@ -541,7 +541,7 @@ void fscache_obtained_object(struct fsca
+@@ -541,7 +541,7 @@ void fscache_obtained_object(struct fscache_object *object)
         * result, in which case there may be data available */
        spin_lock(&object->lock);
        if (object->state == FSCACHE_OBJECT_LOOKING_UP) {
@@ -42805,7 +45033,7 @@ diff -urNp linux-3.1.3/fs/fscache/object.c linux-3.1.3/fs/fscache/object.c
  
                clear_bit(FSCACHE_COOKIE_NO_DATA_YET, &cookie->flags);
  
-@@ -555,7 +555,7 @@ void fscache_obtained_object(struct fsca
+@@ -555,7 +555,7 @@ void fscache_obtained_object(struct fscache_object *object)
                set_bit(FSCACHE_OBJECT_EV_REQUEUE, &object->events);
        } else {
                ASSERTCMP(object->state, ==, FSCACHE_OBJECT_CREATING);
@@ -42814,7 +45042,7 @@ diff -urNp linux-3.1.3/fs/fscache/object.c linux-3.1.3/fs/fscache/object.c
  
                object->state = FSCACHE_OBJECT_AVAILABLE;
                spin_unlock(&object->lock);
-@@ -602,7 +602,7 @@ static void fscache_object_available(str
+@@ -602,7 +602,7 @@ static void fscache_object_available(struct fscache_object *object)
        fscache_enqueue_dependents(object);
  
        fscache_hist(fscache_obj_instantiate_histogram, object->lookup_jif);
@@ -42823,7 +45051,7 @@ diff -urNp linux-3.1.3/fs/fscache/object.c linux-3.1.3/fs/fscache/object.c
  
        _leave("");
  }
-@@ -861,7 +861,7 @@ enum fscache_checkaux fscache_check_aux(
+@@ -861,7 +861,7 @@ enum fscache_checkaux fscache_check_aux(struct fscache_object *object,
        enum fscache_checkaux result;
  
        if (!object->cookie->def->check_aux) {
@@ -42832,7 +45060,7 @@ diff -urNp linux-3.1.3/fs/fscache/object.c linux-3.1.3/fs/fscache/object.c
                return FSCACHE_CHECKAUX_OKAY;
        }
  
-@@ -870,17 +870,17 @@ enum fscache_checkaux fscache_check_aux(
+@@ -870,17 +870,17 @@ enum fscache_checkaux fscache_check_aux(struct fscache_object *object,
        switch (result) {
                /* entry okay as is */
        case FSCACHE_CHECKAUX_OKAY:
@@ -42853,9 +45081,10 @@ diff -urNp linux-3.1.3/fs/fscache/object.c linux-3.1.3/fs/fscache/object.c
                break;
  
        default:
-diff -urNp linux-3.1.3/fs/fscache/operation.c linux-3.1.3/fs/fscache/operation.c
---- linux-3.1.3/fs/fscache/operation.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/fscache/operation.c 2011-11-16 18:39:08.000000000 -0500
+diff --git a/fs/fscache/operation.c b/fs/fscache/operation.c
+index 30afdfa..2256596 100644
+--- a/fs/fscache/operation.c
++++ b/fs/fscache/operation.c
 @@ -17,7 +17,7 @@
  #include <linux/slab.h>
  #include "internal.h"
@@ -42865,7 +45094,7 @@ diff -urNp linux-3.1.3/fs/fscache/operation.c linux-3.1.3/fs/fscache/operation.c
  EXPORT_SYMBOL(fscache_op_debug_id);
  
  /**
-@@ -38,7 +38,7 @@ void fscache_enqueue_operation(struct fs
+@@ -38,7 +38,7 @@ void fscache_enqueue_operation(struct fscache_operation *op)
        ASSERTCMP(op->object->state, >=, FSCACHE_OBJECT_AVAILABLE);
        ASSERTCMP(atomic_read(&op->usage), >, 0);
  
@@ -42874,7 +45103,7 @@ diff -urNp linux-3.1.3/fs/fscache/operation.c linux-3.1.3/fs/fscache/operation.c
        switch (op->flags & FSCACHE_OP_TYPE) {
        case FSCACHE_OP_ASYNC:
                _debug("queue async");
-@@ -69,7 +69,7 @@ static void fscache_run_op(struct fscach
+@@ -69,7 +69,7 @@ static void fscache_run_op(struct fscache_object *object,
                wake_up_bit(&op->flags, FSCACHE_OP_WAITING);
        if (op->processor)
                fscache_enqueue_operation(op);
@@ -42883,7 +45112,7 @@ diff -urNp linux-3.1.3/fs/fscache/operation.c linux-3.1.3/fs/fscache/operation.c
  }
  
  /*
-@@ -98,11 +98,11 @@ int fscache_submit_exclusive_op(struct f
+@@ -98,11 +98,11 @@ int fscache_submit_exclusive_op(struct fscache_object *object,
                if (object->n_ops > 1) {
                        atomic_inc(&op->usage);
                        list_add_tail(&op->pend_link, &object->pending_ops);
@@ -42897,7 +45126,7 @@ diff -urNp linux-3.1.3/fs/fscache/operation.c linux-3.1.3/fs/fscache/operation.c
                        fscache_start_operations(object);
                } else {
                        ASSERTCMP(object->n_in_progress, ==, 0);
-@@ -118,7 +118,7 @@ int fscache_submit_exclusive_op(struct f
+@@ -118,7 +118,7 @@ int fscache_submit_exclusive_op(struct fscache_object *object,
                object->n_exclusive++;  /* reads and writes must wait */
                atomic_inc(&op->usage);
                list_add_tail(&op->pend_link, &object->pending_ops);
@@ -42906,7 +45135,7 @@ diff -urNp linux-3.1.3/fs/fscache/operation.c linux-3.1.3/fs/fscache/operation.c
                ret = 0;
        } else {
                /* not allowed to submit ops in any other state */
-@@ -203,11 +203,11 @@ int fscache_submit_op(struct fscache_obj
+@@ -203,11 +203,11 @@ int fscache_submit_op(struct fscache_object *object,
                if (object->n_exclusive > 0) {
                        atomic_inc(&op->usage);
                        list_add_tail(&op->pend_link, &object->pending_ops);
@@ -42920,7 +45149,7 @@ diff -urNp linux-3.1.3/fs/fscache/operation.c linux-3.1.3/fs/fscache/operation.c
                        fscache_start_operations(object);
                } else {
                        ASSERTCMP(object->n_exclusive, ==, 0);
-@@ -219,12 +219,12 @@ int fscache_submit_op(struct fscache_obj
+@@ -219,12 +219,12 @@ int fscache_submit_op(struct fscache_object *object,
                object->n_ops++;
                atomic_inc(&op->usage);
                list_add_tail(&op->pend_link, &object->pending_ops);
@@ -42935,7 +45164,7 @@ diff -urNp linux-3.1.3/fs/fscache/operation.c linux-3.1.3/fs/fscache/operation.c
                ret = -ENOBUFS;
        } else if (!test_bit(FSCACHE_IOERROR, &object->cache->flags)) {
                fscache_report_unexpected_submission(object, op, ostate);
-@@ -294,7 +294,7 @@ int fscache_cancel_op(struct fscache_ope
+@@ -294,7 +294,7 @@ int fscache_cancel_op(struct fscache_operation *op)
  
        ret = -EBUSY;
        if (!list_empty(&op->pend_link)) {
@@ -42944,7 +45173,7 @@ diff -urNp linux-3.1.3/fs/fscache/operation.c linux-3.1.3/fs/fscache/operation.c
                list_del_init(&op->pend_link);
                object->n_ops--;
                if (test_bit(FSCACHE_OP_EXCLUSIVE, &op->flags))
-@@ -331,7 +331,7 @@ void fscache_put_operation(struct fscach
+@@ -331,7 +331,7 @@ void fscache_put_operation(struct fscache_operation *op)
        if (test_and_set_bit(FSCACHE_OP_DEAD, &op->flags))
                BUG();
  
@@ -42953,7 +45182,7 @@ diff -urNp linux-3.1.3/fs/fscache/operation.c linux-3.1.3/fs/fscache/operation.c
  
        if (op->release) {
                op->release(op);
-@@ -348,7 +348,7 @@ void fscache_put_operation(struct fscach
+@@ -348,7 +348,7 @@ void fscache_put_operation(struct fscache_operation *op)
         * lock, and defer it otherwise */
        if (!spin_trylock(&object->lock)) {
                _debug("defer put");
@@ -42962,7 +45191,7 @@ diff -urNp linux-3.1.3/fs/fscache/operation.c linux-3.1.3/fs/fscache/operation.c
  
                cache = object->cache;
                spin_lock(&cache->op_gc_list_lock);
-@@ -410,7 +410,7 @@ void fscache_operation_gc(struct work_st
+@@ -410,7 +410,7 @@ void fscache_operation_gc(struct work_struct *work)
  
                _debug("GC DEFERRED REL OBJ%x OP%x",
                       object->debug_id, op->debug_id);
@@ -42971,10 +45200,11 @@ diff -urNp linux-3.1.3/fs/fscache/operation.c linux-3.1.3/fs/fscache/operation.c
  
                ASSERTCMP(atomic_read(&op->usage), ==, 0);
  
-diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
---- linux-3.1.3/fs/fscache/page.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/fscache/page.c      2011-11-16 18:39:08.000000000 -0500
-@@ -60,7 +60,7 @@ bool __fscache_maybe_release_page(struct
+diff --git a/fs/fscache/page.c b/fs/fscache/page.c
+index 3f7a59b..cf196cc 100644
+--- a/fs/fscache/page.c
++++ b/fs/fscache/page.c
+@@ -60,7 +60,7 @@ bool __fscache_maybe_release_page(struct fscache_cookie *cookie,
        val = radix_tree_lookup(&cookie->stores, page->index);
        if (!val) {
                rcu_read_unlock();
@@ -42983,7 +45213,7 @@ diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
                __fscache_uncache_page(cookie, page);
                return true;
        }
-@@ -90,11 +90,11 @@ bool __fscache_maybe_release_page(struct
+@@ -90,11 +90,11 @@ bool __fscache_maybe_release_page(struct fscache_cookie *cookie,
        spin_unlock(&cookie->stores_lock);
  
        if (xpage) {
@@ -43007,7 +45237,7 @@ diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
        return false;
  }
  EXPORT_SYMBOL(__fscache_maybe_release_page);
-@@ -131,7 +131,7 @@ static void fscache_end_page_write(struc
+@@ -131,7 +131,7 @@ static void fscache_end_page_write(struct fscache_object *object,
                                     FSCACHE_COOKIE_STORING_TAG);
                if (!radix_tree_tag_get(&cookie->stores, page->index,
                                        FSCACHE_COOKIE_PENDING_TAG)) {
@@ -43016,7 +45246,7 @@ diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
                        xpage = radix_tree_delete(&cookie->stores, page->index);
                }
                spin_unlock(&cookie->stores_lock);
-@@ -152,7 +152,7 @@ static void fscache_attr_changed_op(stru
+@@ -152,7 +152,7 @@ static void fscache_attr_changed_op(struct fscache_operation *op)
  
        _enter("{OBJ%x OP%x}", object->debug_id, op->debug_id);
  
@@ -43025,7 +45255,7 @@ diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
  
        if (fscache_object_is_active(object)) {
                fscache_stat(&fscache_n_cop_attr_changed);
-@@ -177,11 +177,11 @@ int __fscache_attr_changed(struct fscach
+@@ -177,11 +177,11 @@ int __fscache_attr_changed(struct fscache_cookie *cookie)
  
        ASSERTCMP(cookie->def->type, !=, FSCACHE_COOKIE_TYPE_INDEX);
  
@@ -43039,7 +45269,7 @@ diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
                _leave(" = -ENOMEM");
                return -ENOMEM;
        }
-@@ -199,7 +199,7 @@ int __fscache_attr_changed(struct fscach
+@@ -199,7 +199,7 @@ int __fscache_attr_changed(struct fscache_cookie *cookie)
        if (fscache_submit_exclusive_op(object, op) < 0)
                goto nobufs;
        spin_unlock(&cookie->lock);
@@ -43048,7 +45278,7 @@ diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
        fscache_put_operation(op);
        _leave(" = 0");
        return 0;
-@@ -207,7 +207,7 @@ int __fscache_attr_changed(struct fscach
+@@ -207,7 +207,7 @@ int __fscache_attr_changed(struct fscache_cookie *cookie)
  nobufs:
        spin_unlock(&cookie->lock);
        kfree(op);
@@ -43057,7 +45287,7 @@ diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
        _leave(" = %d", -ENOBUFS);
        return -ENOBUFS;
  }
-@@ -243,7 +243,7 @@ static struct fscache_retrieval *fscache
+@@ -243,7 +243,7 @@ static struct fscache_retrieval *fscache_alloc_retrieval(
        /* allocate a retrieval operation and attempt to submit it */
        op = kzalloc(sizeof(*op), GFP_NOIO);
        if (!op) {
@@ -43066,7 +45296,7 @@ diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
                return NULL;
        }
  
-@@ -271,13 +271,13 @@ static int fscache_wait_for_deferred_loo
+@@ -271,13 +271,13 @@ static int fscache_wait_for_deferred_lookup(struct fscache_cookie *cookie)
                return 0;
        }
  
@@ -43082,7 +45312,7 @@ diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
                _leave(" = -ERESTARTSYS");
                return -ERESTARTSYS;
        }
-@@ -295,8 +295,8 @@ static int fscache_wait_for_deferred_loo
+@@ -295,8 +295,8 @@ static int fscache_wait_for_deferred_lookup(struct fscache_cookie *cookie)
   */
  static int fscache_wait_for_retrieval_activation(struct fscache_object *object,
                                                 struct fscache_retrieval *op,
@@ -43093,7 +45323,7 @@ diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
  {
        int ret;
  
-@@ -304,7 +304,7 @@ static int fscache_wait_for_retrieval_ac
+@@ -304,7 +304,7 @@ static int fscache_wait_for_retrieval_activation(struct fscache_object *object,
                goto check_if_dead;
  
        _debug(">>> WT");
@@ -43102,7 +45332,7 @@ diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
        if (wait_on_bit(&op->op.flags, FSCACHE_OP_WAITING,
                        fscache_wait_bit_interruptible,
                        TASK_INTERRUPTIBLE) < 0) {
-@@ -321,7 +321,7 @@ static int fscache_wait_for_retrieval_ac
+@@ -321,7 +321,7 @@ static int fscache_wait_for_retrieval_activation(struct fscache_object *object,
  
  check_if_dead:
        if (unlikely(fscache_object_is_dead(object))) {
@@ -43111,7 +45341,7 @@ diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
                return -ENOBUFS;
        }
        return 0;
-@@ -348,7 +348,7 @@ int __fscache_read_or_alloc_page(struct 
+@@ -348,7 +348,7 @@ int __fscache_read_or_alloc_page(struct fscache_cookie *cookie,
  
        _enter("%p,%p,,,", cookie, page);
  
@@ -43120,7 +45350,7 @@ diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
  
        if (hlist_empty(&cookie->backing_objects))
                goto nobufs;
-@@ -381,7 +381,7 @@ int __fscache_read_or_alloc_page(struct 
+@@ -381,7 +381,7 @@ int __fscache_read_or_alloc_page(struct fscache_cookie *cookie,
                goto nobufs_unlock;
        spin_unlock(&cookie->lock);
  
@@ -43129,7 +45359,7 @@ diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
  
        /* pin the netfs read context in case we need to do the actual netfs
         * read because we've encountered a cache read failure */
-@@ -411,15 +411,15 @@ int __fscache_read_or_alloc_page(struct 
+@@ -411,15 +411,15 @@ int __fscache_read_or_alloc_page(struct fscache_cookie *cookie,
  
  error:
        if (ret == -ENOMEM)
@@ -43159,7 +45389,7 @@ diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
        _leave(" = -ENOBUFS");
        return -ENOBUFS;
  }
-@@ -467,7 +467,7 @@ int __fscache_read_or_alloc_pages(struct
+@@ -467,7 +467,7 @@ int __fscache_read_or_alloc_pages(struct fscache_cookie *cookie,
  
        _enter("%p,,%d,,,", cookie, *nr_pages);
  
@@ -43168,7 +45398,7 @@ diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
  
        if (hlist_empty(&cookie->backing_objects))
                goto nobufs;
-@@ -497,7 +497,7 @@ int __fscache_read_or_alloc_pages(struct
+@@ -497,7 +497,7 @@ int __fscache_read_or_alloc_pages(struct fscache_cookie *cookie,
                goto nobufs_unlock;
        spin_unlock(&cookie->lock);
  
@@ -43177,7 +45407,7 @@ diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
  
        /* pin the netfs read context in case we need to do the actual netfs
         * read because we've encountered a cache read failure */
-@@ -527,15 +527,15 @@ int __fscache_read_or_alloc_pages(struct
+@@ -527,15 +527,15 @@ int __fscache_read_or_alloc_pages(struct fscache_cookie *cookie,
  
  error:
        if (ret == -ENOMEM)
@@ -43207,7 +45437,7 @@ diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
        _leave(" = -ENOBUFS");
        return -ENOBUFS;
  }
-@@ -569,7 +569,7 @@ int __fscache_alloc_page(struct fscache_
+@@ -569,7 +569,7 @@ int __fscache_alloc_page(struct fscache_cookie *cookie,
  
        _enter("%p,%p,,,", cookie, page);
  
@@ -43216,7 +45446,7 @@ diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
  
        if (hlist_empty(&cookie->backing_objects))
                goto nobufs;
-@@ -595,7 +595,7 @@ int __fscache_alloc_page(struct fscache_
+@@ -595,7 +595,7 @@ int __fscache_alloc_page(struct fscache_cookie *cookie,
                goto nobufs_unlock;
        spin_unlock(&cookie->lock);
  
@@ -43225,7 +45455,7 @@ diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
  
        ret = fscache_wait_for_retrieval_activation(
                object, op,
-@@ -611,11 +611,11 @@ int __fscache_alloc_page(struct fscache_
+@@ -611,11 +611,11 @@ int __fscache_alloc_page(struct fscache_cookie *cookie,
  
  error:
        if (ret == -ERESTARTSYS)
@@ -43249,7 +45479,7 @@ diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
        _leave(" = -ENOBUFS");
        return -ENOBUFS;
  }
-@@ -666,7 +666,7 @@ static void fscache_write_op(struct fsca
+@@ -666,7 +666,7 @@ static void fscache_write_op(struct fscache_operation *_op)
  
        spin_lock(&cookie->stores_lock);
  
@@ -43258,7 +45488,7 @@ diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
  
        /* find a page to store */
        page = NULL;
-@@ -677,7 +677,7 @@ static void fscache_write_op(struct fsca
+@@ -677,7 +677,7 @@ static void fscache_write_op(struct fscache_operation *_op)
        page = results[0];
        _debug("gang %d [%lx]", n, page->index);
        if (page->index > op->store_limit) {
@@ -43267,7 +45497,7 @@ diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
                goto superseded;
        }
  
-@@ -689,7 +689,7 @@ static void fscache_write_op(struct fsca
+@@ -689,7 +689,7 @@ static void fscache_write_op(struct fscache_operation *_op)
        spin_unlock(&cookie->stores_lock);
        spin_unlock(&object->lock);
  
@@ -43276,7 +45506,7 @@ diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
        fscache_stat(&fscache_n_cop_write_page);
        ret = object->cache->ops->write_page(op, page);
        fscache_stat_d(&fscache_n_cop_write_page);
-@@ -757,7 +757,7 @@ int __fscache_write_page(struct fscache_
+@@ -757,7 +757,7 @@ int __fscache_write_page(struct fscache_cookie *cookie,
        ASSERTCMP(cookie->def->type, !=, FSCACHE_COOKIE_TYPE_INDEX);
        ASSERT(PageFsCache(page));
  
@@ -43285,7 +45515,7 @@ diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
  
        op = kzalloc(sizeof(*op), GFP_NOIO);
        if (!op)
-@@ -808,7 +808,7 @@ int __fscache_write_page(struct fscache_
+@@ -808,7 +808,7 @@ int __fscache_write_page(struct fscache_cookie *cookie,
        spin_unlock(&cookie->stores_lock);
        spin_unlock(&object->lock);
  
@@ -43294,7 +45524,7 @@ diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
        op->store_limit = object->store_limit;
  
        if (fscache_submit_op(object, &op->op) < 0)
-@@ -816,8 +816,8 @@ int __fscache_write_page(struct fscache_
+@@ -816,8 +816,8 @@ int __fscache_write_page(struct fscache_cookie *cookie,
  
        spin_unlock(&cookie->lock);
        radix_tree_preload_end();
@@ -43305,7 +45535,7 @@ diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
  
        /* the work queue now carries its own ref on the object */
        fscache_put_operation(&op->op);
-@@ -825,14 +825,14 @@ int __fscache_write_page(struct fscache_
+@@ -825,14 +825,14 @@ int __fscache_write_page(struct fscache_cookie *cookie,
        return 0;
  
  already_queued:
@@ -43339,7 +45569,7 @@ diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
        _leave(" = -ENOMEM");
        return -ENOMEM;
  }
-@@ -876,7 +876,7 @@ void __fscache_uncache_page(struct fscac
+@@ -876,7 +876,7 @@ void __fscache_uncache_page(struct fscache_cookie *cookie, struct page *page)
        ASSERTCMP(cookie->def->type, !=, FSCACHE_COOKIE_TYPE_INDEX);
        ASSERTCMP(page, !=, NULL);
  
@@ -43348,7 +45578,7 @@ diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
  
        /* cache withdrawal may beat us to it */
        if (!PageFsCache(page))
-@@ -929,7 +929,7 @@ void fscache_mark_pages_cached(struct fs
+@@ -929,7 +929,7 @@ void fscache_mark_pages_cached(struct fscache_retrieval *op,
        unsigned long loop;
  
  #ifdef CONFIG_FSCACHE_STATS
@@ -43357,9 +45587,10 @@ diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
  #endif
  
        for (loop = 0; loop < pagevec->nr; loop++) {
-diff -urNp linux-3.1.3/fs/fscache/stats.c linux-3.1.3/fs/fscache/stats.c
---- linux-3.1.3/fs/fscache/stats.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/fscache/stats.c     2011-11-16 18:39:08.000000000 -0500
+diff --git a/fs/fscache/stats.c b/fs/fscache/stats.c
+index 4765190..2a067f2 100644
+--- a/fs/fscache/stats.c
++++ b/fs/fscache/stats.c
 @@ -18,95 +18,95 @@
  /*
   * operation counters
@@ -43373,13 +45604,27 @@ diff -urNp linux-3.1.3/fs/fscache/stats.c linux-3.1.3/fs/fscache/stats.c
 -atomic_t fscache_n_op_gc;
 -atomic_t fscache_n_op_cancelled;
 -atomic_t fscache_n_op_rejected;
--
++atomic_unchecked_t fscache_n_op_pend;
++atomic_unchecked_t fscache_n_op_run;
++atomic_unchecked_t fscache_n_op_enqueue;
++atomic_unchecked_t fscache_n_op_requeue;
++atomic_unchecked_t fscache_n_op_deferred_release;
++atomic_unchecked_t fscache_n_op_release;
++atomic_unchecked_t fscache_n_op_gc;
++atomic_unchecked_t fscache_n_op_cancelled;
++atomic_unchecked_t fscache_n_op_rejected;
 -atomic_t fscache_n_attr_changed;
 -atomic_t fscache_n_attr_changed_ok;
 -atomic_t fscache_n_attr_changed_nobufs;
 -atomic_t fscache_n_attr_changed_nomem;
 -atomic_t fscache_n_attr_changed_calls;
--
++atomic_unchecked_t fscache_n_attr_changed;
++atomic_unchecked_t fscache_n_attr_changed_ok;
++atomic_unchecked_t fscache_n_attr_changed_nobufs;
++atomic_unchecked_t fscache_n_attr_changed_nomem;
++atomic_unchecked_t fscache_n_attr_changed_calls;
 -atomic_t fscache_n_allocs;
 -atomic_t fscache_n_allocs_ok;
 -atomic_t fscache_n_allocs_wait;
@@ -43388,7 +45633,15 @@ diff -urNp linux-3.1.3/fs/fscache/stats.c linux-3.1.3/fs/fscache/stats.c
 -atomic_t fscache_n_allocs_object_dead;
 -atomic_t fscache_n_alloc_ops;
 -atomic_t fscache_n_alloc_op_waits;
--
++atomic_unchecked_t fscache_n_allocs;
++atomic_unchecked_t fscache_n_allocs_ok;
++atomic_unchecked_t fscache_n_allocs_wait;
++atomic_unchecked_t fscache_n_allocs_nobufs;
++atomic_unchecked_t fscache_n_allocs_intr;
++atomic_unchecked_t fscache_n_allocs_object_dead;
++atomic_unchecked_t fscache_n_alloc_ops;
++atomic_unchecked_t fscache_n_alloc_op_waits;
 -atomic_t fscache_n_retrievals;
 -atomic_t fscache_n_retrievals_ok;
 -atomic_t fscache_n_retrievals_wait;
@@ -43399,85 +45652,6 @@ diff -urNp linux-3.1.3/fs/fscache/stats.c linux-3.1.3/fs/fscache/stats.c
 -atomic_t fscache_n_retrievals_object_dead;
 -atomic_t fscache_n_retrieval_ops;
 -atomic_t fscache_n_retrieval_op_waits;
--
--atomic_t fscache_n_stores;
--atomic_t fscache_n_stores_ok;
--atomic_t fscache_n_stores_again;
--atomic_t fscache_n_stores_nobufs;
--atomic_t fscache_n_stores_oom;
--atomic_t fscache_n_store_ops;
--atomic_t fscache_n_store_calls;
--atomic_t fscache_n_store_pages;
--atomic_t fscache_n_store_radix_deletes;
--atomic_t fscache_n_store_pages_over_limit;
--
--atomic_t fscache_n_store_vmscan_not_storing;
--atomic_t fscache_n_store_vmscan_gone;
--atomic_t fscache_n_store_vmscan_busy;
--atomic_t fscache_n_store_vmscan_cancelled;
--
--atomic_t fscache_n_marks;
--atomic_t fscache_n_uncaches;
--
--atomic_t fscache_n_acquires;
--atomic_t fscache_n_acquires_null;
--atomic_t fscache_n_acquires_no_cache;
--atomic_t fscache_n_acquires_ok;
--atomic_t fscache_n_acquires_nobufs;
--atomic_t fscache_n_acquires_oom;
--
--atomic_t fscache_n_updates;
--atomic_t fscache_n_updates_null;
--atomic_t fscache_n_updates_run;
--
--atomic_t fscache_n_relinquishes;
--atomic_t fscache_n_relinquishes_null;
--atomic_t fscache_n_relinquishes_waitcrt;
--atomic_t fscache_n_relinquishes_retire;
--
--atomic_t fscache_n_cookie_index;
--atomic_t fscache_n_cookie_data;
--atomic_t fscache_n_cookie_special;
--
--atomic_t fscache_n_object_alloc;
--atomic_t fscache_n_object_no_alloc;
--atomic_t fscache_n_object_lookups;
--atomic_t fscache_n_object_lookups_negative;
--atomic_t fscache_n_object_lookups_positive;
--atomic_t fscache_n_object_lookups_timed_out;
--atomic_t fscache_n_object_created;
--atomic_t fscache_n_object_avail;
--atomic_t fscache_n_object_dead;
--
--atomic_t fscache_n_checkaux_none;
--atomic_t fscache_n_checkaux_okay;
--atomic_t fscache_n_checkaux_update;
--atomic_t fscache_n_checkaux_obsolete;
-+atomic_unchecked_t fscache_n_op_pend;
-+atomic_unchecked_t fscache_n_op_run;
-+atomic_unchecked_t fscache_n_op_enqueue;
-+atomic_unchecked_t fscache_n_op_requeue;
-+atomic_unchecked_t fscache_n_op_deferred_release;
-+atomic_unchecked_t fscache_n_op_release;
-+atomic_unchecked_t fscache_n_op_gc;
-+atomic_unchecked_t fscache_n_op_cancelled;
-+atomic_unchecked_t fscache_n_op_rejected;
-+
-+atomic_unchecked_t fscache_n_attr_changed;
-+atomic_unchecked_t fscache_n_attr_changed_ok;
-+atomic_unchecked_t fscache_n_attr_changed_nobufs;
-+atomic_unchecked_t fscache_n_attr_changed_nomem;
-+atomic_unchecked_t fscache_n_attr_changed_calls;
-+
-+atomic_unchecked_t fscache_n_allocs;
-+atomic_unchecked_t fscache_n_allocs_ok;
-+atomic_unchecked_t fscache_n_allocs_wait;
-+atomic_unchecked_t fscache_n_allocs_nobufs;
-+atomic_unchecked_t fscache_n_allocs_intr;
-+atomic_unchecked_t fscache_n_allocs_object_dead;
-+atomic_unchecked_t fscache_n_alloc_ops;
-+atomic_unchecked_t fscache_n_alloc_op_waits;
-+
 +atomic_unchecked_t fscache_n_retrievals;
 +atomic_unchecked_t fscache_n_retrievals_ok;
 +atomic_unchecked_t fscache_n_retrievals_wait;
@@ -43488,7 +45662,17 @@ diff -urNp linux-3.1.3/fs/fscache/stats.c linux-3.1.3/fs/fscache/stats.c
 +atomic_unchecked_t fscache_n_retrievals_object_dead;
 +atomic_unchecked_t fscache_n_retrieval_ops;
 +atomic_unchecked_t fscache_n_retrieval_op_waits;
-+
+-atomic_t fscache_n_stores;
+-atomic_t fscache_n_stores_ok;
+-atomic_t fscache_n_stores_again;
+-atomic_t fscache_n_stores_nobufs;
+-atomic_t fscache_n_stores_oom;
+-atomic_t fscache_n_store_ops;
+-atomic_t fscache_n_store_calls;
+-atomic_t fscache_n_store_pages;
+-atomic_t fscache_n_store_radix_deletes;
+-atomic_t fscache_n_store_pages_over_limit;
 +atomic_unchecked_t fscache_n_stores;
 +atomic_unchecked_t fscache_n_stores_ok;
 +atomic_unchecked_t fscache_n_stores_again;
@@ -43499,35 +45683,66 @@ diff -urNp linux-3.1.3/fs/fscache/stats.c linux-3.1.3/fs/fscache/stats.c
 +atomic_unchecked_t fscache_n_store_pages;
 +atomic_unchecked_t fscache_n_store_radix_deletes;
 +atomic_unchecked_t fscache_n_store_pages_over_limit;
-+
+-atomic_t fscache_n_store_vmscan_not_storing;
+-atomic_t fscache_n_store_vmscan_gone;
+-atomic_t fscache_n_store_vmscan_busy;
+-atomic_t fscache_n_store_vmscan_cancelled;
 +atomic_unchecked_t fscache_n_store_vmscan_not_storing;
 +atomic_unchecked_t fscache_n_store_vmscan_gone;
 +atomic_unchecked_t fscache_n_store_vmscan_busy;
 +atomic_unchecked_t fscache_n_store_vmscan_cancelled;
-+
+-atomic_t fscache_n_marks;
+-atomic_t fscache_n_uncaches;
 +atomic_unchecked_t fscache_n_marks;
 +atomic_unchecked_t fscache_n_uncaches;
-+
+-atomic_t fscache_n_acquires;
+-atomic_t fscache_n_acquires_null;
+-atomic_t fscache_n_acquires_no_cache;
+-atomic_t fscache_n_acquires_ok;
+-atomic_t fscache_n_acquires_nobufs;
+-atomic_t fscache_n_acquires_oom;
 +atomic_unchecked_t fscache_n_acquires;
 +atomic_unchecked_t fscache_n_acquires_null;
 +atomic_unchecked_t fscache_n_acquires_no_cache;
 +atomic_unchecked_t fscache_n_acquires_ok;
 +atomic_unchecked_t fscache_n_acquires_nobufs;
 +atomic_unchecked_t fscache_n_acquires_oom;
-+
+-atomic_t fscache_n_updates;
+-atomic_t fscache_n_updates_null;
+-atomic_t fscache_n_updates_run;
 +atomic_unchecked_t fscache_n_updates;
 +atomic_unchecked_t fscache_n_updates_null;
 +atomic_unchecked_t fscache_n_updates_run;
-+
+-atomic_t fscache_n_relinquishes;
+-atomic_t fscache_n_relinquishes_null;
+-atomic_t fscache_n_relinquishes_waitcrt;
+-atomic_t fscache_n_relinquishes_retire;
 +atomic_unchecked_t fscache_n_relinquishes;
 +atomic_unchecked_t fscache_n_relinquishes_null;
 +atomic_unchecked_t fscache_n_relinquishes_waitcrt;
 +atomic_unchecked_t fscache_n_relinquishes_retire;
-+
+-atomic_t fscache_n_cookie_index;
+-atomic_t fscache_n_cookie_data;
+-atomic_t fscache_n_cookie_special;
 +atomic_unchecked_t fscache_n_cookie_index;
 +atomic_unchecked_t fscache_n_cookie_data;
 +atomic_unchecked_t fscache_n_cookie_special;
-+
+-atomic_t fscache_n_object_alloc;
+-atomic_t fscache_n_object_no_alloc;
+-atomic_t fscache_n_object_lookups;
+-atomic_t fscache_n_object_lookups_negative;
+-atomic_t fscache_n_object_lookups_positive;
+-atomic_t fscache_n_object_lookups_timed_out;
+-atomic_t fscache_n_object_created;
+-atomic_t fscache_n_object_avail;
+-atomic_t fscache_n_object_dead;
 +atomic_unchecked_t fscache_n_object_alloc;
 +atomic_unchecked_t fscache_n_object_no_alloc;
 +atomic_unchecked_t fscache_n_object_lookups;
@@ -43537,7 +45752,11 @@ diff -urNp linux-3.1.3/fs/fscache/stats.c linux-3.1.3/fs/fscache/stats.c
 +atomic_unchecked_t fscache_n_object_created;
 +atomic_unchecked_t fscache_n_object_avail;
 +atomic_unchecked_t fscache_n_object_dead;
-+
+-atomic_t fscache_n_checkaux_none;
+-atomic_t fscache_n_checkaux_okay;
+-atomic_t fscache_n_checkaux_update;
+-atomic_t fscache_n_checkaux_obsolete;
 +atomic_unchecked_t fscache_n_checkaux_none;
 +atomic_unchecked_t fscache_n_checkaux_okay;
 +atomic_unchecked_t fscache_n_checkaux_update;
@@ -43545,7 +45764,7 @@ diff -urNp linux-3.1.3/fs/fscache/stats.c linux-3.1.3/fs/fscache/stats.c
  
  atomic_t fscache_n_cop_alloc_object;
  atomic_t fscache_n_cop_lookup_object;
-@@ -133,113 +133,113 @@ static int fscache_stats_show(struct seq
+@@ -133,113 +133,113 @@ static int fscache_stats_show(struct seq_file *m, void *v)
        seq_puts(m, "FS-Cache statistics\n");
  
        seq_printf(m, "Cookies: idx=%u dat=%u spc=%u\n",
@@ -43735,101 +45954,10 @@ diff -urNp linux-3.1.3/fs/fscache/stats.c linux-3.1.3/fs/fscache/stats.c
  
        seq_printf(m, "CacheOp: alo=%d luo=%d luc=%d gro=%d\n",
                   atomic_read(&fscache_n_cop_alloc_object),
-diff -urNp linux-3.1.3/fs/fs_struct.c linux-3.1.3/fs/fs_struct.c
---- linux-3.1.3/fs/fs_struct.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/fs_struct.c 2011-11-16 18:40:29.000000000 -0500
-@@ -4,6 +4,7 @@
- #include <linux/path.h>
- #include <linux/slab.h>
- #include <linux/fs_struct.h>
-+#include <linux/grsecurity.h>
- #include "internal.h"
- static inline void path_get_longterm(struct path *path)
-@@ -31,6 +32,7 @@ void set_fs_root(struct fs_struct *fs, s
-       old_root = fs->root;
-       fs->root = *path;
-       path_get_longterm(path);
-+      gr_set_chroot_entries(current, path);
-       write_seqcount_end(&fs->seq);
-       spin_unlock(&fs->lock);
-       if (old_root.dentry)
-@@ -74,6 +76,7 @@ void chroot_fs_refs(struct path *old_roo
-                           && fs->root.mnt == old_root->mnt) {
-                               path_get_longterm(new_root);
-                               fs->root = *new_root;
-+                              gr_set_chroot_entries(p, new_root);
-                               count++;
-                       }
-                       if (fs->pwd.dentry == old_root->dentry
-@@ -109,7 +112,8 @@ void exit_fs(struct task_struct *tsk)
-               spin_lock(&fs->lock);
-               write_seqcount_begin(&fs->seq);
-               tsk->fs = NULL;
--              kill = !--fs->users;
-+              gr_clear_chroot_entries(tsk);
-+              kill = !atomic_dec_return(&fs->users);
-               write_seqcount_end(&fs->seq);
-               spin_unlock(&fs->lock);
-               task_unlock(tsk);
-@@ -123,7 +127,7 @@ struct fs_struct *copy_fs_struct(struct 
-       struct fs_struct *fs = kmem_cache_alloc(fs_cachep, GFP_KERNEL);
-       /* We don't need to lock fs - think why ;-) */
-       if (fs) {
--              fs->users = 1;
-+              atomic_set(&fs->users, 1);
-               fs->in_exec = 0;
-               spin_lock_init(&fs->lock);
-               seqcount_init(&fs->seq);
-@@ -132,6 +136,9 @@ struct fs_struct *copy_fs_struct(struct 
-               spin_lock(&old->lock);
-               fs->root = old->root;
-               path_get_longterm(&fs->root);
-+              /* instead of calling gr_set_chroot_entries here,
-+                 we call it from every caller of this function
-+              */
-               fs->pwd = old->pwd;
-               path_get_longterm(&fs->pwd);
-               spin_unlock(&old->lock);
-@@ -150,8 +157,9 @@ int unshare_fs_struct(void)
-       task_lock(current);
-       spin_lock(&fs->lock);
--      kill = !--fs->users;
-+      kill = !atomic_dec_return(&fs->users);
-       current->fs = new_fs;
-+      gr_set_chroot_entries(current, &new_fs->root);
-       spin_unlock(&fs->lock);
-       task_unlock(current);
-@@ -170,7 +178,7 @@ EXPORT_SYMBOL(current_umask);
- /* to be mentioned only in INIT_TASK */
- struct fs_struct init_fs = {
--      .users          = 1,
-+      .users          = ATOMIC_INIT(1),
-       .lock           = __SPIN_LOCK_UNLOCKED(init_fs.lock),
-       .seq            = SEQCNT_ZERO,
-       .umask          = 0022,
-@@ -186,12 +194,13 @@ void daemonize_fs_struct(void)
-               task_lock(current);
-               spin_lock(&init_fs.lock);
--              init_fs.users++;
-+              atomic_inc(&init_fs.users);
-               spin_unlock(&init_fs.lock);
-               spin_lock(&fs->lock);
-               current->fs = &init_fs;
--              kill = !--fs->users;
-+              gr_set_chroot_entries(current, &current->fs->root);
-+              kill = !atomic_dec_return(&fs->users);
-               spin_unlock(&fs->lock);
-               task_unlock(current);
-diff -urNp linux-3.1.3/fs/fuse/cuse.c linux-3.1.3/fs/fuse/cuse.c
---- linux-3.1.3/fs/fuse/cuse.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/fuse/cuse.c 2011-11-16 18:39:08.000000000 -0500
+diff --git a/fs/fuse/cuse.c b/fs/fuse/cuse.c
+index b6cca47..ec782c3 100644
+--- a/fs/fuse/cuse.c
++++ b/fs/fuse/cuse.c
 @@ -586,10 +586,12 @@ static int __init cuse_init(void)
                INIT_LIST_HEAD(&cuse_conntbl[i]);
  
@@ -43847,10 +45975,11 @@ diff -urNp linux-3.1.3/fs/fuse/cuse.c linux-3.1.3/fs/fuse/cuse.c
  
        cuse_class = class_create(THIS_MODULE, "cuse");
        if (IS_ERR(cuse_class))
-diff -urNp linux-3.1.3/fs/fuse/dev.c linux-3.1.3/fs/fuse/dev.c
---- linux-3.1.3/fs/fuse/dev.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/fuse/dev.c  2011-11-16 18:39:08.000000000 -0500
-@@ -1242,7 +1242,7 @@ static ssize_t fuse_dev_splice_read(stru
+diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
+index 5cb8614..6865b11 100644
+--- a/fs/fuse/dev.c
++++ b/fs/fuse/dev.c
+@@ -1242,7 +1242,7 @@ static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos,
        ret = 0;
        pipe_lock(pipe);
  
@@ -43859,10 +45988,11 @@ diff -urNp linux-3.1.3/fs/fuse/dev.c linux-3.1.3/fs/fuse/dev.c
                send_sig(SIGPIPE, current, 0);
                if (!ret)
                        ret = -EPIPE;
-diff -urNp linux-3.1.3/fs/fuse/dir.c linux-3.1.3/fs/fuse/dir.c
---- linux-3.1.3/fs/fuse/dir.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/fuse/dir.c  2011-11-16 18:39:08.000000000 -0500
-@@ -1147,7 +1147,7 @@ static char *read_link(struct dentry *de
+diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
+index 9f63e49..d8a64c0 100644
+--- a/fs/fuse/dir.c
++++ b/fs/fuse/dir.c
+@@ -1147,7 +1147,7 @@ static char *read_link(struct dentry *dentry)
        return link;
  }
  
@@ -43871,9 +46001,10 @@ diff -urNp linux-3.1.3/fs/fuse/dir.c linux-3.1.3/fs/fuse/dir.c
  {
        if (!IS_ERR(link))
                free_page((unsigned long) link);
-diff -urNp linux-3.1.3/fs/gfs2/inode.c linux-3.1.3/fs/gfs2/inode.c
---- linux-3.1.3/fs/gfs2/inode.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/gfs2/inode.c        2011-11-16 18:39:08.000000000 -0500
+diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
+index 900cf98..3896726 100644
+--- a/fs/gfs2/inode.c
++++ b/fs/gfs2/inode.c
 @@ -1517,7 +1517,7 @@ out:
  
  static void gfs2_put_link(struct dentry *dentry, struct nameidata *nd, void *p)
@@ -43883,10 +46014,11 @@ diff -urNp linux-3.1.3/fs/gfs2/inode.c linux-3.1.3/fs/gfs2/inode.c
        if (!IS_ERR(s))
                kfree(s);
  }
-diff -urNp linux-3.1.3/fs/hfs/btree.c linux-3.1.3/fs/hfs/btree.c
---- linux-3.1.3/fs/hfs/btree.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/hfs/btree.c 2011-11-18 18:48:11.000000000 -0500
-@@ -46,11 +46,27 @@ struct hfs_btree *hfs_btree_open(struct 
+diff --git a/fs/hfs/btree.c b/fs/hfs/btree.c
+index 3ebc437..eb23952 100644
+--- a/fs/hfs/btree.c
++++ b/fs/hfs/btree.c
+@@ -46,11 +46,27 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke
        case HFS_EXT_CNID:
                hfs_inode_read_fork(tree->inode, mdb->drXTExtRec, mdb->drXTFlSize,
                                    mdb->drXTFlSize, be32_to_cpu(mdb->drXTClpSiz));
@@ -43914,7 +46046,7 @@ diff -urNp linux-3.1.3/fs/hfs/btree.c linux-3.1.3/fs/hfs/btree.c
                tree->inode->i_mapping->a_ops = &hfs_btree_aops;
                break;
        default:
-@@ -59,11 +75,6 @@ struct hfs_btree *hfs_btree_open(struct 
+@@ -59,11 +75,6 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke
        }
        unlock_new_inode(tree->inode);
  
@@ -43926,10 +46058,11 @@ diff -urNp linux-3.1.3/fs/hfs/btree.c linux-3.1.3/fs/hfs/btree.c
        mapping = tree->inode->i_mapping;
        page = read_mapping_page(mapping, 0, NULL);
        if (IS_ERR(page))
-diff -urNp linux-3.1.3/fs/hfsplus/catalog.c linux-3.1.3/fs/hfsplus/catalog.c
---- linux-3.1.3/fs/hfsplus/catalog.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/hfsplus/catalog.c   2011-11-16 19:23:09.000000000 -0500
-@@ -179,6 +179,8 @@ int hfsplus_find_cat(struct super_block 
+diff --git a/fs/hfsplus/catalog.c b/fs/hfsplus/catalog.c
+index 4dfbfec..947c9c2 100644
+--- a/fs/hfsplus/catalog.c
++++ b/fs/hfsplus/catalog.c
+@@ -179,6 +179,8 @@ int hfsplus_find_cat(struct super_block *sb, u32 cnid,
        int err;
        u16 type;
  
@@ -43938,7 +46071,7 @@ diff -urNp linux-3.1.3/fs/hfsplus/catalog.c linux-3.1.3/fs/hfsplus/catalog.c
        hfsplus_cat_build_key(sb, fd->search_key, cnid, NULL);
        err = hfs_brec_read(fd, &tmp, sizeof(hfsplus_cat_entry));
        if (err)
-@@ -210,6 +212,8 @@ int hfsplus_create_cat(u32 cnid, struct 
+@@ -210,6 +212,8 @@ int hfsplus_create_cat(u32 cnid, struct inode *dir,
        int entry_size;
        int err;
  
@@ -43956,10 +46089,11 @@ diff -urNp linux-3.1.3/fs/hfsplus/catalog.c linux-3.1.3/fs/hfsplus/catalog.c
        dprint(DBG_CAT_MOD, "rename_cat: %u - %lu,%s - %lu,%s\n",
                cnid, src_dir->i_ino, src_name->name,
                dst_dir->i_ino, dst_name->name);
-diff -urNp linux-3.1.3/fs/hfsplus/dir.c linux-3.1.3/fs/hfsplus/dir.c
---- linux-3.1.3/fs/hfsplus/dir.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/hfsplus/dir.c       2011-11-16 18:40:29.000000000 -0500
-@@ -131,6 +131,8 @@ static int hfsplus_readdir(struct file *
+diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c
+index 25b2443..09a3341 100644
+--- a/fs/hfsplus/dir.c
++++ b/fs/hfsplus/dir.c
+@@ -131,6 +131,8 @@ static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir)
        struct hfsplus_readdir_data *rd;
        u16 type;
  
@@ -43968,10 +46102,11 @@ diff -urNp linux-3.1.3/fs/hfsplus/dir.c linux-3.1.3/fs/hfsplus/dir.c
        if (filp->f_pos >= inode->i_size)
                return 0;
  
-diff -urNp linux-3.1.3/fs/hfsplus/inode.c linux-3.1.3/fs/hfsplus/inode.c
---- linux-3.1.3/fs/hfsplus/inode.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/hfsplus/inode.c     2011-11-16 18:40:29.000000000 -0500
-@@ -501,6 +501,8 @@ int hfsplus_cat_read_inode(struct inode 
+diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c
+index 4cc1e3a..ad0f70b 100644
+--- a/fs/hfsplus/inode.c
++++ b/fs/hfsplus/inode.c
+@@ -501,6 +501,8 @@ int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd)
        int res = 0;
        u16 type;
  
@@ -43980,7 +46115,7 @@ diff -urNp linux-3.1.3/fs/hfsplus/inode.c linux-3.1.3/fs/hfsplus/inode.c
        type = hfs_bnode_read_u16(fd->bnode, fd->entryoffset);
  
        HFSPLUS_I(inode)->linkid = 0;
-@@ -564,6 +566,8 @@ int hfsplus_cat_write_inode(struct inode
+@@ -564,6 +566,8 @@ int hfsplus_cat_write_inode(struct inode *inode)
        struct hfs_find_data fd;
        hfsplus_cat_entry entry;
  
@@ -43989,10 +46124,11 @@ diff -urNp linux-3.1.3/fs/hfsplus/inode.c linux-3.1.3/fs/hfsplus/inode.c
        if (HFSPLUS_IS_RSRC(inode))
                main_inode = HFSPLUS_I(inode)->rsrc_inode;
  
-diff -urNp linux-3.1.3/fs/hfsplus/ioctl.c linux-3.1.3/fs/hfsplus/ioctl.c
---- linux-3.1.3/fs/hfsplus/ioctl.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/hfsplus/ioctl.c     2011-11-16 18:40:29.000000000 -0500
-@@ -122,6 +122,8 @@ int hfsplus_setxattr(struct dentry *dent
+diff --git a/fs/hfsplus/ioctl.c b/fs/hfsplus/ioctl.c
+index fbaa669..c548cd0 100644
+--- a/fs/hfsplus/ioctl.c
++++ b/fs/hfsplus/ioctl.c
+@@ -122,6 +122,8 @@ int hfsplus_setxattr(struct dentry *dentry, const char *name,
        struct hfsplus_cat_file *file;
        int res;
  
@@ -44001,7 +46137,7 @@ diff -urNp linux-3.1.3/fs/hfsplus/ioctl.c linux-3.1.3/fs/hfsplus/ioctl.c
        if (!S_ISREG(inode->i_mode) || HFSPLUS_IS_RSRC(inode))
                return -EOPNOTSUPP;
  
-@@ -166,6 +168,8 @@ ssize_t hfsplus_getxattr(struct dentry *
+@@ -166,6 +168,8 @@ ssize_t hfsplus_getxattr(struct dentry *dentry, const char *name,
        struct hfsplus_cat_file *file;
        ssize_t res = 0;
  
@@ -44010,10 +46146,11 @@ diff -urNp linux-3.1.3/fs/hfsplus/ioctl.c linux-3.1.3/fs/hfsplus/ioctl.c
        if (!S_ISREG(inode->i_mode) || HFSPLUS_IS_RSRC(inode))
                return -EOPNOTSUPP;
  
-diff -urNp linux-3.1.3/fs/hfsplus/super.c linux-3.1.3/fs/hfsplus/super.c
---- linux-3.1.3/fs/hfsplus/super.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/hfsplus/super.c     2011-11-16 19:23:30.000000000 -0500
-@@ -347,6 +347,8 @@ static int hfsplus_fill_super(struct sup
+diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c
+index d24a9b6..dd9b3dd 100644
+--- a/fs/hfsplus/super.c
++++ b/fs/hfsplus/super.c
+@@ -347,6 +347,8 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
        u64 last_fs_block, last_fs_page;
        int err;
  
@@ -44022,10 +46159,11 @@ diff -urNp linux-3.1.3/fs/hfsplus/super.c linux-3.1.3/fs/hfsplus/super.c
        err = -EINVAL;
        sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
        if (!sbi)
-diff -urNp linux-3.1.3/fs/hugetlbfs/inode.c linux-3.1.3/fs/hugetlbfs/inode.c
---- linux-3.1.3/fs/hugetlbfs/inode.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/hugetlbfs/inode.c   2011-11-16 18:40:29.000000000 -0500
-@@ -915,7 +915,7 @@ static struct file_system_type hugetlbfs
+diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
+index ec88953..cb5e98e 100644
+--- a/fs/hugetlbfs/inode.c
++++ b/fs/hugetlbfs/inode.c
+@@ -915,7 +915,7 @@ static struct file_system_type hugetlbfs_fs_type = {
        .kill_sb        = kill_litter_super,
  };
  
@@ -44034,9 +46172,10 @@ diff -urNp linux-3.1.3/fs/hugetlbfs/inode.c linux-3.1.3/fs/hugetlbfs/inode.c
  
  static int can_do_hugetlb_shm(void)
  {
-diff -urNp linux-3.1.3/fs/inode.c linux-3.1.3/fs/inode.c
---- linux-3.1.3/fs/inode.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/inode.c     2011-11-16 18:39:08.000000000 -0500
+diff --git a/fs/inode.c b/fs/inode.c
+index ec79246..054c36a 100644
+--- a/fs/inode.c
++++ b/fs/inode.c
 @@ -787,8 +787,8 @@ unsigned int get_next_ino(void)
  
  #ifdef CONFIG_SMP
@@ -44048,10 +46187,11 @@ diff -urNp linux-3.1.3/fs/inode.c linux-3.1.3/fs/inode.c
  
                res = next - LAST_INO_BATCH;
        }
-diff -urNp linux-3.1.3/fs/jbd/checkpoint.c linux-3.1.3/fs/jbd/checkpoint.c
---- linux-3.1.3/fs/jbd/checkpoint.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/jbd/checkpoint.c    2011-11-16 18:40:29.000000000 -0500
-@@ -358,6 +358,8 @@ int log_do_checkpoint(journal_t *journal
+diff --git a/fs/jbd/checkpoint.c b/fs/jbd/checkpoint.c
+index f94fc48..3bb8d30 100644
+--- a/fs/jbd/checkpoint.c
++++ b/fs/jbd/checkpoint.c
+@@ -358,6 +358,8 @@ int log_do_checkpoint(journal_t *journal)
        tid_t this_tid;
        int result;
  
@@ -44060,10 +46200,11 @@ diff -urNp linux-3.1.3/fs/jbd/checkpoint.c linux-3.1.3/fs/jbd/checkpoint.c
        jbd_debug(1, "Start checkpoint\n");
  
        /*
-diff -urNp linux-3.1.3/fs/jffs2/compr_rtime.c linux-3.1.3/fs/jffs2/compr_rtime.c
---- linux-3.1.3/fs/jffs2/compr_rtime.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/jffs2/compr_rtime.c 2011-11-16 18:40:29.000000000 -0500
-@@ -37,6 +37,8 @@ static int jffs2_rtime_compress(unsigned
+diff --git a/fs/jffs2/compr_rtime.c b/fs/jffs2/compr_rtime.c
+index 16a5047..88ff6ca 100644
+--- a/fs/jffs2/compr_rtime.c
++++ b/fs/jffs2/compr_rtime.c
+@@ -37,6 +37,8 @@ static int jffs2_rtime_compress(unsigned char *data_in,
        int outpos = 0;
        int pos=0;
  
@@ -44072,7 +46213,7 @@ diff -urNp linux-3.1.3/fs/jffs2/compr_rtime.c linux-3.1.3/fs/jffs2/compr_rtime.c
        memset(positions,0,sizeof(positions));
  
        while (pos < (*sourcelen) && outpos <= (*dstlen)-2) {
-@@ -78,6 +80,8 @@ static int jffs2_rtime_decompress(unsign
+@@ -78,6 +80,8 @@ static int jffs2_rtime_decompress(unsigned char *data_in,
        int outpos = 0;
        int pos=0;
  
@@ -44081,10 +46222,11 @@ diff -urNp linux-3.1.3/fs/jffs2/compr_rtime.c linux-3.1.3/fs/jffs2/compr_rtime.c
        memset(positions,0,sizeof(positions));
  
        while (outpos<destlen) {
-diff -urNp linux-3.1.3/fs/jffs2/compr_rubin.c linux-3.1.3/fs/jffs2/compr_rubin.c
---- linux-3.1.3/fs/jffs2/compr_rubin.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/jffs2/compr_rubin.c 2011-11-16 18:40:29.000000000 -0500
-@@ -314,6 +314,8 @@ static int jffs2_dynrubin_compress(unsig
+diff --git a/fs/jffs2/compr_rubin.c b/fs/jffs2/compr_rubin.c
+index 9e7cec8..4713089 100644
+--- a/fs/jffs2/compr_rubin.c
++++ b/fs/jffs2/compr_rubin.c
+@@ -314,6 +314,8 @@ static int jffs2_dynrubin_compress(unsigned char *data_in,
        int ret;
        uint32_t mysrclen, mydstlen;
  
@@ -44093,10 +46235,11 @@ diff -urNp linux-3.1.3/fs/jffs2/compr_rubin.c linux-3.1.3/fs/jffs2/compr_rubin.c
        mysrclen = *sourcelen;
        mydstlen = *dstlen - 8;
  
-diff -urNp linux-3.1.3/fs/jffs2/erase.c linux-3.1.3/fs/jffs2/erase.c
---- linux-3.1.3/fs/jffs2/erase.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/jffs2/erase.c       2011-11-16 18:39:08.000000000 -0500
-@@ -439,7 +439,8 @@ static void jffs2_mark_erased_block(stru
+diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c
+index e513f19..2ab1351 100644
+--- a/fs/jffs2/erase.c
++++ b/fs/jffs2/erase.c
+@@ -439,7 +439,8 @@ static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseb
                struct jffs2_unknown_node marker = {
                        .magic =        cpu_to_je16(JFFS2_MAGIC_BITMASK),
                        .nodetype =     cpu_to_je16(JFFS2_NODETYPE_CLEANMARKER),
@@ -44106,10 +46249,11 @@ diff -urNp linux-3.1.3/fs/jffs2/erase.c linux-3.1.3/fs/jffs2/erase.c
                };
  
                jffs2_prealloc_raw_node_refs(c, jeb, 1);
-diff -urNp linux-3.1.3/fs/jffs2/wbuf.c linux-3.1.3/fs/jffs2/wbuf.c
---- linux-3.1.3/fs/jffs2/wbuf.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/jffs2/wbuf.c        2011-11-16 18:39:08.000000000 -0500
-@@ -1012,7 +1012,8 @@ static const struct jffs2_unknown_node o
+diff --git a/fs/jffs2/wbuf.c b/fs/jffs2/wbuf.c
+index 4515bea..178f2d6 100644
+--- a/fs/jffs2/wbuf.c
++++ b/fs/jffs2/wbuf.c
+@@ -1012,7 +1012,8 @@ static const struct jffs2_unknown_node oob_cleanmarker =
  {
        .magic = constant_cpu_to_je16(JFFS2_MAGIC_BITMASK),
        .nodetype = constant_cpu_to_je16(JFFS2_NODETYPE_CLEANMARKER),
@@ -44119,10 +46263,11 @@ diff -urNp linux-3.1.3/fs/jffs2/wbuf.c linux-3.1.3/fs/jffs2/wbuf.c
  };
  
  /*
-diff -urNp linux-3.1.3/fs/jffs2/xattr.c linux-3.1.3/fs/jffs2/xattr.c
---- linux-3.1.3/fs/jffs2/xattr.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/jffs2/xattr.c       2011-11-16 18:40:29.000000000 -0500
-@@ -773,6 +773,8 @@ void jffs2_build_xattr_subsystem(struct 
+diff --git a/fs/jffs2/xattr.c b/fs/jffs2/xattr.c
+index 3e93cdd..c8a80e1 100644
+--- a/fs/jffs2/xattr.c
++++ b/fs/jffs2/xattr.c
+@@ -773,6 +773,8 @@ void jffs2_build_xattr_subsystem(struct jffs2_sb_info *c)
  
        BUG_ON(!(c->flags & JFFS2_SB_FLAG_BUILDING));
  
@@ -44131,9 +46276,10 @@ diff -urNp linux-3.1.3/fs/jffs2/xattr.c linux-3.1.3/fs/jffs2/xattr.c
        /* Phase.1 : Merge same xref */
        for (i=0; i < XREF_TMPHASH_SIZE; i++)
                xref_tmphash[i] = NULL;
-diff -urNp linux-3.1.3/fs/jfs/super.c linux-3.1.3/fs/jfs/super.c
---- linux-3.1.3/fs/jfs/super.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/jfs/super.c 2011-11-16 18:39:08.000000000 -0500
+diff --git a/fs/jfs/super.c b/fs/jfs/super.c
+index 06c8a67..589dbbd 100644
+--- a/fs/jfs/super.c
++++ b/fs/jfs/super.c
 @@ -803,7 +803,7 @@ static int __init init_jfs_fs(void)
  
        jfs_inode_cachep =
@@ -44143,22 +46289,11 @@ diff -urNp linux-3.1.3/fs/jfs/super.c linux-3.1.3/fs/jfs/super.c
                            init_once);
        if (jfs_inode_cachep == NULL)
                return -ENOMEM;
-diff -urNp linux-3.1.3/fs/Kconfig.binfmt linux-3.1.3/fs/Kconfig.binfmt
---- linux-3.1.3/fs/Kconfig.binfmt      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/Kconfig.binfmt      2011-11-16 18:39:08.000000000 -0500
-@@ -86,7 +86,7 @@ config HAVE_AOUT
- config BINFMT_AOUT
-       tristate "Kernel support for a.out and ECOFF binaries"
--      depends on HAVE_AOUT
-+      depends on HAVE_AOUT && BROKEN
-       ---help---
-         A.out (Assembler.OUTput) is a set of formats for libraries and
-         executables used in the earliest versions of UNIX.  Linux used
-diff -urNp linux-3.1.3/fs/libfs.c linux-3.1.3/fs/libfs.c
---- linux-3.1.3/fs/libfs.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/libfs.c     2011-11-16 18:39:08.000000000 -0500
-@@ -165,6 +165,9 @@ int dcache_readdir(struct file * filp, v
+diff --git a/fs/libfs.c b/fs/libfs.c
+index c18e9a1..0b04e2c 100644
+--- a/fs/libfs.c
++++ b/fs/libfs.c
+@@ -165,6 +165,9 @@ int dcache_readdir(struct file * filp, void * dirent, filldir_t filldir)
  
                        for (p=q->next; p != &dentry->d_subdirs; p=p->next) {
                                struct dentry *next;
@@ -44168,7 +46303,7 @@ diff -urNp linux-3.1.3/fs/libfs.c linux-3.1.3/fs/libfs.c
                                next = list_entry(p, struct dentry, d_u.d_child);
                                spin_lock_nested(&next->d_lock, DENTRY_D_LOCK_NESTED);
                                if (!simple_positive(next)) {
-@@ -174,7 +177,12 @@ int dcache_readdir(struct file * filp, v
+@@ -174,7 +177,12 @@ int dcache_readdir(struct file * filp, void * dirent, filldir_t filldir)
  
                                spin_unlock(&next->d_lock);
                                spin_unlock(&dentry->d_lock);
@@ -44182,10 +46317,11 @@ diff -urNp linux-3.1.3/fs/libfs.c linux-3.1.3/fs/libfs.c
                                            next->d_name.len, filp->f_pos, 
                                            next->d_inode->i_ino, 
                                            dt_type(next->d_inode)) < 0)
-diff -urNp linux-3.1.3/fs/lockd/clntproc.c linux-3.1.3/fs/lockd/clntproc.c
---- linux-3.1.3/fs/lockd/clntproc.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/lockd/clntproc.c    2011-11-16 18:40:29.000000000 -0500
-@@ -36,11 +36,11 @@ static const struct rpc_call_ops nlmclnt
+diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c
+index 8392cb8..ae8ed40 100644
+--- a/fs/lockd/clntproc.c
++++ b/fs/lockd/clntproc.c
+@@ -36,11 +36,11 @@ static const struct rpc_call_ops nlmclnt_cancel_ops;
  /*
   * Cookie counter for NLM requests
   */
@@ -44199,7 +46335,7 @@ diff -urNp linux-3.1.3/fs/lockd/clntproc.c linux-3.1.3/fs/lockd/clntproc.c
  
        memcpy(c->data, &cookie, 4);
        c->len=4;
-@@ -621,6 +621,8 @@ nlmclnt_reclaim(struct nlm_host *host, s
+@@ -621,6 +621,8 @@ nlmclnt_reclaim(struct nlm_host *host, struct file_lock *fl)
        struct nlm_rqst reqst, *req;
        int             status;
  
@@ -44208,10 +46344,11 @@ diff -urNp linux-3.1.3/fs/lockd/clntproc.c linux-3.1.3/fs/lockd/clntproc.c
        req = &reqst;
        memset(req, 0, sizeof(*req));
        locks_init_lock(&req->a_args.lock.fl);
-diff -urNp linux-3.1.3/fs/locks.c linux-3.1.3/fs/locks.c
---- linux-3.1.3/fs/locks.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/locks.c     2011-11-16 18:39:08.000000000 -0500
-@@ -2022,16 +2022,16 @@ void locks_remove_flock(struct file *fil
+diff --git a/fs/locks.c b/fs/locks.c
+index 703f545..150a552 100644
+--- a/fs/locks.c
++++ b/fs/locks.c
+@@ -2022,16 +2022,16 @@ void locks_remove_flock(struct file *filp)
                return;
  
        if (filp->f_op && filp->f_op->flock) {
@@ -44232,10 +46369,11 @@ diff -urNp linux-3.1.3/fs/locks.c linux-3.1.3/fs/locks.c
        }
  
        lock_flocks();
-diff -urNp linux-3.1.3/fs/logfs/super.c linux-3.1.3/fs/logfs/super.c
---- linux-3.1.3/fs/logfs/super.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/logfs/super.c       2011-11-16 18:40:29.000000000 -0500
-@@ -266,6 +266,8 @@ static int logfs_recover_sb(struct super
+diff --git a/fs/logfs/super.c b/fs/logfs/super.c
+index ce03a18..ac8c14f 100644
+--- a/fs/logfs/super.c
++++ b/fs/logfs/super.c
+@@ -266,6 +266,8 @@ static int logfs_recover_sb(struct super_block *sb)
        struct logfs_disk_super _ds1, *ds1 = &_ds1;
        int err, valid0, valid1;
  
@@ -44244,17 +46382,148 @@ diff -urNp linux-3.1.3/fs/logfs/super.c linux-3.1.3/fs/logfs/super.c
        /* read first superblock */
        err = wbuf_read(sb, super->s_sb_ofs[0], sizeof(*ds0), ds0);
        if (err)
-diff -urNp linux-3.1.3/fs/namei.c linux-3.1.3/fs/namei.c
---- linux-3.1.3/fs/namei.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/namei.c     2011-11-17 00:36:54.000000000 -0500
-@@ -283,14 +283,22 @@ int generic_permission(struct inode *ino
+diff --git a/fs/minix/bitmap.c b/fs/minix/bitmap.c
+index 3f32bcb..7c82c29 100644
+--- a/fs/minix/bitmap.c
++++ b/fs/minix/bitmap.c
+@@ -20,10 +20,11 @@ static const int nibblemap[] = { 4,3,3,2,3,2,2,1,3,2,2,1,2,1,1,0 };
  
+ static DEFINE_SPINLOCK(bitmap_lock);
+-static unsigned long count_free(struct buffer_head *map[], unsigned numblocks, __u32 numbits)
++static unsigned long count_free(struct buffer_head *map[], unsigned blocksize, __u32 numbits)
+ {
+       unsigned i, j, sum = 0;
+       struct buffer_head *bh;
++      unsigned numblocks = minix_blocks_needed(numbits, blocksize);
+   
+       for (i=0; i<numblocks-1; i++) {
+               if (!(bh=map[i])) 
+@@ -105,10 +106,12 @@ int minix_new_block(struct inode * inode)
+       return 0;
+ }
+-unsigned long minix_count_free_blocks(struct minix_sb_info *sbi)
++unsigned long minix_count_free_blocks(struct super_block *sb)
+ {
+-      return (count_free(sbi->s_zmap, sbi->s_zmap_blocks,
+-              sbi->s_nzones - sbi->s_firstdatazone + 1)
++      struct minix_sb_info *sbi = minix_sb(sb);
++      u32 bits = sbi->s_nzones - (sbi->s_firstdatazone + 1);
++
++      return (count_free(sbi->s_zmap, sb->s_blocksize, bits)
+               << sbi->s_log_zone_size);
+ }
+@@ -273,7 +276,10 @@ struct inode *minix_new_inode(const struct inode *dir, int mode, int *error)
+       return inode;
+ }
+-unsigned long minix_count_free_inodes(struct minix_sb_info *sbi)
++unsigned long minix_count_free_inodes(struct super_block *sb)
+ {
+-      return count_free(sbi->s_imap, sbi->s_imap_blocks, sbi->s_ninodes + 1);
++      struct minix_sb_info *sbi = minix_sb(sb);
++      u32 bits = sbi->s_ninodes + 1;
++
++      return count_free(sbi->s_imap, sb->s_blocksize, bits);
+ }
+diff --git a/fs/minix/inode.c b/fs/minix/inode.c
+index e7d23e2..1ed1351 100644
+--- a/fs/minix/inode.c
++++ b/fs/minix/inode.c
+@@ -279,6 +279,27 @@ static int minix_fill_super(struct super_block *s, void *data, int silent)
+       else if (sbi->s_mount_state & MINIX_ERROR_FS)
+               printk("MINIX-fs: mounting file system with errors, "
+                       "running fsck is recommended\n");
++
++      /* Apparently minix can create filesystems that allocate more blocks for
++       * the bitmaps than needed.  We simply ignore that, but verify it didn't
++       * create one with not enough blocks and bail out if so.
++       */
++      block = minix_blocks_needed(sbi->s_ninodes, s->s_blocksize);
++      if (sbi->s_imap_blocks < block) {
++              printk("MINIX-fs: file system does not have enough "
++                              "imap blocks allocated.  Refusing to mount\n");
++              goto out_iput;
++      }
++
++      block = minix_blocks_needed(
++                      (sbi->s_nzones - (sbi->s_firstdatazone + 1)),
++                      s->s_blocksize);
++      if (sbi->s_zmap_blocks < block) {
++              printk("MINIX-fs: file system does not have enough "
++                              "zmap blocks allocated.  Refusing to mount.\n");
++              goto out_iput;
++      }
++
+       return 0;
+ out_iput:
+@@ -339,10 +360,10 @@ static int minix_statfs(struct dentry *dentry, struct kstatfs *buf)
+       buf->f_type = sb->s_magic;
+       buf->f_bsize = sb->s_blocksize;
+       buf->f_blocks = (sbi->s_nzones - sbi->s_firstdatazone) << sbi->s_log_zone_size;
+-      buf->f_bfree = minix_count_free_blocks(sbi);
++      buf->f_bfree = minix_count_free_blocks(sb);
+       buf->f_bavail = buf->f_bfree;
+       buf->f_files = sbi->s_ninodes;
+-      buf->f_ffree = minix_count_free_inodes(sbi);
++      buf->f_ffree = minix_count_free_inodes(sb);
+       buf->f_namelen = sbi->s_namelen;
+       buf->f_fsid.val[0] = (u32)id;
+       buf->f_fsid.val[1] = (u32)(id >> 32);
+diff --git a/fs/minix/minix.h b/fs/minix/minix.h
+index 341e212..6415fe0 100644
+--- a/fs/minix/minix.h
++++ b/fs/minix/minix.h
+@@ -48,10 +48,10 @@ extern struct minix_inode * minix_V1_raw_inode(struct super_block *, ino_t, stru
+ extern struct minix2_inode * minix_V2_raw_inode(struct super_block *, ino_t, struct buffer_head **);
+ extern struct inode * minix_new_inode(const struct inode *, int, int *);
+ extern void minix_free_inode(struct inode * inode);
+-extern unsigned long minix_count_free_inodes(struct minix_sb_info *sbi);
++extern unsigned long minix_count_free_inodes(struct super_block *sb);
+ extern int minix_new_block(struct inode * inode);
+ extern void minix_free_block(struct inode *inode, unsigned long block);
+-extern unsigned long minix_count_free_blocks(struct minix_sb_info *sbi);
++extern unsigned long minix_count_free_blocks(struct super_block *sb);
+ extern int minix_getattr(struct vfsmount *, struct dentry *, struct kstat *);
+ extern int minix_prepare_chunk(struct page *page, loff_t pos, unsigned len);
+@@ -88,6 +88,11 @@ static inline struct minix_inode_info *minix_i(struct inode *inode)
+       return list_entry(inode, struct minix_inode_info, vfs_inode);
+ }
++static inline unsigned minix_blocks_needed(unsigned bits, unsigned blocksize)
++{
++      return DIV_ROUND_UP(bits, blocksize * 8);
++}
++
+ #if defined(CONFIG_MINIX_FS_NATIVE_ENDIAN) && \
+       defined(CONFIG_MINIX_FS_BIG_ENDIAN_16BIT_INDEXED)
+diff --git a/fs/namei.c b/fs/namei.c
+index 3d15072..c1ddf9c 100644
+--- a/fs/namei.c
++++ b/fs/namei.c
+@@ -281,16 +281,32 @@ int generic_permission(struct inode *inode, int mask)
+       if (ret != -EACCES)
+               return ret;
++#ifdef CONFIG_GRKERNSEC
++      /* we'll block if we have to log due to a denied capability use */
++      if (mask & MAY_NOT_BLOCK)
++              return -ECHILD;
++#endif
++
        if (S_ISDIR(inode->i_mode)) {
                /* DACs are overridable for directories */
 -              if (ns_capable(inode_userns(inode), CAP_DAC_OVERRIDE))
 -                      return 0;
                if (!(mask & MAY_WRITE))
-                       if (ns_capable(inode_userns(inode), CAP_DAC_READ_SEARCH))
+-                      if (ns_capable(inode_userns(inode), CAP_DAC_READ_SEARCH))
++                      if (ns_capable_nolog(inode_userns(inode), CAP_DAC_OVERRIDE) ||
++                          ns_capable(inode_userns(inode), CAP_DAC_READ_SEARCH))
                                return 0;
 +              if (ns_capable(inode_userns(inode), CAP_DAC_OVERRIDE))
 +                      return 0;
@@ -44265,14 +46534,15 @@ diff -urNp linux-3.1.3/fs/namei.c linux-3.1.3/fs/namei.c
 +       */
 +      mask &= MAY_READ | MAY_WRITE | MAY_EXEC;
 +      if (mask == MAY_READ)
-+              if (ns_capable(inode_userns(inode), CAP_DAC_READ_SEARCH))
++              if (ns_capable_nolog(inode_userns(inode), CAP_DAC_OVERRIDE) ||
++                  ns_capable(inode_userns(inode), CAP_DAC_READ_SEARCH))
 +                      return 0;
 +
 +      /*
         * Read/write DACs are always overridable.
         * Executable DACs are overridable when there is
         * at least one exec bit set.
-@@ -299,14 +307,6 @@ int generic_permission(struct inode *ino
+@@ -299,14 +315,6 @@ int generic_permission(struct inode *inode, int mask)
                if (ns_capable(inode_userns(inode), CAP_DAC_OVERRIDE))
                        return 0;
  
@@ -44287,7 +46557,7 @@ diff -urNp linux-3.1.3/fs/namei.c linux-3.1.3/fs/namei.c
        return -EACCES;
  }
  
-@@ -653,11 +653,19 @@ follow_link(struct path *link, struct na
+@@ -653,11 +661,19 @@ follow_link(struct path *link, struct nameidata *nd, void **p)
                return error;
        }
  
@@ -44308,30 +46578,45 @@ diff -urNp linux-3.1.3/fs/namei.c linux-3.1.3/fs/namei.c
                error = 0;
                if (s)
                        error = __vfs_follow_link(nd, s);
-@@ -1622,6 +1630,12 @@ static int path_lookupat(int dfd, const 
+@@ -1622,6 +1638,21 @@ static int path_lookupat(int dfd, const char *name,
        if (!err)
                err = complete_walk(nd);
  
-+      if (!(nd->flags & LOOKUP_PARENT) && !gr_acl_handle_hidden_file(nd->path.dentry, nd->path.mnt)) {
-+              if (!err)
-+                      path_put(&nd->path);
-+              err = -ENOENT;
++      if (!(nd->flags & LOOKUP_PARENT)) {
++#ifdef CONFIG_GRKERNSEC
++              if (flags & LOOKUP_RCU) {
++                      if (!err)
++                              path_put(&nd->path);
++                      err = -ECHILD;
++              } else
++#endif
++              if (!gr_acl_handle_hidden_file(nd->path.dentry, nd->path.mnt)) {
++                      if (!err)
++                              path_put(&nd->path);
++                      err = -ENOENT;
++              }
 +      }
 +
        if (!err && nd->flags & LOOKUP_DIRECTORY) {
                if (!nd->inode->i_op->lookup) {
                        path_put(&nd->path);
-@@ -1649,6 +1663,9 @@ static int do_path_lookup(int dfd, const
+@@ -1649,6 +1680,15 @@ static int do_path_lookup(int dfd, const char *name,
                retval = path_lookupat(dfd, name, flags | LOOKUP_REVAL, nd);
  
        if (likely(!retval)) {
-+              if (*name != '/' && nd->path.dentry && nd->inode && !gr_chroot_fchdir(nd->path.dentry, nd->path.mnt))
-+                      return -ENOENT;
++              if (*name != '/' && nd->path.dentry && nd->inode) {
++#ifdef CONFIG_GRKERNSEC
++                      if (flags & LOOKUP_RCU)
++                              return -ECHILD;
++#endif
++                      if (!gr_chroot_fchdir(nd->path.dentry, nd->path.mnt))
++                              return -ENOENT;
++              }
 +
                if (unlikely(!audit_dummy_context())) {
                        if (nd->path.dentry && nd->inode)
                                audit_inode(name, nd->path.dentry);
-@@ -2049,7 +2066,27 @@ static int may_open(struct path *path, i
+@@ -2049,7 +2089,27 @@ static int may_open(struct path *path, int acc_mode, int flag)
        /*
         * Ensure there are no outstanding leases on the file.
         */
@@ -44360,10 +46645,16 @@ diff -urNp linux-3.1.3/fs/namei.c linux-3.1.3/fs/namei.c
  }
  
  static int handle_truncate(struct file *filp)
-@@ -2110,6 +2147,10 @@ static struct file *do_last(struct namei
+@@ -2110,6 +2170,16 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
                error = complete_walk(nd);
                if (error)
                        return ERR_PTR(error);
++#ifdef CONFIG_GRKERNSEC
++              if (nd->flags & LOOKUP_RCU) {
++                      error = -ECHILD;
++                      goto exit;
++              }
++#endif
 +              if (!gr_acl_handle_hidden_file(nd->path.dentry, nd->path.mnt)) {
 +                      error = -ENOENT;
 +                      goto exit;
@@ -44371,10 +46662,16 @@ diff -urNp linux-3.1.3/fs/namei.c linux-3.1.3/fs/namei.c
                audit_inode(pathname, nd->path.dentry);
                if (open_flag & O_CREAT) {
                        error = -EISDIR;
-@@ -2120,6 +2161,10 @@ static struct file *do_last(struct namei
+@@ -2120,6 +2190,16 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
                error = complete_walk(nd);
                if (error)
                        return ERR_PTR(error);
++#ifdef CONFIG_GRKERNSEC
++              if (nd->flags & LOOKUP_RCU) {
++                      error = -ECHILD;
++                      goto exit;
++              }
++#endif
 +              if (!gr_acl_handle_hidden_file(dir, nd->path.mnt)) {
 +                      error = -ENOENT;
 +                      goto exit;
@@ -44382,19 +46679,24 @@ diff -urNp linux-3.1.3/fs/namei.c linux-3.1.3/fs/namei.c
                audit_inode(pathname, dir);
                goto ok;
        }
-@@ -2142,6 +2187,11 @@ static struct file *do_last(struct namei
+@@ -2141,6 +2221,16 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
+               error = complete_walk(nd);
                if (error)
                        return ERR_PTR(-ECHILD);
++#ifdef CONFIG_GRKERNSEC
++              if (nd->flags & LOOKUP_RCU) {
++                      error = -ECHILD;
++                      goto exit;
++              }
++#endif
 +              if (!gr_acl_handle_hidden_file(nd->path.dentry, nd->path.mnt)) {
 +                      error = -ENOENT;
 +                      goto exit;
 +              }
-+
                error = -ENOTDIR;
                if (nd->flags & LOOKUP_DIRECTORY) {
-                       if (!nd->inode->i_op->lookup)
-@@ -2181,6 +2231,12 @@ static struct file *do_last(struct namei
+@@ -2181,6 +2271,12 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
        /* Negative dentry, just create the file */
        if (!dentry->d_inode) {
                int mode = op->mode;
@@ -44407,7 +46709,7 @@ diff -urNp linux-3.1.3/fs/namei.c linux-3.1.3/fs/namei.c
                if (!IS_POSIXACL(dir->d_inode))
                        mode &= ~current_umask();
                /*
-@@ -2204,6 +2260,8 @@ static struct file *do_last(struct namei
+@@ -2204,6 +2300,8 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
                error = vfs_create(dir->d_inode, dentry, mode, nd);
                if (error)
                        goto exit_mutex_unlock;
@@ -44416,7 +46718,7 @@ diff -urNp linux-3.1.3/fs/namei.c linux-3.1.3/fs/namei.c
                mutex_unlock(&dir->d_inode->i_mutex);
                dput(nd->path.dentry);
                nd->path.dentry = dentry;
-@@ -2213,6 +2271,19 @@ static struct file *do_last(struct namei
+@@ -2213,6 +2311,19 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
        /*
         * It already exists.
         */
@@ -44436,7 +46738,7 @@ diff -urNp linux-3.1.3/fs/namei.c linux-3.1.3/fs/namei.c
        mutex_unlock(&dir->d_inode->i_mutex);
        audit_inode(pathname, path->dentry);
  
-@@ -2425,6 +2496,11 @@ struct dentry *kern_path_create(int dfd,
+@@ -2425,6 +2536,11 @@ struct dentry *kern_path_create(int dfd, const char *pathname, struct path *path
        *path = nd.path;
        return dentry;
  eexist:
@@ -44448,7 +46750,7 @@ diff -urNp linux-3.1.3/fs/namei.c linux-3.1.3/fs/namei.c
        dput(dentry);
        dentry = ERR_PTR(-EEXIST);
  fail:
-@@ -2447,6 +2523,20 @@ struct dentry *user_path_create(int dfd,
+@@ -2447,6 +2563,20 @@ struct dentry *user_path_create(int dfd, const char __user *pathname, struct pat
  }
  EXPORT_SYMBOL(user_path_create);
  
@@ -44469,7 +46771,7 @@ diff -urNp linux-3.1.3/fs/namei.c linux-3.1.3/fs/namei.c
  int vfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
  {
        int error = may_create(dir, dentry);
-@@ -2514,6 +2604,17 @@ SYSCALL_DEFINE4(mknodat, int, dfd, const
+@@ -2514,6 +2644,17 @@ SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, int, mode,
        error = mnt_want_write(path.mnt);
        if (error)
                goto out_dput;
@@ -44487,7 +46789,7 @@ diff -urNp linux-3.1.3/fs/namei.c linux-3.1.3/fs/namei.c
        error = security_path_mknod(&path, dentry, mode, dev);
        if (error)
                goto out_drop_write;
-@@ -2531,6 +2632,9 @@ SYSCALL_DEFINE4(mknodat, int, dfd, const
+@@ -2531,6 +2672,9 @@ SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, int, mode,
        }
  out_drop_write:
        mnt_drop_write(path.mnt);
@@ -44497,7 +46799,7 @@ diff -urNp linux-3.1.3/fs/namei.c linux-3.1.3/fs/namei.c
  out_dput:
        dput(dentry);
        mutex_unlock(&path.dentry->d_inode->i_mutex);
-@@ -2580,12 +2684,21 @@ SYSCALL_DEFINE3(mkdirat, int, dfd, const
+@@ -2580,12 +2724,21 @@ SYSCALL_DEFINE3(mkdirat, int, dfd, const char __user *, pathname, int, mode)
        error = mnt_want_write(path.mnt);
        if (error)
                goto out_dput;
@@ -44519,7 +46821,7 @@ diff -urNp linux-3.1.3/fs/namei.c linux-3.1.3/fs/namei.c
  out_dput:
        dput(dentry);
        mutex_unlock(&path.dentry->d_inode->i_mutex);
-@@ -2665,6 +2778,8 @@ static long do_rmdir(int dfd, const char
+@@ -2665,6 +2818,8 @@ static long do_rmdir(int dfd, const char __user *pathname)
        char * name;
        struct dentry *dentry;
        struct nameidata nd;
@@ -44528,7 +46830,7 @@ diff -urNp linux-3.1.3/fs/namei.c linux-3.1.3/fs/namei.c
  
        error = user_path_parent(dfd, pathname, &nd, &name);
        if (error)
-@@ -2693,6 +2808,15 @@ static long do_rmdir(int dfd, const char
+@@ -2693,6 +2848,15 @@ static long do_rmdir(int dfd, const char __user *pathname)
                error = -ENOENT;
                goto exit3;
        }
@@ -44544,7 +46846,7 @@ diff -urNp linux-3.1.3/fs/namei.c linux-3.1.3/fs/namei.c
        error = mnt_want_write(nd.path.mnt);
        if (error)
                goto exit3;
-@@ -2700,6 +2824,8 @@ static long do_rmdir(int dfd, const char
+@@ -2700,6 +2864,8 @@ static long do_rmdir(int dfd, const char __user *pathname)
        if (error)
                goto exit4;
        error = vfs_rmdir(nd.path.dentry->d_inode, dentry);
@@ -44553,7 +46855,7 @@ diff -urNp linux-3.1.3/fs/namei.c linux-3.1.3/fs/namei.c
  exit4:
        mnt_drop_write(nd.path.mnt);
  exit3:
-@@ -2762,6 +2888,8 @@ static long do_unlinkat(int dfd, const c
+@@ -2762,6 +2928,8 @@ static long do_unlinkat(int dfd, const char __user *pathname)
        struct dentry *dentry;
        struct nameidata nd;
        struct inode *inode = NULL;
@@ -44562,7 +46864,7 @@ diff -urNp linux-3.1.3/fs/namei.c linux-3.1.3/fs/namei.c
  
        error = user_path_parent(dfd, pathname, &nd, &name);
        if (error)
-@@ -2784,6 +2912,16 @@ static long do_unlinkat(int dfd, const c
+@@ -2784,6 +2952,16 @@ static long do_unlinkat(int dfd, const char __user *pathname)
                if (!inode)
                        goto slashes;
                ihold(inode);
@@ -44579,7 +46881,7 @@ diff -urNp linux-3.1.3/fs/namei.c linux-3.1.3/fs/namei.c
                error = mnt_want_write(nd.path.mnt);
                if (error)
                        goto exit2;
-@@ -2791,6 +2929,8 @@ static long do_unlinkat(int dfd, const c
+@@ -2791,6 +2969,8 @@ static long do_unlinkat(int dfd, const char __user *pathname)
                if (error)
                        goto exit3;
                error = vfs_unlink(nd.path.dentry->d_inode, dentry);
@@ -44588,7 +46890,7 @@ diff -urNp linux-3.1.3/fs/namei.c linux-3.1.3/fs/namei.c
  exit3:
                mnt_drop_write(nd.path.mnt);
        exit2:
-@@ -2866,10 +3006,18 @@ SYSCALL_DEFINE3(symlinkat, const char __
+@@ -2866,10 +3046,18 @@ SYSCALL_DEFINE3(symlinkat, const char __user *, oldname,
        error = mnt_want_write(path.mnt);
        if (error)
                goto out_dput;
@@ -44607,15 +46909,15 @@ diff -urNp linux-3.1.3/fs/namei.c linux-3.1.3/fs/namei.c
  out_drop_write:
        mnt_drop_write(path.mnt);
  out_dput:
-@@ -2941,6 +3089,7 @@ SYSCALL_DEFINE5(linkat, int, olddfd, con
+@@ -2941,6 +3129,7 @@ SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname,
  {
        struct dentry *new_dentry;
        struct path old_path, new_path;
-+      char *to;
++      char *to = NULL;
        int how = 0;
        int error;
  
-@@ -2964,7 +3113,7 @@ SYSCALL_DEFINE5(linkat, int, olddfd, con
+@@ -2964,7 +3153,7 @@ SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname,
        if (error)
                return error;
  
@@ -44624,7 +46926,7 @@ diff -urNp linux-3.1.3/fs/namei.c linux-3.1.3/fs/namei.c
        error = PTR_ERR(new_dentry);
        if (IS_ERR(new_dentry))
                goto out;
-@@ -2975,13 +3124,30 @@ SYSCALL_DEFINE5(linkat, int, olddfd, con
+@@ -2975,13 +3164,30 @@ SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname,
        error = mnt_want_write(new_path.mnt);
        if (error)
                goto out_dput;
@@ -44655,7 +46957,7 @@ diff -urNp linux-3.1.3/fs/namei.c linux-3.1.3/fs/namei.c
        dput(new_dentry);
        mutex_unlock(&new_path.dentry->d_inode->i_mutex);
        path_put(&new_path);
-@@ -3153,6 +3319,8 @@ SYSCALL_DEFINE4(renameat, int, olddfd, c
+@@ -3153,6 +3359,8 @@ SYSCALL_DEFINE4(renameat, int, olddfd, const char __user *, oldname,
        char *to;
        int error;
  
@@ -44664,7 +46966,7 @@ diff -urNp linux-3.1.3/fs/namei.c linux-3.1.3/fs/namei.c
        error = user_path_parent(olddfd, oldname, &oldnd, &from);
        if (error)
                goto exit;
-@@ -3209,6 +3377,12 @@ SYSCALL_DEFINE4(renameat, int, olddfd, c
+@@ -3209,6 +3417,12 @@ SYSCALL_DEFINE4(renameat, int, olddfd, const char __user *, oldname,
        if (new_dentry == trap)
                goto exit5;
  
@@ -44677,7 +46979,7 @@ diff -urNp linux-3.1.3/fs/namei.c linux-3.1.3/fs/namei.c
        error = mnt_want_write(oldnd.path.mnt);
        if (error)
                goto exit5;
-@@ -3218,6 +3392,9 @@ SYSCALL_DEFINE4(renameat, int, olddfd, c
+@@ -3218,6 +3432,9 @@ SYSCALL_DEFINE4(renameat, int, olddfd, const char __user *, oldname,
                goto exit6;
        error = vfs_rename(old_dir->d_inode, old_dentry,
                                   new_dir->d_inode, new_dentry);
@@ -44687,7 +46989,7 @@ diff -urNp linux-3.1.3/fs/namei.c linux-3.1.3/fs/namei.c
  exit6:
        mnt_drop_write(oldnd.path.mnt);
  exit5:
-@@ -3243,6 +3420,8 @@ SYSCALL_DEFINE2(rename, const char __use
+@@ -3243,6 +3460,8 @@ SYSCALL_DEFINE2(rename, const char __user *, oldname, const char __user *, newna
  
  int vfs_readlink(struct dentry *dentry, char __user *buffer, int buflen, const char *link)
  {
@@ -44696,7 +46998,7 @@ diff -urNp linux-3.1.3/fs/namei.c linux-3.1.3/fs/namei.c
        int len;
  
        len = PTR_ERR(link);
-@@ -3252,7 +3431,14 @@ int vfs_readlink(struct dentry *dentry, 
+@@ -3252,7 +3471,14 @@ int vfs_readlink(struct dentry *dentry, char __user *buffer, int buflen, const c
        len = strlen(link);
        if (len > (unsigned) buflen)
                len = buflen;
@@ -44712,10 +47014,11 @@ diff -urNp linux-3.1.3/fs/namei.c linux-3.1.3/fs/namei.c
                len = -EFAULT;
  out:
        return len;
-diff -urNp linux-3.1.3/fs/namespace.c linux-3.1.3/fs/namespace.c
---- linux-3.1.3/fs/namespace.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/namespace.c 2011-11-16 18:40:29.000000000 -0500
-@@ -1329,6 +1329,9 @@ static int do_umount(struct vfsmount *mn
+diff --git a/fs/namespace.c b/fs/namespace.c
+index e5e1c7d..019609e 100644
+--- a/fs/namespace.c
++++ b/fs/namespace.c
+@@ -1329,6 +1329,9 @@ static int do_umount(struct vfsmount *mnt, int flags)
                if (!(sb->s_flags & MS_RDONLY))
                        retval = do_remount_sb(sb, MS_RDONLY, NULL, 0);
                up_write(&sb->s_umount);
@@ -44725,7 +47028,7 @@ diff -urNp linux-3.1.3/fs/namespace.c linux-3.1.3/fs/namespace.c
                return retval;
        }
  
-@@ -1348,6 +1351,9 @@ static int do_umount(struct vfsmount *mn
+@@ -1348,6 +1351,9 @@ static int do_umount(struct vfsmount *mnt, int flags)
        br_write_unlock(vfsmount_lock);
        up_write(&namespace_sem);
        release_mounts(&umount_list);
@@ -44735,7 +47038,7 @@ diff -urNp linux-3.1.3/fs/namespace.c linux-3.1.3/fs/namespace.c
        return retval;
  }
  
-@@ -2339,6 +2345,16 @@ long do_mount(char *dev_name, char *dir_
+@@ -2339,6 +2345,16 @@ long do_mount(char *dev_name, char *dir_name, char *type_page,
                   MS_NOATIME | MS_NODIRATIME | MS_RELATIME| MS_KERNMOUNT |
                   MS_STRICTATIME);
  
@@ -44752,7 +47055,7 @@ diff -urNp linux-3.1.3/fs/namespace.c linux-3.1.3/fs/namespace.c
        if (flags & MS_REMOUNT)
                retval = do_remount(&path, flags & ~MS_REMOUNT, mnt_flags,
                                    data_page);
-@@ -2353,6 +2369,9 @@ long do_mount(char *dev_name, char *dir_
+@@ -2353,6 +2369,9 @@ long do_mount(char *dev_name, char *dir_name, char *type_page,
                                      dev_name, data_page);
  dput_out:
        path_put(&path);
@@ -44762,7 +47065,7 @@ diff -urNp linux-3.1.3/fs/namespace.c linux-3.1.3/fs/namespace.c
        return retval;
  }
  
-@@ -2576,6 +2595,11 @@ SYSCALL_DEFINE2(pivot_root, const char _
+@@ -2576,6 +2595,11 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, new_root,
        if (error)
                goto out2;
  
@@ -44774,10 +47077,11 @@ diff -urNp linux-3.1.3/fs/namespace.c linux-3.1.3/fs/namespace.c
        get_fs_root(current->fs, &root);
        error = lock_mount(&old);
        if (error)
-diff -urNp linux-3.1.3/fs/ncpfs/dir.c linux-3.1.3/fs/ncpfs/dir.c
---- linux-3.1.3/fs/ncpfs/dir.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/ncpfs/dir.c 2011-11-16 18:40:29.000000000 -0500
-@@ -299,6 +299,8 @@ ncp_lookup_validate(struct dentry *dentr
+diff --git a/fs/ncpfs/dir.c b/fs/ncpfs/dir.c
+index 9c51f62..503b252 100644
+--- a/fs/ncpfs/dir.c
++++ b/fs/ncpfs/dir.c
+@@ -299,6 +299,8 @@ ncp_lookup_validate(struct dentry *dentry, struct nameidata *nd)
        int res, val = 0, len;
        __u8 __name[NCP_MAXPATHLEN + 1];
  
@@ -44786,7 +47090,7 @@ diff -urNp linux-3.1.3/fs/ncpfs/dir.c linux-3.1.3/fs/ncpfs/dir.c
        if (dentry == dentry->d_sb->s_root)
                return 1;
  
-@@ -844,6 +846,8 @@ static struct dentry *ncp_lookup(struct 
+@@ -844,6 +846,8 @@ static struct dentry *ncp_lookup(struct inode *dir, struct dentry *dentry, struc
        int error, res, len;
        __u8 __name[NCP_MAXPATHLEN + 1];
  
@@ -44795,7 +47099,7 @@ diff -urNp linux-3.1.3/fs/ncpfs/dir.c linux-3.1.3/fs/ncpfs/dir.c
        error = -EIO;
        if (!ncp_conn_valid(server))
                goto finished;
-@@ -931,6 +935,8 @@ int ncp_create_new(struct inode *dir, st
+@@ -931,6 +935,8 @@ int ncp_create_new(struct inode *dir, struct dentry *dentry, int mode,
        PPRINTK("ncp_create_new: creating %s/%s, mode=%x\n",
                dentry->d_parent->d_name.name, dentry->d_name.name, mode);
  
@@ -44804,7 +47108,7 @@ diff -urNp linux-3.1.3/fs/ncpfs/dir.c linux-3.1.3/fs/ncpfs/dir.c
        ncp_age_dentry(server, dentry);
        len = sizeof(__name);
        error = ncp_io2vol(server, __name, &len, dentry->d_name.name,
-@@ -992,6 +998,8 @@ static int ncp_mkdir(struct inode *dir, 
+@@ -992,6 +998,8 @@ static int ncp_mkdir(struct inode *dir, struct dentry *dentry, int mode)
        int error, len;
        __u8 __name[NCP_MAXPATHLEN + 1];
  
@@ -44813,7 +47117,7 @@ diff -urNp linux-3.1.3/fs/ncpfs/dir.c linux-3.1.3/fs/ncpfs/dir.c
        DPRINTK("ncp_mkdir: making %s/%s\n",
                dentry->d_parent->d_name.name, dentry->d_name.name);
  
-@@ -1140,6 +1148,8 @@ static int ncp_rename(struct inode *old_
+@@ -1140,6 +1148,8 @@ static int ncp_rename(struct inode *old_dir, struct dentry *old_dentry,
        int old_len, new_len;
        __u8 __old_name[NCP_MAXPATHLEN + 1], __new_name[NCP_MAXPATHLEN + 1];
  
@@ -44822,10 +47126,11 @@ diff -urNp linux-3.1.3/fs/ncpfs/dir.c linux-3.1.3/fs/ncpfs/dir.c
        DPRINTK("ncp_rename: %s/%s to %s/%s\n",
                old_dentry->d_parent->d_name.name, old_dentry->d_name.name,
                new_dentry->d_parent->d_name.name, new_dentry->d_name.name);
-diff -urNp linux-3.1.3/fs/ncpfs/inode.c linux-3.1.3/fs/ncpfs/inode.c
---- linux-3.1.3/fs/ncpfs/inode.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/ncpfs/inode.c       2011-11-16 18:40:29.000000000 -0500
-@@ -461,6 +461,8 @@ static int ncp_fill_super(struct super_b
+diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c
+index 202f370..9d4565e 100644
+--- a/fs/ncpfs/inode.c
++++ b/fs/ncpfs/inode.c
+@@ -461,6 +461,8 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent)
  #endif
        struct ncp_entry_info finfo;
  
@@ -44834,10 +47139,11 @@ diff -urNp linux-3.1.3/fs/ncpfs/inode.c linux-3.1.3/fs/ncpfs/inode.c
        memset(&data, 0, sizeof(data));
        server = kzalloc(sizeof(struct ncp_server), GFP_KERNEL);
        if (!server)
-diff -urNp linux-3.1.3/fs/nfs/blocklayout/blocklayout.c linux-3.1.3/fs/nfs/blocklayout/blocklayout.c
---- linux-3.1.3/fs/nfs/blocklayout/blocklayout.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/nfs/blocklayout/blocklayout.c       2011-11-16 18:39:08.000000000 -0500
-@@ -90,7 +90,7 @@ static int is_writable(struct pnfs_block
+diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c
+index 281ae95..dd895b9 100644
+--- a/fs/nfs/blocklayout/blocklayout.c
++++ b/fs/nfs/blocklayout/blocklayout.c
+@@ -90,7 +90,7 @@ static int is_writable(struct pnfs_block_extent *be, sector_t isect)
   */
  struct parallel_io {
        struct kref refcnt;
@@ -44846,10 +47152,11 @@ diff -urNp linux-3.1.3/fs/nfs/blocklayout/blocklayout.c linux-3.1.3/fs/nfs/block
        void (*pnfs_callback) (void *data);
        void *data;
  };
-diff -urNp linux-3.1.3/fs/nfs/inode.c linux-3.1.3/fs/nfs/inode.c
---- linux-3.1.3/fs/nfs/inode.c 2011-11-26 19:57:29.000000000 -0500
-+++ linux-3.1.3/fs/nfs/inode.c 2011-11-26 20:00:43.000000000 -0500
-@@ -150,7 +150,7 @@ static void nfs_zap_caches_locked(struct
+diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
+index 679d2f5..ef1ffec 100644
+--- a/fs/nfs/inode.c
++++ b/fs/nfs/inode.c
+@@ -150,7 +150,7 @@ static void nfs_zap_caches_locked(struct inode *inode)
        nfsi->attrtimeo = NFS_MINATTRTIMEO(inode);
        nfsi->attrtimeo_timestamp = jiffies;
  
@@ -44858,7 +47165,7 @@ diff -urNp linux-3.1.3/fs/nfs/inode.c linux-3.1.3/fs/nfs/inode.c
        if (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode))
                nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL|NFS_INO_REVAL_PAGECACHE;
        else
-@@ -1002,16 +1002,16 @@ static int nfs_size_need_update(const st
+@@ -1002,16 +1002,16 @@ static int nfs_size_need_update(const struct inode *inode, const struct nfs_fatt
        return nfs_size_to_loff_t(fattr->size) > i_size_read(inode);
  }
  
@@ -44878,10 +47185,11 @@ diff -urNp linux-3.1.3/fs/nfs/inode.c linux-3.1.3/fs/nfs/inode.c
  }
  
  void nfs_fattr_init(struct nfs_fattr *fattr)
-diff -urNp linux-3.1.3/fs/nfsd/nfs4state.c linux-3.1.3/fs/nfsd/nfs4state.c
---- linux-3.1.3/fs/nfsd/nfs4state.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/nfsd/nfs4state.c    2011-11-16 18:40:29.000000000 -0500
-@@ -3999,6 +3999,8 @@ nfsd4_lock(struct svc_rqst *rqstp, struc
+diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
+index 6f8bcc7..8f823c5 100644
+--- a/fs/nfsd/nfs4state.c
++++ b/fs/nfsd/nfs4state.c
+@@ -3999,6 +3999,8 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
        unsigned int strhashval;
        int err;
  
@@ -44890,10 +47198,11 @@ diff -urNp linux-3.1.3/fs/nfsd/nfs4state.c linux-3.1.3/fs/nfsd/nfs4state.c
        dprintk("NFSD: nfsd4_lock: start=%Ld length=%Ld\n",
                (long long) lock->lk_offset,
                (long long) lock->lk_length);
-diff -urNp linux-3.1.3/fs/nfsd/nfs4xdr.c linux-3.1.3/fs/nfsd/nfs4xdr.c
---- linux-3.1.3/fs/nfsd/nfs4xdr.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/nfsd/nfs4xdr.c      2011-11-16 18:40:29.000000000 -0500
-@@ -1875,6 +1875,8 @@ nfsd4_encode_fattr(struct svc_fh *fhp, s
+diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
+index f810996..cec8977 100644
+--- a/fs/nfsd/nfs4xdr.c
++++ b/fs/nfsd/nfs4xdr.c
+@@ -1875,6 +1875,8 @@ nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
                .dentry = dentry,
        };
  
@@ -44902,10 +47211,11 @@ diff -urNp linux-3.1.3/fs/nfsd/nfs4xdr.c linux-3.1.3/fs/nfsd/nfs4xdr.c
        BUG_ON(bmval1 & NFSD_WRITEONLY_ATTRS_WORD1);
        BUG_ON(bmval0 & ~nfsd_suppattrs0(minorversion));
        BUG_ON(bmval1 & ~nfsd_suppattrs1(minorversion));
-diff -urNp linux-3.1.3/fs/nfsd/vfs.c linux-3.1.3/fs/nfsd/vfs.c
---- linux-3.1.3/fs/nfsd/vfs.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/nfsd/vfs.c  2011-11-16 18:39:08.000000000 -0500
-@@ -896,7 +896,7 @@ nfsd_vfs_read(struct svc_rqst *rqstp, st
+diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
+index acf88ae..4fd6245 100644
+--- a/fs/nfsd/vfs.c
++++ b/fs/nfsd/vfs.c
+@@ -896,7 +896,7 @@ nfsd_vfs_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
        } else {
                oldfs = get_fs();
                set_fs(KERNEL_DS);
@@ -44914,7 +47224,7 @@ diff -urNp linux-3.1.3/fs/nfsd/vfs.c linux-3.1.3/fs/nfsd/vfs.c
                set_fs(oldfs);
        }
  
-@@ -1000,7 +1000,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, s
+@@ -1000,7 +1000,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
  
        /* Write the data. */
        oldfs = get_fs(); set_fs(KERNEL_DS);
@@ -44923,7 +47233,7 @@ diff -urNp linux-3.1.3/fs/nfsd/vfs.c linux-3.1.3/fs/nfsd/vfs.c
        set_fs(oldfs);
        if (host_err < 0)
                goto out_nfserr;
-@@ -1535,7 +1535,7 @@ nfsd_readlink(struct svc_rqst *rqstp, st
+@@ -1535,7 +1535,7 @@ nfsd_readlink(struct svc_rqst *rqstp, struct svc_fh *fhp, char *buf, int *lenp)
         */
  
        oldfs = get_fs(); set_fs(KERNEL_DS);
@@ -44932,10 +47242,11 @@ diff -urNp linux-3.1.3/fs/nfsd/vfs.c linux-3.1.3/fs/nfsd/vfs.c
        set_fs(oldfs);
  
        if (host_err < 0)
-diff -urNp linux-3.1.3/fs/notify/fanotify/fanotify_user.c linux-3.1.3/fs/notify/fanotify/fanotify_user.c
---- linux-3.1.3/fs/notify/fanotify/fanotify_user.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/notify/fanotify/fanotify_user.c     2011-11-16 18:39:08.000000000 -0500
-@@ -276,7 +276,8 @@ static ssize_t copy_event_to_user(struct
+diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
+index 9fde1c0..14e8827 100644
+--- a/fs/notify/fanotify/fanotify_user.c
++++ b/fs/notify/fanotify/fanotify_user.c
+@@ -276,7 +276,8 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group,
                goto out_close_fd;
  
        ret = -EFAULT;
@@ -44945,10 +47256,11 @@ diff -urNp linux-3.1.3/fs/notify/fanotify/fanotify_user.c linux-3.1.3/fs/notify/
                         fanotify_event_metadata.event_len))
                goto out_kill_access_response;
  
-diff -urNp linux-3.1.3/fs/notify/notification.c linux-3.1.3/fs/notify/notification.c
---- linux-3.1.3/fs/notify/notification.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/notify/notification.c       2011-11-16 18:39:08.000000000 -0500
-@@ -57,7 +57,7 @@ static struct kmem_cache *fsnotify_event
+diff --git a/fs/notify/notification.c b/fs/notify/notification.c
+index ee18815..7aa5d01 100644
+--- a/fs/notify/notification.c
++++ b/fs/notify/notification.c
+@@ -57,7 +57,7 @@ static struct kmem_cache *fsnotify_event_holder_cachep;
   * get set to 0 so it will never get 'freed'
   */
  static struct fsnotify_event *q_overflow_event;
@@ -44957,7 +47269,7 @@ diff -urNp linux-3.1.3/fs/notify/notification.c linux-3.1.3/fs/notify/notificati
  
  /**
   * fsnotify_get_cookie - return a unique cookie for use in synchronizing events.
-@@ -65,7 +65,7 @@ static atomic_t fsnotify_sync_cookie = A
+@@ -65,7 +65,7 @@ static atomic_t fsnotify_sync_cookie = ATOMIC_INIT(0);
   */
  u32 fsnotify_get_cookie(void)
  {
@@ -44966,9 +47278,10 @@ diff -urNp linux-3.1.3/fs/notify/notification.c linux-3.1.3/fs/notify/notificati
  }
  EXPORT_SYMBOL_GPL(fsnotify_get_cookie);
  
-diff -urNp linux-3.1.3/fs/ntfs/dir.c linux-3.1.3/fs/ntfs/dir.c
---- linux-3.1.3/fs/ntfs/dir.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/ntfs/dir.c  2011-11-16 18:39:08.000000000 -0500
+diff --git a/fs/ntfs/dir.c b/fs/ntfs/dir.c
+index 99e3610..02c1068 100644
+--- a/fs/ntfs/dir.c
++++ b/fs/ntfs/dir.c
 @@ -1329,7 +1329,7 @@ find_next_index_buffer:
        ia = (INDEX_ALLOCATION*)(kaddr + (ia_pos & ~PAGE_CACHE_MASK &
                        ~(s64)(ndir->itype.index.block_size - 1)));
@@ -44978,10 +47291,11 @@ diff -urNp linux-3.1.3/fs/ntfs/dir.c linux-3.1.3/fs/ntfs/dir.c
                ntfs_error(sb, "Out of bounds check failed. Corrupt directory "
                                "inode 0x%lx or driver bug.", vdir->i_ino);
                goto err_out;
-diff -urNp linux-3.1.3/fs/ntfs/file.c linux-3.1.3/fs/ntfs/file.c
---- linux-3.1.3/fs/ntfs/file.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/ntfs/file.c 2011-11-16 18:39:08.000000000 -0500
-@@ -2229,6 +2229,6 @@ const struct inode_operations ntfs_file_
+diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c
+index c587e2d..3641eaa 100644
+--- a/fs/ntfs/file.c
++++ b/fs/ntfs/file.c
+@@ -2229,6 +2229,6 @@ const struct inode_operations ntfs_file_inode_ops = {
  #endif /* NTFS_RW */
  };
  
@@ -44990,10 +47304,11 @@ diff -urNp linux-3.1.3/fs/ntfs/file.c linux-3.1.3/fs/ntfs/file.c
  
 -const struct inode_operations ntfs_empty_inode_ops = {};
 +const struct inode_operations ntfs_empty_inode_ops __read_only;
-diff -urNp linux-3.1.3/fs/ocfs2/localalloc.c linux-3.1.3/fs/ocfs2/localalloc.c
---- linux-3.1.3/fs/ocfs2/localalloc.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/ocfs2/localalloc.c  2011-11-16 18:39:08.000000000 -0500
-@@ -1283,7 +1283,7 @@ static int ocfs2_local_alloc_slide_windo
+diff --git a/fs/ocfs2/localalloc.c b/fs/ocfs2/localalloc.c
+index 210c352..a174f83 100644
+--- a/fs/ocfs2/localalloc.c
++++ b/fs/ocfs2/localalloc.c
+@@ -1283,7 +1283,7 @@ static int ocfs2_local_alloc_slide_window(struct ocfs2_super *osb,
                goto bail;
        }
  
@@ -45002,10 +47317,11 @@ diff -urNp linux-3.1.3/fs/ocfs2/localalloc.c linux-3.1.3/fs/ocfs2/localalloc.c
  
  bail:
        if (handle)
-diff -urNp linux-3.1.3/fs/ocfs2/namei.c linux-3.1.3/fs/ocfs2/namei.c
---- linux-3.1.3/fs/ocfs2/namei.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/ocfs2/namei.c       2011-11-16 18:40:29.000000000 -0500
-@@ -1063,6 +1063,8 @@ static int ocfs2_rename(struct inode *ol
+diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
+index 53aa41e..d7df9f1 100644
+--- a/fs/ocfs2/namei.c
++++ b/fs/ocfs2/namei.c
+@@ -1063,6 +1063,8 @@ static int ocfs2_rename(struct inode *old_dir,
        struct ocfs2_dir_lookup_result orphan_insert = { NULL, };
        struct ocfs2_dir_lookup_result target_insert = { NULL, };
  
@@ -45014,9 +47330,10 @@ diff -urNp linux-3.1.3/fs/ocfs2/namei.c linux-3.1.3/fs/ocfs2/namei.c
        /* At some point it might be nice to break this function up a
         * bit. */
  
-diff -urNp linux-3.1.3/fs/ocfs2/ocfs2.h linux-3.1.3/fs/ocfs2/ocfs2.h
---- linux-3.1.3/fs/ocfs2/ocfs2.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/ocfs2/ocfs2.h       2011-11-16 18:39:08.000000000 -0500
+diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h
+index 4092858..51c70ff 100644
+--- a/fs/ocfs2/ocfs2.h
++++ b/fs/ocfs2/ocfs2.h
 @@ -235,11 +235,11 @@ enum ocfs2_vol_state
  
  struct ocfs2_alloc_stats
@@ -45034,10 +47351,11 @@ diff -urNp linux-3.1.3/fs/ocfs2/ocfs2.h linux-3.1.3/fs/ocfs2/ocfs2.h
  };
  
  enum ocfs2_local_alloc_state
-diff -urNp linux-3.1.3/fs/ocfs2/suballoc.c linux-3.1.3/fs/ocfs2/suballoc.c
---- linux-3.1.3/fs/ocfs2/suballoc.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/ocfs2/suballoc.c    2011-11-16 18:39:08.000000000 -0500
-@@ -872,7 +872,7 @@ static int ocfs2_reserve_suballoc_bits(s
+diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c
+index ba5d97e..c77db25 100644
+--- a/fs/ocfs2/suballoc.c
++++ b/fs/ocfs2/suballoc.c
+@@ -872,7 +872,7 @@ static int ocfs2_reserve_suballoc_bits(struct ocfs2_super *osb,
                                mlog_errno(status);
                        goto bail;
                }
@@ -45046,7 +47364,7 @@ diff -urNp linux-3.1.3/fs/ocfs2/suballoc.c linux-3.1.3/fs/ocfs2/suballoc.c
  
                /* You should never ask for this much metadata */
                BUG_ON(bits_wanted >
-@@ -2008,7 +2008,7 @@ int ocfs2_claim_metadata(handle_t *handl
+@@ -2008,7 +2008,7 @@ int ocfs2_claim_metadata(handle_t *handle,
                mlog_errno(status);
                goto bail;
        }
@@ -45055,7 +47373,7 @@ diff -urNp linux-3.1.3/fs/ocfs2/suballoc.c linux-3.1.3/fs/ocfs2/suballoc.c
  
        *suballoc_loc = res.sr_bg_blkno;
        *suballoc_bit_start = res.sr_bit_offset;
-@@ -2172,7 +2172,7 @@ int ocfs2_claim_new_inode_at_loc(handle_
+@@ -2172,7 +2172,7 @@ int ocfs2_claim_new_inode_at_loc(handle_t *handle,
        trace_ocfs2_claim_new_inode_at_loc((unsigned long long)di_blkno,
                                           res->sr_bits);
  
@@ -45064,7 +47382,7 @@ diff -urNp linux-3.1.3/fs/ocfs2/suballoc.c linux-3.1.3/fs/ocfs2/suballoc.c
  
        BUG_ON(res->sr_bits != 1);
  
-@@ -2214,7 +2214,7 @@ int ocfs2_claim_new_inode(handle_t *hand
+@@ -2214,7 +2214,7 @@ int ocfs2_claim_new_inode(handle_t *handle,
                mlog_errno(status);
                goto bail;
        }
@@ -45073,7 +47391,7 @@ diff -urNp linux-3.1.3/fs/ocfs2/suballoc.c linux-3.1.3/fs/ocfs2/suballoc.c
  
        BUG_ON(res.sr_bits != 1);
  
-@@ -2318,7 +2318,7 @@ int __ocfs2_claim_clusters(handle_t *han
+@@ -2318,7 +2318,7 @@ int __ocfs2_claim_clusters(handle_t *handle,
                                                      cluster_start,
                                                      num_clusters);
                if (!status)
@@ -45082,7 +47400,7 @@ diff -urNp linux-3.1.3/fs/ocfs2/suballoc.c linux-3.1.3/fs/ocfs2/suballoc.c
        } else {
                if (min_clusters > (osb->bitmap_cpg - 1)) {
                        /* The only paths asking for contiguousness
-@@ -2344,7 +2344,7 @@ int __ocfs2_claim_clusters(handle_t *han
+@@ -2344,7 +2344,7 @@ int __ocfs2_claim_clusters(handle_t *handle,
                                ocfs2_desc_bitmap_to_cluster_off(ac->ac_inode,
                                                                 res.sr_bg_blkno,
                                                                 res.sr_bit_offset);
@@ -45091,10 +47409,11 @@ diff -urNp linux-3.1.3/fs/ocfs2/suballoc.c linux-3.1.3/fs/ocfs2/suballoc.c
                        *num_clusters = res.sr_bits;
                }
        }
-diff -urNp linux-3.1.3/fs/ocfs2/super.c linux-3.1.3/fs/ocfs2/super.c
---- linux-3.1.3/fs/ocfs2/super.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/ocfs2/super.c       2011-11-16 18:39:08.000000000 -0500
-@@ -300,11 +300,11 @@ static int ocfs2_osb_dump(struct ocfs2_s
+diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
+index 56f6102..1433c29 100644
+--- a/fs/ocfs2/super.c
++++ b/fs/ocfs2/super.c
+@@ -300,11 +300,11 @@ static int ocfs2_osb_dump(struct ocfs2_super *osb, char *buf, int len)
                        "%10s => GlobalAllocs: %d  LocalAllocs: %d  "
                        "SubAllocs: %d  LAWinMoves: %d  SAExtends: %d\n",
                        "Stats",
@@ -45111,7 +47430,7 @@ diff -urNp linux-3.1.3/fs/ocfs2/super.c linux-3.1.3/fs/ocfs2/super.c
  
        out += snprintf(buf + out, len - out,
                        "%10s => State: %u  Descriptor: %llu  Size: %u bits  "
-@@ -2112,11 +2112,11 @@ static int ocfs2_initialize_super(struct
+@@ -2112,11 +2112,11 @@ static int ocfs2_initialize_super(struct super_block *sb,
        spin_lock_init(&osb->osb_xattr_lock);
        ocfs2_init_steal_slots(osb);
  
@@ -45128,9 +47447,10 @@ diff -urNp linux-3.1.3/fs/ocfs2/super.c linux-3.1.3/fs/ocfs2/super.c
  
        /* Copy the blockcheck stats from the superblock probe */
        osb->osb_ecc_stats = *stats;
-diff -urNp linux-3.1.3/fs/ocfs2/symlink.c linux-3.1.3/fs/ocfs2/symlink.c
---- linux-3.1.3/fs/ocfs2/symlink.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/ocfs2/symlink.c     2011-11-16 18:39:08.000000000 -0500
+diff --git a/fs/ocfs2/symlink.c b/fs/ocfs2/symlink.c
+index 5d22872..523db20 100644
+--- a/fs/ocfs2/symlink.c
++++ b/fs/ocfs2/symlink.c
 @@ -142,7 +142,7 @@ bail:
  
  static void ocfs2_fast_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie)
@@ -45140,10 +47460,11 @@ diff -urNp linux-3.1.3/fs/ocfs2/symlink.c linux-3.1.3/fs/ocfs2/symlink.c
        if (!IS_ERR(link))
                kfree(link);
  }
-diff -urNp linux-3.1.3/fs/open.c linux-3.1.3/fs/open.c
---- linux-3.1.3/fs/open.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/open.c      2011-11-17 19:07:55.000000000 -0500
-@@ -112,6 +112,10 @@ static long do_sys_truncate(const char _
+diff --git a/fs/open.c b/fs/open.c
+index f711921..28d5958 100644
+--- a/fs/open.c
++++ b/fs/open.c
+@@ -112,6 +112,10 @@ static long do_sys_truncate(const char __user *pathname, loff_t length)
        error = locks_verify_truncate(inode, NULL, length);
        if (!error)
                error = security_path_truncate(&path);
@@ -45154,7 +47475,7 @@ diff -urNp linux-3.1.3/fs/open.c linux-3.1.3/fs/open.c
        if (!error)
                error = do_truncate(path.dentry, length, 0, NULL);
  
-@@ -358,6 +362,9 @@ SYSCALL_DEFINE3(faccessat, int, dfd, con
+@@ -358,6 +362,9 @@ SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode)
        if (__mnt_is_readonly(path.mnt))
                res = -EROFS;
  
@@ -45164,7 +47485,7 @@ diff -urNp linux-3.1.3/fs/open.c linux-3.1.3/fs/open.c
  out_path_release:
        path_put(&path);
  out:
-@@ -384,6 +391,8 @@ SYSCALL_DEFINE1(chdir, const char __user
+@@ -384,6 +391,8 @@ SYSCALL_DEFINE1(chdir, const char __user *, filename)
        if (error)
                goto dput_and_out;
  
@@ -45173,7 +47494,7 @@ diff -urNp linux-3.1.3/fs/open.c linux-3.1.3/fs/open.c
        set_fs_pwd(current->fs, &path);
  
  dput_and_out:
-@@ -410,6 +419,13 @@ SYSCALL_DEFINE1(fchdir, unsigned int, fd
+@@ -410,6 +419,13 @@ SYSCALL_DEFINE1(fchdir, unsigned int, fd)
                goto out_putf;
  
        error = inode_permission(inode, MAY_EXEC | MAY_CHDIR);
@@ -45187,7 +47508,7 @@ diff -urNp linux-3.1.3/fs/open.c linux-3.1.3/fs/open.c
        if (!error)
                set_fs_pwd(current->fs, &file->f_path);
  out_putf:
-@@ -438,7 +454,13 @@ SYSCALL_DEFINE1(chroot, const char __use
+@@ -438,7 +454,13 @@ SYSCALL_DEFINE1(chroot, const char __user *, filename)
        if (error)
                goto dput_and_out;
  
@@ -45201,7 +47522,7 @@ diff -urNp linux-3.1.3/fs/open.c linux-3.1.3/fs/open.c
        error = 0;
  dput_and_out:
        path_put(&path);
-@@ -456,6 +478,16 @@ static int chmod_common(struct path *pat
+@@ -456,6 +478,16 @@ static int chmod_common(struct path *path, umode_t mode)
        if (error)
                return error;
        mutex_lock(&inode->i_mutex);
@@ -45218,7 +47539,7 @@ diff -urNp linux-3.1.3/fs/open.c linux-3.1.3/fs/open.c
        error = security_path_chmod(path->dentry, path->mnt, mode);
        if (error)
                goto out_unlock;
-@@ -506,6 +538,9 @@ static int chown_common(struct path *pat
+@@ -506,6 +538,9 @@ static int chown_common(struct path *path, uid_t user, gid_t group)
        int error;
        struct iattr newattrs;
  
@@ -45228,10 +47549,36 @@ diff -urNp linux-3.1.3/fs/open.c linux-3.1.3/fs/open.c
        newattrs.ia_valid =  ATTR_CTIME;
        if (user != (uid_t) -1) {
                newattrs.ia_valid |= ATTR_UID;
-diff -urNp linux-3.1.3/fs/partitions/ldm.c linux-3.1.3/fs/partitions/ldm.c
---- linux-3.1.3/fs/partitions/ldm.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/partitions/ldm.c    2011-11-17 19:08:15.000000000 -0500
-@@ -1322,7 +1322,7 @@ static bool ldm_frag_add (const u8 *data
+diff --git a/fs/partitions/efi.c b/fs/partitions/efi.c
+index 6296b40..417c00f 100644
+--- a/fs/partitions/efi.c
++++ b/fs/partitions/efi.c
+@@ -234,14 +234,14 @@ static gpt_entry *alloc_read_gpt_entries(struct parsed_partitions *state,
+       if (!gpt)
+               return NULL;
++      if (!le32_to_cpu(gpt->num_partition_entries))
++              return NULL;
++      pte = kcalloc(le32_to_cpu(gpt->num_partition_entries), le32_to_cpu(gpt->sizeof_partition_entry), GFP_KERNEL);
++      if (!pte)
++              return NULL;
++
+       count = le32_to_cpu(gpt->num_partition_entries) *
+                 le32_to_cpu(gpt->sizeof_partition_entry);
+-      if (!count)
+-              return NULL;
+-      pte = kzalloc(count, GFP_KERNEL);
+-      if (!pte)
+-              return NULL;
+-
+       if (read_lba(state, le64_to_cpu(gpt->partition_entry_lba),
+                      (u8 *) pte,
+                    count) < count) {
+diff --git a/fs/partitions/ldm.c b/fs/partitions/ldm.c
+index af9fdf0..75b15c3 100644
+--- a/fs/partitions/ldm.c
++++ b/fs/partitions/ldm.c
+@@ -1322,7 +1322,7 @@ static bool ldm_frag_add (const u8 *data, int size, struct list_head *frags)
                        goto found;
        }
  
@@ -45240,9 +47587,10 @@ diff -urNp linux-3.1.3/fs/partitions/ldm.c linux-3.1.3/fs/partitions/ldm.c
        if (!f) {
                ldm_crit ("Out of memory.");
                return false;
-diff -urNp linux-3.1.3/fs/pipe.c linux-3.1.3/fs/pipe.c
---- linux-3.1.3/fs/pipe.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/pipe.c      2011-11-16 18:40:29.000000000 -0500
+diff --git a/fs/pipe.c b/fs/pipe.c
+index 0e0be1d..f62a72d 100644
+--- a/fs/pipe.c
++++ b/fs/pipe.c
 @@ -420,9 +420,9 @@ redo:
                }
                if (bufs)       /* More to do? */
@@ -45255,7 +47603,7 @@ diff -urNp linux-3.1.3/fs/pipe.c linux-3.1.3/fs/pipe.c
                        /* syscall merging: Usually we must not sleep
                         * if O_NONBLOCK is set, or if we got some data.
                         * But if a writer sleeps in kernel space, then
-@@ -481,7 +481,7 @@ pipe_write(struct kiocb *iocb, const str
+@@ -481,7 +481,7 @@ pipe_write(struct kiocb *iocb, const struct iovec *_iov,
        mutex_lock(&inode->i_mutex);
        pipe = inode->i_pipe;
  
@@ -45285,7 +47633,7 @@ diff -urNp linux-3.1.3/fs/pipe.c linux-3.1.3/fs/pipe.c
        }
  out:
        mutex_unlock(&inode->i_mutex);
-@@ -685,7 +685,7 @@ pipe_poll(struct file *filp, poll_table 
+@@ -685,7 +685,7 @@ pipe_poll(struct file *filp, poll_table *wait)
        mask = 0;
        if (filp->f_mode & FMODE_READ) {
                mask = (nrbufs > 0) ? POLLIN | POLLRDNORM : 0;
@@ -45294,7 +47642,7 @@ diff -urNp linux-3.1.3/fs/pipe.c linux-3.1.3/fs/pipe.c
                        mask |= POLLHUP;
        }
  
-@@ -695,7 +695,7 @@ pipe_poll(struct file *filp, poll_table 
+@@ -695,7 +695,7 @@ pipe_poll(struct file *filp, poll_table *wait)
                 * Most Unices do not set POLLERR for FIFOs but on Linux they
                 * behave exactly like pipes for poll().
                 */
@@ -45303,7 +47651,7 @@ diff -urNp linux-3.1.3/fs/pipe.c linux-3.1.3/fs/pipe.c
                        mask |= POLLERR;
        }
  
-@@ -709,10 +709,10 @@ pipe_release(struct inode *inode, int de
+@@ -709,10 +709,10 @@ pipe_release(struct inode *inode, int decr, int decw)
  
        mutex_lock(&inode->i_mutex);
        pipe = inode->i_pipe;
@@ -45317,7 +47665,7 @@ diff -urNp linux-3.1.3/fs/pipe.c linux-3.1.3/fs/pipe.c
                free_pipe_info(inode);
        } else {
                wake_up_interruptible_sync_poll(&pipe->wait, POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM | POLLERR | POLLHUP);
-@@ -802,7 +802,7 @@ pipe_read_open(struct inode *inode, stru
+@@ -802,7 +802,7 @@ pipe_read_open(struct inode *inode, struct file *filp)
  
        if (inode->i_pipe) {
                ret = 0;
@@ -45326,7 +47674,7 @@ diff -urNp linux-3.1.3/fs/pipe.c linux-3.1.3/fs/pipe.c
        }
  
        mutex_unlock(&inode->i_mutex);
-@@ -819,7 +819,7 @@ pipe_write_open(struct inode *inode, str
+@@ -819,7 +819,7 @@ pipe_write_open(struct inode *inode, struct file *filp)
  
        if (inode->i_pipe) {
                ret = 0;
@@ -45335,7 +47683,7 @@ diff -urNp linux-3.1.3/fs/pipe.c linux-3.1.3/fs/pipe.c
        }
  
        mutex_unlock(&inode->i_mutex);
-@@ -837,9 +837,9 @@ pipe_rdwr_open(struct inode *inode, stru
+@@ -837,9 +837,9 @@ pipe_rdwr_open(struct inode *inode, struct file *filp)
        if (inode->i_pipe) {
                ret = 0;
                if (filp->f_mode & FMODE_READ)
@@ -45356,7 +47704,7 @@ diff -urNp linux-3.1.3/fs/pipe.c linux-3.1.3/fs/pipe.c
  
  /*
   * pipefs_dname() is called from d_path().
-@@ -961,7 +961,8 @@ static struct inode * get_pipe_inode(voi
+@@ -961,7 +961,8 @@ static struct inode * get_pipe_inode(void)
                goto fail_iput;
        inode->i_pipe = pipe;
  
@@ -45366,9 +47714,41 @@ diff -urNp linux-3.1.3/fs/pipe.c linux-3.1.3/fs/pipe.c
        inode->i_fop = &rdwr_pipefifo_fops;
  
        /*
-diff -urNp linux-3.1.3/fs/proc/array.c linux-3.1.3/fs/proc/array.c
---- linux-3.1.3/fs/proc/array.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/proc/array.c        2011-11-17 18:42:02.000000000 -0500
+diff --git a/fs/proc/Kconfig b/fs/proc/Kconfig
+index 15af622..0e9f4467 100644
+--- a/fs/proc/Kconfig
++++ b/fs/proc/Kconfig
+@@ -30,12 +30,12 @@ config PROC_FS
+ config PROC_KCORE
+       bool "/proc/kcore support" if !ARM
+-      depends on PROC_FS && MMU
++      depends on PROC_FS && MMU && !GRKERNSEC_PROC_ADD
+ config PROC_VMCORE
+       bool "/proc/vmcore support"
+-      depends on PROC_FS && CRASH_DUMP
+-      default y
++      depends on PROC_FS && CRASH_DUMP && !GRKERNSEC
++      default n
+         help
+         Exports the dump image of crashed kernel in ELF format.
+@@ -59,8 +59,8 @@ config PROC_SYSCTL
+         limited in memory.
+ config PROC_PAGE_MONITOR
+-      default y
+-      depends on PROC_FS && MMU
++      default n
++      depends on PROC_FS && MMU && !GRKERNSEC
+       bool "Enable /proc page monitoring" if EXPERT
+       help
+         Various /proc files exist to monitor process memory utilization:
+diff --git a/fs/proc/array.c b/fs/proc/array.c
+index 3a1dafd..c7fed72 100644
+--- a/fs/proc/array.c
++++ b/fs/proc/array.c
 @@ -60,6 +60,7 @@
  #include <linux/tty.h>
  #include <linux/string.h>
@@ -45377,7 +47757,7 @@ diff -urNp linux-3.1.3/fs/proc/array.c linux-3.1.3/fs/proc/array.c
  #include <linux/proc_fs.h>
  #include <linux/ioport.h>
  #include <linux/uaccess.h>
-@@ -337,6 +338,21 @@ static void task_cpus_allowed(struct seq
+@@ -337,6 +338,21 @@ static void task_cpus_allowed(struct seq_file *m, struct task_struct *task)
        seq_putc(m, '\n');
  }
  
@@ -45399,7 +47779,7 @@ diff -urNp linux-3.1.3/fs/proc/array.c linux-3.1.3/fs/proc/array.c
  int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,
                        struct pid *pid, struct task_struct *task)
  {
-@@ -354,9 +370,24 @@ int proc_pid_status(struct seq_file *m, 
+@@ -354,9 +370,24 @@ int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,
        task_cpus_allowed(m, task);
        cpuset_task_status_allowed(m, task);
        task_context_switch_counts(m, task);
@@ -45424,7 +47804,7 @@ diff -urNp linux-3.1.3/fs/proc/array.c linux-3.1.3/fs/proc/array.c
  static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
                        struct pid *pid, struct task_struct *task, int whole)
  {
-@@ -378,6 +409,8 @@ static int do_task_stat(struct seq_file 
+@@ -378,6 +409,8 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
        char tcomm[sizeof(task->comm)];
        unsigned long flags;
  
@@ -45433,7 +47813,7 @@ diff -urNp linux-3.1.3/fs/proc/array.c linux-3.1.3/fs/proc/array.c
        state = *get_task_state(task);
        vsize = eip = esp = 0;
        permitted = ptrace_may_access(task, PTRACE_MODE_READ);
-@@ -449,6 +482,19 @@ static int do_task_stat(struct seq_file 
+@@ -449,6 +482,19 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
                gtime = task->gtime;
        }
  
@@ -45453,7 +47833,7 @@ diff -urNp linux-3.1.3/fs/proc/array.c linux-3.1.3/fs/proc/array.c
        /* scale priority and nice values from timeslices to -20..20 */
        /* to make it look like a "normal" Unix priority/nice value  */
        priority = task_prio(task);
-@@ -489,9 +535,15 @@ static int do_task_stat(struct seq_file 
+@@ -489,9 +535,15 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
                vsize,
                mm ? get_mm_rss(mm) : 0,
                rsslim,
@@ -45469,7 +47849,7 @@ diff -urNp linux-3.1.3/fs/proc/array.c linux-3.1.3/fs/proc/array.c
                esp,
                eip,
                /* The signal information here is obsolete.
-@@ -544,3 +596,18 @@ int proc_pid_statm(struct seq_file *m, s
+@@ -544,3 +596,18 @@ int proc_pid_statm(struct seq_file *m, struct pid_namespace *ns,
  
        return 0;
  }
@@ -45488,9 +47868,10 @@ diff -urNp linux-3.1.3/fs/proc/array.c linux-3.1.3/fs/proc/array.c
 +      return sprintf(buffer, "%pI4\n", &curr_ip);
 +}
 +#endif
-diff -urNp linux-3.1.3/fs/proc/base.c linux-3.1.3/fs/proc/base.c
---- linux-3.1.3/fs/proc/base.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/proc/base.c 2011-11-17 18:43:19.000000000 -0500
+diff --git a/fs/proc/base.c b/fs/proc/base.c
+index 5eb0206..fe01db4 100644
+--- a/fs/proc/base.c
++++ b/fs/proc/base.c
 @@ -107,6 +107,22 @@ struct pid_entry {
        union proc_op op;
  };
@@ -45514,7 +47895,7 @@ diff -urNp linux-3.1.3/fs/proc/base.c linux-3.1.3/fs/proc/base.c
  #define NOD(NAME, MODE, IOP, FOP, OP) {                       \
        .name = (NAME),                                 \
        .len  = sizeof(NAME) - 1,                       \
-@@ -209,6 +225,9 @@ static struct mm_struct *__check_mem_per
+@@ -209,6 +225,9 @@ static struct mm_struct *__check_mem_permission(struct task_struct *task)
        if (task == current)
                return mm;
  
@@ -45524,7 +47905,7 @@ diff -urNp linux-3.1.3/fs/proc/base.c linux-3.1.3/fs/proc/base.c
        /*
         * If current is actively ptrace'ing, and would also be
         * permitted to freshly attach with ptrace now, permit it.
-@@ -282,6 +301,9 @@ static int proc_pid_cmdline(struct task_
+@@ -282,6 +301,9 @@ static int proc_pid_cmdline(struct task_struct *task, char * buffer)
        if (!mm->arg_end)
                goto out_mm;    /* Shh! No looking before we're done */
  
@@ -45563,7 +47944,7 @@ diff -urNp linux-3.1.3/fs/proc/base.c linux-3.1.3/fs/proc/base.c
                do {
                        nwords += 2;
                } while (mm->saved_auxv[nwords - 2] != 0); /* AT_NULL */
-@@ -328,7 +366,7 @@ static int proc_pid_auxv(struct task_str
+@@ -328,7 +366,7 @@ static int proc_pid_auxv(struct task_struct *task, char *buffer)
  }
  
  
@@ -45572,7 +47953,7 @@ diff -urNp linux-3.1.3/fs/proc/base.c linux-3.1.3/fs/proc/base.c
  /*
   * Provides a wchan file via kallsyms in a proper one-value-per-file format.
   * Returns the resolved symbol.  If that fails, simply return the address.
-@@ -367,7 +405,7 @@ static void unlock_trace(struct task_str
+@@ -367,7 +405,7 @@ static void unlock_trace(struct task_struct *task)
        mutex_unlock(&task->signal->cred_guard_mutex);
  }
  
@@ -45581,7 +47962,7 @@ diff -urNp linux-3.1.3/fs/proc/base.c linux-3.1.3/fs/proc/base.c
  
  #define MAX_STACK_TRACE_DEPTH 64
  
-@@ -558,7 +596,7 @@ static int proc_pid_limits(struct task_s
+@@ -558,7 +596,7 @@ static int proc_pid_limits(struct task_struct *task, char *buffer)
        return count;
  }
  
@@ -45590,7 +47971,7 @@ diff -urNp linux-3.1.3/fs/proc/base.c linux-3.1.3/fs/proc/base.c
  static int proc_pid_syscall(struct task_struct *task, char *buffer)
  {
        long nr;
-@@ -587,7 +625,7 @@ static int proc_pid_syscall(struct task_
+@@ -587,7 +625,7 @@ static int proc_pid_syscall(struct task_struct *task, char *buffer)
  /************************************************************************/
  
  /* permission checks */
@@ -45599,7 +47980,7 @@ diff -urNp linux-3.1.3/fs/proc/base.c linux-3.1.3/fs/proc/base.c
  {
        struct task_struct *task;
        int allowed = 0;
-@@ -597,7 +635,10 @@ static int proc_fd_access_allowed(struct
+@@ -597,7 +635,10 @@ static int proc_fd_access_allowed(struct inode *inode)
         */
        task = get_proc_task(inode);
        if (task) {
@@ -45611,7 +47992,7 @@ diff -urNp linux-3.1.3/fs/proc/base.c linux-3.1.3/fs/proc/base.c
                put_task_struct(task);
        }
        return allowed;
-@@ -978,6 +1019,9 @@ static ssize_t environ_read(struct file 
+@@ -978,6 +1019,9 @@ static ssize_t environ_read(struct file *file, char __user *buf,
        if (!task)
                goto out_no_task;
  
@@ -45621,7 +48002,7 @@ diff -urNp linux-3.1.3/fs/proc/base.c linux-3.1.3/fs/proc/base.c
        ret = -ENOMEM;
        page = (char *)__get_free_page(GFP_TEMPORARY);
        if (!page)
-@@ -1613,7 +1657,7 @@ static void *proc_pid_follow_link(struct
+@@ -1613,7 +1657,7 @@ static void *proc_pid_follow_link(struct dentry *dentry, struct nameidata *nd)
        path_put(&nd->path);
  
        /* Are we allowed to snoop on the tasks file descriptors? */
@@ -45630,7 +48011,7 @@ diff -urNp linux-3.1.3/fs/proc/base.c linux-3.1.3/fs/proc/base.c
                goto out;
  
        error = PROC_I(inode)->op.proc_get_link(inode, &nd->path);
-@@ -1652,8 +1696,18 @@ static int proc_pid_readlink(struct dent
+@@ -1652,8 +1696,18 @@ static int proc_pid_readlink(struct dentry * dentry, char __user * buffer, int b
        struct path path;
  
        /* Are we allowed to snoop on the tasks file descriptors? */
@@ -45651,7 +48032,7 @@ diff -urNp linux-3.1.3/fs/proc/base.c linux-3.1.3/fs/proc/base.c
  
        error = PROC_I(inode)->op.proc_get_link(inode, &path);
        if (error)
-@@ -1718,7 +1772,11 @@ struct inode *proc_pid_make_inode(struct
+@@ -1718,7 +1772,11 @@ struct inode *proc_pid_make_inode(struct super_block * sb, struct task_struct *t
                rcu_read_lock();
                cred = __task_cred(task);
                inode->i_uid = cred->euid;
@@ -45663,7 +48044,7 @@ diff -urNp linux-3.1.3/fs/proc/base.c linux-3.1.3/fs/proc/base.c
                rcu_read_unlock();
        }
        security_task_to_inode(task, inode);
-@@ -1736,6 +1794,9 @@ int pid_getattr(struct vfsmount *mnt, st
+@@ -1736,6 +1794,9 @@ int pid_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
        struct inode *inode = dentry->d_inode;
        struct task_struct *task;
        const struct cred *cred;
@@ -45673,7 +48054,7 @@ diff -urNp linux-3.1.3/fs/proc/base.c linux-3.1.3/fs/proc/base.c
  
        generic_fillattr(inode, stat);
  
-@@ -1743,13 +1804,41 @@ int pid_getattr(struct vfsmount *mnt, st
+@@ -1743,13 +1804,41 @@ int pid_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
        stat->uid = 0;
        stat->gid = 0;
        task = pid_task(proc_pid(inode), PIDTYPE_PID);
@@ -45716,7 +48097,7 @@ diff -urNp linux-3.1.3/fs/proc/base.c linux-3.1.3/fs/proc/base.c
        }
        rcu_read_unlock();
        return 0;
-@@ -1786,11 +1875,20 @@ int pid_revalidate(struct dentry *dentry
+@@ -1786,11 +1875,20 @@ int pid_revalidate(struct dentry *dentry, struct nameidata *nd)
  
        if (task) {
                if ((inode->i_mode == (S_IFDIR|S_IRUGO|S_IXUGO)) ||
@@ -45737,7 +48118,7 @@ diff -urNp linux-3.1.3/fs/proc/base.c linux-3.1.3/fs/proc/base.c
                        rcu_read_unlock();
                } else {
                        inode->i_uid = 0;
-@@ -1908,7 +2006,8 @@ static int proc_fd_info(struct inode *in
+@@ -1908,7 +2006,8 @@ static int proc_fd_info(struct inode *inode, struct path *path, char *info)
        int fd = proc_fd(inode);
  
        if (task) {
@@ -45747,7 +48128,7 @@ diff -urNp linux-3.1.3/fs/proc/base.c linux-3.1.3/fs/proc/base.c
                put_task_struct(task);
        }
        if (files) {
-@@ -2176,11 +2275,21 @@ static const struct file_operations proc
+@@ -2176,11 +2275,21 @@ static const struct file_operations proc_fd_operations = {
   */
  static int proc_fd_permission(struct inode *inode, int mask)
  {
@@ -45771,7 +48152,7 @@ diff -urNp linux-3.1.3/fs/proc/base.c linux-3.1.3/fs/proc/base.c
        return rv;
  }
  
-@@ -2290,6 +2399,9 @@ static struct dentry *proc_pident_lookup
+@@ -2290,6 +2399,9 @@ static struct dentry *proc_pident_lookup(struct inode *dir,
        if (!task)
                goto out_no_task;
  
@@ -45781,7 +48162,7 @@ diff -urNp linux-3.1.3/fs/proc/base.c linux-3.1.3/fs/proc/base.c
        /*
         * Yes, it does not scale. And it should not. Don't add
         * new entries into /proc/<tgid>/ without very good reasons.
-@@ -2334,6 +2446,9 @@ static int proc_pident_readdir(struct fi
+@@ -2334,6 +2446,9 @@ static int proc_pident_readdir(struct file *filp,
        if (!task)
                goto out_no_task;
  
@@ -45791,7 +48172,7 @@ diff -urNp linux-3.1.3/fs/proc/base.c linux-3.1.3/fs/proc/base.c
        ret = 0;
        i = filp->f_pos;
        switch (i) {
-@@ -2604,7 +2719,7 @@ static void *proc_self_follow_link(struc
+@@ -2604,7 +2719,7 @@ static void *proc_self_follow_link(struct dentry *dentry, struct nameidata *nd)
  static void proc_self_put_link(struct dentry *dentry, struct nameidata *nd,
                                void *cookie)
  {
@@ -45800,7 +48181,7 @@ diff -urNp linux-3.1.3/fs/proc/base.c linux-3.1.3/fs/proc/base.c
        if (!IS_ERR(s))
                __putname(s);
  }
-@@ -2802,7 +2917,7 @@ static const struct pid_entry tgid_base_
+@@ -2802,7 +2917,7 @@ static const struct pid_entry tgid_base_stuff[] = {
        REG("autogroup",  S_IRUGO|S_IWUSR, proc_pid_sched_autogroup_operations),
  #endif
        REG("comm",      S_IRUGO|S_IWUSR, proc_pid_set_comm_operations),
@@ -45809,7 +48190,7 @@ diff -urNp linux-3.1.3/fs/proc/base.c linux-3.1.3/fs/proc/base.c
        INF("syscall",    S_IRUGO, proc_pid_syscall),
  #endif
        INF("cmdline",    S_IRUGO, proc_pid_cmdline),
-@@ -2827,10 +2942,10 @@ static const struct pid_entry tgid_base_
+@@ -2827,10 +2942,10 @@ static const struct pid_entry tgid_base_stuff[] = {
  #ifdef CONFIG_SECURITY
        DIR("attr",       S_IRUGO|S_IXUGO, proc_attr_dir_inode_operations, proc_attr_dir_operations),
  #endif
@@ -45822,7 +48203,7 @@ diff -urNp linux-3.1.3/fs/proc/base.c linux-3.1.3/fs/proc/base.c
        ONE("stack",      S_IRUGO, proc_pid_stack),
  #endif
  #ifdef CONFIG_SCHEDSTATS
-@@ -2864,6 +2979,9 @@ static const struct pid_entry tgid_base_
+@@ -2864,6 +2979,9 @@ static const struct pid_entry tgid_base_stuff[] = {
  #ifdef CONFIG_HARDWALL
        INF("hardwall",   S_IRUGO, proc_pid_hardwall),
  #endif
@@ -45832,7 +48213,7 @@ diff -urNp linux-3.1.3/fs/proc/base.c linux-3.1.3/fs/proc/base.c
  };
  
  static int proc_tgid_base_readdir(struct file * filp,
-@@ -2989,7 +3107,14 @@ static struct dentry *proc_pid_instantia
+@@ -2989,7 +3107,14 @@ static struct dentry *proc_pid_instantiate(struct inode *dir,
        if (!inode)
                goto out;
  
@@ -45847,13 +48228,10 @@ diff -urNp linux-3.1.3/fs/proc/base.c linux-3.1.3/fs/proc/base.c
        inode->i_op = &proc_tgid_base_inode_operations;
        inode->i_fop = &proc_tgid_base_operations;
        inode->i_flags|=S_IMMUTABLE;
-@@ -3031,7 +3156,14 @@ struct dentry *proc_pid_lookup(struct in
+@@ -3031,7 +3156,11 @@ struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, struct
        if (!task)
                goto out;
  
-+      if (!has_group_leader_pid(task))
-+              goto out_put_task;
-+
 +      if (gr_pid_is_chrooted(task) || gr_check_hidden_task(task))
 +              goto out_put_task;
 +
@@ -45862,7 +48240,7 @@ diff -urNp linux-3.1.3/fs/proc/base.c linux-3.1.3/fs/proc/base.c
        put_task_struct(task);
  out:
        return result;
-@@ -3096,6 +3228,11 @@ int proc_pid_readdir(struct file * filp,
+@@ -3096,6 +3225,11 @@ int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir)
  {
        unsigned int nr;
        struct task_struct *reaper;
@@ -45874,7 +48252,7 @@ diff -urNp linux-3.1.3/fs/proc/base.c linux-3.1.3/fs/proc/base.c
        struct tgid_iter iter;
        struct pid_namespace *ns;
  
-@@ -3119,8 +3256,27 @@ int proc_pid_readdir(struct file * filp,
+@@ -3119,8 +3253,27 @@ int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir)
        for (iter = next_tgid(ns, iter);
             iter.task;
             iter.tgid += 1, iter = next_tgid(ns, iter)) {
@@ -45903,7 +48281,7 @@ diff -urNp linux-3.1.3/fs/proc/base.c linux-3.1.3/fs/proc/base.c
                        put_task_struct(iter.task);
                        goto out;
                }
-@@ -3148,7 +3304,7 @@ static const struct pid_entry tid_base_s
+@@ -3148,7 +3301,7 @@ static const struct pid_entry tid_base_stuff[] = {
        REG("sched",     S_IRUGO|S_IWUSR, proc_pid_sched_operations),
  #endif
        REG("comm",      S_IRUGO|S_IWUSR, proc_pid_set_comm_operations),
@@ -45912,7 +48290,7 @@ diff -urNp linux-3.1.3/fs/proc/base.c linux-3.1.3/fs/proc/base.c
        INF("syscall",   S_IRUGO, proc_pid_syscall),
  #endif
        INF("cmdline",   S_IRUGO, proc_pid_cmdline),
-@@ -3172,10 +3328,10 @@ static const struct pid_entry tid_base_s
+@@ -3172,10 +3325,10 @@ static const struct pid_entry tid_base_stuff[] = {
  #ifdef CONFIG_SECURITY
        DIR("attr",      S_IRUGO|S_IXUGO, proc_attr_dir_inode_operations, proc_attr_dir_operations),
  #endif
@@ -45925,10 +48303,11 @@ diff -urNp linux-3.1.3/fs/proc/base.c linux-3.1.3/fs/proc/base.c
        ONE("stack",      S_IRUGO, proc_pid_stack),
  #endif
  #ifdef CONFIG_SCHEDSTATS
-diff -urNp linux-3.1.3/fs/proc/cmdline.c linux-3.1.3/fs/proc/cmdline.c
---- linux-3.1.3/fs/proc/cmdline.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/proc/cmdline.c      2011-11-16 18:40:29.000000000 -0500
-@@ -23,7 +23,11 @@ static const struct file_operations cmdl
+diff --git a/fs/proc/cmdline.c b/fs/proc/cmdline.c
+index 82676e3..5f8518a 100644
+--- a/fs/proc/cmdline.c
++++ b/fs/proc/cmdline.c
+@@ -23,7 +23,11 @@ static const struct file_operations cmdline_proc_fops = {
  
  static int __init proc_cmdline_init(void)
  {
@@ -45940,10 +48319,11 @@ diff -urNp linux-3.1.3/fs/proc/cmdline.c linux-3.1.3/fs/proc/cmdline.c
        return 0;
  }
  module_init(proc_cmdline_init);
-diff -urNp linux-3.1.3/fs/proc/devices.c linux-3.1.3/fs/proc/devices.c
---- linux-3.1.3/fs/proc/devices.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/proc/devices.c      2011-11-16 18:40:29.000000000 -0500
-@@ -64,7 +64,11 @@ static const struct file_operations proc
+diff --git a/fs/proc/devices.c b/fs/proc/devices.c
+index b143471..bb105e5 100644
+--- a/fs/proc/devices.c
++++ b/fs/proc/devices.c
+@@ -64,7 +64,11 @@ static const struct file_operations proc_devinfo_operations = {
  
  static int __init proc_devices_init(void)
  {
@@ -45955,9 +48335,10 @@ diff -urNp linux-3.1.3/fs/proc/devices.c linux-3.1.3/fs/proc/devices.c
        return 0;
  }
  module_init(proc_devices_init);
-diff -urNp linux-3.1.3/fs/proc/inode.c linux-3.1.3/fs/proc/inode.c
---- linux-3.1.3/fs/proc/inode.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/proc/inode.c        2011-11-16 18:40:29.000000000 -0500
+diff --git a/fs/proc/inode.c b/fs/proc/inode.c
+index 7ed72d6..d5f061a 100644
+--- a/fs/proc/inode.c
++++ b/fs/proc/inode.c
 @@ -18,12 +18,18 @@
  #include <linux/module.h>
  #include <linux/sysctl.h>
@@ -45977,7 +48358,7 @@ diff -urNp linux-3.1.3/fs/proc/inode.c linux-3.1.3/fs/proc/inode.c
  static void proc_evict_inode(struct inode *inode)
  {
        struct proc_dir_entry *de;
-@@ -49,6 +55,13 @@ static void proc_evict_inode(struct inod
+@@ -49,6 +55,13 @@ static void proc_evict_inode(struct inode *inode)
        ns_ops = PROC_I(inode)->ns_ops;
        if (ns_ops && ns_ops->put)
                ns_ops->put(PROC_I(inode)->ns);
@@ -45991,7 +48372,7 @@ diff -urNp linux-3.1.3/fs/proc/inode.c linux-3.1.3/fs/proc/inode.c
  }
  
  static struct kmem_cache * proc_inode_cachep;
-@@ -440,7 +453,11 @@ struct inode *proc_get_inode(struct supe
+@@ -440,7 +453,11 @@ struct inode *proc_get_inode(struct super_block *sb, struct proc_dir_entry *de)
                if (de->mode) {
                        inode->i_mode = de->mode;
                        inode->i_uid = de->uid;
@@ -46003,10 +48384,11 @@ diff -urNp linux-3.1.3/fs/proc/inode.c linux-3.1.3/fs/proc/inode.c
                }
                if (de->size)
                        inode->i_size = de->size;
-diff -urNp linux-3.1.3/fs/proc/internal.h linux-3.1.3/fs/proc/internal.h
---- linux-3.1.3/fs/proc/internal.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/proc/internal.h     2011-11-16 18:40:29.000000000 -0500
-@@ -51,6 +51,9 @@ extern int proc_pid_status(struct seq_fi
+diff --git a/fs/proc/internal.h b/fs/proc/internal.h
+index 7838e5c..ff92cbc 100644
+--- a/fs/proc/internal.h
++++ b/fs/proc/internal.h
+@@ -51,6 +51,9 @@ extern int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,
                                struct pid *pid, struct task_struct *task);
  extern int proc_pid_statm(struct seq_file *m, struct pid_namespace *ns,
                                struct pid *pid, struct task_struct *task);
@@ -46016,40 +48398,11 @@ diff -urNp linux-3.1.3/fs/proc/internal.h linux-3.1.3/fs/proc/internal.h
  extern loff_t mem_lseek(struct file *file, loff_t offset, int orig);
  
  extern const struct file_operations proc_maps_operations;
-diff -urNp linux-3.1.3/fs/proc/Kconfig linux-3.1.3/fs/proc/Kconfig
---- linux-3.1.3/fs/proc/Kconfig        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/proc/Kconfig        2011-11-16 18:40:29.000000000 -0500
-@@ -30,12 +30,12 @@ config PROC_FS
- config PROC_KCORE
-       bool "/proc/kcore support" if !ARM
--      depends on PROC_FS && MMU
-+      depends on PROC_FS && MMU && !GRKERNSEC_PROC_ADD
- config PROC_VMCORE
-       bool "/proc/vmcore support"
--      depends on PROC_FS && CRASH_DUMP
--      default y
-+      depends on PROC_FS && CRASH_DUMP && !GRKERNSEC
-+      default n
-         help
-         Exports the dump image of crashed kernel in ELF format.
-@@ -59,8 +59,8 @@ config PROC_SYSCTL
-         limited in memory.
- config PROC_PAGE_MONITOR
--      default y
--      depends on PROC_FS && MMU
-+      default n
-+      depends on PROC_FS && MMU && !GRKERNSEC
-       bool "Enable /proc page monitoring" if EXPERT
-       help
-         Various /proc files exist to monitor process memory utilization:
-diff -urNp linux-3.1.3/fs/proc/kcore.c linux-3.1.3/fs/proc/kcore.c
---- linux-3.1.3/fs/proc/kcore.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/proc/kcore.c        2011-11-16 18:40:29.000000000 -0500
-@@ -321,6 +321,8 @@ static void elf_kcore_store_hdr(char *bu
+diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c
+index d245cb2..7e645bd 100644
+--- a/fs/proc/kcore.c
++++ b/fs/proc/kcore.c
+@@ -321,6 +321,8 @@ static void elf_kcore_store_hdr(char *bufp, int nphdr, int dataoff)
        off_t offset = 0;
        struct kcore_list *m;
  
@@ -46058,7 +48411,7 @@ diff -urNp linux-3.1.3/fs/proc/kcore.c linux-3.1.3/fs/proc/kcore.c
        /* setup ELF header */
        elf = (struct elfhdr *) bufp;
        bufp += sizeof(struct elfhdr);
-@@ -478,9 +480,10 @@ read_kcore(struct file *file, char __use
+@@ -478,9 +480,10 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
         * the addresses in the elf_phdr on our list.
         */
        start = kc_offset_to_vaddr(*fpos - elf_buflen);
@@ -46071,7 +48424,7 @@ diff -urNp linux-3.1.3/fs/proc/kcore.c linux-3.1.3/fs/proc/kcore.c
        while (buflen) {
                struct kcore_list *m;
  
-@@ -509,20 +512,23 @@ read_kcore(struct file *file, char __use
+@@ -509,20 +512,23 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
                        kfree(elf_buf);
                } else {
                        if (kern_addr_valid(start)) {
@@ -46106,7 +48459,7 @@ diff -urNp linux-3.1.3/fs/proc/kcore.c linux-3.1.3/fs/proc/kcore.c
                        } else {
                                if (clear_user(buffer, tsz))
                                        return -EFAULT;
-@@ -542,6 +548,9 @@ read_kcore(struct file *file, char __use
+@@ -542,6 +548,9 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
  
  static int open_kcore(struct inode *inode, struct file *filp)
  {
@@ -46116,10 +48469,11 @@ diff -urNp linux-3.1.3/fs/proc/kcore.c linux-3.1.3/fs/proc/kcore.c
        if (!capable(CAP_SYS_RAWIO))
                return -EPERM;
        if (kcore_need_update)
-diff -urNp linux-3.1.3/fs/proc/meminfo.c linux-3.1.3/fs/proc/meminfo.c
---- linux-3.1.3/fs/proc/meminfo.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/proc/meminfo.c      2011-11-16 18:40:29.000000000 -0500
-@@ -29,6 +29,8 @@ static int meminfo_proc_show(struct seq_
+diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
+index 5861741..32c53bc 100644
+--- a/fs/proc/meminfo.c
++++ b/fs/proc/meminfo.c
+@@ -29,6 +29,8 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
        unsigned long pages[NR_LRU_LISTS];
        int lru;
  
@@ -46128,7 +48482,7 @@ diff -urNp linux-3.1.3/fs/proc/meminfo.c linux-3.1.3/fs/proc/meminfo.c
  /*
   * display in kilobytes.
   */
-@@ -157,7 +159,7 @@ static int meminfo_proc_show(struct seq_
+@@ -157,7 +159,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
                vmi.used >> 10,
                vmi.largest_chunk >> 10
  #ifdef CONFIG_MEMORY_FAILURE
@@ -46137,10 +48491,11 @@ diff -urNp linux-3.1.3/fs/proc/meminfo.c linux-3.1.3/fs/proc/meminfo.c
  #endif
  #ifdef CONFIG_TRANSPARENT_HUGEPAGE
                ,K(global_page_state(NR_ANON_TRANSPARENT_HUGEPAGES) *
-diff -urNp linux-3.1.3/fs/proc/nommu.c linux-3.1.3/fs/proc/nommu.c
---- linux-3.1.3/fs/proc/nommu.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/proc/nommu.c        2011-11-16 18:39:08.000000000 -0500
-@@ -66,7 +66,7 @@ static int nommu_region_show(struct seq_
+diff --git a/fs/proc/nommu.c b/fs/proc/nommu.c
+index b1822dd..df622cb 100644
+--- a/fs/proc/nommu.c
++++ b/fs/proc/nommu.c
+@@ -66,7 +66,7 @@ static int nommu_region_show(struct seq_file *m, struct vm_region *region)
                if (len < 1)
                        len = 1;
                seq_printf(m, "%*c", len, ' ');
@@ -46149,10 +48504,11 @@ diff -urNp linux-3.1.3/fs/proc/nommu.c linux-3.1.3/fs/proc/nommu.c
        }
  
        seq_putc(m, '\n');
-diff -urNp linux-3.1.3/fs/proc/proc_net.c linux-3.1.3/fs/proc/proc_net.c
---- linux-3.1.3/fs/proc/proc_net.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/proc/proc_net.c     2011-11-16 18:40:29.000000000 -0500
-@@ -105,6 +105,17 @@ static struct net *get_proc_task_net(str
+diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c
+index f738024..876984a 100644
+--- a/fs/proc/proc_net.c
++++ b/fs/proc/proc_net.c
+@@ -105,6 +105,17 @@ static struct net *get_proc_task_net(struct inode *dir)
        struct task_struct *task;
        struct nsproxy *ns;
        struct net *net = NULL;
@@ -46170,9 +48526,10 @@ diff -urNp linux-3.1.3/fs/proc/proc_net.c linux-3.1.3/fs/proc/proc_net.c
  
        rcu_read_lock();
        task = pid_task(proc_pid(dir), PIDTYPE_PID);
-diff -urNp linux-3.1.3/fs/proc/proc_sysctl.c linux-3.1.3/fs/proc/proc_sysctl.c
---- linux-3.1.3/fs/proc/proc_sysctl.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/proc/proc_sysctl.c  2011-11-18 18:45:33.000000000 -0500
+diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c
+index 1a77dbe..56ec911 100644
+--- a/fs/proc/proc_sysctl.c
++++ b/fs/proc/proc_sysctl.c
 @@ -8,11 +8,13 @@
  #include <linux/namei.h>
  #include "internal.h"
@@ -46189,7 +48546,7 @@ diff -urNp linux-3.1.3/fs/proc/proc_sysctl.c linux-3.1.3/fs/proc/proc_sysctl.c
  
  static struct inode *proc_sys_make_inode(struct super_block *sb,
                struct ctl_table_header *head, struct ctl_table *table)
-@@ -121,8 +123,14 @@ static struct dentry *proc_sys_lookup(st
+@@ -121,8 +123,14 @@ static struct dentry *proc_sys_lookup(struct inode *dir, struct dentry *dentry,
  
        err = NULL;
        d_set_d_op(dentry, &proc_sys_dentry_operations);
@@ -46204,7 +48561,7 @@ diff -urNp linux-3.1.3/fs/proc/proc_sysctl.c linux-3.1.3/fs/proc/proc_sysctl.c
  out:
        sysctl_head_finish(head);
        return err;
-@@ -202,6 +210,9 @@ static int proc_sys_fill_cache(struct fi
+@@ -202,6 +210,9 @@ static int proc_sys_fill_cache(struct file *filp, void *dirent,
                                return -ENOMEM;
                        } else {
                                d_set_d_op(child, &proc_sys_dentry_operations);
@@ -46214,7 +48571,7 @@ diff -urNp linux-3.1.3/fs/proc/proc_sysctl.c linux-3.1.3/fs/proc/proc_sysctl.c
                                d_add(child, inode);
                        }
                } else {
-@@ -230,6 +241,9 @@ static int scan(struct ctl_table_header 
+@@ -230,6 +241,9 @@ static int scan(struct ctl_table_header *head, ctl_table *table,
                if (*pos < file->f_pos)
                        continue;
  
@@ -46224,7 +48581,7 @@ diff -urNp linux-3.1.3/fs/proc/proc_sysctl.c linux-3.1.3/fs/proc/proc_sysctl.c
                res = proc_sys_fill_cache(file, dirent, filldir, head, table);
                if (res)
                        return res;
-@@ -355,6 +369,9 @@ static int proc_sys_getattr(struct vfsmo
+@@ -355,6 +369,9 @@ static int proc_sys_getattr(struct vfsmount *mnt, struct dentry *dentry, struct
        if (IS_ERR(head))
                return PTR_ERR(head);
  
@@ -46234,7 +48591,7 @@ diff -urNp linux-3.1.3/fs/proc/proc_sysctl.c linux-3.1.3/fs/proc/proc_sysctl.c
        generic_fillattr(inode, stat);
        if (table)
                stat->mode = (stat->mode & S_IFMT) | table->mode;
-@@ -370,17 +387,18 @@ static const struct file_operations proc
+@@ -370,17 +387,18 @@ static const struct file_operations proc_sys_file_operations = {
  };
  
  static const struct file_operations proc_sys_dir_file_operations = {
@@ -46255,9 +48612,10 @@ diff -urNp linux-3.1.3/fs/proc/proc_sysctl.c linux-3.1.3/fs/proc/proc_sysctl.c
        .lookup         = proc_sys_lookup,
        .permission     = proc_sys_permission,
        .setattr        = proc_sys_setattr,
-diff -urNp linux-3.1.3/fs/proc/root.c linux-3.1.3/fs/proc/root.c
---- linux-3.1.3/fs/proc/root.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/proc/root.c 2011-11-16 18:40:29.000000000 -0500
+diff --git a/fs/proc/root.c b/fs/proc/root.c
+index 9a8a2b7..3018df6 100644
+--- a/fs/proc/root.c
++++ b/fs/proc/root.c
 @@ -123,7 +123,15 @@ void __init proc_root_init(void)
  #ifdef CONFIG_PROC_DEVICETREE
        proc_device_tree_init();
@@ -46274,10 +48632,11 @@ diff -urNp linux-3.1.3/fs/proc/root.c linux-3.1.3/fs/proc/root.c
        proc_sys_init();
  }
  
-diff -urNp linux-3.1.3/fs/proc/task_mmu.c linux-3.1.3/fs/proc/task_mmu.c
---- linux-3.1.3/fs/proc/task_mmu.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/proc/task_mmu.c     2011-11-16 18:40:29.000000000 -0500
-@@ -51,8 +51,13 @@ void task_mem(struct seq_file *m, struct
+diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
+index c7d4ee6..41c5564 100644
+--- a/fs/proc/task_mmu.c
++++ b/fs/proc/task_mmu.c
+@@ -51,8 +51,13 @@ void task_mem(struct seq_file *m, struct mm_struct *mm)
                "VmExe:\t%8lu kB\n"
                "VmLib:\t%8lu kB\n"
                "VmPTE:\t%8lu kB\n"
@@ -46293,7 +48652,7 @@ diff -urNp linux-3.1.3/fs/proc/task_mmu.c linux-3.1.3/fs/proc/task_mmu.c
                (total_vm - mm->reserved_vm) << (PAGE_SHIFT-10),
                mm->locked_vm << (PAGE_SHIFT-10),
                hiwater_rss << (PAGE_SHIFT-10),
-@@ -60,7 +65,13 @@ void task_mem(struct seq_file *m, struct
+@@ -60,7 +65,13 @@ void task_mem(struct seq_file *m, struct mm_struct *mm)
                data << (PAGE_SHIFT-10),
                mm->stack_vm << (PAGE_SHIFT-10), text, lib,
                (PTRS_PER_PTE*sizeof(pte_t)*mm->nr_ptes) >> 10,
@@ -46308,7 +48667,7 @@ diff -urNp linux-3.1.3/fs/proc/task_mmu.c linux-3.1.3/fs/proc/task_mmu.c
  }
  
  unsigned long task_vsize(struct mm_struct *mm)
-@@ -207,6 +218,12 @@ static int do_maps_open(struct inode *in
+@@ -207,6 +218,12 @@ static int do_maps_open(struct inode *inode, struct file *file,
        return ret;
  }
  
@@ -46321,7 +48680,7 @@ diff -urNp linux-3.1.3/fs/proc/task_mmu.c linux-3.1.3/fs/proc/task_mmu.c
  static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
  {
        struct mm_struct *mm = vma->vm_mm;
-@@ -225,13 +242,13 @@ static void show_map_vma(struct seq_file
+@@ -225,13 +242,13 @@ static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
                pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT;
        }
  
@@ -46340,7 +48699,7 @@ diff -urNp linux-3.1.3/fs/proc/task_mmu.c linux-3.1.3/fs/proc/task_mmu.c
  
        seq_printf(m, "%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu %n",
                        start,
-@@ -240,7 +257,11 @@ static void show_map_vma(struct seq_file
+@@ -240,7 +257,11 @@ static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
                        flags & VM_WRITE ? 'w' : '-',
                        flags & VM_EXEC ? 'x' : '-',
                        flags & VM_MAYSHARE ? 's' : 'p',
@@ -46352,7 +48711,7 @@ diff -urNp linux-3.1.3/fs/proc/task_mmu.c linux-3.1.3/fs/proc/task_mmu.c
                        MAJOR(dev), MINOR(dev), ino, &len);
  
        /*
-@@ -249,7 +270,7 @@ static void show_map_vma(struct seq_file
+@@ -249,7 +270,7 @@ static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
         */
        if (file) {
                pad_len_spaces(m, len);
@@ -46361,7 +48720,7 @@ diff -urNp linux-3.1.3/fs/proc/task_mmu.c linux-3.1.3/fs/proc/task_mmu.c
        } else {
                const char *name = arch_vma_name(vma);
                if (!name) {
-@@ -257,8 +278,9 @@ static void show_map_vma(struct seq_file
+@@ -257,8 +278,9 @@ static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
                                if (vma->vm_start <= mm->brk &&
                                                vma->vm_end >= mm->start_brk) {
                                        name = "[heap]";
@@ -46373,7 +48732,7 @@ diff -urNp linux-3.1.3/fs/proc/task_mmu.c linux-3.1.3/fs/proc/task_mmu.c
                                        name = "[stack]";
                                }
                        } else {
-@@ -433,11 +455,16 @@ static int show_smap(struct seq_file *m,
+@@ -433,11 +455,16 @@ static int show_smap(struct seq_file *m, void *v)
        };
  
        memset(&mss, 0, sizeof mss);
@@ -46395,7 +48754,7 @@ diff -urNp linux-3.1.3/fs/proc/task_mmu.c linux-3.1.3/fs/proc/task_mmu.c
        show_map_vma(m, vma);
  
        seq_printf(m,
-@@ -455,7 +482,11 @@ static int show_smap(struct seq_file *m,
+@@ -455,7 +482,11 @@ static int show_smap(struct seq_file *m, void *v)
                   "KernelPageSize: %8lu kB\n"
                   "MMUPageSize:    %8lu kB\n"
                   "Locked:         %8lu kB\n",
@@ -46407,7 +48766,7 @@ diff -urNp linux-3.1.3/fs/proc/task_mmu.c linux-3.1.3/fs/proc/task_mmu.c
                   mss.resident >> 10,
                   (unsigned long)(mss.pss >> (10 + PSS_SHIFT)),
                   mss.shared_clean  >> 10,
-@@ -1031,7 +1062,7 @@ static int show_numa_map(struct seq_file
+@@ -1031,7 +1062,7 @@ static int show_numa_map(struct seq_file *m, void *v)
  
        if (file) {
                seq_printf(m, " file=");
@@ -46416,10 +48775,11 @@ diff -urNp linux-3.1.3/fs/proc/task_mmu.c linux-3.1.3/fs/proc/task_mmu.c
        } else if (vma->vm_start <= mm->brk && vma->vm_end >= mm->start_brk) {
                seq_printf(m, " heap");
        } else if (vma->vm_start <= mm->start_stack &&
-diff -urNp linux-3.1.3/fs/proc/task_nommu.c linux-3.1.3/fs/proc/task_nommu.c
---- linux-3.1.3/fs/proc/task_nommu.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/proc/task_nommu.c   2011-11-16 18:39:08.000000000 -0500
-@@ -51,7 +51,7 @@ void task_mem(struct seq_file *m, struct
+diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c
+index 980de54..2a4db5f 100644
+--- a/fs/proc/task_nommu.c
++++ b/fs/proc/task_nommu.c
+@@ -51,7 +51,7 @@ void task_mem(struct seq_file *m, struct mm_struct *mm)
        else
                bytes += kobjsize(mm);
        
@@ -46428,7 +48788,7 @@ diff -urNp linux-3.1.3/fs/proc/task_nommu.c linux-3.1.3/fs/proc/task_nommu.c
                sbytes += kobjsize(current->fs);
        else
                bytes += kobjsize(current->fs);
-@@ -166,7 +166,7 @@ static int nommu_vma_show(struct seq_fil
+@@ -166,7 +166,7 @@ static int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma)
  
        if (file) {
                pad_len_spaces(m, len);
@@ -46437,10 +48797,11 @@ diff -urNp linux-3.1.3/fs/proc/task_nommu.c linux-3.1.3/fs/proc/task_nommu.c
        } else if (mm) {
                if (vma->vm_start <= mm->start_stack &&
                        vma->vm_end >= mm->start_stack) {
-diff -urNp linux-3.1.3/fs/quota/netlink.c linux-3.1.3/fs/quota/netlink.c
---- linux-3.1.3/fs/quota/netlink.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/quota/netlink.c     2011-11-16 18:39:08.000000000 -0500
-@@ -33,7 +33,7 @@ static struct genl_family quota_genl_fam
+diff --git a/fs/quota/netlink.c b/fs/quota/netlink.c
+index d67908b..d13f6a6 100644
+--- a/fs/quota/netlink.c
++++ b/fs/quota/netlink.c
+@@ -33,7 +33,7 @@ static struct genl_family quota_genl_family = {
  void quota_send_warning(short type, unsigned int id, dev_t dev,
                        const char warntype)
  {
@@ -46449,7 +48810,7 @@ diff -urNp linux-3.1.3/fs/quota/netlink.c linux-3.1.3/fs/quota/netlink.c
        struct sk_buff *skb;
        void *msg_head;
        int ret;
-@@ -49,7 +49,7 @@ void quota_send_warning(short type, unsi
+@@ -49,7 +49,7 @@ void quota_send_warning(short type, unsigned int id, dev_t dev,
                  "VFS: Not enough memory to send quota warning.\n");
                return;
        }
@@ -46458,9 +48819,10 @@ diff -urNp linux-3.1.3/fs/quota/netlink.c linux-3.1.3/fs/quota/netlink.c
                        &quota_genl_family, 0, QUOTA_NL_C_WARNING);
        if (!msg_head) {
                printk(KERN_ERR
-diff -urNp linux-3.1.3/fs/readdir.c linux-3.1.3/fs/readdir.c
---- linux-3.1.3/fs/readdir.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/readdir.c   2011-11-16 18:40:29.000000000 -0500
+diff --git a/fs/readdir.c b/fs/readdir.c
+index 356f715..c918d38 100644
+--- a/fs/readdir.c
++++ b/fs/readdir.c
 @@ -17,6 +17,7 @@
  #include <linux/security.h>
  #include <linux/syscalls.h>
@@ -46477,7 +48839,7 @@ diff -urNp linux-3.1.3/fs/readdir.c linux-3.1.3/fs/readdir.c
        int result;
  };
  
-@@ -84,6 +86,10 @@ static int fillonedir(void * __buf, cons
+@@ -84,6 +86,10 @@ static int fillonedir(void * __buf, const char * name, int namlen, loff_t offset
                buf->result = -EOVERFLOW;
                return -EOVERFLOW;
        }
@@ -46488,7 +48850,7 @@ diff -urNp linux-3.1.3/fs/readdir.c linux-3.1.3/fs/readdir.c
        buf->result++;
        dirent = buf->dirent;
        if (!access_ok(VERIFY_WRITE, dirent,
-@@ -116,6 +122,7 @@ SYSCALL_DEFINE3(old_readdir, unsigned in
+@@ -116,6 +122,7 @@ SYSCALL_DEFINE3(old_readdir, unsigned int, fd,
  
        buf.result = 0;
        buf.dirent = dirent;
@@ -46504,7 +48866,7 @@ diff -urNp linux-3.1.3/fs/readdir.c linux-3.1.3/fs/readdir.c
        int count;
        int error;
  };
-@@ -163,6 +171,10 @@ static int filldir(void * __buf, const c
+@@ -163,6 +171,10 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset,
                buf->error = -EOVERFLOW;
                return -EOVERFLOW;
        }
@@ -46515,7 +48877,7 @@ diff -urNp linux-3.1.3/fs/readdir.c linux-3.1.3/fs/readdir.c
        dirent = buf->previous;
        if (dirent) {
                if (__put_user(offset, &dirent->d_off))
-@@ -210,6 +222,7 @@ SYSCALL_DEFINE3(getdents, unsigned int, 
+@@ -210,6 +222,7 @@ SYSCALL_DEFINE3(getdents, unsigned int, fd,
        buf.previous = NULL;
        buf.count = count;
        buf.error = 0;
@@ -46531,7 +48893,7 @@ diff -urNp linux-3.1.3/fs/readdir.c linux-3.1.3/fs/readdir.c
        int count;
        int error;
  };
-@@ -244,6 +258,10 @@ static int filldir64(void * __buf, const
+@@ -244,6 +258,10 @@ static int filldir64(void * __buf, const char * name, int namlen, loff_t offset,
        buf->error = -EINVAL;   /* only used if we fail.. */
        if (reclen > buf->count)
                return -EINVAL;
@@ -46542,7 +48904,7 @@ diff -urNp linux-3.1.3/fs/readdir.c linux-3.1.3/fs/readdir.c
        dirent = buf->previous;
        if (dirent) {
                if (__put_user(offset, &dirent->d_off))
-@@ -291,6 +309,7 @@ SYSCALL_DEFINE3(getdents64, unsigned int
+@@ -291,6 +309,7 @@ SYSCALL_DEFINE3(getdents64, unsigned int, fd,
  
        buf.current_dir = dirent;
        buf.previous = NULL;
@@ -46550,7 +48912,7 @@ diff -urNp linux-3.1.3/fs/readdir.c linux-3.1.3/fs/readdir.c
        buf.count = count;
        buf.error = 0;
  
-@@ -299,7 +318,7 @@ SYSCALL_DEFINE3(getdents64, unsigned int
+@@ -299,7 +318,7 @@ SYSCALL_DEFINE3(getdents64, unsigned int, fd,
                error = buf.error;
        lastdirent = buf.previous;
        if (lastdirent) {
@@ -46559,10 +48921,11 @@ diff -urNp linux-3.1.3/fs/readdir.c linux-3.1.3/fs/readdir.c
                if (__put_user(d_off, &lastdirent->d_off))
                        error = -EFAULT;
                else
-diff -urNp linux-3.1.3/fs/reiserfs/dir.c linux-3.1.3/fs/reiserfs/dir.c
---- linux-3.1.3/fs/reiserfs/dir.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/reiserfs/dir.c      2011-11-16 18:40:29.000000000 -0500
-@@ -75,6 +75,8 @@ int reiserfs_readdir_dentry(struct dentr
+diff --git a/fs/reiserfs/dir.c b/fs/reiserfs/dir.c
+index 133e935..349ef18 100644
+--- a/fs/reiserfs/dir.c
++++ b/fs/reiserfs/dir.c
+@@ -75,6 +75,8 @@ int reiserfs_readdir_dentry(struct dentry *dentry, void *dirent,
        struct reiserfs_dir_entry de;
        int ret = 0;
  
@@ -46571,10 +48934,11 @@ diff -urNp linux-3.1.3/fs/reiserfs/dir.c linux-3.1.3/fs/reiserfs/dir.c
        reiserfs_write_lock(inode->i_sb);
  
        reiserfs_check_lock_depth(inode->i_sb, "readdir");
-diff -urNp linux-3.1.3/fs/reiserfs/do_balan.c linux-3.1.3/fs/reiserfs/do_balan.c
---- linux-3.1.3/fs/reiserfs/do_balan.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/reiserfs/do_balan.c 2011-11-16 18:39:08.000000000 -0500
-@@ -2051,7 +2051,7 @@ void do_balance(struct tree_balance *tb,
+diff --git a/fs/reiserfs/do_balan.c b/fs/reiserfs/do_balan.c
+index 60c0804..d814f98 100644
+--- a/fs/reiserfs/do_balan.c
++++ b/fs/reiserfs/do_balan.c
+@@ -2051,7 +2051,7 @@ void do_balance(struct tree_balance *tb, /* tree_balance structure */
                return;
        }
  
@@ -46583,10 +48947,11 @@ diff -urNp linux-3.1.3/fs/reiserfs/do_balan.c linux-3.1.3/fs/reiserfs/do_balan.c
        do_balance_starts(tb);
  
        /* balance leaf returns 0 except if combining L R and S into
-diff -urNp linux-3.1.3/fs/reiserfs/journal.c linux-3.1.3/fs/reiserfs/journal.c
---- linux-3.1.3/fs/reiserfs/journal.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/reiserfs/journal.c  2011-11-16 18:40:29.000000000 -0500
-@@ -2289,6 +2289,8 @@ static struct buffer_head *reiserfs_brea
+diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
+index a159ba5..0396a76 100644
+--- a/fs/reiserfs/journal.c
++++ b/fs/reiserfs/journal.c
+@@ -2289,6 +2289,8 @@ static struct buffer_head *reiserfs_breada(struct block_device *dev,
        struct buffer_head *bh;
        int i, j;
  
@@ -46595,10 +48960,11 @@ diff -urNp linux-3.1.3/fs/reiserfs/journal.c linux-3.1.3/fs/reiserfs/journal.c
        bh = __getblk(dev, block, bufsize);
        if (buffer_uptodate(bh))
                return (bh);
-diff -urNp linux-3.1.3/fs/reiserfs/namei.c linux-3.1.3/fs/reiserfs/namei.c
---- linux-3.1.3/fs/reiserfs/namei.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/reiserfs/namei.c    2011-11-16 18:40:29.000000000 -0500
-@@ -1225,6 +1225,8 @@ static int reiserfs_rename(struct inode 
+diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c
+index ef39232..0fa91ba 100644
+--- a/fs/reiserfs/namei.c
++++ b/fs/reiserfs/namei.c
+@@ -1225,6 +1225,8 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry,
        unsigned long savelink = 1;
        struct timespec ctime;
  
@@ -46607,10 +48973,11 @@ diff -urNp linux-3.1.3/fs/reiserfs/namei.c linux-3.1.3/fs/reiserfs/namei.c
        /* three balancings: (1) old name removal, (2) new name insertion
           and (3) maybe "save" link insertion
           stat data updates: (1) old directory,
-diff -urNp linux-3.1.3/fs/reiserfs/procfs.c linux-3.1.3/fs/reiserfs/procfs.c
---- linux-3.1.3/fs/reiserfs/procfs.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/reiserfs/procfs.c   2011-11-16 18:40:29.000000000 -0500
-@@ -113,7 +113,7 @@ static int show_super(struct seq_file *m
+diff --git a/fs/reiserfs/procfs.c b/fs/reiserfs/procfs.c
+index 7a99811..2c9286f 100644
+--- a/fs/reiserfs/procfs.c
++++ b/fs/reiserfs/procfs.c
+@@ -113,7 +113,7 @@ static int show_super(struct seq_file *m, struct super_block *sb)
                   "SMALL_TAILS " : "NO_TAILS ",
                   replay_only(sb) ? "REPLAY_ONLY " : "",
                   convert_reiserfs(sb) ? "CONV " : "",
@@ -46619,7 +48986,7 @@ diff -urNp linux-3.1.3/fs/reiserfs/procfs.c linux-3.1.3/fs/reiserfs/procfs.c
                   SF(s_disk_reads), SF(s_disk_writes), SF(s_fix_nodes),
                   SF(s_do_balance), SF(s_unneeded_left_neighbor),
                   SF(s_good_search_by_key_reada), SF(s_bmaps),
-@@ -299,6 +299,8 @@ static int show_journal(struct seq_file 
+@@ -299,6 +299,8 @@ static int show_journal(struct seq_file *m, struct super_block *sb)
        struct journal_params *jp = &rs->s_v1.s_journal;
        char b[BDEVNAME_SIZE];
  
@@ -46628,10 +48995,11 @@ diff -urNp linux-3.1.3/fs/reiserfs/procfs.c linux-3.1.3/fs/reiserfs/procfs.c
        seq_printf(m,           /* on-disk fields */
                   "jp_journal_1st_block: \t%i\n"
                   "jp_journal_dev: \t%s[%x]\n"
-diff -urNp linux-3.1.3/fs/reiserfs/stree.c linux-3.1.3/fs/reiserfs/stree.c
---- linux-3.1.3/fs/reiserfs/stree.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/reiserfs/stree.c    2011-11-16 18:40:29.000000000 -0500
-@@ -1196,6 +1196,8 @@ int reiserfs_delete_item(struct reiserfs
+diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c
+index 313d39d..3a5811b 100644
+--- a/fs/reiserfs/stree.c
++++ b/fs/reiserfs/stree.c
+@@ -1196,6 +1196,8 @@ int reiserfs_delete_item(struct reiserfs_transaction_handle *th,
        int iter = 0;
  #endif
  
@@ -46640,7 +49008,7 @@ diff -urNp linux-3.1.3/fs/reiserfs/stree.c linux-3.1.3/fs/reiserfs/stree.c
        BUG_ON(!th->t_trans_id);
  
        init_tb_struct(th, &s_del_balance, sb, path,
-@@ -1333,6 +1335,8 @@ void reiserfs_delete_solid_item(struct r
+@@ -1333,6 +1335,8 @@ void reiserfs_delete_solid_item(struct reiserfs_transaction_handle *th,
        int retval;
        int quota_cut_bytes = 0;
  
@@ -46649,7 +49017,7 @@ diff -urNp linux-3.1.3/fs/reiserfs/stree.c linux-3.1.3/fs/reiserfs/stree.c
        BUG_ON(!th->t_trans_id);
  
        le_key2cpu_key(&cpu_key, key);
-@@ -1562,6 +1566,8 @@ int reiserfs_cut_from_item(struct reiser
+@@ -1562,6 +1566,8 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th,
        int quota_cut_bytes;
        loff_t tail_pos = 0;
  
@@ -46658,7 +49026,7 @@ diff -urNp linux-3.1.3/fs/reiserfs/stree.c linux-3.1.3/fs/reiserfs/stree.c
        BUG_ON(!th->t_trans_id);
  
        init_tb_struct(th, &s_cut_balance, inode->i_sb, path,
-@@ -1957,6 +1963,8 @@ int reiserfs_paste_into_item(struct reis
+@@ -1957,6 +1963,8 @@ int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, struct tree
        int retval;
        int fs_gen;
  
@@ -46667,7 +49035,7 @@ diff -urNp linux-3.1.3/fs/reiserfs/stree.c linux-3.1.3/fs/reiserfs/stree.c
        BUG_ON(!th->t_trans_id);
  
        fs_gen = get_generation(inode->i_sb);
-@@ -2045,6 +2053,8 @@ int reiserfs_insert_item(struct reiserfs
+@@ -2045,6 +2053,8 @@ int reiserfs_insert_item(struct reiserfs_transaction_handle *th,
        int fs_gen = 0;
        int quota_bytes = 0;
  
@@ -46676,10 +49044,11 @@ diff -urNp linux-3.1.3/fs/reiserfs/stree.c linux-3.1.3/fs/reiserfs/stree.c
        BUG_ON(!th->t_trans_id);
  
        if (inode) {            /* Do we count quotas for item? */
-diff -urNp linux-3.1.3/fs/reiserfs/super.c linux-3.1.3/fs/reiserfs/super.c
---- linux-3.1.3/fs/reiserfs/super.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/reiserfs/super.c    2011-11-16 18:40:29.000000000 -0500
-@@ -927,6 +927,8 @@ static int reiserfs_parse_options(struct
+diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
+index 14363b9..dd95a04 100644
+--- a/fs/reiserfs/super.c
++++ b/fs/reiserfs/super.c
+@@ -927,6 +927,8 @@ static int reiserfs_parse_options(struct super_block *s, char *options,    /* strin
                {.option_name = NULL}
        };
  
@@ -46688,9 +49057,10 @@ diff -urNp linux-3.1.3/fs/reiserfs/super.c linux-3.1.3/fs/reiserfs/super.c
        *blocks = 0;
        if (!options || !*options)
                /* use default configuration: create tails, journaling on, no
-diff -urNp linux-3.1.3/fs/select.c linux-3.1.3/fs/select.c
---- linux-3.1.3/fs/select.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/select.c    2011-11-16 18:40:29.000000000 -0500
+diff --git a/fs/select.c b/fs/select.c
+index d33418f..f8e06bc 100644
+--- a/fs/select.c
++++ b/fs/select.c
 @@ -20,6 +20,7 @@
  #include <linux/module.h>
  #include <linux/slab.h>
@@ -46699,7 +49069,7 @@ diff -urNp linux-3.1.3/fs/select.c linux-3.1.3/fs/select.c
  #include <linux/personality.h> /* for STICKY_TIMEOUTS */
  #include <linux/file.h>
  #include <linux/fdtable.h>
-@@ -403,6 +404,8 @@ int do_select(int n, fd_set_bits *fds, s
+@@ -403,6 +404,8 @@ int do_select(int n, fd_set_bits *fds, struct timespec *end_time)
        int retval, i, timed_out = 0;
        unsigned long slack = 0;
  
@@ -46708,7 +49078,7 @@ diff -urNp linux-3.1.3/fs/select.c linux-3.1.3/fs/select.c
        rcu_read_lock();
        retval = max_select_fd(n, fds);
        rcu_read_unlock();
-@@ -528,6 +531,8 @@ int core_sys_select(int n, fd_set __user
+@@ -528,6 +531,8 @@ int core_sys_select(int n, fd_set __user *inp, fd_set __user *outp,
        /* Allocate small arguments on the stack to save memory and be faster */
        long stack_fds[SELECT_STACK_ALLOC/sizeof(long)];
  
@@ -46717,7 +49087,7 @@ diff -urNp linux-3.1.3/fs/select.c linux-3.1.3/fs/select.c
        ret = -EINVAL;
        if (n < 0)
                goto out_nofds;
-@@ -837,6 +842,9 @@ int do_sys_poll(struct pollfd __user *uf
+@@ -837,6 +842,9 @@ int do_sys_poll(struct pollfd __user *ufds, unsigned int nfds,
        struct poll_list *walk = head;
        unsigned long todo = nfds;
  
@@ -46727,10 +49097,11 @@ diff -urNp linux-3.1.3/fs/select.c linux-3.1.3/fs/select.c
        if (nfds > rlimit(RLIMIT_NOFILE))
                return -EINVAL;
  
-diff -urNp linux-3.1.3/fs/seq_file.c linux-3.1.3/fs/seq_file.c
---- linux-3.1.3/fs/seq_file.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/seq_file.c  2011-11-16 18:39:08.000000000 -0500
-@@ -76,7 +76,8 @@ static int traverse(struct seq_file *m, 
+diff --git a/fs/seq_file.c b/fs/seq_file.c
+index 05d6b0e..ee96362 100644
+--- a/fs/seq_file.c
++++ b/fs/seq_file.c
+@@ -76,7 +76,8 @@ static int traverse(struct seq_file *m, loff_t offset)
                return 0;
        }
        if (!m->buf) {
@@ -46740,7 +49111,7 @@ diff -urNp linux-3.1.3/fs/seq_file.c linux-3.1.3/fs/seq_file.c
                if (!m->buf)
                        return -ENOMEM;
        }
-@@ -116,7 +117,8 @@ static int traverse(struct seq_file *m, 
+@@ -116,7 +117,8 @@ static int traverse(struct seq_file *m, loff_t offset)
  Eoverflow:
        m->op->stop(m, p);
        kfree(m->buf);
@@ -46750,7 +49121,7 @@ diff -urNp linux-3.1.3/fs/seq_file.c linux-3.1.3/fs/seq_file.c
        return !m->buf ? -ENOMEM : -EAGAIN;
  }
  
-@@ -169,7 +171,8 @@ ssize_t seq_read(struct file *file, char
+@@ -169,7 +171,8 @@ ssize_t seq_read(struct file *file, char __user *buf, size_t size, loff_t *ppos)
        m->version = file->f_version;
        /* grab buffer if we didn't have one */
        if (!m->buf) {
@@ -46760,7 +49131,7 @@ diff -urNp linux-3.1.3/fs/seq_file.c linux-3.1.3/fs/seq_file.c
                if (!m->buf)
                        goto Enomem;
        }
-@@ -210,7 +213,8 @@ ssize_t seq_read(struct file *file, char
+@@ -210,7 +213,8 @@ ssize_t seq_read(struct file *file, char __user *buf, size_t size, loff_t *ppos)
                        goto Fill;
                m->op->stop(m, p);
                kfree(m->buf);
@@ -46770,7 +49141,7 @@ diff -urNp linux-3.1.3/fs/seq_file.c linux-3.1.3/fs/seq_file.c
                if (!m->buf)
                        goto Enomem;
                m->count = 0;
-@@ -549,7 +553,7 @@ static void single_stop(struct seq_file 
+@@ -549,7 +553,7 @@ static void single_stop(struct seq_file *p, void *v)
  int single_open(struct file *file, int (*show)(struct seq_file *, void *),
                void *data)
  {
@@ -46779,10 +49150,11 @@ diff -urNp linux-3.1.3/fs/seq_file.c linux-3.1.3/fs/seq_file.c
        int res = -ENOMEM;
  
        if (op) {
-diff -urNp linux-3.1.3/fs/splice.c linux-3.1.3/fs/splice.c
---- linux-3.1.3/fs/splice.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/splice.c    2011-11-16 18:40:29.000000000 -0500
-@@ -194,7 +194,7 @@ ssize_t splice_to_pipe(struct pipe_inode
+diff --git a/fs/splice.c b/fs/splice.c
+index fa2defa..9a697a5 100644
+--- a/fs/splice.c
++++ b/fs/splice.c
+@@ -194,7 +194,7 @@ ssize_t splice_to_pipe(struct pipe_inode_info *pipe,
        pipe_lock(pipe);
  
        for (;;) {
@@ -46791,7 +49163,7 @@ diff -urNp linux-3.1.3/fs/splice.c linux-3.1.3/fs/splice.c
                        send_sig(SIGPIPE, current, 0);
                        if (!ret)
                                ret = -EPIPE;
-@@ -248,9 +248,9 @@ ssize_t splice_to_pipe(struct pipe_inode
+@@ -248,9 +248,9 @@ ssize_t splice_to_pipe(struct pipe_inode_info *pipe,
                        do_wakeup = 0;
                }
  
@@ -46803,7 +49175,7 @@ diff -urNp linux-3.1.3/fs/splice.c linux-3.1.3/fs/splice.c
        }
  
        pipe_unlock(pipe);
-@@ -320,6 +320,8 @@ __generic_file_splice_read(struct file *
+@@ -320,6 +320,8 @@ __generic_file_splice_read(struct file *in, loff_t *ppos,
                .spd_release = spd_release_page,
        };
  
@@ -46812,7 +49184,7 @@ diff -urNp linux-3.1.3/fs/splice.c linux-3.1.3/fs/splice.c
        if (splice_grow_spd(pipe, &spd))
                return -ENOMEM;
  
-@@ -560,7 +562,7 @@ static ssize_t kernel_readv(struct file 
+@@ -560,7 +562,7 @@ static ssize_t kernel_readv(struct file *file, const struct iovec *vec,
        old_fs = get_fs();
        set_fs(get_ds());
        /* The cast to a user pointer is valid due to the set_fs() */
@@ -46821,7 +49193,7 @@ diff -urNp linux-3.1.3/fs/splice.c linux-3.1.3/fs/splice.c
        set_fs(old_fs);
  
        return res;
-@@ -575,7 +577,7 @@ static ssize_t kernel_write(struct file 
+@@ -575,7 +577,7 @@ static ssize_t kernel_write(struct file *file, const char *buf, size_t count,
        old_fs = get_fs();
        set_fs(get_ds());
        /* The cast to a user pointer is valid due to the set_fs() */
@@ -46830,7 +49202,7 @@ diff -urNp linux-3.1.3/fs/splice.c linux-3.1.3/fs/splice.c
        set_fs(old_fs);
  
        return res;
-@@ -603,6 +605,8 @@ ssize_t default_file_splice_read(struct 
+@@ -603,6 +605,8 @@ ssize_t default_file_splice_read(struct file *in, loff_t *ppos,
                .spd_release = spd_release_page,
        };
  
@@ -46839,7 +49211,7 @@ diff -urNp linux-3.1.3/fs/splice.c linux-3.1.3/fs/splice.c
        if (splice_grow_spd(pipe, &spd))
                return -ENOMEM;
  
-@@ -626,7 +630,7 @@ ssize_t default_file_splice_read(struct 
+@@ -626,7 +630,7 @@ ssize_t default_file_splice_read(struct file *in, loff_t *ppos,
                        goto err;
  
                this_len = min_t(size_t, len, PAGE_CACHE_SIZE - offset);
@@ -46861,7 +49233,7 @@ diff -urNp linux-3.1.3/fs/splice.c linux-3.1.3/fs/splice.c
                        return 0;
  
                if (sd->flags & SPLICE_F_NONBLOCK)
-@@ -1182,7 +1186,7 @@ ssize_t splice_direct_to_actor(struct fi
+@@ -1182,7 +1186,7 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd,
                 * out of the pipe right after the splice_to_pipe(). So set
                 * PIPE_READERS appropriately.
                 */
@@ -46870,7 +49242,7 @@ diff -urNp linux-3.1.3/fs/splice.c linux-3.1.3/fs/splice.c
  
                current->splice_pipe = pipe;
        }
-@@ -1619,6 +1623,8 @@ static long vmsplice_to_pipe(struct file
+@@ -1619,6 +1623,8 @@ static long vmsplice_to_pipe(struct file *file, const struct iovec __user *iov,
        };
        long ret;
  
@@ -46879,7 +49251,7 @@ diff -urNp linux-3.1.3/fs/splice.c linux-3.1.3/fs/splice.c
        pipe = get_pipe_info(file);
        if (!pipe)
                return -EBADF;
-@@ -1734,9 +1740,9 @@ static int ipipe_prep(struct pipe_inode_
+@@ -1734,9 +1740,9 @@ static int ipipe_prep(struct pipe_inode_info *pipe, unsigned int flags)
                        ret = -ERESTARTSYS;
                        break;
                }
@@ -46891,7 +49263,7 @@ diff -urNp linux-3.1.3/fs/splice.c linux-3.1.3/fs/splice.c
                        if (flags & SPLICE_F_NONBLOCK) {
                                ret = -EAGAIN;
                                break;
-@@ -1768,7 +1774,7 @@ static int opipe_prep(struct pipe_inode_
+@@ -1768,7 +1774,7 @@ static int opipe_prep(struct pipe_inode_info *pipe, unsigned int flags)
        pipe_lock(pipe);
  
        while (pipe->nrbufs >= pipe->buffers) {
@@ -46900,7 +49272,7 @@ diff -urNp linux-3.1.3/fs/splice.c linux-3.1.3/fs/splice.c
                        send_sig(SIGPIPE, current, 0);
                        ret = -EPIPE;
                        break;
-@@ -1781,9 +1787,9 @@ static int opipe_prep(struct pipe_inode_
+@@ -1781,9 +1787,9 @@ static int opipe_prep(struct pipe_inode_info *pipe, unsigned int flags)
                        ret = -ERESTARTSYS;
                        break;
                }
@@ -46929,7 +49301,7 @@ diff -urNp linux-3.1.3/fs/splice.c linux-3.1.3/fs/splice.c
                        break;
  
                /*
-@@ -1923,7 +1929,7 @@ static int link_pipe(struct pipe_inode_i
+@@ -1923,7 +1929,7 @@ static int link_pipe(struct pipe_inode_info *ipipe,
        pipe_double_lock(ipipe, opipe);
  
        do {
@@ -46938,7 +49310,7 @@ diff -urNp linux-3.1.3/fs/splice.c linux-3.1.3/fs/splice.c
                        send_sig(SIGPIPE, current, 0);
                        if (!ret)
                                ret = -EPIPE;
-@@ -1968,7 +1974,7 @@ static int link_pipe(struct pipe_inode_i
+@@ -1968,7 +1974,7 @@ static int link_pipe(struct pipe_inode_info *ipipe,
         * return EAGAIN if we have the potential of some data in the
         * future, otherwise just return 0
         */
@@ -46947,10 +49319,11 @@ diff -urNp linux-3.1.3/fs/splice.c linux-3.1.3/fs/splice.c
                ret = -EAGAIN;
  
        pipe_unlock(ipipe);
-diff -urNp linux-3.1.3/fs/sysfs/file.c linux-3.1.3/fs/sysfs/file.c
---- linux-3.1.3/fs/sysfs/file.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/sysfs/file.c        2011-11-16 18:39:08.000000000 -0500
-@@ -37,7 +37,7 @@ static DEFINE_SPINLOCK(sysfs_open_dirent
+diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
+index 1ad8c93..6633545 100644
+--- a/fs/sysfs/file.c
++++ b/fs/sysfs/file.c
+@@ -37,7 +37,7 @@ static DEFINE_SPINLOCK(sysfs_open_dirent_lock);
  
  struct sysfs_open_dirent {
        atomic_t                refcnt;
@@ -46959,7 +49332,7 @@ diff -urNp linux-3.1.3/fs/sysfs/file.c linux-3.1.3/fs/sysfs/file.c
        wait_queue_head_t       poll;
        struct list_head        buffers; /* goes through sysfs_buffer.list */
  };
-@@ -81,7 +81,7 @@ static int fill_read_buffer(struct dentr
+@@ -81,7 +81,7 @@ static int fill_read_buffer(struct dentry * dentry, struct sysfs_buffer * buffer
        if (!sysfs_get_active(attr_sd))
                return -ENODEV;
  
@@ -46968,7 +49341,7 @@ diff -urNp linux-3.1.3/fs/sysfs/file.c linux-3.1.3/fs/sysfs/file.c
        count = ops->show(kobj, attr_sd->s_attr.attr, buffer->page);
  
        sysfs_put_active(attr_sd);
-@@ -287,7 +287,7 @@ static int sysfs_get_open_dirent(struct 
+@@ -287,7 +287,7 @@ static int sysfs_get_open_dirent(struct sysfs_dirent *sd,
                return -ENOMEM;
  
        atomic_set(&new_od->refcnt, 0);
@@ -46977,7 +49350,7 @@ diff -urNp linux-3.1.3/fs/sysfs/file.c linux-3.1.3/fs/sysfs/file.c
        init_waitqueue_head(&new_od->poll);
        INIT_LIST_HEAD(&new_od->buffers);
        goto retry;
-@@ -432,7 +432,7 @@ static unsigned int sysfs_poll(struct fi
+@@ -432,7 +432,7 @@ static unsigned int sysfs_poll(struct file *filp, poll_table *wait)
  
        sysfs_put_active(attr_sd);
  
@@ -46986,7 +49359,7 @@ diff -urNp linux-3.1.3/fs/sysfs/file.c linux-3.1.3/fs/sysfs/file.c
                goto trigger;
  
        return DEFAULT_POLLMASK;
-@@ -451,7 +451,7 @@ void sysfs_notify_dirent(struct sysfs_di
+@@ -451,7 +451,7 @@ void sysfs_notify_dirent(struct sysfs_dirent *sd)
  
        od = sd->s_attr.open;
        if (od) {
@@ -46995,9 +49368,10 @@ diff -urNp linux-3.1.3/fs/sysfs/file.c linux-3.1.3/fs/sysfs/file.c
                wake_up_interruptible(&od->poll);
        }
  
-diff -urNp linux-3.1.3/fs/sysfs/mount.c linux-3.1.3/fs/sysfs/mount.c
---- linux-3.1.3/fs/sysfs/mount.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/sysfs/mount.c       2011-11-16 18:40:29.000000000 -0500
+diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c
+index e34f0d9..740ea7b 100644
+--- a/fs/sysfs/mount.c
++++ b/fs/sysfs/mount.c
 @@ -36,7 +36,11 @@ struct sysfs_dirent sysfs_root = {
        .s_name         = "",
        .s_count        = ATOMIC_INIT(1),
@@ -47010,10 +49384,11 @@ diff -urNp linux-3.1.3/fs/sysfs/mount.c linux-3.1.3/fs/sysfs/mount.c
        .s_ino          = 1,
  };
  
-diff -urNp linux-3.1.3/fs/sysfs/symlink.c linux-3.1.3/fs/sysfs/symlink.c
---- linux-3.1.3/fs/sysfs/symlink.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/sysfs/symlink.c     2011-11-16 18:39:08.000000000 -0500
-@@ -286,7 +286,7 @@ static void *sysfs_follow_link(struct de
+diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c
+index a7ac78f..02158e1 100644
+--- a/fs/sysfs/symlink.c
++++ b/fs/sysfs/symlink.c
+@@ -286,7 +286,7 @@ static void *sysfs_follow_link(struct dentry *dentry, struct nameidata *nd)
  
  static void sysfs_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie)
  {
@@ -47022,10 +49397,11 @@ diff -urNp linux-3.1.3/fs/sysfs/symlink.c linux-3.1.3/fs/sysfs/symlink.c
        if (!IS_ERR(page))
                free_page((unsigned long)page);
  }
-diff -urNp linux-3.1.3/fs/udf/inode.c linux-3.1.3/fs/udf/inode.c
---- linux-3.1.3/fs/udf/inode.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/udf/inode.c 2011-11-16 18:40:29.000000000 -0500
-@@ -560,6 +560,8 @@ static struct buffer_head *inode_getblk(
+diff --git a/fs/udf/inode.c b/fs/udf/inode.c
+index 1d1358e..408bedb 100644
+--- a/fs/udf/inode.c
++++ b/fs/udf/inode.c
+@@ -560,6 +560,8 @@ static struct buffer_head *inode_getblk(struct inode *inode, sector_t block,
        int goal = 0, pgoal = iinfo->i_location.logicalBlockNum;
        int lastblock = 0;
  
@@ -47034,10 +49410,11 @@ diff -urNp linux-3.1.3/fs/udf/inode.c linux-3.1.3/fs/udf/inode.c
        prev_epos.offset = udf_file_entry_alloc_offset(inode);
        prev_epos.block = iinfo->i_location;
        prev_epos.bh = NULL;
-diff -urNp linux-3.1.3/fs/udf/misc.c linux-3.1.3/fs/udf/misc.c
---- linux-3.1.3/fs/udf/misc.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/udf/misc.c  2011-11-16 18:39:08.000000000 -0500
-@@ -286,7 +286,7 @@ void udf_new_tag(char *data, uint16_t id
+diff --git a/fs/udf/misc.c b/fs/udf/misc.c
+index 9215700..bf1f68e 100644
+--- a/fs/udf/misc.c
++++ b/fs/udf/misc.c
+@@ -286,7 +286,7 @@ void udf_new_tag(char *data, uint16_t ident, uint16_t version, uint16_t snum,
  
  u8 udf_tag_checksum(const struct tag *t)
  {
@@ -47046,9 +49423,10 @@ diff -urNp linux-3.1.3/fs/udf/misc.c linux-3.1.3/fs/udf/misc.c
        u8 checksum = 0;
        int i;
        for (i = 0; i < sizeof(struct tag); ++i)
-diff -urNp linux-3.1.3/fs/utimes.c linux-3.1.3/fs/utimes.c
---- linux-3.1.3/fs/utimes.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/utimes.c    2011-11-16 18:40:29.000000000 -0500
+diff --git a/fs/utimes.c b/fs/utimes.c
+index ba653f3..06ea4b1 100644
+--- a/fs/utimes.c
++++ b/fs/utimes.c
 @@ -1,6 +1,7 @@
  #include <linux/compiler.h>
  #include <linux/file.h>
@@ -47057,7 +49435,7 @@ diff -urNp linux-3.1.3/fs/utimes.c linux-3.1.3/fs/utimes.c
  #include <linux/linkage.h>
  #include <linux/mount.h>
  #include <linux/namei.h>
-@@ -101,6 +102,12 @@ static int utimes_common(struct path *pa
+@@ -101,6 +102,12 @@ static int utimes_common(struct path *path, struct timespec *times)
                                goto mnt_drop_write_and_out;
                }
        }
@@ -47070,23 +49448,10 @@ diff -urNp linux-3.1.3/fs/utimes.c linux-3.1.3/fs/utimes.c
        mutex_lock(&inode->i_mutex);
        error = notify_change(path->dentry, &newattrs);
        mutex_unlock(&inode->i_mutex);
-diff -urNp linux-3.1.3/fs/xattr_acl.c linux-3.1.3/fs/xattr_acl.c
---- linux-3.1.3/fs/xattr_acl.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/xattr_acl.c 2011-11-16 18:39:08.000000000 -0500
-@@ -17,8 +17,8 @@
- struct posix_acl *
- posix_acl_from_xattr(const void *value, size_t size)
- {
--      posix_acl_xattr_header *header = (posix_acl_xattr_header *)value;
--      posix_acl_xattr_entry *entry = (posix_acl_xattr_entry *)(header+1), *end;
-+      const posix_acl_xattr_header *header = (const posix_acl_xattr_header *)value;
-+      const posix_acl_xattr_entry *entry = (const posix_acl_xattr_entry *)(header+1), *end;
-       int count;
-       struct posix_acl *acl;
-       struct posix_acl_entry *acl_e;
-diff -urNp linux-3.1.3/fs/xattr.c linux-3.1.3/fs/xattr.c
---- linux-3.1.3/fs/xattr.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/xattr.c     2011-11-16 18:40:29.000000000 -0500
+diff --git a/fs/xattr.c b/fs/xattr.c
+index f060663..def7007 100644
+--- a/fs/xattr.c
++++ b/fs/xattr.c
 @@ -254,7 +254,7 @@ EXPORT_SYMBOL_GPL(vfs_removexattr);
   * Extended attribute SET operations
   */
@@ -47096,7 +49461,7 @@ diff -urNp linux-3.1.3/fs/xattr.c linux-3.1.3/fs/xattr.c
         size_t size, int flags)
  {
        int error;
-@@ -278,7 +278,13 @@ setxattr(struct dentry *d, const char __
+@@ -278,7 +278,13 @@ setxattr(struct dentry *d, const char __user *name, const void __user *value,
                        return PTR_ERR(kvalue);
        }
  
@@ -47111,7 +49476,7 @@ diff -urNp linux-3.1.3/fs/xattr.c linux-3.1.3/fs/xattr.c
        kfree(kvalue);
        return error;
  }
-@@ -295,7 +301,7 @@ SYSCALL_DEFINE5(setxattr, const char __u
+@@ -295,7 +301,7 @@ SYSCALL_DEFINE5(setxattr, const char __user *, pathname,
                return error;
        error = mnt_want_write(path.mnt);
        if (!error) {
@@ -47120,7 +49485,7 @@ diff -urNp linux-3.1.3/fs/xattr.c linux-3.1.3/fs/xattr.c
                mnt_drop_write(path.mnt);
        }
        path_put(&path);
-@@ -314,7 +320,7 @@ SYSCALL_DEFINE5(lsetxattr, const char __
+@@ -314,7 +320,7 @@ SYSCALL_DEFINE5(lsetxattr, const char __user *, pathname,
                return error;
        error = mnt_want_write(path.mnt);
        if (!error) {
@@ -47129,7 +49494,7 @@ diff -urNp linux-3.1.3/fs/xattr.c linux-3.1.3/fs/xattr.c
                mnt_drop_write(path.mnt);
        }
        path_put(&path);
-@@ -325,17 +331,15 @@ SYSCALL_DEFINE5(fsetxattr, int, fd, cons
+@@ -325,17 +331,15 @@ SYSCALL_DEFINE5(fsetxattr, int, fd, const char __user *, name,
                const void __user *,value, size_t, size, int, flags)
  {
        struct file *f;
@@ -47149,9 +49514,25 @@ diff -urNp linux-3.1.3/fs/xattr.c linux-3.1.3/fs/xattr.c
                mnt_drop_write(f->f_path.mnt);
        }
        fput(f);
-diff -urNp linux-3.1.3/fs/xfs/xfs_bmap.c linux-3.1.3/fs/xfs/xfs_bmap.c
---- linux-3.1.3/fs/xfs/xfs_bmap.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/xfs/xfs_bmap.c      2011-11-16 18:39:08.000000000 -0500
+diff --git a/fs/xattr_acl.c b/fs/xattr_acl.c
+index 8d5a506..7f62712 100644
+--- a/fs/xattr_acl.c
++++ b/fs/xattr_acl.c
+@@ -17,8 +17,8 @@
+ struct posix_acl *
+ posix_acl_from_xattr(const void *value, size_t size)
+ {
+-      posix_acl_xattr_header *header = (posix_acl_xattr_header *)value;
+-      posix_acl_xattr_entry *entry = (posix_acl_xattr_entry *)(header+1), *end;
++      const posix_acl_xattr_header *header = (const posix_acl_xattr_header *)value;
++      const posix_acl_xattr_entry *entry = (const posix_acl_xattr_entry *)(header+1), *end;
+       int count;
+       struct posix_acl *acl;
+       struct posix_acl_entry *acl_e;
+diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
+index 452a291..91a95f3b 100644
+--- a/fs/xfs/xfs_bmap.c
++++ b/fs/xfs/xfs_bmap.c
 @@ -250,7 +250,7 @@ xfs_bmap_validate_ret(
        int                     nmap,
        int                     ret_nmap);
@@ -47161,9 +49542,10 @@ diff -urNp linux-3.1.3/fs/xfs/xfs_bmap.c linux-3.1.3/fs/xfs/xfs_bmap.c
  #endif /* DEBUG */
  
  STATIC int
-diff -urNp linux-3.1.3/fs/xfs/xfs_dir2_sf.c linux-3.1.3/fs/xfs/xfs_dir2_sf.c
---- linux-3.1.3/fs/xfs/xfs_dir2_sf.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/xfs/xfs_dir2_sf.c   2011-11-16 18:39:08.000000000 -0500
+diff --git a/fs/xfs/xfs_dir2_sf.c b/fs/xfs/xfs_dir2_sf.c
+index 79d05e8..e3e5861 100644
+--- a/fs/xfs/xfs_dir2_sf.c
++++ b/fs/xfs/xfs_dir2_sf.c
 @@ -852,7 +852,15 @@ xfs_dir2_sf_getdents(
                }
  
@@ -47181,9 +49563,10 @@ diff -urNp linux-3.1.3/fs/xfs/xfs_dir2_sf.c linux-3.1.3/fs/xfs/xfs_dir2_sf.c
                            off & 0x7fffffff, ino, DT_UNKNOWN)) {
                        *offset = off & 0x7fffffff;
                        return 0;
-diff -urNp linux-3.1.3/fs/xfs/xfs_ioctl.c linux-3.1.3/fs/xfs/xfs_ioctl.c
---- linux-3.1.3/fs/xfs/xfs_ioctl.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/xfs/xfs_ioctl.c     2011-11-16 18:39:08.000000000 -0500
+diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
+index f7ce7de..e1a5db0 100644
+--- a/fs/xfs/xfs_ioctl.c
++++ b/fs/xfs/xfs_ioctl.c
 @@ -128,7 +128,7 @@ xfs_find_handle(
        }
  
@@ -47193,9 +49576,10 @@ diff -urNp linux-3.1.3/fs/xfs/xfs_ioctl.c linux-3.1.3/fs/xfs/xfs_ioctl.c
            copy_to_user(hreq->ohandlen, &hsize, sizeof(__s32)))
                goto out_put;
  
-diff -urNp linux-3.1.3/fs/xfs/xfs_iops.c linux-3.1.3/fs/xfs/xfs_iops.c
---- linux-3.1.3/fs/xfs/xfs_iops.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/xfs/xfs_iops.c      2011-11-16 18:39:08.000000000 -0500
+diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
+index 474920b..97169a9 100644
+--- a/fs/xfs/xfs_iops.c
++++ b/fs/xfs/xfs_iops.c
 @@ -446,7 +446,7 @@ xfs_vn_put_link(
        struct nameidata *nd,
        void            *p)
@@ -47205,936 +49589,1890 @@ diff -urNp linux-3.1.3/fs/xfs/xfs_iops.c linux-3.1.3/fs/xfs/xfs_iops.c
  
        if (!IS_ERR(s))
                kfree(s);
-diff -urNp linux-3.1.3/fs/xfs/xfs_vnodeops.c linux-3.1.3/fs/xfs/xfs_vnodeops.c
---- linux-3.1.3/fs/xfs/xfs_vnodeops.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/fs/xfs/xfs_vnodeops.c  2011-11-18 18:54:56.000000000 -0500
-@@ -123,13 +123,17 @@ xfs_readlink(
-       xfs_ilock(ip, XFS_ILOCK_SHARED);
--      ASSERT(S_ISLNK(ip->i_d.di_mode));
--      ASSERT(ip->i_d.di_size <= MAXPATHLEN);
--
-       pathlen = ip->i_d.di_size;
-       if (!pathlen)
-               goto out;
-+      if (pathlen > MAXPATHLEN) {
-+              xfs_alert(mp, "%s: inode (%llu) symlink length (%d) too long",
-+                       __func__, (unsigned long long)ip->i_ino, pathlen);
-+              ASSERT(0);
-+              return XFS_ERROR(EFSCORRUPTED);
-+      }
+diff --git a/grsecurity/Kconfig b/grsecurity/Kconfig
+new file mode 100644
+index 0000000..9629731
+--- /dev/null
++++ b/grsecurity/Kconfig
+@@ -0,0 +1,1037 @@
++#
++# grecurity configuration
++#
 +
-       if (ip->i_df.if_flags & XFS_IFINLINE) {
-               memcpy(link, ip->i_df.if_u1.if_data, pathlen);
-               link[pathlen] = '\0';
-diff -urNp linux-3.1.3/grsecurity/gracl_alloc.c linux-3.1.3/grsecurity/gracl_alloc.c
---- linux-3.1.3/grsecurity/gracl_alloc.c       1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/grsecurity/gracl_alloc.c       2011-11-16 18:40:31.000000000 -0500
-@@ -0,0 +1,105 @@
-+#include <linux/kernel.h>
-+#include <linux/mm.h>
-+#include <linux/slab.h>
-+#include <linux/vmalloc.h>
-+#include <linux/gracl.h>
-+#include <linux/grsecurity.h>
++menu "Grsecurity"
 +
-+static unsigned long alloc_stack_next = 1;
-+static unsigned long alloc_stack_size = 1;
-+static void **alloc_stack;
++config GRKERNSEC
++      bool "Grsecurity"
++      select CRYPTO
++      select CRYPTO_SHA256
++      help
++        If you say Y here, you will be able to configure many features
++        that will enhance the security of your system.  It is highly
++        recommended that you say Y here and read through the help
++        for each option so that you fully understand the features and
++        can evaluate their usefulness for your machine.
 +
-+static __inline__ int
-+alloc_pop(void)
-+{
-+      if (alloc_stack_next == 1)
-+              return 0;
++choice
++      prompt "Security Level"
++      depends on GRKERNSEC
++      default GRKERNSEC_CUSTOM
 +
-+      kfree(alloc_stack[alloc_stack_next - 2]);
++config GRKERNSEC_LOW
++      bool "Low"
++      select GRKERNSEC_LINK
++      select GRKERNSEC_FIFO
++      select GRKERNSEC_RANDNET
++      select GRKERNSEC_DMESG
++      select GRKERNSEC_CHROOT
++      select GRKERNSEC_CHROOT_CHDIR
 +
-+      alloc_stack_next--;
++      help
++        If you choose this option, several of the grsecurity options will
++        be enabled that will give you greater protection against a number
++        of attacks, while assuring that none of your software will have any
++        conflicts with the additional security measures.  If you run a lot
++        of unusual software, or you are having problems with the higher
++        security levels, you should say Y here.  With this option, the
++        following features are enabled:
 +
-+      return 1;
-+}
++        - Linking restrictions
++        - FIFO restrictions
++        - Restricted dmesg
++        - Enforced chdir("/") on chroot
++        - Runtime module disabling
 +
-+static __inline__ int
-+alloc_push(void *buf)
-+{
-+      if (alloc_stack_next >= alloc_stack_size)
-+              return 1;
++config GRKERNSEC_MEDIUM
++      bool "Medium"
++      select PAX
++      select PAX_EI_PAX
++      select PAX_PT_PAX_FLAGS
++      select PAX_HAVE_ACL_FLAGS
++      select GRKERNSEC_PROC_MEMMAP if (PAX_NOEXEC || PAX_ASLR)
++      select GRKERNSEC_CHROOT
++      select GRKERNSEC_CHROOT_SYSCTL
++      select GRKERNSEC_LINK
++      select GRKERNSEC_FIFO
++      select GRKERNSEC_DMESG
++      select GRKERNSEC_RANDNET
++      select GRKERNSEC_FORKFAIL
++      select GRKERNSEC_TIME
++      select GRKERNSEC_SIGNAL
++      select GRKERNSEC_CHROOT
++      select GRKERNSEC_CHROOT_UNIX
++      select GRKERNSEC_CHROOT_MOUNT
++      select GRKERNSEC_CHROOT_PIVOT
++      select GRKERNSEC_CHROOT_DOUBLE
++      select GRKERNSEC_CHROOT_CHDIR
++      select GRKERNSEC_CHROOT_MKNOD
++      select GRKERNSEC_PROC
++      select GRKERNSEC_PROC_USERGROUP
++      select PAX_RANDUSTACK
++      select PAX_ASLR
++      select PAX_RANDMMAP
++      select PAX_REFCOUNT if (X86 || SPARC64)
++      select PAX_USERCOPY if ((X86 || SPARC || PPC || ARM) && (SLAB || SLUB || SLOB))
 +
-+      alloc_stack[alloc_stack_next - 1] = buf;
++      help
++        If you say Y here, several features in addition to those included
++        in the low additional security level will be enabled.  These
++        features provide even more security to your system, though in rare
++        cases they may be incompatible with very old or poorly written
++        software.  If you enable this option, make sure that your auth
++        service (identd) is running as gid 1001.  With this option, 
++        the following features (in addition to those provided in the 
++        low additional security level) will be enabled:
 +
-+      alloc_stack_next++;
++        - Failed fork logging
++        - Time change logging
++        - Signal logging
++        - Deny mounts in chroot
++        - Deny double chrooting
++        - Deny sysctl writes in chroot
++        - Deny mknod in chroot
++        - Deny access to abstract AF_UNIX sockets out of chroot
++        - Deny pivot_root in chroot
++        - Denied reads/writes of /dev/kmem, /dev/mem, and /dev/port
++        - /proc restrictions with special GID set to 10 (usually wheel)
++        - Address Space Layout Randomization (ASLR)
++        - Prevent exploitation of most refcount overflows
++        - Bounds checking of copying between the kernel and userland
 +
-+      return 0;
-+}
++config GRKERNSEC_HIGH
++      bool "High"
++      select GRKERNSEC_LINK
++      select GRKERNSEC_FIFO
++      select GRKERNSEC_DMESG
++      select GRKERNSEC_FORKFAIL
++      select GRKERNSEC_TIME
++      select GRKERNSEC_SIGNAL
++      select GRKERNSEC_CHROOT
++      select GRKERNSEC_CHROOT_SHMAT
++      select GRKERNSEC_CHROOT_UNIX
++      select GRKERNSEC_CHROOT_MOUNT
++      select GRKERNSEC_CHROOT_FCHDIR
++      select GRKERNSEC_CHROOT_PIVOT
++      select GRKERNSEC_CHROOT_DOUBLE
++      select GRKERNSEC_CHROOT_CHDIR
++      select GRKERNSEC_CHROOT_MKNOD
++      select GRKERNSEC_CHROOT_CAPS
++      select GRKERNSEC_CHROOT_SYSCTL
++      select GRKERNSEC_CHROOT_FINDTASK
++      select GRKERNSEC_SYSFS_RESTRICT
++      select GRKERNSEC_PROC
++      select GRKERNSEC_PROC_MEMMAP if (PAX_NOEXEC || PAX_ASLR)
++      select GRKERNSEC_HIDESYM
++      select GRKERNSEC_BRUTE
++      select GRKERNSEC_PROC_USERGROUP
++      select GRKERNSEC_KMEM
++      select GRKERNSEC_RESLOG
++      select GRKERNSEC_RANDNET
++      select GRKERNSEC_PROC_ADD
++      select GRKERNSEC_CHROOT_CHMOD
++      select GRKERNSEC_CHROOT_NICE
++      select GRKERNSEC_AUDIT_MOUNT
++      select GRKERNSEC_MODHARDEN if (MODULES)
++      select GRKERNSEC_HARDEN_PTRACE
++      select GRKERNSEC_VM86 if (X86_32)
++      select GRKERNSEC_KERN_LOCKOUT if (X86 || ARM || PPC || SPARC)
++      select PAX
++      select PAX_RANDUSTACK
++      select PAX_ASLR
++      select PAX_RANDMMAP
++      select PAX_NOEXEC
++      select PAX_MPROTECT
++      select PAX_EI_PAX
++      select PAX_PT_PAX_FLAGS
++      select PAX_HAVE_ACL_FLAGS
++      select PAX_KERNEXEC if ((PPC || X86) && (!X86_32 || X86_WP_WORKS_OK) && !XEN)
++      select PAX_MEMORY_UDEREF if (X86 && !XEN)
++      select PAX_RANDKSTACK if (X86_TSC && X86)
++      select PAX_SEGMEXEC if (X86_32)
++      select PAX_PAGEEXEC
++      select PAX_EMUPLT if (ALPHA || PARISC || SPARC)
++      select PAX_EMUTRAMP if (PARISC)
++      select PAX_EMUSIGRT if (PARISC)
++      select PAX_ETEXECRELOCS if (ALPHA || IA64 || PARISC)
++      select PAX_ELFRELOCS if (PAX_ETEXECRELOCS || (IA64 || PPC || X86))
++      select PAX_REFCOUNT if (X86 || SPARC64)
++      select PAX_USERCOPY if ((X86 || PPC || SPARC || ARM) && (SLAB || SLUB || SLOB))
++      help
++        If you say Y here, many of the features of grsecurity will be
++        enabled, which will protect you against many kinds of attacks
++        against your system.  The heightened security comes at a cost
++        of an increased chance of incompatibilities with rare software
++        on your machine.  Since this security level enables PaX, you should
++        view <http://pax.grsecurity.net> and read about the PaX
++        project.  While you are there, download chpax and run it on
++        binaries that cause problems with PaX.  Also remember that
++        since the /proc restrictions are enabled, you must run your
++        identd as gid 1001.  This security level enables the following 
++        features in addition to those listed in the low and medium 
++        security levels:
 +
-+void *
-+acl_alloc(unsigned long len)
-+{
-+      void *ret = NULL;
++        - Additional /proc restrictions
++        - Chmod restrictions in chroot
++        - No signals, ptrace, or viewing of processes outside of chroot
++        - Capability restrictions in chroot
++        - Deny fchdir out of chroot
++        - Priority restrictions in chroot
++        - Segmentation-based implementation of PaX
++        - Mprotect restrictions
++        - Removal of addresses from /proc/<pid>/[smaps|maps|stat]
++        - Kernel stack randomization
++        - Mount/unmount/remount logging
++        - Kernel symbol hiding
++        - Hardening of module auto-loading
++        - Ptrace restrictions
++        - Restricted vm86 mode
++        - Restricted sysfs/debugfs
++        - Active kernel exploit response
 +
-+      if (!len || len > PAGE_SIZE)
-+              goto out;
++config GRKERNSEC_CUSTOM
++      bool "Custom"
++      help
++        If you say Y here, you will be able to configure every grsecurity
++        option, which allows you to enable many more features that aren't
++        covered in the basic security levels.  These additional features
++        include TPE, socket restrictions, and the sysctl system for
++        grsecurity.  It is advised that you read through the help for
++        each option to determine its usefulness in your situation.
 +
-+      ret = kmalloc(len, GFP_KERNEL);
++endchoice
 +
-+      if (ret) {
-+              if (alloc_push(ret)) {
-+                      kfree(ret);
-+                      ret = NULL;
-+              }
-+      }
++menu "Address Space Protection"
++depends on GRKERNSEC
 +
-+out:
-+      return ret;
-+}
++config GRKERNSEC_KMEM
++      bool "Deny reading/writing to /dev/kmem, /dev/mem, and /dev/port"
++      select STRICT_DEVMEM if (X86 || ARM || TILE || S390)
++      help
++        If you say Y here, /dev/kmem and /dev/mem won't be allowed to
++        be written to or read from to modify or leak the contents of the running
++        kernel.  /dev/port will also not be allowed to be opened. If you have module
++        support disabled, enabling this will close up four ways that are
++        currently used  to insert malicious code into the running kernel.
++        Even with all these features enabled, we still highly recommend that
++        you use the RBAC system, as it is still possible for an attacker to
++        modify the running kernel through privileged I/O granted by ioperm/iopl.
++        If you are not using XFree86, you may be able to stop this additional
++        case by enabling the 'Disable privileged I/O' option. Though nothing
++        legitimately writes to /dev/kmem, XFree86 does need to write to /dev/mem,
++        but only to video memory, which is the only writing we allow in this
++        case.  If /dev/kmem or /dev/mem are mmaped without PROT_WRITE, they will
++        not be allowed to mprotect it with PROT_WRITE later.
++        It is highly recommended that you say Y here if you meet all the
++        conditions above.
 +
-+void *
-+acl_alloc_num(unsigned long num, unsigned long len)
-+{
-+      if (!len || (num > (PAGE_SIZE / len)))
-+              return NULL;
++config GRKERNSEC_VM86
++      bool "Restrict VM86 mode"
++      depends on X86_32
 +
-+      return acl_alloc(num * len);
-+}
++      help
++        If you say Y here, only processes with CAP_SYS_RAWIO will be able to
++        make use of a special execution mode on 32bit x86 processors called
++        Virtual 8086 (VM86) mode.  XFree86 may need vm86 mode for certain
++        video cards and will still work with this option enabled.  The purpose
++        of the option is to prevent exploitation of emulation errors in
++        virtualization of vm86 mode like the one discovered in VMWare in 2009.
++        Nearly all users should be able to enable this option.
 +
-+void
-+acl_free_all(void)
-+{
-+      if (gr_acl_is_enabled() || !alloc_stack)
-+              return;
++config GRKERNSEC_IO
++      bool "Disable privileged I/O"
++      depends on X86
++      select RTC_CLASS
++      select RTC_INTF_DEV
++      select RTC_DRV_CMOS
 +
-+      while (alloc_pop()) ;
++      help
++        If you say Y here, all ioperm and iopl calls will return an error.
++        Ioperm and iopl can be used to modify the running kernel.
++        Unfortunately, some programs need this access to operate properly,
++        the most notable of which are XFree86 and hwclock.  hwclock can be
++        remedied by having RTC support in the kernel, so real-time 
++        clock support is enabled if this option is enabled, to ensure 
++        that hwclock operates correctly.  XFree86 still will not 
++        operate correctly with this option enabled, so DO NOT CHOOSE Y 
++        IF YOU USE XFree86.  If you use XFree86 and you still want to 
++        protect your kernel against modification, use the RBAC system.
 +
-+      if (alloc_stack) {
-+              if ((alloc_stack_size * sizeof (void *)) <= PAGE_SIZE)
-+                      kfree(alloc_stack);
-+              else
-+                      vfree(alloc_stack);
-+      }
++config GRKERNSEC_PROC_MEMMAP
++      bool "Remove addresses from /proc/<pid>/[smaps|maps|stat]"
++      default y if (PAX_NOEXEC || PAX_ASLR)
++      depends on PAX_NOEXEC || PAX_ASLR
++      help
++        If you say Y here, the /proc/<pid>/maps and /proc/<pid>/stat files will
++        give no information about the addresses of its mappings if
++        PaX features that rely on random addresses are enabled on the task.
++        If you use PaX it is greatly recommended that you say Y here as it
++        closes up a hole that makes the full ASLR useless for suid
++        binaries.
 +
-+      alloc_stack = NULL;
-+      alloc_stack_size = 1;
-+      alloc_stack_next = 1;
++config GRKERNSEC_BRUTE
++      bool "Deter exploit bruteforcing"
++      help
++        If you say Y here, attempts to bruteforce exploits against forking
++        daemons such as apache or sshd, as well as against suid/sgid binaries
++        will be deterred.  When a child of a forking daemon is killed by PaX
++        or crashes due to an illegal instruction or other suspicious signal,
++        the parent process will be delayed 30 seconds upon every subsequent
++        fork until the administrator is able to assess the situation and
++        restart the daemon.
++        In the suid/sgid case, the attempt is logged, the user has all their
++        processes terminated, and they are prevented from executing any further
++        processes for 15 minutes.
++        It is recommended that you also enable signal logging in the auditing
++        section so that logs are generated when a process triggers a suspicious
++        signal.
++        If the sysctl option is enabled, a sysctl option with name
++        "deter_bruteforce" is created.
 +
-+      return;
-+}
 +
-+int
-+acl_alloc_stack_init(unsigned long size)
-+{
-+      if ((size * sizeof (void *)) <= PAGE_SIZE)
-+              alloc_stack =
-+                  (void **) kmalloc(size * sizeof (void *), GFP_KERNEL);
-+      else
-+              alloc_stack = (void **) vmalloc(size * sizeof (void *));
++config GRKERNSEC_MODHARDEN
++      bool "Harden module auto-loading"
++      depends on MODULES
++      help
++        If you say Y here, module auto-loading in response to use of some
++        feature implemented by an unloaded module will be restricted to
++        root users.  Enabling this option helps defend against attacks 
++        by unprivileged users who abuse the auto-loading behavior to 
++        cause a vulnerable module to load that is then exploited.
 +
-+      alloc_stack_size = size;
++        If this option prevents a legitimate use of auto-loading for a 
++        non-root user, the administrator can execute modprobe manually 
++        with the exact name of the module mentioned in the alert log.
++        Alternatively, the administrator can add the module to the list
++        of modules loaded at boot by modifying init scripts.
 +
-+      if (!alloc_stack)
-+              return 0;
-+      else
-+              return 1;
-+}
-diff -urNp linux-3.1.3/grsecurity/gracl.c linux-3.1.3/grsecurity/gracl.c
---- linux-3.1.3/grsecurity/gracl.c     1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/grsecurity/gracl.c     2011-11-16 19:31:00.000000000 -0500
-@@ -0,0 +1,4156 @@
-+#include <linux/kernel.h>
-+#include <linux/module.h>
-+#include <linux/sched.h>
-+#include <linux/mm.h>
-+#include <linux/file.h>
-+#include <linux/fs.h>
-+#include <linux/namei.h>
-+#include <linux/mount.h>
-+#include <linux/tty.h>
-+#include <linux/proc_fs.h>
-+#include <linux/lglock.h>
-+#include <linux/slab.h>
-+#include <linux/vmalloc.h>
-+#include <linux/types.h>
-+#include <linux/sysctl.h>
-+#include <linux/netdevice.h>
-+#include <linux/ptrace.h>
-+#include <linux/gracl.h>
-+#include <linux/gralloc.h>
-+#include <linux/grsecurity.h>
-+#include <linux/grinternal.h>
-+#include <linux/pid_namespace.h>
-+#include <linux/fdtable.h>
-+#include <linux/percpu.h>
-+
-+#include <asm/uaccess.h>
-+#include <asm/errno.h>
-+#include <asm/mman.h>
++        Modification of init scripts will most likely be needed on 
++        Ubuntu servers with encrypted home directory support enabled,
++        as the first non-root user logging in will cause the ecb(aes),
++        ecb(aes)-all, cbc(aes), and cbc(aes)-all  modules to be loaded.
 +
-+static struct acl_role_db acl_role_set;
-+static struct name_db name_set;
-+static struct inodev_db inodev_set;
++config GRKERNSEC_HIDESYM
++      bool "Hide kernel symbols"
++      help
++        If you say Y here, getting information on loaded modules, and
++        displaying all kernel symbols through a syscall will be restricted
++        to users with CAP_SYS_MODULE.  For software compatibility reasons,
++        /proc/kallsyms will be restricted to the root user.  The RBAC
++        system can hide that entry even from root.
 +
-+/* for keeping track of userspace pointers used for subjects, so we
-+   can share references in the kernel as well
-+*/
++        This option also prevents leaking of kernel addresses through
++        several /proc entries.
 +
-+static struct path real_root;
++        Note that this option is only effective provided the following
++        conditions are met:
++        1) The kernel using grsecurity is not precompiled by some distribution
++        2) You have also enabled GRKERNSEC_DMESG
++        3) You are using the RBAC system and hiding other files such as your
++           kernel image and System.map.  Alternatively, enabling this option
++           causes the permissions on /boot, /lib/modules, and the kernel
++           source directory to change at compile time to prevent 
++           reading by non-root users.
++        If the above conditions are met, this option will aid in providing a
++        useful protection against local kernel exploitation of overflows
++        and arbitrary read/write vulnerabilities.
 +
-+static struct acl_subj_map_db subj_map_set;
++config GRKERNSEC_KERN_LOCKOUT
++      bool "Active kernel exploit response"
++      depends on X86 || ARM || PPC || SPARC
++      help
++        If you say Y here, when a PaX alert is triggered due to suspicious
++        activity in the kernel (from KERNEXEC/UDEREF/USERCOPY)
++        or an OOPs occurs due to bad memory accesses, instead of just
++        terminating the offending process (and potentially allowing
++        a subsequent exploit from the same user), we will take one of two
++        actions:
++         If the user was root, we will panic the system
++         If the user was non-root, we will log the attempt, terminate
++         all processes owned by the user, then prevent them from creating
++         any new processes until the system is restarted
++        This deters repeated kernel exploitation/bruteforcing attempts
++        and is useful for later forensics.
 +
-+static struct acl_role_label *default_role;
++endmenu
++menu "Role Based Access Control Options"
++depends on GRKERNSEC
 +
-+static struct acl_role_label *role_list;
++config GRKERNSEC_RBAC_DEBUG
++      bool
 +
-+static u16 acl_sp_role_value;
++config GRKERNSEC_NO_RBAC
++      bool "Disable RBAC system"
++      help
++        If you say Y here, the /dev/grsec device will be removed from the kernel,
++        preventing the RBAC system from being enabled.  You should only say Y
++        here if you have no intention of using the RBAC system, so as to prevent
++        an attacker with root access from misusing the RBAC system to hide files
++        and processes when loadable module support and /dev/[k]mem have been
++        locked down.
 +
-+extern char *gr_shared_page[4];
-+static DEFINE_MUTEX(gr_dev_mutex);
-+DEFINE_RWLOCK(gr_inode_lock);
++config GRKERNSEC_ACL_HIDEKERN
++      bool "Hide kernel processes"
++      help
++        If you say Y here, all kernel threads will be hidden to all
++        processes but those whose subject has the "view hidden processes"
++        flag.
 +
-+struct gr_arg *gr_usermode;
++config GRKERNSEC_ACL_MAXTRIES
++      int "Maximum tries before password lockout"
++      default 3
++      help
++        This option enforces the maximum number of times a user can attempt
++        to authorize themselves with the grsecurity RBAC system before being
++        denied the ability to attempt authorization again for a specified time.
++        The lower the number, the harder it will be to brute-force a password.
 +
-+static unsigned int gr_status __read_only = GR_STATUS_INIT;
++config GRKERNSEC_ACL_TIMEOUT
++      int "Time to wait after max password tries, in seconds"
++      default 30
++      help
++        This option specifies the time the user must wait after attempting to
++        authorize to the RBAC system with the maximum number of invalid
++        passwords.  The higher the number, the harder it will be to brute-force
++        a password.
 +
-+extern int chkpw(struct gr_arg *entry, unsigned char *salt, unsigned char *sum);
-+extern void gr_clear_learn_entries(void);
++endmenu
++menu "Filesystem Protections"
++depends on GRKERNSEC
 +
-+#ifdef CONFIG_GRKERNSEC_RESLOG
-+extern void gr_log_resource(const struct task_struct *task,
-+                          const int res, const unsigned long wanted, const int gt);
-+#endif
++config GRKERNSEC_PROC
++      bool "Proc restrictions"
++      help
++        If you say Y here, the permissions of the /proc filesystem
++        will be altered to enhance system security and privacy.  You MUST
++        choose either a user only restriction or a user and group restriction.
++        Depending upon the option you choose, you can either restrict users to
++        see only the processes they themselves run, or choose a group that can
++        view all processes and files normally restricted to root if you choose
++        the "restrict to user only" option.  NOTE: If you're running identd as
++        a non-root user, you will have to run it as the group you specify here.
 +
-+unsigned char *gr_system_salt;
-+unsigned char *gr_system_sum;
++config GRKERNSEC_PROC_USER
++      bool "Restrict /proc to user only"
++      depends on GRKERNSEC_PROC
++      help
++        If you say Y here, non-root users will only be able to view their own
++        processes, and restricts them from viewing network-related information,
++        and viewing kernel symbol and module information.
 +
-+static struct sprole_pw **acl_special_roles = NULL;
-+static __u16 num_sprole_pws = 0;
++config GRKERNSEC_PROC_USERGROUP
++      bool "Allow special group"
++      depends on GRKERNSEC_PROC && !GRKERNSEC_PROC_USER
++      help
++        If you say Y here, you will be able to select a group that will be
++          able to view all processes and network-related information.  If you've
++          enabled GRKERNSEC_HIDESYM, kernel and symbol information may still
++          remain hidden.  This option is useful if you want to run identd as
++          a non-root user.
 +
-+static struct acl_role_label *kernel_role = NULL;
++config GRKERNSEC_PROC_GID
++      int "GID for special group"
++      depends on GRKERNSEC_PROC_USERGROUP
++      default 1001
 +
-+static unsigned int gr_auth_attempts = 0;
-+static unsigned long gr_auth_expires = 0UL;
++config GRKERNSEC_PROC_ADD
++      bool "Additional restrictions"
++      depends on GRKERNSEC_PROC_USER || GRKERNSEC_PROC_USERGROUP
++      help
++        If you say Y here, additional restrictions will be placed on
++        /proc that keep normal users from viewing device information and 
++        slabinfo information that could be useful for exploits.
 +
-+#ifdef CONFIG_NET
-+extern struct vfsmount *sock_mnt;
-+#endif
++config GRKERNSEC_LINK
++      bool "Linking restrictions"
++      help
++        If you say Y here, /tmp race exploits will be prevented, since users
++        will no longer be able to follow symlinks owned by other users in
++        world-writable +t directories (e.g. /tmp), unless the owner of the
++        symlink is the owner of the directory. users will also not be
++        able to hardlink to files they do not own.  If the sysctl option is
++        enabled, a sysctl option with name "linking_restrictions" is created.
 +
-+extern struct vfsmount *pipe_mnt;
-+extern struct vfsmount *shm_mnt;
-+#ifdef CONFIG_HUGETLBFS
-+extern struct vfsmount *hugetlbfs_vfsmount;
-+#endif
++config GRKERNSEC_FIFO
++      bool "FIFO restrictions"
++      help
++        If you say Y here, users will not be able to write to FIFOs they don't
++        own in world-writable +t directories (e.g. /tmp), unless the owner of
++        the FIFO is the same owner of the directory it's held in.  If the sysctl
++        option is enabled, a sysctl option with name "fifo_restrictions" is
++        created.
 +
-+static struct acl_object_label *fakefs_obj_rw;
-+static struct acl_object_label *fakefs_obj_rwx;
++config GRKERNSEC_SYSFS_RESTRICT
++      bool "Sysfs/debugfs restriction"
++      depends on SYSFS
++      help
++        If you say Y here, sysfs (the pseudo-filesystem mounted at /sys) and
++        any filesystem normally mounted under it (e.g. debugfs) will only
++        be accessible by root.  These filesystems generally provide access
++        to hardware and debug information that isn't appropriate for unprivileged
++        users of the system.  Sysfs and debugfs have also become a large source
++        of new vulnerabilities, ranging from infoleaks to local compromise.
++        There has been very little oversight with an eye toward security involved
++        in adding new exporters of information to these filesystems, so their
++        use is discouraged.
++        This option is equivalent to a chmod 0700 of the mount paths.
 +
-+extern int gr_init_uidset(void);
-+extern void gr_free_uidset(void);
-+extern void gr_remove_uid(uid_t uid);
-+extern int gr_find_uid(uid_t uid);
++config GRKERNSEC_ROFS
++      bool "Runtime read-only mount protection"
++      help
++        If you say Y here, a sysctl option with name "romount_protect" will
++        be created.  By setting this option to 1 at runtime, filesystems
++        will be protected in the following ways:
++        * No new writable mounts will be allowed
++        * Existing read-only mounts won't be able to be remounted read/write
++        * Write operations will be denied on all block devices
++        This option acts independently of grsec_lock: once it is set to 1,
++        it cannot be turned off.  Therefore, please be mindful of the resulting
++        behavior if this option is enabled in an init script on a read-only
++        filesystem.  This feature is mainly intended for secure embedded systems.
 +
-+DECLARE_BRLOCK(vfsmount_lock);
++config GRKERNSEC_CHROOT
++      bool "Chroot jail restrictions"
++      help
++        If you say Y here, you will be able to choose several options that will
++        make breaking out of a chrooted jail much more difficult.  If you
++        encounter no software incompatibilities with the following options, it
++        is recommended that you enable each one.
 +
-+__inline__ int
-+gr_acl_is_enabled(void)
-+{
-+      return (gr_status & GR_READY);
-+}
++config GRKERNSEC_CHROOT_MOUNT
++      bool "Deny mounts"
++      depends on GRKERNSEC_CHROOT
++      help
++        If you say Y here, processes inside a chroot will not be able to
++        mount or remount filesystems.  If the sysctl option is enabled, a
++        sysctl option with name "chroot_deny_mount" is created.
 +
-+#ifdef CONFIG_BTRFS_FS
-+extern dev_t get_btrfs_dev_from_inode(struct inode *inode);
-+extern int btrfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat);
-+#endif
++config GRKERNSEC_CHROOT_DOUBLE
++      bool "Deny double-chroots"
++      depends on GRKERNSEC_CHROOT
++      help
++        If you say Y here, processes inside a chroot will not be able to chroot
++        again outside the chroot.  This is a widely used method of breaking
++        out of a chroot jail and should not be allowed.  If the sysctl 
++        option is enabled, a sysctl option with name 
++        "chroot_deny_chroot" is created.
 +
-+static inline dev_t __get_dev(const struct dentry *dentry)
-+{
-+#ifdef CONFIG_BTRFS_FS
-+      if (dentry->d_inode->i_op && dentry->d_inode->i_op->getattr == &btrfs_getattr)
-+              return get_btrfs_dev_from_inode(dentry->d_inode);
-+      else
-+#endif
-+              return dentry->d_inode->i_sb->s_dev;
-+}
++config GRKERNSEC_CHROOT_PIVOT
++      bool "Deny pivot_root in chroot"
++      depends on GRKERNSEC_CHROOT
++      help
++        If you say Y here, processes inside a chroot will not be able to use
++        a function called pivot_root() that was introduced in Linux 2.3.41.  It
++        works similar to chroot in that it changes the root filesystem.  This
++        function could be misused in a chrooted process to attempt to break out
++        of the chroot, and therefore should not be allowed.  If the sysctl
++        option is enabled, a sysctl option with name "chroot_deny_pivot" is
++        created.
 +
-+dev_t gr_get_dev_from_dentry(struct dentry *dentry)
-+{
-+      return __get_dev(dentry);
-+}
++config GRKERNSEC_CHROOT_CHDIR
++      bool "Enforce chdir(\"/\") on all chroots"
++      depends on GRKERNSEC_CHROOT
++      help
++        If you say Y here, the current working directory of all newly-chrooted
++        applications will be set to the the root directory of the chroot.
++        The man page on chroot(2) states:
++        Note that this call does not change  the  current  working
++        directory,  so  that `.' can be outside the tree rooted at
++        `/'.  In particular, the  super-user  can  escape  from  a
++        `chroot jail' by doing `mkdir foo; chroot foo; cd ..'.
 +
-+static char gr_task_roletype_to_char(struct task_struct *task)
-+{
-+      switch (task->role->roletype &
-+              (GR_ROLE_DEFAULT | GR_ROLE_USER | GR_ROLE_GROUP |
-+               GR_ROLE_SPECIAL)) {
-+      case GR_ROLE_DEFAULT:
-+              return 'D';
-+      case GR_ROLE_USER:
-+              return 'U';
-+      case GR_ROLE_GROUP:
-+              return 'G';
-+      case GR_ROLE_SPECIAL:
-+              return 'S';
-+      }
++        It is recommended that you say Y here, since it's not known to break
++        any software.  If the sysctl option is enabled, a sysctl option with
++        name "chroot_enforce_chdir" is created.
 +
-+      return 'X';
-+}
++config GRKERNSEC_CHROOT_CHMOD
++      bool "Deny (f)chmod +s"
++      depends on GRKERNSEC_CHROOT
++      help
++        If you say Y here, processes inside a chroot will not be able to chmod
++        or fchmod files to make them have suid or sgid bits.  This protects
++        against another published method of breaking a chroot.  If the sysctl
++        option is enabled, a sysctl option with name "chroot_deny_chmod" is
++        created.
 +
-+char gr_roletype_to_char(void)
-+{
-+      return gr_task_roletype_to_char(current);
-+}
++config GRKERNSEC_CHROOT_FCHDIR
++      bool "Deny fchdir out of chroot"
++      depends on GRKERNSEC_CHROOT
++      help
++        If you say Y here, a well-known method of breaking chroots by fchdir'ing
++        to a file descriptor of the chrooting process that points to a directory
++        outside the filesystem will be stopped.  If the sysctl option
++        is enabled, a sysctl option with name "chroot_deny_fchdir" is created.
 +
-+__inline__ int
-+gr_acl_tpe_check(void)
-+{
-+      if (unlikely(!(gr_status & GR_READY)))
-+              return 0;
-+      if (current->role->roletype & GR_ROLE_TPE)
-+              return 1;
-+      else
-+              return 0;
-+}
++config GRKERNSEC_CHROOT_MKNOD
++      bool "Deny mknod"
++      depends on GRKERNSEC_CHROOT
++      help
++        If you say Y here, processes inside a chroot will not be allowed to
++        mknod.  The problem with using mknod inside a chroot is that it
++        would allow an attacker to create a device entry that is the same
++        as one on the physical root of your system, which could range from
++        anything from the console device to a device for your harddrive (which
++        they could then use to wipe the drive or steal data).  It is recommended
++        that you say Y here, unless you run into software incompatibilities.
++        If the sysctl option is enabled, a sysctl option with name
++        "chroot_deny_mknod" is created.
 +
-+int
-+gr_handle_rawio(const struct inode *inode)
-+{
-+#ifdef CONFIG_GRKERNSEC_CHROOT_CAPS
-+      if (inode && S_ISBLK(inode->i_mode) &&
-+          grsec_enable_chroot_caps && proc_is_chrooted(current) &&
-+          !capable(CAP_SYS_RAWIO))
-+              return 1;
-+#endif
-+      return 0;
-+}
++config GRKERNSEC_CHROOT_SHMAT
++      bool "Deny shmat() out of chroot"
++      depends on GRKERNSEC_CHROOT
++      help
++        If you say Y here, processes inside a chroot will not be able to attach
++        to shared memory segments that were created outside of the chroot jail.
++        It is recommended that you say Y here.  If the sysctl option is enabled,
++        a sysctl option with name "chroot_deny_shmat" is created.
 +
-+static int
-+gr_streq(const char *a, const char *b, const unsigned int lena, const unsigned int lenb)
-+{
-+      if (likely(lena != lenb))
-+              return 0;
++config GRKERNSEC_CHROOT_UNIX
++      bool "Deny access to abstract AF_UNIX sockets out of chroot"
++      depends on GRKERNSEC_CHROOT
++      help
++        If you say Y here, processes inside a chroot will not be able to
++        connect to abstract (meaning not belonging to a filesystem) Unix
++        domain sockets that were bound outside of a chroot.  It is recommended
++        that you say Y here.  If the sysctl option is enabled, a sysctl option
++        with name "chroot_deny_unix" is created.
 +
-+      return !memcmp(a, b, lena);
-+}
++config GRKERNSEC_CHROOT_FINDTASK
++      bool "Protect outside processes"
++      depends on GRKERNSEC_CHROOT
++      help
++        If you say Y here, processes inside a chroot will not be able to
++        kill, send signals with fcntl, ptrace, capget, getpgid, setpgid, 
++        getsid, or view any process outside of the chroot.  If the sysctl
++        option is enabled, a sysctl option with name "chroot_findtask" is
++        created.
 +
-+static int prepend(char **buffer, int *buflen, const char *str, int namelen)
-+{
-+      *buflen -= namelen;
-+      if (*buflen < 0)
-+              return -ENAMETOOLONG;
-+      *buffer -= namelen;
-+      memcpy(*buffer, str, namelen);
-+      return 0;
-+}
++config GRKERNSEC_CHROOT_NICE
++      bool "Restrict priority changes"
++      depends on GRKERNSEC_CHROOT
++      help
++        If you say Y here, processes inside a chroot will not be able to raise
++        the priority of processes in the chroot, or alter the priority of
++        processes outside the chroot.  This provides more security than simply
++        removing CAP_SYS_NICE from the process' capability set.  If the
++        sysctl option is enabled, a sysctl option with name "chroot_restrict_nice"
++        is created.
 +
-+static int prepend_name(char **buffer, int *buflen, struct qstr *name)
-+{
-+      return prepend(buffer, buflen, name->name, name->len);
-+}
++config GRKERNSEC_CHROOT_SYSCTL
++      bool "Deny sysctl writes"
++      depends on GRKERNSEC_CHROOT
++      help
++        If you say Y here, an attacker in a chroot will not be able to
++        write to sysctl entries, either by sysctl(2) or through a /proc
++        interface.  It is strongly recommended that you say Y here. If the
++        sysctl option is enabled, a sysctl option with name
++        "chroot_deny_sysctl" is created.
 +
-+static int prepend_path(const struct path *path, struct path *root,
-+                      char **buffer, int *buflen)
-+{
-+      struct dentry *dentry = path->dentry;
-+      struct vfsmount *vfsmnt = path->mnt;
-+      bool slash = false;
-+      int error = 0;
++config GRKERNSEC_CHROOT_CAPS
++      bool "Capability restrictions"
++      depends on GRKERNSEC_CHROOT
++      help
++        If you say Y here, the capabilities on all processes within a
++        chroot jail will be lowered to stop module insertion, raw i/o,
++        system and net admin tasks, rebooting the system, modifying immutable
++        files, modifying IPC owned by another, and changing the system time.
++        This is left an option because it can break some apps.  Disable this
++        if your chrooted apps are having problems performing those kinds of
++        tasks.  If the sysctl option is enabled, a sysctl option with
++        name "chroot_caps" is created.
 +
-+      while (dentry != root->dentry || vfsmnt != root->mnt) {
-+              struct dentry * parent;
++endmenu
++menu "Kernel Auditing"
++depends on GRKERNSEC
 +
-+              if (dentry == vfsmnt->mnt_root || IS_ROOT(dentry)) {
-+                      /* Global root? */
-+                      if (vfsmnt->mnt_parent == vfsmnt) {
-+                              goto out;
-+                      }
-+                      dentry = vfsmnt->mnt_mountpoint;
-+                      vfsmnt = vfsmnt->mnt_parent;
-+                      continue;
-+              }
-+              parent = dentry->d_parent;
-+              prefetch(parent);
-+              spin_lock(&dentry->d_lock);
-+              error = prepend_name(buffer, buflen, &dentry->d_name);
-+              spin_unlock(&dentry->d_lock);
-+              if (!error)
-+                      error = prepend(buffer, buflen, "/", 1);
-+              if (error)
-+                      break;
++config GRKERNSEC_AUDIT_GROUP
++      bool "Single group for auditing"
++      help
++        If you say Y here, the exec, chdir, and (un)mount logging features
++        will only operate on a group you specify.  This option is recommended
++        if you only want to watch certain users instead of having a large
++        amount of logs from the entire system.  If the sysctl option is enabled,
++        a sysctl option with name "audit_group" is created.
 +
-+              slash = true;
-+              dentry = parent;
-+      }
++config GRKERNSEC_AUDIT_GID
++      int "GID for auditing"
++      depends on GRKERNSEC_AUDIT_GROUP
++      default 1007
 +
-+out:
-+      if (!error && !slash)
-+              error = prepend(buffer, buflen, "/", 1);
++config GRKERNSEC_EXECLOG
++      bool "Exec logging"
++      help
++        If you say Y here, all execve() calls will be logged (since the
++        other exec*() calls are frontends to execve(), all execution
++        will be logged).  Useful for shell-servers that like to keep track
++        of their users.  If the sysctl option is enabled, a sysctl option with
++        name "exec_logging" is created.
++        WARNING: This option when enabled will produce a LOT of logs, especially
++        on an active system.
 +
-+      return error;
-+}
++config GRKERNSEC_RESLOG
++      bool "Resource logging"
++      help
++        If you say Y here, all attempts to overstep resource limits will
++        be logged with the resource name, the requested size, and the current
++        limit.  It is highly recommended that you say Y here.  If the sysctl
++        option is enabled, a sysctl option with name "resource_logging" is
++        created.  If the RBAC system is enabled, the sysctl value is ignored.
 +
-+/* this must be called with vfsmount_lock and rename_lock held */
++config GRKERNSEC_CHROOT_EXECLOG
++      bool "Log execs within chroot"
++      help
++        If you say Y here, all executions inside a chroot jail will be logged
++        to syslog.  This can cause a large amount of logs if certain
++        applications (eg. djb's daemontools) are installed on the system, and
++        is therefore left as an option.  If the sysctl option is enabled, a
++        sysctl option with name "chroot_execlog" is created.
 +
-+static char *__our_d_path(const struct path *path, struct path *root,
-+                      char *buf, int buflen)
-+{
-+      char *res = buf + buflen;
-+      int error;
++config GRKERNSEC_AUDIT_PTRACE
++      bool "Ptrace logging"
++      help
++        If you say Y here, all attempts to attach to a process via ptrace
++        will be logged.  If the sysctl option is enabled, a sysctl option
++        with name "audit_ptrace" is created.
 +
-+      prepend(&res, &buflen, "\0", 1);
-+      error = prepend_path(path, root, &res, &buflen);
-+      if (error)
-+              return ERR_PTR(error);
++config GRKERNSEC_AUDIT_CHDIR
++      bool "Chdir logging"
++      help
++        If you say Y here, all chdir() calls will be logged.  If the sysctl
++        option is enabled, a sysctl option with name "audit_chdir" is created.
 +
-+      return res;
-+}
++config GRKERNSEC_AUDIT_MOUNT
++      bool "(Un)Mount logging"
++      help
++        If you say Y here, all mounts and unmounts will be logged.  If the
++        sysctl option is enabled, a sysctl option with name "audit_mount" is
++        created.
 +
-+static char *
-+gen_full_path(struct path *path, struct path *root, char *buf, int buflen)
-+{
-+      char *retval;
++config GRKERNSEC_SIGNAL
++      bool "Signal logging"
++      help
++        If you say Y here, certain important signals will be logged, such as
++        SIGSEGV, which will as a result inform you of when a error in a program
++        occurred, which in some cases could mean a possible exploit attempt.
++        If the sysctl option is enabled, a sysctl option with name
++        "signal_logging" is created.
 +
-+      retval = __our_d_path(path, root, buf, buflen);
-+      if (unlikely(IS_ERR(retval)))
-+              retval = strcpy(buf, "<path too long>");
-+      else if (unlikely(retval[1] == '/' && retval[2] == '\0'))
-+              retval[1] = '\0';
++config GRKERNSEC_FORKFAIL
++      bool "Fork failure logging"
++      help
++        If you say Y here, all failed fork() attempts will be logged.
++        This could suggest a fork bomb, or someone attempting to overstep
++        their process limit.  If the sysctl option is enabled, a sysctl option
++        with name "forkfail_logging" is created.
 +
-+      return retval;
-+}
++config GRKERNSEC_TIME
++      bool "Time change logging"
++      help
++        If you say Y here, any changes of the system clock will be logged.
++        If the sysctl option is enabled, a sysctl option with name
++        "timechange_logging" is created.
 +
-+static char *
-+__d_real_path(const struct dentry *dentry, const struct vfsmount *vfsmnt,
-+              char *buf, int buflen)
-+{
-+      struct path path;
-+      char *res;
++config GRKERNSEC_PROC_IPADDR
++      bool "/proc/<pid>/ipaddr support"
++      help
++        If you say Y here, a new entry will be added to each /proc/<pid>
++        directory that contains the IP address of the person using the task.
++        The IP is carried across local TCP and AF_UNIX stream sockets.
++        This information can be useful for IDS/IPSes to perform remote response
++        to a local attack.  The entry is readable by only the owner of the
++        process (and root if he has CAP_DAC_OVERRIDE, which can be removed via
++        the RBAC system), and thus does not create privacy concerns.
 +
-+      path.dentry = (struct dentry *)dentry;
-+      path.mnt = (struct vfsmount *)vfsmnt;
++config GRKERNSEC_RWXMAP_LOG
++      bool 'Denied RWX mmap/mprotect logging'
++      depends on PAX_MPROTECT && !PAX_EMUPLT && !PAX_EMUSIGRT
++      help
++        If you say Y here, calls to mmap() and mprotect() with explicit
++        usage of PROT_WRITE and PROT_EXEC together will be logged when
++        denied by the PAX_MPROTECT feature.  If the sysctl option is
++        enabled, a sysctl option with name "rwxmap_logging" is created.
 +
-+      /* we can use real_root.dentry, real_root.mnt, because this is only called
-+         by the RBAC system */
-+      res = gen_full_path(&path, &real_root, buf, buflen);
++config GRKERNSEC_AUDIT_TEXTREL
++      bool 'ELF text relocations logging (READ HELP)'
++      depends on PAX_MPROTECT
++      help
++        If you say Y here, text relocations will be logged with the filename
++        of the offending library or binary.  The purpose of the feature is
++        to help Linux distribution developers get rid of libraries and
++        binaries that need text relocations which hinder the future progress
++        of PaX.  Only Linux distribution developers should say Y here, and
++        never on a production machine, as this option creates an information
++        leak that could aid an attacker in defeating the randomization of
++        a single memory region.  If the sysctl option is enabled, a sysctl
++        option with name "audit_textrel" is created.
 +
-+      return res;
-+}
++endmenu
 +
-+static char *
-+d_real_path(const struct dentry *dentry, const struct vfsmount *vfsmnt,
-+          char *buf, int buflen)
-+{
-+      char *res;
-+      struct path path;
-+      struct path root;
-+      struct task_struct *reaper = &init_task;
++menu "Executable Protections"
++depends on GRKERNSEC
 +
-+      path.dentry = (struct dentry *)dentry;
-+      path.mnt = (struct vfsmount *)vfsmnt;
++config GRKERNSEC_DMESG
++      bool "Dmesg(8) restriction"
++      help
++        If you say Y here, non-root users will not be able to use dmesg(8)
++        to view up to the last 4kb of messages in the kernel's log buffer.
++        The kernel's log buffer often contains kernel addresses and other
++        identifying information useful to an attacker in fingerprinting a
++        system for a targeted exploit.
++        If the sysctl option is enabled, a sysctl option with name "dmesg" is
++        created.
 +
-+      /* we can't use real_root.dentry, real_root.mnt, because they belong only to the RBAC system */
-+      get_fs_root(reaper->fs, &root);
++config GRKERNSEC_HARDEN_PTRACE
++      bool "Deter ptrace-based process snooping"
++      help
++        If you say Y here, TTY sniffers and other malicious monitoring
++        programs implemented through ptrace will be defeated.  If you
++        have been using the RBAC system, this option has already been
++        enabled for several years for all users, with the ability to make
++        fine-grained exceptions.
 +
-+      write_seqlock(&rename_lock);
-+      br_read_lock(vfsmount_lock);
-+      res = gen_full_path(&path, &root, buf, buflen);
-+      br_read_unlock(vfsmount_lock);
-+      write_sequnlock(&rename_lock);
++        This option only affects the ability of non-root users to ptrace
++        processes that are not a descendent of the ptracing process.
++        This means that strace ./binary and gdb ./binary will still work,
++        but attaching to arbitrary processes will not.  If the sysctl
++        option is enabled, a sysctl option with name "harden_ptrace" is
++        created.
 +
-+      path_put(&root);
-+      return res;
-+}
++config GRKERNSEC_TPE
++      bool "Trusted Path Execution (TPE)"
++      help
++        If you say Y here, you will be able to choose a gid to add to the
++        supplementary groups of users you want to mark as "untrusted."
++        These users will not be able to execute any files that are not in
++        root-owned directories writable only by root.  If the sysctl option
++        is enabled, a sysctl option with name "tpe" is created.
 +
-+static char *
-+gr_to_filename_rbac(const struct dentry *dentry, const struct vfsmount *mnt)
-+{
-+      char *ret;
-+      write_seqlock(&rename_lock);
-+      br_read_lock(vfsmount_lock);
-+      ret = __d_real_path(dentry, mnt, per_cpu_ptr(gr_shared_page[0],smp_processor_id()),
-+                           PAGE_SIZE);
-+      br_read_unlock(vfsmount_lock);
-+      write_sequnlock(&rename_lock);
-+      return ret;
-+}
++config GRKERNSEC_TPE_ALL
++      bool "Partially restrict all non-root users"
++      depends on GRKERNSEC_TPE
++      help
++        If you say Y here, all non-root users will be covered under
++        a weaker TPE restriction.  This is separate from, and in addition to,
++        the main TPE options that you have selected elsewhere.  Thus, if a
++        "trusted" GID is chosen, this restriction applies to even that GID.
++        Under this restriction, all non-root users will only be allowed to
++        execute files in directories they own that are not group or
++        world-writable, or in directories owned by root and writable only by
++        root.  If the sysctl option is enabled, a sysctl option with name
++        "tpe_restrict_all" is created.
 +
-+static char *
-+gr_to_proc_filename_rbac(const struct dentry *dentry, const struct vfsmount *mnt)
-+{
-+      char *ret;
-+      char *buf;
-+      int buflen;
++config GRKERNSEC_TPE_INVERT
++      bool "Invert GID option"
++      depends on GRKERNSEC_TPE
++      help
++        If you say Y here, the group you specify in the TPE configuration will
++        decide what group TPE restrictions will be *disabled* for.  This
++        option is useful if you want TPE restrictions to be applied to most
++        users on the system.  If the sysctl option is enabled, a sysctl option
++        with name "tpe_invert" is created.  Unlike other sysctl options, this
++        entry will default to on for backward-compatibility.
 +
-+      write_seqlock(&rename_lock);
-+      br_read_lock(vfsmount_lock);
-+      buf = per_cpu_ptr(gr_shared_page[0], smp_processor_id());
-+      ret = __d_real_path(dentry, mnt, buf, PAGE_SIZE - 6);
-+      buflen = (int)(ret - buf);
-+      if (buflen >= 5)
-+              prepend(&ret, &buflen, "/proc", 5);
-+      else
-+              ret = strcpy(buf, "<path too long>");
-+      br_read_unlock(vfsmount_lock);
-+      write_sequnlock(&rename_lock);
-+      return ret;
-+}
++config GRKERNSEC_TPE_GID
++      int "GID for untrusted users"
++      depends on GRKERNSEC_TPE && !GRKERNSEC_TPE_INVERT
++      default 1005
++      help
++        Setting this GID determines what group TPE restrictions will be
++        *enabled* for.  If the sysctl option is enabled, a sysctl option
++        with name "tpe_gid" is created.
 +
-+char *
-+gr_to_filename_nolock(const struct dentry *dentry, const struct vfsmount *mnt)
-+{
-+      return __d_real_path(dentry, mnt, per_cpu_ptr(gr_shared_page[0],smp_processor_id()),
-+                           PAGE_SIZE);
-+}
++config GRKERNSEC_TPE_GID
++      int "GID for trusted users"
++      depends on GRKERNSEC_TPE && GRKERNSEC_TPE_INVERT
++      default 1005
++      help
++        Setting this GID determines what group TPE restrictions will be
++        *disabled* for.  If the sysctl option is enabled, a sysctl option
++        with name "tpe_gid" is created.
 +
-+char *
-+gr_to_filename(const struct dentry *dentry, const struct vfsmount *mnt)
-+{
-+      return d_real_path(dentry, mnt, per_cpu_ptr(gr_shared_page[0], smp_processor_id()),
-+                         PAGE_SIZE);
-+}
++endmenu
++menu "Network Protections"
++depends on GRKERNSEC
 +
-+char *
-+gr_to_filename1(const struct dentry *dentry, const struct vfsmount *mnt)
-+{
-+      return d_real_path(dentry, mnt, per_cpu_ptr(gr_shared_page[1], smp_processor_id()),
-+                         PAGE_SIZE);
-+}
++config GRKERNSEC_RANDNET
++      bool "Larger entropy pools"
++      help
++        If you say Y here, the entropy pools used for many features of Linux
++        and grsecurity will be doubled in size.  Since several grsecurity
++        features use additional randomness, it is recommended that you say Y
++        here.  Saying Y here has a similar effect as modifying
++        /proc/sys/kernel/random/poolsize.
 +
-+char *
-+gr_to_filename2(const struct dentry *dentry, const struct vfsmount *mnt)
-+{
-+      return d_real_path(dentry, mnt, per_cpu_ptr(gr_shared_page[2], smp_processor_id()),
-+                         PAGE_SIZE);
-+}
++config GRKERNSEC_BLACKHOLE
++      bool "TCP/UDP blackhole and LAST_ACK DoS prevention"
++      depends on NET
++      help
++        If you say Y here, neither TCP resets nor ICMP
++        destination-unreachable packets will be sent in response to packets
++        sent to ports for which no associated listening process exists.
++        This feature supports both IPV4 and IPV6 and exempts the 
++        loopback interface from blackholing.  Enabling this feature 
++        makes a host more resilient to DoS attacks and reduces network
++        visibility against scanners.
 +
-+char *
-+gr_to_filename3(const struct dentry *dentry, const struct vfsmount *mnt)
-+{
-+      return d_real_path(dentry, mnt, per_cpu_ptr(gr_shared_page[3], smp_processor_id()),
-+                         PAGE_SIZE);
-+}
++        The blackhole feature as-implemented is equivalent to the FreeBSD
++        blackhole feature, as it prevents RST responses to all packets, not
++        just SYNs.  Under most application behavior this causes no
++        problems, but applications (like haproxy) may not close certain
++        connections in a way that cleanly terminates them on the remote
++        end, leaving the remote host in LAST_ACK state.  Because of this
++        side-effect and to prevent intentional LAST_ACK DoSes, this
++        feature also adds automatic mitigation against such attacks.
++        The mitigation drastically reduces the amount of time a socket
++        can spend in LAST_ACK state.  If you're using haproxy and not
++        all servers it connects to have this option enabled, consider
++        disabling this feature on the haproxy host.
 +
-+__inline__ __u32
-+to_gr_audit(const __u32 reqmode)
-+{
-+      /* masks off auditable permission flags, then shifts them to create
-+         auditing flags, and adds the special case of append auditing if
-+         we're requesting write */
-+      return (((reqmode & ~GR_AUDITS) << 10) | ((reqmode & GR_WRITE) ? GR_AUDIT_APPEND : 0));
-+}
++        If the sysctl option is enabled, two sysctl options with names
++        "ip_blackhole" and "lastack_retries" will be created.
++        While "ip_blackhole" takes the standard zero/non-zero on/off
++        toggle, "lastack_retries" uses the same kinds of values as
++        "tcp_retries1" and "tcp_retries2".  The default value of 4
++        prevents a socket from lasting more than 45 seconds in LAST_ACK
++        state.
 +
-+struct acl_subject_label *
-+lookup_subject_map(const struct acl_subject_label *userp)
-+{
-+      unsigned int index = shash(userp, subj_map_set.s_size);
-+      struct subject_map *match;
++config GRKERNSEC_SOCKET
++      bool "Socket restrictions"
++      depends on NET
++      help
++        If you say Y here, you will be able to choose from several options.
++        If you assign a GID on your system and add it to the supplementary
++        groups of users you want to restrict socket access to, this patch
++        will perform up to three things, based on the option(s) you choose.
 +
-+      match = subj_map_set.s_hash[index];
++config GRKERNSEC_SOCKET_ALL
++      bool "Deny any sockets to group"
++      depends on GRKERNSEC_SOCKET
++      help
++        If you say Y here, you will be able to choose a GID of whose users will
++        be unable to connect to other hosts from your machine or run server
++        applications from your machine.  If the sysctl option is enabled, a
++        sysctl option with name "socket_all" is created.
 +
-+      while (match && match->user != userp)
-+              match = match->next;
++config GRKERNSEC_SOCKET_ALL_GID
++      int "GID to deny all sockets for"
++      depends on GRKERNSEC_SOCKET_ALL
++      default 1004
++      help
++        Here you can choose the GID to disable socket access for. Remember to
++        add the users you want socket access disabled for to the GID
++        specified here.  If the sysctl option is enabled, a sysctl option
++        with name "socket_all_gid" is created.
 +
-+      if (match != NULL)
-+              return match->kernel;
-+      else
-+              return NULL;
-+}
++config GRKERNSEC_SOCKET_CLIENT
++      bool "Deny client sockets to group"
++      depends on GRKERNSEC_SOCKET
++      help
++        If you say Y here, you will be able to choose a GID of whose users will
++        be unable to connect to other hosts from your machine, but will be
++        able to run servers.  If this option is enabled, all users in the group
++        you specify will have to use passive mode when initiating ftp transfers
++        from the shell on your machine.  If the sysctl option is enabled, a
++        sysctl option with name "socket_client" is created.
 +
-+static void
-+insert_subj_map_entry(struct subject_map *subjmap)
-+{
-+      unsigned int index = shash(subjmap->user, subj_map_set.s_size);
-+      struct subject_map **curr;
++config GRKERNSEC_SOCKET_CLIENT_GID
++      int "GID to deny client sockets for"
++      depends on GRKERNSEC_SOCKET_CLIENT
++      default 1003
++      help
++        Here you can choose the GID to disable client socket access for.
++        Remember to add the users you want client socket access disabled for to
++        the GID specified here.  If the sysctl option is enabled, a sysctl
++        option with name "socket_client_gid" is created.
 +
-+      subjmap->prev = NULL;
++config GRKERNSEC_SOCKET_SERVER
++      bool "Deny server sockets to group"
++      depends on GRKERNSEC_SOCKET
++      help
++        If you say Y here, you will be able to choose a GID of whose users will
++        be unable to run server applications from your machine.  If the sysctl
++        option is enabled, a sysctl option with name "socket_server" is created.
 +
-+      curr = &subj_map_set.s_hash[index];
-+      if (*curr != NULL)
-+              (*curr)->prev = subjmap;
++config GRKERNSEC_SOCKET_SERVER_GID
++      int "GID to deny server sockets for"
++      depends on GRKERNSEC_SOCKET_SERVER
++      default 1002
++      help
++        Here you can choose the GID to disable server socket access for.
++        Remember to add the users you want server socket access disabled for to
++        the GID specified here.  If the sysctl option is enabled, a sysctl
++        option with name "socket_server_gid" is created.
 +
-+      subjmap->next = *curr;
-+      *curr = subjmap;
++endmenu
++menu "Sysctl support"
++depends on GRKERNSEC && SYSCTL
 +
-+      return;
-+}
++config GRKERNSEC_SYSCTL
++      bool "Sysctl support"
++      help
++        If you say Y here, you will be able to change the options that
++        grsecurity runs with at bootup, without having to recompile your
++        kernel.  You can echo values to files in /proc/sys/kernel/grsecurity
++        to enable (1) or disable (0) various features.  All the sysctl entries
++        are mutable until the "grsec_lock" entry is set to a non-zero value.
++        All features enabled in the kernel configuration are disabled at boot
++        if you do not say Y to the "Turn on features by default" option.
++        All options should be set at startup, and the grsec_lock entry should
++        be set to a non-zero value after all the options are set.
++        *THIS IS EXTREMELY IMPORTANT*
 +
-+static struct acl_role_label *
-+lookup_acl_role_label(const struct task_struct *task, const uid_t uid,
-+                    const gid_t gid)
-+{
-+      unsigned int index = rhash(uid, GR_ROLE_USER, acl_role_set.r_size);
-+      struct acl_role_label *match;
-+      struct role_allowed_ip *ipp;
-+      unsigned int x;
-+      u32 curr_ip = task->signal->curr_ip;
++config GRKERNSEC_SYSCTL_DISTRO
++      bool "Extra sysctl support for distro makers (READ HELP)"
++      depends on GRKERNSEC_SYSCTL && GRKERNSEC_IO
++      help
++        If you say Y here, additional sysctl options will be created
++        for features that affect processes running as root.  Therefore,
++        it is critical when using this option that the grsec_lock entry be
++        enabled after boot.  Only distros with prebuilt kernel packages
++        with this option enabled that can ensure grsec_lock is enabled
++        after boot should use this option.
++        *Failure to set grsec_lock after boot makes all grsec features
++        this option covers useless*
 +
-+      task->signal->saved_ip = curr_ip;
++        Currently this option creates the following sysctl entries:
++        "Disable Privileged I/O": "disable_priv_io"   
 +
-+      match = acl_role_set.r_hash[index];
++config GRKERNSEC_SYSCTL_ON
++      bool "Turn on features by default"
++      depends on GRKERNSEC_SYSCTL
++      help
++        If you say Y here, instead of having all features enabled in the
++        kernel configuration disabled at boot time, the features will be
++        enabled at boot time.  It is recommended you say Y here unless
++        there is some reason you would want all sysctl-tunable features to
++        be disabled by default.  As mentioned elsewhere, it is important
++        to enable the grsec_lock entry once you have finished modifying
++        the sysctl entries.
 +
-+      while (match) {
-+              if ((match->roletype & (GR_ROLE_DOMAIN | GR_ROLE_USER)) == (GR_ROLE_DOMAIN | GR_ROLE_USER)) {
-+                      for (x = 0; x < match->domain_child_num; x++) {
-+                              if (match->domain_children[x] == uid)
-+                                      goto found;
-+                      }
-+              } else if (match->uidgid == uid && match->roletype & GR_ROLE_USER)
-+                      break;
-+              match = match->next;
-+      }
-+found:
-+      if (match == NULL) {
-+            try_group:
-+              index = rhash(gid, GR_ROLE_GROUP, acl_role_set.r_size);
-+              match = acl_role_set.r_hash[index];
++endmenu
++menu "Logging Options"
++depends on GRKERNSEC
 +
-+              while (match) {
-+                      if ((match->roletype & (GR_ROLE_DOMAIN | GR_ROLE_GROUP)) == (GR_ROLE_DOMAIN | GR_ROLE_GROUP)) {
-+                              for (x = 0; x < match->domain_child_num; x++) {
-+                                      if (match->domain_children[x] == gid)
-+                                              goto found2;
-+                              }
-+                      } else if (match->uidgid == gid && match->roletype & GR_ROLE_GROUP)
-+                              break;
-+                      match = match->next;
-+              }
-+found2:
-+              if (match == NULL)
-+                      match = default_role;
-+              if (match->allowed_ips == NULL)
-+                      return match;
-+              else {
-+                      for (ipp = match->allowed_ips; ipp; ipp = ipp->next) {
-+                              if (likely
-+                                  ((ntohl(curr_ip) & ipp->netmask) ==
-+                                   (ntohl(ipp->addr) & ipp->netmask)))
-+                                      return match;
-+                      }
-+                      match = default_role;
-+              }
-+      } else if (match->allowed_ips == NULL) {
-+              return match;
-+      } else {
-+              for (ipp = match->allowed_ips; ipp; ipp = ipp->next) {
-+                      if (likely
-+                          ((ntohl(curr_ip) & ipp->netmask) ==
-+                           (ntohl(ipp->addr) & ipp->netmask)))
-+                              return match;
-+              }
-+              goto try_group;
-+      }
-+
-+      return match;
-+}
++config GRKERNSEC_FLOODTIME
++      int "Seconds in between log messages (minimum)"
++      default 10
++      help
++        This option allows you to enforce the number of seconds between
++        grsecurity log messages.  The default should be suitable for most
++        people, however, if you choose to change it, choose a value small enough
++        to allow informative logs to be produced, but large enough to
++        prevent flooding.
 +
-+struct acl_subject_label *
-+lookup_acl_subj_label(const ino_t ino, const dev_t dev,
-+                    const struct acl_role_label *role)
-+{
-+      unsigned int index = fhash(ino, dev, role->subj_hash_size);
-+      struct acl_subject_label *match;
++config GRKERNSEC_FLOODBURST
++      int "Number of messages in a burst (maximum)"
++      default 6
++      help
++        This option allows you to choose the maximum number of messages allowed
++        within the flood time interval you chose in a separate option.  The
++        default should be suitable for most people, however if you find that
++        many of your logs are being interpreted as flooding, you may want to
++        raise this value.
 +
-+      match = role->subj_hash[index];
++endmenu
 +
-+      while (match && (match->inode != ino || match->device != dev ||
-+             (match->mode & GR_DELETED))) {
-+              match = match->next;
-+      }
++endmenu
+diff --git a/grsecurity/Makefile b/grsecurity/Makefile
+new file mode 100644
+index 0000000..be9ae3a
+--- /dev/null
++++ b/grsecurity/Makefile
+@@ -0,0 +1,36 @@
++# grsecurity's ACL system was originally written in 2001 by Michael Dalton
++# during 2001-2009 it has been completely redesigned by Brad Spengler
++# into an RBAC system
++#
++# All code in this directory and various hooks inserted throughout the kernel
++# are copyright Brad Spengler - Open Source Security, Inc., and released 
++# under the GPL v2 or higher
 +
-+      if (match && !(match->mode & GR_DELETED))
-+              return match;
-+      else
-+              return NULL;
-+}
++obj-y = grsec_chdir.o grsec_chroot.o grsec_exec.o grsec_fifo.o grsec_fork.o \
++      grsec_mount.o grsec_sig.o grsec_sysctl.o \
++      grsec_time.o grsec_tpe.o grsec_link.o grsec_pax.o grsec_ptrace.o
 +
-+struct acl_subject_label *
-+lookup_acl_subj_label_deleted(const ino_t ino, const dev_t dev,
-+                        const struct acl_role_label *role)
-+{
-+      unsigned int index = fhash(ino, dev, role->subj_hash_size);
-+      struct acl_subject_label *match;
++obj-$(CONFIG_GRKERNSEC) += grsec_init.o grsum.o gracl.o gracl_segv.o \
++      gracl_cap.o gracl_alloc.o gracl_shm.o grsec_mem.o gracl_fs.o \
++      gracl_learn.o grsec_log.o
++obj-$(CONFIG_GRKERNSEC_RESLOG) += gracl_res.o
 +
-+      match = role->subj_hash[index];
++ifdef CONFIG_NET
++obj-y += grsec_sock.o
++obj-$(CONFIG_GRKERNSEC) += gracl_ip.o
++endif
 +
-+      while (match && (match->inode != ino || match->device != dev ||
-+             !(match->mode & GR_DELETED))) {
-+              match = match->next;
-+      }
++ifndef CONFIG_GRKERNSEC
++obj-y += grsec_disabled.o
++endif
 +
-+      if (match && (match->mode & GR_DELETED))
-+              return match;
-+      else
-+              return NULL;
-+}
++ifdef CONFIG_GRKERNSEC_HIDESYM
++extra-y := grsec_hidesym.o
++$(obj)/grsec_hidesym.o:
++      @-chmod -f 500 /boot
++      @-chmod -f 500 /lib/modules
++      @-chmod -f 500 /lib64/modules
++      @-chmod -f 500 /lib32/modules
++      @-chmod -f 700 .
++      @echo '  grsec: protected kernel image paths'
++endif
+diff --git a/grsecurity/gracl.c b/grsecurity/gracl.c
+new file mode 100644
+index 0000000..09258e0
+--- /dev/null
++++ b/grsecurity/gracl.c
+@@ -0,0 +1,4156 @@
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/sched.h>
++#include <linux/mm.h>
++#include <linux/file.h>
++#include <linux/fs.h>
++#include <linux/namei.h>
++#include <linux/mount.h>
++#include <linux/tty.h>
++#include <linux/proc_fs.h>
++#include <linux/lglock.h>
++#include <linux/slab.h>
++#include <linux/vmalloc.h>
++#include <linux/types.h>
++#include <linux/sysctl.h>
++#include <linux/netdevice.h>
++#include <linux/ptrace.h>
++#include <linux/gracl.h>
++#include <linux/gralloc.h>
++#include <linux/grsecurity.h>
++#include <linux/grinternal.h>
++#include <linux/pid_namespace.h>
++#include <linux/fdtable.h>
++#include <linux/percpu.h>
 +
-+static struct acl_object_label *
-+lookup_acl_obj_label(const ino_t ino, const dev_t dev,
-+                   const struct acl_subject_label *subj)
-+{
-+      unsigned int index = fhash(ino, dev, subj->obj_hash_size);
-+      struct acl_object_label *match;
++#include <asm/uaccess.h>
++#include <asm/errno.h>
++#include <asm/mman.h>
 +
-+      match = subj->obj_hash[index];
++static struct acl_role_db acl_role_set;
++static struct name_db name_set;
++static struct inodev_db inodev_set;
 +
-+      while (match && (match->inode != ino || match->device != dev ||
-+             (match->mode & GR_DELETED))) {
-+              match = match->next;
-+      }
++/* for keeping track of userspace pointers used for subjects, so we
++   can share references in the kernel as well
++*/
 +
-+      if (match && !(match->mode & GR_DELETED))
-+              return match;
-+      else
-+              return NULL;
-+}
++static struct path real_root;
 +
-+static struct acl_object_label *
-+lookup_acl_obj_label_create(const ino_t ino, const dev_t dev,
-+                   const struct acl_subject_label *subj)
-+{
-+      unsigned int index = fhash(ino, dev, subj->obj_hash_size);
-+      struct acl_object_label *match;
++static struct acl_subj_map_db subj_map_set;
 +
-+      match = subj->obj_hash[index];
++static struct acl_role_label *default_role;
 +
-+      while (match && (match->inode != ino || match->device != dev ||
-+             !(match->mode & GR_DELETED))) {
-+              match = match->next;
-+      }
++static struct acl_role_label *role_list;
 +
-+      if (match && (match->mode & GR_DELETED))
-+              return match;
++static u16 acl_sp_role_value;
 +
-+      match = subj->obj_hash[index];
++extern char *gr_shared_page[4];
++static DEFINE_MUTEX(gr_dev_mutex);
++DEFINE_RWLOCK(gr_inode_lock);
 +
-+      while (match && (match->inode != ino || match->device != dev ||
-+             (match->mode & GR_DELETED))) {
-+              match = match->next;
-+      }
++struct gr_arg *gr_usermode;
 +
-+      if (match && !(match->mode & GR_DELETED))
-+              return match;
-+      else
-+              return NULL;
-+}
++static unsigned int gr_status __read_only = GR_STATUS_INIT;
 +
-+static struct name_entry *
-+lookup_name_entry(const char *name)
-+{
-+      unsigned int len = strlen(name);
-+      unsigned int key = full_name_hash(name, len);
-+      unsigned int index = key % name_set.n_size;
-+      struct name_entry *match;
++extern int chkpw(struct gr_arg *entry, unsigned char *salt, unsigned char *sum);
++extern void gr_clear_learn_entries(void);
 +
-+      match = name_set.n_hash[index];
++#ifdef CONFIG_GRKERNSEC_RESLOG
++extern void gr_log_resource(const struct task_struct *task,
++                          const int res, const unsigned long wanted, const int gt);
++#endif
 +
-+      while (match && (match->key != key || !gr_streq(match->name, name, match->len, len)))
-+              match = match->next;
++unsigned char *gr_system_salt;
++unsigned char *gr_system_sum;
 +
-+      return match;
-+}
++static struct sprole_pw **acl_special_roles = NULL;
++static __u16 num_sprole_pws = 0;
 +
-+static struct name_entry *
-+lookup_name_entry_create(const char *name)
-+{
-+      unsigned int len = strlen(name);
-+      unsigned int key = full_name_hash(name, len);
-+      unsigned int index = key % name_set.n_size;
-+      struct name_entry *match;
++static struct acl_role_label *kernel_role = NULL;
 +
-+      match = name_set.n_hash[index];
++static unsigned int gr_auth_attempts = 0;
++static unsigned long gr_auth_expires = 0UL;
 +
-+      while (match && (match->key != key || !gr_streq(match->name, name, match->len, len) ||
-+                       !match->deleted))
-+              match = match->next;
++#ifdef CONFIG_NET
++extern struct vfsmount *sock_mnt;
++#endif
 +
-+      if (match && match->deleted)
-+              return match;
++extern struct vfsmount *pipe_mnt;
++extern struct vfsmount *shm_mnt;
++#ifdef CONFIG_HUGETLBFS
++extern struct vfsmount *hugetlbfs_vfsmount;
++#endif
 +
-+      match = name_set.n_hash[index];
++static struct acl_object_label *fakefs_obj_rw;
++static struct acl_object_label *fakefs_obj_rwx;
 +
-+      while (match && (match->key != key || !gr_streq(match->name, name, match->len, len) ||
-+                       match->deleted))
-+              match = match->next;
++extern int gr_init_uidset(void);
++extern void gr_free_uidset(void);
++extern void gr_remove_uid(uid_t uid);
++extern int gr_find_uid(uid_t uid);
 +
-+      if (match && !match->deleted)
-+              return match;
-+      else
-+              return NULL;
-+}
++DECLARE_BRLOCK(vfsmount_lock);
 +
-+static struct inodev_entry *
-+lookup_inodev_entry(const ino_t ino, const dev_t dev)
++__inline__ int
++gr_acl_is_enabled(void)
 +{
-+      unsigned int index = fhash(ino, dev, inodev_set.i_size);
-+      struct inodev_entry *match;
-+
-+      match = inodev_set.i_hash[index];
++      return (gr_status & GR_READY);
++}
 +
-+      while (match && (match->nentry->inode != ino || match->nentry->device != dev))
-+              match = match->next;
++#ifdef CONFIG_BTRFS_FS
++extern dev_t get_btrfs_dev_from_inode(struct inode *inode);
++extern int btrfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat);
++#endif
 +
-+      return match;
++static inline dev_t __get_dev(const struct dentry *dentry)
++{
++#ifdef CONFIG_BTRFS_FS
++      if (dentry->d_inode->i_op && dentry->d_inode->i_op->getattr == &btrfs_getattr)
++              return get_btrfs_dev_from_inode(dentry->d_inode);
++      else
++#endif
++              return dentry->d_inode->i_sb->s_dev;
 +}
 +
-+static void
-+insert_inodev_entry(struct inodev_entry *entry)
++dev_t gr_get_dev_from_dentry(struct dentry *dentry)
 +{
-+      unsigned int index = fhash(entry->nentry->inode, entry->nentry->device,
-+                                  inodev_set.i_size);
-+      struct inodev_entry **curr;
++      return __get_dev(dentry);
++}
 +
-+      entry->prev = NULL;
++static char gr_task_roletype_to_char(struct task_struct *task)
++{
++      switch (task->role->roletype &
++              (GR_ROLE_DEFAULT | GR_ROLE_USER | GR_ROLE_GROUP |
++               GR_ROLE_SPECIAL)) {
++      case GR_ROLE_DEFAULT:
++              return 'D';
++      case GR_ROLE_USER:
++              return 'U';
++      case GR_ROLE_GROUP:
++              return 'G';
++      case GR_ROLE_SPECIAL:
++              return 'S';
++      }
 +
-+      curr = &inodev_set.i_hash[index];
-+      if (*curr != NULL)
-+              (*curr)->prev = entry;
-+      
-+      entry->next = *curr;
-+      *curr = entry;
++      return 'X';
++}
 +
-+      return;
++char gr_roletype_to_char(void)
++{
++      return gr_task_roletype_to_char(current);
 +}
 +
-+static void
-+__insert_acl_role_label(struct acl_role_label *role, uid_t uidgid)
++__inline__ int
++gr_acl_tpe_check(void)
 +{
-+      unsigned int index =
-+          rhash(uidgid, role->roletype & (GR_ROLE_USER | GR_ROLE_GROUP), acl_role_set.r_size);
-+      struct acl_role_label **curr;
-+      struct acl_role_label *tmp;
++      if (unlikely(!(gr_status & GR_READY)))
++              return 0;
++      if (current->role->roletype & GR_ROLE_TPE)
++              return 1;
++      else
++              return 0;
++}
 +
-+      curr = &acl_role_set.r_hash[index];
++int
++gr_handle_rawio(const struct inode *inode)
++{
++#ifdef CONFIG_GRKERNSEC_CHROOT_CAPS
++      if (inode && S_ISBLK(inode->i_mode) &&
++          grsec_enable_chroot_caps && proc_is_chrooted(current) &&
++          !capable(CAP_SYS_RAWIO))
++              return 1;
++#endif
++      return 0;
++}
 +
-+      /* if role was already inserted due to domains and already has
-+         a role in the same bucket as it attached, then we need to
-+         combine these two buckets
-+      */
-+      if (role->next) {
-+              tmp = role->next;
-+              while (tmp->next)
-+                      tmp = tmp->next;
-+              tmp->next = *curr;
-+      } else
-+              role->next = *curr;
-+      *curr = role;
++static int
++gr_streq(const char *a, const char *b, const unsigned int lena, const unsigned int lenb)
++{
++      if (likely(lena != lenb))
++              return 0;
 +
-+      return;
++      return !memcmp(a, b, lena);
 +}
 +
-+static void
-+insert_acl_role_label(struct acl_role_label *role)
++static int prepend(char **buffer, int *buflen, const char *str, int namelen)
 +{
-+      int i;
-+
-+      if (role_list == NULL) {
-+              role_list = role;
-+              role->prev = NULL;
-+      } else {
-+              role->prev = role_list;
-+              role_list = role;
-+      }
-+      
-+      /* used for hash chains */
-+      role->next = NULL;
++      *buflen -= namelen;
++      if (*buflen < 0)
++              return -ENAMETOOLONG;
++      *buffer -= namelen;
++      memcpy(*buffer, str, namelen);
++      return 0;
++}
 +
-+      if (role->roletype & GR_ROLE_DOMAIN) {
-+              for (i = 0; i < role->domain_child_num; i++)
-+                      __insert_acl_role_label(role, role->domain_children[i]);
-+      } else
-+              __insert_acl_role_label(role, role->uidgid);
++static int prepend_name(char **buffer, int *buflen, struct qstr *name)
++{
++      return prepend(buffer, buflen, name->name, name->len);
 +}
-+                                      
-+static int
-+insert_name_entry(char *name, const ino_t inode, const dev_t device, __u8 deleted)
++
++static int prepend_path(const struct path *path, struct path *root,
++                      char **buffer, int *buflen)
 +{
-+      struct name_entry **curr, *nentry;
-+      struct inodev_entry *ientry;
-+      unsigned int len = strlen(name);
-+      unsigned int key = full_name_hash(name, len);
-+      unsigned int index = key % name_set.n_size;
++      struct dentry *dentry = path->dentry;
++      struct vfsmount *vfsmnt = path->mnt;
++      bool slash = false;
++      int error = 0;
 +
-+      curr = &name_set.n_hash[index];
++      while (dentry != root->dentry || vfsmnt != root->mnt) {
++              struct dentry * parent;
 +
-+      while (*curr && ((*curr)->key != key || !gr_streq((*curr)->name, name, (*curr)->len, len)))
-+              curr = &((*curr)->next);
++              if (dentry == vfsmnt->mnt_root || IS_ROOT(dentry)) {
++                      /* Global root? */
++                      if (vfsmnt->mnt_parent == vfsmnt) {
++                              goto out;
++                      }
++                      dentry = vfsmnt->mnt_mountpoint;
++                      vfsmnt = vfsmnt->mnt_parent;
++                      continue;
++              }
++              parent = dentry->d_parent;
++              prefetch(parent);
++              spin_lock(&dentry->d_lock);
++              error = prepend_name(buffer, buflen, &dentry->d_name);
++              spin_unlock(&dentry->d_lock);
++              if (!error)
++                      error = prepend(buffer, buflen, "/", 1);
++              if (error)
++                      break;
 +
-+      if (*curr != NULL)
-+              return 1;
++              slash = true;
++              dentry = parent;
++      }
 +
-+      nentry = acl_alloc(sizeof (struct name_entry));
-+      if (nentry == NULL)
-+              return 0;
-+      ientry = acl_alloc(sizeof (struct inodev_entry));
-+      if (ientry == NULL)
-+              return 0;
-+      ientry->nentry = nentry;
++out:
++      if (!error && !slash)
++              error = prepend(buffer, buflen, "/", 1);
 +
-+      nentry->key = key;
-+      nentry->name = name;
-+      nentry->inode = inode;
-+      nentry->device = device;
-+      nentry->len = len;
-+      nentry->deleted = deleted;
++      return error;
++}
 +
-+      nentry->prev = NULL;
-+      curr = &name_set.n_hash[index];
-+      if (*curr != NULL)
-+              (*curr)->prev = nentry;
-+      nentry->next = *curr;
-+      *curr = nentry;
++/* this must be called with vfsmount_lock and rename_lock held */
 +
-+      /* insert us into the table searchable by inode/dev */
-+      insert_inodev_entry(ientry);
++static char *__our_d_path(const struct path *path, struct path *root,
++                      char *buf, int buflen)
++{
++      char *res = buf + buflen;
++      int error;
 +
-+      return 1;
++      prepend(&res, &buflen, "\0", 1);
++      error = prepend_path(path, root, &res, &buflen);
++      if (error)
++              return ERR_PTR(error);
++
++      return res;
 +}
 +
-+static void
-+insert_acl_obj_label(struct acl_object_label *obj,
-+                   struct acl_subject_label *subj)
++static char *
++gen_full_path(struct path *path, struct path *root, char *buf, int buflen)
 +{
-+      unsigned int index =
-+          fhash(obj->inode, obj->device, subj->obj_hash_size);
-+      struct acl_object_label **curr;
-+
-+      
-+      obj->prev = NULL;
-+
-+      curr = &subj->obj_hash[index];
-+      if (*curr != NULL)
-+              (*curr)->prev = obj;
++      char *retval;
 +
-+      obj->next = *curr;
-+      *curr = obj;
++      retval = __our_d_path(path, root, buf, buflen);
++      if (unlikely(IS_ERR(retval)))
++              retval = strcpy(buf, "<path too long>");
++      else if (unlikely(retval[1] == '/' && retval[2] == '\0'))
++              retval[1] = '\0';
 +
-+      return;
++      return retval;
 +}
 +
-+static void
-+insert_acl_subj_label(struct acl_subject_label *obj,
-+                    struct acl_role_label *role)
++static char *
++__d_real_path(const struct dentry *dentry, const struct vfsmount *vfsmnt,
++              char *buf, int buflen)
 +{
-+      unsigned int index = fhash(obj->inode, obj->device, role->subj_hash_size);
-+      struct acl_subject_label **curr;
-+
-+      obj->prev = NULL;
++      struct path path;
++      char *res;
 +
-+      curr = &role->subj_hash[index];
-+      if (*curr != NULL)
-+              (*curr)->prev = obj;
++      path.dentry = (struct dentry *)dentry;
++      path.mnt = (struct vfsmount *)vfsmnt;
 +
-+      obj->next = *curr;
-+      *curr = obj;
++      /* we can use real_root.dentry, real_root.mnt, because this is only called
++         by the RBAC system */
++      res = gen_full_path(&path, &real_root, buf, buflen);
 +
-+      return;
++      return res;
 +}
 +
-+/* allocating chained hash tables, so optimal size is where lambda ~ 1 */
-+
-+static void *
-+create_table(__u32 * len, int elementsize)
++static char *
++d_real_path(const struct dentry *dentry, const struct vfsmount *vfsmnt,
++          char *buf, int buflen)
 +{
-+      unsigned int table_sizes[] = {
++      char *res;
++      struct path path;
++      struct path root;
++      struct task_struct *reaper = &init_task;
++
++      path.dentry = (struct dentry *)dentry;
++      path.mnt = (struct vfsmount *)vfsmnt;
++
++      /* we can't use real_root.dentry, real_root.mnt, because they belong only to the RBAC system */
++      get_fs_root(reaper->fs, &root);
++
++      write_seqlock(&rename_lock);
++      br_read_lock(vfsmount_lock);
++      res = gen_full_path(&path, &root, buf, buflen);
++      br_read_unlock(vfsmount_lock);
++      write_sequnlock(&rename_lock);
++
++      path_put(&root);
++      return res;
++}
++
++static char *
++gr_to_filename_rbac(const struct dentry *dentry, const struct vfsmount *mnt)
++{
++      char *ret;
++      write_seqlock(&rename_lock);
++      br_read_lock(vfsmount_lock);
++      ret = __d_real_path(dentry, mnt, per_cpu_ptr(gr_shared_page[0],smp_processor_id()),
++                           PAGE_SIZE);
++      br_read_unlock(vfsmount_lock);
++      write_sequnlock(&rename_lock);
++      return ret;
++}
++
++static char *
++gr_to_proc_filename_rbac(const struct dentry *dentry, const struct vfsmount *mnt)
++{
++      char *ret;
++      char *buf;
++      int buflen;
++
++      write_seqlock(&rename_lock);
++      br_read_lock(vfsmount_lock);
++      buf = per_cpu_ptr(gr_shared_page[0], smp_processor_id());
++      ret = __d_real_path(dentry, mnt, buf, PAGE_SIZE - 6);
++      buflen = (int)(ret - buf);
++      if (buflen >= 5)
++              prepend(&ret, &buflen, "/proc", 5);
++      else
++              ret = strcpy(buf, "<path too long>");
++      br_read_unlock(vfsmount_lock);
++      write_sequnlock(&rename_lock);
++      return ret;
++}
++
++char *
++gr_to_filename_nolock(const struct dentry *dentry, const struct vfsmount *mnt)
++{
++      return __d_real_path(dentry, mnt, per_cpu_ptr(gr_shared_page[0],smp_processor_id()),
++                           PAGE_SIZE);
++}
++
++char *
++gr_to_filename(const struct dentry *dentry, const struct vfsmount *mnt)
++{
++      return d_real_path(dentry, mnt, per_cpu_ptr(gr_shared_page[0], smp_processor_id()),
++                         PAGE_SIZE);
++}
++
++char *
++gr_to_filename1(const struct dentry *dentry, const struct vfsmount *mnt)
++{
++      return d_real_path(dentry, mnt, per_cpu_ptr(gr_shared_page[1], smp_processor_id()),
++                         PAGE_SIZE);
++}
++
++char *
++gr_to_filename2(const struct dentry *dentry, const struct vfsmount *mnt)
++{
++      return d_real_path(dentry, mnt, per_cpu_ptr(gr_shared_page[2], smp_processor_id()),
++                         PAGE_SIZE);
++}
++
++char *
++gr_to_filename3(const struct dentry *dentry, const struct vfsmount *mnt)
++{
++      return d_real_path(dentry, mnt, per_cpu_ptr(gr_shared_page[3], smp_processor_id()),
++                         PAGE_SIZE);
++}
++
++__inline__ __u32
++to_gr_audit(const __u32 reqmode)
++{
++      /* masks off auditable permission flags, then shifts them to create
++         auditing flags, and adds the special case of append auditing if
++         we're requesting write */
++      return (((reqmode & ~GR_AUDITS) << 10) | ((reqmode & GR_WRITE) ? GR_AUDIT_APPEND : 0));
++}
++
++struct acl_subject_label *
++lookup_subject_map(const struct acl_subject_label *userp)
++{
++      unsigned int index = shash(userp, subj_map_set.s_size);
++      struct subject_map *match;
++
++      match = subj_map_set.s_hash[index];
++
++      while (match && match->user != userp)
++              match = match->next;
++
++      if (match != NULL)
++              return match->kernel;
++      else
++              return NULL;
++}
++
++static void
++insert_subj_map_entry(struct subject_map *subjmap)
++{
++      unsigned int index = shash(subjmap->user, subj_map_set.s_size);
++      struct subject_map **curr;
++
++      subjmap->prev = NULL;
++
++      curr = &subj_map_set.s_hash[index];
++      if (*curr != NULL)
++              (*curr)->prev = subjmap;
++
++      subjmap->next = *curr;
++      *curr = subjmap;
++
++      return;
++}
++
++static struct acl_role_label *
++lookup_acl_role_label(const struct task_struct *task, const uid_t uid,
++                    const gid_t gid)
++{
++      unsigned int index = rhash(uid, GR_ROLE_USER, acl_role_set.r_size);
++      struct acl_role_label *match;
++      struct role_allowed_ip *ipp;
++      unsigned int x;
++      u32 curr_ip = task->signal->curr_ip;
++
++      task->signal->saved_ip = curr_ip;
++
++      match = acl_role_set.r_hash[index];
++
++      while (match) {
++              if ((match->roletype & (GR_ROLE_DOMAIN | GR_ROLE_USER)) == (GR_ROLE_DOMAIN | GR_ROLE_USER)) {
++                      for (x = 0; x < match->domain_child_num; x++) {
++                              if (match->domain_children[x] == uid)
++                                      goto found;
++                      }
++              } else if (match->uidgid == uid && match->roletype & GR_ROLE_USER)
++                      break;
++              match = match->next;
++      }
++found:
++      if (match == NULL) {
++            try_group:
++              index = rhash(gid, GR_ROLE_GROUP, acl_role_set.r_size);
++              match = acl_role_set.r_hash[index];
++
++              while (match) {
++                      if ((match->roletype & (GR_ROLE_DOMAIN | GR_ROLE_GROUP)) == (GR_ROLE_DOMAIN | GR_ROLE_GROUP)) {
++                              for (x = 0; x < match->domain_child_num; x++) {
++                                      if (match->domain_children[x] == gid)
++                                              goto found2;
++                              }
++                      } else if (match->uidgid == gid && match->roletype & GR_ROLE_GROUP)
++                              break;
++                      match = match->next;
++              }
++found2:
++              if (match == NULL)
++                      match = default_role;
++              if (match->allowed_ips == NULL)
++                      return match;
++              else {
++                      for (ipp = match->allowed_ips; ipp; ipp = ipp->next) {
++                              if (likely
++                                  ((ntohl(curr_ip) & ipp->netmask) ==
++                                   (ntohl(ipp->addr) & ipp->netmask)))
++                                      return match;
++                      }
++                      match = default_role;
++              }
++      } else if (match->allowed_ips == NULL) {
++              return match;
++      } else {
++              for (ipp = match->allowed_ips; ipp; ipp = ipp->next) {
++                      if (likely
++                          ((ntohl(curr_ip) & ipp->netmask) ==
++                           (ntohl(ipp->addr) & ipp->netmask)))
++                              return match;
++              }
++              goto try_group;
++      }
++
++      return match;
++}
++
++struct acl_subject_label *
++lookup_acl_subj_label(const ino_t ino, const dev_t dev,
++                    const struct acl_role_label *role)
++{
++      unsigned int index = fhash(ino, dev, role->subj_hash_size);
++      struct acl_subject_label *match;
++
++      match = role->subj_hash[index];
++
++      while (match && (match->inode != ino || match->device != dev ||
++             (match->mode & GR_DELETED))) {
++              match = match->next;
++      }
++
++      if (match && !(match->mode & GR_DELETED))
++              return match;
++      else
++              return NULL;
++}
++
++struct acl_subject_label *
++lookup_acl_subj_label_deleted(const ino_t ino, const dev_t dev,
++                        const struct acl_role_label *role)
++{
++      unsigned int index = fhash(ino, dev, role->subj_hash_size);
++      struct acl_subject_label *match;
++
++      match = role->subj_hash[index];
++
++      while (match && (match->inode != ino || match->device != dev ||
++             !(match->mode & GR_DELETED))) {
++              match = match->next;
++      }
++
++      if (match && (match->mode & GR_DELETED))
++              return match;
++      else
++              return NULL;
++}
++
++static struct acl_object_label *
++lookup_acl_obj_label(const ino_t ino, const dev_t dev,
++                   const struct acl_subject_label *subj)
++{
++      unsigned int index = fhash(ino, dev, subj->obj_hash_size);
++      struct acl_object_label *match;
++
++      match = subj->obj_hash[index];
++
++      while (match && (match->inode != ino || match->device != dev ||
++             (match->mode & GR_DELETED))) {
++              match = match->next;
++      }
++
++      if (match && !(match->mode & GR_DELETED))
++              return match;
++      else
++              return NULL;
++}
++
++static struct acl_object_label *
++lookup_acl_obj_label_create(const ino_t ino, const dev_t dev,
++                   const struct acl_subject_label *subj)
++{
++      unsigned int index = fhash(ino, dev, subj->obj_hash_size);
++      struct acl_object_label *match;
++
++      match = subj->obj_hash[index];
++
++      while (match && (match->inode != ino || match->device != dev ||
++             !(match->mode & GR_DELETED))) {
++              match = match->next;
++      }
++
++      if (match && (match->mode & GR_DELETED))
++              return match;
++
++      match = subj->obj_hash[index];
++
++      while (match && (match->inode != ino || match->device != dev ||
++             (match->mode & GR_DELETED))) {
++              match = match->next;
++      }
++
++      if (match && !(match->mode & GR_DELETED))
++              return match;
++      else
++              return NULL;
++}
++
++static struct name_entry *
++lookup_name_entry(const char *name)
++{
++      unsigned int len = strlen(name);
++      unsigned int key = full_name_hash(name, len);
++      unsigned int index = key % name_set.n_size;
++      struct name_entry *match;
++
++      match = name_set.n_hash[index];
++
++      while (match && (match->key != key || !gr_streq(match->name, name, match->len, len)))
++              match = match->next;
++
++      return match;
++}
++
++static struct name_entry *
++lookup_name_entry_create(const char *name)
++{
++      unsigned int len = strlen(name);
++      unsigned int key = full_name_hash(name, len);
++      unsigned int index = key % name_set.n_size;
++      struct name_entry *match;
++
++      match = name_set.n_hash[index];
++
++      while (match && (match->key != key || !gr_streq(match->name, name, match->len, len) ||
++                       !match->deleted))
++              match = match->next;
++
++      if (match && match->deleted)
++              return match;
++
++      match = name_set.n_hash[index];
++
++      while (match && (match->key != key || !gr_streq(match->name, name, match->len, len) ||
++                       match->deleted))
++              match = match->next;
++
++      if (match && !match->deleted)
++              return match;
++      else
++              return NULL;
++}
++
++static struct inodev_entry *
++lookup_inodev_entry(const ino_t ino, const dev_t dev)
++{
++      unsigned int index = fhash(ino, dev, inodev_set.i_size);
++      struct inodev_entry *match;
++
++      match = inodev_set.i_hash[index];
++
++      while (match && (match->nentry->inode != ino || match->nentry->device != dev))
++              match = match->next;
++
++      return match;
++}
++
++static void
++insert_inodev_entry(struct inodev_entry *entry)
++{
++      unsigned int index = fhash(entry->nentry->inode, entry->nentry->device,
++                                  inodev_set.i_size);
++      struct inodev_entry **curr;
++
++      entry->prev = NULL;
++
++      curr = &inodev_set.i_hash[index];
++      if (*curr != NULL)
++              (*curr)->prev = entry;
++      
++      entry->next = *curr;
++      *curr = entry;
++
++      return;
++}
++
++static void
++__insert_acl_role_label(struct acl_role_label *role, uid_t uidgid)
++{
++      unsigned int index =
++          rhash(uidgid, role->roletype & (GR_ROLE_USER | GR_ROLE_GROUP), acl_role_set.r_size);
++      struct acl_role_label **curr;
++      struct acl_role_label *tmp;
++
++      curr = &acl_role_set.r_hash[index];
++
++      /* if role was already inserted due to domains and already has
++         a role in the same bucket as it attached, then we need to
++         combine these two buckets
++      */
++      if (role->next) {
++              tmp = role->next;
++              while (tmp->next)
++                      tmp = tmp->next;
++              tmp->next = *curr;
++      } else
++              role->next = *curr;
++      *curr = role;
++
++      return;
++}
++
++static void
++insert_acl_role_label(struct acl_role_label *role)
++{
++      int i;
++
++      if (role_list == NULL) {
++              role_list = role;
++              role->prev = NULL;
++      } else {
++              role->prev = role_list;
++              role_list = role;
++      }
++      
++      /* used for hash chains */
++      role->next = NULL;
++
++      if (role->roletype & GR_ROLE_DOMAIN) {
++              for (i = 0; i < role->domain_child_num; i++)
++                      __insert_acl_role_label(role, role->domain_children[i]);
++      } else
++              __insert_acl_role_label(role, role->uidgid);
++}
++                                      
++static int
++insert_name_entry(char *name, const ino_t inode, const dev_t device, __u8 deleted)
++{
++      struct name_entry **curr, *nentry;
++      struct inodev_entry *ientry;
++      unsigned int len = strlen(name);
++      unsigned int key = full_name_hash(name, len);
++      unsigned int index = key % name_set.n_size;
++
++      curr = &name_set.n_hash[index];
++
++      while (*curr && ((*curr)->key != key || !gr_streq((*curr)->name, name, (*curr)->len, len)))
++              curr = &((*curr)->next);
++
++      if (*curr != NULL)
++              return 1;
++
++      nentry = acl_alloc(sizeof (struct name_entry));
++      if (nentry == NULL)
++              return 0;
++      ientry = acl_alloc(sizeof (struct inodev_entry));
++      if (ientry == NULL)
++              return 0;
++      ientry->nentry = nentry;
++
++      nentry->key = key;
++      nentry->name = name;
++      nentry->inode = inode;
++      nentry->device = device;
++      nentry->len = len;
++      nentry->deleted = deleted;
++
++      nentry->prev = NULL;
++      curr = &name_set.n_hash[index];
++      if (*curr != NULL)
++              (*curr)->prev = nentry;
++      nentry->next = *curr;
++      *curr = nentry;
++
++      /* insert us into the table searchable by inode/dev */
++      insert_inodev_entry(ientry);
++
++      return 1;
++}
++
++static void
++insert_acl_obj_label(struct acl_object_label *obj,
++                   struct acl_subject_label *subj)
++{
++      unsigned int index =
++          fhash(obj->inode, obj->device, subj->obj_hash_size);
++      struct acl_object_label **curr;
++
++      
++      obj->prev = NULL;
++
++      curr = &subj->obj_hash[index];
++      if (*curr != NULL)
++              (*curr)->prev = obj;
++
++      obj->next = *curr;
++      *curr = obj;
++
++      return;
++}
++
++static void
++insert_acl_subj_label(struct acl_subject_label *obj,
++                    struct acl_role_label *role)
++{
++      unsigned int index = fhash(obj->inode, obj->device, role->subj_hash_size);
++      struct acl_subject_label **curr;
++
++      obj->prev = NULL;
++
++      curr = &role->subj_hash[index];
++      if (*curr != NULL)
++              (*curr)->prev = obj;
++
++      obj->next = *curr;
++      *curr = obj;
++
++      return;
++}
++
++/* allocating chained hash tables, so optimal size is where lambda ~ 1 */
++
++static void *
++create_table(__u32 * len, int elementsize)
++{
++      unsigned int table_sizes[] = {
 +              7, 13, 31, 61, 127, 251, 509, 1021, 2039, 4093, 8191, 16381,
 +              32749, 65521, 131071, 262139, 524287, 1048573, 2097143,
 +              4194301, 8388593, 16777213, 33554393, 67108859
@@ -51498,9 +54836,122 @@ diff -urNp linux-3.1.3/grsecurity/gracl.c linux-3.1.3/grsecurity/gracl.c
 +EXPORT_SYMBOL(gr_check_group_change);
 +#endif
 +
-diff -urNp linux-3.1.3/grsecurity/gracl_cap.c linux-3.1.3/grsecurity/gracl_cap.c
---- linux-3.1.3/grsecurity/gracl_cap.c 1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/grsecurity/gracl_cap.c 2011-11-16 18:40:31.000000000 -0500
+diff --git a/grsecurity/gracl_alloc.c b/grsecurity/gracl_alloc.c
+new file mode 100644
+index 0000000..34fefda
+--- /dev/null
++++ b/grsecurity/gracl_alloc.c
+@@ -0,0 +1,105 @@
++#include <linux/kernel.h>
++#include <linux/mm.h>
++#include <linux/slab.h>
++#include <linux/vmalloc.h>
++#include <linux/gracl.h>
++#include <linux/grsecurity.h>
++
++static unsigned long alloc_stack_next = 1;
++static unsigned long alloc_stack_size = 1;
++static void **alloc_stack;
++
++static __inline__ int
++alloc_pop(void)
++{
++      if (alloc_stack_next == 1)
++              return 0;
++
++      kfree(alloc_stack[alloc_stack_next - 2]);
++
++      alloc_stack_next--;
++
++      return 1;
++}
++
++static __inline__ int
++alloc_push(void *buf)
++{
++      if (alloc_stack_next >= alloc_stack_size)
++              return 1;
++
++      alloc_stack[alloc_stack_next - 1] = buf;
++
++      alloc_stack_next++;
++
++      return 0;
++}
++
++void *
++acl_alloc(unsigned long len)
++{
++      void *ret = NULL;
++
++      if (!len || len > PAGE_SIZE)
++              goto out;
++
++      ret = kmalloc(len, GFP_KERNEL);
++
++      if (ret) {
++              if (alloc_push(ret)) {
++                      kfree(ret);
++                      ret = NULL;
++              }
++      }
++
++out:
++      return ret;
++}
++
++void *
++acl_alloc_num(unsigned long num, unsigned long len)
++{
++      if (!len || (num > (PAGE_SIZE / len)))
++              return NULL;
++
++      return acl_alloc(num * len);
++}
++
++void
++acl_free_all(void)
++{
++      if (gr_acl_is_enabled() || !alloc_stack)
++              return;
++
++      while (alloc_pop()) ;
++
++      if (alloc_stack) {
++              if ((alloc_stack_size * sizeof (void *)) <= PAGE_SIZE)
++                      kfree(alloc_stack);
++              else
++                      vfree(alloc_stack);
++      }
++
++      alloc_stack = NULL;
++      alloc_stack_size = 1;
++      alloc_stack_next = 1;
++
++      return;
++}
++
++int
++acl_alloc_stack_init(unsigned long size)
++{
++      if ((size * sizeof (void *)) <= PAGE_SIZE)
++              alloc_stack =
++                  (void **) kmalloc(size * sizeof (void *), GFP_KERNEL);
++      else
++              alloc_stack = (void **) vmalloc(size * sizeof (void *));
++
++      alloc_stack_size = size;
++
++      if (!alloc_stack)
++              return 0;
++      else
++              return 1;
++}
+diff --git a/grsecurity/gracl_cap.c b/grsecurity/gracl_cap.c
+new file mode 100644
+index 0000000..955ddfb
+--- /dev/null
++++ b/grsecurity/gracl_cap.c
 @@ -0,0 +1,101 @@
 +#include <linux/kernel.h>
 +#include <linux/module.h>
@@ -51603,9 +55054,11 @@ diff -urNp linux-3.1.3/grsecurity/gracl_cap.c linux-3.1.3/grsecurity/gracl_cap.c
 +      return 0;
 +}
 +
-diff -urNp linux-3.1.3/grsecurity/gracl_fs.c linux-3.1.3/grsecurity/gracl_fs.c
---- linux-3.1.3/grsecurity/gracl_fs.c  1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/grsecurity/gracl_fs.c  2011-11-17 00:25:32.000000000 -0500
+diff --git a/grsecurity/gracl_fs.c b/grsecurity/gracl_fs.c
+new file mode 100644
+index 0000000..4eda5c3
+--- /dev/null
++++ b/grsecurity/gracl_fs.c
 @@ -0,0 +1,433 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
@@ -52040,9 +55493,11 @@ diff -urNp linux-3.1.3/grsecurity/gracl_fs.c linux-3.1.3/grsecurity/gracl_fs.c
 +
 +      return 0;
 +}
-diff -urNp linux-3.1.3/grsecurity/gracl_ip.c linux-3.1.3/grsecurity/gracl_ip.c
---- linux-3.1.3/grsecurity/gracl_ip.c  1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/grsecurity/gracl_ip.c  2011-11-16 18:40:31.000000000 -0500
+diff --git a/grsecurity/gracl_ip.c b/grsecurity/gracl_ip.c
+new file mode 100644
+index 0000000..17050ca
+--- /dev/null
++++ b/grsecurity/gracl_ip.c
 @@ -0,0 +1,381 @@
 +#include <linux/kernel.h>
 +#include <asm/uaccess.h>
@@ -52425,9 +55880,11 @@ diff -urNp linux-3.1.3/grsecurity/gracl_ip.c linux-3.1.3/grsecurity/gracl_ip.c
 +
 +      return gr_search_connectbind(GR_CONNECT | GR_CONNECTOVERRIDE, sk, &sin, SOCK_DGRAM);
 +}
-diff -urNp linux-3.1.3/grsecurity/gracl_learn.c linux-3.1.3/grsecurity/gracl_learn.c
---- linux-3.1.3/grsecurity/gracl_learn.c       1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/grsecurity/gracl_learn.c       2011-11-16 18:40:31.000000000 -0500
+diff --git a/grsecurity/gracl_learn.c b/grsecurity/gracl_learn.c
+new file mode 100644
+index 0000000..25f54ef
+--- /dev/null
++++ b/grsecurity/gracl_learn.c
 @@ -0,0 +1,207 @@
 +#include <linux/kernel.h>
 +#include <linux/mm.h>
@@ -52636,9 +56093,11 @@ diff -urNp linux-3.1.3/grsecurity/gracl_learn.c linux-3.1.3/grsecurity/gracl_lea
 +      .release        = close_learn,
 +      .poll           = poll_learn,
 +};
-diff -urNp linux-3.1.3/grsecurity/gracl_res.c linux-3.1.3/grsecurity/gracl_res.c
---- linux-3.1.3/grsecurity/gracl_res.c 1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/grsecurity/gracl_res.c 2011-11-16 18:40:31.000000000 -0500
+diff --git a/grsecurity/gracl_res.c b/grsecurity/gracl_res.c
+new file mode 100644
+index 0000000..39645c9
+--- /dev/null
++++ b/grsecurity/gracl_res.c
 @@ -0,0 +1,68 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
@@ -52708,9 +56167,11 @@ diff -urNp linux-3.1.3/grsecurity/gracl_res.c linux-3.1.3/grsecurity/gracl_res.c
 +      rcu_read_unlock();
 +      return;
 +}
-diff -urNp linux-3.1.3/grsecurity/gracl_segv.c linux-3.1.3/grsecurity/gracl_segv.c
---- linux-3.1.3/grsecurity/gracl_segv.c        1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/grsecurity/gracl_segv.c        2011-11-16 18:40:31.000000000 -0500
+diff --git a/grsecurity/gracl_segv.c b/grsecurity/gracl_segv.c
+new file mode 100644
+index 0000000..5556be3
+--- /dev/null
++++ b/grsecurity/gracl_segv.c
 @@ -0,0 +1,299 @@
 +#include <linux/kernel.h>
 +#include <linux/mm.h>
@@ -53011,9 +56472,11 @@ diff -urNp linux-3.1.3/grsecurity/gracl_segv.c linux-3.1.3/grsecurity/gracl_segv
 +
 +      return;
 +}
-diff -urNp linux-3.1.3/grsecurity/gracl_shm.c linux-3.1.3/grsecurity/gracl_shm.c
---- linux-3.1.3/grsecurity/gracl_shm.c 1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/grsecurity/gracl_shm.c 2011-11-16 18:40:31.000000000 -0500
+diff --git a/grsecurity/gracl_shm.c b/grsecurity/gracl_shm.c
+new file mode 100644
+index 0000000..9d83a69
+--- /dev/null
++++ b/grsecurity/gracl_shm.c
 @@ -0,0 +1,40 @@
 +#include <linux/kernel.h>
 +#include <linux/mm.h>
@@ -53055,9 +56518,11 @@ diff -urNp linux-3.1.3/grsecurity/gracl_shm.c linux-3.1.3/grsecurity/gracl_shm.c
 +
 +      return 1;
 +}
-diff -urNp linux-3.1.3/grsecurity/grsec_chdir.c linux-3.1.3/grsecurity/grsec_chdir.c
---- linux-3.1.3/grsecurity/grsec_chdir.c       1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/grsecurity/grsec_chdir.c       2011-11-16 18:40:31.000000000 -0500
+diff --git a/grsecurity/grsec_chdir.c b/grsecurity/grsec_chdir.c
+new file mode 100644
+index 0000000..bc0be01
+--- /dev/null
++++ b/grsecurity/grsec_chdir.c
 @@ -0,0 +1,19 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
@@ -53078,9 +56543,11 @@ diff -urNp linux-3.1.3/grsecurity/grsec_chdir.c linux-3.1.3/grsecurity/grsec_chd
 +#endif
 +      return;
 +}
-diff -urNp linux-3.1.3/grsecurity/grsec_chroot.c linux-3.1.3/grsecurity/grsec_chroot.c
---- linux-3.1.3/grsecurity/grsec_chroot.c      1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/grsecurity/grsec_chroot.c      2011-11-16 18:40:31.000000000 -0500
+diff --git a/grsecurity/grsec_chroot.c b/grsecurity/grsec_chroot.c
+new file mode 100644
+index 0000000..a2dc675
+--- /dev/null
++++ b/grsecurity/grsec_chroot.c
 @@ -0,0 +1,351 @@
 +#include <linux/kernel.h>
 +#include <linux/module.h>
@@ -53433,9 +56900,11 @@ diff -urNp linux-3.1.3/grsecurity/grsec_chroot.c linux-3.1.3/grsecurity/grsec_ch
 +#endif
 +      return 0;
 +}
-diff -urNp linux-3.1.3/grsecurity/grsec_disabled.c linux-3.1.3/grsecurity/grsec_disabled.c
---- linux-3.1.3/grsecurity/grsec_disabled.c    1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/grsecurity/grsec_disabled.c    2011-11-17 00:16:25.000000000 -0500
+diff --git a/grsecurity/grsec_disabled.c b/grsecurity/grsec_disabled.c
+new file mode 100644
+index 0000000..d81a586
+--- /dev/null
++++ b/grsecurity/grsec_disabled.c
 @@ -0,0 +1,439 @@
 +#include <linux/kernel.h>
 +#include <linux/module.h>
@@ -53876,9 +57345,11 @@ diff -urNp linux-3.1.3/grsecurity/grsec_disabled.c linux-3.1.3/grsecurity/grsec_
 +EXPORT_SYMBOL(gr_check_user_change);
 +EXPORT_SYMBOL(gr_check_group_change);
 +#endif
-diff -urNp linux-3.1.3/grsecurity/grsec_exec.c linux-3.1.3/grsecurity/grsec_exec.c
---- linux-3.1.3/grsecurity/grsec_exec.c        1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/grsecurity/grsec_exec.c        2011-11-16 18:40:31.000000000 -0500
+diff --git a/grsecurity/grsec_exec.c b/grsecurity/grsec_exec.c
+new file mode 100644
+index 0000000..2b05ada
+--- /dev/null
++++ b/grsecurity/grsec_exec.c
 @@ -0,0 +1,146 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
@@ -54026,9 +57497,11 @@ diff -urNp linux-3.1.3/grsecurity/grsec_exec.c linux-3.1.3/grsecurity/grsec_exec
 +
 +EXPORT_SYMBOL(gr_is_capable);
 +EXPORT_SYMBOL(gr_is_capable_nolog);
-diff -urNp linux-3.1.3/grsecurity/grsec_fifo.c linux-3.1.3/grsecurity/grsec_fifo.c
---- linux-3.1.3/grsecurity/grsec_fifo.c        1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/grsecurity/grsec_fifo.c        2011-11-16 18:40:31.000000000 -0500
+diff --git a/grsecurity/grsec_fifo.c b/grsecurity/grsec_fifo.c
+new file mode 100644
+index 0000000..d3ee748
+--- /dev/null
++++ b/grsecurity/grsec_fifo.c
 @@ -0,0 +1,24 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
@@ -54054,9 +57527,11 @@ diff -urNp linux-3.1.3/grsecurity/grsec_fifo.c linux-3.1.3/grsecurity/grsec_fifo
 +#endif
 +      return 0;
 +}
-diff -urNp linux-3.1.3/grsecurity/grsec_fork.c linux-3.1.3/grsecurity/grsec_fork.c
---- linux-3.1.3/grsecurity/grsec_fork.c        1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/grsecurity/grsec_fork.c        2011-11-16 18:40:31.000000000 -0500
+diff --git a/grsecurity/grsec_fork.c b/grsecurity/grsec_fork.c
+new file mode 100644
+index 0000000..8ca18bf
+--- /dev/null
++++ b/grsecurity/grsec_fork.c
 @@ -0,0 +1,23 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
@@ -54081,9 +57556,11 @@ diff -urNp linux-3.1.3/grsecurity/grsec_fork.c linux-3.1.3/grsecurity/grsec_fork
 +#endif
 +      return;
 +}
-diff -urNp linux-3.1.3/grsecurity/grsec_init.c linux-3.1.3/grsecurity/grsec_init.c
---- linux-3.1.3/grsecurity/grsec_init.c        1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/grsecurity/grsec_init.c        2011-11-16 18:40:31.000000000 -0500
+diff --git a/grsecurity/grsec_init.c b/grsecurity/grsec_init.c
+new file mode 100644
+index 0000000..356ef00
+--- /dev/null
++++ b/grsecurity/grsec_init.c
 @@ -0,0 +1,269 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
@@ -54354,9 +57831,11 @@ diff -urNp linux-3.1.3/grsecurity/grsec_init.c linux-3.1.3/grsecurity/grsec_init
 +
 +      return;
 +}
-diff -urNp linux-3.1.3/grsecurity/grsec_link.c linux-3.1.3/grsecurity/grsec_link.c
---- linux-3.1.3/grsecurity/grsec_link.c        1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/grsecurity/grsec_link.c        2011-11-16 18:40:31.000000000 -0500
+diff --git a/grsecurity/grsec_link.c b/grsecurity/grsec_link.c
+new file mode 100644
+index 0000000..3efe141
+--- /dev/null
++++ b/grsecurity/grsec_link.c
 @@ -0,0 +1,43 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
@@ -54401,9 +57880,11 @@ diff -urNp linux-3.1.3/grsecurity/grsec_link.c linux-3.1.3/grsecurity/grsec_link
 +#endif
 +      return 0;
 +}
-diff -urNp linux-3.1.3/grsecurity/grsec_log.c linux-3.1.3/grsecurity/grsec_log.c
---- linux-3.1.3/grsecurity/grsec_log.c 1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/grsecurity/grsec_log.c 2011-11-16 18:40:31.000000000 -0500
+diff --git a/grsecurity/grsec_log.c b/grsecurity/grsec_log.c
+new file mode 100644
+index 0000000..a45d2e9
+--- /dev/null
++++ b/grsecurity/grsec_log.c
 @@ -0,0 +1,322 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
@@ -54727,9 +58208,11 @@ diff -urNp linux-3.1.3/grsecurity/grsec_log.c linux-3.1.3/grsecurity/grsec_log.c
 +              gr_log_end(audit, 1);
 +      END_LOCKS(audit);
 +}
-diff -urNp linux-3.1.3/grsecurity/grsec_mem.c linux-3.1.3/grsecurity/grsec_mem.c
---- linux-3.1.3/grsecurity/grsec_mem.c 1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/grsecurity/grsec_mem.c 2011-11-16 18:40:31.000000000 -0500
+diff --git a/grsecurity/grsec_mem.c b/grsecurity/grsec_mem.c
+new file mode 100644
+index 0000000..6c0416b
+--- /dev/null
++++ b/grsecurity/grsec_mem.c
 @@ -0,0 +1,33 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
@@ -54764,9 +58247,11 @@ diff -urNp linux-3.1.3/grsecurity/grsec_mem.c linux-3.1.3/grsecurity/grsec_mem.c
 +      gr_log_noargs(GR_DONT_AUDIT, GR_VM86_MSG);
 +      return;
 +}
-diff -urNp linux-3.1.3/grsecurity/grsec_mount.c linux-3.1.3/grsecurity/grsec_mount.c
---- linux-3.1.3/grsecurity/grsec_mount.c       1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/grsecurity/grsec_mount.c       2011-11-16 18:40:31.000000000 -0500
+diff --git a/grsecurity/grsec_mount.c b/grsecurity/grsec_mount.c
+new file mode 100644
+index 0000000..2131422
+--- /dev/null
++++ b/grsecurity/grsec_mount.c
 @@ -0,0 +1,62 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
@@ -54830,9 +58315,11 @@ diff -urNp linux-3.1.3/grsecurity/grsec_mount.c linux-3.1.3/grsecurity/grsec_mou
 +#endif
 +      return 0;
 +}
-diff -urNp linux-3.1.3/grsecurity/grsec_pax.c linux-3.1.3/grsecurity/grsec_pax.c
---- linux-3.1.3/grsecurity/grsec_pax.c 1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/grsecurity/grsec_pax.c 2011-11-16 18:40:31.000000000 -0500
+diff --git a/grsecurity/grsec_pax.c b/grsecurity/grsec_pax.c
+new file mode 100644
+index 0000000..a3b12a0
+--- /dev/null
++++ b/grsecurity/grsec_pax.c
 @@ -0,0 +1,36 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
@@ -54870,9 +58357,11 @@ diff -urNp linux-3.1.3/grsecurity/grsec_pax.c linux-3.1.3/grsecurity/grsec_pax.c
 +#endif
 +      return;
 +}
-diff -urNp linux-3.1.3/grsecurity/grsec_ptrace.c linux-3.1.3/grsecurity/grsec_ptrace.c
---- linux-3.1.3/grsecurity/grsec_ptrace.c      1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/grsecurity/grsec_ptrace.c      2011-11-16 18:40:31.000000000 -0500
+diff --git a/grsecurity/grsec_ptrace.c b/grsecurity/grsec_ptrace.c
+new file mode 100644
+index 0000000..472c1d6
+--- /dev/null
++++ b/grsecurity/grsec_ptrace.c
 @@ -0,0 +1,14 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
@@ -54888,9 +58377,11 @@ diff -urNp linux-3.1.3/grsecurity/grsec_ptrace.c linux-3.1.3/grsecurity/grsec_pt
 +#endif
 +      return;
 +}
-diff -urNp linux-3.1.3/grsecurity/grsec_sig.c linux-3.1.3/grsecurity/grsec_sig.c
---- linux-3.1.3/grsecurity/grsec_sig.c 1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/grsecurity/grsec_sig.c 2011-11-16 18:40:31.000000000 -0500
+diff --git a/grsecurity/grsec_sig.c b/grsecurity/grsec_sig.c
+new file mode 100644
+index 0000000..cf090b3
+--- /dev/null
++++ b/grsecurity/grsec_sig.c
 @@ -0,0 +1,206 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
@@ -55098,9 +58589,11 @@ diff -urNp linux-3.1.3/grsecurity/grsec_sig.c linux-3.1.3/grsecurity/grsec_sig.c
 +#endif
 +      return 0;
 +}
-diff -urNp linux-3.1.3/grsecurity/grsec_sock.c linux-3.1.3/grsecurity/grsec_sock.c
---- linux-3.1.3/grsecurity/grsec_sock.c        1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/grsecurity/grsec_sock.c        2011-11-16 18:40:31.000000000 -0500
+diff --git a/grsecurity/grsec_sock.c b/grsecurity/grsec_sock.c
+new file mode 100644
+index 0000000..4030d57
+--- /dev/null
++++ b/grsecurity/grsec_sock.c
 @@ -0,0 +1,244 @@
 +#include <linux/kernel.h>
 +#include <linux/module.h>
@@ -55346,9 +58839,11 @@ diff -urNp linux-3.1.3/grsecurity/grsec_sock.c linux-3.1.3/grsecurity/grsec_sock
 +#endif
 +      return 0;
 +}
-diff -urNp linux-3.1.3/grsecurity/grsec_sysctl.c linux-3.1.3/grsecurity/grsec_sysctl.c
---- linux-3.1.3/grsecurity/grsec_sysctl.c      1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/grsecurity/grsec_sysctl.c      2011-11-16 18:40:31.000000000 -0500
+diff --git a/grsecurity/grsec_sysctl.c b/grsecurity/grsec_sysctl.c
+new file mode 100644
+index 0000000..174668f
+--- /dev/null
++++ b/grsecurity/grsec_sysctl.c
 @@ -0,0 +1,433 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
@@ -55574,1427 +59069,353 @@ diff -urNp linux-3.1.3/grsecurity/grsec_sysctl.c linux-3.1.3/grsecurity/grsec_sy
 +      },
 +#endif
 +#ifdef CONFIG_GRKERNSEC_CHROOT_CAPS
-+      {
-+              .procname       = "chroot_caps",
-+              .data           = &grsec_enable_chroot_caps,
-+              .maxlen         = sizeof(int),
-+              .mode           = 0600,
-+              .proc_handler   = &proc_dointvec,
-+      },
-+#endif
-+#ifdef CONFIG_GRKERNSEC_CHROOT_SYSCTL
-+      {
-+              .procname       = "chroot_deny_sysctl",
-+              .data           = &grsec_enable_chroot_sysctl,
-+              .maxlen         = sizeof(int),
-+              .mode           = 0600,
-+              .proc_handler   = &proc_dointvec,
-+      },
-+#endif
-+#ifdef CONFIG_GRKERNSEC_TPE
-+      {
-+              .procname       = "tpe",
-+              .data           = &grsec_enable_tpe,
-+              .maxlen         = sizeof(int),
-+              .mode           = 0600,
-+              .proc_handler   = &proc_dointvec,
-+      },
-+      {
-+              .procname       = "tpe_gid",
-+              .data           = &grsec_tpe_gid,
-+              .maxlen         = sizeof(int),
-+              .mode           = 0600,
-+              .proc_handler   = &proc_dointvec,
-+      },
-+#endif
-+#ifdef CONFIG_GRKERNSEC_TPE_INVERT
-+      {
-+              .procname       = "tpe_invert",
-+              .data           = &grsec_enable_tpe_invert,
-+              .maxlen         = sizeof(int),
-+              .mode           = 0600,
-+              .proc_handler   = &proc_dointvec,
-+      },
-+#endif
-+#ifdef CONFIG_GRKERNSEC_TPE_ALL
-+      {
-+              .procname       = "tpe_restrict_all",
-+              .data           = &grsec_enable_tpe_all,
-+              .maxlen         = sizeof(int),
-+              .mode           = 0600,
-+              .proc_handler   = &proc_dointvec,
-+      },
-+#endif
-+#ifdef CONFIG_GRKERNSEC_SOCKET_ALL
-+      {
-+              .procname       = "socket_all",
-+              .data           = &grsec_enable_socket_all,
-+              .maxlen         = sizeof(int),
-+              .mode           = 0600,
-+              .proc_handler   = &proc_dointvec,
-+      },
-+      {
-+              .procname       = "socket_all_gid",
-+              .data           = &grsec_socket_all_gid,
-+              .maxlen         = sizeof(int),
-+              .mode           = 0600,
-+              .proc_handler   = &proc_dointvec,
-+      },
-+#endif
-+#ifdef CONFIG_GRKERNSEC_SOCKET_CLIENT
-+      {
-+              .procname       = "socket_client",
-+              .data           = &grsec_enable_socket_client,
-+              .maxlen         = sizeof(int),
-+              .mode           = 0600,
-+              .proc_handler   = &proc_dointvec,
-+      },
-+      {
-+              .procname       = "socket_client_gid",
-+              .data           = &grsec_socket_client_gid,
-+              .maxlen         = sizeof(int),
-+              .mode           = 0600,
-+              .proc_handler   = &proc_dointvec,
-+      },
-+#endif
-+#ifdef CONFIG_GRKERNSEC_SOCKET_SERVER
-+      {
-+              .procname       = "socket_server",
-+              .data           = &grsec_enable_socket_server,
-+              .maxlen         = sizeof(int),
-+              .mode           = 0600,
-+              .proc_handler   = &proc_dointvec,
-+      },
-+      {
-+              .procname       = "socket_server_gid",
-+              .data           = &grsec_socket_server_gid,
-+              .maxlen         = sizeof(int),
-+              .mode           = 0600,
-+              .proc_handler   = &proc_dointvec,
-+      },
-+#endif
-+#ifdef CONFIG_GRKERNSEC_AUDIT_GROUP
-+      {
-+              .procname       = "audit_group",
-+              .data           = &grsec_enable_group,
-+              .maxlen         = sizeof(int),
-+              .mode           = 0600,
-+              .proc_handler   = &proc_dointvec,
-+      },
-+      {
-+              .procname       = "audit_gid",
-+              .data           = &grsec_audit_gid,
-+              .maxlen         = sizeof(int),
-+              .mode           = 0600,
-+              .proc_handler   = &proc_dointvec,
-+      },
-+#endif
-+#ifdef CONFIG_GRKERNSEC_AUDIT_CHDIR
-+      {
-+              .procname       = "audit_chdir",
-+              .data           = &grsec_enable_chdir,
-+              .maxlen         = sizeof(int),
-+              .mode           = 0600,
-+              .proc_handler   = &proc_dointvec,
-+      },
-+#endif
-+#ifdef CONFIG_GRKERNSEC_AUDIT_MOUNT
-+      {
-+              .procname       = "audit_mount",
-+              .data           = &grsec_enable_mount,
-+              .maxlen         = sizeof(int),
-+              .mode           = 0600,
-+              .proc_handler   = &proc_dointvec,
-+      },
-+#endif
-+#ifdef CONFIG_GRKERNSEC_AUDIT_TEXTREL
-+      {
-+              .procname       = "audit_textrel",
-+              .data           = &grsec_enable_audit_textrel,
-+              .maxlen         = sizeof(int),
-+              .mode           = 0600,
-+              .proc_handler   = &proc_dointvec,
-+      },
-+#endif
-+#ifdef CONFIG_GRKERNSEC_DMESG
-+      {
-+              .procname       = "dmesg",
-+              .data           = &grsec_enable_dmesg,
-+              .maxlen         = sizeof(int),
-+              .mode           = 0600,
-+              .proc_handler   = &proc_dointvec,
-+      },
-+#endif
-+#ifdef CONFIG_GRKERNSEC_CHROOT_FINDTASK
-+      {
-+              .procname       = "chroot_findtask",
-+              .data           = &grsec_enable_chroot_findtask,
-+              .maxlen         = sizeof(int),
-+              .mode           = 0600,
-+              .proc_handler   = &proc_dointvec,
-+      },
-+#endif
-+#ifdef CONFIG_GRKERNSEC_RESLOG
-+      {
-+              .procname       = "resource_logging",
-+              .data           = &grsec_resource_logging,
-+              .maxlen         = sizeof(int),
-+              .mode           = 0600,
-+              .proc_handler   = &proc_dointvec,
-+      },
-+#endif
-+#ifdef CONFIG_GRKERNSEC_AUDIT_PTRACE
-+      {
-+              .procname       = "audit_ptrace",
-+              .data           = &grsec_enable_audit_ptrace,
-+              .maxlen         = sizeof(int),
-+              .mode           = 0600,
-+              .proc_handler   = &proc_dointvec,
-+      },
-+#endif
-+#ifdef CONFIG_GRKERNSEC_HARDEN_PTRACE
-+      {
-+              .procname       = "harden_ptrace",
-+              .data           = &grsec_enable_harden_ptrace,
-+              .maxlen         = sizeof(int),
-+              .mode           = 0600,
-+              .proc_handler   = &proc_dointvec,
-+      },
-+#endif
-+      {
-+              .procname       = "grsec_lock",
-+              .data           = &grsec_lock,
-+              .maxlen         = sizeof(int),
-+              .mode           = 0600,
-+              .proc_handler   = &proc_dointvec,
-+      },
-+#endif
-+#ifdef CONFIG_GRKERNSEC_ROFS
-+      {
-+              .procname       = "romount_protect",
-+              .data           = &grsec_enable_rofs,
-+              .maxlen         = sizeof(int),
-+              .mode           = 0600,
-+              .proc_handler   = &proc_dointvec_minmax,
-+              .extra1         = &one,
-+              .extra2         = &one,
-+      },
-+#endif
-+      { }
-+};
-+#endif
-diff -urNp linux-3.1.3/grsecurity/grsec_time.c linux-3.1.3/grsecurity/grsec_time.c
---- linux-3.1.3/grsecurity/grsec_time.c        1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/grsecurity/grsec_time.c        2011-11-16 18:40:31.000000000 -0500
-@@ -0,0 +1,16 @@
-+#include <linux/kernel.h>
-+#include <linux/sched.h>
-+#include <linux/grinternal.h>
-+#include <linux/module.h>
-+
-+void
-+gr_log_timechange(void)
-+{
-+#ifdef CONFIG_GRKERNSEC_TIME
-+      if (grsec_enable_time)
-+              gr_log_noargs(GR_DONT_AUDIT_GOOD, GR_TIME_MSG);
-+#endif
-+      return;
-+}
-+
-+EXPORT_SYMBOL(gr_log_timechange);
-diff -urNp linux-3.1.3/grsecurity/grsec_tpe.c linux-3.1.3/grsecurity/grsec_tpe.c
---- linux-3.1.3/grsecurity/grsec_tpe.c 1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/grsecurity/grsec_tpe.c 2011-11-16 18:40:31.000000000 -0500
-@@ -0,0 +1,39 @@
-+#include <linux/kernel.h>
-+#include <linux/sched.h>
-+#include <linux/file.h>
-+#include <linux/fs.h>
-+#include <linux/grinternal.h>
-+
-+extern int gr_acl_tpe_check(void);
-+
-+int
-+gr_tpe_allow(const struct file *file)
-+{
-+#ifdef CONFIG_GRKERNSEC
-+      struct inode *inode = file->f_path.dentry->d_parent->d_inode;
-+      const struct cred *cred = current_cred();
-+
-+      if (cred->uid && ((grsec_enable_tpe &&
-+#ifdef CONFIG_GRKERNSEC_TPE_INVERT
-+          ((grsec_enable_tpe_invert && !in_group_p(grsec_tpe_gid)) ||
-+           (!grsec_enable_tpe_invert && in_group_p(grsec_tpe_gid)))
-+#else
-+          in_group_p(grsec_tpe_gid)
-+#endif
-+          ) || gr_acl_tpe_check()) &&
-+          (inode->i_uid || (!inode->i_uid && ((inode->i_mode & S_IWGRP) ||
-+                                              (inode->i_mode & S_IWOTH))))) {
-+              gr_log_fs_generic(GR_DONT_AUDIT, GR_EXEC_TPE_MSG, file->f_path.dentry, file->f_path.mnt);
-+              return 0;
-+      }
-+#ifdef CONFIG_GRKERNSEC_TPE_ALL
-+      if (cred->uid && grsec_enable_tpe && grsec_enable_tpe_all &&
-+          ((inode->i_uid && (inode->i_uid != cred->uid)) ||
-+           (inode->i_mode & S_IWGRP) || (inode->i_mode & S_IWOTH))) {
-+              gr_log_fs_generic(GR_DONT_AUDIT, GR_EXEC_TPE_MSG, file->f_path.dentry, file->f_path.mnt);
-+              return 0;
-+      }
-+#endif
-+#endif
-+      return 1;
-+}
-diff -urNp linux-3.1.3/grsecurity/grsum.c linux-3.1.3/grsecurity/grsum.c
---- linux-3.1.3/grsecurity/grsum.c     1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/grsecurity/grsum.c     2011-11-16 18:40:31.000000000 -0500
-@@ -0,0 +1,61 @@
-+#include <linux/err.h>
-+#include <linux/kernel.h>
-+#include <linux/sched.h>
-+#include <linux/mm.h>
-+#include <linux/scatterlist.h>
-+#include <linux/crypto.h>
-+#include <linux/gracl.h>
-+
-+
-+#if !defined(CONFIG_CRYPTO) || defined(CONFIG_CRYPTO_MODULE) || !defined(CONFIG_CRYPTO_SHA256) || defined(CONFIG_CRYPTO_SHA256_MODULE)
-+#error "crypto and sha256 must be built into the kernel"
-+#endif
-+
-+int
-+chkpw(struct gr_arg *entry, unsigned char *salt, unsigned char *sum)
-+{
-+      char *p;
-+      struct crypto_hash *tfm;
-+      struct hash_desc desc;
-+      struct scatterlist sg;
-+      unsigned char temp_sum[GR_SHA_LEN];
-+      volatile int retval = 0;
-+      volatile int dummy = 0;
-+      unsigned int i;
-+
-+      sg_init_table(&sg, 1);
-+
-+      tfm = crypto_alloc_hash("sha256", 0, CRYPTO_ALG_ASYNC);
-+      if (IS_ERR(tfm)) {
-+              /* should never happen, since sha256 should be built in */
-+              return 1;
-+      }
-+
-+      desc.tfm = tfm;
-+      desc.flags = 0;
-+
-+      crypto_hash_init(&desc);
-+
-+      p = salt;
-+      sg_set_buf(&sg, p, GR_SALT_LEN);
-+      crypto_hash_update(&desc, &sg, sg.length);
-+
-+      p = entry->pw;
-+      sg_set_buf(&sg, p, strlen(p));
-+      
-+      crypto_hash_update(&desc, &sg, sg.length);
-+
-+      crypto_hash_final(&desc, temp_sum);
-+
-+      memset(entry->pw, 0, GR_PW_LEN);
-+
-+      for (i = 0; i < GR_SHA_LEN; i++)
-+              if (sum[i] != temp_sum[i])
-+                      retval = 1;
-+              else
-+                      dummy = 1;      // waste a cycle
-+
-+      crypto_free_hash(tfm);
-+
-+      return retval;
-+}
-diff -urNp linux-3.1.3/grsecurity/Kconfig linux-3.1.3/grsecurity/Kconfig
---- linux-3.1.3/grsecurity/Kconfig     1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/grsecurity/Kconfig     2011-11-16 18:40:31.000000000 -0500
-@@ -0,0 +1,1037 @@
-+#
-+# grecurity configuration
-+#
-+
-+menu "Grsecurity"
-+
-+config GRKERNSEC
-+      bool "Grsecurity"
-+      select CRYPTO
-+      select CRYPTO_SHA256
-+      help
-+        If you say Y here, you will be able to configure many features
-+        that will enhance the security of your system.  It is highly
-+        recommended that you say Y here and read through the help
-+        for each option so that you fully understand the features and
-+        can evaluate their usefulness for your machine.
-+
-+choice
-+      prompt "Security Level"
-+      depends on GRKERNSEC
-+      default GRKERNSEC_CUSTOM
-+
-+config GRKERNSEC_LOW
-+      bool "Low"
-+      select GRKERNSEC_LINK
-+      select GRKERNSEC_FIFO
-+      select GRKERNSEC_RANDNET
-+      select GRKERNSEC_DMESG
-+      select GRKERNSEC_CHROOT
-+      select GRKERNSEC_CHROOT_CHDIR
-+
-+      help
-+        If you choose this option, several of the grsecurity options will
-+        be enabled that will give you greater protection against a number
-+        of attacks, while assuring that none of your software will have any
-+        conflicts with the additional security measures.  If you run a lot
-+        of unusual software, or you are having problems with the higher
-+        security levels, you should say Y here.  With this option, the
-+        following features are enabled:
-+
-+        - Linking restrictions
-+        - FIFO restrictions
-+        - Restricted dmesg
-+        - Enforced chdir("/") on chroot
-+        - Runtime module disabling
-+
-+config GRKERNSEC_MEDIUM
-+      bool "Medium"
-+      select PAX
-+      select PAX_EI_PAX
-+      select PAX_PT_PAX_FLAGS
-+      select PAX_HAVE_ACL_FLAGS
-+      select GRKERNSEC_PROC_MEMMAP if (PAX_NOEXEC || PAX_ASLR)
-+      select GRKERNSEC_CHROOT
-+      select GRKERNSEC_CHROOT_SYSCTL
-+      select GRKERNSEC_LINK
-+      select GRKERNSEC_FIFO
-+      select GRKERNSEC_DMESG
-+      select GRKERNSEC_RANDNET
-+      select GRKERNSEC_FORKFAIL
-+      select GRKERNSEC_TIME
-+      select GRKERNSEC_SIGNAL
-+      select GRKERNSEC_CHROOT
-+      select GRKERNSEC_CHROOT_UNIX
-+      select GRKERNSEC_CHROOT_MOUNT
-+      select GRKERNSEC_CHROOT_PIVOT
-+      select GRKERNSEC_CHROOT_DOUBLE
-+      select GRKERNSEC_CHROOT_CHDIR
-+      select GRKERNSEC_CHROOT_MKNOD
-+      select GRKERNSEC_PROC
-+      select GRKERNSEC_PROC_USERGROUP
-+      select PAX_RANDUSTACK
-+      select PAX_ASLR
-+      select PAX_RANDMMAP
-+      select PAX_REFCOUNT if (X86 || SPARC64)
-+      select PAX_USERCOPY if ((X86 || SPARC || PPC || ARM) && (SLAB || SLUB || SLOB))
-+
-+      help
-+        If you say Y here, several features in addition to those included
-+        in the low additional security level will be enabled.  These
-+        features provide even more security to your system, though in rare
-+        cases they may be incompatible with very old or poorly written
-+        software.  If you enable this option, make sure that your auth
-+        service (identd) is running as gid 1001.  With this option, 
-+        the following features (in addition to those provided in the 
-+        low additional security level) will be enabled:
-+
-+        - Failed fork logging
-+        - Time change logging
-+        - Signal logging
-+        - Deny mounts in chroot
-+        - Deny double chrooting
-+        - Deny sysctl writes in chroot
-+        - Deny mknod in chroot
-+        - Deny access to abstract AF_UNIX sockets out of chroot
-+        - Deny pivot_root in chroot
-+        - Denied reads/writes of /dev/kmem, /dev/mem, and /dev/port
-+        - /proc restrictions with special GID set to 10 (usually wheel)
-+        - Address Space Layout Randomization (ASLR)
-+        - Prevent exploitation of most refcount overflows
-+        - Bounds checking of copying between the kernel and userland
-+
-+config GRKERNSEC_HIGH
-+      bool "High"
-+      select GRKERNSEC_LINK
-+      select GRKERNSEC_FIFO
-+      select GRKERNSEC_DMESG
-+      select GRKERNSEC_FORKFAIL
-+      select GRKERNSEC_TIME
-+      select GRKERNSEC_SIGNAL
-+      select GRKERNSEC_CHROOT
-+      select GRKERNSEC_CHROOT_SHMAT
-+      select GRKERNSEC_CHROOT_UNIX
-+      select GRKERNSEC_CHROOT_MOUNT
-+      select GRKERNSEC_CHROOT_FCHDIR
-+      select GRKERNSEC_CHROOT_PIVOT
-+      select GRKERNSEC_CHROOT_DOUBLE
-+      select GRKERNSEC_CHROOT_CHDIR
-+      select GRKERNSEC_CHROOT_MKNOD
-+      select GRKERNSEC_CHROOT_CAPS
-+      select GRKERNSEC_CHROOT_SYSCTL
-+      select GRKERNSEC_CHROOT_FINDTASK
-+      select GRKERNSEC_SYSFS_RESTRICT
-+      select GRKERNSEC_PROC
-+      select GRKERNSEC_PROC_MEMMAP if (PAX_NOEXEC || PAX_ASLR)
-+      select GRKERNSEC_HIDESYM
-+      select GRKERNSEC_BRUTE
-+      select GRKERNSEC_PROC_USERGROUP
-+      select GRKERNSEC_KMEM
-+      select GRKERNSEC_RESLOG
-+      select GRKERNSEC_RANDNET
-+      select GRKERNSEC_PROC_ADD
-+      select GRKERNSEC_CHROOT_CHMOD
-+      select GRKERNSEC_CHROOT_NICE
-+      select GRKERNSEC_AUDIT_MOUNT
-+      select GRKERNSEC_MODHARDEN if (MODULES)
-+      select GRKERNSEC_HARDEN_PTRACE
-+      select GRKERNSEC_VM86 if (X86_32)
-+      select GRKERNSEC_KERN_LOCKOUT if (X86 || ARM || PPC || SPARC)
-+      select PAX
-+      select PAX_RANDUSTACK
-+      select PAX_ASLR
-+      select PAX_RANDMMAP
-+      select PAX_NOEXEC
-+      select PAX_MPROTECT
-+      select PAX_EI_PAX
-+      select PAX_PT_PAX_FLAGS
-+      select PAX_HAVE_ACL_FLAGS
-+      select PAX_KERNEXEC if ((PPC || X86) && (!X86_32 || X86_WP_WORKS_OK) && !XEN)
-+      select PAX_MEMORY_UDEREF if (X86 && !XEN)
-+      select PAX_RANDKSTACK if (X86_TSC && X86)
-+      select PAX_SEGMEXEC if (X86_32)
-+      select PAX_PAGEEXEC
-+      select PAX_EMUPLT if (ALPHA || PARISC || SPARC)
-+      select PAX_EMUTRAMP if (PARISC)
-+      select PAX_EMUSIGRT if (PARISC)
-+      select PAX_ETEXECRELOCS if (ALPHA || IA64 || PARISC)
-+      select PAX_ELFRELOCS if (PAX_ETEXECRELOCS || (IA64 || PPC || X86))
-+      select PAX_REFCOUNT if (X86 || SPARC64)
-+      select PAX_USERCOPY if ((X86 || PPC || SPARC || ARM) && (SLAB || SLUB || SLOB))
-+      help
-+        If you say Y here, many of the features of grsecurity will be
-+        enabled, which will protect you against many kinds of attacks
-+        against your system.  The heightened security comes at a cost
-+        of an increased chance of incompatibilities with rare software
-+        on your machine.  Since this security level enables PaX, you should
-+        view <http://pax.grsecurity.net> and read about the PaX
-+        project.  While you are there, download chpax and run it on
-+        binaries that cause problems with PaX.  Also remember that
-+        since the /proc restrictions are enabled, you must run your
-+        identd as gid 1001.  This security level enables the following 
-+        features in addition to those listed in the low and medium 
-+        security levels:
-+
-+        - Additional /proc restrictions
-+        - Chmod restrictions in chroot
-+        - No signals, ptrace, or viewing of processes outside of chroot
-+        - Capability restrictions in chroot
-+        - Deny fchdir out of chroot
-+        - Priority restrictions in chroot
-+        - Segmentation-based implementation of PaX
-+        - Mprotect restrictions
-+        - Removal of addresses from /proc/<pid>/[smaps|maps|stat]
-+        - Kernel stack randomization
-+        - Mount/unmount/remount logging
-+        - Kernel symbol hiding
-+        - Hardening of module auto-loading
-+        - Ptrace restrictions
-+        - Restricted vm86 mode
-+        - Restricted sysfs/debugfs
-+        - Active kernel exploit response
-+
-+config GRKERNSEC_CUSTOM
-+      bool "Custom"
-+      help
-+        If you say Y here, you will be able to configure every grsecurity
-+        option, which allows you to enable many more features that aren't
-+        covered in the basic security levels.  These additional features
-+        include TPE, socket restrictions, and the sysctl system for
-+        grsecurity.  It is advised that you read through the help for
-+        each option to determine its usefulness in your situation.
-+
-+endchoice
-+
-+menu "Address Space Protection"
-+depends on GRKERNSEC
-+
-+config GRKERNSEC_KMEM
-+      bool "Deny reading/writing to /dev/kmem, /dev/mem, and /dev/port"
-+      select STRICT_DEVMEM if (X86 || ARM || TILE || S390)
-+      help
-+        If you say Y here, /dev/kmem and /dev/mem won't be allowed to
-+        be written to or read from to modify or leak the contents of the running
-+        kernel.  /dev/port will also not be allowed to be opened. If you have module
-+        support disabled, enabling this will close up four ways that are
-+        currently used  to insert malicious code into the running kernel.
-+        Even with all these features enabled, we still highly recommend that
-+        you use the RBAC system, as it is still possible for an attacker to
-+        modify the running kernel through privileged I/O granted by ioperm/iopl.
-+        If you are not using XFree86, you may be able to stop this additional
-+        case by enabling the 'Disable privileged I/O' option. Though nothing
-+        legitimately writes to /dev/kmem, XFree86 does need to write to /dev/mem,
-+        but only to video memory, which is the only writing we allow in this
-+        case.  If /dev/kmem or /dev/mem are mmaped without PROT_WRITE, they will
-+        not be allowed to mprotect it with PROT_WRITE later.
-+        It is highly recommended that you say Y here if you meet all the
-+        conditions above.
-+
-+config GRKERNSEC_VM86
-+      bool "Restrict VM86 mode"
-+      depends on X86_32
-+
-+      help
-+        If you say Y here, only processes with CAP_SYS_RAWIO will be able to
-+        make use of a special execution mode on 32bit x86 processors called
-+        Virtual 8086 (VM86) mode.  XFree86 may need vm86 mode for certain
-+        video cards and will still work with this option enabled.  The purpose
-+        of the option is to prevent exploitation of emulation errors in
-+        virtualization of vm86 mode like the one discovered in VMWare in 2009.
-+        Nearly all users should be able to enable this option.
-+
-+config GRKERNSEC_IO
-+      bool "Disable privileged I/O"
-+      depends on X86
-+      select RTC_CLASS
-+      select RTC_INTF_DEV
-+      select RTC_DRV_CMOS
-+
-+      help
-+        If you say Y here, all ioperm and iopl calls will return an error.
-+        Ioperm and iopl can be used to modify the running kernel.
-+        Unfortunately, some programs need this access to operate properly,
-+        the most notable of which are XFree86 and hwclock.  hwclock can be
-+        remedied by having RTC support in the kernel, so real-time 
-+        clock support is enabled if this option is enabled, to ensure 
-+        that hwclock operates correctly.  XFree86 still will not 
-+        operate correctly with this option enabled, so DO NOT CHOOSE Y 
-+        IF YOU USE XFree86.  If you use XFree86 and you still want to 
-+        protect your kernel against modification, use the RBAC system.
-+
-+config GRKERNSEC_PROC_MEMMAP
-+      bool "Remove addresses from /proc/<pid>/[smaps|maps|stat]"
-+      default y if (PAX_NOEXEC || PAX_ASLR)
-+      depends on PAX_NOEXEC || PAX_ASLR
-+      help
-+        If you say Y here, the /proc/<pid>/maps and /proc/<pid>/stat files will
-+        give no information about the addresses of its mappings if
-+        PaX features that rely on random addresses are enabled on the task.
-+        If you use PaX it is greatly recommended that you say Y here as it
-+        closes up a hole that makes the full ASLR useless for suid
-+        binaries.
-+
-+config GRKERNSEC_BRUTE
-+      bool "Deter exploit bruteforcing"
-+      help
-+        If you say Y here, attempts to bruteforce exploits against forking
-+        daemons such as apache or sshd, as well as against suid/sgid binaries
-+        will be deterred.  When a child of a forking daemon is killed by PaX
-+        or crashes due to an illegal instruction or other suspicious signal,
-+        the parent process will be delayed 30 seconds upon every subsequent
-+        fork until the administrator is able to assess the situation and
-+        restart the daemon.
-+        In the suid/sgid case, the attempt is logged, the user has all their
-+        processes terminated, and they are prevented from executing any further
-+        processes for 15 minutes.
-+        It is recommended that you also enable signal logging in the auditing
-+        section so that logs are generated when a process triggers a suspicious
-+        signal.
-+        If the sysctl option is enabled, a sysctl option with name
-+        "deter_bruteforce" is created.
-+
-+
-+config GRKERNSEC_MODHARDEN
-+      bool "Harden module auto-loading"
-+      depends on MODULES
-+      help
-+        If you say Y here, module auto-loading in response to use of some
-+        feature implemented by an unloaded module will be restricted to
-+        root users.  Enabling this option helps defend against attacks 
-+        by unprivileged users who abuse the auto-loading behavior to 
-+        cause a vulnerable module to load that is then exploited.
-+
-+        If this option prevents a legitimate use of auto-loading for a 
-+        non-root user, the administrator can execute modprobe manually 
-+        with the exact name of the module mentioned in the alert log.
-+        Alternatively, the administrator can add the module to the list
-+        of modules loaded at boot by modifying init scripts.
-+
-+        Modification of init scripts will most likely be needed on 
-+        Ubuntu servers with encrypted home directory support enabled,
-+        as the first non-root user logging in will cause the ecb(aes),
-+        ecb(aes)-all, cbc(aes), and cbc(aes)-all  modules to be loaded.
-+
-+config GRKERNSEC_HIDESYM
-+      bool "Hide kernel symbols"
-+      help
-+        If you say Y here, getting information on loaded modules, and
-+        displaying all kernel symbols through a syscall will be restricted
-+        to users with CAP_SYS_MODULE.  For software compatibility reasons,
-+        /proc/kallsyms will be restricted to the root user.  The RBAC
-+        system can hide that entry even from root.
-+
-+        This option also prevents leaking of kernel addresses through
-+        several /proc entries.
-+
-+        Note that this option is only effective provided the following
-+        conditions are met:
-+        1) The kernel using grsecurity is not precompiled by some distribution
-+        2) You have also enabled GRKERNSEC_DMESG
-+        3) You are using the RBAC system and hiding other files such as your
-+           kernel image and System.map.  Alternatively, enabling this option
-+           causes the permissions on /boot, /lib/modules, and the kernel
-+           source directory to change at compile time to prevent 
-+           reading by non-root users.
-+        If the above conditions are met, this option will aid in providing a
-+        useful protection against local kernel exploitation of overflows
-+        and arbitrary read/write vulnerabilities.
-+
-+config GRKERNSEC_KERN_LOCKOUT
-+      bool "Active kernel exploit response"
-+      depends on X86 || ARM || PPC || SPARC
-+      help
-+        If you say Y here, when a PaX alert is triggered due to suspicious
-+        activity in the kernel (from KERNEXEC/UDEREF/USERCOPY)
-+        or an OOPs occurs due to bad memory accesses, instead of just
-+        terminating the offending process (and potentially allowing
-+        a subsequent exploit from the same user), we will take one of two
-+        actions:
-+         If the user was root, we will panic the system
-+         If the user was non-root, we will log the attempt, terminate
-+         all processes owned by the user, then prevent them from creating
-+         any new processes until the system is restarted
-+        This deters repeated kernel exploitation/bruteforcing attempts
-+        and is useful for later forensics.
-+
-+endmenu
-+menu "Role Based Access Control Options"
-+depends on GRKERNSEC
-+
-+config GRKERNSEC_RBAC_DEBUG
-+      bool
-+
-+config GRKERNSEC_NO_RBAC
-+      bool "Disable RBAC system"
-+      help
-+        If you say Y here, the /dev/grsec device will be removed from the kernel,
-+        preventing the RBAC system from being enabled.  You should only say Y
-+        here if you have no intention of using the RBAC system, so as to prevent
-+        an attacker with root access from misusing the RBAC system to hide files
-+        and processes when loadable module support and /dev/[k]mem have been
-+        locked down.
-+
-+config GRKERNSEC_ACL_HIDEKERN
-+      bool "Hide kernel processes"
-+      help
-+        If you say Y here, all kernel threads will be hidden to all
-+        processes but those whose subject has the "view hidden processes"
-+        flag.
-+
-+config GRKERNSEC_ACL_MAXTRIES
-+      int "Maximum tries before password lockout"
-+      default 3
-+      help
-+        This option enforces the maximum number of times a user can attempt
-+        to authorize themselves with the grsecurity RBAC system before being
-+        denied the ability to attempt authorization again for a specified time.
-+        The lower the number, the harder it will be to brute-force a password.
-+
-+config GRKERNSEC_ACL_TIMEOUT
-+      int "Time to wait after max password tries, in seconds"
-+      default 30
-+      help
-+        This option specifies the time the user must wait after attempting to
-+        authorize to the RBAC system with the maximum number of invalid
-+        passwords.  The higher the number, the harder it will be to brute-force
-+        a password.
-+
-+endmenu
-+menu "Filesystem Protections"
-+depends on GRKERNSEC
-+
-+config GRKERNSEC_PROC
-+      bool "Proc restrictions"
-+      help
-+        If you say Y here, the permissions of the /proc filesystem
-+        will be altered to enhance system security and privacy.  You MUST
-+        choose either a user only restriction or a user and group restriction.
-+        Depending upon the option you choose, you can either restrict users to
-+        see only the processes they themselves run, or choose a group that can
-+        view all processes and files normally restricted to root if you choose
-+        the "restrict to user only" option.  NOTE: If you're running identd as
-+        a non-root user, you will have to run it as the group you specify here.
-+
-+config GRKERNSEC_PROC_USER
-+      bool "Restrict /proc to user only"
-+      depends on GRKERNSEC_PROC
-+      help
-+        If you say Y here, non-root users will only be able to view their own
-+        processes, and restricts them from viewing network-related information,
-+        and viewing kernel symbol and module information.
-+
-+config GRKERNSEC_PROC_USERGROUP
-+      bool "Allow special group"
-+      depends on GRKERNSEC_PROC && !GRKERNSEC_PROC_USER
-+      help
-+        If you say Y here, you will be able to select a group that will be
-+          able to view all processes and network-related information.  If you've
-+          enabled GRKERNSEC_HIDESYM, kernel and symbol information may still
-+          remain hidden.  This option is useful if you want to run identd as
-+          a non-root user.
-+
-+config GRKERNSEC_PROC_GID
-+      int "GID for special group"
-+      depends on GRKERNSEC_PROC_USERGROUP
-+      default 1001
-+
-+config GRKERNSEC_PROC_ADD
-+      bool "Additional restrictions"
-+      depends on GRKERNSEC_PROC_USER || GRKERNSEC_PROC_USERGROUP
-+      help
-+        If you say Y here, additional restrictions will be placed on
-+        /proc that keep normal users from viewing device information and 
-+        slabinfo information that could be useful for exploits.
-+
-+config GRKERNSEC_LINK
-+      bool "Linking restrictions"
-+      help
-+        If you say Y here, /tmp race exploits will be prevented, since users
-+        will no longer be able to follow symlinks owned by other users in
-+        world-writable +t directories (e.g. /tmp), unless the owner of the
-+        symlink is the owner of the directory. users will also not be
-+        able to hardlink to files they do not own.  If the sysctl option is
-+        enabled, a sysctl option with name "linking_restrictions" is created.
-+
-+config GRKERNSEC_FIFO
-+      bool "FIFO restrictions"
-+      help
-+        If you say Y here, users will not be able to write to FIFOs they don't
-+        own in world-writable +t directories (e.g. /tmp), unless the owner of
-+        the FIFO is the same owner of the directory it's held in.  If the sysctl
-+        option is enabled, a sysctl option with name "fifo_restrictions" is
-+        created.
-+
-+config GRKERNSEC_SYSFS_RESTRICT
-+      bool "Sysfs/debugfs restriction"
-+      depends on SYSFS
-+      help
-+        If you say Y here, sysfs (the pseudo-filesystem mounted at /sys) and
-+        any filesystem normally mounted under it (e.g. debugfs) will only
-+        be accessible by root.  These filesystems generally provide access
-+        to hardware and debug information that isn't appropriate for unprivileged
-+        users of the system.  Sysfs and debugfs have also become a large source
-+        of new vulnerabilities, ranging from infoleaks to local compromise.
-+        There has been very little oversight with an eye toward security involved
-+        in adding new exporters of information to these filesystems, so their
-+        use is discouraged.
-+        This option is equivalent to a chmod 0700 of the mount paths.
-+
-+config GRKERNSEC_ROFS
-+      bool "Runtime read-only mount protection"
-+      help
-+        If you say Y here, a sysctl option with name "romount_protect" will
-+        be created.  By setting this option to 1 at runtime, filesystems
-+        will be protected in the following ways:
-+        * No new writable mounts will be allowed
-+        * Existing read-only mounts won't be able to be remounted read/write
-+        * Write operations will be denied on all block devices
-+        This option acts independently of grsec_lock: once it is set to 1,
-+        it cannot be turned off.  Therefore, please be mindful of the resulting
-+        behavior if this option is enabled in an init script on a read-only
-+        filesystem.  This feature is mainly intended for secure embedded systems.
-+
-+config GRKERNSEC_CHROOT
-+      bool "Chroot jail restrictions"
-+      help
-+        If you say Y here, you will be able to choose several options that will
-+        make breaking out of a chrooted jail much more difficult.  If you
-+        encounter no software incompatibilities with the following options, it
-+        is recommended that you enable each one.
-+
-+config GRKERNSEC_CHROOT_MOUNT
-+      bool "Deny mounts"
-+      depends on GRKERNSEC_CHROOT
-+      help
-+        If you say Y here, processes inside a chroot will not be able to
-+        mount or remount filesystems.  If the sysctl option is enabled, a
-+        sysctl option with name "chroot_deny_mount" is created.
-+
-+config GRKERNSEC_CHROOT_DOUBLE
-+      bool "Deny double-chroots"
-+      depends on GRKERNSEC_CHROOT
-+      help
-+        If you say Y here, processes inside a chroot will not be able to chroot
-+        again outside the chroot.  This is a widely used method of breaking
-+        out of a chroot jail and should not be allowed.  If the sysctl 
-+        option is enabled, a sysctl option with name 
-+        "chroot_deny_chroot" is created.
-+
-+config GRKERNSEC_CHROOT_PIVOT
-+      bool "Deny pivot_root in chroot"
-+      depends on GRKERNSEC_CHROOT
-+      help
-+        If you say Y here, processes inside a chroot will not be able to use
-+        a function called pivot_root() that was introduced in Linux 2.3.41.  It
-+        works similar to chroot in that it changes the root filesystem.  This
-+        function could be misused in a chrooted process to attempt to break out
-+        of the chroot, and therefore should not be allowed.  If the sysctl
-+        option is enabled, a sysctl option with name "chroot_deny_pivot" is
-+        created.
-+
-+config GRKERNSEC_CHROOT_CHDIR
-+      bool "Enforce chdir(\"/\") on all chroots"
-+      depends on GRKERNSEC_CHROOT
-+      help
-+        If you say Y here, the current working directory of all newly-chrooted
-+        applications will be set to the the root directory of the chroot.
-+        The man page on chroot(2) states:
-+        Note that this call does not change  the  current  working
-+        directory,  so  that `.' can be outside the tree rooted at
-+        `/'.  In particular, the  super-user  can  escape  from  a
-+        `chroot jail' by doing `mkdir foo; chroot foo; cd ..'.
-+
-+        It is recommended that you say Y here, since it's not known to break
-+        any software.  If the sysctl option is enabled, a sysctl option with
-+        name "chroot_enforce_chdir" is created.
-+
-+config GRKERNSEC_CHROOT_CHMOD
-+      bool "Deny (f)chmod +s"
-+      depends on GRKERNSEC_CHROOT
-+      help
-+        If you say Y here, processes inside a chroot will not be able to chmod
-+        or fchmod files to make them have suid or sgid bits.  This protects
-+        against another published method of breaking a chroot.  If the sysctl
-+        option is enabled, a sysctl option with name "chroot_deny_chmod" is
-+        created.
-+
-+config GRKERNSEC_CHROOT_FCHDIR
-+      bool "Deny fchdir out of chroot"
-+      depends on GRKERNSEC_CHROOT
-+      help
-+        If you say Y here, a well-known method of breaking chroots by fchdir'ing
-+        to a file descriptor of the chrooting process that points to a directory
-+        outside the filesystem will be stopped.  If the sysctl option
-+        is enabled, a sysctl option with name "chroot_deny_fchdir" is created.
-+
-+config GRKERNSEC_CHROOT_MKNOD
-+      bool "Deny mknod"
-+      depends on GRKERNSEC_CHROOT
-+      help
-+        If you say Y here, processes inside a chroot will not be allowed to
-+        mknod.  The problem with using mknod inside a chroot is that it
-+        would allow an attacker to create a device entry that is the same
-+        as one on the physical root of your system, which could range from
-+        anything from the console device to a device for your harddrive (which
-+        they could then use to wipe the drive or steal data).  It is recommended
-+        that you say Y here, unless you run into software incompatibilities.
-+        If the sysctl option is enabled, a sysctl option with name
-+        "chroot_deny_mknod" is created.
-+
-+config GRKERNSEC_CHROOT_SHMAT
-+      bool "Deny shmat() out of chroot"
-+      depends on GRKERNSEC_CHROOT
-+      help
-+        If you say Y here, processes inside a chroot will not be able to attach
-+        to shared memory segments that were created outside of the chroot jail.
-+        It is recommended that you say Y here.  If the sysctl option is enabled,
-+        a sysctl option with name "chroot_deny_shmat" is created.
-+
-+config GRKERNSEC_CHROOT_UNIX
-+      bool "Deny access to abstract AF_UNIX sockets out of chroot"
-+      depends on GRKERNSEC_CHROOT
-+      help
-+        If you say Y here, processes inside a chroot will not be able to
-+        connect to abstract (meaning not belonging to a filesystem) Unix
-+        domain sockets that were bound outside of a chroot.  It is recommended
-+        that you say Y here.  If the sysctl option is enabled, a sysctl option
-+        with name "chroot_deny_unix" is created.
-+
-+config GRKERNSEC_CHROOT_FINDTASK
-+      bool "Protect outside processes"
-+      depends on GRKERNSEC_CHROOT
-+      help
-+        If you say Y here, processes inside a chroot will not be able to
-+        kill, send signals with fcntl, ptrace, capget, getpgid, setpgid, 
-+        getsid, or view any process outside of the chroot.  If the sysctl
-+        option is enabled, a sysctl option with name "chroot_findtask" is
-+        created.
-+
-+config GRKERNSEC_CHROOT_NICE
-+      bool "Restrict priority changes"
-+      depends on GRKERNSEC_CHROOT
-+      help
-+        If you say Y here, processes inside a chroot will not be able to raise
-+        the priority of processes in the chroot, or alter the priority of
-+        processes outside the chroot.  This provides more security than simply
-+        removing CAP_SYS_NICE from the process' capability set.  If the
-+        sysctl option is enabled, a sysctl option with name "chroot_restrict_nice"
-+        is created.
-+
-+config GRKERNSEC_CHROOT_SYSCTL
-+      bool "Deny sysctl writes"
-+      depends on GRKERNSEC_CHROOT
-+      help
-+        If you say Y here, an attacker in a chroot will not be able to
-+        write to sysctl entries, either by sysctl(2) or through a /proc
-+        interface.  It is strongly recommended that you say Y here. If the
-+        sysctl option is enabled, a sysctl option with name
-+        "chroot_deny_sysctl" is created.
-+
-+config GRKERNSEC_CHROOT_CAPS
-+      bool "Capability restrictions"
-+      depends on GRKERNSEC_CHROOT
-+      help
-+        If you say Y here, the capabilities on all processes within a
-+        chroot jail will be lowered to stop module insertion, raw i/o,
-+        system and net admin tasks, rebooting the system, modifying immutable
-+        files, modifying IPC owned by another, and changing the system time.
-+        This is left an option because it can break some apps.  Disable this
-+        if your chrooted apps are having problems performing those kinds of
-+        tasks.  If the sysctl option is enabled, a sysctl option with
-+        name "chroot_caps" is created.
-+
-+endmenu
-+menu "Kernel Auditing"
-+depends on GRKERNSEC
-+
-+config GRKERNSEC_AUDIT_GROUP
-+      bool "Single group for auditing"
-+      help
-+        If you say Y here, the exec, chdir, and (un)mount logging features
-+        will only operate on a group you specify.  This option is recommended
-+        if you only want to watch certain users instead of having a large
-+        amount of logs from the entire system.  If the sysctl option is enabled,
-+        a sysctl option with name "audit_group" is created.
-+
-+config GRKERNSEC_AUDIT_GID
-+      int "GID for auditing"
-+      depends on GRKERNSEC_AUDIT_GROUP
-+      default 1007
-+
-+config GRKERNSEC_EXECLOG
-+      bool "Exec logging"
-+      help
-+        If you say Y here, all execve() calls will be logged (since the
-+        other exec*() calls are frontends to execve(), all execution
-+        will be logged).  Useful for shell-servers that like to keep track
-+        of their users.  If the sysctl option is enabled, a sysctl option with
-+        name "exec_logging" is created.
-+        WARNING: This option when enabled will produce a LOT of logs, especially
-+        on an active system.
-+
-+config GRKERNSEC_RESLOG
-+      bool "Resource logging"
-+      help
-+        If you say Y here, all attempts to overstep resource limits will
-+        be logged with the resource name, the requested size, and the current
-+        limit.  It is highly recommended that you say Y here.  If the sysctl
-+        option is enabled, a sysctl option with name "resource_logging" is
-+        created.  If the RBAC system is enabled, the sysctl value is ignored.
-+
-+config GRKERNSEC_CHROOT_EXECLOG
-+      bool "Log execs within chroot"
-+      help
-+        If you say Y here, all executions inside a chroot jail will be logged
-+        to syslog.  This can cause a large amount of logs if certain
-+        applications (eg. djb's daemontools) are installed on the system, and
-+        is therefore left as an option.  If the sysctl option is enabled, a
-+        sysctl option with name "chroot_execlog" is created.
-+
-+config GRKERNSEC_AUDIT_PTRACE
-+      bool "Ptrace logging"
-+      help
-+        If you say Y here, all attempts to attach to a process via ptrace
-+        will be logged.  If the sysctl option is enabled, a sysctl option
-+        with name "audit_ptrace" is created.
-+
-+config GRKERNSEC_AUDIT_CHDIR
-+      bool "Chdir logging"
-+      help
-+        If you say Y here, all chdir() calls will be logged.  If the sysctl
-+        option is enabled, a sysctl option with name "audit_chdir" is created.
-+
-+config GRKERNSEC_AUDIT_MOUNT
-+      bool "(Un)Mount logging"
-+      help
-+        If you say Y here, all mounts and unmounts will be logged.  If the
-+        sysctl option is enabled, a sysctl option with name "audit_mount" is
-+        created.
-+
-+config GRKERNSEC_SIGNAL
-+      bool "Signal logging"
-+      help
-+        If you say Y here, certain important signals will be logged, such as
-+        SIGSEGV, which will as a result inform you of when a error in a program
-+        occurred, which in some cases could mean a possible exploit attempt.
-+        If the sysctl option is enabled, a sysctl option with name
-+        "signal_logging" is created.
-+
-+config GRKERNSEC_FORKFAIL
-+      bool "Fork failure logging"
-+      help
-+        If you say Y here, all failed fork() attempts will be logged.
-+        This could suggest a fork bomb, or someone attempting to overstep
-+        their process limit.  If the sysctl option is enabled, a sysctl option
-+        with name "forkfail_logging" is created.
-+
-+config GRKERNSEC_TIME
-+      bool "Time change logging"
-+      help
-+        If you say Y here, any changes of the system clock will be logged.
-+        If the sysctl option is enabled, a sysctl option with name
-+        "timechange_logging" is created.
-+
-+config GRKERNSEC_PROC_IPADDR
-+      bool "/proc/<pid>/ipaddr support"
-+      help
-+        If you say Y here, a new entry will be added to each /proc/<pid>
-+        directory that contains the IP address of the person using the task.
-+        The IP is carried across local TCP and AF_UNIX stream sockets.
-+        This information can be useful for IDS/IPSes to perform remote response
-+        to a local attack.  The entry is readable by only the owner of the
-+        process (and root if he has CAP_DAC_OVERRIDE, which can be removed via
-+        the RBAC system), and thus does not create privacy concerns.
-+
-+config GRKERNSEC_RWXMAP_LOG
-+      bool 'Denied RWX mmap/mprotect logging'
-+      depends on PAX_MPROTECT && !PAX_EMUPLT && !PAX_EMUSIGRT
-+      help
-+        If you say Y here, calls to mmap() and mprotect() with explicit
-+        usage of PROT_WRITE and PROT_EXEC together will be logged when
-+        denied by the PAX_MPROTECT feature.  If the sysctl option is
-+        enabled, a sysctl option with name "rwxmap_logging" is created.
-+
-+config GRKERNSEC_AUDIT_TEXTREL
-+      bool 'ELF text relocations logging (READ HELP)'
-+      depends on PAX_MPROTECT
-+      help
-+        If you say Y here, text relocations will be logged with the filename
-+        of the offending library or binary.  The purpose of the feature is
-+        to help Linux distribution developers get rid of libraries and
-+        binaries that need text relocations which hinder the future progress
-+        of PaX.  Only Linux distribution developers should say Y here, and
-+        never on a production machine, as this option creates an information
-+        leak that could aid an attacker in defeating the randomization of
-+        a single memory region.  If the sysctl option is enabled, a sysctl
-+        option with name "audit_textrel" is created.
-+
-+endmenu
-+
-+menu "Executable Protections"
-+depends on GRKERNSEC
-+
-+config GRKERNSEC_DMESG
-+      bool "Dmesg(8) restriction"
-+      help
-+        If you say Y here, non-root users will not be able to use dmesg(8)
-+        to view up to the last 4kb of messages in the kernel's log buffer.
-+        The kernel's log buffer often contains kernel addresses and other
-+        identifying information useful to an attacker in fingerprinting a
-+        system for a targeted exploit.
-+        If the sysctl option is enabled, a sysctl option with name "dmesg" is
-+        created.
-+
-+config GRKERNSEC_HARDEN_PTRACE
-+      bool "Deter ptrace-based process snooping"
-+      help
-+        If you say Y here, TTY sniffers and other malicious monitoring
-+        programs implemented through ptrace will be defeated.  If you
-+        have been using the RBAC system, this option has already been
-+        enabled for several years for all users, with the ability to make
-+        fine-grained exceptions.
-+
-+        This option only affects the ability of non-root users to ptrace
-+        processes that are not a descendent of the ptracing process.
-+        This means that strace ./binary and gdb ./binary will still work,
-+        but attaching to arbitrary processes will not.  If the sysctl
-+        option is enabled, a sysctl option with name "harden_ptrace" is
-+        created.
-+
-+config GRKERNSEC_TPE
-+      bool "Trusted Path Execution (TPE)"
-+      help
-+        If you say Y here, you will be able to choose a gid to add to the
-+        supplementary groups of users you want to mark as "untrusted."
-+        These users will not be able to execute any files that are not in
-+        root-owned directories writable only by root.  If the sysctl option
-+        is enabled, a sysctl option with name "tpe" is created.
-+
-+config GRKERNSEC_TPE_ALL
-+      bool "Partially restrict all non-root users"
-+      depends on GRKERNSEC_TPE
-+      help
-+        If you say Y here, all non-root users will be covered under
-+        a weaker TPE restriction.  This is separate from, and in addition to,
-+        the main TPE options that you have selected elsewhere.  Thus, if a
-+        "trusted" GID is chosen, this restriction applies to even that GID.
-+        Under this restriction, all non-root users will only be allowed to
-+        execute files in directories they own that are not group or
-+        world-writable, or in directories owned by root and writable only by
-+        root.  If the sysctl option is enabled, a sysctl option with name
-+        "tpe_restrict_all" is created.
-+
-+config GRKERNSEC_TPE_INVERT
-+      bool "Invert GID option"
-+      depends on GRKERNSEC_TPE
-+      help
-+        If you say Y here, the group you specify in the TPE configuration will
-+        decide what group TPE restrictions will be *disabled* for.  This
-+        option is useful if you want TPE restrictions to be applied to most
-+        users on the system.  If the sysctl option is enabled, a sysctl option
-+        with name "tpe_invert" is created.  Unlike other sysctl options, this
-+        entry will default to on for backward-compatibility.
-+
-+config GRKERNSEC_TPE_GID
-+      int "GID for untrusted users"
-+      depends on GRKERNSEC_TPE && !GRKERNSEC_TPE_INVERT
-+      default 1005
-+      help
-+        Setting this GID determines what group TPE restrictions will be
-+        *enabled* for.  If the sysctl option is enabled, a sysctl option
-+        with name "tpe_gid" is created.
-+
-+config GRKERNSEC_TPE_GID
-+      int "GID for trusted users"
-+      depends on GRKERNSEC_TPE && GRKERNSEC_TPE_INVERT
-+      default 1005
-+      help
-+        Setting this GID determines what group TPE restrictions will be
-+        *disabled* for.  If the sysctl option is enabled, a sysctl option
-+        with name "tpe_gid" is created.
-+
-+endmenu
-+menu "Network Protections"
-+depends on GRKERNSEC
-+
-+config GRKERNSEC_RANDNET
-+      bool "Larger entropy pools"
-+      help
-+        If you say Y here, the entropy pools used for many features of Linux
-+        and grsecurity will be doubled in size.  Since several grsecurity
-+        features use additional randomness, it is recommended that you say Y
-+        here.  Saying Y here has a similar effect as modifying
-+        /proc/sys/kernel/random/poolsize.
-+
-+config GRKERNSEC_BLACKHOLE
-+      bool "TCP/UDP blackhole and LAST_ACK DoS prevention"
-+      depends on NET
-+      help
-+        If you say Y here, neither TCP resets nor ICMP
-+        destination-unreachable packets will be sent in response to packets
-+        sent to ports for which no associated listening process exists.
-+        This feature supports both IPV4 and IPV6 and exempts the 
-+        loopback interface from blackholing.  Enabling this feature 
-+        makes a host more resilient to DoS attacks and reduces network
-+        visibility against scanners.
-+
-+        The blackhole feature as-implemented is equivalent to the FreeBSD
-+        blackhole feature, as it prevents RST responses to all packets, not
-+        just SYNs.  Under most application behavior this causes no
-+        problems, but applications (like haproxy) may not close certain
-+        connections in a way that cleanly terminates them on the remote
-+        end, leaving the remote host in LAST_ACK state.  Because of this
-+        side-effect and to prevent intentional LAST_ACK DoSes, this
-+        feature also adds automatic mitigation against such attacks.
-+        The mitigation drastically reduces the amount of time a socket
-+        can spend in LAST_ACK state.  If you're using haproxy and not
-+        all servers it connects to have this option enabled, consider
-+        disabling this feature on the haproxy host.
-+
-+        If the sysctl option is enabled, two sysctl options with names
-+        "ip_blackhole" and "lastack_retries" will be created.
-+        While "ip_blackhole" takes the standard zero/non-zero on/off
-+        toggle, "lastack_retries" uses the same kinds of values as
-+        "tcp_retries1" and "tcp_retries2".  The default value of 4
-+        prevents a socket from lasting more than 45 seconds in LAST_ACK
-+        state.
-+
-+config GRKERNSEC_SOCKET
-+      bool "Socket restrictions"
-+      depends on NET
-+      help
-+        If you say Y here, you will be able to choose from several options.
-+        If you assign a GID on your system and add it to the supplementary
-+        groups of users you want to restrict socket access to, this patch
-+        will perform up to three things, based on the option(s) you choose.
-+
-+config GRKERNSEC_SOCKET_ALL
-+      bool "Deny any sockets to group"
-+      depends on GRKERNSEC_SOCKET
-+      help
-+        If you say Y here, you will be able to choose a GID of whose users will
-+        be unable to connect to other hosts from your machine or run server
-+        applications from your machine.  If the sysctl option is enabled, a
-+        sysctl option with name "socket_all" is created.
-+
-+config GRKERNSEC_SOCKET_ALL_GID
-+      int "GID to deny all sockets for"
-+      depends on GRKERNSEC_SOCKET_ALL
-+      default 1004
-+      help
-+        Here you can choose the GID to disable socket access for. Remember to
-+        add the users you want socket access disabled for to the GID
-+        specified here.  If the sysctl option is enabled, a sysctl option
-+        with name "socket_all_gid" is created.
++      {
++              .procname       = "chroot_caps",
++              .data           = &grsec_enable_chroot_caps,
++              .maxlen         = sizeof(int),
++              .mode           = 0600,
++              .proc_handler   = &proc_dointvec,
++      },
++#endif
++#ifdef CONFIG_GRKERNSEC_CHROOT_SYSCTL
++      {
++              .procname       = "chroot_deny_sysctl",
++              .data           = &grsec_enable_chroot_sysctl,
++              .maxlen         = sizeof(int),
++              .mode           = 0600,
++              .proc_handler   = &proc_dointvec,
++      },
++#endif
++#ifdef CONFIG_GRKERNSEC_TPE
++      {
++              .procname       = "tpe",
++              .data           = &grsec_enable_tpe,
++              .maxlen         = sizeof(int),
++              .mode           = 0600,
++              .proc_handler   = &proc_dointvec,
++      },
++      {
++              .procname       = "tpe_gid",
++              .data           = &grsec_tpe_gid,
++              .maxlen         = sizeof(int),
++              .mode           = 0600,
++              .proc_handler   = &proc_dointvec,
++      },
++#endif
++#ifdef CONFIG_GRKERNSEC_TPE_INVERT
++      {
++              .procname       = "tpe_invert",
++              .data           = &grsec_enable_tpe_invert,
++              .maxlen         = sizeof(int),
++              .mode           = 0600,
++              .proc_handler   = &proc_dointvec,
++      },
++#endif
++#ifdef CONFIG_GRKERNSEC_TPE_ALL
++      {
++              .procname       = "tpe_restrict_all",
++              .data           = &grsec_enable_tpe_all,
++              .maxlen         = sizeof(int),
++              .mode           = 0600,
++              .proc_handler   = &proc_dointvec,
++      },
++#endif
++#ifdef CONFIG_GRKERNSEC_SOCKET_ALL
++      {
++              .procname       = "socket_all",
++              .data           = &grsec_enable_socket_all,
++              .maxlen         = sizeof(int),
++              .mode           = 0600,
++              .proc_handler   = &proc_dointvec,
++      },
++      {
++              .procname       = "socket_all_gid",
++              .data           = &grsec_socket_all_gid,
++              .maxlen         = sizeof(int),
++              .mode           = 0600,
++              .proc_handler   = &proc_dointvec,
++      },
++#endif
++#ifdef CONFIG_GRKERNSEC_SOCKET_CLIENT
++      {
++              .procname       = "socket_client",
++              .data           = &grsec_enable_socket_client,
++              .maxlen         = sizeof(int),
++              .mode           = 0600,
++              .proc_handler   = &proc_dointvec,
++      },
++      {
++              .procname       = "socket_client_gid",
++              .data           = &grsec_socket_client_gid,
++              .maxlen         = sizeof(int),
++              .mode           = 0600,
++              .proc_handler   = &proc_dointvec,
++      },
++#endif
++#ifdef CONFIG_GRKERNSEC_SOCKET_SERVER
++      {
++              .procname       = "socket_server",
++              .data           = &grsec_enable_socket_server,
++              .maxlen         = sizeof(int),
++              .mode           = 0600,
++              .proc_handler   = &proc_dointvec,
++      },
++      {
++              .procname       = "socket_server_gid",
++              .data           = &grsec_socket_server_gid,
++              .maxlen         = sizeof(int),
++              .mode           = 0600,
++              .proc_handler   = &proc_dointvec,
++      },
++#endif
++#ifdef CONFIG_GRKERNSEC_AUDIT_GROUP
++      {
++              .procname       = "audit_group",
++              .data           = &grsec_enable_group,
++              .maxlen         = sizeof(int),
++              .mode           = 0600,
++              .proc_handler   = &proc_dointvec,
++      },
++      {
++              .procname       = "audit_gid",
++              .data           = &grsec_audit_gid,
++              .maxlen         = sizeof(int),
++              .mode           = 0600,
++              .proc_handler   = &proc_dointvec,
++      },
++#endif
++#ifdef CONFIG_GRKERNSEC_AUDIT_CHDIR
++      {
++              .procname       = "audit_chdir",
++              .data           = &grsec_enable_chdir,
++              .maxlen         = sizeof(int),
++              .mode           = 0600,
++              .proc_handler   = &proc_dointvec,
++      },
++#endif
++#ifdef CONFIG_GRKERNSEC_AUDIT_MOUNT
++      {
++              .procname       = "audit_mount",
++              .data           = &grsec_enable_mount,
++              .maxlen         = sizeof(int),
++              .mode           = 0600,
++              .proc_handler   = &proc_dointvec,
++      },
++#endif
++#ifdef CONFIG_GRKERNSEC_AUDIT_TEXTREL
++      {
++              .procname       = "audit_textrel",
++              .data           = &grsec_enable_audit_textrel,
++              .maxlen         = sizeof(int),
++              .mode           = 0600,
++              .proc_handler   = &proc_dointvec,
++      },
++#endif
++#ifdef CONFIG_GRKERNSEC_DMESG
++      {
++              .procname       = "dmesg",
++              .data           = &grsec_enable_dmesg,
++              .maxlen         = sizeof(int),
++              .mode           = 0600,
++              .proc_handler   = &proc_dointvec,
++      },
++#endif
++#ifdef CONFIG_GRKERNSEC_CHROOT_FINDTASK
++      {
++              .procname       = "chroot_findtask",
++              .data           = &grsec_enable_chroot_findtask,
++              .maxlen         = sizeof(int),
++              .mode           = 0600,
++              .proc_handler   = &proc_dointvec,
++      },
++#endif
++#ifdef CONFIG_GRKERNSEC_RESLOG
++      {
++              .procname       = "resource_logging",
++              .data           = &grsec_resource_logging,
++              .maxlen         = sizeof(int),
++              .mode           = 0600,
++              .proc_handler   = &proc_dointvec,
++      },
++#endif
++#ifdef CONFIG_GRKERNSEC_AUDIT_PTRACE
++      {
++              .procname       = "audit_ptrace",
++              .data           = &grsec_enable_audit_ptrace,
++              .maxlen         = sizeof(int),
++              .mode           = 0600,
++              .proc_handler   = &proc_dointvec,
++      },
++#endif
++#ifdef CONFIG_GRKERNSEC_HARDEN_PTRACE
++      {
++              .procname       = "harden_ptrace",
++              .data           = &grsec_enable_harden_ptrace,
++              .maxlen         = sizeof(int),
++              .mode           = 0600,
++              .proc_handler   = &proc_dointvec,
++      },
++#endif
++      {
++              .procname       = "grsec_lock",
++              .data           = &grsec_lock,
++              .maxlen         = sizeof(int),
++              .mode           = 0600,
++              .proc_handler   = &proc_dointvec,
++      },
++#endif
++#ifdef CONFIG_GRKERNSEC_ROFS
++      {
++              .procname       = "romount_protect",
++              .data           = &grsec_enable_rofs,
++              .maxlen         = sizeof(int),
++              .mode           = 0600,
++              .proc_handler   = &proc_dointvec_minmax,
++              .extra1         = &one,
++              .extra2         = &one,
++      },
++#endif
++      { }
++};
++#endif
+diff --git a/grsecurity/grsec_time.c b/grsecurity/grsec_time.c
+new file mode 100644
+index 0000000..0dc13c3
+--- /dev/null
++++ b/grsecurity/grsec_time.c
+@@ -0,0 +1,16 @@
++#include <linux/kernel.h>
++#include <linux/sched.h>
++#include <linux/grinternal.h>
++#include <linux/module.h>
 +
-+config GRKERNSEC_SOCKET_CLIENT
-+      bool "Deny client sockets to group"
-+      depends on GRKERNSEC_SOCKET
-+      help
-+        If you say Y here, you will be able to choose a GID of whose users will
-+        be unable to connect to other hosts from your machine, but will be
-+        able to run servers.  If this option is enabled, all users in the group
-+        you specify will have to use passive mode when initiating ftp transfers
-+        from the shell on your machine.  If the sysctl option is enabled, a
-+        sysctl option with name "socket_client" is created.
++void
++gr_log_timechange(void)
++{
++#ifdef CONFIG_GRKERNSEC_TIME
++      if (grsec_enable_time)
++              gr_log_noargs(GR_DONT_AUDIT_GOOD, GR_TIME_MSG);
++#endif
++      return;
++}
 +
-+config GRKERNSEC_SOCKET_CLIENT_GID
-+      int "GID to deny client sockets for"
-+      depends on GRKERNSEC_SOCKET_CLIENT
-+      default 1003
-+      help
-+        Here you can choose the GID to disable client socket access for.
-+        Remember to add the users you want client socket access disabled for to
-+        the GID specified here.  If the sysctl option is enabled, a sysctl
-+        option with name "socket_client_gid" is created.
++EXPORT_SYMBOL(gr_log_timechange);
+diff --git a/grsecurity/grsec_tpe.c b/grsecurity/grsec_tpe.c
+new file mode 100644
+index 0000000..4a78774
+--- /dev/null
++++ b/grsecurity/grsec_tpe.c
+@@ -0,0 +1,39 @@
++#include <linux/kernel.h>
++#include <linux/sched.h>
++#include <linux/file.h>
++#include <linux/fs.h>
++#include <linux/grinternal.h>
 +
-+config GRKERNSEC_SOCKET_SERVER
-+      bool "Deny server sockets to group"
-+      depends on GRKERNSEC_SOCKET
-+      help
-+        If you say Y here, you will be able to choose a GID of whose users will
-+        be unable to run server applications from your machine.  If the sysctl
-+        option is enabled, a sysctl option with name "socket_server" is created.
++extern int gr_acl_tpe_check(void);
 +
-+config GRKERNSEC_SOCKET_SERVER_GID
-+      int "GID to deny server sockets for"
-+      depends on GRKERNSEC_SOCKET_SERVER
-+      default 1002
-+      help
-+        Here you can choose the GID to disable server socket access for.
-+        Remember to add the users you want server socket access disabled for to
-+        the GID specified here.  If the sysctl option is enabled, a sysctl
-+        option with name "socket_server_gid" is created.
++int
++gr_tpe_allow(const struct file *file)
++{
++#ifdef CONFIG_GRKERNSEC
++      struct inode *inode = file->f_path.dentry->d_parent->d_inode;
++      const struct cred *cred = current_cred();
 +
-+endmenu
-+menu "Sysctl support"
-+depends on GRKERNSEC && SYSCTL
++      if (cred->uid && ((grsec_enable_tpe &&
++#ifdef CONFIG_GRKERNSEC_TPE_INVERT
++          ((grsec_enable_tpe_invert && !in_group_p(grsec_tpe_gid)) ||
++           (!grsec_enable_tpe_invert && in_group_p(grsec_tpe_gid)))
++#else
++          in_group_p(grsec_tpe_gid)
++#endif
++          ) || gr_acl_tpe_check()) &&
++          (inode->i_uid || (!inode->i_uid && ((inode->i_mode & S_IWGRP) ||
++                                              (inode->i_mode & S_IWOTH))))) {
++              gr_log_fs_generic(GR_DONT_AUDIT, GR_EXEC_TPE_MSG, file->f_path.dentry, file->f_path.mnt);
++              return 0;
++      }
++#ifdef CONFIG_GRKERNSEC_TPE_ALL
++      if (cred->uid && grsec_enable_tpe && grsec_enable_tpe_all &&
++          ((inode->i_uid && (inode->i_uid != cred->uid)) ||
++           (inode->i_mode & S_IWGRP) || (inode->i_mode & S_IWOTH))) {
++              gr_log_fs_generic(GR_DONT_AUDIT, GR_EXEC_TPE_MSG, file->f_path.dentry, file->f_path.mnt);
++              return 0;
++      }
++#endif
++#endif
++      return 1;
++}
+diff --git a/grsecurity/grsum.c b/grsecurity/grsum.c
+new file mode 100644
+index 0000000..9f7b1ac
+--- /dev/null
++++ b/grsecurity/grsum.c
+@@ -0,0 +1,61 @@
++#include <linux/err.h>
++#include <linux/kernel.h>
++#include <linux/sched.h>
++#include <linux/mm.h>
++#include <linux/scatterlist.h>
++#include <linux/crypto.h>
++#include <linux/gracl.h>
 +
-+config GRKERNSEC_SYSCTL
-+      bool "Sysctl support"
-+      help
-+        If you say Y here, you will be able to change the options that
-+        grsecurity runs with at bootup, without having to recompile your
-+        kernel.  You can echo values to files in /proc/sys/kernel/grsecurity
-+        to enable (1) or disable (0) various features.  All the sysctl entries
-+        are mutable until the "grsec_lock" entry is set to a non-zero value.
-+        All features enabled in the kernel configuration are disabled at boot
-+        if you do not say Y to the "Turn on features by default" option.
-+        All options should be set at startup, and the grsec_lock entry should
-+        be set to a non-zero value after all the options are set.
-+        *THIS IS EXTREMELY IMPORTANT*
 +
-+config GRKERNSEC_SYSCTL_DISTRO
-+      bool "Extra sysctl support for distro makers (READ HELP)"
-+      depends on GRKERNSEC_SYSCTL && GRKERNSEC_IO
-+      help
-+        If you say Y here, additional sysctl options will be created
-+        for features that affect processes running as root.  Therefore,
-+        it is critical when using this option that the grsec_lock entry be
-+        enabled after boot.  Only distros with prebuilt kernel packages
-+        with this option enabled that can ensure grsec_lock is enabled
-+        after boot should use this option.
-+        *Failure to set grsec_lock after boot makes all grsec features
-+        this option covers useless*
++#if !defined(CONFIG_CRYPTO) || defined(CONFIG_CRYPTO_MODULE) || !defined(CONFIG_CRYPTO_SHA256) || defined(CONFIG_CRYPTO_SHA256_MODULE)
++#error "crypto and sha256 must be built into the kernel"
++#endif
 +
-+        Currently this option creates the following sysctl entries:
-+        "Disable Privileged I/O": "disable_priv_io"   
++int
++chkpw(struct gr_arg *entry, unsigned char *salt, unsigned char *sum)
++{
++      char *p;
++      struct crypto_hash *tfm;
++      struct hash_desc desc;
++      struct scatterlist sg;
++      unsigned char temp_sum[GR_SHA_LEN];
++      volatile int retval = 0;
++      volatile int dummy = 0;
++      unsigned int i;
 +
-+config GRKERNSEC_SYSCTL_ON
-+      bool "Turn on features by default"
-+      depends on GRKERNSEC_SYSCTL
-+      help
-+        If you say Y here, instead of having all features enabled in the
-+        kernel configuration disabled at boot time, the features will be
-+        enabled at boot time.  It is recommended you say Y here unless
-+        there is some reason you would want all sysctl-tunable features to
-+        be disabled by default.  As mentioned elsewhere, it is important
-+        to enable the grsec_lock entry once you have finished modifying
-+        the sysctl entries.
++      sg_init_table(&sg, 1);
 +
-+endmenu
-+menu "Logging Options"
-+depends on GRKERNSEC
++      tfm = crypto_alloc_hash("sha256", 0, CRYPTO_ALG_ASYNC);
++      if (IS_ERR(tfm)) {
++              /* should never happen, since sha256 should be built in */
++              return 1;
++      }
 +
-+config GRKERNSEC_FLOODTIME
-+      int "Seconds in between log messages (minimum)"
-+      default 10
-+      help
-+        This option allows you to enforce the number of seconds between
-+        grsecurity log messages.  The default should be suitable for most
-+        people, however, if you choose to change it, choose a value small enough
-+        to allow informative logs to be produced, but large enough to
-+        prevent flooding.
++      desc.tfm = tfm;
++      desc.flags = 0;
 +
-+config GRKERNSEC_FLOODBURST
-+      int "Number of messages in a burst (maximum)"
-+      default 6
-+      help
-+        This option allows you to choose the maximum number of messages allowed
-+        within the flood time interval you chose in a separate option.  The
-+        default should be suitable for most people, however if you find that
-+        many of your logs are being interpreted as flooding, you may want to
-+        raise this value.
++      crypto_hash_init(&desc);
 +
-+endmenu
++      p = salt;
++      sg_set_buf(&sg, p, GR_SALT_LEN);
++      crypto_hash_update(&desc, &sg, sg.length);
 +
-+endmenu
-diff -urNp linux-3.1.3/grsecurity/Makefile linux-3.1.3/grsecurity/Makefile
---- linux-3.1.3/grsecurity/Makefile    1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/grsecurity/Makefile    2011-11-16 18:40:31.000000000 -0500
-@@ -0,0 +1,36 @@
-+# grsecurity's ACL system was originally written in 2001 by Michael Dalton
-+# during 2001-2009 it has been completely redesigned by Brad Spengler
-+# into an RBAC system
-+#
-+# All code in this directory and various hooks inserted throughout the kernel
-+# are copyright Brad Spengler - Open Source Security, Inc., and released 
-+# under the GPL v2 or higher
++      p = entry->pw;
++      sg_set_buf(&sg, p, strlen(p));
++      
++      crypto_hash_update(&desc, &sg, sg.length);
 +
-+obj-y = grsec_chdir.o grsec_chroot.o grsec_exec.o grsec_fifo.o grsec_fork.o \
-+      grsec_mount.o grsec_sig.o grsec_sysctl.o \
-+      grsec_time.o grsec_tpe.o grsec_link.o grsec_pax.o grsec_ptrace.o
++      crypto_hash_final(&desc, temp_sum);
 +
-+obj-$(CONFIG_GRKERNSEC) += grsec_init.o grsum.o gracl.o gracl_segv.o \
-+      gracl_cap.o gracl_alloc.o gracl_shm.o grsec_mem.o gracl_fs.o \
-+      gracl_learn.o grsec_log.o
-+obj-$(CONFIG_GRKERNSEC_RESLOG) += gracl_res.o
++      memset(entry->pw, 0, GR_PW_LEN);
 +
-+ifdef CONFIG_NET
-+obj-y += grsec_sock.o
-+obj-$(CONFIG_GRKERNSEC) += gracl_ip.o
-+endif
++      for (i = 0; i < GR_SHA_LEN; i++)
++              if (sum[i] != temp_sum[i])
++                      retval = 1;
++              else
++                      dummy = 1;      // waste a cycle
 +
-+ifndef CONFIG_GRKERNSEC
-+obj-y += grsec_disabled.o
-+endif
++      crypto_free_hash(tfm);
 +
-+ifdef CONFIG_GRKERNSEC_HIDESYM
-+extra-y := grsec_hidesym.o
-+$(obj)/grsec_hidesym.o:
-+      @-chmod -f 500 /boot
-+      @-chmod -f 500 /lib/modules
-+      @-chmod -f 500 /lib64/modules
-+      @-chmod -f 500 /lib32/modules
-+      @-chmod -f 700 .
-+      @echo '  grsec: protected kernel image paths'
-+endif
-diff -urNp linux-3.1.3/include/acpi/acpi_bus.h linux-3.1.3/include/acpi/acpi_bus.h
---- linux-3.1.3/include/acpi/acpi_bus.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/acpi/acpi_bus.h        2011-11-16 18:39:08.000000000 -0500
++      return retval;
++}
+diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
+index 6cd5b64..f620d2d 100644
+--- a/include/acpi/acpi_bus.h
++++ b/include/acpi/acpi_bus.h
 @@ -107,7 +107,7 @@ struct acpi_device_ops {
        acpi_op_bind bind;
        acpi_op_unbind unbind;
@@ -57004,9 +59425,10 @@ diff -urNp linux-3.1.3/include/acpi/acpi_bus.h linux-3.1.3/include/acpi/acpi_bus
  
  #define ACPI_DRIVER_ALL_NOTIFY_EVENTS 0x1     /* system AND device events */
  
-diff -urNp linux-3.1.3/include/asm-generic/atomic-long.h linux-3.1.3/include/asm-generic/atomic-long.h
---- linux-3.1.3/include/asm-generic/atomic-long.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/asm-generic/atomic-long.h      2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/asm-generic/atomic-long.h b/include/asm-generic/atomic-long.h
+index b7babf0..71e4e74 100644
+--- a/include/asm-generic/atomic-long.h
++++ b/include/asm-generic/atomic-long.h
 @@ -22,6 +22,12 @@
  
  typedef atomic64_t atomic_long_t;
@@ -57020,7 +59442,7 @@ diff -urNp linux-3.1.3/include/asm-generic/atomic-long.h linux-3.1.3/include/asm
  #define ATOMIC_LONG_INIT(i)   ATOMIC64_INIT(i)
  
  static inline long atomic_long_read(atomic_long_t *l)
-@@ -31,6 +37,15 @@ static inline long atomic_long_read(atom
+@@ -31,6 +37,15 @@ static inline long atomic_long_read(atomic_long_t *l)
        return (long)atomic64_read(v);
  }
  
@@ -57036,7 +59458,7 @@ diff -urNp linux-3.1.3/include/asm-generic/atomic-long.h linux-3.1.3/include/asm
  static inline void atomic_long_set(atomic_long_t *l, long i)
  {
        atomic64_t *v = (atomic64_t *)l;
-@@ -38,6 +53,15 @@ static inline void atomic_long_set(atomi
+@@ -38,6 +53,15 @@ static inline void atomic_long_set(atomic_long_t *l, long i)
        atomic64_set(v, i);
  }
  
@@ -57052,7 +59474,7 @@ diff -urNp linux-3.1.3/include/asm-generic/atomic-long.h linux-3.1.3/include/asm
  static inline void atomic_long_inc(atomic_long_t *l)
  {
        atomic64_t *v = (atomic64_t *)l;
-@@ -45,6 +69,15 @@ static inline void atomic_long_inc(atomi
+@@ -45,6 +69,15 @@ static inline void atomic_long_inc(atomic_long_t *l)
        atomic64_inc(v);
  }
  
@@ -57068,7 +59490,7 @@ diff -urNp linux-3.1.3/include/asm-generic/atomic-long.h linux-3.1.3/include/asm
  static inline void atomic_long_dec(atomic_long_t *l)
  {
        atomic64_t *v = (atomic64_t *)l;
-@@ -52,6 +85,15 @@ static inline void atomic_long_dec(atomi
+@@ -52,6 +85,15 @@ static inline void atomic_long_dec(atomic_long_t *l)
        atomic64_dec(v);
  }
  
@@ -57084,7 +59506,7 @@ diff -urNp linux-3.1.3/include/asm-generic/atomic-long.h linux-3.1.3/include/asm
  static inline void atomic_long_add(long i, atomic_long_t *l)
  {
        atomic64_t *v = (atomic64_t *)l;
-@@ -59,6 +101,15 @@ static inline void atomic_long_add(long 
+@@ -59,6 +101,15 @@ static inline void atomic_long_add(long i, atomic_long_t *l)
        atomic64_add(i, v);
  }
  
@@ -57100,7 +59522,7 @@ diff -urNp linux-3.1.3/include/asm-generic/atomic-long.h linux-3.1.3/include/asm
  static inline void atomic_long_sub(long i, atomic_long_t *l)
  {
        atomic64_t *v = (atomic64_t *)l;
-@@ -66,6 +117,15 @@ static inline void atomic_long_sub(long 
+@@ -66,6 +117,15 @@ static inline void atomic_long_sub(long i, atomic_long_t *l)
        atomic64_sub(i, v);
  }
  
@@ -57116,7 +59538,7 @@ diff -urNp linux-3.1.3/include/asm-generic/atomic-long.h linux-3.1.3/include/asm
  static inline int atomic_long_sub_and_test(long i, atomic_long_t *l)
  {
        atomic64_t *v = (atomic64_t *)l;
-@@ -115,6 +175,15 @@ static inline long atomic_long_inc_retur
+@@ -115,6 +175,15 @@ static inline long atomic_long_inc_return(atomic_long_t *l)
        return (long)atomic64_inc_return(v);
  }
  
@@ -57132,7 +59554,7 @@ diff -urNp linux-3.1.3/include/asm-generic/atomic-long.h linux-3.1.3/include/asm
  static inline long atomic_long_dec_return(atomic_long_t *l)
  {
        atomic64_t *v = (atomic64_t *)l;
-@@ -140,6 +209,12 @@ static inline long atomic_long_add_unles
+@@ -140,6 +209,12 @@ static inline long atomic_long_add_unless(atomic_long_t *l, long a, long u)
  
  typedef atomic_t atomic_long_t;
  
@@ -57145,7 +59567,7 @@ diff -urNp linux-3.1.3/include/asm-generic/atomic-long.h linux-3.1.3/include/asm
  #define ATOMIC_LONG_INIT(i)   ATOMIC_INIT(i)
  static inline long atomic_long_read(atomic_long_t *l)
  {
-@@ -148,6 +223,15 @@ static inline long atomic_long_read(atom
+@@ -148,6 +223,15 @@ static inline long atomic_long_read(atomic_long_t *l)
        return (long)atomic_read(v);
  }
  
@@ -57161,7 +59583,7 @@ diff -urNp linux-3.1.3/include/asm-generic/atomic-long.h linux-3.1.3/include/asm
  static inline void atomic_long_set(atomic_long_t *l, long i)
  {
        atomic_t *v = (atomic_t *)l;
-@@ -155,6 +239,15 @@ static inline void atomic_long_set(atomi
+@@ -155,6 +239,15 @@ static inline void atomic_long_set(atomic_long_t *l, long i)
        atomic_set(v, i);
  }
  
@@ -57177,7 +59599,7 @@ diff -urNp linux-3.1.3/include/asm-generic/atomic-long.h linux-3.1.3/include/asm
  static inline void atomic_long_inc(atomic_long_t *l)
  {
        atomic_t *v = (atomic_t *)l;
-@@ -162,6 +255,15 @@ static inline void atomic_long_inc(atomi
+@@ -162,6 +255,15 @@ static inline void atomic_long_inc(atomic_long_t *l)
        atomic_inc(v);
  }
  
@@ -57193,7 +59615,7 @@ diff -urNp linux-3.1.3/include/asm-generic/atomic-long.h linux-3.1.3/include/asm
  static inline void atomic_long_dec(atomic_long_t *l)
  {
        atomic_t *v = (atomic_t *)l;
-@@ -169,6 +271,15 @@ static inline void atomic_long_dec(atomi
+@@ -169,6 +271,15 @@ static inline void atomic_long_dec(atomic_long_t *l)
        atomic_dec(v);
  }
  
@@ -57209,7 +59631,7 @@ diff -urNp linux-3.1.3/include/asm-generic/atomic-long.h linux-3.1.3/include/asm
  static inline void atomic_long_add(long i, atomic_long_t *l)
  {
        atomic_t *v = (atomic_t *)l;
-@@ -176,6 +287,15 @@ static inline void atomic_long_add(long 
+@@ -176,6 +287,15 @@ static inline void atomic_long_add(long i, atomic_long_t *l)
        atomic_add(i, v);
  }
  
@@ -57225,7 +59647,7 @@ diff -urNp linux-3.1.3/include/asm-generic/atomic-long.h linux-3.1.3/include/asm
  static inline void atomic_long_sub(long i, atomic_long_t *l)
  {
        atomic_t *v = (atomic_t *)l;
-@@ -183,6 +303,15 @@ static inline void atomic_long_sub(long 
+@@ -183,6 +303,15 @@ static inline void atomic_long_sub(long i, atomic_long_t *l)
        atomic_sub(i, v);
  }
  
@@ -57241,7 +59663,7 @@ diff -urNp linux-3.1.3/include/asm-generic/atomic-long.h linux-3.1.3/include/asm
  static inline int atomic_long_sub_and_test(long i, atomic_long_t *l)
  {
        atomic_t *v = (atomic_t *)l;
-@@ -232,6 +361,15 @@ static inline long atomic_long_inc_retur
+@@ -232,6 +361,15 @@ static inline long atomic_long_inc_return(atomic_long_t *l)
        return (long)atomic_inc_return(v);
  }
  
@@ -57257,7 +59679,7 @@ diff -urNp linux-3.1.3/include/asm-generic/atomic-long.h linux-3.1.3/include/asm
  static inline long atomic_long_dec_return(atomic_long_t *l)
  {
        atomic_t *v = (atomic_t *)l;
-@@ -255,4 +393,49 @@ static inline long atomic_long_add_unles
+@@ -255,4 +393,49 @@ static inline long atomic_long_add_unless(atomic_long_t *l, long a, long u)
  
  #endif  /*  BITS_PER_LONG == 64  */
  
@@ -57307,9 +59729,38 @@ diff -urNp linux-3.1.3/include/asm-generic/atomic-long.h linux-3.1.3/include/asm
 +#endif
 +
  #endif  /*  _ASM_GENERIC_ATOMIC_LONG_H  */
-diff -urNp linux-3.1.3/include/asm-generic/cache.h linux-3.1.3/include/asm-generic/cache.h
---- linux-3.1.3/include/asm-generic/cache.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/asm-generic/cache.h    2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/asm-generic/atomic64.h b/include/asm-generic/atomic64.h
+index b18ce4f..2ee2843 100644
+--- a/include/asm-generic/atomic64.h
++++ b/include/asm-generic/atomic64.h
+@@ -16,6 +16,8 @@ typedef struct {
+       long long counter;
+ } atomic64_t;
++typedef atomic64_t atomic64_unchecked_t;
++
+ #define ATOMIC64_INIT(i)      { (i) }
+ extern long long atomic64_read(const atomic64_t *v);
+@@ -39,4 +41,14 @@ extern int   atomic64_add_unless(atomic64_t *v, long long a, long long u);
+ #define atomic64_dec_and_test(v)      (atomic64_dec_return((v)) == 0)
+ #define atomic64_inc_not_zero(v)      atomic64_add_unless((v), 1LL, 0LL)
++#define atomic64_read_unchecked(v) atomic64_read(v)
++#define atomic64_set_unchecked(v, i) atomic64_set((v), (i))
++#define atomic64_add_unchecked(a, v) atomic64_add((a), (v))
++#define atomic64_add_return_unchecked(a, v) atomic64_add_return((a), (v))
++#define atomic64_sub_unchecked(a, v) atomic64_sub((a), (v))
++#define atomic64_inc_unchecked(v) atomic64_inc(v)
++#define atomic64_inc_return_unchecked(v) atomic64_inc_return(v)
++#define atomic64_dec_unchecked(v) atomic64_dec(v)
++#define atomic64_cmpxchg_unchecked(v, o, n) atomic64_cmpxchg((v), (o), (n))
++
+ #endif  /*  _ASM_GENERIC_ATOMIC64_H  */
+diff --git a/include/asm-generic/cache.h b/include/asm-generic/cache.h
+index 1bfcfe5..e04c5c9 100644
+--- a/include/asm-generic/cache.h
++++ b/include/asm-generic/cache.h
 @@ -6,7 +6,7 @@
   * cache lines need to provide their own cache.h.
   */
@@ -57320,9 +59771,10 @@ diff -urNp linux-3.1.3/include/asm-generic/cache.h linux-3.1.3/include/asm-gener
 +#define L1_CACHE_BYTES                (1UL << L1_CACHE_SHIFT)
  
  #endif /* __ASM_GENERIC_CACHE_H */
-diff -urNp linux-3.1.3/include/asm-generic/int-l64.h linux-3.1.3/include/asm-generic/int-l64.h
---- linux-3.1.3/include/asm-generic/int-l64.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/asm-generic/int-l64.h  2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/asm-generic/int-l64.h b/include/asm-generic/int-l64.h
+index 1ca3efc..e3dc852 100644
+--- a/include/asm-generic/int-l64.h
++++ b/include/asm-generic/int-l64.h
 @@ -46,6 +46,8 @@ typedef unsigned int u32;
  typedef signed long s64;
  typedef unsigned long u64;
@@ -57332,9 +59784,10 @@ diff -urNp linux-3.1.3/include/asm-generic/int-l64.h linux-3.1.3/include/asm-gen
  #define S8_C(x)  x
  #define U8_C(x)  x ## U
  #define S16_C(x) x
-diff -urNp linux-3.1.3/include/asm-generic/int-ll64.h linux-3.1.3/include/asm-generic/int-ll64.h
---- linux-3.1.3/include/asm-generic/int-ll64.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/asm-generic/int-ll64.h 2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/asm-generic/int-ll64.h b/include/asm-generic/int-ll64.h
+index f394147..b6152b9 100644
+--- a/include/asm-generic/int-ll64.h
++++ b/include/asm-generic/int-ll64.h
 @@ -51,6 +51,8 @@ typedef unsigned int u32;
  typedef signed long long s64;
  typedef unsigned long long u64;
@@ -57344,9 +59797,10 @@ diff -urNp linux-3.1.3/include/asm-generic/int-ll64.h linux-3.1.3/include/asm-ge
  #define S8_C(x)  x
  #define U8_C(x)  x ## U
  #define S16_C(x) x
-diff -urNp linux-3.1.3/include/asm-generic/kmap_types.h linux-3.1.3/include/asm-generic/kmap_types.h
---- linux-3.1.3/include/asm-generic/kmap_types.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/asm-generic/kmap_types.h       2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/asm-generic/kmap_types.h b/include/asm-generic/kmap_types.h
+index 0232ccb..13d9165 100644
+--- a/include/asm-generic/kmap_types.h
++++ b/include/asm-generic/kmap_types.h
 @@ -29,10 +29,11 @@ KMAP_D(16) KM_IRQ_PTE,
  KMAP_D(17)    KM_NMI,
  KMAP_D(18)    KM_NMI_PTE,
@@ -57360,27 +59814,10 @@ diff -urNp linux-3.1.3/include/asm-generic/kmap_types.h linux-3.1.3/include/asm-
  };
  
  #undef KMAP_D
-diff -urNp linux-3.1.3/include/asm-generic/pgtable.h linux-3.1.3/include/asm-generic/pgtable.h
---- linux-3.1.3/include/asm-generic/pgtable.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/asm-generic/pgtable.h  2011-11-16 18:39:08.000000000 -0500
-@@ -443,6 +443,14 @@ static inline int pmd_write(pmd_t pmd)
- #endif /* __HAVE_ARCH_PMD_WRITE */
- #endif
-+#ifndef __HAVE_ARCH_PAX_OPEN_KERNEL
-+static inline unsigned long pax_open_kernel(void) { return 0; }
-+#endif
-+
-+#ifndef __HAVE_ARCH_PAX_CLOSE_KERNEL
-+static inline unsigned long pax_close_kernel(void) { return 0; }
-+#endif
-+
- #endif /* !__ASSEMBLY__ */
- #endif /* _ASM_GENERIC_PGTABLE_H */
-diff -urNp linux-3.1.3/include/asm-generic/pgtable-nopmd.h linux-3.1.3/include/asm-generic/pgtable-nopmd.h
---- linux-3.1.3/include/asm-generic/pgtable-nopmd.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/asm-generic/pgtable-nopmd.h    2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/asm-generic/pgtable-nopmd.h b/include/asm-generic/pgtable-nopmd.h
+index 725612b..9cc513a 100644
+--- a/include/asm-generic/pgtable-nopmd.h
++++ b/include/asm-generic/pgtable-nopmd.h
 @@ -1,14 +1,19 @@
  #ifndef _PGTABLE_NOPMD_H
  #define _PGTABLE_NOPMD_H
@@ -57417,9 +59854,10 @@ diff -urNp linux-3.1.3/include/asm-generic/pgtable-nopmd.h linux-3.1.3/include/a
  /*
   * The "pud_xxx()" functions here are trivial for a folded two-level
   * setup: the pmd is never bad, and a pmd always exists (as it's folded
-diff -urNp linux-3.1.3/include/asm-generic/pgtable-nopud.h linux-3.1.3/include/asm-generic/pgtable-nopud.h
---- linux-3.1.3/include/asm-generic/pgtable-nopud.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/asm-generic/pgtable-nopud.h    2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/asm-generic/pgtable-nopud.h b/include/asm-generic/pgtable-nopud.h
+index 810431d..ccc3638 100644
+--- a/include/asm-generic/pgtable-nopud.h
++++ b/include/asm-generic/pgtable-nopud.h
 @@ -1,10 +1,15 @@
  #ifndef _PGTABLE_NOPUD_H
  #define _PGTABLE_NOPUD_H
@@ -57450,9 +59888,29 @@ diff -urNp linux-3.1.3/include/asm-generic/pgtable-nopud.h linux-3.1.3/include/a
  /*
   * The "pgd_xxx()" functions here are trivial for a folded two-level
   * setup: the pud is never bad, and a pud always exists (as it's folded
-diff -urNp linux-3.1.3/include/asm-generic/vmlinux.lds.h linux-3.1.3/include/asm-generic/vmlinux.lds.h
---- linux-3.1.3/include/asm-generic/vmlinux.lds.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/asm-generic/vmlinux.lds.h      2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
+index 76bff2b..c7a14e2 100644
+--- a/include/asm-generic/pgtable.h
++++ b/include/asm-generic/pgtable.h
+@@ -443,6 +443,14 @@ static inline int pmd_write(pmd_t pmd)
+ #endif /* __HAVE_ARCH_PMD_WRITE */
+ #endif
++#ifndef __HAVE_ARCH_PAX_OPEN_KERNEL
++static inline unsigned long pax_open_kernel(void) { return 0; }
++#endif
++
++#ifndef __HAVE_ARCH_PAX_CLOSE_KERNEL
++static inline unsigned long pax_close_kernel(void) { return 0; }
++#endif
++
+ #endif /* !__ASSEMBLY__ */
+ #endif /* _ASM_GENERIC_PGTABLE_H */
+diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
+index db22d13..1f2e3e1 100644
+--- a/include/asm-generic/vmlinux.lds.h
++++ b/include/asm-generic/vmlinux.lds.h
 @@ -217,6 +217,7 @@
        .rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {           \
                VMLINUX_SYMBOL(__start_rodata) = .;                     \
@@ -57484,30 +59942,10 @@ diff -urNp linux-3.1.3/include/asm-generic/vmlinux.lds.h linux-3.1.3/include/asm
  
  /**
   * PERCPU_SECTION - define output section for percpu area, simple version
-diff -urNp linux-3.1.3/include/drm/drm_crtc_helper.h linux-3.1.3/include/drm/drm_crtc_helper.h
---- linux-3.1.3/include/drm/drm_crtc_helper.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/drm/drm_crtc_helper.h  2011-11-16 18:39:08.000000000 -0500
-@@ -74,7 +74,7 @@ struct drm_crtc_helper_funcs {
-       /* disable crtc when not in use - more explicit than dpms off */
-       void (*disable)(struct drm_crtc *crtc);
--};
-+} __no_const;
- struct drm_encoder_helper_funcs {
-       void (*dpms)(struct drm_encoder *encoder, int mode);
-@@ -95,7 +95,7 @@ struct drm_encoder_helper_funcs {
-                                           struct drm_connector *connector);
-       /* disable encoder when not in use - more explicit than dpms off */
-       void (*disable)(struct drm_encoder *encoder);
--};
-+} __no_const;
- struct drm_connector_helper_funcs {
-       int (*get_modes)(struct drm_connector *connector);
-diff -urNp linux-3.1.3/include/drm/drmP.h linux-3.1.3/include/drm/drmP.h
---- linux-3.1.3/include/drm/drmP.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/drm/drmP.h     2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/drm/drmP.h b/include/drm/drmP.h
+index 9b7c2bb..76b7d1e 100644
+--- a/include/drm/drmP.h
++++ b/include/drm/drmP.h
 @@ -73,6 +73,7 @@
  #include <linux/workqueue.h>
  #include <linux/poll.h>
@@ -57534,9 +59972,32 @@ diff -urNp linux-3.1.3/include/drm/drmP.h linux-3.1.3/include/drm/drmP.h
        /*@} */
  
        struct list_head filelist;
-diff -urNp linux-3.1.3/include/drm/ttm/ttm_memory.h linux-3.1.3/include/drm/ttm/ttm_memory.h
---- linux-3.1.3/include/drm/ttm/ttm_memory.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/drm/ttm/ttm_memory.h   2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h
+index 73b0712..0b7ef2f 100644
+--- a/include/drm/drm_crtc_helper.h
++++ b/include/drm/drm_crtc_helper.h
+@@ -74,7 +74,7 @@ struct drm_crtc_helper_funcs {
+       /* disable crtc when not in use - more explicit than dpms off */
+       void (*disable)(struct drm_crtc *crtc);
+-};
++} __no_const;
+ struct drm_encoder_helper_funcs {
+       void (*dpms)(struct drm_encoder *encoder, int mode);
+@@ -95,7 +95,7 @@ struct drm_encoder_helper_funcs {
+                                           struct drm_connector *connector);
+       /* disable encoder when not in use - more explicit than dpms off */
+       void (*disable)(struct drm_encoder *encoder);
+-};
++} __no_const;
+ struct drm_connector_helper_funcs {
+       int (*get_modes)(struct drm_connector *connector);
+diff --git a/include/drm/ttm/ttm_memory.h b/include/drm/ttm/ttm_memory.h
+index 26c1f78..6722682 100644
+--- a/include/drm/ttm/ttm_memory.h
++++ b/include/drm/ttm/ttm_memory.h
 @@ -47,7 +47,7 @@
  
  struct ttm_mem_shrink {
@@ -57546,9 +60007,10 @@ diff -urNp linux-3.1.3/include/drm/ttm/ttm_memory.h linux-3.1.3/include/drm/ttm/
  
  /**
   * struct ttm_mem_global - Global memory accounting structure.
-diff -urNp linux-3.1.3/include/linux/a.out.h linux-3.1.3/include/linux/a.out.h
---- linux-3.1.3/include/linux/a.out.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/a.out.h  2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/a.out.h b/include/linux/a.out.h
+index e86dfca..40cc55f 100644
+--- a/include/linux/a.out.h
++++ b/include/linux/a.out.h
 @@ -39,6 +39,14 @@ enum machine_type {
    M_MIPS2 = 152               /* MIPS R6000/R4000 binary */
  };
@@ -57564,9 +60026,10 @@ diff -urNp linux-3.1.3/include/linux/a.out.h linux-3.1.3/include/linux/a.out.h
  #if !defined (N_MAGIC)
  #define N_MAGIC(exec) ((exec).a_info & 0xffff)
  #endif
-diff -urNp linux-3.1.3/include/linux/atmdev.h linux-3.1.3/include/linux/atmdev.h
---- linux-3.1.3/include/linux/atmdev.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/atmdev.h 2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
+index 49a83ca..df96b54 100644
+--- a/include/linux/atmdev.h
++++ b/include/linux/atmdev.h
 @@ -237,7 +237,7 @@ struct compat_atm_iobuf {
  #endif
  
@@ -57576,9 +60039,10 @@ diff -urNp linux-3.1.3/include/linux/atmdev.h linux-3.1.3/include/linux/atmdev.h
        __AAL_STAT_ITEMS
  #undef __HANDLE_ITEM
  };
-diff -urNp linux-3.1.3/include/linux/binfmts.h linux-3.1.3/include/linux/binfmts.h
---- linux-3.1.3/include/linux/binfmts.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/binfmts.h        2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
+index fd88a39..f4d0bad 100644
+--- a/include/linux/binfmts.h
++++ b/include/linux/binfmts.h
 @@ -88,6 +88,7 @@ struct linux_binfmt {
        int (*load_binary)(struct linux_binprm *, struct  pt_regs * regs);
        int (*load_shlib)(struct file *);
@@ -57587,9 +60051,10 @@ diff -urNp linux-3.1.3/include/linux/binfmts.h linux-3.1.3/include/linux/binfmts
        unsigned long min_coredump;     /* minimal dump size */
  };
  
-diff -urNp linux-3.1.3/include/linux/blkdev.h linux-3.1.3/include/linux/blkdev.h
---- linux-3.1.3/include/linux/blkdev.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/blkdev.h 2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
+index 7fbaa91..5e6a460 100644
+--- a/include/linux/blkdev.h
++++ b/include/linux/blkdev.h
 @@ -1321,7 +1321,7 @@ struct block_device_operations {
        /* this callback is with swap_lock and sometimes page table lock held */
        void (*swap_slot_free_notify) (struct block_device *, unsigned long);
@@ -57599,9 +60064,10 @@ diff -urNp linux-3.1.3/include/linux/blkdev.h linux-3.1.3/include/linux/blkdev.h
  
  extern int __blkdev_driver_ioctl(struct block_device *, fmode_t, unsigned int,
                                 unsigned long);
-diff -urNp linux-3.1.3/include/linux/blktrace_api.h linux-3.1.3/include/linux/blktrace_api.h
---- linux-3.1.3/include/linux/blktrace_api.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/blktrace_api.h   2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
+index 8e9e4bc..88bd457 100644
+--- a/include/linux/blktrace_api.h
++++ b/include/linux/blktrace_api.h
 @@ -162,7 +162,7 @@ struct blk_trace {
        struct dentry *dir;
        struct dentry *dropped_file;
@@ -57611,9 +60077,10 @@ diff -urNp linux-3.1.3/include/linux/blktrace_api.h linux-3.1.3/include/linux/bl
  };
  
  extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *);
-diff -urNp linux-3.1.3/include/linux/byteorder/little_endian.h linux-3.1.3/include/linux/byteorder/little_endian.h
---- linux-3.1.3/include/linux/byteorder/little_endian.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/byteorder/little_endian.h        2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/byteorder/little_endian.h b/include/linux/byteorder/little_endian.h
+index 83195fb..0b0f77d 100644
+--- a/include/linux/byteorder/little_endian.h
++++ b/include/linux/byteorder/little_endian.h
 @@ -42,51 +42,51 @@
  
  static inline __le64 __cpu_to_le64p(const __u64 *p)
@@ -57678,9 +60145,10 @@ diff -urNp linux-3.1.3/include/linux/byteorder/little_endian.h linux-3.1.3/inclu
  }
  #define __cpu_to_le64s(x) do { (void)(x); } while (0)
  #define __le64_to_cpus(x) do { (void)(x); } while (0)
-diff -urNp linux-3.1.3/include/linux/cache.h linux-3.1.3/include/linux/cache.h
---- linux-3.1.3/include/linux/cache.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/cache.h  2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/cache.h b/include/linux/cache.h
+index 4c57065..4307975 100644
+--- a/include/linux/cache.h
++++ b/include/linux/cache.h
 @@ -16,6 +16,10 @@
  #define __read_mostly
  #endif
@@ -57692,9 +60160,10 @@ diff -urNp linux-3.1.3/include/linux/cache.h linux-3.1.3/include/linux/cache.h
  #ifndef ____cacheline_aligned
  #define ____cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES)))
  #endif
-diff -urNp linux-3.1.3/include/linux/capability.h linux-3.1.3/include/linux/capability.h
---- linux-3.1.3/include/linux/capability.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/capability.h     2011-11-16 18:40:31.000000000 -0500
+diff --git a/include/linux/capability.h b/include/linux/capability.h
+index c421123..e343179 100644
+--- a/include/linux/capability.h
++++ b/include/linux/capability.h
 @@ -547,6 +547,9 @@ extern bool capable(int cap);
  extern bool ns_capable(struct user_namespace *ns, int cap);
  extern bool task_ns_capable(struct task_struct *t, int cap);
@@ -57705,9 +60174,10 @@ diff -urNp linux-3.1.3/include/linux/capability.h linux-3.1.3/include/linux/capa
  
  /* audit system wants to get cap info from files as well */
  extern int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data *cpu_caps);
-diff -urNp linux-3.1.3/include/linux/cleancache.h linux-3.1.3/include/linux/cleancache.h
---- linux-3.1.3/include/linux/cleancache.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/cleancache.h     2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/cleancache.h b/include/linux/cleancache.h
+index 04ffb2e..6799180 100644
+--- a/include/linux/cleancache.h
++++ b/include/linux/cleancache.h
 @@ -31,7 +31,7 @@ struct cleancache_ops {
        void (*flush_page)(int, struct cleancache_filekey, pgoff_t);
        void (*flush_inode)(int, struct cleancache_filekey);
@@ -57717,9 +60187,10 @@ diff -urNp linux-3.1.3/include/linux/cleancache.h linux-3.1.3/include/linux/clea
  
  extern struct cleancache_ops
        cleancache_register_ops(struct cleancache_ops *ops);
-diff -urNp linux-3.1.3/include/linux/compiler-gcc4.h linux-3.1.3/include/linux/compiler-gcc4.h
---- linux-3.1.3/include/linux/compiler-gcc4.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/compiler-gcc4.h  2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h
+index dfadc96..c0e70c1 100644
+--- a/include/linux/compiler-gcc4.h
++++ b/include/linux/compiler-gcc4.h
 @@ -31,6 +31,12 @@
  
  
@@ -57745,9 +60216,10 @@ diff -urNp linux-3.1.3/include/linux/compiler-gcc4.h linux-3.1.3/include/linux/c
  #endif
  
  #if __GNUC_MINOR__ > 0
-diff -urNp linux-3.1.3/include/linux/compiler.h linux-3.1.3/include/linux/compiler.h
---- linux-3.1.3/include/linux/compiler.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/compiler.h       2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/compiler.h b/include/linux/compiler.h
+index 320d6c9..8573a1c 100644
+--- a/include/linux/compiler.h
++++ b/include/linux/compiler.h
 @@ -5,31 +5,62 @@
  
  #ifdef __CHECKER__
@@ -57811,7 +60283,7 @@ diff -urNp linux-3.1.3/include/linux/compiler.h linux-3.1.3/include/linux/compil
  # define __chk_user_ptr(x) (void)0
  # define __chk_io_ptr(x) (void)0
  # define __builtin_warning(x, y...) (1)
-@@ -39,7 +70,9 @@ extern void __chk_io_ptr(const volatile 
+@@ -39,7 +70,9 @@ extern void __chk_io_ptr(const volatile void __iomem *);
  # define __release(x) (void)0
  # define __cond_lock(x,c) (c)
  # define __percpu
@@ -57821,7 +60293,7 @@ diff -urNp linux-3.1.3/include/linux/compiler.h linux-3.1.3/include/linux/compil
  #endif
  
  #ifdef __KERNEL__
-@@ -264,6 +297,14 @@ void ftrace_likely_update(struct ftrace_
+@@ -264,6 +297,14 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
  # define __attribute_const__  /* unimplemented */
  #endif
  
@@ -57836,7 +60308,7 @@ diff -urNp linux-3.1.3/include/linux/compiler.h linux-3.1.3/include/linux/compil
  /*
   * Tell gcc if a function is cold. The compiler will assume any path
   * directly leading to the call is unlikely.
-@@ -273,6 +314,22 @@ void ftrace_likely_update(struct ftrace_
+@@ -273,6 +314,22 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
  #define __cold
  #endif
  
@@ -57859,7 +60331,7 @@ diff -urNp linux-3.1.3/include/linux/compiler.h linux-3.1.3/include/linux/compil
  /* Simple shorthand for a section definition */
  #ifndef __section
  # define __section(S) __attribute__ ((__section__(#S)))
-@@ -306,6 +363,7 @@ void ftrace_likely_update(struct ftrace_
+@@ -306,6 +363,7 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
   * use is to mediate communication between process-level code and irq/NMI
   * handlers, all running on the same CPU.
   */
@@ -57868,10 +60340,11 @@ diff -urNp linux-3.1.3/include/linux/compiler.h linux-3.1.3/include/linux/compil
 +#define ACCESS_ONCE_RW(x) (*(volatile typeof(x) *)&(x))
  
  #endif /* __LINUX_COMPILER_H */
-diff -urNp linux-3.1.3/include/linux/cpuset.h linux-3.1.3/include/linux/cpuset.h
---- linux-3.1.3/include/linux/cpuset.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/cpuset.h 2011-11-16 18:39:08.000000000 -0500
-@@ -118,7 +118,7 @@ static inline void put_mems_allowed(void
+diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h
+index e9eaec5..bfeb9bb 100644
+--- a/include/linux/cpuset.h
++++ b/include/linux/cpuset.h
+@@ -118,7 +118,7 @@ static inline void put_mems_allowed(void)
         * nodemask.
         */
        smp_mb();
@@ -57880,9 +60353,10 @@ diff -urNp linux-3.1.3/include/linux/cpuset.h linux-3.1.3/include/linux/cpuset.h
  }
  
  static inline void set_mems_allowed(nodemask_t nodemask)
-diff -urNp linux-3.1.3/include/linux/crypto.h linux-3.1.3/include/linux/crypto.h
---- linux-3.1.3/include/linux/crypto.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/crypto.h 2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/crypto.h b/include/linux/crypto.h
+index e5e468e..f079672 100644
+--- a/include/linux/crypto.h
++++ b/include/linux/crypto.h
 @@ -361,7 +361,7 @@ struct cipher_tfm {
                          const u8 *key, unsigned int keylen);
        void (*cit_encrypt_one)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
@@ -57908,9 +60382,10 @@ diff -urNp linux-3.1.3/include/linux/crypto.h linux-3.1.3/include/linux/crypto.h
  
  #define crt_ablkcipher        crt_u.ablkcipher
  #define crt_aead      crt_u.aead
-diff -urNp linux-3.1.3/include/linux/decompress/mm.h linux-3.1.3/include/linux/decompress/mm.h
---- linux-3.1.3/include/linux/decompress/mm.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/decompress/mm.h  2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/decompress/mm.h b/include/linux/decompress/mm.h
+index 7925bf0..d5143d2 100644
+--- a/include/linux/decompress/mm.h
++++ b/include/linux/decompress/mm.h
 @@ -77,7 +77,7 @@ static void free(void *where)
   * warnings when not needed (indeed large_malloc / large_free are not
   * needed by inflate */
@@ -57920,9 +60395,10 @@ diff -urNp linux-3.1.3/include/linux/decompress/mm.h linux-3.1.3/include/linux/d
  #define free(a) kfree(a)
  
  #define large_malloc(a) vmalloc(a)
-diff -urNp linux-3.1.3/include/linux/dma-mapping.h linux-3.1.3/include/linux/dma-mapping.h
---- linux-3.1.3/include/linux/dma-mapping.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/dma-mapping.h    2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
+index 347fdc3..cd01657 100644
+--- a/include/linux/dma-mapping.h
++++ b/include/linux/dma-mapping.h
 @@ -42,7 +42,7 @@ struct dma_map_ops {
        int (*dma_supported)(struct device *dev, u64 mask);
        int (*set_dma_mask)(struct device *dev, u64 mask);
@@ -57932,9 +60408,10 @@ diff -urNp linux-3.1.3/include/linux/dma-mapping.h linux-3.1.3/include/linux/dma
  
  #define DMA_BIT_MASK(n)       (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
  
-diff -urNp linux-3.1.3/include/linux/efi.h linux-3.1.3/include/linux/efi.h
---- linux-3.1.3/include/linux/efi.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/efi.h    2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/efi.h b/include/linux/efi.h
+index 2362a0b..cfaf8fcc 100644
+--- a/include/linux/efi.h
++++ b/include/linux/efi.h
 @@ -446,7 +446,7 @@ struct efivar_operations {
        efi_get_variable_t *get_variable;
        efi_get_next_variable_t *get_next_variable;
@@ -57944,9 +60421,10 @@ diff -urNp linux-3.1.3/include/linux/efi.h linux-3.1.3/include/linux/efi.h
  
  struct efivars {
        /*
-diff -urNp linux-3.1.3/include/linux/elf.h linux-3.1.3/include/linux/elf.h
---- linux-3.1.3/include/linux/elf.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/elf.h    2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/elf.h b/include/linux/elf.h
+index 110821c..cb14c08 100644
+--- a/include/linux/elf.h
++++ b/include/linux/elf.h
 @@ -49,6 +49,17 @@ typedef __s64       Elf64_Sxword;
  #define PT_GNU_EH_FRAME               0x6474e550
  
@@ -58019,10 +60497,11 @@ diff -urNp linux-3.1.3/include/linux/elf.h linux-3.1.3/include/linux/elf.h
  
  #endif
  
-diff -urNp linux-3.1.3/include/linux/filter.h linux-3.1.3/include/linux/filter.h
---- linux-3.1.3/include/linux/filter.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/filter.h 2011-11-20 19:21:53.000000000 -0500
-@@ -134,6 +134,7 @@ struct sock_fprog {        /* Required for SO_A
+diff --git a/include/linux/filter.h b/include/linux/filter.h
+index 741956f..f02f482 100644
+--- a/include/linux/filter.h
++++ b/include/linux/filter.h
+@@ -134,6 +134,7 @@ struct sock_fprog {        /* Required for SO_ATTACH_FILTER. */
  
  struct sk_buff;
  struct sock;
@@ -58040,9 +60519,10 @@ diff -urNp linux-3.1.3/include/linux/filter.h linux-3.1.3/include/linux/filter.h
        struct rcu_head         rcu;
        struct sock_filter      insns[0];
  };
-diff -urNp linux-3.1.3/include/linux/firewire.h linux-3.1.3/include/linux/firewire.h
---- linux-3.1.3/include/linux/firewire.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/firewire.h       2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/firewire.h b/include/linux/firewire.h
+index 84ccf8e..2e9b14c 100644
+--- a/include/linux/firewire.h
++++ b/include/linux/firewire.h
 @@ -428,7 +428,7 @@ struct fw_iso_context {
        union {
                fw_iso_callback_t sc;
@@ -58052,9 +60532,37 @@ diff -urNp linux-3.1.3/include/linux/firewire.h linux-3.1.3/include/linux/firewi
        void *callback_data;
  };
  
-diff -urNp linux-3.1.3/include/linux/fscache-cache.h linux-3.1.3/include/linux/fscache-cache.h
---- linux-3.1.3/include/linux/fscache-cache.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/fscache-cache.h  2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/fs.h b/include/linux/fs.h
+index 277f497..9be66a4 100644
+--- a/include/linux/fs.h
++++ b/include/linux/fs.h
+@@ -1588,7 +1588,8 @@ struct file_operations {
+       int (*setlease)(struct file *, long, struct file_lock **);
+       long (*fallocate)(struct file *file, int mode, loff_t offset,
+                         loff_t len);
+-};
++} __do_const;
++typedef struct file_operations __no_const file_operations_no_const;
+ struct inode_operations {
+       struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *);
+diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h
+index 003dc0f..3c4ea97 100644
+--- a/include/linux/fs_struct.h
++++ b/include/linux/fs_struct.h
+@@ -6,7 +6,7 @@
+ #include <linux/seqlock.h>
+ struct fs_struct {
+-      int users;
++      atomic_t users;
+       spinlock_t lock;
+       seqcount_t seq;
+       int umask;
+diff --git a/include/linux/fscache-cache.h b/include/linux/fscache-cache.h
+index af095b5..cf1220c 100644
+--- a/include/linux/fscache-cache.h
++++ b/include/linux/fscache-cache.h
 @@ -102,7 +102,7 @@ struct fscache_operation {
        fscache_operation_release_t release;
  };
@@ -58064,7 +60572,7 @@ diff -urNp linux-3.1.3/include/linux/fscache-cache.h linux-3.1.3/include/linux/f
  extern void fscache_op_work_func(struct work_struct *work);
  
  extern void fscache_enqueue_operation(struct fscache_operation *);
-@@ -122,7 +122,7 @@ static inline void fscache_operation_ini
+@@ -122,7 +122,7 @@ static inline void fscache_operation_init(struct fscache_operation *op,
  {
        INIT_WORK(&op->work, fscache_op_work_func);
        atomic_set(&op->usage, 1);
@@ -58073,23 +60581,11 @@ diff -urNp linux-3.1.3/include/linux/fscache-cache.h linux-3.1.3/include/linux/f
        op->processor = processor;
        op->release = release;
        INIT_LIST_HEAD(&op->pend_link);
-diff -urNp linux-3.1.3/include/linux/fs.h linux-3.1.3/include/linux/fs.h
---- linux-3.1.3/include/linux/fs.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/fs.h     2011-11-16 23:39:39.000000000 -0500
-@@ -1588,7 +1588,8 @@ struct file_operations {
-       int (*setlease)(struct file *, long, struct file_lock **);
-       long (*fallocate)(struct file *file, int mode, loff_t offset,
-                         loff_t len);
--};
-+} __do_const;
-+typedef struct file_operations __no_const file_operations_no_const;
- struct inode_operations {
-       struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *);
-diff -urNp linux-3.1.3/include/linux/fsnotify.h linux-3.1.3/include/linux/fsnotify.h
---- linux-3.1.3/include/linux/fsnotify.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/fsnotify.h       2011-11-16 18:39:08.000000000 -0500
-@@ -314,7 +314,7 @@ static inline void fsnotify_change(struc
+diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h
+index 2a53f10..0187fdf 100644
+--- a/include/linux/fsnotify.h
++++ b/include/linux/fsnotify.h
+@@ -314,7 +314,7 @@ static inline void fsnotify_change(struct dentry *dentry, unsigned int ia_valid)
   */
  static inline const unsigned char *fsnotify_oldname_init(const unsigned char *name)
  {
@@ -58098,21 +60594,10 @@ diff -urNp linux-3.1.3/include/linux/fsnotify.h linux-3.1.3/include/linux/fsnoti
  }
  
  /*
-diff -urNp linux-3.1.3/include/linux/fs_struct.h linux-3.1.3/include/linux/fs_struct.h
---- linux-3.1.3/include/linux/fs_struct.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/fs_struct.h      2011-11-16 18:39:08.000000000 -0500
-@@ -6,7 +6,7 @@
- #include <linux/seqlock.h>
- struct fs_struct {
--      int users;
-+      atomic_t users;
-       spinlock_t lock;
-       seqcount_t seq;
-       int umask;
-diff -urNp linux-3.1.3/include/linux/ftrace_event.h linux-3.1.3/include/linux/ftrace_event.h
---- linux-3.1.3/include/linux/ftrace_event.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/ftrace_event.h   2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
+index 96efa67..1261547 100644
+--- a/include/linux/ftrace_event.h
++++ b/include/linux/ftrace_event.h
 @@ -97,7 +97,7 @@ struct trace_event_functions {
        trace_print_func        raw;
        trace_print_func        hex;
@@ -58122,7 +60607,7 @@ diff -urNp linux-3.1.3/include/linux/ftrace_event.h linux-3.1.3/include/linux/ft
  
  struct trace_event {
        struct hlist_node               node;
-@@ -252,7 +252,7 @@ extern int trace_define_field(struct ftr
+@@ -252,7 +252,7 @@ extern int trace_define_field(struct ftrace_event_call *call, const char *type,
  extern int trace_add_event_call(struct ftrace_event_call *call);
  extern void trace_remove_event_call(struct ftrace_event_call *call);
  
@@ -58131,9 +60616,10 @@ diff -urNp linux-3.1.3/include/linux/ftrace_event.h linux-3.1.3/include/linux/ft
  
  int trace_set_clr_event(const char *system, const char *event, int set);
  
-diff -urNp linux-3.1.3/include/linux/genhd.h linux-3.1.3/include/linux/genhd.h
---- linux-3.1.3/include/linux/genhd.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/genhd.h  2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/genhd.h b/include/linux/genhd.h
+index 02fa469..a15f279 100644
+--- a/include/linux/genhd.h
++++ b/include/linux/genhd.h
 @@ -184,7 +184,7 @@ struct gendisk {
        struct kobject *slave_dir;
  
@@ -58143,9 +60629,11 @@ diff -urNp linux-3.1.3/include/linux/genhd.h linux-3.1.3/include/linux/genhd.h
        struct disk_events *ev;
  #ifdef  CONFIG_BLK_DEV_INTEGRITY
        struct blk_integrity *integrity;
-diff -urNp linux-3.1.3/include/linux/gracl.h linux-3.1.3/include/linux/gracl.h
---- linux-3.1.3/include/linux/gracl.h  1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/include/linux/gracl.h  2011-11-16 18:40:31.000000000 -0500
+diff --git a/include/linux/gracl.h b/include/linux/gracl.h
+new file mode 100644
+index 0000000..0dc3943
+--- /dev/null
++++ b/include/linux/gracl.h
 @@ -0,0 +1,317 @@
 +#ifndef GR_ACL_H
 +#define GR_ACL_H
@@ -58464,9 +60952,11 @@ diff -urNp linux-3.1.3/include/linux/gracl.h linux-3.1.3/include/linux/gracl.h
 +
 +#endif
 +
-diff -urNp linux-3.1.3/include/linux/gralloc.h linux-3.1.3/include/linux/gralloc.h
---- linux-3.1.3/include/linux/gralloc.h        1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/include/linux/gralloc.h        2011-11-16 18:40:31.000000000 -0500
+diff --git a/include/linux/gralloc.h b/include/linux/gralloc.h
+new file mode 100644
+index 0000000..323ecf2
+--- /dev/null
++++ b/include/linux/gralloc.h
 @@ -0,0 +1,9 @@
 +#ifndef __GRALLOC_H
 +#define __GRALLOC_H
@@ -58477,9 +60967,11 @@ diff -urNp linux-3.1.3/include/linux/gralloc.h linux-3.1.3/include/linux/gralloc
 +void *acl_alloc_num(unsigned long num, unsigned long len);
 +
 +#endif
-diff -urNp linux-3.1.3/include/linux/grdefs.h linux-3.1.3/include/linux/grdefs.h
---- linux-3.1.3/include/linux/grdefs.h 1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/include/linux/grdefs.h 2011-11-16 18:40:31.000000000 -0500
+diff --git a/include/linux/grdefs.h b/include/linux/grdefs.h
+new file mode 100644
+index 0000000..b30e9bc
+--- /dev/null
++++ b/include/linux/grdefs.h
 @@ -0,0 +1,140 @@
 +#ifndef GRDEFS_H
 +#define GRDEFS_H
@@ -58621,9 +61113,11 @@ diff -urNp linux-3.1.3/include/linux/grdefs.h linux-3.1.3/include/linux/grdefs.h
 +};
 +
 +#endif
-diff -urNp linux-3.1.3/include/linux/grinternal.h linux-3.1.3/include/linux/grinternal.h
---- linux-3.1.3/include/linux/grinternal.h     1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/include/linux/grinternal.h     2011-11-16 18:40:31.000000000 -0500
+diff --git a/include/linux/grinternal.h b/include/linux/grinternal.h
+new file mode 100644
+index 0000000..60cda84
+--- /dev/null
++++ b/include/linux/grinternal.h
 @@ -0,0 +1,220 @@
 +#ifndef __GRINTERNAL_H
 +#define __GRINTERNAL_H
@@ -58845,9 +61339,11 @@ diff -urNp linux-3.1.3/include/linux/grinternal.h linux-3.1.3/include/linux/grin
 +#endif
 +
 +#endif
-diff -urNp linux-3.1.3/include/linux/grmsg.h linux-3.1.3/include/linux/grmsg.h
---- linux-3.1.3/include/linux/grmsg.h  1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/include/linux/grmsg.h  2011-11-16 18:40:31.000000000 -0500
+diff --git a/include/linux/grmsg.h b/include/linux/grmsg.h
+new file mode 100644
+index 0000000..9d5fd4a
+--- /dev/null
++++ b/include/linux/grmsg.h
 @@ -0,0 +1,108 @@
 +#define DEFAULTSECMSG "%.256s[%.16s:%d] uid/euid:%u/%u gid/egid:%u/%u, parent %.256s[%.16s:%d] uid/euid:%u/%u gid/egid:%u/%u"
 +#define GR_ACL_PROCACCT_MSG "%.256s[%.16s:%d] IP:%pI4 TTY:%.64s uid/euid:%u/%u gid/egid:%u/%u run time:[%ud %uh %um %us] cpu time:[%ud %uh %um %us] %s with exit code %ld, parent %.256s[%.16s:%d] IP:%pI4 TTY:%.64s uid/euid:%u/%u gid/egid:%u/%u"
@@ -58957,9 +61453,11 @@ diff -urNp linux-3.1.3/include/linux/grmsg.h linux-3.1.3/include/linux/grmsg.h
 +#define GR_VM86_MSG "denied use of vm86 by "
 +#define GR_PTRACE_AUDIT_MSG "process %.950s(%.16s:%d) attached to via ptrace by "
 +#define GR_INIT_TRANSFER_MSG "persistent special role transferred privilege to init by "
-diff -urNp linux-3.1.3/include/linux/grsecurity.h linux-3.1.3/include/linux/grsecurity.h
---- linux-3.1.3/include/linux/grsecurity.h     1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/include/linux/grsecurity.h     2011-11-17 00:16:10.000000000 -0500
+diff --git a/include/linux/grsecurity.h b/include/linux/grsecurity.h
+new file mode 100644
+index 0000000..bd25f72
+--- /dev/null
++++ b/include/linux/grsecurity.h
 @@ -0,0 +1,228 @@
 +#ifndef GR_SECURITY_H
 +#define GR_SECURITY_H
@@ -59189,9 +61687,11 @@ diff -urNp linux-3.1.3/include/linux/grsecurity.h linux-3.1.3/include/linux/grse
 +#endif
 +
 +#endif
-diff -urNp linux-3.1.3/include/linux/grsock.h linux-3.1.3/include/linux/grsock.h
---- linux-3.1.3/include/linux/grsock.h 1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/include/linux/grsock.h 2011-11-16 18:40:31.000000000 -0500
+diff --git a/include/linux/grsock.h b/include/linux/grsock.h
+new file mode 100644
+index 0000000..e7ffaaf
+--- /dev/null
++++ b/include/linux/grsock.h
 @@ -0,0 +1,19 @@
 +#ifndef __GRSOCK_H
 +#define __GRSOCK_H
@@ -59212,9 +61712,10 @@ diff -urNp linux-3.1.3/include/linux/grsock.h linux-3.1.3/include/linux/grsock.h
 +                          const int protocol);
 +
 +#endif
-diff -urNp linux-3.1.3/include/linux/hid.h linux-3.1.3/include/linux/hid.h
---- linux-3.1.3/include/linux/hid.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/hid.h    2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/hid.h b/include/linux/hid.h
+index 9cf8e7a..5ec94d0 100644
+--- a/include/linux/hid.h
++++ b/include/linux/hid.h
 @@ -676,7 +676,7 @@ struct hid_ll_driver {
                        unsigned int code, int value);
  
@@ -59224,10 +61725,11 @@ diff -urNp linux-3.1.3/include/linux/hid.h linux-3.1.3/include/linux/hid.h
  
  #define       PM_HINT_FULLON  1<<5
  #define PM_HINT_NORMAL        1<<1
-diff -urNp linux-3.1.3/include/linux/highmem.h linux-3.1.3/include/linux/highmem.h
---- linux-3.1.3/include/linux/highmem.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/highmem.h        2011-11-16 18:39:08.000000000 -0500
-@@ -185,6 +185,18 @@ static inline void clear_highpage(struct
+diff --git a/include/linux/highmem.h b/include/linux/highmem.h
+index 3a93f73..b19d0b3 100644
+--- a/include/linux/highmem.h
++++ b/include/linux/highmem.h
+@@ -185,6 +185,18 @@ static inline void clear_highpage(struct page *page)
        kunmap_atomic(kaddr, KM_USER0);
  }
  
@@ -59246,9 +61748,10 @@ diff -urNp linux-3.1.3/include/linux/highmem.h linux-3.1.3/include/linux/highmem
  static inline void zero_user_segments(struct page *page,
        unsigned start1, unsigned end1,
        unsigned start2, unsigned end2)
-diff -urNp linux-3.1.3/include/linux/i2c.h linux-3.1.3/include/linux/i2c.h
---- linux-3.1.3/include/linux/i2c.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/i2c.h    2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/i2c.h b/include/linux/i2c.h
+index a6c652e..1f5878f 100644
+--- a/include/linux/i2c.h
++++ b/include/linux/i2c.h
 @@ -346,6 +346,7 @@ struct i2c_algorithm {
        /* To determine what the adapter supports */
        u32 (*functionality) (struct i2c_adapter *);
@@ -59257,9 +61760,10 @@ diff -urNp linux-3.1.3/include/linux/i2c.h linux-3.1.3/include/linux/i2c.h
  
  /*
   * i2c_adapter is the structure used to identify a physical i2c bus along
-diff -urNp linux-3.1.3/include/linux/i2o.h linux-3.1.3/include/linux/i2o.h
---- linux-3.1.3/include/linux/i2o.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/i2o.h    2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/i2o.h b/include/linux/i2o.h
+index a6deef4..c56a7f2 100644
+--- a/include/linux/i2o.h
++++ b/include/linux/i2o.h
 @@ -564,7 +564,7 @@ struct i2o_controller {
        struct i2o_device *exec;        /* Executive */
  #if BITS_PER_LONG == 64
@@ -59269,10 +61773,11 @@ diff -urNp linux-3.1.3/include/linux/i2o.h linux-3.1.3/include/linux/i2o.h
        struct list_head context_list;  /* list of context id's
                                           and pointers */
  #endif
-diff -urNp linux-3.1.3/include/linux/init.h linux-3.1.3/include/linux/init.h
---- linux-3.1.3/include/linux/init.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/init.h   2011-11-16 18:39:08.000000000 -0500
-@@ -293,13 +293,13 @@ void __init parse_early_options(char *cm
+diff --git a/include/linux/init.h b/include/linux/init.h
+index 9146f39..885354d 100644
+--- a/include/linux/init.h
++++ b/include/linux/init.h
+@@ -293,13 +293,13 @@ void __init parse_early_options(char *cmdline);
  
  /* Each module must use one module_init(). */
  #define module_init(initfn)                                   \
@@ -59288,9 +61793,10 @@ diff -urNp linux-3.1.3/include/linux/init.h linux-3.1.3/include/linux/init.h
        { return exitfn; }                                      \
        void cleanup_module(void) __attribute__((alias(#exitfn)));
  
-diff -urNp linux-3.1.3/include/linux/init_task.h linux-3.1.3/include/linux/init_task.h
---- linux-3.1.3/include/linux/init_task.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/init_task.h      2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/init_task.h b/include/linux/init_task.h
+index d14e058..4162929 100644
+--- a/include/linux/init_task.h
++++ b/include/linux/init_task.h
 @@ -126,6 +126,12 @@ extern struct cred init_cred;
  # define INIT_PERF_EVENTS(tsk)
  #endif
@@ -59312,9 +61818,10 @@ diff -urNp linux-3.1.3/include/linux/init_task.h linux-3.1.3/include/linux/init_
        .fs             = &init_fs,                                     \
        .files          = &init_files,                                  \
        .signal         = &init_signals,                                \
-diff -urNp linux-3.1.3/include/linux/intel-iommu.h linux-3.1.3/include/linux/intel-iommu.h
---- linux-3.1.3/include/linux/intel-iommu.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/intel-iommu.h    2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h
+index 9310c69..6ebb244 100644
+--- a/include/linux/intel-iommu.h
++++ b/include/linux/intel-iommu.h
 @@ -296,7 +296,7 @@ struct iommu_flush {
                              u8 fm, u64 type);
        void (*flush_iotlb)(struct intel_iommu *iommu, u16 did, u64 addr,
@@ -59324,9 +61831,10 @@ diff -urNp linux-3.1.3/include/linux/intel-iommu.h linux-3.1.3/include/linux/int
  
  enum {
        SR_DMAR_FECTL_REG,
-diff -urNp linux-3.1.3/include/linux/interrupt.h linux-3.1.3/include/linux/interrupt.h
---- linux-3.1.3/include/linux/interrupt.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/interrupt.h      2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
+index f51a81b..adfcb44 100644
+--- a/include/linux/interrupt.h
++++ b/include/linux/interrupt.h
 @@ -425,7 +425,7 @@ enum
  /* map softirq index to softirq name. update 'softirq_to_name' in
   * kernel/softirq.c when adding a new softirq.
@@ -59336,7 +61844,7 @@ diff -urNp linux-3.1.3/include/linux/interrupt.h linux-3.1.3/include/linux/inter
  
  /* softirq mask and active fields moved to irq_cpustat_t in
   * asm/hardirq.h to get better cache usage.  KAO
-@@ -433,12 +433,12 @@ extern char *softirq_to_name[NR_SOFTIRQS
+@@ -433,12 +433,12 @@ extern char *softirq_to_name[NR_SOFTIRQS];
  
  struct softirq_action
  {
@@ -59351,9 +61859,10 @@ diff -urNp linux-3.1.3/include/linux/interrupt.h linux-3.1.3/include/linux/inter
  extern void softirq_init(void);
  static inline void __raise_softirq_irqoff(unsigned int nr)
  {
-diff -urNp linux-3.1.3/include/linux/kallsyms.h linux-3.1.3/include/linux/kallsyms.h
---- linux-3.1.3/include/linux/kallsyms.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/kallsyms.h       2011-11-16 18:40:31.000000000 -0500
+diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
+index 0df513b..fe901a2 100644
+--- a/include/linux/kallsyms.h
++++ b/include/linux/kallsyms.h
 @@ -15,7 +15,8 @@
  
  struct module;
@@ -59364,7 +61873,7 @@ diff -urNp linux-3.1.3/include/linux/kallsyms.h linux-3.1.3/include/linux/kallsy
  /* Lookup the address for a symbol. Returns 0 if not found. */
  unsigned long kallsyms_lookup_name(const char *name);
  
-@@ -99,6 +100,16 @@ static inline int lookup_symbol_attrs(un
+@@ -99,6 +100,16 @@ static inline int lookup_symbol_attrs(unsigned long addr, unsigned long *size, u
  /* Stupid that this does nothing, but I didn't create this mess. */
  #define __print_symbol(fmt, addr)
  #endif /*CONFIG_KALLSYMS*/
@@ -59381,9 +61890,10 @@ diff -urNp linux-3.1.3/include/linux/kallsyms.h linux-3.1.3/include/linux/kallsy
  
  /* This macro allows us to keep printk typechecking */
  static void __check_printsym_format(const char *fmt, ...)
-diff -urNp linux-3.1.3/include/linux/kgdb.h linux-3.1.3/include/linux/kgdb.h
---- linux-3.1.3/include/linux/kgdb.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/kgdb.h   2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h
+index fa39183..40160be 100644
+--- a/include/linux/kgdb.h
++++ b/include/linux/kgdb.h
 @@ -53,7 +53,7 @@ extern int kgdb_connected;
  extern int kgdb_io_module_registered;
  
@@ -59411,10 +61921,11 @@ diff -urNp linux-3.1.3/include/linux/kgdb.h linux-3.1.3/include/linux/kgdb.h
  
  extern struct kgdb_arch               arch_kgdb_ops;
  
-diff -urNp linux-3.1.3/include/linux/kmod.h linux-3.1.3/include/linux/kmod.h
---- linux-3.1.3/include/linux/kmod.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/kmod.h   2011-11-16 18:40:31.000000000 -0500
-@@ -34,6 +34,8 @@ extern char modprobe_path[]; /* for sysc
+diff --git a/include/linux/kmod.h b/include/linux/kmod.h
+index 0da38cf..d23f05f 100644
+--- a/include/linux/kmod.h
++++ b/include/linux/kmod.h
+@@ -34,6 +34,8 @@ extern char modprobe_path[]; /* for sysctl */
   * usually useless though. */
  extern int __request_module(bool wait, const char *name, ...) \
        __attribute__((format(printf, 2, 3)));
@@ -59423,10 +61934,11 @@ diff -urNp linux-3.1.3/include/linux/kmod.h linux-3.1.3/include/linux/kmod.h
  #define request_module(mod...) __request_module(true, mod)
  #define request_module_nowait(mod...) __request_module(false, mod)
  #define try_then_request_module(x, mod...) \
-diff -urNp linux-3.1.3/include/linux/kvm_host.h linux-3.1.3/include/linux/kvm_host.h
---- linux-3.1.3/include/linux/kvm_host.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/kvm_host.h       2011-11-16 18:39:08.000000000 -0500
-@@ -308,7 +308,7 @@ void kvm_vcpu_uninit(struct kvm_vcpu *vc
+diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
+index eabb21a..3f030f4 100644
+--- a/include/linux/kvm_host.h
++++ b/include/linux/kvm_host.h
+@@ -308,7 +308,7 @@ void kvm_vcpu_uninit(struct kvm_vcpu *vcpu);
  void vcpu_load(struct kvm_vcpu *vcpu);
  void vcpu_put(struct kvm_vcpu *vcpu);
  
@@ -59435,7 +61947,7 @@ diff -urNp linux-3.1.3/include/linux/kvm_host.h linux-3.1.3/include/linux/kvm_ho
                  struct module *module);
  void kvm_exit(void);
  
-@@ -454,7 +454,7 @@ int kvm_arch_vcpu_ioctl_set_guest_debug(
+@@ -454,7 +454,7 @@ int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,
                                        struct kvm_guest_debug *dbg);
  int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run);
  
@@ -59444,9 +61956,10 @@ diff -urNp linux-3.1.3/include/linux/kvm_host.h linux-3.1.3/include/linux/kvm_ho
  void kvm_arch_exit(void);
  
  int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu);
-diff -urNp linux-3.1.3/include/linux/libata.h linux-3.1.3/include/linux/libata.h
---- linux-3.1.3/include/linux/libata.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/libata.h 2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/libata.h b/include/linux/libata.h
+index efd6f98..5f5fd37 100644
+--- a/include/linux/libata.h
++++ b/include/linux/libata.h
 @@ -909,7 +909,7 @@ struct ata_port_operations {
         * fields must be pointers.
         */
@@ -59456,9 +61969,10 @@ diff -urNp linux-3.1.3/include/linux/libata.h linux-3.1.3/include/linux/libata.h
  
  struct ata_port_info {
        unsigned long           flags;
-diff -urNp linux-3.1.3/include/linux/mca.h linux-3.1.3/include/linux/mca.h
---- linux-3.1.3/include/linux/mca.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/mca.h    2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/mca.h b/include/linux/mca.h
+index 3797270..7765ede 100644
+--- a/include/linux/mca.h
++++ b/include/linux/mca.h
 @@ -80,7 +80,7 @@ struct mca_bus_accessor_functions {
                                                  int region);
        void *          (*mca_transform_memory)(struct mca_device *,
@@ -59468,9 +61982,10 @@ diff -urNp linux-3.1.3/include/linux/mca.h linux-3.1.3/include/linux/mca.h
  
  struct mca_bus {
        u64                     default_dma_mask;
-diff -urNp linux-3.1.3/include/linux/memory.h linux-3.1.3/include/linux/memory.h
---- linux-3.1.3/include/linux/memory.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/memory.h 2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/memory.h b/include/linux/memory.h
+index 935699b..11042cc 100644
+--- a/include/linux/memory.h
++++ b/include/linux/memory.h
 @@ -144,7 +144,7 @@ struct memory_accessor {
                        size_t count);
        ssize_t (*write)(struct memory_accessor *, const char *buf,
@@ -59480,9 +61995,10 @@ diff -urNp linux-3.1.3/include/linux/memory.h linux-3.1.3/include/linux/memory.h
  
  /*
   * Kernel text modification mutex, used for code patching. Users of this lock
-diff -urNp linux-3.1.3/include/linux/mfd/abx500.h linux-3.1.3/include/linux/mfd/abx500.h
---- linux-3.1.3/include/linux/mfd/abx500.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/mfd/abx500.h     2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/mfd/abx500.h b/include/linux/mfd/abx500.h
+index 896b5e4..1159ad0 100644
+--- a/include/linux/mfd/abx500.h
++++ b/include/linux/mfd/abx500.h
 @@ -234,6 +234,7 @@ struct abx500_ops {
        int (*event_registers_startup_state_get) (struct device *, u8 *);
        int (*startup_irq_enabled) (struct device *, unsigned int);
@@ -59491,10 +62007,11 @@ diff -urNp linux-3.1.3/include/linux/mfd/abx500.h linux-3.1.3/include/linux/mfd/
  
  int abx500_register_ops(struct device *core_dev, struct abx500_ops *ops);
  void abx500_remove_ops(struct device *dev);
-diff -urNp linux-3.1.3/include/linux/mm.h linux-3.1.3/include/linux/mm.h
---- linux-3.1.3/include/linux/mm.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/mm.h     2011-11-16 18:39:08.000000000 -0500
-@@ -114,7 +114,14 @@ extern unsigned int kobjsize(const void 
+diff --git a/include/linux/mm.h b/include/linux/mm.h
+index fedc5f0..7cedb6d 100644
+--- a/include/linux/mm.h
++++ b/include/linux/mm.h
+@@ -114,7 +114,14 @@ extern unsigned int kobjsize(const void *objp);
  
  #define VM_CAN_NONLINEAR 0x08000000   /* Has ->fault & does nonlinear pages */
  #define VM_MIXEDMAP   0x10000000      /* Can contain "struct page" and pure PFN pages */
@@ -59544,7 +62061,7 @@ diff -urNp linux-3.1.3/include/linux/mm.h linux-3.1.3/include/linux/mm.h
  extern unsigned long move_page_tables(struct vm_area_struct *vma,
                unsigned long old_addr, struct vm_area_struct *new_vma,
                unsigned long new_addr, unsigned long len);
-@@ -1133,6 +1112,15 @@ static inline void sync_mm_rss(struct ta
+@@ -1133,6 +1112,15 @@ static inline void sync_mm_rss(struct task_struct *task, struct mm_struct *mm)
  }
  #endif
  
@@ -59568,7 +62085,7 @@ diff -urNp linux-3.1.3/include/linux/mm.h linux-3.1.3/include/linux/mm.h
  
  extern unsigned long do_brk(unsigned long, unsigned long);
  
-@@ -1474,6 +1463,10 @@ extern struct vm_area_struct * find_vma(
+@@ -1474,6 +1463,10 @@ extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long add
  extern struct vm_area_struct * find_vma_prev(struct mm_struct * mm, unsigned long addr,
                                             struct vm_area_struct **pprev);
  
@@ -59579,7 +62096,7 @@ diff -urNp linux-3.1.3/include/linux/mm.h linux-3.1.3/include/linux/mm.h
  /* Look up the first VMA which intersects the interval start_addr..end_addr-1,
     NULL if none.  Assume start_addr < end_addr. */
  static inline struct vm_area_struct * find_vma_intersection(struct mm_struct * mm, unsigned long start_addr, unsigned long end_addr)
-@@ -1490,15 +1483,6 @@ static inline unsigned long vma_pages(st
+@@ -1490,15 +1483,6 @@ static inline unsigned long vma_pages(struct vm_area_struct *vma)
        return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
  }
  
@@ -59595,7 +62112,7 @@ diff -urNp linux-3.1.3/include/linux/mm.h linux-3.1.3/include/linux/mm.h
  struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr);
  int remap_pfn_range(struct vm_area_struct *, unsigned long addr,
                        unsigned long pfn, unsigned long size, pgprot_t);
-@@ -1612,7 +1596,7 @@ extern int unpoison_memory(unsigned long
+@@ -1612,7 +1596,7 @@ extern int unpoison_memory(unsigned long pfn);
  extern int sysctl_memory_failure_early_kill;
  extern int sysctl_memory_failure_recovery;
  extern void shake_page(struct page *p, int access);
@@ -59604,7 +62121,7 @@ diff -urNp linux-3.1.3/include/linux/mm.h linux-3.1.3/include/linux/mm.h
  extern int soft_offline_page(struct page *page, int flags);
  
  extern void dump_page(struct page *page);
-@@ -1626,5 +1610,11 @@ extern void copy_user_huge_page(struct p
+@@ -1626,5 +1610,11 @@ extern void copy_user_huge_page(struct page *dst, struct page *src,
                                unsigned int pages_per_huge_page);
  #endif /* CONFIG_TRANSPARENT_HUGEPAGE || CONFIG_HUGETLBFS */
  
@@ -59616,9 +62133,10 @@ diff -urNp linux-3.1.3/include/linux/mm.h linux-3.1.3/include/linux/mm.h
 +
  #endif /* __KERNEL__ */
  #endif /* _LINUX_MM_H */
-diff -urNp linux-3.1.3/include/linux/mm_types.h linux-3.1.3/include/linux/mm_types.h
---- linux-3.1.3/include/linux/mm_types.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/mm_types.h       2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
+index 10a2f62..c8fa287 100644
+--- a/include/linux/mm_types.h
++++ b/include/linux/mm_types.h
 @@ -230,6 +230,8 @@ struct vm_area_struct {
  #ifdef CONFIG_NUMA
        struct mempolicy *vm_policy;    /* NUMA policy for the VMA */
@@ -59653,10 +62171,11 @@ diff -urNp linux-3.1.3/include/linux/mm_types.h linux-3.1.3/include/linux/mm_typ
  };
  
  static inline void mm_init_cpumask(struct mm_struct *mm)
-diff -urNp linux-3.1.3/include/linux/mmu_notifier.h linux-3.1.3/include/linux/mmu_notifier.h
---- linux-3.1.3/include/linux/mmu_notifier.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/mmu_notifier.h   2011-11-16 18:39:08.000000000 -0500
-@@ -255,12 +255,12 @@ static inline void mmu_notifier_mm_destr
+diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h
+index 1d1b1e1..2a13c78 100644
+--- a/include/linux/mmu_notifier.h
++++ b/include/linux/mmu_notifier.h
+@@ -255,12 +255,12 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm)
   */
  #define ptep_clear_flush_notify(__vma, __address, __ptep)             \
  ({                                                                    \
@@ -59672,9 +62191,10 @@ diff -urNp linux-3.1.3/include/linux/mmu_notifier.h linux-3.1.3/include/linux/mm
  })
  
  #define pmdp_clear_flush_notify(__vma, __address, __pmdp)             \
-diff -urNp linux-3.1.3/include/linux/mmzone.h linux-3.1.3/include/linux/mmzone.h
---- linux-3.1.3/include/linux/mmzone.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/mmzone.h 2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
+index be1ac8d..26868ce 100644
+--- a/include/linux/mmzone.h
++++ b/include/linux/mmzone.h
 @@ -356,7 +356,7 @@ struct zone {
        unsigned long           flags;             /* zone flags, see below */
  
@@ -59684,9 +62204,10 @@ diff -urNp linux-3.1.3/include/linux/mmzone.h linux-3.1.3/include/linux/mmzone.h
  
        /*
         * The target ratio of ACTIVE_ANON to INACTIVE_ANON pages on
-diff -urNp linux-3.1.3/include/linux/mod_devicetable.h linux-3.1.3/include/linux/mod_devicetable.h
---- linux-3.1.3/include/linux/mod_devicetable.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/mod_devicetable.h        2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
+index ae28e93..1ac2233 100644
+--- a/include/linux/mod_devicetable.h
++++ b/include/linux/mod_devicetable.h
 @@ -12,7 +12,7 @@
  typedef unsigned long kernel_ulong_t;
  #endif
@@ -59705,9 +62226,10 @@ diff -urNp linux-3.1.3/include/linux/mod_devicetable.h linux-3.1.3/include/linux
  
  struct hid_device_id {
        __u16 bus;
-diff -urNp linux-3.1.3/include/linux/module.h linux-3.1.3/include/linux/module.h
---- linux-3.1.3/include/linux/module.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/module.h 2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/module.h b/include/linux/module.h
+index 1c30087..fc2a442 100644
+--- a/include/linux/module.h
++++ b/include/linux/module.h
 @@ -16,6 +16,7 @@
  #include <linux/kobject.h>
  #include <linux/moduleparam.h>
@@ -59751,7 +62273,7 @@ diff -urNp linux-3.1.3/include/linux/module.h linux-3.1.3/include/linux/module.h
  #endif
  #ifdef CONFIG_FTRACE_MCOUNT_RECORD
        unsigned int num_ftrace_callsites;
-@@ -445,16 +447,46 @@ bool is_module_address(unsigned long add
+@@ -445,16 +447,46 @@ bool is_module_address(unsigned long addr);
  bool is_module_percpu_address(unsigned long addr);
  bool is_module_text_address(unsigned long addr);
  
@@ -59802,10 +62324,11 @@ diff -urNp linux-3.1.3/include/linux/module.h linux-3.1.3/include/linux/module.h
  }
  
  /* Search for module by name: must hold module_mutex. */
-diff -urNp linux-3.1.3/include/linux/moduleloader.h linux-3.1.3/include/linux/moduleloader.h
---- linux-3.1.3/include/linux/moduleloader.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/moduleloader.h   2011-11-16 18:39:08.000000000 -0500
-@@ -25,9 +25,21 @@ unsigned int arch_mod_section_prepend(st
+diff --git a/include/linux/moduleloader.h b/include/linux/moduleloader.h
+index b2be02e..6a9fdb1 100644
+--- a/include/linux/moduleloader.h
++++ b/include/linux/moduleloader.h
+@@ -25,9 +25,21 @@ unsigned int arch_mod_section_prepend(struct module *mod, unsigned int section);
     sections.  Returns NULL on failure. */
  void *module_alloc(unsigned long size);
  
@@ -59827,10 +62350,11 @@ diff -urNp linux-3.1.3/include/linux/moduleloader.h linux-3.1.3/include/linux/mo
  /* Apply the given relocation to the (simplified) ELF.  Return -error
     or 0. */
  int apply_relocate(Elf_Shdr *sechdrs,
-diff -urNp linux-3.1.3/include/linux/moduleparam.h linux-3.1.3/include/linux/moduleparam.h
---- linux-3.1.3/include/linux/moduleparam.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/moduleparam.h    2011-11-16 18:39:08.000000000 -0500
-@@ -255,7 +255,7 @@ static inline void __kernel_param_unlock
+diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
+index ddaae98..3c70938 100644
+--- a/include/linux/moduleparam.h
++++ b/include/linux/moduleparam.h
+@@ -255,7 +255,7 @@ static inline void __kernel_param_unlock(void)
   * @len is usually just sizeof(string).
   */
  #define module_param_string(name, string, len, perm)                  \
@@ -59839,7 +62363,7 @@ diff -urNp linux-3.1.3/include/linux/moduleparam.h linux-3.1.3/include/linux/mod
                = { len, string };                                      \
        __module_param_call(MODULE_PARAM_PREFIX, name,                  \
                            &param_ops_string,                          \
-@@ -370,7 +370,7 @@ extern int param_get_invbool(char *buffe
+@@ -370,7 +370,7 @@ extern int param_get_invbool(char *buffer, const struct kernel_param *kp);
   * module_param_named() for why this might be necessary.
   */
  #define module_param_array_named(name, array, type, nump, perm)               \
@@ -59848,9 +62372,10 @@ diff -urNp linux-3.1.3/include/linux/moduleparam.h linux-3.1.3/include/linux/mod
        = { .max = ARRAY_SIZE(array), .num = nump,                      \
            .ops = &param_ops_##type,                                   \
            .elemsize = sizeof(array[0]), .elem = array };              \
-diff -urNp linux-3.1.3/include/linux/namei.h linux-3.1.3/include/linux/namei.h
---- linux-3.1.3/include/linux/namei.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/namei.h  2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/namei.h b/include/linux/namei.h
+index ffc0213..2c1f2cb 100644
+--- a/include/linux/namei.h
++++ b/include/linux/namei.h
 @@ -24,7 +24,7 @@ struct nameidata {
        unsigned        seq;
        int             last_type;
@@ -59875,9 +62400,10 @@ diff -urNp linux-3.1.3/include/linux/namei.h linux-3.1.3/include/linux/namei.h
  {
        return nd->saved_names[nd->depth];
  }
-diff -urNp linux-3.1.3/include/linux/netdevice.h linux-3.1.3/include/linux/netdevice.h
---- linux-3.1.3/include/linux/netdevice.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/netdevice.h      2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
+index ddee79b..67af106 100644
+--- a/include/linux/netdevice.h
++++ b/include/linux/netdevice.h
 @@ -944,6 +944,7 @@ struct net_device_ops {
        int                     (*ndo_set_features)(struct net_device *dev,
                                                    u32 features);
@@ -59886,9 +62412,11 @@ diff -urNp linux-3.1.3/include/linux/netdevice.h linux-3.1.3/include/linux/netde
  
  /*
   *    The DEVICE structure.
-diff -urNp linux-3.1.3/include/linux/netfilter/xt_gradm.h linux-3.1.3/include/linux/netfilter/xt_gradm.h
---- linux-3.1.3/include/linux/netfilter/xt_gradm.h     1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/include/linux/netfilter/xt_gradm.h     2011-11-16 18:40:31.000000000 -0500
+diff --git a/include/linux/netfilter/xt_gradm.h b/include/linux/netfilter/xt_gradm.h
+new file mode 100644
+index 0000000..33f4af8
+--- /dev/null
++++ b/include/linux/netfilter/xt_gradm.h
 @@ -0,0 +1,9 @@
 +#ifndef _LINUX_NETFILTER_XT_GRADM_H
 +#define _LINUX_NETFILTER_XT_GRADM_H 1
@@ -59899,9 +62427,10 @@ diff -urNp linux-3.1.3/include/linux/netfilter/xt_gradm.h linux-3.1.3/include/li
 +};
 +
 +#endif
-diff -urNp linux-3.1.3/include/linux/of_pdt.h linux-3.1.3/include/linux/of_pdt.h
---- linux-3.1.3/include/linux/of_pdt.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/of_pdt.h 2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/of_pdt.h b/include/linux/of_pdt.h
+index c65a18a..0c05f3a 100644
+--- a/include/linux/of_pdt.h
++++ b/include/linux/of_pdt.h
 @@ -32,7 +32,7 @@ struct of_pdt_ops {
  
        /* return 0 on success; fill in 'len' with number of bytes in path */
@@ -59911,10 +62440,11 @@ diff -urNp linux-3.1.3/include/linux/of_pdt.h linux-3.1.3/include/linux/of_pdt.h
  
  extern void *prom_early_alloc(unsigned long size);
  
-diff -urNp linux-3.1.3/include/linux/oprofile.h linux-3.1.3/include/linux/oprofile.h
---- linux-3.1.3/include/linux/oprofile.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/oprofile.h       2011-11-16 18:39:08.000000000 -0500
-@@ -139,9 +139,9 @@ int oprofilefs_create_ulong(struct super
+diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h
+index 49c8727..34d2ae1 100644
+--- a/include/linux/oprofile.h
++++ b/include/linux/oprofile.h
+@@ -139,9 +139,9 @@ int oprofilefs_create_ulong(struct super_block * sb, struct dentry * root,
  int oprofilefs_create_ro_ulong(struct super_block * sb, struct dentry * root,
        char const * name, ulong * val);
   
@@ -59926,9 +62456,10 @@ diff -urNp linux-3.1.3/include/linux/oprofile.h linux-3.1.3/include/linux/oprofi
   
  /** create a directory */
  struct dentry * oprofilefs_mkdir(struct super_block * sb, struct dentry * root,
-diff -urNp linux-3.1.3/include/linux/padata.h linux-3.1.3/include/linux/padata.h
---- linux-3.1.3/include/linux/padata.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/padata.h 2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/padata.h b/include/linux/padata.h
+index 4633b2f..988bc08 100644
+--- a/include/linux/padata.h
++++ b/include/linux/padata.h
 @@ -129,7 +129,7 @@ struct parallel_data {
        struct padata_instance          *pinst;
        struct padata_parallel_queue    __percpu *pqueue;
@@ -59938,9 +62469,10 @@ diff -urNp linux-3.1.3/include/linux/padata.h linux-3.1.3/include/linux/padata.h
        atomic_t                        reorder_objects;
        atomic_t                        refcnt;
        unsigned int                    max_seq_nr;
-diff -urNp linux-3.1.3/include/linux/perf_event.h linux-3.1.3/include/linux/perf_event.h
---- linux-3.1.3/include/linux/perf_event.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/perf_event.h     2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
+index c816075..cd28c4d 100644
+--- a/include/linux/perf_event.h
++++ b/include/linux/perf_event.h
 @@ -745,8 +745,8 @@ struct perf_event {
  
        enum perf_event_active_state    state;
@@ -59963,9 +62495,10 @@ diff -urNp linux-3.1.3/include/linux/perf_event.h linux-3.1.3/include/linux/perf
  
        /*
         * Protect attach/detach and child_list:
-diff -urNp linux-3.1.3/include/linux/pipe_fs_i.h linux-3.1.3/include/linux/pipe_fs_i.h
---- linux-3.1.3/include/linux/pipe_fs_i.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/pipe_fs_i.h      2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
+index 77257c9..51d473a 100644
+--- a/include/linux/pipe_fs_i.h
++++ b/include/linux/pipe_fs_i.h
 @@ -46,9 +46,9 @@ struct pipe_buffer {
  struct pipe_inode_info {
        wait_queue_head_t wait;
@@ -59979,10 +62512,11 @@ diff -urNp linux-3.1.3/include/linux/pipe_fs_i.h linux-3.1.3/include/linux/pipe_
        unsigned int r_counter;
        unsigned int w_counter;
        struct page *tmp_page;
-diff -urNp linux-3.1.3/include/linux/pm_runtime.h linux-3.1.3/include/linux/pm_runtime.h
---- linux-3.1.3/include/linux/pm_runtime.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/pm_runtime.h     2011-11-16 18:39:08.000000000 -0500
-@@ -99,7 +99,7 @@ static inline bool pm_runtime_callbacks_
+diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
+index daac05d..c6802ce 100644
+--- a/include/linux/pm_runtime.h
++++ b/include/linux/pm_runtime.h
+@@ -99,7 +99,7 @@ static inline bool pm_runtime_callbacks_present(struct device *dev)
  
  static inline void pm_runtime_mark_last_busy(struct device *dev)
  {
@@ -59991,9 +62525,10 @@ diff -urNp linux-3.1.3/include/linux/pm_runtime.h linux-3.1.3/include/linux/pm_r
  }
  
  #else /* !CONFIG_PM_RUNTIME */
-diff -urNp linux-3.1.3/include/linux/poison.h linux-3.1.3/include/linux/poison.h
---- linux-3.1.3/include/linux/poison.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/poison.h 2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/poison.h b/include/linux/poison.h
+index 79159de..f1233a9 100644
+--- a/include/linux/poison.h
++++ b/include/linux/poison.h
 @@ -19,8 +19,8 @@
   * under normal circumstances, used to verify that nobody uses
   * non-initialized list entries.
@@ -60005,9 +62540,10 @@ diff -urNp linux-3.1.3/include/linux/poison.h linux-3.1.3/include/linux/poison.h
  
  /********** include/linux/timer.h **********/
  /*
-diff -urNp linux-3.1.3/include/linux/preempt.h linux-3.1.3/include/linux/preempt.h
---- linux-3.1.3/include/linux/preempt.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/preempt.h        2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/preempt.h b/include/linux/preempt.h
+index 58969b2..ead129b 100644
+--- a/include/linux/preempt.h
++++ b/include/linux/preempt.h
 @@ -123,7 +123,7 @@ struct preempt_ops {
        void (*sched_in)(struct preempt_notifier *notifier, int cpu);
        void (*sched_out)(struct preempt_notifier *notifier,
@@ -60017,10 +62553,11 @@ diff -urNp linux-3.1.3/include/linux/preempt.h linux-3.1.3/include/linux/preempt
  
  /**
   * preempt_notifier - key for installing preemption notifiers
-diff -urNp linux-3.1.3/include/linux/proc_fs.h linux-3.1.3/include/linux/proc_fs.h
---- linux-3.1.3/include/linux/proc_fs.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/proc_fs.h        2011-11-16 18:40:31.000000000 -0500
-@@ -155,6 +155,19 @@ static inline struct proc_dir_entry *pro
+diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
+index 643b96c..ef55a9c 100644
+--- a/include/linux/proc_fs.h
++++ b/include/linux/proc_fs.h
+@@ -155,6 +155,19 @@ static inline struct proc_dir_entry *proc_create(const char *name, mode_t mode,
        return proc_create_data(name, mode, parent, proc_fops, NULL);
  }
  
@@ -60049,10 +62586,11 @@ diff -urNp linux-3.1.3/include/linux/proc_fs.h linux-3.1.3/include/linux/proc_fs
  
  struct ctl_table_header;
  struct ctl_table;
-diff -urNp linux-3.1.3/include/linux/ptrace.h linux-3.1.3/include/linux/ptrace.h
---- linux-3.1.3/include/linux/ptrace.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/ptrace.h 2011-11-16 18:40:31.000000000 -0500
-@@ -129,10 +129,10 @@ extern void __ptrace_unlink(struct task_
+diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
+index 800f113..af90cc8 100644
+--- a/include/linux/ptrace.h
++++ b/include/linux/ptrace.h
+@@ -129,10 +129,10 @@ extern void __ptrace_unlink(struct task_struct *child);
  extern void exit_ptrace(struct task_struct *tracer);
  #define PTRACE_MODE_READ   1
  #define PTRACE_MODE_ATTACH 2
@@ -60065,9 +62603,10 @@ diff -urNp linux-3.1.3/include/linux/ptrace.h linux-3.1.3/include/linux/ptrace.h
  
  static inline int ptrace_reparented(struct task_struct *child)
  {
-diff -urNp linux-3.1.3/include/linux/random.h linux-3.1.3/include/linux/random.h
---- linux-3.1.3/include/linux/random.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/random.h 2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/random.h b/include/linux/random.h
+index d13059f..2eaafaa 100644
+--- a/include/linux/random.h
++++ b/include/linux/random.h
 @@ -69,12 +69,17 @@ void srandom32(u32 seed);
  
  u32 prandom32(struct rnd_state *);
@@ -60087,10 +62626,11 @@ diff -urNp linux-3.1.3/include/linux/random.h linux-3.1.3/include/linux/random.h
  }
  
  /**
-diff -urNp linux-3.1.3/include/linux/reboot.h linux-3.1.3/include/linux/reboot.h
---- linux-3.1.3/include/linux/reboot.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/reboot.h 2011-11-16 18:39:08.000000000 -0500
-@@ -52,9 +52,9 @@ extern int unregister_reboot_notifier(st
+diff --git a/include/linux/reboot.h b/include/linux/reboot.h
+index e0879a7..a12f962 100644
+--- a/include/linux/reboot.h
++++ b/include/linux/reboot.h
+@@ -52,9 +52,9 @@ extern int unregister_reboot_notifier(struct notifier_block *);
   * Architecture-specific implementations of sys_reboot commands.
   */
  
@@ -60103,7 +62643,7 @@ diff -urNp linux-3.1.3/include/linux/reboot.h linux-3.1.3/include/linux/reboot.h
  
  extern void machine_shutdown(void);
  struct pt_regs;
-@@ -65,9 +65,9 @@ extern void machine_crash_shutdown(struc
+@@ -65,9 +65,9 @@ extern void machine_crash_shutdown(struct pt_regs *);
   */
  
  extern void kernel_restart_prepare(char *cmd);
@@ -60125,10 +62665,11 @@ diff -urNp linux-3.1.3/include/linux/reboot.h linux-3.1.3/include/linux/reboot.h
  #include <asm/emergency-restart.h>
  
  #endif
-diff -urNp linux-3.1.3/include/linux/reiserfs_fs.h linux-3.1.3/include/linux/reiserfs_fs.h
---- linux-3.1.3/include/linux/reiserfs_fs.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/reiserfs_fs.h    2011-11-16 18:39:08.000000000 -0500
-@@ -1406,7 +1406,7 @@ static inline loff_t max_reiserfs_offset
+diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
+index 96d465f..b084e05 100644
+--- a/include/linux/reiserfs_fs.h
++++ b/include/linux/reiserfs_fs.h
+@@ -1406,7 +1406,7 @@ static inline loff_t max_reiserfs_offset(struct inode *inode)
  #define REISERFS_USER_MEM             1       /* reiserfs user memory mode            */
  
  #define fs_generation(s) (REISERFS_SB(s)->s_generation_counter)
@@ -60137,9 +62678,10 @@ diff -urNp linux-3.1.3/include/linux/reiserfs_fs.h linux-3.1.3/include/linux/rei
  #define FILESYSTEM_CHANGED_TB(tb)  (get_generation((tb)->tb_sb) != (tb)->fs_gen)
  #define __fs_changed(gen,s) (gen != get_generation (s))
  #define fs_changed(gen,s)             \
-diff -urNp linux-3.1.3/include/linux/reiserfs_fs_sb.h linux-3.1.3/include/linux/reiserfs_fs_sb.h
---- linux-3.1.3/include/linux/reiserfs_fs_sb.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/reiserfs_fs_sb.h 2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h
+index 52c83b6..18ed7eb 100644
+--- a/include/linux/reiserfs_fs_sb.h
++++ b/include/linux/reiserfs_fs_sb.h
 @@ -386,7 +386,7 @@ struct reiserfs_sb_info {
        /* Comment? -Hans */
        wait_queue_head_t s_wait;
@@ -60149,9 +62691,10 @@ diff -urNp linux-3.1.3/include/linux/reiserfs_fs_sb.h linux-3.1.3/include/linux/
        // tree gets re-balanced
        unsigned long s_properties;     /* File system properties. Currently holds
                                           on-disk FS format */
-diff -urNp linux-3.1.3/include/linux/relay.h linux-3.1.3/include/linux/relay.h
---- linux-3.1.3/include/linux/relay.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/relay.h  2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/relay.h b/include/linux/relay.h
+index 14a86bc..17d0700 100644
+--- a/include/linux/relay.h
++++ b/include/linux/relay.h
 @@ -159,7 +159,7 @@ struct rchan_callbacks
         * The callback should return 0 if successful, negative if not.
         */
@@ -60161,9 +62704,10 @@ diff -urNp linux-3.1.3/include/linux/relay.h linux-3.1.3/include/linux/relay.h
  
  /*
   * CONFIG_RELAY kernel API, kernel/relay.c
-diff -urNp linux-3.1.3/include/linux/rfkill.h linux-3.1.3/include/linux/rfkill.h
---- linux-3.1.3/include/linux/rfkill.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/rfkill.h 2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
+index c6c6084..5bf1212 100644
+--- a/include/linux/rfkill.h
++++ b/include/linux/rfkill.h
 @@ -147,6 +147,7 @@ struct rfkill_ops {
        void    (*query)(struct rfkill *rfkill, void *data);
        int     (*set_block)(void *data, bool blocked);
@@ -60172,10 +62716,11 @@ diff -urNp linux-3.1.3/include/linux/rfkill.h linux-3.1.3/include/linux/rfkill.h
  
  #if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE)
  /**
-diff -urNp linux-3.1.3/include/linux/rmap.h linux-3.1.3/include/linux/rmap.h
---- linux-3.1.3/include/linux/rmap.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/rmap.h   2011-11-16 18:39:08.000000000 -0500
-@@ -119,8 +119,8 @@ static inline void anon_vma_unlock(struc
+diff --git a/include/linux/rmap.h b/include/linux/rmap.h
+index 2148b12..519b820 100644
+--- a/include/linux/rmap.h
++++ b/include/linux/rmap.h
+@@ -119,8 +119,8 @@ static inline void anon_vma_unlock(struct anon_vma *anon_vma)
  void anon_vma_init(void);     /* create anon_vma_cachep */
  int  anon_vma_prepare(struct vm_area_struct *);
  void unlink_anon_vmas(struct vm_area_struct *);
@@ -60186,9 +62731,10 @@ diff -urNp linux-3.1.3/include/linux/rmap.h linux-3.1.3/include/linux/rmap.h
  void __anon_vma_link(struct vm_area_struct *);
  
  static inline void anon_vma_merge(struct vm_area_struct *vma,
-diff -urNp linux-3.1.3/include/linux/sched.h linux-3.1.3/include/linux/sched.h
---- linux-3.1.3/include/linux/sched.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/sched.h  2011-11-16 18:40:31.000000000 -0500
+diff --git a/include/linux/sched.h b/include/linux/sched.h
+index 41d0237..5a64056 100644
+--- a/include/linux/sched.h
++++ b/include/linux/sched.h
 @@ -100,6 +100,7 @@ struct bio_list;
  struct fs_struct;
  struct perf_event_context;
@@ -60393,7 +62939,7 @@ diff -urNp linux-3.1.3/include/linux/sched.h linux-3.1.3/include/linux/sched.h
  extern struct task_struct *find_task_by_pid_ns(pid_t nr,
                struct pid_namespace *ns);
  
-@@ -2243,7 +2338,7 @@ extern void __cleanup_sighand(struct sig
+@@ -2243,7 +2338,7 @@ extern void __cleanup_sighand(struct sighand_struct *);
  extern void exit_itimers(struct signal_struct *);
  extern void flush_itimer_signals(void);
  
@@ -60402,7 +62948,7 @@ diff -urNp linux-3.1.3/include/linux/sched.h linux-3.1.3/include/linux/sched.h
  
  extern void daemonize(const char *, ...);
  extern int allow_signal(int);
-@@ -2408,13 +2503,17 @@ static inline unsigned long *end_of_stac
+@@ -2408,13 +2503,17 @@ static inline unsigned long *end_of_stack(struct task_struct *p)
  
  #endif
  
@@ -60422,9 +62968,10 @@ diff -urNp linux-3.1.3/include/linux/sched.h linux-3.1.3/include/linux/sched.h
  extern void thread_info_cache_init(void);
  
  #ifdef CONFIG_DEBUG_STACK_USAGE
-diff -urNp linux-3.1.3/include/linux/screen_info.h linux-3.1.3/include/linux/screen_info.h
---- linux-3.1.3/include/linux/screen_info.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/screen_info.h    2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/screen_info.h b/include/linux/screen_info.h
+index 899fbb4..1cb4138 100644
+--- a/include/linux/screen_info.h
++++ b/include/linux/screen_info.h
 @@ -43,7 +43,8 @@ struct screen_info {
        __u16 pages;            /* 0x32 */
        __u16 vesa_attributes;  /* 0x34 */
@@ -60435,9 +62982,10 @@ diff -urNp linux-3.1.3/include/linux/screen_info.h linux-3.1.3/include/linux/scr
  } __attribute__((packed));
  
  #define VIDEO_TYPE_MDA                0x10    /* Monochrome Text Display      */
-diff -urNp linux-3.1.3/include/linux/security.h linux-3.1.3/include/linux/security.h
---- linux-3.1.3/include/linux/security.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/security.h       2011-11-16 18:40:31.000000000 -0500
+diff --git a/include/linux/security.h b/include/linux/security.h
+index ebd2a53..2d949ae 100644
+--- a/include/linux/security.h
++++ b/include/linux/security.h
 @@ -36,6 +36,7 @@
  #include <linux/key.h>
  #include <linux/xfrm.h>
@@ -60446,9 +62994,10 @@ diff -urNp linux-3.1.3/include/linux/security.h linux-3.1.3/include/linux/securi
  #include <net/flow.h>
  
  /* Maximum number of letters for an LSM name string */
-diff -urNp linux-3.1.3/include/linux/seq_file.h linux-3.1.3/include/linux/seq_file.h
---- linux-3.1.3/include/linux/seq_file.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/seq_file.h       2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h
+index be720cd..a0e1b94 100644
+--- a/include/linux/seq_file.h
++++ b/include/linux/seq_file.h
 @@ -33,6 +33,7 @@ struct seq_operations {
        void * (*next) (struct seq_file *m, void *v, loff_t *pos);
        int (*show) (struct seq_file *m, void *v);
@@ -60457,10 +63006,11 @@ diff -urNp linux-3.1.3/include/linux/seq_file.h linux-3.1.3/include/linux/seq_fi
  
  #define SEQ_SKIP 1
  
-diff -urNp linux-3.1.3/include/linux/shm.h linux-3.1.3/include/linux/shm.h
---- linux-3.1.3/include/linux/shm.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/shm.h    2011-11-16 18:59:58.000000000 -0500
-@@ -98,6 +98,10 @@ struct shmid_kernel /* private to the ke
+diff --git a/include/linux/shm.h b/include/linux/shm.h
+index 92808b8..c28cac4 100644
+--- a/include/linux/shm.h
++++ b/include/linux/shm.h
+@@ -98,6 +98,10 @@ struct shmid_kernel /* private to the kernel */
  
        /* The task created the shm object.  NULL if the task is dead. */
        struct task_struct      *shm_creator;
@@ -60471,10 +63021,11 @@ diff -urNp linux-3.1.3/include/linux/shm.h linux-3.1.3/include/linux/shm.h
  };
  
  /* shm_mode upper byte flags */
-diff -urNp linux-3.1.3/include/linux/skbuff.h linux-3.1.3/include/linux/skbuff.h
---- linux-3.1.3/include/linux/skbuff.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/skbuff.h 2011-11-16 18:39:08.000000000 -0500
-@@ -610,7 +610,7 @@ static inline struct skb_shared_hwtstamp
+diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
+index 0f96646..cfb757a 100644
+--- a/include/linux/skbuff.h
++++ b/include/linux/skbuff.h
+@@ -610,7 +610,7 @@ static inline struct skb_shared_hwtstamps *skb_hwtstamps(struct sk_buff *skb)
   */
  static inline int skb_queue_empty(const struct sk_buff_head *list)
  {
@@ -60483,7 +63034,7 @@ diff -urNp linux-3.1.3/include/linux/skbuff.h linux-3.1.3/include/linux/skbuff.h
  }
  
  /**
-@@ -623,7 +623,7 @@ static inline int skb_queue_empty(const 
+@@ -623,7 +623,7 @@ static inline int skb_queue_empty(const struct sk_buff_head *list)
  static inline bool skb_queue_is_last(const struct sk_buff_head *list,
                                     const struct sk_buff *skb)
  {
@@ -60492,7 +63043,7 @@ diff -urNp linux-3.1.3/include/linux/skbuff.h linux-3.1.3/include/linux/skbuff.h
  }
  
  /**
-@@ -636,7 +636,7 @@ static inline bool skb_queue_is_last(con
+@@ -636,7 +636,7 @@ static inline bool skb_queue_is_last(const struct sk_buff_head *list,
  static inline bool skb_queue_is_first(const struct sk_buff_head *list,
                                      const struct sk_buff *skb)
  {
@@ -60501,7 +63052,7 @@ diff -urNp linux-3.1.3/include/linux/skbuff.h linux-3.1.3/include/linux/skbuff.h
  }
  
  /**
-@@ -1458,7 +1458,7 @@ static inline int pskb_network_may_pull(
+@@ -1458,7 +1458,7 @@ static inline int pskb_network_may_pull(struct sk_buff *skb, unsigned int len)
   * NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8)
   */
  #ifndef NET_SKB_PAD
@@ -60510,27 +63061,10 @@ diff -urNp linux-3.1.3/include/linux/skbuff.h linux-3.1.3/include/linux/skbuff.h
  #endif
  
  extern int ___pskb_trim(struct sk_buff *skb, unsigned int len);
-diff -urNp linux-3.1.3/include/linux/slab_def.h linux-3.1.3/include/linux/slab_def.h
---- linux-3.1.3/include/linux/slab_def.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/slab_def.h       2011-11-16 18:39:08.000000000 -0500
-@@ -68,10 +68,10 @@ struct kmem_cache {
-       unsigned long node_allocs;
-       unsigned long node_frees;
-       unsigned long node_overflow;
--      atomic_t allochit;
--      atomic_t allocmiss;
--      atomic_t freehit;
--      atomic_t freemiss;
-+      atomic_unchecked_t allochit;
-+      atomic_unchecked_t allocmiss;
-+      atomic_unchecked_t freehit;
-+      atomic_unchecked_t freemiss;
-       /*
-        * If debugging is enabled, then the allocator can add additional
-diff -urNp linux-3.1.3/include/linux/slab.h linux-3.1.3/include/linux/slab.h
---- linux-3.1.3/include/linux/slab.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/slab.h   2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/slab.h b/include/linux/slab.h
+index 573c809..e84c132 100644
+--- a/include/linux/slab.h
++++ b/include/linux/slab.h
 @@ -11,12 +11,20 @@
  
  #include <linux/gfp.h>
@@ -60569,7 +63103,7 @@ diff -urNp linux-3.1.3/include/linux/slab.h linux-3.1.3/include/linux/slab.h
  
  /*
   * struct kmem_cache related prototypes
-@@ -161,6 +172,7 @@ void * __must_check krealloc(const void 
+@@ -161,6 +172,7 @@ void * __must_check krealloc(const void *, size_t, gfp_t);
  void kfree(const void *);
  void kzfree(const void *);
  size_t ksize(const void *);
@@ -60577,7 +63111,7 @@ diff -urNp linux-3.1.3/include/linux/slab.h linux-3.1.3/include/linux/slab.h
  
  /*
   * Allocator specific definitions. These are mainly used to establish optimized
-@@ -353,4 +365,59 @@ static inline void *kzalloc_node(size_t 
+@@ -353,4 +365,59 @@ static inline void *kzalloc_node(size_t size, gfp_t flags, int node)
  
  void __init kmem_cache_init_late(void);
  
@@ -60637,9 +63171,29 @@ diff -urNp linux-3.1.3/include/linux/slab.h linux-3.1.3/include/linux/slab.h
 +})
 +
  #endif        /* _LINUX_SLAB_H */
-diff -urNp linux-3.1.3/include/linux/slub_def.h linux-3.1.3/include/linux/slub_def.h
---- linux-3.1.3/include/linux/slub_def.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/slub_def.h       2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h
+index d00e0ba..1b3bf7b 100644
+--- a/include/linux/slab_def.h
++++ b/include/linux/slab_def.h
+@@ -68,10 +68,10 @@ struct kmem_cache {
+       unsigned long node_allocs;
+       unsigned long node_frees;
+       unsigned long node_overflow;
+-      atomic_t allochit;
+-      atomic_t allocmiss;
+-      atomic_t freehit;
+-      atomic_t freemiss;
++      atomic_unchecked_t allochit;
++      atomic_unchecked_t allocmiss;
++      atomic_unchecked_t freehit;
++      atomic_unchecked_t freemiss;
+       /*
+        * If debugging is enabled, then the allocator can add additional
+diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
+index f58d641..c56bf9c 100644
+--- a/include/linux/slub_def.h
++++ b/include/linux/slub_def.h
 @@ -85,7 +85,7 @@ struct kmem_cache {
        struct kmem_cache_order_objects max;
        struct kmem_cache_order_objects min;
@@ -60649,7 +63203,7 @@ diff -urNp linux-3.1.3/include/linux/slub_def.h linux-3.1.3/include/linux/slub_d
        void (*ctor)(void *);
        int inuse;              /* Offset to metadata */
        int align;              /* Alignment */
-@@ -211,7 +211,7 @@ static __always_inline struct kmem_cache
+@@ -211,7 +211,7 @@ static __always_inline struct kmem_cache *kmalloc_slab(size_t size)
  }
  
  void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
@@ -60658,9 +63212,10 @@ diff -urNp linux-3.1.3/include/linux/slub_def.h linux-3.1.3/include/linux/slub_d
  
  static __always_inline void *
  kmalloc_order(size_t size, gfp_t flags, unsigned int order)
-diff -urNp linux-3.1.3/include/linux/sonet.h linux-3.1.3/include/linux/sonet.h
---- linux-3.1.3/include/linux/sonet.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/sonet.h  2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/sonet.h b/include/linux/sonet.h
+index de8832d..0147b46 100644
+--- a/include/linux/sonet.h
++++ b/include/linux/sonet.h
 @@ -61,7 +61,7 @@ struct sonet_stats {
  #include <linux/atomic.h>
  
@@ -60670,10 +63225,11 @@ diff -urNp linux-3.1.3/include/linux/sonet.h linux-3.1.3/include/linux/sonet.h
        __SONET_ITEMS
  #undef __HANDLE_ITEM
  };
-diff -urNp linux-3.1.3/include/linux/sunrpc/clnt.h linux-3.1.3/include/linux/sunrpc/clnt.h
---- linux-3.1.3/include/linux/sunrpc/clnt.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/sunrpc/clnt.h    2011-11-16 18:39:08.000000000 -0500
-@@ -169,9 +169,9 @@ static inline unsigned short rpc_get_por
+diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
+index db7bcaf..1aca77e 100644
+--- a/include/linux/sunrpc/clnt.h
++++ b/include/linux/sunrpc/clnt.h
+@@ -169,9 +169,9 @@ static inline unsigned short rpc_get_port(const struct sockaddr *sap)
  {
        switch (sap->sa_family) {
        case AF_INET:
@@ -60685,7 +63241,7 @@ diff -urNp linux-3.1.3/include/linux/sunrpc/clnt.h linux-3.1.3/include/linux/sun
        }
        return 0;
  }
-@@ -204,7 +204,7 @@ static inline bool __rpc_cmp_addr4(const
+@@ -204,7 +204,7 @@ static inline bool __rpc_cmp_addr4(const struct sockaddr *sap1,
  static inline bool __rpc_copy_addr4(struct sockaddr *dst,
                                    const struct sockaddr *src)
  {
@@ -60694,7 +63250,7 @@ diff -urNp linux-3.1.3/include/linux/sunrpc/clnt.h linux-3.1.3/include/linux/sun
        struct sockaddr_in *dsin = (struct sockaddr_in *) dst;
  
        dsin->sin_family = ssin->sin_family;
-@@ -301,7 +301,7 @@ static inline u32 rpc_get_scope_id(const
+@@ -301,7 +301,7 @@ static inline u32 rpc_get_scope_id(const struct sockaddr *sa)
        if (sa->sa_family != AF_INET6)
                return 0;
  
@@ -60703,9 +63259,10 @@ diff -urNp linux-3.1.3/include/linux/sunrpc/clnt.h linux-3.1.3/include/linux/sun
  }
  
  #endif /* __KERNEL__ */
-diff -urNp linux-3.1.3/include/linux/sunrpc/sched.h linux-3.1.3/include/linux/sunrpc/sched.h
---- linux-3.1.3/include/linux/sunrpc/sched.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/sunrpc/sched.h   2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
+index e775689..9e206d9 100644
+--- a/include/linux/sunrpc/sched.h
++++ b/include/linux/sunrpc/sched.h
 @@ -105,6 +105,7 @@ struct rpc_call_ops {
        void (*rpc_call_done)(struct rpc_task *, void *);
        void (*rpc_release)(void *);
@@ -60714,9 +63271,10 @@ diff -urNp linux-3.1.3/include/linux/sunrpc/sched.h linux-3.1.3/include/linux/su
  
  struct rpc_task_setup {
        struct rpc_task *task;
-diff -urNp linux-3.1.3/include/linux/sunrpc/svc_rdma.h linux-3.1.3/include/linux/sunrpc/svc_rdma.h
---- linux-3.1.3/include/linux/sunrpc/svc_rdma.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/sunrpc/svc_rdma.h        2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h
+index c14fe86..393245e 100644
+--- a/include/linux/sunrpc/svc_rdma.h
++++ b/include/linux/sunrpc/svc_rdma.h
 @@ -53,15 +53,15 @@ extern unsigned int svcrdma_ord;
  extern unsigned int svcrdma_max_requests;
  extern unsigned int svcrdma_max_req_size;
@@ -60742,9 +63300,10 @@ diff -urNp linux-3.1.3/include/linux/sunrpc/svc_rdma.h linux-3.1.3/include/linux
  
  #define RPCRDMA_VERSION 1
  
-diff -urNp linux-3.1.3/include/linux/sysctl.h linux-3.1.3/include/linux/sysctl.h
---- linux-3.1.3/include/linux/sysctl.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/sysctl.h 2011-11-16 18:40:31.000000000 -0500
+diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
+index 11684d9..0d245eb 100644
+--- a/include/linux/sysctl.h
++++ b/include/linux/sysctl.h
 @@ -155,7 +155,11 @@ enum
        KERN_PANIC_ON_NMI=76, /* int: whether we will panic on an unrecovered */
  };
@@ -60758,7 +63317,7 @@ diff -urNp linux-3.1.3/include/linux/sysctl.h linux-3.1.3/include/linux/sysctl.h
  
  /* CTL_VM names: */
  enum
-@@ -967,6 +971,8 @@ typedef int proc_handler (struct ctl_tab
+@@ -967,6 +971,8 @@ typedef int proc_handler (struct ctl_table *ctl, int write,
  
  extern int proc_dostring(struct ctl_table *, int,
                         void __user *, size_t *, loff_t *);
@@ -60767,9 +63326,10 @@ diff -urNp linux-3.1.3/include/linux/sysctl.h linux-3.1.3/include/linux/sysctl.h
  extern int proc_dointvec(struct ctl_table *, int,
                         void __user *, size_t *, loff_t *);
  extern int proc_dointvec_minmax(struct ctl_table *, int,
-diff -urNp linux-3.1.3/include/linux/tty_ldisc.h linux-3.1.3/include/linux/tty_ldisc.h
---- linux-3.1.3/include/linux/tty_ldisc.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/tty_ldisc.h      2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h
+index ff7dc08..893e1bd 100644
+--- a/include/linux/tty_ldisc.h
++++ b/include/linux/tty_ldisc.h
 @@ -148,7 +148,7 @@ struct tty_ldisc_ops {
  
        struct  module *owner;
@@ -60779,9 +63339,10 @@ diff -urNp linux-3.1.3/include/linux/tty_ldisc.h linux-3.1.3/include/linux/tty_l
  };
  
  struct tty_ldisc {
-diff -urNp linux-3.1.3/include/linux/types.h linux-3.1.3/include/linux/types.h
---- linux-3.1.3/include/linux/types.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/types.h  2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/types.h b/include/linux/types.h
+index 176da8c..e45e473 100644
+--- a/include/linux/types.h
++++ b/include/linux/types.h
 @@ -213,10 +213,26 @@ typedef struct {
        int counter;
  } atomic_t;
@@ -60809,10 +63370,11 @@ diff -urNp linux-3.1.3/include/linux/types.h linux-3.1.3/include/linux/types.h
  #endif
  
  struct list_head {
-diff -urNp linux-3.1.3/include/linux/uaccess.h linux-3.1.3/include/linux/uaccess.h
---- linux-3.1.3/include/linux/uaccess.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/uaccess.h        2011-11-16 18:39:08.000000000 -0500
-@@ -76,11 +76,11 @@ static inline unsigned long __copy_from_
+diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h
+index 5ca0951..ab496a5 100644
+--- a/include/linux/uaccess.h
++++ b/include/linux/uaccess.h
+@@ -76,11 +76,11 @@ static inline unsigned long __copy_from_user_nocache(void *to,
                long ret;                               \
                mm_segment_t old_fs = get_fs();         \
                                                        \
@@ -60827,9 +63389,10 @@ diff -urNp linux-3.1.3/include/linux/uaccess.h linux-3.1.3/include/linux/uaccess
                ret;                                    \
        })
  
-diff -urNp linux-3.1.3/include/linux/unaligned/access_ok.h linux-3.1.3/include/linux/unaligned/access_ok.h
---- linux-3.1.3/include/linux/unaligned/access_ok.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/unaligned/access_ok.h    2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/linux/unaligned/access_ok.h b/include/linux/unaligned/access_ok.h
+index 99c1b4d..bb94261 100644
+--- a/include/linux/unaligned/access_ok.h
++++ b/include/linux/unaligned/access_ok.h
 @@ -6,32 +6,32 @@
  
  static inline u16 get_unaligned_le16(const void *p)
@@ -60869,9 +63432,10 @@ diff -urNp linux-3.1.3/include/linux/unaligned/access_ok.h linux-3.1.3/include/l
  }
  
  static inline void put_unaligned_le16(u16 val, void *p)
-diff -urNp linux-3.1.3/include/linux/vermagic.h linux-3.1.3/include/linux/vermagic.h
---- linux-3.1.3/include/linux/vermagic.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/vermagic.h       2011-11-16 18:54:54.000000000 -0500
+diff --git a/include/linux/vermagic.h b/include/linux/vermagic.h
+index cf97b5b..40ebc87 100644
+--- a/include/linux/vermagic.h
++++ b/include/linux/vermagic.h
 @@ -26,9 +26,35 @@
  #define MODULE_ARCH_VERMAGIC ""
  #endif
@@ -60909,10 +63473,11 @@ diff -urNp linux-3.1.3/include/linux/vermagic.h linux-3.1.3/include/linux/vermag
 +      MODULE_PAX_REFCOUNT MODULE_CONSTIFY_PLUGIN MODULE_STACKLEAK_PLUGIN \
 +      MODULE_GRSEC
  
-diff -urNp linux-3.1.3/include/linux/vmalloc.h linux-3.1.3/include/linux/vmalloc.h
---- linux-3.1.3/include/linux/vmalloc.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/vmalloc.h        2011-11-16 18:39:08.000000000 -0500
-@@ -14,6 +14,11 @@ struct vm_area_struct;              /* vma defining 
+diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
+index 687fb11..b342358 100644
+--- a/include/linux/vmalloc.h
++++ b/include/linux/vmalloc.h
+@@ -14,6 +14,11 @@ struct vm_area_struct;              /* vma defining user mapping in mm_types.h */
  #define VM_USERMAP    0x00000008      /* suitable for remap_vmalloc_range */
  #define VM_VPAGES     0x00000010      /* buffer for pages was vmalloc'ed */
  #define VM_UNLIST     0x00000020      /* vm_struct is not listed in vmlist */
@@ -60924,7 +63489,7 @@ diff -urNp linux-3.1.3/include/linux/vmalloc.h linux-3.1.3/include/linux/vmalloc
  /* bits [20..32] reserved for arch specific ioremap internals */
  
  /*
-@@ -156,4 +161,103 @@ pcpu_free_vm_areas(struct vm_struct **vm
+@@ -156,4 +161,103 @@ pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms)
  # endif
  #endif
  
@@ -61028,10 +63593,11 @@ diff -urNp linux-3.1.3/include/linux/vmalloc.h linux-3.1.3/include/linux/vmalloc
 +})
 +
  #endif /* _LINUX_VMALLOC_H */
-diff -urNp linux-3.1.3/include/linux/vmstat.h linux-3.1.3/include/linux/vmstat.h
---- linux-3.1.3/include/linux/vmstat.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/linux/vmstat.h 2011-11-16 18:39:08.000000000 -0500
-@@ -87,18 +87,18 @@ static inline void vm_events_fold_cpu(in
+diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
+index 65efb92..137adbb 100644
+--- a/include/linux/vmstat.h
++++ b/include/linux/vmstat.h
+@@ -87,18 +87,18 @@ static inline void vm_events_fold_cpu(int cpu)
  /*
   * Zone based page accounting with per cpu differentials.
   */
@@ -61054,7 +63620,7 @@ diff -urNp linux-3.1.3/include/linux/vmstat.h linux-3.1.3/include/linux/vmstat.h
  #ifdef CONFIG_SMP
        if (x < 0)
                x = 0;
-@@ -109,7 +109,7 @@ static inline unsigned long global_page_
+@@ -109,7 +109,7 @@ static inline unsigned long global_page_state(enum zone_stat_item item)
  static inline unsigned long zone_page_state(struct zone *zone,
                                        enum zone_stat_item item)
  {
@@ -61063,7 +63629,7 @@ diff -urNp linux-3.1.3/include/linux/vmstat.h linux-3.1.3/include/linux/vmstat.h
  #ifdef CONFIG_SMP
        if (x < 0)
                x = 0;
-@@ -126,7 +126,7 @@ static inline unsigned long zone_page_st
+@@ -126,7 +126,7 @@ static inline unsigned long zone_page_state(struct zone *zone,
  static inline unsigned long zone_page_state_snapshot(struct zone *zone,
                                        enum zone_stat_item item)
  {
@@ -61072,7 +63638,7 @@ diff -urNp linux-3.1.3/include/linux/vmstat.h linux-3.1.3/include/linux/vmstat.h
  
  #ifdef CONFIG_SMP
        int cpu;
-@@ -221,8 +221,8 @@ static inline void __mod_zone_page_state
+@@ -221,8 +221,8 @@ static inline void __mod_zone_page_state(struct zone *zone,
  
  static inline void __inc_zone_state(struct zone *zone, enum zone_stat_item item)
  {
@@ -61083,7 +63649,7 @@ diff -urNp linux-3.1.3/include/linux/vmstat.h linux-3.1.3/include/linux/vmstat.h
  }
  
  static inline void __inc_zone_page_state(struct page *page,
-@@ -233,8 +233,8 @@ static inline void __inc_zone_page_state
+@@ -233,8 +233,8 @@ static inline void __inc_zone_page_state(struct page *page,
  
  static inline void __dec_zone_state(struct zone *zone, enum zone_stat_item item)
  {
@@ -61094,9 +63660,10 @@ diff -urNp linux-3.1.3/include/linux/vmstat.h linux-3.1.3/include/linux/vmstat.h
  }
  
  static inline void __dec_zone_page_state(struct page *page,
-diff -urNp linux-3.1.3/include/media/saa7146_vv.h linux-3.1.3/include/media/saa7146_vv.h
---- linux-3.1.3/include/media/saa7146_vv.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/media/saa7146_vv.h     2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/media/saa7146_vv.h b/include/media/saa7146_vv.h
+index 4aeff96..b378cdc 100644
+--- a/include/media/saa7146_vv.h
++++ b/include/media/saa7146_vv.h
 @@ -163,7 +163,7 @@ struct saa7146_ext_vv
        int (*std_callback)(struct saa7146_dev*, struct saa7146_standard *);
  
@@ -61106,10 +63673,11 @@ diff -urNp linux-3.1.3/include/media/saa7146_vv.h linux-3.1.3/include/media/saa7
        /* pointer to the saa7146 core ops */
        const struct v4l2_ioctl_ops *core_ops;
  
-diff -urNp linux-3.1.3/include/media/v4l2-dev.h linux-3.1.3/include/media/v4l2-dev.h
---- linux-3.1.3/include/media/v4l2-dev.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/media/v4l2-dev.h       2011-11-16 18:39:08.000000000 -0500
-@@ -56,7 +56,7 @@ int v4l2_prio_check(struct v4l2_prio_sta
+diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
+index c7c40f1..4f01585 100644
+--- a/include/media/v4l2-dev.h
++++ b/include/media/v4l2-dev.h
+@@ -56,7 +56,7 @@ int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority local);
  
  
  struct v4l2_file_operations {
@@ -61126,9 +63694,10 @@ diff -urNp linux-3.1.3/include/media/v4l2-dev.h linux-3.1.3/include/media/v4l2-d
  
  /*
   * Newer version of video_device, handled by videodev2.c
-diff -urNp linux-3.1.3/include/media/v4l2-ioctl.h linux-3.1.3/include/media/v4l2-ioctl.h
---- linux-3.1.3/include/media/v4l2-ioctl.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/media/v4l2-ioctl.h     2011-11-17 18:44:20.000000000 -0500
+diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
+index dd9f1e7..8c4dd86 100644
+--- a/include/media/v4l2-ioctl.h
++++ b/include/media/v4l2-ioctl.h
 @@ -272,7 +272,7 @@ struct v4l2_ioctl_ops {
        long (*vidioc_default)         (struct file *file, void *fh,
                                        bool valid_prio, int cmd, void *arg);
@@ -61138,9 +63707,10 @@ diff -urNp linux-3.1.3/include/media/v4l2-ioctl.h linux-3.1.3/include/media/v4l2
  
  /* v4l debugging and diagnostics */
  
-diff -urNp linux-3.1.3/include/net/caif/caif_hsi.h linux-3.1.3/include/net/caif/caif_hsi.h
---- linux-3.1.3/include/net/caif/caif_hsi.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/net/caif/caif_hsi.h    2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/net/caif/caif_hsi.h b/include/net/caif/caif_hsi.h
+index c5dedd8..a93b07b 100644
+--- a/include/net/caif/caif_hsi.h
++++ b/include/net/caif/caif_hsi.h
 @@ -94,7 +94,7 @@ struct cfhsi_drv {
        void (*rx_done_cb) (struct cfhsi_drv *drv);
        void (*wake_up_cb) (struct cfhsi_drv *drv);
@@ -61150,9 +63720,10 @@ diff -urNp linux-3.1.3/include/net/caif/caif_hsi.h linux-3.1.3/include/net/caif/
  
  /* Structure implemented by HSI device. */
  struct cfhsi_dev {
-diff -urNp linux-3.1.3/include/net/caif/cfctrl.h linux-3.1.3/include/net/caif/cfctrl.h
---- linux-3.1.3/include/net/caif/cfctrl.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/net/caif/cfctrl.h      2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/net/caif/cfctrl.h b/include/net/caif/cfctrl.h
+index 9e5425b..8136ffc 100644
+--- a/include/net/caif/cfctrl.h
++++ b/include/net/caif/cfctrl.h
 @@ -52,7 +52,7 @@ struct cfctrl_rsp {
        void (*radioset_rsp)(void);
        void (*reject_rsp)(struct cflayer *layer, u8 linkid,
@@ -61173,10 +63744,11 @@ diff -urNp linux-3.1.3/include/net/caif/cfctrl.h linux-3.1.3/include/net/caif/cf
        struct list_head list;
        /* Protects from simultaneous access to first_req list */
        spinlock_t info_list_lock;
-diff -urNp linux-3.1.3/include/net/flow.h linux-3.1.3/include/net/flow.h
---- linux-3.1.3/include/net/flow.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/net/flow.h     2011-11-16 18:39:08.000000000 -0500
-@@ -207,6 +207,6 @@ extern struct flow_cache_object *flow_ca
+diff --git a/include/net/flow.h b/include/net/flow.h
+index a094477..bc91db1 100644
+--- a/include/net/flow.h
++++ b/include/net/flow.h
+@@ -207,6 +207,6 @@ extern struct flow_cache_object *flow_cache_lookup(
                u8 dir, flow_resolve_t resolver, void *ctx);
  
  extern void flow_cache_flush(void);
@@ -61184,10 +63756,11 @@ diff -urNp linux-3.1.3/include/net/flow.h linux-3.1.3/include/net/flow.h
 +extern atomic_unchecked_t flow_cache_genid;
  
  #endif
-diff -urNp linux-3.1.3/include/net/inetpeer.h linux-3.1.3/include/net/inetpeer.h
---- linux-3.1.3/include/net/inetpeer.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/net/inetpeer.h 2011-11-16 18:39:08.000000000 -0500
-@@ -47,8 +47,8 @@ struct inet_peer {
+diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
+index e9ff3fc..9d3e5c7 100644
+--- a/include/net/inetpeer.h
++++ b/include/net/inetpeer.h
+@@ -48,8 +48,8 @@ struct inet_peer {
         */
        union {
                struct {
@@ -61198,7 +63771,7 @@ diff -urNp linux-3.1.3/include/net/inetpeer.h linux-3.1.3/include/net/inetpeer.h
                        __u32                           tcp_ts;
                        __u32                           tcp_ts_stamp;
                };
-@@ -112,11 +112,11 @@ static inline int inet_getid(struct inet
+@@ -113,11 +113,11 @@ static inline int inet_getid(struct inet_peer *p, int more)
        more++;
        inet_peer_refcheck(p);
        do {
@@ -61212,10 +63785,11 @@ diff -urNp linux-3.1.3/include/net/inetpeer.h linux-3.1.3/include/net/inetpeer.h
        return new;
  }
  
-diff -urNp linux-3.1.3/include/net/ip_fib.h linux-3.1.3/include/net/ip_fib.h
---- linux-3.1.3/include/net/ip_fib.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/net/ip_fib.h   2011-11-16 18:39:08.000000000 -0500
-@@ -146,7 +146,7 @@ extern __be32 fib_info_update_nh_saddr(s
+diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
+index 10422ef..662570f 100644
+--- a/include/net/ip_fib.h
++++ b/include/net/ip_fib.h
+@@ -146,7 +146,7 @@ extern __be32 fib_info_update_nh_saddr(struct net *net, struct fib_nh *nh);
  
  #define FIB_RES_SADDR(net, res)                               \
        ((FIB_RES_NH(res).nh_saddr_genid ==             \
@@ -61224,9 +63798,10 @@ diff -urNp linux-3.1.3/include/net/ip_fib.h linux-3.1.3/include/net/ip_fib.h
         FIB_RES_NH(res).nh_saddr :                     \
         fib_info_update_nh_saddr((net), &FIB_RES_NH(res)))
  #define FIB_RES_GW(res)                       (FIB_RES_NH(res).nh_gw)
-diff -urNp linux-3.1.3/include/net/ip_vs.h linux-3.1.3/include/net/ip_vs.h
---- linux-3.1.3/include/net/ip_vs.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/net/ip_vs.h    2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
+index 8fa4430..05dd772 100644
+--- a/include/net/ip_vs.h
++++ b/include/net/ip_vs.h
 @@ -509,7 +509,7 @@ struct ip_vs_conn {
        struct ip_vs_conn       *control;       /* Master control connection */
        atomic_t                n_control;      /* Number of controlled ones */
@@ -61245,9 +63820,10 @@ diff -urNp linux-3.1.3/include/net/ip_vs.h linux-3.1.3/include/net/ip_vs.h
        atomic_t                weight;         /* server weight */
  
        atomic_t                refcnt;         /* reference counter */
-diff -urNp linux-3.1.3/include/net/irda/ircomm_core.h linux-3.1.3/include/net/irda/ircomm_core.h
---- linux-3.1.3/include/net/irda/ircomm_core.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/net/irda/ircomm_core.h 2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/net/irda/ircomm_core.h b/include/net/irda/ircomm_core.h
+index 69b610a..fe3962c 100644
+--- a/include/net/irda/ircomm_core.h
++++ b/include/net/irda/ircomm_core.h
 @@ -51,7 +51,7 @@ typedef struct {
        int (*connect_response)(struct ircomm_cb *, struct sk_buff *);
        int (*disconnect_request)(struct ircomm_cb *, struct sk_buff *, 
@@ -61257,9 +63833,10 @@ diff -urNp linux-3.1.3/include/net/irda/ircomm_core.h linux-3.1.3/include/net/ir
  
  struct ircomm_cb {
        irda_queue_t queue;
-diff -urNp linux-3.1.3/include/net/irda/ircomm_tty.h linux-3.1.3/include/net/irda/ircomm_tty.h
---- linux-3.1.3/include/net/irda/ircomm_tty.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/net/irda/ircomm_tty.h  2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/net/irda/ircomm_tty.h b/include/net/irda/ircomm_tty.h
+index 59ba38bc..d515662 100644
+--- a/include/net/irda/ircomm_tty.h
++++ b/include/net/irda/ircomm_tty.h
 @@ -35,6 +35,7 @@
  #include <linux/termios.h>
  #include <linux/timer.h>
@@ -61279,9 +63856,10 @@ diff -urNp linux-3.1.3/include/net/irda/ircomm_tty.h linux-3.1.3/include/net/ird
  
        /* Protect concurent access to :
         *      o self->open_count
-diff -urNp linux-3.1.3/include/net/iucv/af_iucv.h linux-3.1.3/include/net/iucv/af_iucv.h
---- linux-3.1.3/include/net/iucv/af_iucv.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/net/iucv/af_iucv.h     2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/net/iucv/af_iucv.h b/include/net/iucv/af_iucv.h
+index f82a1e8..82d81e8 100644
+--- a/include/net/iucv/af_iucv.h
++++ b/include/net/iucv/af_iucv.h
 @@ -87,7 +87,7 @@ struct iucv_sock {
  struct iucv_sock_list {
        struct hlist_head head;
@@ -61291,9 +63869,10 @@ diff -urNp linux-3.1.3/include/net/iucv/af_iucv.h linux-3.1.3/include/net/iucv/a
  };
  
  unsigned int iucv_sock_poll(struct file *file, struct socket *sock,
-diff -urNp linux-3.1.3/include/net/lapb.h linux-3.1.3/include/net/lapb.h
---- linux-3.1.3/include/net/lapb.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/net/lapb.h     2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/net/lapb.h b/include/net/lapb.h
+index 96cb5dd..25e8d4f 100644
+--- a/include/net/lapb.h
++++ b/include/net/lapb.h
 @@ -95,7 +95,7 @@ struct lapb_cb {
        struct sk_buff_head     write_queue;
        struct sk_buff_head     ack_queue;
@@ -61303,9 +63882,10 @@ diff -urNp linux-3.1.3/include/net/lapb.h linux-3.1.3/include/net/lapb.h
  
        /* FRMR control information */
        struct lapb_frame       frmr_data;
-diff -urNp linux-3.1.3/include/net/neighbour.h linux-3.1.3/include/net/neighbour.h
---- linux-3.1.3/include/net/neighbour.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/net/neighbour.h        2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/net/neighbour.h b/include/net/neighbour.h
+index 2720884..3aa5c25 100644
+--- a/include/net/neighbour.h
++++ b/include/net/neighbour.h
 @@ -122,7 +122,7 @@ struct neigh_ops {
        void                    (*error_report)(struct neighbour *, struct sk_buff *);
        int                     (*output)(struct neighbour *, struct sk_buff *);
@@ -61315,10 +63895,11 @@ diff -urNp linux-3.1.3/include/net/neighbour.h linux-3.1.3/include/net/neighbour
  
  struct pneigh_entry {
        struct pneigh_entry     *next;
-diff -urNp linux-3.1.3/include/net/netlink.h linux-3.1.3/include/net/netlink.h
---- linux-3.1.3/include/net/netlink.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/net/netlink.h  2011-11-16 18:39:08.000000000 -0500
-@@ -562,7 +562,7 @@ static inline void *nlmsg_get_pos(struct
+diff --git a/include/net/netlink.h b/include/net/netlink.h
+index 98c1854..d4add7b 100644
+--- a/include/net/netlink.h
++++ b/include/net/netlink.h
+@@ -562,7 +562,7 @@ static inline void *nlmsg_get_pos(struct sk_buff *skb)
  static inline void nlmsg_trim(struct sk_buff *skb, const void *mark)
  {
        if (mark)
@@ -61327,9 +63908,10 @@ diff -urNp linux-3.1.3/include/net/netlink.h linux-3.1.3/include/net/netlink.h
  }
  
  /**
-diff -urNp linux-3.1.3/include/net/netns/ipv4.h linux-3.1.3/include/net/netns/ipv4.h
---- linux-3.1.3/include/net/netns/ipv4.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/net/netns/ipv4.h       2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
+index d786b4f..4c3dd41 100644
+--- a/include/net/netns/ipv4.h
++++ b/include/net/netns/ipv4.h
 @@ -56,8 +56,8 @@ struct netns_ipv4 {
  
        unsigned int sysctl_ping_group_range[2];
@@ -61341,9 +63923,10 @@ diff -urNp linux-3.1.3/include/net/netns/ipv4.h linux-3.1.3/include/net/netns/ip
  
  #ifdef CONFIG_IP_MROUTE
  #ifndef CONFIG_IP_MROUTE_MULTIPLE_TABLES
-diff -urNp linux-3.1.3/include/net/sctp/sctp.h linux-3.1.3/include/net/sctp/sctp.h
---- linux-3.1.3/include/net/sctp/sctp.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/net/sctp/sctp.h        2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
+index 6a72a58..e6a127d 100644
+--- a/include/net/sctp/sctp.h
++++ b/include/net/sctp/sctp.h
 @@ -318,9 +318,9 @@ do {                                                                       \
  
  #else /* SCTP_DEBUG */
@@ -61357,9 +63940,10 @@ diff -urNp linux-3.1.3/include/net/sctp/sctp.h linux-3.1.3/include/net/sctp/sctp
  #define SCTP_ENABLE_DEBUG
  #define SCTP_DISABLE_DEBUG
  #define SCTP_ASSERT(expr, str, func)
-diff -urNp linux-3.1.3/include/net/sock.h linux-3.1.3/include/net/sock.h
---- linux-3.1.3/include/net/sock.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/net/sock.h     2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/net/sock.h b/include/net/sock.h
+index 8e4062f..77b041e 100644
+--- a/include/net/sock.h
++++ b/include/net/sock.h
 @@ -278,7 +278,7 @@ struct sock {
  #ifdef CONFIG_RPS
        __u32                   sk_rxhash;
@@ -61369,7 +63953,7 @@ diff -urNp linux-3.1.3/include/net/sock.h linux-3.1.3/include/net/sock.h
        int                     sk_rcvbuf;
  
        struct sk_filter __rcu  *sk_filter;
-@@ -1391,7 +1391,7 @@ static inline void sk_nocaps_add(struct 
+@@ -1391,7 +1391,7 @@ static inline void sk_nocaps_add(struct sock *sk, int flags)
  }
  
  static inline int skb_do_copy_data_nocache(struct sock *sk, struct sk_buff *skb,
@@ -61378,9 +63962,10 @@ diff -urNp linux-3.1.3/include/net/sock.h linux-3.1.3/include/net/sock.h
                                           int copy, int offset)
  {
        if (skb->ip_summed == CHECKSUM_NONE) {
-diff -urNp linux-3.1.3/include/net/tcp.h linux-3.1.3/include/net/tcp.h
---- linux-3.1.3/include/net/tcp.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/net/tcp.h      2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/net/tcp.h b/include/net/tcp.h
+index acc620a..f4d99c6 100644
+--- a/include/net/tcp.h
++++ b/include/net/tcp.h
 @@ -1401,8 +1401,8 @@ enum tcp_seq_states {
  struct tcp_seq_afinfo {
        char                    *name;
@@ -61392,9 +63977,10 @@ diff -urNp linux-3.1.3/include/net/tcp.h linux-3.1.3/include/net/tcp.h
  };
  
  struct tcp_iter_state {
-diff -urNp linux-3.1.3/include/net/udp.h linux-3.1.3/include/net/udp.h
---- linux-3.1.3/include/net/udp.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/net/udp.h      2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/net/udp.h b/include/net/udp.h
+index 67ea6fc..e42aee8 100644
+--- a/include/net/udp.h
++++ b/include/net/udp.h
 @@ -234,8 +234,8 @@ struct udp_seq_afinfo {
        char                    *name;
        sa_family_t             family;
@@ -61406,9 +63992,10 @@ diff -urNp linux-3.1.3/include/net/udp.h linux-3.1.3/include/net/udp.h
  };
  
  struct udp_iter_state {
-diff -urNp linux-3.1.3/include/net/xfrm.h linux-3.1.3/include/net/xfrm.h
---- linux-3.1.3/include/net/xfrm.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/net/xfrm.h     2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/net/xfrm.h b/include/net/xfrm.h
+index b203e14..1df3991 100644
+--- a/include/net/xfrm.h
++++ b/include/net/xfrm.h
 @@ -505,7 +505,7 @@ struct xfrm_policy {
        struct timer_list       timer;
  
@@ -61418,9 +64005,10 @@ diff -urNp linux-3.1.3/include/net/xfrm.h linux-3.1.3/include/net/xfrm.h
        u32                     priority;
        u32                     index;
        struct xfrm_mark        mark;
-diff -urNp linux-3.1.3/include/rdma/iw_cm.h linux-3.1.3/include/rdma/iw_cm.h
---- linux-3.1.3/include/rdma/iw_cm.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/rdma/iw_cm.h   2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/rdma/iw_cm.h b/include/rdma/iw_cm.h
+index 2d0191c..a55797d 100644
+--- a/include/rdma/iw_cm.h
++++ b/include/rdma/iw_cm.h
 @@ -120,7 +120,7 @@ struct iw_cm_verbs {
                                         int backlog);
  
@@ -61430,9 +64018,10 @@ diff -urNp linux-3.1.3/include/rdma/iw_cm.h linux-3.1.3/include/rdma/iw_cm.h
  
  /**
   * iw_create_cm_id - Create an IW CM identifier.
-diff -urNp linux-3.1.3/include/scsi/libfc.h linux-3.1.3/include/scsi/libfc.h
---- linux-3.1.3/include/scsi/libfc.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/scsi/libfc.h   2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
+index 7d96829..4ba78d3 100644
+--- a/include/scsi/libfc.h
++++ b/include/scsi/libfc.h
 @@ -758,6 +758,7 @@ struct libfc_function_template {
         */
        void (*disc_stop_final) (struct fc_lport *);
@@ -61450,9 +64039,10 @@ diff -urNp linux-3.1.3/include/scsi/libfc.h linux-3.1.3/include/scsi/libfc.h
        u8                             link_up;
        u8                             qfull;
        enum fc_lport_state            state;
-diff -urNp linux-3.1.3/include/scsi/scsi_device.h linux-3.1.3/include/scsi/scsi_device.h
---- linux-3.1.3/include/scsi/scsi_device.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/scsi/scsi_device.h     2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
+index d371c3c..e228a8c 100644
+--- a/include/scsi/scsi_device.h
++++ b/include/scsi/scsi_device.h
 @@ -161,9 +161,9 @@ struct scsi_device {
        unsigned int max_device_blocked; /* what device_blocked counts down from  */
  #define SCSI_DEFAULT_DEVICE_BLOCKED   3
@@ -61466,9 +64056,10 @@ diff -urNp linux-3.1.3/include/scsi/scsi_device.h linux-3.1.3/include/scsi/scsi_
  
        struct device           sdev_gendev,
                                sdev_dev;
-diff -urNp linux-3.1.3/include/scsi/scsi_transport_fc.h linux-3.1.3/include/scsi/scsi_transport_fc.h
---- linux-3.1.3/include/scsi/scsi_transport_fc.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/scsi/scsi_transport_fc.h       2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h
+index 2a65167..91e01f8 100644
+--- a/include/scsi/scsi_transport_fc.h
++++ b/include/scsi/scsi_transport_fc.h
 @@ -711,7 +711,7 @@ struct fc_function_template {
        unsigned long   show_host_system_hostname:1;
  
@@ -61478,9 +64069,10 @@ diff -urNp linux-3.1.3/include/scsi/scsi_transport_fc.h linux-3.1.3/include/scsi
  
  
  /**
-diff -urNp linux-3.1.3/include/sound/ak4xxx-adda.h linux-3.1.3/include/sound/ak4xxx-adda.h
---- linux-3.1.3/include/sound/ak4xxx-adda.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/sound/ak4xxx-adda.h    2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/sound/ak4xxx-adda.h b/include/sound/ak4xxx-adda.h
+index 030b87c..98a6954 100644
+--- a/include/sound/ak4xxx-adda.h
++++ b/include/sound/ak4xxx-adda.h
 @@ -35,7 +35,7 @@ struct snd_ak4xxx_ops {
        void (*write)(struct snd_akm4xxx *ak, int chip, unsigned char reg,
                      unsigned char val);
@@ -61490,9 +64082,10 @@ diff -urNp linux-3.1.3/include/sound/ak4xxx-adda.h linux-3.1.3/include/sound/ak4
  
  #define AK4XXX_IMAGE_SIZE     (AK4XXX_MAX_CHIPS * 16) /* 64 bytes */
  
-diff -urNp linux-3.1.3/include/sound/hwdep.h linux-3.1.3/include/sound/hwdep.h
---- linux-3.1.3/include/sound/hwdep.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/sound/hwdep.h  2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/sound/hwdep.h b/include/sound/hwdep.h
+index 8c05e47..2b5df97 100644
+--- a/include/sound/hwdep.h
++++ b/include/sound/hwdep.h
 @@ -49,7 +49,7 @@ struct snd_hwdep_ops {
                          struct snd_hwdep_dsp_status *status);
        int (*dsp_load)(struct snd_hwdep *hw,
@@ -61502,9 +64095,10 @@ diff -urNp linux-3.1.3/include/sound/hwdep.h linux-3.1.3/include/sound/hwdep.h
  
  struct snd_hwdep {
        struct snd_card *card;
-diff -urNp linux-3.1.3/include/sound/info.h linux-3.1.3/include/sound/info.h
---- linux-3.1.3/include/sound/info.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/sound/info.h   2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/sound/info.h b/include/sound/info.h
+index 4e94cf1..76748b1 100644
+--- a/include/sound/info.h
++++ b/include/sound/info.h
 @@ -44,7 +44,7 @@ struct snd_info_entry_text {
                     struct snd_info_buffer *buffer);
        void (*write)(struct snd_info_entry *entry,
@@ -61514,9 +64108,10 @@ diff -urNp linux-3.1.3/include/sound/info.h linux-3.1.3/include/sound/info.h
  
  struct snd_info_entry_ops {
        int (*open)(struct snd_info_entry *entry,
-diff -urNp linux-3.1.3/include/sound/pcm.h linux-3.1.3/include/sound/pcm.h
---- linux-3.1.3/include/sound/pcm.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/sound/pcm.h    2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/sound/pcm.h b/include/sound/pcm.h
+index 57e71fa..a2c7534 100644
+--- a/include/sound/pcm.h
++++ b/include/sound/pcm.h
 @@ -81,6 +81,7 @@ struct snd_pcm_ops {
        int (*mmap)(struct snd_pcm_substream *substream, struct vm_area_struct *vma);
        int (*ack)(struct snd_pcm_substream *substream);
@@ -61525,9 +64120,10 @@ diff -urNp linux-3.1.3/include/sound/pcm.h linux-3.1.3/include/sound/pcm.h
  
  /*
   *
-diff -urNp linux-3.1.3/include/sound/sb16_csp.h linux-3.1.3/include/sound/sb16_csp.h
---- linux-3.1.3/include/sound/sb16_csp.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/sound/sb16_csp.h       2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/sound/sb16_csp.h b/include/sound/sb16_csp.h
+index af1b49e..a5d55a5 100644
+--- a/include/sound/sb16_csp.h
++++ b/include/sound/sb16_csp.h
 @@ -146,7 +146,7 @@ struct snd_sb_csp_ops {
        int (*csp_start) (struct snd_sb_csp * p, int sample_width, int channels);
        int (*csp_stop) (struct snd_sb_csp * p);
@@ -61537,9 +64133,10 @@ diff -urNp linux-3.1.3/include/sound/sb16_csp.h linux-3.1.3/include/sound/sb16_c
  
  /*
   * CSP private data
-diff -urNp linux-3.1.3/include/sound/soc.h linux-3.1.3/include/sound/soc.h
---- linux-3.1.3/include/sound/soc.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/sound/soc.h    2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/sound/soc.h b/include/sound/soc.h
+index aa19f5a..a5b8208 100644
+--- a/include/sound/soc.h
++++ b/include/sound/soc.h
 @@ -676,7 +676,7 @@ struct snd_soc_platform_driver {
        /* platform IO - used for platform DAPM */
        unsigned int (*read)(struct snd_soc_platform *, unsigned int);
@@ -61549,9 +64146,10 @@ diff -urNp linux-3.1.3/include/sound/soc.h linux-3.1.3/include/sound/soc.h
  
  struct snd_soc_platform {
        const char *name;
-diff -urNp linux-3.1.3/include/sound/ymfpci.h linux-3.1.3/include/sound/ymfpci.h
---- linux-3.1.3/include/sound/ymfpci.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/sound/ymfpci.h 2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/sound/ymfpci.h b/include/sound/ymfpci.h
+index 444cd6b..3327cc5 100644
+--- a/include/sound/ymfpci.h
++++ b/include/sound/ymfpci.h
 @@ -358,7 +358,7 @@ struct snd_ymfpci {
        spinlock_t reg_lock;
        spinlock_t voice_lock;
@@ -61561,9 +64159,10 @@ diff -urNp linux-3.1.3/include/sound/ymfpci.h linux-3.1.3/include/sound/ymfpci.h
        struct snd_info_entry *proc_entry;
        const struct firmware *dsp_microcode;
        const struct firmware *controller_microcode;
-diff -urNp linux-3.1.3/include/target/target_core_base.h linux-3.1.3/include/target/target_core_base.h
---- linux-3.1.3/include/target/target_core_base.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/target/target_core_base.h      2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
+index 2704065..e10f3ef 100644
+--- a/include/target/target_core_base.h
++++ b/include/target/target_core_base.h
 @@ -356,7 +356,7 @@ struct t10_reservation_ops {
        int (*t10_seq_non_holder)(struct se_cmd *, unsigned char *, u32);
        int (*t10_pr_register)(struct se_cmd *);
@@ -61593,9 +64192,10 @@ diff -urNp linux-3.1.3/include/target/target_core_base.h linux-3.1.3/include/tar
        atomic_t                dev_tur_active;
        atomic_t                execute_tasks;
        atomic_t                dev_status_thr_count;
-diff -urNp linux-3.1.3/include/trace/events/irq.h linux-3.1.3/include/trace/events/irq.h
---- linux-3.1.3/include/trace/events/irq.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/trace/events/irq.h     2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/trace/events/irq.h b/include/trace/events/irq.h
+index 1c09820..7f5ec79 100644
+--- a/include/trace/events/irq.h
++++ b/include/trace/events/irq.h
 @@ -36,7 +36,7 @@ struct softirq_action;
   */
  TRACE_EVENT(irq_handler_entry,
@@ -61614,9 +64214,10 @@ diff -urNp linux-3.1.3/include/trace/events/irq.h linux-3.1.3/include/trace/even
  
        TP_ARGS(irq, action, ret),
  
-diff -urNp linux-3.1.3/include/video/udlfb.h linux-3.1.3/include/video/udlfb.h
---- linux-3.1.3/include/video/udlfb.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/video/udlfb.h  2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/video/udlfb.h b/include/video/udlfb.h
+index 69d485a..dd0bee7 100644
+--- a/include/video/udlfb.h
++++ b/include/video/udlfb.h
 @@ -51,10 +51,10 @@ struct dlfb_data {
        int base8;
        u32 pseudo_palette[256];
@@ -61632,9 +64233,10 @@ diff -urNp linux-3.1.3/include/video/udlfb.h linux-3.1.3/include/video/udlfb.h
  };
  
  #define NR_USB_REQUEST_I2C_SUB_IO 0x02
-diff -urNp linux-3.1.3/include/video/uvesafb.h linux-3.1.3/include/video/uvesafb.h
---- linux-3.1.3/include/video/uvesafb.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/include/video/uvesafb.h        2011-11-16 18:39:08.000000000 -0500
+diff --git a/include/video/uvesafb.h b/include/video/uvesafb.h
+index 0993a22..32ba2fe 100644
+--- a/include/video/uvesafb.h
++++ b/include/video/uvesafb.h
 @@ -177,6 +177,7 @@ struct uvesafb_par {
        u8 ypan;                        /* 0 - nothing, 1 - ypan, 2 - ywrap */
        u8 pmi_setpal;                  /* PMI for palette changes */
@@ -61643,10 +64245,24 @@ diff -urNp linux-3.1.3/include/video/uvesafb.h linux-3.1.3/include/video/uvesafb
        void *pmi_start;
        void *pmi_pal;
        u8 *vbe_state_orig;             /*
-diff -urNp linux-3.1.3/init/do_mounts.c linux-3.1.3/init/do_mounts.c
---- linux-3.1.3/init/do_mounts.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/init/do_mounts.c       2011-11-16 18:39:08.000000000 -0500
-@@ -287,11 +287,11 @@ static void __init get_fs_names(char *pa
+diff --git a/init/Kconfig b/init/Kconfig
+index d627783..693a9f3 100644
+--- a/init/Kconfig
++++ b/init/Kconfig
+@@ -1202,7 +1202,7 @@ config SLUB_DEBUG
+ config COMPAT_BRK
+       bool "Disable heap randomization"
+-      default y
++      default n
+       help
+         Randomizing heap placement makes heap exploits harder, but it
+         also breaks ancient binaries (including anything libc5 based).
+diff --git a/init/do_mounts.c b/init/do_mounts.c
+index c0851a8..4f8977d 100644
+--- a/init/do_mounts.c
++++ b/init/do_mounts.c
+@@ -287,11 +287,11 @@ static void __init get_fs_names(char *page)
  
  static int __init do_mount_root(char *name, char *fs, int flags, void *data)
  {
@@ -61660,7 +64276,7 @@ diff -urNp linux-3.1.3/init/do_mounts.c linux-3.1.3/init/do_mounts.c
        ROOT_DEV = current->fs->pwd.mnt->mnt_sb->s_dev;
        printk(KERN_INFO
               "VFS: Mounted root (%s filesystem)%s on device %u:%u.\n",
-@@ -383,18 +383,18 @@ void __init change_floppy(char *fmt, ...
+@@ -383,18 +383,18 @@ void __init change_floppy(char *fmt, ...)
        va_start(args, fmt);
        vsprintf(buf, fmt, args);
        va_end(args);
@@ -61691,9 +64307,10 @@ diff -urNp linux-3.1.3/init/do_mounts.c linux-3.1.3/init/do_mounts.c
 +      sys_mount((char __force_user *)".", (char __force_user *)"/", NULL, MS_MOVE, NULL);
 +      sys_chroot((const char __force_user *)".");
  }
-diff -urNp linux-3.1.3/init/do_mounts.h linux-3.1.3/init/do_mounts.h
---- linux-3.1.3/init/do_mounts.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/init/do_mounts.h       2011-11-16 18:39:08.000000000 -0500
+diff --git a/init/do_mounts.h b/init/do_mounts.h
+index f5b978a..69dbfe8 100644
+--- a/init/do_mounts.h
++++ b/init/do_mounts.h
 @@ -15,15 +15,15 @@ extern int root_mountflags;
  
  static inline int create_dev(char *name, dev_t dev)
@@ -61722,9 +64339,10 @@ diff -urNp linux-3.1.3/init/do_mounts.h linux-3.1.3/init/do_mounts.h
                return 0;
        if (!S_ISBLK(stat.st_mode))
                return 0;
-diff -urNp linux-3.1.3/init/do_mounts_initrd.c linux-3.1.3/init/do_mounts_initrd.c
---- linux-3.1.3/init/do_mounts_initrd.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/init/do_mounts_initrd.c        2011-11-16 18:39:08.000000000 -0500
+diff --git a/init/do_mounts_initrd.c b/init/do_mounts_initrd.c
+index 3098a38..253064e 100644
+--- a/init/do_mounts_initrd.c
++++ b/init/do_mounts_initrd.c
 @@ -44,13 +44,13 @@ static void __init handle_initrd(void)
        create_dev("/dev/root.old", Root_RAM0);
        /* mount initrd on rootfs' /root */
@@ -61799,9 +64417,10 @@ diff -urNp linux-3.1.3/init/do_mounts_initrd.c linux-3.1.3/init/do_mounts_initrd
 +      sys_unlink((const char __force_user *)"/initrd.image");
        return 0;
  }
-diff -urNp linux-3.1.3/init/do_mounts_md.c linux-3.1.3/init/do_mounts_md.c
---- linux-3.1.3/init/do_mounts_md.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/init/do_mounts_md.c    2011-11-16 18:39:08.000000000 -0500
+diff --git a/init/do_mounts_md.c b/init/do_mounts_md.c
+index 32c4799..c27ee74 100644
+--- a/init/do_mounts_md.c
++++ b/init/do_mounts_md.c
 @@ -170,7 +170,7 @@ static void __init md_setup_drive(void)
                        partitioned ? "_d" : "", minor,
                        md_setup_args[ent].device_names);
@@ -61829,9 +64448,10 @@ diff -urNp linux-3.1.3/init/do_mounts_md.c linux-3.1.3/init/do_mounts_md.c
        if (fd >= 0) {
                sys_ioctl(fd, RAID_AUTORUN, raid_autopart);
                sys_close(fd);
-diff -urNp linux-3.1.3/init/initramfs.c linux-3.1.3/init/initramfs.c
---- linux-3.1.3/init/initramfs.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/init/initramfs.c       2011-11-16 18:39:08.000000000 -0500
+diff --git a/init/initramfs.c b/init/initramfs.c
+index 2531811..040d4d4 100644
+--- a/init/initramfs.c
++++ b/init/initramfs.c
 @@ -74,7 +74,7 @@ static void __init free_hash(void)
        }
  }
@@ -61859,7 +64479,7 @@ diff -urNp linux-3.1.3/init/initramfs.c linux-3.1.3/init/initramfs.c
        }
        return 0;
  }
-@@ -280,11 +280,11 @@ static void __init clean_path(char *path
+@@ -280,11 +280,11 @@ static void __init clean_path(char *path, mode_t mode)
  {
        struct stat st;
  
@@ -61940,22 +64560,11 @@ diff -urNp linux-3.1.3/init/initramfs.c linux-3.1.3/init/initramfs.c
        state = SkipIt;
        next_state = Reset;
        return 0;
-diff -urNp linux-3.1.3/init/Kconfig linux-3.1.3/init/Kconfig
---- linux-3.1.3/init/Kconfig   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/init/Kconfig   2011-11-16 18:39:08.000000000 -0500
-@@ -1202,7 +1202,7 @@ config SLUB_DEBUG
- config COMPAT_BRK
-       bool "Disable heap randomization"
--      default y
-+      default n
-       help
-         Randomizing heap placement makes heap exploits harder, but it
-         also breaks ancient binaries (including anything libc5 based).
-diff -urNp linux-3.1.3/init/main.c linux-3.1.3/init/main.c
---- linux-3.1.3/init/main.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/init/main.c    2011-11-16 18:40:44.000000000 -0500
-@@ -96,6 +96,8 @@ static inline void mark_rodata_ro(void) 
+diff --git a/init/main.c b/init/main.c
+index 03b408d..5777f59 100644
+--- a/init/main.c
++++ b/init/main.c
+@@ -96,6 +96,8 @@ static inline void mark_rodata_ro(void) { }
  extern void tc_init(void);
  #endif
  
@@ -61964,7 +64573,7 @@ diff -urNp linux-3.1.3/init/main.c linux-3.1.3/init/main.c
  /*
   * Debug helper: via this flag we know that we are in 'early bootup code'
   * where only the boot processor is running with IRQ disabled.  This means
-@@ -149,6 +151,49 @@ static int __init set_reset_devices(char
+@@ -149,6 +151,49 @@ static int __init set_reset_devices(char *str)
  
  __setup("reset_devices", set_reset_devices);
  
@@ -62014,7 +64623,7 @@ diff -urNp linux-3.1.3/init/main.c linux-3.1.3/init/main.c
  static const char * argv_init[MAX_INIT_ARGS+2] = { "init", NULL, };
  const char * envp_init[MAX_INIT_ENVS+2] = { "HOME=/", "TERM=linux", NULL, };
  static const char *panic_later, *panic_param;
-@@ -678,6 +723,7 @@ int __init_or_module do_one_initcall(ini
+@@ -678,6 +723,7 @@ int __init_or_module do_one_initcall(initcall_t fn)
  {
        int count = preempt_count();
        int ret;
@@ -62022,7 +64631,7 @@ diff -urNp linux-3.1.3/init/main.c linux-3.1.3/init/main.c
  
        if (initcall_debug)
                ret = do_one_initcall_debug(fn);
-@@ -690,15 +736,15 @@ int __init_or_module do_one_initcall(ini
+@@ -690,15 +736,15 @@ int __init_or_module do_one_initcall(initcall_t fn)
                sprintf(msgbuf, "error code %d ", ret);
  
        if (preempt_count() != count) {
@@ -62042,7 +64651,7 @@ diff -urNp linux-3.1.3/init/main.c linux-3.1.3/init/main.c
        }
  
        return ret;
-@@ -817,7 +863,7 @@ static int __init kernel_init(void * unu
+@@ -817,7 +863,7 @@ static int __init kernel_init(void * unused)
        do_basic_setup();
  
        /* Open the /dev/console on the rootfs, this should never fail */
@@ -62051,7 +64660,7 @@ diff -urNp linux-3.1.3/init/main.c linux-3.1.3/init/main.c
                printk(KERN_WARNING "Warning: unable to open an initial console.\n");
  
        (void) sys_dup(0);
-@@ -830,11 +876,13 @@ static int __init kernel_init(void * unu
+@@ -830,11 +876,13 @@ static int __init kernel_init(void * unused)
        if (!ramdisk_execute_command)
                ramdisk_execute_command = "/init";
  
@@ -62066,10 +64675,11 @@ diff -urNp linux-3.1.3/init/main.c linux-3.1.3/init/main.c
        /*
         * Ok, we have completed the initial bootup, and
         * we're essentially up and running. Get rid of the
-diff -urNp linux-3.1.3/ipc/mqueue.c linux-3.1.3/ipc/mqueue.c
---- linux-3.1.3/ipc/mqueue.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/ipc/mqueue.c   2011-11-16 18:40:44.000000000 -0500
-@@ -156,6 +156,7 @@ static struct inode *mqueue_get_inode(st
+diff --git a/ipc/mqueue.c b/ipc/mqueue.c
+index ed049ea..6442f7f 100644
+--- a/ipc/mqueue.c
++++ b/ipc/mqueue.c
+@@ -156,6 +156,7 @@ static struct inode *mqueue_get_inode(struct super_block *sb,
                mq_bytes = (mq_msg_tblsz +
                        (info->attr.mq_maxmsg * info->attr.mq_msgsize));
  
@@ -62077,10 +64687,11 @@ diff -urNp linux-3.1.3/ipc/mqueue.c linux-3.1.3/ipc/mqueue.c
                spin_lock(&mq_lock);
                if (u->mq_bytes + mq_bytes < u->mq_bytes ||
                    u->mq_bytes + mq_bytes > task_rlimit(p, RLIMIT_MSGQUEUE)) {
-diff -urNp linux-3.1.3/ipc/msg.c linux-3.1.3/ipc/msg.c
---- linux-3.1.3/ipc/msg.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/ipc/msg.c      2011-11-16 18:39:08.000000000 -0500
-@@ -309,18 +309,19 @@ static inline int msg_security(struct ke
+diff --git a/ipc/msg.c b/ipc/msg.c
+index 7385de2..a8180e0 100644
+--- a/ipc/msg.c
++++ b/ipc/msg.c
+@@ -309,18 +309,19 @@ static inline int msg_security(struct kern_ipc_perm *ipcp, int msgflg)
        return security_msg_queue_associate(msq, msgflg);
  }
  
@@ -62105,10 +64716,11 @@ diff -urNp linux-3.1.3/ipc/msg.c linux-3.1.3/ipc/msg.c
        msg_params.key = key;
        msg_params.flg = msgflg;
  
-diff -urNp linux-3.1.3/ipc/sem.c linux-3.1.3/ipc/sem.c
---- linux-3.1.3/ipc/sem.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/ipc/sem.c      2011-11-16 18:40:44.000000000 -0500
-@@ -318,10 +318,15 @@ static inline int sem_more_checks(struct
+diff --git a/ipc/sem.c b/ipc/sem.c
+index c8e00f8..1135c4e 100644
+--- a/ipc/sem.c
++++ b/ipc/sem.c
+@@ -318,10 +318,15 @@ static inline int sem_more_checks(struct kern_ipc_perm *ipcp,
        return 0;
  }
  
@@ -62125,7 +64737,7 @@ diff -urNp linux-3.1.3/ipc/sem.c linux-3.1.3/ipc/sem.c
        struct ipc_params sem_params;
  
        ns = current->nsproxy->ipc_ns;
-@@ -329,10 +334,6 @@ SYSCALL_DEFINE3(semget, key_t, key, int,
+@@ -329,10 +334,6 @@ SYSCALL_DEFINE3(semget, key_t, key, int, nsems, int, semflg)
        if (nsems < 0 || nsems > ns->sc_semmsl)
                return -EINVAL;
  
@@ -62136,7 +64748,7 @@ diff -urNp linux-3.1.3/ipc/sem.c linux-3.1.3/ipc/sem.c
        sem_params.key = key;
        sem_params.flg = semflg;
        sem_params.u.nsems = nsems;
-@@ -848,6 +849,8 @@ static int semctl_main(struct ipc_namesp
+@@ -848,6 +849,8 @@ static int semctl_main(struct ipc_namespace *ns, int semid, int semnum,
        int nsems;
        struct list_head tasks;
  
@@ -62145,7 +64757,7 @@ diff -urNp linux-3.1.3/ipc/sem.c linux-3.1.3/ipc/sem.c
        sma = sem_lock_check(ns, semid);
        if (IS_ERR(sma))
                return PTR_ERR(sma);
-@@ -1295,6 +1298,8 @@ SYSCALL_DEFINE4(semtimedop, int, semid, 
+@@ -1295,6 +1298,8 @@ SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops,
        struct ipc_namespace *ns;
        struct list_head tasks;
  
@@ -62154,10 +64766,11 @@ diff -urNp linux-3.1.3/ipc/sem.c linux-3.1.3/ipc/sem.c
        ns = current->nsproxy->ipc_ns;
  
        if (nsops < 1 || semid < 0)
-diff -urNp linux-3.1.3/ipc/shm.c linux-3.1.3/ipc/shm.c
---- linux-3.1.3/ipc/shm.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/ipc/shm.c      2011-11-16 18:40:44.000000000 -0500
-@@ -69,6 +69,14 @@ static void shm_destroy (struct ipc_name
+diff --git a/ipc/shm.c b/ipc/shm.c
+index 02ecf2c..c8f5627 100644
+--- a/ipc/shm.c
++++ b/ipc/shm.c
+@@ -69,6 +69,14 @@ static void shm_destroy (struct ipc_namespace *ns, struct shmid_kernel *shp);
  static int sysvipc_shm_proc_show(struct seq_file *s, void *it);
  #endif
  
@@ -62172,7 +64785,7 @@ diff -urNp linux-3.1.3/ipc/shm.c linux-3.1.3/ipc/shm.c
  void shm_init_ns(struct ipc_namespace *ns)
  {
        ns->shm_ctlmax = SHMMAX;
-@@ -508,6 +516,14 @@ static int newseg(struct ipc_namespace *
+@@ -508,6 +516,14 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
        shp->shm_lprid = 0;
        shp->shm_atim = shp->shm_dtim = 0;
        shp->shm_ctim = get_seconds();
@@ -62187,7 +64800,7 @@ diff -urNp linux-3.1.3/ipc/shm.c linux-3.1.3/ipc/shm.c
        shp->shm_segsz = size;
        shp->shm_nattch = 0;
        shp->shm_file = file;
-@@ -559,18 +575,19 @@ static inline int shm_more_checks(struct
+@@ -559,18 +575,19 @@ static inline int shm_more_checks(struct kern_ipc_perm *ipcp,
        return 0;
  }
  
@@ -62212,7 +64825,7 @@ diff -urNp linux-3.1.3/ipc/shm.c linux-3.1.3/ipc/shm.c
        shm_params.key = key;
        shm_params.flg = shmflg;
        shm_params.u.size = size;
-@@ -870,8 +887,6 @@ SYSCALL_DEFINE3(shmctl, int, shmid, int,
+@@ -870,8 +887,6 @@ SYSCALL_DEFINE3(shmctl, int, shmid, int, cmd, struct shmid_ds __user *, buf)
        case SHM_LOCK:
        case SHM_UNLOCK:
        {
@@ -62221,7 +64834,7 @@ diff -urNp linux-3.1.3/ipc/shm.c linux-3.1.3/ipc/shm.c
                lru_add_drain_all();  /* drain pagevecs to lru lists */
  
                shp = shm_lock_check(ns, shmid);
-@@ -1004,9 +1019,21 @@ long do_shmat(int shmid, char __user *sh
+@@ -1004,9 +1019,21 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr)
        if (err)
                goto out_unlock;
  
@@ -62243,10 +64856,11 @@ diff -urNp linux-3.1.3/ipc/shm.c linux-3.1.3/ipc/shm.c
        size = i_size_read(path.dentry->d_inode);
        shm_unlock(shp);
  
-diff -urNp linux-3.1.3/kernel/acct.c linux-3.1.3/kernel/acct.c
---- linux-3.1.3/kernel/acct.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/acct.c  2011-11-16 18:39:08.000000000 -0500
-@@ -570,7 +570,7 @@ static void do_acct_process(struct bsd_a
+diff --git a/kernel/acct.c b/kernel/acct.c
+index fa7eb3d..7faf116 100644
+--- a/kernel/acct.c
++++ b/kernel/acct.c
+@@ -570,7 +570,7 @@ static void do_acct_process(struct bsd_acct_struct *acct,
         */
        flim = current->signal->rlim[RLIMIT_FSIZE].rlim_cur;
        current->signal->rlim[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY;
@@ -62255,9 +64869,10 @@ diff -urNp linux-3.1.3/kernel/acct.c linux-3.1.3/kernel/acct.c
                               sizeof(acct_t), &file->f_pos);
        current->signal->rlim[RLIMIT_FSIZE].rlim_cur = flim;
        set_fs(fs);
-diff -urNp linux-3.1.3/kernel/audit.c linux-3.1.3/kernel/audit.c
---- linux-3.1.3/kernel/audit.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/audit.c 2011-11-16 18:39:08.000000000 -0500
+diff --git a/kernel/audit.c b/kernel/audit.c
+index 0a1355c..dca420f 100644
+--- a/kernel/audit.c
++++ b/kernel/audit.c
 @@ -115,7 +115,7 @@ u32                audit_sig_sid = 0;
     3) suppressed due to audit_rate_limit
     4) suppressed due to audit_backlog_limit
@@ -62285,7 +64900,7 @@ diff -urNp linux-3.1.3/kernel/audit.c linux-3.1.3/kernel/audit.c
                                audit_rate_limit,
                                audit_backlog_limit);
                audit_panic(message);
-@@ -689,7 +689,7 @@ static int audit_receive_msg(struct sk_b
+@@ -689,7 +689,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
                status_set.pid           = audit_pid;
                status_set.rate_limit    = audit_rate_limit;
                status_set.backlog_limit = audit_backlog_limit;
@@ -62294,10 +64909,11 @@ diff -urNp linux-3.1.3/kernel/audit.c linux-3.1.3/kernel/audit.c
                status_set.backlog       = skb_queue_len(&audit_skb_queue);
                audit_send_reply(NETLINK_CB(skb).pid, seq, AUDIT_GET, 0, 0,
                                 &status_set, sizeof(status_set));
-diff -urNp linux-3.1.3/kernel/auditsc.c linux-3.1.3/kernel/auditsc.c
---- linux-3.1.3/kernel/auditsc.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/auditsc.c       2011-11-16 18:39:08.000000000 -0500
-@@ -2118,7 +2118,7 @@ int auditsc_get_stamp(struct audit_conte
+diff --git a/kernel/auditsc.c b/kernel/auditsc.c
+index ce4b054..8139ed7 100644
+--- a/kernel/auditsc.c
++++ b/kernel/auditsc.c
+@@ -2118,7 +2118,7 @@ int auditsc_get_stamp(struct audit_context *ctx,
  }
  
  /* global counter which is incremented every time something logs in */
@@ -62306,7 +64922,7 @@ diff -urNp linux-3.1.3/kernel/auditsc.c linux-3.1.3/kernel/auditsc.c
  
  /**
   * audit_set_loginuid - set a task's audit_context loginuid
-@@ -2131,7 +2131,7 @@ static atomic_t session_id = ATOMIC_INIT
+@@ -2131,7 +2131,7 @@ static atomic_t session_id = ATOMIC_INIT(0);
   */
  int audit_set_loginuid(struct task_struct *task, uid_t loginuid)
  {
@@ -62315,10 +64931,11 @@ diff -urNp linux-3.1.3/kernel/auditsc.c linux-3.1.3/kernel/auditsc.c
        struct audit_context *context = task->audit_context;
  
        if (context && context->in_syscall) {
-diff -urNp linux-3.1.3/kernel/capability.c linux-3.1.3/kernel/capability.c
---- linux-3.1.3/kernel/capability.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/capability.c    2011-11-16 18:40:44.000000000 -0500
-@@ -202,6 +202,9 @@ SYSCALL_DEFINE2(capget, cap_user_header_
+diff --git a/kernel/capability.c b/kernel/capability.c
+index 283c529..36ac81e 100644
+--- a/kernel/capability.c
++++ b/kernel/capability.c
+@@ -202,6 +202,9 @@ SYSCALL_DEFINE2(capget, cap_user_header_t, header, cap_user_data_t, dataptr)
                 * before modification is attempted and the application
                 * fails.
                 */
@@ -62328,7 +64945,7 @@ diff -urNp linux-3.1.3/kernel/capability.c linux-3.1.3/kernel/capability.c
                if (copy_to_user(dataptr, kdata, tocopy
                                 * sizeof(struct __user_cap_data_struct))) {
                        return -EFAULT;
-@@ -374,7 +377,7 @@ bool ns_capable(struct user_namespace *n
+@@ -374,7 +377,7 @@ bool ns_capable(struct user_namespace *ns, int cap)
                BUG();
        }
  
@@ -62337,7 +64954,7 @@ diff -urNp linux-3.1.3/kernel/capability.c linux-3.1.3/kernel/capability.c
                current->flags |= PF_SUPERPRIV;
                return true;
        }
-@@ -382,6 +385,27 @@ bool ns_capable(struct user_namespace *n
+@@ -382,6 +385,27 @@ bool ns_capable(struct user_namespace *ns, int cap)
  }
  EXPORT_SYMBOL(ns_capable);
  
@@ -62365,7 +64982,7 @@ diff -urNp linux-3.1.3/kernel/capability.c linux-3.1.3/kernel/capability.c
  /**
   * task_ns_capable - Determine whether current task has a superior
   * capability targeted at a specific task's user namespace.
-@@ -396,6 +420,12 @@ bool task_ns_capable(struct task_struct 
+@@ -396,6 +420,12 @@ bool task_ns_capable(struct task_struct *t, int cap)
  }
  EXPORT_SYMBOL(task_ns_capable);
  
@@ -62378,9 +64995,10 @@ diff -urNp linux-3.1.3/kernel/capability.c linux-3.1.3/kernel/capability.c
  /**
   * nsown_capable - Check superior capability to one's own user_ns
   * @cap: The capability in question
-diff -urNp linux-3.1.3/kernel/cgroup.c linux-3.1.3/kernel/cgroup.c
---- linux-3.1.3/kernel/cgroup.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/cgroup.c        2011-11-16 18:40:44.000000000 -0500
+diff --git a/kernel/cgroup.c b/kernel/cgroup.c
+index 1d2b6ce..87bf267 100644
+--- a/kernel/cgroup.c
++++ b/kernel/cgroup.c
 @@ -595,6 +595,8 @@ static struct css_set *find_css_set(
        struct hlist_head *hhead;
        struct cg_cgroup_link *link;
@@ -62390,9 +65008,10 @@ diff -urNp linux-3.1.3/kernel/cgroup.c linux-3.1.3/kernel/cgroup.c
        /* First see if we already have a cgroup group that matches
         * the desired set */
        read_lock(&css_set_lock);
-diff -urNp linux-3.1.3/kernel/compat.c linux-3.1.3/kernel/compat.c
---- linux-3.1.3/kernel/compat.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/compat.c        2011-11-16 18:40:44.000000000 -0500
+diff --git a/kernel/compat.c b/kernel/compat.c
+index e2435ee..8e82199 100644
+--- a/kernel/compat.c
++++ b/kernel/compat.c
 @@ -13,6 +13,7 @@
  
  #include <linux/linkage.h>
@@ -62401,7 +65020,7 @@ diff -urNp linux-3.1.3/kernel/compat.c linux-3.1.3/kernel/compat.c
  #include <linux/errno.h>
  #include <linux/time.h>
  #include <linux/signal.h>
-@@ -167,7 +168,7 @@ static long compat_nanosleep_restart(str
+@@ -167,7 +168,7 @@ static long compat_nanosleep_restart(struct restart_block *restart)
        mm_segment_t oldfs;
        long ret;
  
@@ -62410,7 +65029,7 @@ diff -urNp linux-3.1.3/kernel/compat.c linux-3.1.3/kernel/compat.c
        oldfs = get_fs();
        set_fs(KERNEL_DS);
        ret = hrtimer_nanosleep_restart(restart);
-@@ -199,7 +200,7 @@ asmlinkage long compat_sys_nanosleep(str
+@@ -199,7 +200,7 @@ asmlinkage long compat_sys_nanosleep(struct compat_timespec __user *rqtp,
        oldfs = get_fs();
        set_fs(KERNEL_DS);
        ret = hrtimer_nanosleep(&tu,
@@ -62419,7 +65038,7 @@ diff -urNp linux-3.1.3/kernel/compat.c linux-3.1.3/kernel/compat.c
                                HRTIMER_MODE_REL, CLOCK_MONOTONIC);
        set_fs(oldfs);
  
-@@ -308,7 +309,7 @@ asmlinkage long compat_sys_sigpending(co
+@@ -308,7 +309,7 @@ asmlinkage long compat_sys_sigpending(compat_old_sigset_t __user *set)
        mm_segment_t old_fs = get_fs();
  
        set_fs(KERNEL_DS);
@@ -62428,7 +65047,7 @@ diff -urNp linux-3.1.3/kernel/compat.c linux-3.1.3/kernel/compat.c
        set_fs(old_fs);
        if (ret == 0)
                ret = put_user(s, set);
-@@ -331,8 +332,8 @@ asmlinkage long compat_sys_sigprocmask(i
+@@ -331,8 +332,8 @@ asmlinkage long compat_sys_sigprocmask(int how, compat_old_sigset_t __user *set,
        old_fs = get_fs();
        set_fs(KERNEL_DS);
        ret = sys_sigprocmask(how,
@@ -62439,7 +65058,7 @@ diff -urNp linux-3.1.3/kernel/compat.c linux-3.1.3/kernel/compat.c
        set_fs(old_fs);
        if (ret == 0)
                if (oset)
-@@ -369,7 +370,7 @@ asmlinkage long compat_sys_old_getrlimit
+@@ -369,7 +370,7 @@ asmlinkage long compat_sys_old_getrlimit(unsigned int resource,
        mm_segment_t old_fs = get_fs();
  
        set_fs(KERNEL_DS);
@@ -62448,7 +65067,7 @@ diff -urNp linux-3.1.3/kernel/compat.c linux-3.1.3/kernel/compat.c
        set_fs(old_fs);
  
        if (!ret) {
-@@ -441,7 +442,7 @@ asmlinkage long compat_sys_getrusage(int
+@@ -441,7 +442,7 @@ asmlinkage long compat_sys_getrusage(int who, struct compat_rusage __user *ru)
        mm_segment_t old_fs = get_fs();
  
        set_fs(KERNEL_DS);
@@ -62457,7 +65076,7 @@ diff -urNp linux-3.1.3/kernel/compat.c linux-3.1.3/kernel/compat.c
        set_fs(old_fs);
  
        if (ret)
-@@ -468,8 +469,8 @@ compat_sys_wait4(compat_pid_t pid, compa
+@@ -468,8 +469,8 @@ compat_sys_wait4(compat_pid_t pid, compat_uint_t __user *stat_addr, int options,
                set_fs (KERNEL_DS);
                ret = sys_wait4(pid,
                                (stat_addr ?
@@ -62468,7 +65087,7 @@ diff -urNp linux-3.1.3/kernel/compat.c linux-3.1.3/kernel/compat.c
                set_fs (old_fs);
  
                if (ret > 0) {
-@@ -494,8 +495,8 @@ asmlinkage long compat_sys_waitid(int wh
+@@ -494,8 +495,8 @@ asmlinkage long compat_sys_waitid(int which, compat_pid_t pid,
        memset(&info, 0, sizeof(info));
  
        set_fs(KERNEL_DS);
@@ -62479,7 +65098,7 @@ diff -urNp linux-3.1.3/kernel/compat.c linux-3.1.3/kernel/compat.c
        set_fs(old_fs);
  
        if ((ret < 0) || (info.si_signo == 0))
-@@ -625,8 +626,8 @@ long compat_sys_timer_settime(timer_t ti
+@@ -625,8 +626,8 @@ long compat_sys_timer_settime(timer_t timer_id, int flags,
        oldfs = get_fs();
        set_fs(KERNEL_DS);
        err = sys_timer_settime(timer_id, flags,
@@ -62490,7 +65109,7 @@ diff -urNp linux-3.1.3/kernel/compat.c linux-3.1.3/kernel/compat.c
        set_fs(oldfs);
        if (!err && old && put_compat_itimerspec(old, &oldts))
                return -EFAULT;
-@@ -643,7 +644,7 @@ long compat_sys_timer_gettime(timer_t ti
+@@ -643,7 +644,7 @@ long compat_sys_timer_gettime(timer_t timer_id,
        oldfs = get_fs();
        set_fs(KERNEL_DS);
        err = sys_timer_gettime(timer_id,
@@ -62499,7 +65118,7 @@ diff -urNp linux-3.1.3/kernel/compat.c linux-3.1.3/kernel/compat.c
        set_fs(oldfs);
        if (!err && put_compat_itimerspec(setting, &ts))
                return -EFAULT;
-@@ -662,7 +663,7 @@ long compat_sys_clock_settime(clockid_t 
+@@ -662,7 +663,7 @@ long compat_sys_clock_settime(clockid_t which_clock,
        oldfs = get_fs();
        set_fs(KERNEL_DS);
        err = sys_clock_settime(which_clock,
@@ -62508,7 +65127,7 @@ diff -urNp linux-3.1.3/kernel/compat.c linux-3.1.3/kernel/compat.c
        set_fs(oldfs);
        return err;
  }
-@@ -677,7 +678,7 @@ long compat_sys_clock_gettime(clockid_t 
+@@ -677,7 +678,7 @@ long compat_sys_clock_gettime(clockid_t which_clock,
        oldfs = get_fs();
        set_fs(KERNEL_DS);
        err = sys_clock_gettime(which_clock,
@@ -62517,7 +65136,7 @@ diff -urNp linux-3.1.3/kernel/compat.c linux-3.1.3/kernel/compat.c
        set_fs(oldfs);
        if (!err && put_compat_timespec(&ts, tp))
                return -EFAULT;
-@@ -697,7 +698,7 @@ long compat_sys_clock_adjtime(clockid_t 
+@@ -697,7 +698,7 @@ long compat_sys_clock_adjtime(clockid_t which_clock,
  
        oldfs = get_fs();
        set_fs(KERNEL_DS);
@@ -62526,7 +65145,7 @@ diff -urNp linux-3.1.3/kernel/compat.c linux-3.1.3/kernel/compat.c
        set_fs(oldfs);
  
        err = compat_put_timex(utp, &txc);
-@@ -717,7 +718,7 @@ long compat_sys_clock_getres(clockid_t w
+@@ -717,7 +718,7 @@ long compat_sys_clock_getres(clockid_t which_clock,
        oldfs = get_fs();
        set_fs(KERNEL_DS);
        err = sys_clock_getres(which_clock,
@@ -62535,7 +65154,7 @@ diff -urNp linux-3.1.3/kernel/compat.c linux-3.1.3/kernel/compat.c
        set_fs(oldfs);
        if (!err && tp && put_compat_timespec(&ts, tp))
                return -EFAULT;
-@@ -729,9 +730,9 @@ static long compat_clock_nanosleep_resta
+@@ -729,9 +730,9 @@ static long compat_clock_nanosleep_restart(struct restart_block *restart)
        long err;
        mm_segment_t oldfs;
        struct timespec tu;
@@ -62547,7 +65166,7 @@ diff -urNp linux-3.1.3/kernel/compat.c linux-3.1.3/kernel/compat.c
        oldfs = get_fs();
        set_fs(KERNEL_DS);
        err = clock_nanosleep_restart(restart);
-@@ -763,8 +764,8 @@ long compat_sys_clock_nanosleep(clockid_
+@@ -763,8 +764,8 @@ long compat_sys_clock_nanosleep(clockid_t which_clock, int flags,
        oldfs = get_fs();
        set_fs(KERNEL_DS);
        err = sys_clock_nanosleep(which_clock, flags,
@@ -62558,9 +65177,10 @@ diff -urNp linux-3.1.3/kernel/compat.c linux-3.1.3/kernel/compat.c
        set_fs(oldfs);
  
        if ((err == -ERESTART_RESTARTBLOCK) && rmtp &&
-diff -urNp linux-3.1.3/kernel/configs.c linux-3.1.3/kernel/configs.c
---- linux-3.1.3/kernel/configs.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/configs.c       2011-11-16 18:40:44.000000000 -0500
+diff --git a/kernel/configs.c b/kernel/configs.c
+index 42e8fa0..9e7406b 100644
+--- a/kernel/configs.c
++++ b/kernel/configs.c
 @@ -74,8 +74,19 @@ static int __init ikconfig_init(void)
        struct proc_dir_entry *entry;
  
@@ -62581,10 +65201,11 @@ diff -urNp linux-3.1.3/kernel/configs.c linux-3.1.3/kernel/configs.c
        if (!entry)
                return -ENOMEM;
  
-diff -urNp linux-3.1.3/kernel/cred.c linux-3.1.3/kernel/cred.c
---- linux-3.1.3/kernel/cred.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/cred.c  2011-11-16 18:40:44.000000000 -0500
-@@ -158,6 +158,8 @@ static void put_cred_rcu(struct rcu_head
+diff --git a/kernel/cred.c b/kernel/cred.c
+index 8ef31f5..f63d997 100644
+--- a/kernel/cred.c
++++ b/kernel/cred.c
+@@ -158,6 +158,8 @@ static void put_cred_rcu(struct rcu_head *rcu)
   */
  void __put_cred(struct cred *cred)
  {
@@ -62602,7 +65223,7 @@ diff -urNp linux-3.1.3/kernel/cred.c linux-3.1.3/kernel/cred.c
        kdebug("exit_creds(%u,%p,%p,{%d,%d})", tsk->pid, tsk->real_cred, tsk->cred,
               atomic_read(&tsk->cred->usage),
               read_cred_subscribers(tsk->cred));
-@@ -220,6 +224,8 @@ const struct cred *get_task_cred(struct 
+@@ -220,6 +224,8 @@ const struct cred *get_task_cred(struct task_struct *task)
  {
        const struct cred *cred;
  
@@ -62638,7 +65259,7 @@ diff -urNp linux-3.1.3/kernel/cred.c linux-3.1.3/kernel/cred.c
  #ifdef CONFIG_KEYS
        tgcred = kmalloc(sizeof(*tgcred), GFP_KERNEL);
        if (!tgcred)
-@@ -385,6 +397,8 @@ int copy_creds(struct task_struct *p, un
+@@ -385,6 +397,8 @@ int copy_creds(struct task_struct *p, unsigned long clone_flags)
        struct cred *new;
        int ret;
  
@@ -62674,7 +65295,7 @@ diff -urNp linux-3.1.3/kernel/cred.c linux-3.1.3/kernel/cred.c
        kdebug("abort_creds(%p{%d,%d})", new,
               atomic_read(&new->usage),
               read_cred_subscribers(new));
-@@ -572,6 +592,8 @@ const struct cred *override_creds(const 
+@@ -572,6 +592,8 @@ const struct cred *override_creds(const struct cred *new)
  {
        const struct cred *old = current->cred;
  
@@ -62683,7 +65304,7 @@ diff -urNp linux-3.1.3/kernel/cred.c linux-3.1.3/kernel/cred.c
        kdebug("override_creds(%p{%d,%d})", new,
               atomic_read(&new->usage),
               read_cred_subscribers(new));
-@@ -601,6 +623,8 @@ void revert_creds(const struct cred *old
+@@ -601,6 +623,8 @@ void revert_creds(const struct cred *old)
  {
        const struct cred *override = current->cred;
  
@@ -62692,7 +65313,7 @@ diff -urNp linux-3.1.3/kernel/cred.c linux-3.1.3/kernel/cred.c
        kdebug("revert_creds(%p{%d,%d})", old,
               atomic_read(&old->usage),
               read_cred_subscribers(old));
-@@ -647,6 +671,8 @@ struct cred *prepare_kernel_cred(struct 
+@@ -647,6 +671,8 @@ struct cred *prepare_kernel_cred(struct task_struct *daemon)
        const struct cred *old;
        struct cred *new;
  
@@ -62710,7 +65331,7 @@ diff -urNp linux-3.1.3/kernel/cred.c linux-3.1.3/kernel/cred.c
        return security_kernel_act_as(new, secid);
  }
  EXPORT_SYMBOL(set_security_override);
-@@ -720,6 +748,8 @@ int set_security_override_from_ctx(struc
+@@ -720,6 +748,8 @@ int set_security_override_from_ctx(struct cred *new, const char *secctx)
        u32 secid;
        int ret;
  
@@ -62719,10 +65340,11 @@ diff -urNp linux-3.1.3/kernel/cred.c linux-3.1.3/kernel/cred.c
        ret = security_secctx_to_secid(secctx, strlen(secctx), &secid);
        if (ret < 0)
                return ret;
-diff -urNp linux-3.1.3/kernel/debug/debug_core.c linux-3.1.3/kernel/debug/debug_core.c
---- linux-3.1.3/kernel/debug/debug_core.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/debug/debug_core.c      2011-11-16 18:39:08.000000000 -0500
-@@ -119,7 +119,7 @@ static DEFINE_RAW_SPINLOCK(dbg_slave_loc
+diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c
+index 0d7c087..01b8cef 100644
+--- a/kernel/debug/debug_core.c
++++ b/kernel/debug/debug_core.c
+@@ -119,7 +119,7 @@ static DEFINE_RAW_SPINLOCK(dbg_slave_lock);
   */
  static atomic_t                       masters_in_kgdb;
  static atomic_t                       slaves_in_kgdb;
@@ -62760,7 +65382,7 @@ diff -urNp linux-3.1.3/kernel/debug/debug_core.c linux-3.1.3/kernel/debug/debug_
                if (kgdb_info[sstep_cpu].task)
                        kgdb_sstep_pid = kgdb_info[sstep_cpu].task->pid;
                else
-@@ -834,18 +834,18 @@ static void kgdb_unregister_callbacks(vo
+@@ -834,18 +834,18 @@ static void kgdb_unregister_callbacks(void)
  static void kgdb_tasklet_bpt(unsigned long ing)
  {
        kgdb_breakpoint();
@@ -62782,10 +65404,11 @@ diff -urNp linux-3.1.3/kernel/debug/debug_core.c linux-3.1.3/kernel/debug/debug_
        tasklet_schedule(&kgdb_tasklet_breakpoint);
  }
  EXPORT_SYMBOL_GPL(kgdb_schedule_breakpoint);
-diff -urNp linux-3.1.3/kernel/debug/kdb/kdb_main.c linux-3.1.3/kernel/debug/kdb/kdb_main.c
---- linux-3.1.3/kernel/debug/kdb/kdb_main.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/debug/kdb/kdb_main.c    2011-11-16 18:39:08.000000000 -0500
-@@ -1980,7 +1980,7 @@ static int kdb_lsmod(int argc, const cha
+diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c
+index 63786e7..0780cac 100644
+--- a/kernel/debug/kdb/kdb_main.c
++++ b/kernel/debug/kdb/kdb_main.c
+@@ -1980,7 +1980,7 @@ static int kdb_lsmod(int argc, const char **argv)
        list_for_each_entry(mod, kdb_modules, list) {
  
                kdb_printf("%-20s%8u  0x%p ", mod->name,
@@ -62794,7 +65417,7 @@ diff -urNp linux-3.1.3/kernel/debug/kdb/kdb_main.c linux-3.1.3/kernel/debug/kdb/
  #ifdef CONFIG_MODULE_UNLOAD
                kdb_printf("%4d ", module_refcount(mod));
  #endif
-@@ -1990,7 +1990,7 @@ static int kdb_lsmod(int argc, const cha
+@@ -1990,7 +1990,7 @@ static int kdb_lsmod(int argc, const char **argv)
                        kdb_printf(" (Loading)");
                else
                        kdb_printf(" (Live)");
@@ -62803,10 +65426,11 @@ diff -urNp linux-3.1.3/kernel/debug/kdb/kdb_main.c linux-3.1.3/kernel/debug/kdb/
  
  #ifdef CONFIG_MODULE_UNLOAD
                {
-diff -urNp linux-3.1.3/kernel/events/core.c linux-3.1.3/kernel/events/core.c
---- linux-3.1.3/kernel/events/core.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/events/core.c   2011-11-16 18:39:08.000000000 -0500
-@@ -172,7 +172,7 @@ int perf_proc_update_handler(struct ctl_
+diff --git a/kernel/events/core.c b/kernel/events/core.c
+index 0f85778..0d43716 100644
+--- a/kernel/events/core.c
++++ b/kernel/events/core.c
+@@ -172,7 +172,7 @@ int perf_proc_update_handler(struct ctl_table *table, int write,
        return 0;
  }
  
@@ -62815,7 +65439,7 @@ diff -urNp linux-3.1.3/kernel/events/core.c linux-3.1.3/kernel/events/core.c
  
  static void cpu_ctx_sched_out(struct perf_cpu_context *cpuctx,
                              enum event_type_t event_type);
-@@ -2535,7 +2535,7 @@ static void __perf_event_read(void *info
+@@ -2535,7 +2535,7 @@ static void __perf_event_read(void *info)
  
  static inline u64 perf_event_count(struct perf_event *event)
  {
@@ -62824,7 +65448,7 @@ diff -urNp linux-3.1.3/kernel/events/core.c linux-3.1.3/kernel/events/core.c
  }
  
  static u64 perf_event_read(struct perf_event *event)
-@@ -3060,9 +3060,9 @@ u64 perf_event_read_value(struct perf_ev
+@@ -3060,9 +3060,9 @@ u64 perf_event_read_value(struct perf_event *event, u64 *enabled, u64 *running)
        mutex_lock(&event->child_mutex);
        total += perf_event_read(event);
        *enabled += event->total_time_enabled +
@@ -62836,7 +65460,7 @@ diff -urNp linux-3.1.3/kernel/events/core.c linux-3.1.3/kernel/events/core.c
  
        list_for_each_entry(child, &event->child_list, child_list) {
                total += perf_event_read(child);
-@@ -3448,10 +3448,10 @@ void perf_event_update_userpage(struct p
+@@ -3448,10 +3448,10 @@ void perf_event_update_userpage(struct perf_event *event)
                userpg->offset -= local64_read(&event->hw.prev_count);
  
        userpg->time_enabled = enabled +
@@ -62849,7 +65473,7 @@ diff -urNp linux-3.1.3/kernel/events/core.c linux-3.1.3/kernel/events/core.c
  
        barrier();
        ++userpg->lock;
-@@ -3822,11 +3822,11 @@ static void perf_output_read_one(struct 
+@@ -3822,11 +3822,11 @@ static void perf_output_read_one(struct perf_output_handle *handle,
        values[n++] = perf_event_count(event);
        if (read_format & PERF_FORMAT_TOTAL_TIME_ENABLED) {
                values[n++] = enabled +
@@ -62863,7 +65487,7 @@ diff -urNp linux-3.1.3/kernel/events/core.c linux-3.1.3/kernel/events/core.c
        }
        if (read_format & PERF_FORMAT_ID)
                values[n++] = primary_event_id(event);
-@@ -4477,12 +4477,12 @@ static void perf_event_mmap_event(struct
+@@ -4477,12 +4477,12 @@ static void perf_event_mmap_event(struct perf_mmap_event *mmap_event)
                 * need to add enough zero bytes after the string to handle
                 * the 64bit alignment we do later.
                 */
@@ -62878,7 +65502,7 @@ diff -urNp linux-3.1.3/kernel/events/core.c linux-3.1.3/kernel/events/core.c
                if (IS_ERR(name)) {
                        name = strncpy(tmp, "//toolong", sizeof(tmp));
                        goto got_name;
-@@ -5833,7 +5833,7 @@ perf_event_alloc(struct perf_event_attr 
+@@ -5833,7 +5833,7 @@ perf_event_alloc(struct perf_event_attr *attr, int cpu,
        event->parent           = parent_event;
  
        event->ns               = get_pid_ns(current->nsproxy->pid_ns);
@@ -62887,7 +65511,7 @@ diff -urNp linux-3.1.3/kernel/events/core.c linux-3.1.3/kernel/events/core.c
  
        event->state            = PERF_EVENT_STATE_INACTIVE;
  
-@@ -6355,10 +6355,10 @@ static void sync_child_event(struct perf
+@@ -6355,10 +6355,10 @@ static void sync_child_event(struct perf_event *child_event,
        /*
         * Add back the child's count to the parent's count:
         */
@@ -62901,9 +65525,10 @@ diff -urNp linux-3.1.3/kernel/events/core.c linux-3.1.3/kernel/events/core.c
                     &parent_event->child_total_time_running);
  
        /*
-diff -urNp linux-3.1.3/kernel/exit.c linux-3.1.3/kernel/exit.c
---- linux-3.1.3/kernel/exit.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/exit.c  2011-11-16 19:33:48.000000000 -0500
+diff --git a/kernel/exit.c b/kernel/exit.c
+index 2913b35..4465c81 100644
+--- a/kernel/exit.c
++++ b/kernel/exit.c
 @@ -57,6 +57,10 @@
  #include <asm/pgtable.h>
  #include <asm/mmu_context.h>
@@ -62915,7 +65540,7 @@ diff -urNp linux-3.1.3/kernel/exit.c linux-3.1.3/kernel/exit.c
  static void exit_mm(struct task_struct * tsk);
  
  static void __unhash_process(struct task_struct *p, bool group_dead)
-@@ -168,6 +172,10 @@ void release_task(struct task_struct * p
+@@ -168,6 +172,10 @@ void release_task(struct task_struct * p)
        struct task_struct *leader;
        int zap_leader;
  repeat:
@@ -62926,30 +65551,7 @@ diff -urNp linux-3.1.3/kernel/exit.c linux-3.1.3/kernel/exit.c
        /* don't need to get the RCU readlock here - the process is dead and
         * can't be modifying its own credentials. But shut RCU-lockdep up */
        rcu_read_lock();
-@@ -324,11 +332,22 @@ static void reparent_to_kthreadd(void)
- {
-       write_lock_irq(&tasklist_lock);
-+#ifdef CONFIG_GRKERNSEC
-+      write_lock(&grsec_exec_file_lock);
-+      if (current->exec_file) {
-+              fput(current->exec_file);
-+              current->exec_file = NULL;
-+      }
-+      write_unlock(&grsec_exec_file_lock);
-+#endif
-+
-       ptrace_unlink(current);
-       /* Reparent to init */
-       current->real_parent = current->parent = kthreadd_task;
-       list_move_tail(&current->sibling, &current->real_parent->children);
-+      gr_set_kernel_label(current);
-+
-       /* Set the exit signal to SIGCHLD so we signal init on exit */
-       current->exit_signal = SIGCHLD;
-@@ -380,7 +399,7 @@ int allow_signal(int sig)
+@@ -380,7 +388,7 @@ int allow_signal(int sig)
         * know it'll be handled, so that they don't get converted to
         * SIGKILL or just silently dropped.
         */
@@ -62958,7 +65560,7 @@ diff -urNp linux-3.1.3/kernel/exit.c linux-3.1.3/kernel/exit.c
        recalc_sigpending();
        spin_unlock_irq(&current->sighand->siglock);
        return 0;
-@@ -416,6 +435,17 @@ void daemonize(const char *name, ...)
+@@ -416,6 +424,17 @@ void daemonize(const char *name, ...)
        vsnprintf(current->comm, sizeof(current->comm), name, args);
        va_end(args);
  
@@ -62976,7 +65578,7 @@ diff -urNp linux-3.1.3/kernel/exit.c linux-3.1.3/kernel/exit.c
        /*
         * If we were started as result of loading a module, close all of the
         * user space pages.  We don't need them, and if we didn't close them
-@@ -895,6 +925,8 @@ NORET_TYPE void do_exit(long code)
+@@ -895,6 +914,8 @@ NORET_TYPE void do_exit(long code)
        struct task_struct *tsk = current;
        int group_dead;
  
@@ -62985,7 +65587,7 @@ diff -urNp linux-3.1.3/kernel/exit.c linux-3.1.3/kernel/exit.c
        profile_task_exit(tsk);
  
        WARN_ON(blk_needs_flush_plug(tsk));
-@@ -911,7 +943,6 @@ NORET_TYPE void do_exit(long code)
+@@ -911,7 +932,6 @@ NORET_TYPE void do_exit(long code)
         * mm_release()->clear_child_tid() from writing to a user-controlled
         * kernel address.
         */
@@ -62993,7 +65595,7 @@ diff -urNp linux-3.1.3/kernel/exit.c linux-3.1.3/kernel/exit.c
  
        ptrace_event(PTRACE_EVENT_EXIT, code);
  
-@@ -973,6 +1004,9 @@ NORET_TYPE void do_exit(long code)
+@@ -973,6 +993,9 @@ NORET_TYPE void do_exit(long code)
        tsk->exit_code = code;
        taskstats_exit(tsk, group_dead);
  
@@ -63003,10 +65605,11 @@ diff -urNp linux-3.1.3/kernel/exit.c linux-3.1.3/kernel/exit.c
        exit_mm(tsk);
  
        if (group_dead)
-diff -urNp linux-3.1.3/kernel/fork.c linux-3.1.3/kernel/fork.c
---- linux-3.1.3/kernel/fork.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/fork.c  2011-11-16 19:36:31.000000000 -0500
-@@ -285,7 +285,7 @@ static struct task_struct *dup_task_stru
+diff --git a/kernel/fork.c b/kernel/fork.c
+index 8e6b6f4..9dccf00 100644
+--- a/kernel/fork.c
++++ b/kernel/fork.c
+@@ -285,7 +285,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig)
        *stackend = STACK_END_MAGIC;    /* for overflow detection */
  
  #ifdef CONFIG_CC_STACKPROTECTOR
@@ -63095,7 +65698,7 @@ diff -urNp linux-3.1.3/kernel/fork.c linux-3.1.3/kernel/fork.c
  
        down_write(&oldmm->mmap_sem);
        flush_cache_dup_mm(oldmm);
-@@ -327,8 +391,8 @@ static int dup_mmap(struct mm_struct *mm
+@@ -327,8 +391,8 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
        mm->locked_vm = 0;
        mm->mmap = NULL;
        mm->mmap_cache = NULL;
@@ -63106,7 +65709,7 @@ diff -urNp linux-3.1.3/kernel/fork.c linux-3.1.3/kernel/fork.c
        mm->map_count = 0;
        cpumask_clear(mm_cpumask(mm));
        mm->mm_rb = RB_ROOT;
-@@ -344,8 +408,6 @@ static int dup_mmap(struct mm_struct *mm
+@@ -344,8 +408,6 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
  
        prev = NULL;
        for (mpnt = oldmm->mmap; mpnt; mpnt = mpnt->vm_next) {
@@ -63115,7 +65718,7 @@ diff -urNp linux-3.1.3/kernel/fork.c linux-3.1.3/kernel/fork.c
                if (mpnt->vm_flags & VM_DONTCOPY) {
                        long pages = vma_pages(mpnt);
                        mm->total_vm -= pages;
-@@ -353,55 +415,13 @@ static int dup_mmap(struct mm_struct *mm
+@@ -353,53 +415,11 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
                                                                -pages);
                        continue;
                }
@@ -63125,7 +65728,11 @@ diff -urNp linux-3.1.3/kernel/fork.c linux-3.1.3/kernel/fork.c
 -                      if (security_vm_enough_memory(len))
 -                              goto fail_nomem;
 -                      charge = len;
--              }
++              tmp = dup_vma(mm, mpnt);
++              if (!tmp) {
++                      retval = -ENOMEM;
++                      goto out;
+               }
 -              tmp = kmem_cache_alloc(vm_area_cachep, GFP_KERNEL);
 -              if (!tmp)
 -                      goto fail_nomem;
@@ -63157,25 +65764,19 @@ diff -urNp linux-3.1.3/kernel/fork.c linux-3.1.3/kernel/fork.c
 -                      vma_prio_tree_add(tmp, mpnt);
 -                      flush_dcache_mmap_unlock(mapping);
 -                      mutex_unlock(&mapping->i_mmap_mutex);
-+              tmp = dup_vma(mm, mpnt);
-+              if (!tmp) {
-+                      retval = -ENOMEM;
-+                      goto out;
-               }
-               /*
+-              }
+-
+-              /*
 -               * Clear hugetlb-related page reserves for children. This only
 -               * affects MAP_PRIVATE mappings. Faults generated by the child
 -               * are not guaranteed to succeed, even if read-only
 -               */
 -              if (is_vm_hugetlb_page(tmp))
 -                      reset_vma_resv_huge_pages(tmp);
--
--              /*
+               /*
                 * Link in the new vma and copy the page table entries.
-                */
-               *pprev = tmp;
-@@ -422,6 +442,31 @@ static int dup_mmap(struct mm_struct *mm
+@@ -422,6 +442,31 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
                if (retval)
                        goto out;
        }
@@ -63222,7 +65823,7 @@ diff -urNp linux-3.1.3/kernel/fork.c linux-3.1.3/kernel/fork.c
  }
  
  static inline int mm_alloc_pgd(struct mm_struct *mm)
-@@ -837,13 +874,14 @@ static int copy_fs(unsigned long clone_f
+@@ -837,13 +874,14 @@ static int copy_fs(unsigned long clone_flags, struct task_struct *tsk)
                        spin_unlock(&fs->lock);
                        return -EAGAIN;
                }
@@ -63238,7 +65839,7 @@ diff -urNp linux-3.1.3/kernel/fork.c linux-3.1.3/kernel/fork.c
        return 0;
  }
  
-@@ -1105,6 +1143,9 @@ static struct task_struct *copy_process(
+@@ -1105,6 +1143,9 @@ static struct task_struct *copy_process(unsigned long clone_flags,
        DEBUG_LOCKS_WARN_ON(!p->softirqs_enabled);
  #endif
        retval = -EAGAIN;
@@ -63248,7 +65849,7 @@ diff -urNp linux-3.1.3/kernel/fork.c linux-3.1.3/kernel/fork.c
        if (atomic_read(&p->real_cred->user->processes) >=
                        task_rlimit(p, RLIMIT_NPROC)) {
                if (!capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_RESOURCE) &&
-@@ -1264,6 +1305,8 @@ static struct task_struct *copy_process(
+@@ -1264,6 +1305,8 @@ static struct task_struct *copy_process(unsigned long clone_flags,
        if (clone_flags & CLONE_THREAD)
                p->tgid = current->tgid;
  
@@ -63275,7 +65876,7 @@ diff -urNp linux-3.1.3/kernel/fork.c linux-3.1.3/kernel/fork.c
                if (clone_flags & CLONE_VFORK) {
                        p->vfork_done = &vfork;
                        init_completion(&vfork);
-@@ -1637,7 +1684,7 @@ static int unshare_fs(unsigned long unsh
+@@ -1637,7 +1684,7 @@ static int unshare_fs(unsigned long unshare_flags, struct fs_struct **new_fsp)
                return 0;
  
        /* don't need lock here; in the worst case we'll do useless copy */
@@ -63284,7 +65885,7 @@ diff -urNp linux-3.1.3/kernel/fork.c linux-3.1.3/kernel/fork.c
                return 0;
  
        *new_fsp = copy_fs_struct(fs);
-@@ -1726,7 +1773,8 @@ SYSCALL_DEFINE1(unshare, unsigned long, 
+@@ -1726,7 +1773,8 @@ SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags)
                        fs = current->fs;
                        spin_lock(&fs->lock);
                        current->fs = new_fs;
@@ -63294,9 +65895,10 @@ diff -urNp linux-3.1.3/kernel/fork.c linux-3.1.3/kernel/fork.c
                                new_fs = NULL;
                        else
                                new_fs = fs;
-diff -urNp linux-3.1.3/kernel/futex.c linux-3.1.3/kernel/futex.c
---- linux-3.1.3/kernel/futex.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/futex.c 2011-11-16 18:40:44.000000000 -0500
+diff --git a/kernel/futex.c b/kernel/futex.c
+index 11cbe05..9ff191b 100644
+--- a/kernel/futex.c
++++ b/kernel/futex.c
 @@ -54,6 +54,7 @@
  #include <linux/mount.h>
  #include <linux/pagemap.h>
@@ -63305,7 +65907,7 @@ diff -urNp linux-3.1.3/kernel/futex.c linux-3.1.3/kernel/futex.c
  #include <linux/signal.h>
  #include <linux/module.h>
  #include <linux/magic.h>
-@@ -238,6 +239,11 @@ get_futex_key(u32 __user *uaddr, int fsh
+@@ -238,6 +239,11 @@ get_futex_key(u32 __user *uaddr, int fshared, union futex_key *key, int rw)
        struct page *page, *page_head;
        int err, ro = 0;
  
@@ -63317,7 +65919,7 @@ diff -urNp linux-3.1.3/kernel/futex.c linux-3.1.3/kernel/futex.c
        /*
         * The futex address must be "naturally" aligned.
         */
-@@ -1863,6 +1869,8 @@ static int futex_wait(u32 __user *uaddr,
+@@ -1863,6 +1869,8 @@ static int futex_wait(u32 __user *uaddr, unsigned int flags, u32 val,
        struct futex_q q = futex_q_init;
        int ret;
  
@@ -63326,7 +65928,7 @@ diff -urNp linux-3.1.3/kernel/futex.c linux-3.1.3/kernel/futex.c
        if (!bitset)
                return -EINVAL;
        q.bitset = bitset;
-@@ -2259,6 +2267,8 @@ static int futex_wait_requeue_pi(u32 __u
+@@ -2259,6 +2267,8 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags,
        struct futex_q q = futex_q_init;
        int res, ret;
  
@@ -63335,7 +65937,7 @@ diff -urNp linux-3.1.3/kernel/futex.c linux-3.1.3/kernel/futex.c
        if (!bitset)
                return -EINVAL;
  
-@@ -2431,7 +2441,9 @@ SYSCALL_DEFINE3(get_robust_list, int, pi
+@@ -2431,7 +2441,9 @@ SYSCALL_DEFINE3(get_robust_list, int, pid,
  {
        struct robust_list_head __user *head;
        unsigned long ret;
@@ -63345,7 +65947,7 @@ diff -urNp linux-3.1.3/kernel/futex.c linux-3.1.3/kernel/futex.c
  
        if (!futex_cmpxchg_enabled)
                return -ENOSYS;
-@@ -2447,6 +2459,10 @@ SYSCALL_DEFINE3(get_robust_list, int, pi
+@@ -2447,6 +2459,10 @@ SYSCALL_DEFINE3(get_robust_list, int, pid,
                if (!p)
                        goto err_unlock;
                ret = -EPERM;
@@ -63356,7 +65958,7 @@ diff -urNp linux-3.1.3/kernel/futex.c linux-3.1.3/kernel/futex.c
                pcred = __task_cred(p);
                /* If victim is in different user_ns, then uids are not
                   comparable, so we must have CAP_SYS_PTRACE */
-@@ -2461,6 +2477,7 @@ SYSCALL_DEFINE3(get_robust_list, int, pi
+@@ -2461,6 +2477,7 @@ SYSCALL_DEFINE3(get_robust_list, int, pid,
                    !ns_capable(pcred->user->user_ns, CAP_SYS_PTRACE))
                        goto err_unlock;
  ok:
@@ -63384,9 +65986,10 @@ diff -urNp linux-3.1.3/kernel/futex.c linux-3.1.3/kernel/futex.c
  
        for (i = 0; i < ARRAY_SIZE(futex_queues); i++) {
                plist_head_init(&futex_queues[i].chain);
-diff -urNp linux-3.1.3/kernel/futex_compat.c linux-3.1.3/kernel/futex_compat.c
---- linux-3.1.3/kernel/futex_compat.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/futex_compat.c  2011-11-16 18:40:44.000000000 -0500
+diff --git a/kernel/futex_compat.c b/kernel/futex_compat.c
+index 5f9e689..03afa21 100644
+--- a/kernel/futex_compat.c
++++ b/kernel/futex_compat.c
 @@ -10,6 +10,7 @@
  #include <linux/compat.h>
  #include <linux/nsproxy.h>
@@ -63395,7 +65998,7 @@ diff -urNp linux-3.1.3/kernel/futex_compat.c linux-3.1.3/kernel/futex_compat.c
  
  #include <asm/uaccess.h>
  
-@@ -136,7 +137,10 @@ compat_sys_get_robust_list(int pid, comp
+@@ -136,7 +137,10 @@ compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr,
  {
        struct compat_robust_list_head __user *head;
        unsigned long ret;
@@ -63407,7 +66010,7 @@ diff -urNp linux-3.1.3/kernel/futex_compat.c linux-3.1.3/kernel/futex_compat.c
  
        if (!futex_cmpxchg_enabled)
                return -ENOSYS;
-@@ -152,6 +156,10 @@ compat_sys_get_robust_list(int pid, comp
+@@ -152,6 +156,10 @@ compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr,
                if (!p)
                        goto err_unlock;
                ret = -EPERM;
@@ -63418,7 +66021,7 @@ diff -urNp linux-3.1.3/kernel/futex_compat.c linux-3.1.3/kernel/futex_compat.c
                pcred = __task_cred(p);
                /* If victim is in different user_ns, then uids are not
                   comparable, so we must have CAP_SYS_PTRACE */
-@@ -166,6 +174,7 @@ compat_sys_get_robust_list(int pid, comp
+@@ -166,6 +174,7 @@ compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr,
                    !ns_capable(pcred->user->user_ns, CAP_SYS_PTRACE))
                        goto err_unlock;
  ok:
@@ -63426,9 +66029,10 @@ diff -urNp linux-3.1.3/kernel/futex_compat.c linux-3.1.3/kernel/futex_compat.c
                head = p->compat_robust_list;
                rcu_read_unlock();
        }
-diff -urNp linux-3.1.3/kernel/gcov/base.c linux-3.1.3/kernel/gcov/base.c
---- linux-3.1.3/kernel/gcov/base.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/gcov/base.c     2011-11-16 18:39:08.000000000 -0500
+diff --git a/kernel/gcov/base.c b/kernel/gcov/base.c
+index 9b22d03..6295b62 100644
+--- a/kernel/gcov/base.c
++++ b/kernel/gcov/base.c
 @@ -102,11 +102,6 @@ void gcov_enable_events(void)
  }
  
@@ -63441,7 +66045,7 @@ diff -urNp linux-3.1.3/kernel/gcov/base.c linux-3.1.3/kernel/gcov/base.c
  /* Update list and generate events when modules are unloaded. */
  static int gcov_module_notifier(struct notifier_block *nb, unsigned long event,
                                void *data)
-@@ -121,7 +116,7 @@ static int gcov_module_notifier(struct n
+@@ -121,7 +116,7 @@ static int gcov_module_notifier(struct notifier_block *nb, unsigned long event,
        prev = NULL;
        /* Remove entries located in module from linked list. */
        for (info = gcov_info_head; info; info = info->next) {
@@ -63450,10 +66054,11 @@ diff -urNp linux-3.1.3/kernel/gcov/base.c linux-3.1.3/kernel/gcov/base.c
                        if (prev)
                                prev->next = info->next;
                        else
-diff -urNp linux-3.1.3/kernel/hrtimer.c linux-3.1.3/kernel/hrtimer.c
---- linux-3.1.3/kernel/hrtimer.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/hrtimer.c       2011-11-16 18:39:08.000000000 -0500
-@@ -1391,7 +1391,7 @@ void hrtimer_peek_ahead_timers(void)
+diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
+index 2043c08..ec81a69 100644
+--- a/kernel/hrtimer.c
++++ b/kernel/hrtimer.c
+@@ -1393,7 +1393,7 @@ void hrtimer_peek_ahead_timers(void)
        local_irq_restore(flags);
  }
  
@@ -63462,10 +66067,11 @@ diff -urNp linux-3.1.3/kernel/hrtimer.c linux-3.1.3/kernel/hrtimer.c
  {
        hrtimer_peek_ahead_timers();
  }
-diff -urNp linux-3.1.3/kernel/jump_label.c linux-3.1.3/kernel/jump_label.c
---- linux-3.1.3/kernel/jump_label.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/jump_label.c    2011-11-16 18:39:08.000000000 -0500
-@@ -55,7 +55,9 @@ jump_label_sort_entries(struct jump_entr
+diff --git a/kernel/jump_label.c b/kernel/jump_label.c
+index e6f1f24..6c19597 100644
+--- a/kernel/jump_label.c
++++ b/kernel/jump_label.c
+@@ -55,7 +55,9 @@ jump_label_sort_entries(struct jump_entry *start, struct jump_entry *stop)
  
        size = (((unsigned long)stop - (unsigned long)start)
                                        / sizeof(struct jump_entry));
@@ -63475,7 +66081,7 @@ diff -urNp linux-3.1.3/kernel/jump_label.c linux-3.1.3/kernel/jump_label.c
  }
  
  static void jump_label_update(struct jump_label_key *key, int enable);
-@@ -297,10 +299,12 @@ static void jump_label_invalidate_module
+@@ -298,10 +300,12 @@ static void jump_label_invalidate_module_init(struct module *mod)
        struct jump_entry *iter_stop = iter_start + mod->num_jump_entries;
        struct jump_entry *iter;
  
@@ -63488,9 +66094,10 @@ diff -urNp linux-3.1.3/kernel/jump_label.c linux-3.1.3/kernel/jump_label.c
  }
  
  static int
-diff -urNp linux-3.1.3/kernel/kallsyms.c linux-3.1.3/kernel/kallsyms.c
---- linux-3.1.3/kernel/kallsyms.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/kallsyms.c      2011-11-16 18:40:44.000000000 -0500
+diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
+index 079f1d3..a407562 100644
+--- a/kernel/kallsyms.c
++++ b/kernel/kallsyms.c
 @@ -11,6 +11,9 @@
   *      Changed the compression method from stem compression to "table lookup"
   *      compression (see scripts/kallsyms.c for a more complete description)
@@ -63501,7 +66108,7 @@ diff -urNp linux-3.1.3/kernel/kallsyms.c linux-3.1.3/kernel/kallsyms.c
  #include <linux/kallsyms.h>
  #include <linux/module.h>
  #include <linux/init.h>
-@@ -53,12 +56,33 @@ extern const unsigned long kallsyms_mark
+@@ -53,12 +56,33 @@ extern const unsigned long kallsyms_markers[] __attribute__((weak));
  
  static inline int is_kernel_inittext(unsigned long addr)
  {
@@ -63535,7 +66142,7 @@ diff -urNp linux-3.1.3/kernel/kallsyms.c linux-3.1.3/kernel/kallsyms.c
  static inline int is_kernel_text(unsigned long addr)
  {
        if ((addr >= (unsigned long)_stext && addr <= (unsigned long)_etext) ||
-@@ -69,13 +93,28 @@ static inline int is_kernel_text(unsigne
+@@ -69,13 +93,28 @@ static inline int is_kernel_text(unsigned long addr)
  
  static inline int is_kernel(unsigned long addr)
  {
@@ -63564,7 +66171,7 @@ diff -urNp linux-3.1.3/kernel/kallsyms.c linux-3.1.3/kernel/kallsyms.c
        if (all_var)
                return is_kernel(addr);
  
-@@ -454,7 +493,6 @@ static unsigned long get_ksymbol_core(st
+@@ -454,7 +493,6 @@ static unsigned long get_ksymbol_core(struct kallsym_iter *iter)
  
  static void reset_iter(struct kallsym_iter *iter, loff_t new_pos)
  {
@@ -63572,7 +66179,7 @@ diff -urNp linux-3.1.3/kernel/kallsyms.c linux-3.1.3/kernel/kallsyms.c
        iter->nameoff = get_symbol_offset(new_pos);
        iter->pos = new_pos;
  }
-@@ -502,6 +540,11 @@ static int s_show(struct seq_file *m, vo
+@@ -502,6 +540,11 @@ static int s_show(struct seq_file *m, void *p)
  {
        struct kallsym_iter *iter = m->private;
  
@@ -63584,7 +66191,7 @@ diff -urNp linux-3.1.3/kernel/kallsyms.c linux-3.1.3/kernel/kallsyms.c
        /* Some debugging symbols have no name.  Ignore them. */
        if (!iter->name[0])
                return 0;
-@@ -540,7 +583,7 @@ static int kallsyms_open(struct inode *i
+@@ -540,7 +583,7 @@ static int kallsyms_open(struct inode *inode, struct file *file)
        struct kallsym_iter *iter;
        int ret;
  
@@ -63593,10 +66200,11 @@ diff -urNp linux-3.1.3/kernel/kallsyms.c linux-3.1.3/kernel/kallsyms.c
        if (!iter)
                return -ENOMEM;
        reset_iter(iter, 0);
-diff -urNp linux-3.1.3/kernel/kexec.c linux-3.1.3/kernel/kexec.c
---- linux-3.1.3/kernel/kexec.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/kexec.c 2011-11-16 18:39:08.000000000 -0500
-@@ -1033,7 +1033,8 @@ asmlinkage long compat_sys_kexec_load(un
+diff --git a/kernel/kexec.c b/kernel/kexec.c
+index 296fbc8..84cb857 100644
+--- a/kernel/kexec.c
++++ b/kernel/kexec.c
+@@ -1033,7 +1033,8 @@ asmlinkage long compat_sys_kexec_load(unsigned long entry,
                                unsigned long flags)
  {
        struct compat_kexec_segment in;
@@ -63606,10 +66214,11 @@ diff -urNp linux-3.1.3/kernel/kexec.c linux-3.1.3/kernel/kexec.c
        unsigned long i, result;
  
        /* Don't allow clients that don't understand the native
-diff -urNp linux-3.1.3/kernel/kmod.c linux-3.1.3/kernel/kmod.c
---- linux-3.1.3/kernel/kmod.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/kmod.c  2011-11-16 18:40:44.000000000 -0500
-@@ -73,13 +73,12 @@ char modprobe_path[KMOD_PATH_LEN] = "/sb
+diff --git a/kernel/kmod.c b/kernel/kmod.c
+index a4bea97..7a1ae9a 100644
+--- a/kernel/kmod.c
++++ b/kernel/kmod.c
+@@ -73,13 +73,12 @@ char modprobe_path[KMOD_PATH_LEN] = "/sbin/modprobe";
   * If module auto-loading support is disabled then this function
   * becomes a no-operation.
   */
@@ -63625,7 +66234,7 @@ diff -urNp linux-3.1.3/kernel/kmod.c linux-3.1.3/kernel/kmod.c
        static char *envp[] = { "HOME=/",
                                "TERM=linux",
                                "PATH=/sbin:/usr/sbin:/bin:/usr/bin",
-@@ -88,9 +87,7 @@ int __request_module(bool wait, const ch
+@@ -88,9 +87,7 @@ int __request_module(bool wait, const char *fmt, ...)
  #define MAX_KMOD_CONCURRENT 50        /* Completely arbitrary value - KAO */
        static int kmod_loop_msg;
  
@@ -63636,7 +66245,7 @@ diff -urNp linux-3.1.3/kernel/kmod.c linux-3.1.3/kernel/kmod.c
        if (ret >= MODULE_NAME_LEN)
                return -ENAMETOOLONG;
  
-@@ -98,6 +95,20 @@ int __request_module(bool wait, const ch
+@@ -98,6 +95,20 @@ int __request_module(bool wait, const char *fmt, ...)
        if (ret)
                return ret;
  
@@ -63657,7 +66266,7 @@ diff -urNp linux-3.1.3/kernel/kmod.c linux-3.1.3/kernel/kmod.c
        /* If modprobe needs a service that is in a module, we get a recursive
         * loop.  Limit the number of running kmod threads to max_threads/2 or
         * MAX_KMOD_CONCURRENT, whichever is the smaller.  A cleaner method
-@@ -133,6 +144,47 @@ int __request_module(bool wait, const ch
+@@ -133,6 +144,47 @@ int __request_module(bool wait, const char *fmt, ...)
        atomic_dec(&kmod_concurrent);
        return ret;
  }
@@ -63714,10 +66323,11 @@ diff -urNp linux-3.1.3/kernel/kmod.c linux-3.1.3/kernel/kmod.c
  
                /*
                 * If ret is 0, either ____call_usermodehelper failed and the
-diff -urNp linux-3.1.3/kernel/kprobes.c linux-3.1.3/kernel/kprobes.c
---- linux-3.1.3/kernel/kprobes.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/kprobes.c       2011-11-16 18:39:08.000000000 -0500
-@@ -185,7 +185,7 @@ static kprobe_opcode_t __kprobes *__get_
+diff --git a/kernel/kprobes.c b/kernel/kprobes.c
+index b30fd54..11821ec 100644
+--- a/kernel/kprobes.c
++++ b/kernel/kprobes.c
+@@ -185,7 +185,7 @@ static kprobe_opcode_t __kprobes *__get_insn_slot(struct kprobe_insn_cache *c)
         * kernel image and loaded module images reside. This is required
         * so x86_64 can correctly handle the %rip-relative fixups.
         */
@@ -63726,7 +66336,7 @@ diff -urNp linux-3.1.3/kernel/kprobes.c linux-3.1.3/kernel/kprobes.c
        if (!kip->insns) {
                kfree(kip);
                return NULL;
-@@ -225,7 +225,7 @@ static int __kprobes collect_one_slot(st
+@@ -225,7 +225,7 @@ static int __kprobes collect_one_slot(struct kprobe_insn_page *kip, int idx)
                 */
                if (!list_is_singular(&kip->list)) {
                        list_del(&kip->list);
@@ -63744,7 +66354,7 @@ diff -urNp linux-3.1.3/kernel/kprobes.c linux-3.1.3/kernel/kprobes.c
        const char *symbol_name;
        void *addr;
        struct kprobe_blackpoint *kb;
-@@ -2075,7 +2075,7 @@ static int __kprobes show_kprobe_addr(st
+@@ -2075,7 +2075,7 @@ static int __kprobes show_kprobe_addr(struct seq_file *pi, void *v)
        const char *sym = NULL;
        unsigned int i = *(loff_t *) v;
        unsigned long offset = 0;
@@ -63753,9 +66363,10 @@ diff -urNp linux-3.1.3/kernel/kprobes.c linux-3.1.3/kernel/kprobes.c
  
        head = &kprobe_table[i];
        preempt_disable();
-diff -urNp linux-3.1.3/kernel/lockdep.c linux-3.1.3/kernel/lockdep.c
---- linux-3.1.3/kernel/lockdep.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/lockdep.c       2011-11-16 18:39:08.000000000 -0500
+diff --git a/kernel/lockdep.c b/kernel/lockdep.c
+index 91d67ce..ac259df 100644
+--- a/kernel/lockdep.c
++++ b/kernel/lockdep.c
 @@ -583,6 +583,10 @@ static int static_obj(void *obj)
                      end   = (unsigned long) &_end,
                      addr  = (unsigned long) obj;
@@ -63767,7 +66378,7 @@ diff -urNp linux-3.1.3/kernel/lockdep.c linux-3.1.3/kernel/lockdep.c
        /*
         * static variable?
         */
-@@ -718,6 +722,7 @@ register_lock_class(struct lockdep_map *
+@@ -718,6 +722,7 @@ register_lock_class(struct lockdep_map *lock, unsigned int subclass, int force)
        if (!static_obj(lock->key)) {
                debug_locks_off();
                printk("INFO: trying to register non-static key.\n");
@@ -63775,7 +66386,7 @@ diff -urNp linux-3.1.3/kernel/lockdep.c linux-3.1.3/kernel/lockdep.c
                printk("the code is fine but needs lockdep annotation.\n");
                printk("turning off the locking correctness validator.\n");
                dump_stack();
-@@ -2948,7 +2953,7 @@ static int __lock_acquire(struct lockdep
+@@ -2948,7 +2953,7 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass,
                if (!class)
                        return 0;
        }
@@ -63784,10 +66395,11 @@ diff -urNp linux-3.1.3/kernel/lockdep.c linux-3.1.3/kernel/lockdep.c
        if (very_verbose(class)) {
                printk("\nacquire class [%p] %s", class->key, class->name);
                if (class->name_version > 1)
-diff -urNp linux-3.1.3/kernel/lockdep_proc.c linux-3.1.3/kernel/lockdep_proc.c
---- linux-3.1.3/kernel/lockdep_proc.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/lockdep_proc.c  2011-11-16 18:39:08.000000000 -0500
-@@ -39,7 +39,7 @@ static void l_stop(struct seq_file *m, v
+diff --git a/kernel/lockdep_proc.c b/kernel/lockdep_proc.c
+index 71edd2f..e0542a5 100644
+--- a/kernel/lockdep_proc.c
++++ b/kernel/lockdep_proc.c
+@@ -39,7 +39,7 @@ static void l_stop(struct seq_file *m, void *v)
  
  static void print_name(struct seq_file *m, struct lock_class *class)
  {
@@ -63796,9 +66408,10 @@ diff -urNp linux-3.1.3/kernel/lockdep_proc.c linux-3.1.3/kernel/lockdep_proc.c
        const char *name = class->name;
  
        if (!name) {
-diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
---- linux-3.1.3/kernel/module.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/module.c        2011-11-16 18:40:44.000000000 -0500
+diff --git a/kernel/module.c b/kernel/module.c
+index 04379f92..fba2faf 100644
+--- a/kernel/module.c
++++ b/kernel/module.c
 @@ -58,6 +58,7 @@
  #include <linux/jump_label.h>
  #include <linux/pfn.h>
@@ -63807,7 +66420,7 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
  
  #define CREATE_TRACE_POINTS
  #include <trace/events/module.h>
-@@ -119,7 +120,8 @@ static BLOCKING_NOTIFIER_HEAD(module_not
+@@ -119,7 +120,8 @@ static BLOCKING_NOTIFIER_HEAD(module_notify_list);
  
  /* Bounds of module allocation, for speeding __module_address.
   * Protected by module_mutex. */
@@ -63817,7 +66430,7 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
  
  int register_module_notifier(struct notifier_block * nb)
  {
-@@ -284,7 +286,7 @@ bool each_symbol_section(bool (*fn)(cons
+@@ -284,7 +286,7 @@ bool each_symbol_section(bool (*fn)(const struct symsearch *arr,
                return true;
  
        list_for_each_entry_rcu(mod, &modules, list) {
@@ -63826,7 +66439,7 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
                        { mod->syms, mod->syms + mod->num_syms, mod->crcs,
                          NOT_GPL_ONLY, false },
                        { mod->gpl_syms, mod->gpl_syms + mod->num_gpl_syms,
-@@ -306,7 +308,7 @@ bool each_symbol_section(bool (*fn)(cons
+@@ -306,7 +308,7 @@ bool each_symbol_section(bool (*fn)(const struct symsearch *arr,
  #endif
                };
  
@@ -63835,7 +66448,7 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
                        return true;
        }
        return false;
-@@ -438,7 +440,7 @@ static inline void __percpu *mod_percpu(
+@@ -438,7 +440,7 @@ static inline void __percpu *mod_percpu(struct module *mod)
  static int percpu_modalloc(struct module *mod,
                           unsigned long size, unsigned long align)
  {
@@ -63853,7 +66466,7 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
  static inline bool sect_empty(const Elf_Shdr *sect)
  {
        return !(sect->sh_flags & SHF_ALLOC) || sect->sh_size == 0;
-@@ -1649,21 +1651,21 @@ static void set_section_ro_nx(void *base
+@@ -1649,21 +1651,21 @@ static void set_section_ro_nx(void *base,
  
  static void unset_module_core_ro_nx(struct module *mod)
  {
@@ -63925,7 +66538,7 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
                                                set_memory_ro);
                }
        }
-@@ -1748,16 +1750,19 @@ static void free_module(struct module *m
+@@ -1748,16 +1750,19 @@ static void free_module(struct module *mod)
  
        /* This may be NULL, but that's OK */
        unset_module_init_ro_nx(mod);
@@ -63948,7 +66561,7 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
  
  #ifdef CONFIG_MPU
        update_protections(current->mm);
-@@ -1826,10 +1831,31 @@ static int simplify_symbols(struct modul
+@@ -1826,10 +1831,31 @@ static int simplify_symbols(struct module *mod, const struct load_info *info)
        unsigned int i;
        int ret = 0;
        const struct kernel_symbol *ksym;
@@ -63980,7 +66593,7 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
                switch (sym[i].st_shndx) {
                case SHN_COMMON:
                        /* We compiled with -fno-common.  These are not
-@@ -1850,7 +1876,9 @@ static int simplify_symbols(struct modul
+@@ -1850,7 +1876,9 @@ static int simplify_symbols(struct module *mod, const struct load_info *info)
                        ksym = resolve_symbol_wait(mod, info, name);
                        /* Ok if resolved.  */
                        if (ksym && !IS_ERR(ksym)) {
@@ -63990,7 +66603,7 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
                                break;
                        }
  
-@@ -1869,11 +1897,20 @@ static int simplify_symbols(struct modul
+@@ -1869,11 +1897,20 @@ static int simplify_symbols(struct module *mod, const struct load_info *info)
                                secbase = (unsigned long)mod_percpu(mod);
                        else
                                secbase = info->sechdrs[sym[i].st_shndx].sh_addr;
@@ -64011,7 +66624,7 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
        return ret;
  }
  
-@@ -1977,22 +2014,12 @@ static void layout_sections(struct modul
+@@ -1977,22 +2014,12 @@ static void layout_sections(struct module *mod, struct load_info *info)
                            || s->sh_entsize != ~0UL
                            || strstarts(sname, ".init"))
                                continue;
@@ -64038,7 +66651,7 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
        }
  
        DEBUGP("Init section allocation order:\n");
-@@ -2006,23 +2033,13 @@ static void layout_sections(struct modul
+@@ -2006,23 +2033,13 @@ static void layout_sections(struct module *mod, struct load_info *info)
                            || s->sh_entsize != ~0UL
                            || !strstarts(sname, ".init"))
                                continue;
@@ -64067,7 +66680,7 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
        }
  }
  
-@@ -2187,7 +2204,7 @@ static void layout_symtab(struct module 
+@@ -2187,7 +2204,7 @@ static void layout_symtab(struct module *mod, struct load_info *info)
  
        /* Put symbol section at end of init part of module. */
        symsect->sh_flags |= SHF_ALLOC;
@@ -64076,7 +66689,7 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
                                         info->index.sym) | INIT_OFFSET_MASK;
        DEBUGP("\t%s\n", info->secstrings + symsect->sh_name);
  
-@@ -2204,19 +2221,19 @@ static void layout_symtab(struct module 
+@@ -2204,19 +2221,19 @@ static void layout_symtab(struct module *mod, struct load_info *info)
                }
  
        /* Append room for core symbols at end of core part. */
@@ -64101,7 +66714,7 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
  }
  
  static void add_kallsyms(struct module *mod, const struct load_info *info)
-@@ -2232,11 +2249,13 @@ static void add_kallsyms(struct module *
+@@ -2232,11 +2249,13 @@ static void add_kallsyms(struct module *mod, const struct load_info *info)
        /* Make sure we get permanent strtab: don't use info->strtab. */
        mod->strtab = (void *)info->sechdrs[info->index.str].sh_addr;
  
@@ -64116,7 +66729,7 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
        src = mod->symtab;
        *dst = *src;
        for (ndst = i = 1; i < mod->num_symtab; ++i, ++src) {
-@@ -2249,10 +2268,12 @@ static void add_kallsyms(struct module *
+@@ -2249,10 +2268,12 @@ static void add_kallsyms(struct module *mod, const struct load_info *info)
        }
        mod->core_num_syms = ndst;
  
@@ -64130,7 +66743,7 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
  }
  #else
  static inline void layout_symtab(struct module *mod, struct load_info *info)
-@@ -2286,17 +2307,33 @@ void * __weak module_alloc(unsigned long
+@@ -2286,17 +2307,33 @@ void * __weak module_alloc(unsigned long size)
        return size == 0 ? NULL : vmalloc_exec(size);
  }
  
@@ -64169,7 +66782,31 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
                mutex_unlock(&module_mutex);
        }
        return ret;
-@@ -2589,7 +2626,7 @@ static int move_module(struct module *mo
+@@ -2474,8 +2511,14 @@ static struct module *setup_load_info(struct load_info *info)
+ static int check_modinfo(struct module *mod, struct load_info *info)
+ {
+       const char *modmagic = get_modinfo(info, "vermagic");
++      const char *license = get_modinfo(info, "license");
+       int err;
++#ifdef CONFIG_PAX_KERNEXEC_PLUGIN_METHOD_OR
++      if (!license || !license_is_gpl_compatible(license))
++              return -ENOEXEC;
++#endif
++
+       /* This is allowed: modprobe --force will invalidate it. */
+       if (!modmagic) {
+               err = try_to_force_load(mod, "bad vermagic");
+@@ -2495,7 +2538,7 @@ static int check_modinfo(struct module *mod, struct load_info *info)
+       }
+       /* Set up license info based on the info section */
+-      set_license(mod, get_modinfo(info, "license"));
++      set_license(mod, license);
+       return 0;
+ }
+@@ -2589,7 +2632,7 @@ static int move_module(struct module *mod, struct load_info *info)
        void *ptr;
  
        /* Do the allocs. */
@@ -64178,7 +66815,7 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
        /*
         * The pointer to this block is stored in the module structure
         * which is inside the block. Just mark it as not being a
-@@ -2599,23 +2636,50 @@ static int move_module(struct module *mo
+@@ -2599,23 +2642,50 @@ static int move_module(struct module *mod, struct load_info *info)
        if (!ptr)
                return -ENOMEM;
  
@@ -64237,7 +66874,7 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
  
        /* Transfer each section which specifies SHF_ALLOC */
        DEBUGP("final section addresses:\n");
-@@ -2626,16 +2690,45 @@ static int move_module(struct module *mo
+@@ -2626,16 +2696,45 @@ static int move_module(struct module *mod, struct load_info *info)
                if (!(shdr->sh_flags & SHF_ALLOC))
                        continue;
  
@@ -64290,7 +66927,7 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
                DEBUGP("\t0x%lx %s\n",
                       shdr->sh_addr, info->secstrings + shdr->sh_name);
        }
-@@ -2686,12 +2779,12 @@ static void flush_module_icache(const st
+@@ -2686,12 +2785,12 @@ static void flush_module_icache(const struct module *mod)
         * Do it before processing of module parameters, so the module
         * can provide parameter accessor functions of its own.
         */
@@ -64309,7 +66946,7 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
  
        set_fs(old_fs);
  }
-@@ -2771,8 +2864,10 @@ static void module_deallocate(struct mod
+@@ -2771,8 +2870,10 @@ static void module_deallocate(struct module *mod, struct load_info *info)
  {
        kfree(info->strmap);
        percpu_modfree(mod);
@@ -64322,7 +66959,7 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
  }
  
  int __weak module_finalize(const Elf_Ehdr *hdr,
-@@ -2836,9 +2931,38 @@ static struct module *load_module(void _
+@@ -2836,9 +2937,38 @@ static struct module *load_module(void __user *umod,
        if (err)
                goto free_unload;
  
@@ -64361,7 +66998,7 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
        /* Fix up syms, so that st_value is a pointer to location. */
        err = simplify_symbols(mod, &info);
        if (err < 0)
-@@ -2854,13 +2978,6 @@ static struct module *load_module(void _
+@@ -2854,13 +2984,6 @@ static struct module *load_module(void __user *umod,
  
        flush_module_icache(mod);
  
@@ -64375,7 +67012,7 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
        /* Mark state as coming so strong_try_module_get() ignores us. */
        mod->state = MODULE_STATE_COMING;
  
-@@ -2920,11 +3037,10 @@ static struct module *load_module(void _
+@@ -2920,11 +3043,10 @@ static struct module *load_module(void __user *umod,
   unlock:
        mutex_unlock(&module_mutex);
        synchronize_sched();
@@ -64388,7 +67025,7 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
   free_unload:
        module_unload_free(mod);
   free_module:
-@@ -2965,16 +3081,16 @@ SYSCALL_DEFINE3(init_module, void __user
+@@ -2965,16 +3087,16 @@ SYSCALL_DEFINE3(init_module, void __user *, umod,
                        MODULE_STATE_COMING, mod);
  
        /* Set RO and NX regions for core */
@@ -64413,7 +67050,7 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
  
        do_mod_ctors(mod);
        /* Start the module */
-@@ -3020,11 +3136,12 @@ SYSCALL_DEFINE3(init_module, void __user
+@@ -3020,11 +3142,12 @@ SYSCALL_DEFINE3(init_module, void __user *, umod,
        mod->strtab = mod->core_strtab;
  #endif
        unset_module_init_ro_nx(mod);
@@ -64431,7 +67068,7 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
        mutex_unlock(&module_mutex);
  
        return 0;
-@@ -3055,10 +3172,16 @@ static const char *get_ksymbol(struct mo
+@@ -3055,10 +3178,16 @@ static const char *get_ksymbol(struct module *mod,
        unsigned long nextval;
  
        /* At worse, next value is at end of module */
@@ -64451,7 +67088,7 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
  
        /* Scan for closest preceding symbol, and next symbol. (ELF
           starts real symbols at 1). */
-@@ -3304,7 +3427,7 @@ static int m_show(struct seq_file *m, vo
+@@ -3304,7 +3433,7 @@ static int m_show(struct seq_file *m, void *p)
        char buf[8];
  
        seq_printf(m, "%s %u",
@@ -64460,7 +67097,7 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
        print_unload_info(m, mod);
  
        /* Informative for users. */
-@@ -3313,7 +3436,7 @@ static int m_show(struct seq_file *m, vo
+@@ -3313,7 +3442,7 @@ static int m_show(struct seq_file *m, void *p)
                   mod->state == MODULE_STATE_COMING ? "Loading":
                   "Live");
        /* Used by oprofile and other similar tools. */
@@ -64469,7 +67106,7 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
  
        /* Taints info */
        if (mod->taints)
-@@ -3349,7 +3472,17 @@ static const struct file_operations proc
+@@ -3349,7 +3478,17 @@ static const struct file_operations proc_modules_operations = {
  
  static int __init proc_modules_init(void)
  {
@@ -64487,7 +67124,7 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
        return 0;
  }
  module_init(proc_modules_init);
-@@ -3408,12 +3541,12 @@ struct module *__module_address(unsigned
+@@ -3408,12 +3547,12 @@ struct module *__module_address(unsigned long addr)
  {
        struct module *mod;
  
@@ -64503,7 +67140,7 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
                        return mod;
        return NULL;
  }
-@@ -3447,11 +3580,20 @@ bool is_module_text_address(unsigned lon
+@@ -3447,11 +3586,20 @@ bool is_module_text_address(unsigned long addr)
   */
  struct module *__module_text_address(unsigned long addr)
  {
@@ -64527,41 +67164,11 @@ diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
                        mod = NULL;
        }
        return mod;
-diff -urNp linux-3.1.3/kernel/mutex.c linux-3.1.3/kernel/mutex.c
---- linux-3.1.3/kernel/mutex.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/mutex.c 2011-11-16 18:39:08.000000000 -0500
-@@ -198,7 +198,7 @@ __mutex_lock_common(struct mutex *lock, 
-       spin_lock_mutex(&lock->wait_lock, flags);
-       debug_mutex_lock_common(lock, &waiter);
--      debug_mutex_add_waiter(lock, &waiter, task_thread_info(task));
-+      debug_mutex_add_waiter(lock, &waiter, task);
-       /* add waiting tasks to the end of the waitqueue (FIFO): */
-       list_add_tail(&waiter.list, &lock->wait_list);
-@@ -227,8 +227,7 @@ __mutex_lock_common(struct mutex *lock, 
-                * TASK_UNINTERRUPTIBLE case.)
-                */
-               if (unlikely(signal_pending_state(state, task))) {
--                      mutex_remove_waiter(lock, &waiter,
--                                          task_thread_info(task));
-+                      mutex_remove_waiter(lock, &waiter, task);
-                       mutex_release(&lock->dep_map, 1, ip);
-                       spin_unlock_mutex(&lock->wait_lock, flags);
-@@ -249,7 +248,7 @@ __mutex_lock_common(struct mutex *lock, 
- done:
-       lock_acquired(&lock->dep_map, ip);
-       /* got the lock - rejoice! */
--      mutex_remove_waiter(lock, &waiter, current_thread_info());
-+      mutex_remove_waiter(lock, &waiter, task);
-       mutex_set_owner(lock);
-       /* set it to 0 if there are no waiters left: */
-diff -urNp linux-3.1.3/kernel/mutex-debug.c linux-3.1.3/kernel/mutex-debug.c
---- linux-3.1.3/kernel/mutex-debug.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/mutex-debug.c   2011-11-16 18:39:08.000000000 -0500
-@@ -49,21 +49,21 @@ void debug_mutex_free_waiter(struct mute
+diff --git a/kernel/mutex-debug.c b/kernel/mutex-debug.c
+index 73da83a..fe46e99 100644
+--- a/kernel/mutex-debug.c
++++ b/kernel/mutex-debug.c
+@@ -49,21 +49,21 @@ void debug_mutex_free_waiter(struct mutex_waiter *waiter)
  }
  
  void debug_mutex_add_waiter(struct mutex *lock, struct mutex_waiter *waiter,
@@ -64589,10 +67196,11 @@ diff -urNp linux-3.1.3/kernel/mutex-debug.c linux-3.1.3/kernel/mutex-debug.c
  
        list_del_init(&waiter->list);
        waiter->task = NULL;
-diff -urNp linux-3.1.3/kernel/mutex-debug.h linux-3.1.3/kernel/mutex-debug.h
---- linux-3.1.3/kernel/mutex-debug.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/mutex-debug.h   2011-11-16 18:39:08.000000000 -0500
-@@ -20,9 +20,9 @@ extern void debug_mutex_wake_waiter(stru
+diff --git a/kernel/mutex-debug.h b/kernel/mutex-debug.h
+index 0799fd3..d06ae3b 100644
+--- a/kernel/mutex-debug.h
++++ b/kernel/mutex-debug.h
+@@ -20,9 +20,9 @@ extern void debug_mutex_wake_waiter(struct mutex *lock,
  extern void debug_mutex_free_waiter(struct mutex_waiter *waiter);
  extern void debug_mutex_add_waiter(struct mutex *lock,
                                   struct mutex_waiter *waiter,
@@ -64604,10 +67212,43 @@ diff -urNp linux-3.1.3/kernel/mutex-debug.h linux-3.1.3/kernel/mutex-debug.h
  extern void debug_mutex_unlock(struct mutex *lock);
  extern void debug_mutex_init(struct mutex *lock, const char *name,
                             struct lock_class_key *key);
-diff -urNp linux-3.1.3/kernel/padata.c linux-3.1.3/kernel/padata.c
---- linux-3.1.3/kernel/padata.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/padata.c        2011-11-16 18:39:08.000000000 -0500
-@@ -132,10 +132,10 @@ int padata_do_parallel(struct padata_ins
+diff --git a/kernel/mutex.c b/kernel/mutex.c
+index d607ed5..58d0a52 100644
+--- a/kernel/mutex.c
++++ b/kernel/mutex.c
+@@ -198,7 +198,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,
+       spin_lock_mutex(&lock->wait_lock, flags);
+       debug_mutex_lock_common(lock, &waiter);
+-      debug_mutex_add_waiter(lock, &waiter, task_thread_info(task));
++      debug_mutex_add_waiter(lock, &waiter, task);
+       /* add waiting tasks to the end of the waitqueue (FIFO): */
+       list_add_tail(&waiter.list, &lock->wait_list);
+@@ -227,8 +227,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,
+                * TASK_UNINTERRUPTIBLE case.)
+                */
+               if (unlikely(signal_pending_state(state, task))) {
+-                      mutex_remove_waiter(lock, &waiter,
+-                                          task_thread_info(task));
++                      mutex_remove_waiter(lock, &waiter, task);
+                       mutex_release(&lock->dep_map, 1, ip);
+                       spin_unlock_mutex(&lock->wait_lock, flags);
+@@ -249,7 +248,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,
+ done:
+       lock_acquired(&lock->dep_map, ip);
+       /* got the lock - rejoice! */
+-      mutex_remove_waiter(lock, &waiter, current_thread_info());
++      mutex_remove_waiter(lock, &waiter, task);
+       mutex_set_owner(lock);
+       /* set it to 0 if there are no waiters left: */
+diff --git a/kernel/padata.c b/kernel/padata.c
+index b91941d..0871d60 100644
+--- a/kernel/padata.c
++++ b/kernel/padata.c
+@@ -132,10 +132,10 @@ int padata_do_parallel(struct padata_instance *pinst,
        padata->pd = pd;
        padata->cb_cpu = cb_cpu;
  
@@ -64621,7 +67262,7 @@ diff -urNp linux-3.1.3/kernel/padata.c linux-3.1.3/kernel/padata.c
  
        target_cpu = padata_cpu_hash(padata);
        queue = per_cpu_ptr(pd->pqueue, target_cpu);
-@@ -444,7 +444,7 @@ static struct parallel_data *padata_allo
+@@ -444,7 +444,7 @@ static struct parallel_data *padata_alloc_pd(struct padata_instance *pinst,
        padata_init_pqueues(pd);
        padata_init_squeues(pd);
        setup_timer(&pd->timer, padata_reorder_timer, (unsigned long)pd);
@@ -64630,10 +67271,11 @@ diff -urNp linux-3.1.3/kernel/padata.c linux-3.1.3/kernel/padata.c
        atomic_set(&pd->reorder_objects, 0);
        atomic_set(&pd->refcnt, 0);
        pd->pinst = pinst;
-diff -urNp linux-3.1.3/kernel/panic.c linux-3.1.3/kernel/panic.c
---- linux-3.1.3/kernel/panic.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/panic.c 2011-11-16 18:40:44.000000000 -0500
-@@ -371,7 +371,7 @@ static void warn_slowpath_common(const c
+diff --git a/kernel/panic.c b/kernel/panic.c
+index d7bb697..9ef9f19 100644
+--- a/kernel/panic.c
++++ b/kernel/panic.c
+@@ -371,7 +371,7 @@ static void warn_slowpath_common(const char *file, int line, void *caller,
        const char *board;
  
        printk(KERN_WARNING "------------[ cut here ]------------\n");
@@ -64652,9 +67294,10 @@ diff -urNp linux-3.1.3/kernel/panic.c linux-3.1.3/kernel/panic.c
                __builtin_return_address(0));
  }
  EXPORT_SYMBOL(__stack_chk_fail);
-diff -urNp linux-3.1.3/kernel/pid.c linux-3.1.3/kernel/pid.c
---- linux-3.1.3/kernel/pid.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/pid.c   2011-11-16 18:40:44.000000000 -0500
+diff --git a/kernel/pid.c b/kernel/pid.c
+index e432057..a2b2ac5 100644
+--- a/kernel/pid.c
++++ b/kernel/pid.c
 @@ -33,6 +33,7 @@
  #include <linux/rculist.h>
  #include <linux/bootmem.h>
@@ -64663,7 +67306,7 @@ diff -urNp linux-3.1.3/kernel/pid.c linux-3.1.3/kernel/pid.c
  #include <linux/pid_namespace.h>
  #include <linux/init_task.h>
  #include <linux/syscalls.h>
-@@ -45,7 +46,7 @@ struct pid init_struct_pid = INIT_STRUCT
+@@ -45,7 +46,7 @@ struct pid init_struct_pid = INIT_STRUCT_PID;
  
  int pid_max = PID_MAX_DEFAULT;
  
@@ -64689,7 +67332,7 @@ diff -urNp linux-3.1.3/kernel/pid.c linux-3.1.3/kernel/pid.c
  }
  
  struct task_struct *find_task_by_vpid(pid_t vnr)
-@@ -427,6 +435,12 @@ struct task_struct *find_task_by_vpid(pi
+@@ -427,6 +435,12 @@ struct task_struct *find_task_by_vpid(pid_t vnr)
        return find_task_by_pid_ns(vnr, current->nsproxy->pid_ns);
  }
  
@@ -64702,9 +67345,10 @@ diff -urNp linux-3.1.3/kernel/pid.c linux-3.1.3/kernel/pid.c
  struct pid *get_task_pid(struct task_struct *task, enum pid_type type)
  {
        struct pid *pid;
-diff -urNp linux-3.1.3/kernel/posix-cpu-timers.c linux-3.1.3/kernel/posix-cpu-timers.c
---- linux-3.1.3/kernel/posix-cpu-timers.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/posix-cpu-timers.c      2011-11-16 18:40:44.000000000 -0500
+diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c
+index 640ded8..3dafb85 100644
+--- a/kernel/posix-cpu-timers.c
++++ b/kernel/posix-cpu-timers.c
 @@ -6,6 +6,7 @@
  #include <linux/posix-timers.h>
  #include <linux/errno.h>
@@ -64730,9 +67374,10 @@ diff -urNp linux-3.1.3/kernel/posix-cpu-timers.c linux-3.1.3/kernel/posix-cpu-ti
                .clock_getres   = thread_cpu_clock_getres,
                .clock_get      = thread_cpu_clock_get,
                .timer_create   = thread_cpu_timer_create,
-diff -urNp linux-3.1.3/kernel/posix-timers.c linux-3.1.3/kernel/posix-timers.c
---- linux-3.1.3/kernel/posix-timers.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/posix-timers.c  2011-11-16 18:40:44.000000000 -0500
+diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c
+index 4556182..9335419 100644
+--- a/kernel/posix-timers.c
++++ b/kernel/posix-timers.c
 @@ -43,6 +43,7 @@
  #include <linux/idr.h>
  #include <linux/posix-clock.h>
@@ -64750,7 +67395,7 @@ diff -urNp linux-3.1.3/kernel/posix-timers.c linux-3.1.3/kernel/posix-timers.c
  
  /*
   * These ones are defined below.
-@@ -227,7 +228,7 @@ static int posix_get_boottime(const cloc
+@@ -227,7 +228,7 @@ static int posix_get_boottime(const clockid_t which_clock, struct timespec *tp)
   */
  static __init int init_posix_timers(void)
  {
@@ -64759,7 +67404,7 @@ diff -urNp linux-3.1.3/kernel/posix-timers.c linux-3.1.3/kernel/posix-timers.c
                .clock_getres   = hrtimer_get_res,
                .clock_get      = posix_clock_realtime_get,
                .clock_set      = posix_clock_realtime_set,
-@@ -239,7 +240,7 @@ static __init int init_posix_timers(void
+@@ -239,7 +240,7 @@ static __init int init_posix_timers(void)
                .timer_get      = common_timer_get,
                .timer_del      = common_timer_del,
        };
@@ -64768,7 +67413,7 @@ diff -urNp linux-3.1.3/kernel/posix-timers.c linux-3.1.3/kernel/posix-timers.c
                .clock_getres   = hrtimer_get_res,
                .clock_get      = posix_ktime_get_ts,
                .nsleep         = common_nsleep,
-@@ -249,19 +250,19 @@ static __init int init_posix_timers(void
+@@ -249,19 +250,19 @@ static __init int init_posix_timers(void)
                .timer_get      = common_timer_get,
                .timer_del      = common_timer_del,
        };
@@ -64792,7 +67437,7 @@ diff -urNp linux-3.1.3/kernel/posix-timers.c linux-3.1.3/kernel/posix-timers.c
                .clock_getres   = hrtimer_get_res,
                .clock_get      = posix_get_boottime,
                .nsleep         = common_nsleep,
-@@ -272,6 +273,8 @@ static __init int init_posix_timers(void
+@@ -272,6 +273,8 @@ static __init int init_posix_timers(void)
                .timer_del      = common_timer_del,
        };
  
@@ -64801,7 +67446,7 @@ diff -urNp linux-3.1.3/kernel/posix-timers.c linux-3.1.3/kernel/posix-timers.c
        posix_timers_register_clock(CLOCK_REALTIME, &clock_realtime);
        posix_timers_register_clock(CLOCK_MONOTONIC, &clock_monotonic);
        posix_timers_register_clock(CLOCK_MONOTONIC_RAW, &clock_monotonic_raw);
-@@ -473,7 +476,7 @@ void posix_timers_register_clock(const c
+@@ -473,7 +476,7 @@ void posix_timers_register_clock(const clockid_t clock_id,
                return;
        }
  
@@ -64810,7 +67455,7 @@ diff -urNp linux-3.1.3/kernel/posix-timers.c linux-3.1.3/kernel/posix-timers.c
  }
  EXPORT_SYMBOL_GPL(posix_timers_register_clock);
  
-@@ -519,9 +522,9 @@ static struct k_clock *clockid_to_kclock
+@@ -519,9 +522,9 @@ static struct k_clock *clockid_to_kclock(const clockid_t id)
                return (id & CLOCKFD_MASK) == CLOCKFD ?
                        &clock_posix_dynamic : &clock_posix_cpu;
  
@@ -64822,7 +67467,7 @@ diff -urNp linux-3.1.3/kernel/posix-timers.c linux-3.1.3/kernel/posix-timers.c
  }
  
  static int common_timer_create(struct k_itimer *new_timer)
-@@ -959,6 +962,13 @@ SYSCALL_DEFINE2(clock_settime, const clo
+@@ -959,6 +962,13 @@ SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock,
        if (copy_from_user(&new_tp, tp, sizeof (*tp)))
                return -EFAULT;
  
@@ -64836,10 +67481,11 @@ diff -urNp linux-3.1.3/kernel/posix-timers.c linux-3.1.3/kernel/posix-timers.c
        return kc->clock_set(which_clock, &new_tp);
  }
  
-diff -urNp linux-3.1.3/kernel/power/poweroff.c linux-3.1.3/kernel/power/poweroff.c
---- linux-3.1.3/kernel/power/poweroff.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/power/poweroff.c        2011-11-16 18:39:08.000000000 -0500
-@@ -37,7 +37,7 @@ static struct sysrq_key_op   sysrq_powerof
+diff --git a/kernel/power/poweroff.c b/kernel/power/poweroff.c
+index d523593..68197a4 100644
+--- a/kernel/power/poweroff.c
++++ b/kernel/power/poweroff.c
+@@ -37,7 +37,7 @@ static struct sysrq_key_op   sysrq_poweroff_op = {
        .enable_mask    = SYSRQ_ENABLE_BOOT,
  };
  
@@ -64848,10 +67494,11 @@ diff -urNp linux-3.1.3/kernel/power/poweroff.c linux-3.1.3/kernel/power/poweroff
  {
        register_sysrq_key('o', &sysrq_poweroff_op);
        return 0;
-diff -urNp linux-3.1.3/kernel/power/process.c linux-3.1.3/kernel/power/process.c
---- linux-3.1.3/kernel/power/process.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/power/process.c 2011-11-16 18:39:08.000000000 -0500
-@@ -41,6 +41,7 @@ static int try_to_freeze_tasks(bool sig_
+diff --git a/kernel/power/process.c b/kernel/power/process.c
+index 0cf3a27..5481be4 100644
+--- a/kernel/power/process.c
++++ b/kernel/power/process.c
+@@ -41,6 +41,7 @@ static int try_to_freeze_tasks(bool sig_only)
        u64 elapsed_csecs64;
        unsigned int elapsed_csecs;
        bool wakeup = false;
@@ -64859,7 +67506,7 @@ diff -urNp linux-3.1.3/kernel/power/process.c linux-3.1.3/kernel/power/process.c
  
        do_gettimeofday(&start);
  
-@@ -51,6 +52,8 @@ static int try_to_freeze_tasks(bool sig_
+@@ -51,6 +52,8 @@ static int try_to_freeze_tasks(bool sig_only)
  
        while (true) {
                todo = 0;
@@ -64868,7 +67515,7 @@ diff -urNp linux-3.1.3/kernel/power/process.c linux-3.1.3/kernel/power/process.c
                read_lock(&tasklist_lock);
                do_each_thread(g, p) {
                        if (frozen(p) || !freezable(p))
-@@ -71,9 +74,13 @@ static int try_to_freeze_tasks(bool sig_
+@@ -71,9 +74,13 @@ static int try_to_freeze_tasks(bool sig_only)
                         * try_to_stop() after schedule() in ptrace/signal
                         * stop sees TIF_FREEZE.
                         */
@@ -64884,7 +67531,7 @@ diff -urNp linux-3.1.3/kernel/power/process.c linux-3.1.3/kernel/power/process.c
                } while_each_thread(g, p);
                read_unlock(&tasklist_lock);
  
-@@ -82,7 +89,7 @@ static int try_to_freeze_tasks(bool sig_
+@@ -82,7 +89,7 @@ static int try_to_freeze_tasks(bool sig_only)
                        todo += wq_busy;
                }
  
@@ -64893,10 +67540,11 @@ diff -urNp linux-3.1.3/kernel/power/process.c linux-3.1.3/kernel/power/process.c
                        break;
  
                if (pm_wakeup_pending()) {
-diff -urNp linux-3.1.3/kernel/printk.c linux-3.1.3/kernel/printk.c
---- linux-3.1.3/kernel/printk.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/printk.c        2011-11-16 19:38:11.000000000 -0500
-@@ -313,6 +313,11 @@ static int check_syslog_permissions(int 
+diff --git a/kernel/printk.c b/kernel/printk.c
+index 28a40d8..2411bec 100644
+--- a/kernel/printk.c
++++ b/kernel/printk.c
+@@ -313,6 +313,11 @@ static int check_syslog_permissions(int type, bool from_file)
        if (from_file && type != SYSLOG_ACTION_OPEN)
                return 0;
  
@@ -64908,9 +67556,10 @@ diff -urNp linux-3.1.3/kernel/printk.c linux-3.1.3/kernel/printk.c
        if (syslog_action_restricted(type)) {
                if (capable(CAP_SYSLOG))
                        return 0;
-diff -urNp linux-3.1.3/kernel/profile.c linux-3.1.3/kernel/profile.c
---- linux-3.1.3/kernel/profile.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/profile.c       2011-11-16 18:39:08.000000000 -0500
+diff --git a/kernel/profile.c b/kernel/profile.c
+index 961b389..c451353 100644
+--- a/kernel/profile.c
++++ b/kernel/profile.c
 @@ -39,7 +39,7 @@ struct profile_hit {
  /* Oprofile timer tick hook */
  static int (*timer_hook)(struct pt_regs *) __read_mostly;
@@ -64929,7 +67578,7 @@ diff -urNp linux-3.1.3/kernel/profile.c linux-3.1.3/kernel/profile.c
                        hits[i].hits = hits[i].pc = 0;
                }
        }
-@@ -342,9 +342,9 @@ static void do_profile_hits(int type, vo
+@@ -342,9 +342,9 @@ static void do_profile_hits(int type, void *__pc, unsigned int nr_hits)
         * Add the current hit(s) and flush the write-queue out
         * to the global buffer:
         */
@@ -64941,7 +67590,7 @@ diff -urNp linux-3.1.3/kernel/profile.c linux-3.1.3/kernel/profile.c
                hits[i].pc = hits[i].hits = 0;
        }
  out:
-@@ -419,7 +419,7 @@ static void do_profile_hits(int type, vo
+@@ -419,7 +419,7 @@ static void do_profile_hits(int type, void *__pc, unsigned int nr_hits)
  {
        unsigned long pc;
        pc = ((unsigned long)__pc - (unsigned long)_stext) >> prof_shift;
@@ -64950,7 +67599,7 @@ diff -urNp linux-3.1.3/kernel/profile.c linux-3.1.3/kernel/profile.c
  }
  #endif /* !CONFIG_SMP */
  
-@@ -517,7 +517,7 @@ read_profile(struct file *file, char __u
+@@ -517,7 +517,7 @@ read_profile(struct file *file, char __user *buf, size_t count, loff_t *ppos)
                        return -EFAULT;
                buf++; p++; count--; read++;
        }
@@ -64959,7 +67608,7 @@ diff -urNp linux-3.1.3/kernel/profile.c linux-3.1.3/kernel/profile.c
        if (copy_to_user(buf, (void *)pnt, count))
                return -EFAULT;
        read += count;
-@@ -548,7 +548,7 @@ static ssize_t write_profile(struct file
+@@ -548,7 +548,7 @@ static ssize_t write_profile(struct file *file, const char __user *buf,
        }
  #endif
        profile_discard_flip_buffers();
@@ -64968,10 +67617,11 @@ diff -urNp linux-3.1.3/kernel/profile.c linux-3.1.3/kernel/profile.c
        return count;
  }
  
-diff -urNp linux-3.1.3/kernel/ptrace.c linux-3.1.3/kernel/ptrace.c
---- linux-3.1.3/kernel/ptrace.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/ptrace.c        2011-11-16 19:50:22.000000000 -0500
-@@ -161,7 +161,8 @@ int ptrace_check_attach(struct task_stru
+diff --git a/kernel/ptrace.c b/kernel/ptrace.c
+index a70d2a5..cbd4b4f 100644
+--- a/kernel/ptrace.c
++++ b/kernel/ptrace.c
+@@ -161,7 +161,8 @@ int ptrace_check_attach(struct task_struct *child, bool ignore_state)
        return ret;
  }
  
@@ -64981,7 +67631,7 @@ diff -urNp linux-3.1.3/kernel/ptrace.c linux-3.1.3/kernel/ptrace.c
  {
        const struct cred *cred = current_cred(), *tcred;
  
-@@ -187,7 +188,8 @@ int __ptrace_may_access(struct task_stru
+@@ -187,7 +188,8 @@ int __ptrace_may_access(struct task_struct *task, unsigned int mode)
             cred->gid == tcred->sgid &&
             cred->gid == tcred->gid))
                goto ok;
@@ -65002,7 +67652,7 @@ diff -urNp linux-3.1.3/kernel/ptrace.c linux-3.1.3/kernel/ptrace.c
                return -EPERM;
  
        return security_ptrace_access_check(task, mode);
-@@ -206,7 +210,16 @@ bool ptrace_may_access(struct task_struc
+@@ -206,7 +210,16 @@ bool ptrace_may_access(struct task_struct *task, unsigned int mode)
  {
        int err;
        task_lock(task);
@@ -65020,7 +67670,7 @@ diff -urNp linux-3.1.3/kernel/ptrace.c linux-3.1.3/kernel/ptrace.c
        task_unlock(task);
        return !err;
  }
-@@ -251,7 +264,7 @@ static int ptrace_attach(struct task_str
+@@ -251,7 +264,7 @@ static int ptrace_attach(struct task_struct *task, long request,
                goto out;
  
        task_lock(task);
@@ -65029,7 +67679,7 @@ diff -urNp linux-3.1.3/kernel/ptrace.c linux-3.1.3/kernel/ptrace.c
        task_unlock(task);
        if (retval)
                goto unlock_creds;
-@@ -266,7 +279,7 @@ static int ptrace_attach(struct task_str
+@@ -266,7 +279,7 @@ static int ptrace_attach(struct task_struct *task, long request,
        task->ptrace = PT_PTRACED;
        if (seize)
                task->ptrace |= PT_SEIZED;
@@ -65038,7 +67688,7 @@ diff -urNp linux-3.1.3/kernel/ptrace.c linux-3.1.3/kernel/ptrace.c
                task->ptrace |= PT_PTRACE_CAP;
  
        __ptrace_link(task, current);
-@@ -461,6 +474,8 @@ int ptrace_readdata(struct task_struct *
+@@ -461,6 +474,8 @@ int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst
  {
        int copied = 0;
  
@@ -65047,7 +67697,7 @@ diff -urNp linux-3.1.3/kernel/ptrace.c linux-3.1.3/kernel/ptrace.c
        while (len > 0) {
                char buf[128];
                int this_len, retval;
-@@ -472,7 +487,7 @@ int ptrace_readdata(struct task_struct *
+@@ -472,7 +487,7 @@ int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst
                                break;
                        return -EIO;
                }
@@ -65056,7 +67706,7 @@ diff -urNp linux-3.1.3/kernel/ptrace.c linux-3.1.3/kernel/ptrace.c
                        return -EFAULT;
                copied += retval;
                src += retval;
-@@ -486,6 +501,8 @@ int ptrace_writedata(struct task_struct 
+@@ -486,6 +501,8 @@ int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long ds
  {
        int copied = 0;
  
@@ -65065,7 +67715,7 @@ diff -urNp linux-3.1.3/kernel/ptrace.c linux-3.1.3/kernel/ptrace.c
        while (len > 0) {
                char buf[128];
                int this_len, retval;
-@@ -669,10 +686,12 @@ int ptrace_request(struct task_struct *c
+@@ -669,10 +686,12 @@ int ptrace_request(struct task_struct *child, long request,
        bool seized = child->ptrace & PT_SEIZED;
        int ret = -EIO;
        siginfo_t siginfo, *si;
@@ -65079,7 +67729,7 @@ diff -urNp linux-3.1.3/kernel/ptrace.c linux-3.1.3/kernel/ptrace.c
        switch (request) {
        case PTRACE_PEEKTEXT:
        case PTRACE_PEEKDATA:
-@@ -871,14 +890,21 @@ SYSCALL_DEFINE4(ptrace, long, request, l
+@@ -871,14 +890,21 @@ SYSCALL_DEFINE4(ptrace, long, request, long, pid, unsigned long, addr,
                goto out;
        }
  
@@ -65102,7 +67752,7 @@ diff -urNp linux-3.1.3/kernel/ptrace.c linux-3.1.3/kernel/ptrace.c
                goto out_put_task_struct;
        }
  
-@@ -904,7 +930,7 @@ int generic_ptrace_peekdata(struct task_
+@@ -904,7 +930,7 @@ int generic_ptrace_peekdata(struct task_struct *tsk, unsigned long addr,
        copied = access_process_vm(tsk, addr, &tmp, sizeof(tmp), 0);
        if (copied != sizeof(tmp))
                return -EIO;
@@ -65111,7 +67761,7 @@ diff -urNp linux-3.1.3/kernel/ptrace.c linux-3.1.3/kernel/ptrace.c
  }
  
  int generic_ptrace_pokedata(struct task_struct *tsk, unsigned long addr,
-@@ -927,6 +953,8 @@ int compat_ptrace_request(struct task_st
+@@ -927,6 +953,8 @@ int compat_ptrace_request(struct task_struct *child, compat_long_t request,
        siginfo_t siginfo;
        int ret;
  
@@ -65120,7 +67770,7 @@ diff -urNp linux-3.1.3/kernel/ptrace.c linux-3.1.3/kernel/ptrace.c
        switch (request) {
        case PTRACE_PEEKTEXT:
        case PTRACE_PEEKDATA:
-@@ -1014,14 +1042,21 @@ asmlinkage long compat_sys_ptrace(compat
+@@ -1014,14 +1042,21 @@ asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid,
                goto out;
        }
  
@@ -65143,10 +67793,11 @@ diff -urNp linux-3.1.3/kernel/ptrace.c linux-3.1.3/kernel/ptrace.c
                goto out_put_task_struct;
        }
  
-diff -urNp linux-3.1.3/kernel/rcutorture.c linux-3.1.3/kernel/rcutorture.c
---- linux-3.1.3/kernel/rcutorture.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/rcutorture.c    2011-11-16 18:39:08.000000000 -0500
-@@ -138,12 +138,12 @@ static DEFINE_PER_CPU(long [RCU_TORTURE_
+diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c
+index 98f51b1..30b950c 100644
+--- a/kernel/rcutorture.c
++++ b/kernel/rcutorture.c
+@@ -138,12 +138,12 @@ static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1], rcu_torture_count) =
        { 0 };
  static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1], rcu_torture_batch) =
        { 0 };
@@ -65197,7 +67848,7 @@ diff -urNp linux-3.1.3/kernel/rcutorture.c linux-3.1.3/kernel/rcutorture.c
        if (++rp->rtort_pipe_count >= RCU_TORTURE_PIPE_LEN) {
                rp->rtort_mbtest = 0;
                rcu_torture_free(rp);
-@@ -407,7 +407,7 @@ static void rcu_sync_torture_deferred_fr
+@@ -407,7 +407,7 @@ static void rcu_sync_torture_deferred_free(struct rcu_torture *p)
                i = rp->rtort_pipe_count;
                if (i > RCU_TORTURE_PIPE_LEN)
                        i = RCU_TORTURE_PIPE_LEN;
@@ -65215,7 +67866,7 @@ diff -urNp linux-3.1.3/kernel/rcutorture.c linux-3.1.3/kernel/rcutorture.c
                        old_rp->rtort_pipe_count++;
                        cur_ops->deferred_free(old_rp);
                }
-@@ -950,7 +950,7 @@ static void rcu_torture_timer(unsigned l
+@@ -950,7 +950,7 @@ static void rcu_torture_timer(unsigned long unused)
                return;
        }
        if (p->rtort_mbtest == 0)
@@ -65306,9 +67957,10 @@ diff -urNp linux-3.1.3/kernel/rcutorture.c linux-3.1.3/kernel/rcutorture.c
        for_each_possible_cpu(cpu) {
                for (i = 0; i < RCU_TORTURE_PIPE_LEN + 1; i++) {
                        per_cpu(rcu_torture_count, cpu)[i] = 0;
-diff -urNp linux-3.1.3/kernel/rcutree.c linux-3.1.3/kernel/rcutree.c
---- linux-3.1.3/kernel/rcutree.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/rcutree.c       2011-11-16 18:39:08.000000000 -0500
+diff --git a/kernel/rcutree.c b/kernel/rcutree.c
+index ba06207..85d8ba8 100644
+--- a/kernel/rcutree.c
++++ b/kernel/rcutree.c
 @@ -356,9 +356,9 @@ void rcu_enter_nohz(void)
        }
        /* CPUs seeing atomic_inc() must see prior RCU read-side crit sects */
@@ -65373,7 +68025,7 @@ diff -urNp linux-3.1.3/kernel/rcutree.c linux-3.1.3/kernel/rcutree.c
        return 0;
  }
  
-@@ -484,7 +484,7 @@ static int rcu_implicit_dynticks_qs(stru
+@@ -484,7 +484,7 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp)
        unsigned long curr;
        unsigned long snap;
  
@@ -65382,7 +68034,7 @@ diff -urNp linux-3.1.3/kernel/rcutree.c linux-3.1.3/kernel/rcutree.c
        snap = (unsigned long)rdp->dynticks_snap;
  
        /*
-@@ -1470,7 +1470,7 @@ __rcu_process_callbacks(struct rcu_state
+@@ -1470,7 +1470,7 @@ __rcu_process_callbacks(struct rcu_state *rsp, struct rcu_data *rdp)
  /*
   * Do softirq processing for the current CPU.
   */
@@ -65391,9 +68043,10 @@ diff -urNp linux-3.1.3/kernel/rcutree.c linux-3.1.3/kernel/rcutree.c
  {
        __rcu_process_callbacks(&rcu_sched_state,
                                &__get_cpu_var(rcu_sched_data));
-diff -urNp linux-3.1.3/kernel/rcutree.h linux-3.1.3/kernel/rcutree.h
---- linux-3.1.3/kernel/rcutree.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/rcutree.h       2011-11-16 18:39:08.000000000 -0500
+diff --git a/kernel/rcutree.h b/kernel/rcutree.h
+index 01b2ccd..4f5d80a 100644
+--- a/kernel/rcutree.h
++++ b/kernel/rcutree.h
 @@ -86,7 +86,7 @@
  struct rcu_dynticks {
        int dynticks_nesting;   /* Track irq/process nesting level. */
@@ -65403,9 +68056,10 @@ diff -urNp linux-3.1.3/kernel/rcutree.h linux-3.1.3/kernel/rcutree.h
  };
  
  /* RCU's kthread states for tracing. */
-diff -urNp linux-3.1.3/kernel/rcutree_plugin.h linux-3.1.3/kernel/rcutree_plugin.h
---- linux-3.1.3/kernel/rcutree_plugin.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/rcutree_plugin.h        2011-11-16 18:39:08.000000000 -0500
+diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h
+index 8aafbb8..2fca109 100644
+--- a/kernel/rcutree_plugin.h
++++ b/kernel/rcutree_plugin.h
 @@ -822,7 +822,7 @@ void synchronize_rcu_expedited(void)
  
        /* Clean up and exit. */
@@ -65415,7 +68069,7 @@ diff -urNp linux-3.1.3/kernel/rcutree_plugin.h linux-3.1.3/kernel/rcutree_plugin
  unlock_mb_ret:
        mutex_unlock(&sync_rcu_preempt_exp_mutex);
  mb_ret:
-@@ -1774,8 +1774,8 @@ EXPORT_SYMBOL_GPL(synchronize_sched_expe
+@@ -1774,8 +1774,8 @@ EXPORT_SYMBOL_GPL(synchronize_sched_expedited);
  
  #else /* #ifndef CONFIG_SMP */
  
@@ -65468,10 +68122,42 @@ diff -urNp linux-3.1.3/kernel/rcutree_plugin.h linux-3.1.3/kernel/rcutree_plugin
  
        put_online_cpus();
  }
-diff -urNp linux-3.1.3/kernel/relay.c linux-3.1.3/kernel/relay.c
---- linux-3.1.3/kernel/relay.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/relay.c 2011-11-16 18:40:44.000000000 -0500
-@@ -1236,6 +1236,8 @@ static ssize_t subbuf_splice_actor(struc
+@@ -1953,7 +1953,7 @@ int rcu_needs_cpu(int cpu)
+       for_each_online_cpu(thatcpu) {
+               if (thatcpu == cpu)
+                       continue;
+-              snap = atomic_add_return(0, &per_cpu(rcu_dynticks,
++              snap = atomic_add_return_unchecked(0, &per_cpu(rcu_dynticks,
+                                                    thatcpu).dynticks);
+               smp_mb(); /* Order sampling of snap with end of grace period. */
+               if ((snap & 0x1) != 0) {
+diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c
+index 3b0c098..43ba2d8 100644
+--- a/kernel/rcutree_trace.c
++++ b/kernel/rcutree_trace.c
+@@ -74,7 +74,7 @@ static void print_one_rcu_data(struct seq_file *m, struct rcu_data *rdp)
+                  rdp->qs_pending);
+ #ifdef CONFIG_NO_HZ
+       seq_printf(m, " dt=%d/%d/%d df=%lu",
+-                 atomic_read(&rdp->dynticks->dynticks),
++                 atomic_read_unchecked(&rdp->dynticks->dynticks),
+                  rdp->dynticks->dynticks_nesting,
+                  rdp->dynticks->dynticks_nmi_nesting,
+                  rdp->dynticks_fqs);
+@@ -148,7 +148,7 @@ static void print_one_rcu_data_csv(struct seq_file *m, struct rcu_data *rdp)
+                  rdp->qs_pending);
+ #ifdef CONFIG_NO_HZ
+       seq_printf(m, ",%d,%d,%d,%lu",
+-                 atomic_read(&rdp->dynticks->dynticks),
++                 atomic_read_unchecked(&rdp->dynticks->dynticks),
+                  rdp->dynticks->dynticks_nesting,
+                  rdp->dynticks->dynticks_nmi_nesting,
+                  rdp->dynticks_fqs);
+diff --git a/kernel/relay.c b/kernel/relay.c
+index 859ea5a..096e2fe 100644
+--- a/kernel/relay.c
++++ b/kernel/relay.c
+@@ -1236,6 +1236,8 @@ static ssize_t subbuf_splice_actor(struct file *in,
        };
        ssize_t ret;
  
@@ -65480,10 +68166,11 @@ diff -urNp linux-3.1.3/kernel/relay.c linux-3.1.3/kernel/relay.c
        if (rbuf->subbufs_produced == rbuf->subbufs_consumed)
                return 0;
        if (splice_grow_spd(pipe, &spd))
-diff -urNp linux-3.1.3/kernel/resource.c linux-3.1.3/kernel/resource.c
---- linux-3.1.3/kernel/resource.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/resource.c      2011-11-16 18:40:44.000000000 -0500
-@@ -141,8 +141,18 @@ static const struct file_operations proc
+diff --git a/kernel/resource.c b/kernel/resource.c
+index c8dc249..f1e2359 100644
+--- a/kernel/resource.c
++++ b/kernel/resource.c
+@@ -141,8 +141,18 @@ static const struct file_operations proc_iomem_operations = {
  
  static int __init ioresources_init(void)
  {
@@ -65502,9 +68189,10 @@ diff -urNp linux-3.1.3/kernel/resource.c linux-3.1.3/kernel/resource.c
        return 0;
  }
  __initcall(ioresources_init);
-diff -urNp linux-3.1.3/kernel/rtmutex-tester.c linux-3.1.3/kernel/rtmutex-tester.c
---- linux-3.1.3/kernel/rtmutex-tester.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/rtmutex-tester.c        2011-11-16 18:39:08.000000000 -0500
+diff --git a/kernel/rtmutex-tester.c b/kernel/rtmutex-tester.c
+index 5c9ccd3..a35e22b 100644
+--- a/kernel/rtmutex-tester.c
++++ b/kernel/rtmutex-tester.c
 @@ -20,7 +20,7 @@
  #define MAX_RT_TEST_MUTEXES   8
  
@@ -65514,7 +68202,7 @@ diff -urNp linux-3.1.3/kernel/rtmutex-tester.c linux-3.1.3/kernel/rtmutex-tester
  
  struct test_thread_data {
        int                     opcode;
-@@ -61,7 +61,7 @@ static int handle_op(struct test_thread_
+@@ -61,7 +61,7 @@ static int handle_op(struct test_thread_data *td, int lockwakeup)
  
        case RTTEST_LOCKCONT:
                td->mutexes[td->opdata] = 1;
@@ -65523,7 +68211,7 @@ diff -urNp linux-3.1.3/kernel/rtmutex-tester.c linux-3.1.3/kernel/rtmutex-tester
                return 0;
  
        case RTTEST_RESET:
-@@ -74,7 +74,7 @@ static int handle_op(struct test_thread_
+@@ -74,7 +74,7 @@ static int handle_op(struct test_thread_data *td, int lockwakeup)
                return 0;
  
        case RTTEST_RESETEVENT:
@@ -65532,7 +68220,7 @@ diff -urNp linux-3.1.3/kernel/rtmutex-tester.c linux-3.1.3/kernel/rtmutex-tester
                return 0;
  
        default:
-@@ -91,9 +91,9 @@ static int handle_op(struct test_thread_
+@@ -91,9 +91,9 @@ static int handle_op(struct test_thread_data *td, int lockwakeup)
                        return ret;
  
                td->mutexes[id] = 1;
@@ -65544,7 +68232,7 @@ diff -urNp linux-3.1.3/kernel/rtmutex-tester.c linux-3.1.3/kernel/rtmutex-tester
                td->mutexes[id] = 4;
                return 0;
  
-@@ -104,9 +104,9 @@ static int handle_op(struct test_thread_
+@@ -104,9 +104,9 @@ static int handle_op(struct test_thread_data *td, int lockwakeup)
                        return ret;
  
                td->mutexes[id] = 1;
@@ -65556,7 +68244,7 @@ diff -urNp linux-3.1.3/kernel/rtmutex-tester.c linux-3.1.3/kernel/rtmutex-tester
                td->mutexes[id] = ret ? 0 : 4;
                return ret ? -EINTR : 0;
  
-@@ -115,9 +115,9 @@ static int handle_op(struct test_thread_
+@@ -115,9 +115,9 @@ static int handle_op(struct test_thread_data *td, int lockwakeup)
                if (id < 0 || id >= MAX_RT_TEST_MUTEXES || td->mutexes[id] != 4)
                        return ret;
  
@@ -65568,7 +68256,7 @@ diff -urNp linux-3.1.3/kernel/rtmutex-tester.c linux-3.1.3/kernel/rtmutex-tester
                td->mutexes[id] = 0;
                return 0;
  
-@@ -164,7 +164,7 @@ void schedule_rt_mutex_test(struct rt_mu
+@@ -164,7 +164,7 @@ void schedule_rt_mutex_test(struct rt_mutex *mutex)
                        break;
  
                td->mutexes[dat] = 2;
@@ -65577,7 +68265,7 @@ diff -urNp linux-3.1.3/kernel/rtmutex-tester.c linux-3.1.3/kernel/rtmutex-tester
                break;
  
        default:
-@@ -184,7 +184,7 @@ void schedule_rt_mutex_test(struct rt_mu
+@@ -184,7 +184,7 @@ void schedule_rt_mutex_test(struct rt_mutex *mutex)
                        return;
  
                td->mutexes[dat] = 3;
@@ -65586,7 +68274,7 @@ diff -urNp linux-3.1.3/kernel/rtmutex-tester.c linux-3.1.3/kernel/rtmutex-tester
                break;
  
        case RTTEST_LOCKNOWAIT:
-@@ -196,7 +196,7 @@ void schedule_rt_mutex_test(struct rt_mu
+@@ -196,7 +196,7 @@ void schedule_rt_mutex_test(struct rt_mutex *mutex)
                        return;
  
                td->mutexes[dat] = 1;
@@ -65595,30 +68283,10 @@ diff -urNp linux-3.1.3/kernel/rtmutex-tester.c linux-3.1.3/kernel/rtmutex-tester
                return;
  
        default:
-diff -urNp linux-3.1.3/kernel/sched_autogroup.c linux-3.1.3/kernel/sched_autogroup.c
---- linux-3.1.3/kernel/sched_autogroup.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/sched_autogroup.c       2011-11-16 18:39:08.000000000 -0500
-@@ -7,7 +7,7 @@
- unsigned int __read_mostly sysctl_sched_autogroup_enabled = 1;
- static struct autogroup autogroup_default;
--static atomic_t autogroup_seq_nr;
-+static atomic_unchecked_t autogroup_seq_nr;
- static void __init autogroup_init(struct task_struct *init_task)
- {
-@@ -78,7 +78,7 @@ static inline struct autogroup *autogrou
-       kref_init(&ag->kref);
-       init_rwsem(&ag->lock);
--      ag->id = atomic_inc_return(&autogroup_seq_nr);
-+      ag->id = atomic_inc_return_unchecked(&autogroup_seq_nr);
-       ag->tg = tg;
- #ifdef CONFIG_RT_GROUP_SCHED
-       /*
-diff -urNp linux-3.1.3/kernel/sched.c linux-3.1.3/kernel/sched.c
---- linux-3.1.3/kernel/sched.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/sched.c 2011-11-16 18:40:44.000000000 -0500
+diff --git a/kernel/sched.c b/kernel/sched.c
+index b50b0f0..1c6c591 100644
+--- a/kernel/sched.c
++++ b/kernel/sched.c
 @@ -4264,6 +4264,8 @@ static void __sched __schedule(void)
        struct rq *rq;
        int cpu;
@@ -65628,7 +68296,7 @@ diff -urNp linux-3.1.3/kernel/sched.c linux-3.1.3/kernel/sched.c
  need_resched:
        preempt_disable();
        cpu = smp_processor_id();
-@@ -4950,6 +4952,8 @@ int can_nice(const struct task_struct *p
+@@ -4950,6 +4952,8 @@ int can_nice(const struct task_struct *p, const int nice)
        /* convert nice value [19,-20] to rlimit style value [1,40] */
        int nice_rlim = 20 - nice;
  
@@ -65655,10 +68323,33 @@ diff -urNp linux-3.1.3/kernel/sched.c linux-3.1.3/kernel/sched.c
                        /* can't set/change the rt policy */
                        if (policy != p->policy && !rlim_rtprio)
                                return -EPERM;
-diff -urNp linux-3.1.3/kernel/sched_fair.c linux-3.1.3/kernel/sched_fair.c
---- linux-3.1.3/kernel/sched_fair.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/sched_fair.c    2011-11-16 18:39:08.000000000 -0500
-@@ -4062,7 +4062,7 @@ static void nohz_idle_balance(int this_c
+diff --git a/kernel/sched_autogroup.c b/kernel/sched_autogroup.c
+index 429242f..d7cca82 100644
+--- a/kernel/sched_autogroup.c
++++ b/kernel/sched_autogroup.c
+@@ -7,7 +7,7 @@
+ unsigned int __read_mostly sysctl_sched_autogroup_enabled = 1;
+ static struct autogroup autogroup_default;
+-static atomic_t autogroup_seq_nr;
++static atomic_unchecked_t autogroup_seq_nr;
+ static void __init autogroup_init(struct task_struct *init_task)
+ {
+@@ -78,7 +78,7 @@ static inline struct autogroup *autogroup_create(void)
+       kref_init(&ag->kref);
+       init_rwsem(&ag->lock);
+-      ag->id = atomic_inc_return(&autogroup_seq_nr);
++      ag->id = atomic_inc_return_unchecked(&autogroup_seq_nr);
+       ag->tg = tg;
+ #ifdef CONFIG_RT_GROUP_SCHED
+       /*
+diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
+index bc8ee99..b6f6492 100644
+--- a/kernel/sched_fair.c
++++ b/kernel/sched_fair.c
+@@ -4062,7 +4062,7 @@ static void nohz_idle_balance(int this_cpu, enum cpu_idle_type idle) { }
   * run_rebalance_domains is triggered when needed from the scheduler tick.
   * Also triggered for nohz idle balancing (with nohz_balancing_kick set).
   */
@@ -65667,10 +68358,11 @@ diff -urNp linux-3.1.3/kernel/sched_fair.c linux-3.1.3/kernel/sched_fair.c
  {
        int this_cpu = smp_processor_id();
        struct rq *this_rq = cpu_rq(this_cpu);
-diff -urNp linux-3.1.3/kernel/signal.c linux-3.1.3/kernel/signal.c
---- linux-3.1.3/kernel/signal.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/signal.c        2011-11-16 19:30:04.000000000 -0500
-@@ -45,12 +45,12 @@ static struct kmem_cache *sigqueue_cache
+diff --git a/kernel/signal.c b/kernel/signal.c
+index 291c970..304bd03 100644
+--- a/kernel/signal.c
++++ b/kernel/signal.c
+@@ -45,12 +45,12 @@ static struct kmem_cache *sigqueue_cachep;
  
  int print_fatal_signals __read_mostly;
  
@@ -65685,7 +68377,7 @@ diff -urNp linux-3.1.3/kernel/signal.c linux-3.1.3/kernel/signal.c
  {
        /* Is it explicitly or implicitly ignored? */
        return handler == SIG_IGN ||
-@@ -60,7 +60,7 @@ static int sig_handler_ignored(void __us
+@@ -60,7 +60,7 @@ static int sig_handler_ignored(void __user *handler, int sig)
  static int sig_task_ignored(struct task_struct *t, int sig,
                int from_ancestor_ns)
  {
@@ -65694,7 +68386,7 @@ diff -urNp linux-3.1.3/kernel/signal.c linux-3.1.3/kernel/signal.c
  
        handler = sig_handler(t, sig);
  
-@@ -364,6 +364,9 @@ __sigqueue_alloc(int sig, struct task_st
+@@ -364,6 +364,9 @@ __sigqueue_alloc(int sig, struct task_struct *t, gfp_t flags, int override_rlimi
        atomic_inc(&user->sigpending);
        rcu_read_unlock();
  
@@ -65704,7 +68396,7 @@ diff -urNp linux-3.1.3/kernel/signal.c linux-3.1.3/kernel/signal.c
        if (override_rlimit ||
            atomic_read(&user->sigpending) <=
                        task_rlimit(t, RLIMIT_SIGPENDING)) {
-@@ -488,7 +491,7 @@ flush_signal_handlers(struct task_struct
+@@ -488,7 +491,7 @@ flush_signal_handlers(struct task_struct *t, int force_default)
  
  int unhandled_signal(struct task_struct *tsk, int sig)
  {
@@ -65713,7 +68405,7 @@ diff -urNp linux-3.1.3/kernel/signal.c linux-3.1.3/kernel/signal.c
        if (is_global_init(tsk))
                return 1;
        if (handler != SIG_IGN && handler != SIG_DFL)
-@@ -815,6 +818,13 @@ static int check_kill_permission(int sig
+@@ -815,6 +818,13 @@ static int check_kill_permission(int sig, struct siginfo *info,
                }
        }
  
@@ -65727,7 +68419,7 @@ diff -urNp linux-3.1.3/kernel/signal.c linux-3.1.3/kernel/signal.c
        return security_task_kill(t, info, sig, 0);
  }
  
-@@ -1165,7 +1175,7 @@ __group_send_sig_info(int sig, struct si
+@@ -1165,7 +1175,7 @@ __group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p)
        return send_signal(sig, info, p, 1);
  }
  
@@ -65736,7 +68428,7 @@ diff -urNp linux-3.1.3/kernel/signal.c linux-3.1.3/kernel/signal.c
  specific_send_sig_info(int sig, struct siginfo *info, struct task_struct *t)
  {
        return send_signal(sig, info, t, 0);
-@@ -1202,6 +1212,7 @@ force_sig_info(int sig, struct siginfo *
+@@ -1202,6 +1212,7 @@ force_sig_info(int sig, struct siginfo *info, struct task_struct *t)
        unsigned long int flags;
        int ret, blocked, ignored;
        struct k_sigaction *action;
@@ -65744,7 +68436,7 @@ diff -urNp linux-3.1.3/kernel/signal.c linux-3.1.3/kernel/signal.c
  
        spin_lock_irqsave(&t->sighand->siglock, flags);
        action = &t->sighand->action[sig-1];
-@@ -1216,9 +1227,18 @@ force_sig_info(int sig, struct siginfo *
+@@ -1216,9 +1227,18 @@ force_sig_info(int sig, struct siginfo *info, struct task_struct *t)
        }
        if (action->sa.sa_handler == SIG_DFL)
                t->signal->flags &= ~SIGNAL_UNKILLABLE;
@@ -65763,7 +68455,7 @@ diff -urNp linux-3.1.3/kernel/signal.c linux-3.1.3/kernel/signal.c
        return ret;
  }
  
-@@ -1285,8 +1305,11 @@ int group_send_sig_info(int sig, struct 
+@@ -1285,8 +1305,11 @@ int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p)
        ret = check_kill_permission(sig, info, p);
        rcu_read_unlock();
  
@@ -65776,7 +68468,7 @@ diff -urNp linux-3.1.3/kernel/signal.c linux-3.1.3/kernel/signal.c
  
        return ret;
  }
-@@ -1909,6 +1932,8 @@ static void ptrace_do_notify(int signr, 
+@@ -1909,6 +1932,8 @@ static void ptrace_do_notify(int signr, int exit_code, int why)
  {
        siginfo_t info;
  
@@ -65785,7 +68477,7 @@ diff -urNp linux-3.1.3/kernel/signal.c linux-3.1.3/kernel/signal.c
        memset(&info, 0, sizeof info);
        info.si_signo = signr;
        info.si_code = exit_code;
-@@ -2748,7 +2773,15 @@ do_send_specific(pid_t tgid, pid_t pid, 
+@@ -2748,7 +2773,15 @@ do_send_specific(pid_t tgid, pid_t pid, int sig, struct siginfo *info)
        int error = -ESRCH;
  
        rcu_read_lock();
@@ -65802,10 +68494,11 @@ diff -urNp linux-3.1.3/kernel/signal.c linux-3.1.3/kernel/signal.c
        if (p && (tgid <= 0 || task_tgid_vnr(p) == tgid)) {
                error = check_kill_permission(sig, info, p);
                /*
-diff -urNp linux-3.1.3/kernel/smp.c linux-3.1.3/kernel/smp.c
---- linux-3.1.3/kernel/smp.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/smp.c   2011-11-16 18:39:08.000000000 -0500
-@@ -580,22 +580,22 @@ int smp_call_function(smp_call_func_t fu
+diff --git a/kernel/smp.c b/kernel/smp.c
+index fb67dfa..f819e2e 100644
+--- a/kernel/smp.c
++++ b/kernel/smp.c
+@@ -580,22 +580,22 @@ int smp_call_function(smp_call_func_t func, void *info, int wait)
  }
  EXPORT_SYMBOL(smp_call_function);
  
@@ -65832,10 +68525,11 @@ diff -urNp linux-3.1.3/kernel/smp.c linux-3.1.3/kernel/smp.c
  {
        raw_spin_unlock_irq(&call_function.lock);
  }
-diff -urNp linux-3.1.3/kernel/softirq.c linux-3.1.3/kernel/softirq.c
---- linux-3.1.3/kernel/softirq.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/softirq.c       2011-11-16 18:39:08.000000000 -0500
-@@ -56,7 +56,7 @@ static struct softirq_action softirq_vec
+diff --git a/kernel/softirq.c b/kernel/softirq.c
+index fca82c3..1db9690 100644
+--- a/kernel/softirq.c
++++ b/kernel/softirq.c
+@@ -56,7 +56,7 @@ static struct softirq_action softirq_vec[NR_SOFTIRQS] __cacheline_aligned_in_smp
  
  DEFINE_PER_CPU(struct task_struct *, ksoftirqd);
  
@@ -65867,7 +68561,7 @@ diff -urNp linux-3.1.3/kernel/softirq.c linux-3.1.3/kernel/softirq.c
  }
  
  /*
-@@ -441,7 +443,7 @@ void __tasklet_hi_schedule_first(struct 
+@@ -441,7 +443,7 @@ void __tasklet_hi_schedule_first(struct tasklet_struct *t)
  
  EXPORT_SYMBOL(__tasklet_hi_schedule_first);
  
@@ -65876,7 +68570,7 @@ diff -urNp linux-3.1.3/kernel/softirq.c linux-3.1.3/kernel/softirq.c
  {
        struct tasklet_struct *list;
  
-@@ -476,7 +478,7 @@ static void tasklet_action(struct softir
+@@ -476,7 +478,7 @@ static void tasklet_action(struct softirq_action *a)
        }
  }
  
@@ -65885,10 +68579,11 @@ diff -urNp linux-3.1.3/kernel/softirq.c linux-3.1.3/kernel/softirq.c
  {
        struct tasklet_struct *list;
  
-diff -urNp linux-3.1.3/kernel/sys.c linux-3.1.3/kernel/sys.c
---- linux-3.1.3/kernel/sys.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/sys.c   2011-11-16 18:40:44.000000000 -0500
-@@ -157,6 +157,12 @@ static int set_one_prio(struct task_stru
+diff --git a/kernel/sys.c b/kernel/sys.c
+index 1dbbe69..e96e1dd 100644
+--- a/kernel/sys.c
++++ b/kernel/sys.c
+@@ -157,6 +157,12 @@ static int set_one_prio(struct task_struct *p, int niceval, int error)
                error = -EACCES;
                goto out;
        }
@@ -65901,7 +68596,7 @@ diff -urNp linux-3.1.3/kernel/sys.c linux-3.1.3/kernel/sys.c
        no_nice = security_task_setnice(p, niceval);
        if (no_nice) {
                error = no_nice;
-@@ -571,6 +577,9 @@ SYSCALL_DEFINE2(setregid, gid_t, rgid, g
+@@ -571,6 +577,9 @@ SYSCALL_DEFINE2(setregid, gid_t, rgid, gid_t, egid)
                        goto error;
        }
  
@@ -65922,7 +68617,7 @@ diff -urNp linux-3.1.3/kernel/sys.c linux-3.1.3/kernel/sys.c
        if (nsown_capable(CAP_SETGID))
                new->gid = new->egid = new->sgid = new->fsgid = gid;
        else if (gid == old->gid || gid == old->sgid)
-@@ -687,6 +700,9 @@ SYSCALL_DEFINE2(setreuid, uid_t, ruid, u
+@@ -687,6 +700,9 @@ SYSCALL_DEFINE2(setreuid, uid_t, ruid, uid_t, euid)
                        goto error;
        }
  
@@ -65945,7 +68640,7 @@ diff -urNp linux-3.1.3/kernel/sys.c linux-3.1.3/kernel/sys.c
        if (nsown_capable(CAP_SETUID)) {
                new->suid = new->uid = uid;
                if (uid != old->uid) {
-@@ -785,6 +807,9 @@ SYSCALL_DEFINE3(setresuid, uid_t, ruid, 
+@@ -785,6 +807,9 @@ SYSCALL_DEFINE3(setresuid, uid_t, ruid, uid_t, euid, uid_t, suid)
                        goto error;
        }
  
@@ -65955,7 +68650,7 @@ diff -urNp linux-3.1.3/kernel/sys.c linux-3.1.3/kernel/sys.c
        if (ruid != (uid_t) -1) {
                new->uid = ruid;
                if (ruid != old->uid) {
-@@ -849,6 +874,9 @@ SYSCALL_DEFINE3(setresgid, gid_t, rgid, 
+@@ -849,6 +874,9 @@ SYSCALL_DEFINE3(setresgid, gid_t, rgid, gid_t, egid, gid_t, sgid)
                        goto error;
        }
  
@@ -66000,7 +68695,19 @@ diff -urNp linux-3.1.3/kernel/sys.c linux-3.1.3/kernel/sys.c
        abort_creds(new);
        return old_fsgid;
  
-@@ -1242,19 +1278,19 @@ SYSCALL_DEFINE1(olduname, struct oldold_
+@@ -1188,7 +1224,10 @@ static int override_release(char __user *release, int len)
+               }
+               v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 40;
+               snprintf(buf, len, "2.6.%u%s", v, rest);
+-              ret = copy_to_user(release, buf, len);
++              if (len > sizeof(buf))
++                      ret = -EFAULT;
++              else
++                      ret = copy_to_user(release, buf, len);
+       }
+       return ret;
+ }
+@@ -1242,19 +1281,19 @@ SYSCALL_DEFINE1(olduname, struct oldold_utsname __user *, name)
                return -EFAULT;
  
        down_read(&uts_sem);
@@ -66025,7 +68732,7 @@ diff -urNp linux-3.1.3/kernel/sys.c linux-3.1.3/kernel/sys.c
                                __OLD_UTS_LEN);
        error |= __put_user(0, name->machine + __OLD_UTS_LEN);
        up_read(&uts_sem);
-@@ -1717,7 +1753,7 @@ SYSCALL_DEFINE5(prctl, int, option, unsi
+@@ -1717,7 +1756,7 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
                        error = get_dumpable(me->mm);
                        break;
                case PR_SET_DUMPABLE:
@@ -66034,75 +68741,10 @@ diff -urNp linux-3.1.3/kernel/sys.c linux-3.1.3/kernel/sys.c
                                error = -EINVAL;
                                break;
                        }
-diff -urNp linux-3.1.3/kernel/sysctl_binary.c linux-3.1.3/kernel/sysctl_binary.c
---- linux-3.1.3/kernel/sysctl_binary.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/sysctl_binary.c 2011-11-16 18:39:08.000000000 -0500
-@@ -989,7 +989,7 @@ static ssize_t bin_intvec(struct file *f
-               int i;
-               set_fs(KERNEL_DS);
--              result = vfs_read(file, buffer, BUFSZ - 1, &pos);
-+              result = vfs_read(file, (char __force_user *)buffer, BUFSZ - 1, &pos);
-               set_fs(old_fs);
-               if (result < 0)
-                       goto out_kfree;
-@@ -1034,7 +1034,7 @@ static ssize_t bin_intvec(struct file *f
-               }
-               set_fs(KERNEL_DS);
--              result = vfs_write(file, buffer, str - buffer, &pos);
-+              result = vfs_write(file, (const char __force_user *)buffer, str - buffer, &pos);
-               set_fs(old_fs);
-               if (result < 0)
-                       goto out_kfree;
-@@ -1067,7 +1067,7 @@ static ssize_t bin_ulongvec(struct file 
-               int i;
-               set_fs(KERNEL_DS);
--              result = vfs_read(file, buffer, BUFSZ - 1, &pos);
-+              result = vfs_read(file, (char __force_user *)buffer, BUFSZ - 1, &pos);
-               set_fs(old_fs);
-               if (result < 0)
-                       goto out_kfree;
-@@ -1112,7 +1112,7 @@ static ssize_t bin_ulongvec(struct file 
-               }
-               set_fs(KERNEL_DS);
--              result = vfs_write(file, buffer, str - buffer, &pos);
-+              result = vfs_write(file, (const char __force_user *)buffer, str - buffer, &pos);
-               set_fs(old_fs);
-               if (result < 0)
-                       goto out_kfree;
-@@ -1138,7 +1138,7 @@ static ssize_t bin_uuid(struct file *fil
-               int i;
-               set_fs(KERNEL_DS);
--              result = vfs_read(file, buf, sizeof(buf) - 1, &pos);
-+              result = vfs_read(file, (char __force_user *)buf, sizeof(buf) - 1, &pos);
-               set_fs(old_fs);
-               if (result < 0)
-                       goto out;
-@@ -1185,7 +1185,7 @@ static ssize_t bin_dn_node_address(struc
-               __le16 dnaddr;
-               set_fs(KERNEL_DS);
--              result = vfs_read(file, buf, sizeof(buf) - 1, &pos);
-+              result = vfs_read(file, (char __force_user *)buf, sizeof(buf) - 1, &pos);
-               set_fs(old_fs);
-               if (result < 0)
-                       goto out;
-@@ -1233,7 +1233,7 @@ static ssize_t bin_dn_node_address(struc
-                               le16_to_cpu(dnaddr) & 0x3ff);
-               set_fs(KERNEL_DS);
--              result = vfs_write(file, buf, len, &pos);
-+              result = vfs_write(file, (const char __force_user *)buf, len, &pos);
-               set_fs(old_fs);
-               if (result < 0)
-                       goto out;
-diff -urNp linux-3.1.3/kernel/sysctl.c linux-3.1.3/kernel/sysctl.c
---- linux-3.1.3/kernel/sysctl.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/sysctl.c        2011-11-16 18:40:44.000000000 -0500
+diff --git a/kernel/sysctl.c b/kernel/sysctl.c
+index 11d65b5..6957b37 100644
+--- a/kernel/sysctl.c
++++ b/kernel/sysctl.c
 @@ -85,6 +85,13 @@
  
  
@@ -66117,7 +68759,7 @@ diff -urNp linux-3.1.3/kernel/sysctl.c linux-3.1.3/kernel/sysctl.c
  
  /* External variables not in a header file. */
  extern int sysctl_overcommit_memory;
-@@ -197,6 +204,7 @@ static int sysrq_sysctl_handler(ctl_tabl
+@@ -197,6 +204,7 @@ static int sysrq_sysctl_handler(ctl_table *table, int write,
  }
  
  #endif
@@ -66232,7 +68874,7 @@ diff -urNp linux-3.1.3/kernel/sysctl.c linux-3.1.3/kernel/sysctl.c
  
        if (root->permissions)
                mode = root->permissions(root, current->nsproxy, table);
-@@ -2113,6 +2173,16 @@ int proc_dostring(struct ctl_table *tabl
+@@ -2113,6 +2173,16 @@ int proc_dostring(struct ctl_table *table, int write,
                               buffer, lenp, ppos);
  }
  
@@ -66249,7 +68891,7 @@ diff -urNp linux-3.1.3/kernel/sysctl.c linux-3.1.3/kernel/sysctl.c
  static size_t proc_skip_spaces(char **buf)
  {
        size_t ret;
-@@ -2218,6 +2288,8 @@ static int proc_put_long(void __user **b
+@@ -2218,6 +2288,8 @@ static int proc_put_long(void __user **buf, size_t *size, unsigned long val,
        len = strlen(tmp);
        if (len > *size)
                len = *size;
@@ -66258,7 +68900,7 @@ diff -urNp linux-3.1.3/kernel/sysctl.c linux-3.1.3/kernel/sysctl.c
        if (copy_to_user(*buf, tmp, len))
                return -EFAULT;
        *size -= len;
-@@ -2534,8 +2606,11 @@ static int __do_proc_doulongvec_minmax(v
+@@ -2534,8 +2606,11 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int
                        *i = val;
                } else {
                        val = convdiv * (*i) / convmul;
@@ -66271,7 +68913,7 @@ diff -urNp linux-3.1.3/kernel/sysctl.c linux-3.1.3/kernel/sysctl.c
                        err = proc_put_long(&buffer, &left, val, false);
                        if (err)
                                break;
-@@ -2930,6 +3005,12 @@ int proc_dostring(struct ctl_table *tabl
+@@ -2930,6 +3005,12 @@ int proc_dostring(struct ctl_table *table, int write,
        return -ENOSYS;
  }
  
@@ -66292,10 +68934,78 @@ diff -urNp linux-3.1.3/kernel/sysctl.c linux-3.1.3/kernel/sysctl.c
  EXPORT_SYMBOL(proc_doulongvec_minmax);
  EXPORT_SYMBOL(proc_doulongvec_ms_jiffies_minmax);
  EXPORT_SYMBOL(register_sysctl_table);
-diff -urNp linux-3.1.3/kernel/sysctl_check.c linux-3.1.3/kernel/sysctl_check.c
---- linux-3.1.3/kernel/sysctl_check.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/sysctl_check.c  2011-11-16 18:40:44.000000000 -0500
-@@ -129,6 +129,7 @@ int sysctl_check_table(struct nsproxy *n
+diff --git a/kernel/sysctl_binary.c b/kernel/sysctl_binary.c
+index e8bffbe..2344401 100644
+--- a/kernel/sysctl_binary.c
++++ b/kernel/sysctl_binary.c
+@@ -989,7 +989,7 @@ static ssize_t bin_intvec(struct file *file,
+               int i;
+               set_fs(KERNEL_DS);
+-              result = vfs_read(file, buffer, BUFSZ - 1, &pos);
++              result = vfs_read(file, (char __force_user *)buffer, BUFSZ - 1, &pos);
+               set_fs(old_fs);
+               if (result < 0)
+                       goto out_kfree;
+@@ -1034,7 +1034,7 @@ static ssize_t bin_intvec(struct file *file,
+               }
+               set_fs(KERNEL_DS);
+-              result = vfs_write(file, buffer, str - buffer, &pos);
++              result = vfs_write(file, (const char __force_user *)buffer, str - buffer, &pos);
+               set_fs(old_fs);
+               if (result < 0)
+                       goto out_kfree;
+@@ -1067,7 +1067,7 @@ static ssize_t bin_ulongvec(struct file *file,
+               int i;
+               set_fs(KERNEL_DS);
+-              result = vfs_read(file, buffer, BUFSZ - 1, &pos);
++              result = vfs_read(file, (char __force_user *)buffer, BUFSZ - 1, &pos);
+               set_fs(old_fs);
+               if (result < 0)
+                       goto out_kfree;
+@@ -1112,7 +1112,7 @@ static ssize_t bin_ulongvec(struct file *file,
+               }
+               set_fs(KERNEL_DS);
+-              result = vfs_write(file, buffer, str - buffer, &pos);
++              result = vfs_write(file, (const char __force_user *)buffer, str - buffer, &pos);
+               set_fs(old_fs);
+               if (result < 0)
+                       goto out_kfree;
+@@ -1138,7 +1138,7 @@ static ssize_t bin_uuid(struct file *file,
+               int i;
+               set_fs(KERNEL_DS);
+-              result = vfs_read(file, buf, sizeof(buf) - 1, &pos);
++              result = vfs_read(file, (char __force_user *)buf, sizeof(buf) - 1, &pos);
+               set_fs(old_fs);
+               if (result < 0)
+                       goto out;
+@@ -1185,7 +1185,7 @@ static ssize_t bin_dn_node_address(struct file *file,
+               __le16 dnaddr;
+               set_fs(KERNEL_DS);
+-              result = vfs_read(file, buf, sizeof(buf) - 1, &pos);
++              result = vfs_read(file, (char __force_user *)buf, sizeof(buf) - 1, &pos);
+               set_fs(old_fs);
+               if (result < 0)
+                       goto out;
+@@ -1233,7 +1233,7 @@ static ssize_t bin_dn_node_address(struct file *file,
+                               le16_to_cpu(dnaddr) & 0x3ff);
+               set_fs(KERNEL_DS);
+-              result = vfs_write(file, buf, len, &pos);
++              result = vfs_write(file, (const char __force_user *)buf, len, &pos);
+               set_fs(old_fs);
+               if (result < 0)
+                       goto out;
+diff --git a/kernel/sysctl_check.c b/kernel/sysctl_check.c
+index 362da65..ab8ef8c 100644
+--- a/kernel/sysctl_check.c
++++ b/kernel/sysctl_check.c
+@@ -129,6 +129,7 @@ int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table)
                                set_fail(&fail, table, "Directory with extra2");
                } else {
                        if ((table->proc_handler == proc_dostring) ||
@@ -66303,9 +69013,10 @@ diff -urNp linux-3.1.3/kernel/sysctl_check.c linux-3.1.3/kernel/sysctl_check.c
                            (table->proc_handler == proc_dointvec) ||
                            (table->proc_handler == proc_dointvec_minmax) ||
                            (table->proc_handler == proc_dointvec_jiffies) ||
-diff -urNp linux-3.1.3/kernel/taskstats.c linux-3.1.3/kernel/taskstats.c
---- linux-3.1.3/kernel/taskstats.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/taskstats.c     2011-11-16 19:35:09.000000000 -0500
+diff --git a/kernel/taskstats.c b/kernel/taskstats.c
+index e660464..c8b9e67 100644
+--- a/kernel/taskstats.c
++++ b/kernel/taskstats.c
 @@ -27,9 +27,12 @@
  #include <linux/cgroup.h>
  #include <linux/fs.h>
@@ -66329,9 +69040,26 @@ diff -urNp linux-3.1.3/kernel/taskstats.c linux-3.1.3/kernel/taskstats.c
        if (info->attrs[TASKSTATS_CMD_ATTR_REGISTER_CPUMASK])
                return cmd_attr_register_cpumask(info);
        else if (info->attrs[TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK])
-diff -urNp linux-3.1.3/kernel/time/alarmtimer.c linux-3.1.3/kernel/time/alarmtimer.c
---- linux-3.1.3/kernel/time/alarmtimer.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/time/alarmtimer.c       2011-11-16 18:39:08.000000000 -0500
+diff --git a/kernel/time.c b/kernel/time.c
+index d776062..fa8d186 100644
+--- a/kernel/time.c
++++ b/kernel/time.c
+@@ -163,6 +163,11 @@ int do_sys_settimeofday(const struct timespec *tv, const struct timezone *tz)
+               return error;
+       if (tz) {
++              /* we log in do_settimeofday called below, so don't log twice
++              */
++              if (!tv)
++                      gr_log_timechange();
++
+               /* SMP safe, global irq locking makes it work. */
+               sys_tz = *tz;
+               update_vsyscall_tz();
+diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
+index ea5e1a9..8b8df07 100644
+--- a/kernel/time/alarmtimer.c
++++ b/kernel/time/alarmtimer.c
 @@ -693,7 +693,7 @@ static int __init alarmtimer_init(void)
  {
        int error = 0;
@@ -66341,10 +69069,11 @@ diff -urNp linux-3.1.3/kernel/time/alarmtimer.c linux-3.1.3/kernel/time/alarmtim
                .clock_getres   = alarm_clock_getres,
                .clock_get      = alarm_clock_get,
                .timer_create   = alarm_timer_create,
-diff -urNp linux-3.1.3/kernel/time/tick-broadcast.c linux-3.1.3/kernel/time/tick-broadcast.c
---- linux-3.1.3/kernel/time/tick-broadcast.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/time/tick-broadcast.c   2011-11-16 18:39:08.000000000 -0500
-@@ -115,7 +115,7 @@ int tick_device_uses_broadcast(struct cl
+diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
+index 7a90d02..6d8585a 100644
+--- a/kernel/time/tick-broadcast.c
++++ b/kernel/time/tick-broadcast.c
+@@ -115,7 +115,7 @@ int tick_device_uses_broadcast(struct clock_event_device *dev, int cpu)
                 * then clear the broadcast bit.
                 */
                if (!(dev->features & CLOCK_EVT_FEAT_C3STOP)) {
@@ -66353,9 +69082,10 @@ diff -urNp linux-3.1.3/kernel/time/tick-broadcast.c linux-3.1.3/kernel/time/tick
  
                        cpumask_clear_cpu(cpu, tick_get_broadcast_mask());
                        tick_broadcast_clear_oneshot(cpu);
-diff -urNp linux-3.1.3/kernel/time/timekeeping.c linux-3.1.3/kernel/time/timekeeping.c
---- linux-3.1.3/kernel/time/timekeeping.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/time/timekeeping.c      2011-11-16 18:40:44.000000000 -0500
+diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
+index 6f9798b..f8c4087 100644
+--- a/kernel/time/timekeeping.c
++++ b/kernel/time/timekeeping.c
 @@ -14,6 +14,7 @@
  #include <linux/init.h>
  #include <linux/mm.h>
@@ -66364,7 +69094,7 @@ diff -urNp linux-3.1.3/kernel/time/timekeeping.c linux-3.1.3/kernel/time/timekee
  #include <linux/syscore_ops.h>
  #include <linux/clocksource.h>
  #include <linux/jiffies.h>
-@@ -361,6 +362,8 @@ int do_settimeofday(const struct timespe
+@@ -365,6 +366,8 @@ int do_settimeofday(const struct timespec *tv)
        if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
                return -EINVAL;
  
@@ -66373,10 +69103,11 @@ diff -urNp linux-3.1.3/kernel/time/timekeeping.c linux-3.1.3/kernel/time/timekee
        write_seqlock_irqsave(&xtime_lock, flags);
  
        timekeeping_forward_now();
-diff -urNp linux-3.1.3/kernel/time/timer_list.c linux-3.1.3/kernel/time/timer_list.c
---- linux-3.1.3/kernel/time/timer_list.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/time/timer_list.c       2011-11-16 18:40:44.000000000 -0500
-@@ -38,12 +38,16 @@ DECLARE_PER_CPU(struct hrtimer_cpu_base,
+diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c
+index 3258455..f35227d 100644
+--- a/kernel/time/timer_list.c
++++ b/kernel/time/timer_list.c
+@@ -38,12 +38,16 @@ DECLARE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases);
  
  static void print_name_offset(struct seq_file *m, void *sym)
  {
@@ -66405,7 +69136,7 @@ diff -urNp linux-3.1.3/kernel/time/timer_list.c linux-3.1.3/kernel/time/timer_li
        SEQ_printf(m, "  .index:      %d\n",
                        base->index);
        SEQ_printf(m, "  .resolution: %Lu nsecs\n",
-@@ -293,7 +301,11 @@ static int __init init_timer_list_procfs
+@@ -293,7 +301,11 @@ static int __init init_timer_list_procfs(void)
  {
        struct proc_dir_entry *pe;
  
@@ -66417,9 +69148,10 @@ diff -urNp linux-3.1.3/kernel/time/timer_list.c linux-3.1.3/kernel/time/timer_li
        if (!pe)
                return -ENOMEM;
        return 0;
-diff -urNp linux-3.1.3/kernel/time/timer_stats.c linux-3.1.3/kernel/time/timer_stats.c
---- linux-3.1.3/kernel/time/timer_stats.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/time/timer_stats.c      2011-11-16 18:40:44.000000000 -0500
+diff --git a/kernel/time/timer_stats.c b/kernel/time/timer_stats.c
+index a5d0a3a..60c7948 100644
+--- a/kernel/time/timer_stats.c
++++ b/kernel/time/timer_stats.c
 @@ -116,7 +116,7 @@ static ktime_t time_start, time_stop;
  static unsigned long nr_entries;
  static struct entry entries[MAX_ENTRIES];
@@ -66438,7 +69170,7 @@ diff -urNp linux-3.1.3/kernel/time/timer_stats.c linux-3.1.3/kernel/time/timer_s
  }
  
  static struct entry *alloc_entry(void)
-@@ -261,7 +261,7 @@ void timer_stats_update_stats(void *time
+@@ -261,7 +261,7 @@ void timer_stats_update_stats(void *timer, pid_t pid, void *startf,
        if (likely(entry))
                entry->count++;
        else
@@ -66447,7 +69179,7 @@ diff -urNp linux-3.1.3/kernel/time/timer_stats.c linux-3.1.3/kernel/time/timer_s
  
   out_unlock:
        raw_spin_unlock_irqrestore(lock, flags);
-@@ -269,12 +269,16 @@ void timer_stats_update_stats(void *time
+@@ -269,12 +269,16 @@ void timer_stats_update_stats(void *timer, pid_t pid, void *startf,
  
  static void print_name_offset(struct seq_file *m, unsigned long addr)
  {
@@ -66464,7 +69196,7 @@ diff -urNp linux-3.1.3/kernel/time/timer_stats.c linux-3.1.3/kernel/time/timer_s
  }
  
  static int tstats_show(struct seq_file *m, void *v)
-@@ -300,9 +304,9 @@ static int tstats_show(struct seq_file *
+@@ -300,9 +304,9 @@ static int tstats_show(struct seq_file *m, void *v)
  
        seq_puts(m, "Timer Stats Version: v0.2\n");
        seq_printf(m, "Sample period: %ld.%03ld s\n", period.tv_sec, ms);
@@ -66476,7 +69208,7 @@ diff -urNp linux-3.1.3/kernel/time/timer_stats.c linux-3.1.3/kernel/time/timer_s
  
        for (i = 0; i < nr_entries; i++) {
                entry = entries + i;
-@@ -417,7 +421,11 @@ static int __init init_tstats_procfs(voi
+@@ -417,7 +421,11 @@ static int __init init_tstats_procfs(void)
  {
        struct proc_dir_entry *pe;
  
@@ -66488,24 +69220,10 @@ diff -urNp linux-3.1.3/kernel/time/timer_stats.c linux-3.1.3/kernel/time/timer_s
        if (!pe)
                return -ENOMEM;
        return 0;
-diff -urNp linux-3.1.3/kernel/time.c linux-3.1.3/kernel/time.c
---- linux-3.1.3/kernel/time.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/time.c  2011-11-16 18:40:44.000000000 -0500
-@@ -163,6 +163,11 @@ int do_sys_settimeofday(const struct tim
-               return error;
-       if (tz) {
-+              /* we log in do_settimeofday called below, so don't log twice
-+              */
-+              if (!tv)
-+                      gr_log_timechange();
-+
-               /* SMP safe, global irq locking makes it work. */
-               sys_tz = *tz;
-               update_vsyscall_tz();
-diff -urNp linux-3.1.3/kernel/timer.c linux-3.1.3/kernel/timer.c
---- linux-3.1.3/kernel/timer.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/timer.c 2011-11-16 18:39:08.000000000 -0500
+diff --git a/kernel/timer.c b/kernel/timer.c
+index 8cff361..0fb5cd8 100644
+--- a/kernel/timer.c
++++ b/kernel/timer.c
 @@ -1304,7 +1304,7 @@ void update_process_times(int user_tick)
  /*
   * This function runs timers and the timer-tq in bottom half context.
@@ -66515,10 +69233,11 @@ diff -urNp linux-3.1.3/kernel/timer.c linux-3.1.3/kernel/timer.c
  {
        struct tvec_base *base = __this_cpu_read(tvec_bases);
  
-diff -urNp linux-3.1.3/kernel/trace/blktrace.c linux-3.1.3/kernel/trace/blktrace.c
---- linux-3.1.3/kernel/trace/blktrace.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/trace/blktrace.c        2011-11-16 18:39:08.000000000 -0500
-@@ -323,7 +323,7 @@ static ssize_t blk_dropped_read(struct f
+diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
+index 7c910a5..8b72104 100644
+--- a/kernel/trace/blktrace.c
++++ b/kernel/trace/blktrace.c
+@@ -323,7 +323,7 @@ static ssize_t blk_dropped_read(struct file *filp, char __user *buffer,
        struct blk_trace *bt = filp->private_data;
        char buf[16];
  
@@ -66527,7 +69246,7 @@ diff -urNp linux-3.1.3/kernel/trace/blktrace.c linux-3.1.3/kernel/trace/blktrace
  
        return simple_read_from_buffer(buffer, count, ppos, buf, strlen(buf));
  }
-@@ -388,7 +388,7 @@ static int blk_subbuf_start_callback(str
+@@ -388,7 +388,7 @@ static int blk_subbuf_start_callback(struct rchan_buf *buf, void *subbuf,
                return 1;
  
        bt = buf->chan->private_data;
@@ -66536,7 +69255,7 @@ diff -urNp linux-3.1.3/kernel/trace/blktrace.c linux-3.1.3/kernel/trace/blktrace
        return 0;
  }
  
-@@ -489,7 +489,7 @@ int do_blk_trace_setup(struct request_qu
+@@ -489,7 +489,7 @@ int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
  
        bt->dir = dir;
        bt->dev = dev;
@@ -66545,10 +69264,11 @@ diff -urNp linux-3.1.3/kernel/trace/blktrace.c linux-3.1.3/kernel/trace/blktrace
  
        ret = -EIO;
        bt->dropped_file = debugfs_create_file("dropped", 0444, dir, bt,
-diff -urNp linux-3.1.3/kernel/trace/ftrace.c linux-3.1.3/kernel/trace/ftrace.c
---- linux-3.1.3/kernel/trace/ftrace.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/trace/ftrace.c  2011-11-16 18:39:08.000000000 -0500
-@@ -1585,12 +1585,17 @@ ftrace_code_disable(struct module *mod, 
+diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
+index 48d3762..3b61fce 100644
+--- a/kernel/trace/ftrace.c
++++ b/kernel/trace/ftrace.c
+@@ -1584,12 +1584,17 @@ ftrace_code_disable(struct module *mod, struct dyn_ftrace *rec)
        if (unlikely(ftrace_disabled))
                return 0;
  
@@ -66568,7 +69288,7 @@ diff -urNp linux-3.1.3/kernel/trace/ftrace.c linux-3.1.3/kernel/trace/ftrace.c
  }
  
  /*
-@@ -2607,7 +2612,7 @@ static void ftrace_free_entry_rcu(struct
+@@ -2606,7 +2611,7 @@ static void ftrace_free_entry_rcu(struct rcu_head *rhp)
  
  int
  register_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,
@@ -66577,10 +69297,11 @@ diff -urNp linux-3.1.3/kernel/trace/ftrace.c linux-3.1.3/kernel/trace/ftrace.c
  {
        struct ftrace_func_probe *entry;
        struct ftrace_page *pg;
-diff -urNp linux-3.1.3/kernel/trace/trace.c linux-3.1.3/kernel/trace/trace.c
---- linux-3.1.3/kernel/trace/trace.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/trace/trace.c   2011-11-16 18:40:44.000000000 -0500
-@@ -3451,6 +3451,8 @@ static ssize_t tracing_splice_read_pipe(
+diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
+index 17a2d44..85907e2 100644
+--- a/kernel/trace/trace.c
++++ b/kernel/trace/trace.c
+@@ -3451,6 +3451,8 @@ static ssize_t tracing_splice_read_pipe(struct file *filp,
        size_t rem;
        unsigned int i;
  
@@ -66589,7 +69310,7 @@ diff -urNp linux-3.1.3/kernel/trace/trace.c linux-3.1.3/kernel/trace/trace.c
        if (splice_grow_spd(pipe, &spd))
                return -ENOMEM;
  
-@@ -3926,6 +3928,8 @@ tracing_buffers_splice_read(struct file 
+@@ -3926,6 +3928,8 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos,
        int entries, size, i;
        size_t ret;
  
@@ -66598,7 +69319,7 @@ diff -urNp linux-3.1.3/kernel/trace/trace.c linux-3.1.3/kernel/trace/trace.c
        if (splice_grow_spd(pipe, &spd))
                return -ENOMEM;
  
-@@ -4093,10 +4097,9 @@ static const struct file_operations trac
+@@ -4093,10 +4097,9 @@ static const struct file_operations tracing_dyn_info_fops = {
  };
  #endif
  
@@ -66622,10 +69343,11 @@ diff -urNp linux-3.1.3/kernel/trace/trace.c linux-3.1.3/kernel/trace/trace.c
        static int once;
        struct dentry *d_tracer;
  
-diff -urNp linux-3.1.3/kernel/trace/trace_events.c linux-3.1.3/kernel/trace/trace_events.c
---- linux-3.1.3/kernel/trace/trace_events.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/trace/trace_events.c    2011-11-16 18:39:08.000000000 -0500
-@@ -1300,10 +1300,6 @@ static LIST_HEAD(ftrace_module_file_list
+diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
+index c212a7f..7b02394 100644
+--- a/kernel/trace/trace_events.c
++++ b/kernel/trace/trace_events.c
+@@ -1299,10 +1299,6 @@ static LIST_HEAD(ftrace_module_file_list);
  struct ftrace_module_file_ops {
        struct list_head                list;
        struct module                   *mod;
@@ -66636,7 +69358,7 @@ diff -urNp linux-3.1.3/kernel/trace/trace_events.c linux-3.1.3/kernel/trace/trac
  };
  
  static struct ftrace_module_file_ops *
-@@ -1324,17 +1320,12 @@ trace_create_file_ops(struct module *mod
+@@ -1323,17 +1319,12 @@ trace_create_file_ops(struct module *mod)
  
        file_ops->mod = mod;
  
@@ -66660,7 +69382,7 @@ diff -urNp linux-3.1.3/kernel/trace/trace_events.c linux-3.1.3/kernel/trace/trac
  
        list_add(&file_ops->list, &ftrace_module_file_list);
  
-@@ -1358,8 +1349,8 @@ static void trace_module_add_events(stru
+@@ -1357,8 +1348,8 @@ static void trace_module_add_events(struct module *mod)
  
        for_each_event(call, start, end) {
                __trace_add_event_call(*call, mod,
@@ -66671,10 +69393,11 @@ diff -urNp linux-3.1.3/kernel/trace/trace_events.c linux-3.1.3/kernel/trace/trac
        }
  }
  
-diff -urNp linux-3.1.3/kernel/trace/trace_kprobe.c linux-3.1.3/kernel/trace/trace_kprobe.c
---- linux-3.1.3/kernel/trace/trace_kprobe.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/trace/trace_kprobe.c    2011-11-16 18:39:08.000000000 -0500
-@@ -217,7 +217,7 @@ static __kprobes void FETCH_FUNC_NAME(me
+diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
+index 00d527c..7c5b1a3 100644
+--- a/kernel/trace/trace_kprobe.c
++++ b/kernel/trace/trace_kprobe.c
+@@ -217,7 +217,7 @@ static __kprobes void FETCH_FUNC_NAME(memory, string)(struct pt_regs *regs,
        long ret;
        int maxlen = get_rloc_len(*(u32 *)dest);
        u8 *dst = get_rloc_data(dest);
@@ -66683,7 +69406,7 @@ diff -urNp linux-3.1.3/kernel/trace/trace_kprobe.c linux-3.1.3/kernel/trace/trac
        mm_segment_t old_fs = get_fs();
        if (!maxlen)
                return;
-@@ -229,7 +229,7 @@ static __kprobes void FETCH_FUNC_NAME(me
+@@ -229,7 +229,7 @@ static __kprobes void FETCH_FUNC_NAME(memory, string)(struct pt_regs *regs,
        pagefault_disable();
        do
                ret = __copy_from_user_inatomic(dst++, src++, 1);
@@ -66692,7 +69415,7 @@ diff -urNp linux-3.1.3/kernel/trace/trace_kprobe.c linux-3.1.3/kernel/trace/trac
        dst[-1] = '\0';
        pagefault_enable();
        set_fs(old_fs);
-@@ -238,7 +238,7 @@ static __kprobes void FETCH_FUNC_NAME(me
+@@ -238,7 +238,7 @@ static __kprobes void FETCH_FUNC_NAME(memory, string)(struct pt_regs *regs,
                ((u8 *)get_rloc_data(dest))[0] = '\0';
                *(u32 *)dest = make_data_rloc(0, get_rloc_offs(*(u32 *)dest));
        } else
@@ -66701,7 +69424,7 @@ diff -urNp linux-3.1.3/kernel/trace/trace_kprobe.c linux-3.1.3/kernel/trace/trac
                                              get_rloc_offs(*(u32 *)dest));
  }
  /* Return the length of string -- including null terminal byte */
-@@ -252,7 +252,7 @@ static __kprobes void FETCH_FUNC_NAME(me
+@@ -252,7 +252,7 @@ static __kprobes void FETCH_FUNC_NAME(memory, string_size)(struct pt_regs *regs,
        set_fs(KERNEL_DS);
        pagefault_disable();
        do {
@@ -66710,9 +69433,10 @@ diff -urNp linux-3.1.3/kernel/trace/trace_kprobe.c linux-3.1.3/kernel/trace/trac
                len++;
        } while (c && ret == 0 && len < MAX_STRING_SIZE);
        pagefault_enable();
-diff -urNp linux-3.1.3/kernel/trace/trace_mmiotrace.c linux-3.1.3/kernel/trace/trace_mmiotrace.c
---- linux-3.1.3/kernel/trace/trace_mmiotrace.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/trace/trace_mmiotrace.c 2011-11-16 18:39:08.000000000 -0500
+diff --git a/kernel/trace/trace_mmiotrace.c b/kernel/trace/trace_mmiotrace.c
+index fd3c8aa..5f324a6 100644
+--- a/kernel/trace/trace_mmiotrace.c
++++ b/kernel/trace/trace_mmiotrace.c
 @@ -24,7 +24,7 @@ struct header_iter {
  static struct trace_array *mmio_trace_array;
  static bool overrun_detected;
@@ -66722,7 +69446,7 @@ diff -urNp linux-3.1.3/kernel/trace/trace_mmiotrace.c linux-3.1.3/kernel/trace/t
  
  static void mmio_reset_data(struct trace_array *tr)
  {
-@@ -127,7 +127,7 @@ static void mmio_close(struct trace_iter
+@@ -127,7 +127,7 @@ static void mmio_close(struct trace_iterator *iter)
  
  static unsigned long count_overruns(struct trace_iterator *iter)
  {
@@ -66731,7 +69455,7 @@ diff -urNp linux-3.1.3/kernel/trace/trace_mmiotrace.c linux-3.1.3/kernel/trace/t
        unsigned long over = ring_buffer_overruns(iter->tr->buffer);
  
        if (over > prev_overruns)
-@@ -317,7 +317,7 @@ static void __trace_mmiotrace_rw(struct 
+@@ -317,7 +317,7 @@ static void __trace_mmiotrace_rw(struct trace_array *tr,
        event = trace_buffer_lock_reserve(buffer, TRACE_MMIO_RW,
                                          sizeof(*entry), 0, pc);
        if (!event) {
@@ -66740,7 +69464,7 @@ diff -urNp linux-3.1.3/kernel/trace/trace_mmiotrace.c linux-3.1.3/kernel/trace/t
                return;
        }
        entry   = ring_buffer_event_data(event);
-@@ -347,7 +347,7 @@ static void __trace_mmiotrace_map(struct
+@@ -347,7 +347,7 @@ static void __trace_mmiotrace_map(struct trace_array *tr,
        event = trace_buffer_lock_reserve(buffer, TRACE_MMIO_MAP,
                                          sizeof(*entry), 0, pc);
        if (!event) {
@@ -66749,10 +69473,11 @@ diff -urNp linux-3.1.3/kernel/trace/trace_mmiotrace.c linux-3.1.3/kernel/trace/t
                return;
        }
        entry   = ring_buffer_event_data(event);
-diff -urNp linux-3.1.3/kernel/trace/trace_output.c linux-3.1.3/kernel/trace/trace_output.c
---- linux-3.1.3/kernel/trace/trace_output.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/trace/trace_output.c    2011-11-16 18:39:08.000000000 -0500
-@@ -278,7 +278,7 @@ int trace_seq_path(struct trace_seq *s, 
+diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
+index 5199930..26c73a0 100644
+--- a/kernel/trace/trace_output.c
++++ b/kernel/trace/trace_output.c
+@@ -278,7 +278,7 @@ int trace_seq_path(struct trace_seq *s, struct path *path)
  
        p = d_path(path, s->buffer + s->len, PAGE_SIZE - s->len);
        if (!IS_ERR(p)) {
@@ -66761,9 +69486,10 @@ diff -urNp linux-3.1.3/kernel/trace/trace_output.c linux-3.1.3/kernel/trace/trac
                if (p) {
                        s->len = p - s->buffer;
                        return 1;
-diff -urNp linux-3.1.3/kernel/trace/trace_stack.c linux-3.1.3/kernel/trace/trace_stack.c
---- linux-3.1.3/kernel/trace/trace_stack.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/trace/trace_stack.c     2011-11-16 18:39:08.000000000 -0500
+diff --git a/kernel/trace/trace_stack.c b/kernel/trace/trace_stack.c
+index 77575b3..6e623d1 100644
+--- a/kernel/trace/trace_stack.c
++++ b/kernel/trace/trace_stack.c
 @@ -50,7 +50,7 @@ static inline void check_stack(void)
                return;
  
@@ -66773,9 +69499,10 @@ diff -urNp linux-3.1.3/kernel/trace/trace_stack.c linux-3.1.3/kernel/trace/trace
                return;
  
        local_irq_save(flags);
-diff -urNp linux-3.1.3/kernel/trace/trace_workqueue.c linux-3.1.3/kernel/trace/trace_workqueue.c
---- linux-3.1.3/kernel/trace/trace_workqueue.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/kernel/trace/trace_workqueue.c 2011-11-16 18:39:08.000000000 -0500
+diff --git a/kernel/trace/trace_workqueue.c b/kernel/trace/trace_workqueue.c
+index 209b379..7f76423 100644
+--- a/kernel/trace/trace_workqueue.c
++++ b/kernel/trace/trace_workqueue.c
 @@ -22,7 +22,7 @@ struct cpu_workqueue_stats {
        int                         cpu;
        pid_t                       pid;
@@ -66794,7 +69521,7 @@ diff -urNp linux-3.1.3/kernel/trace/trace_workqueue.c linux-3.1.3/kernel/trace/t
                        goto found;
                }
        }
-@@ -210,7 +210,7 @@ static int workqueue_stat_show(struct se
+@@ -210,7 +210,7 @@ static int workqueue_stat_show(struct seq_file *s, void *p)
                tsk = get_pid_task(pid, PIDTYPE_PID);
                if (tsk) {
                        seq_printf(s, "%3d %6d     %6u       %s\n", cws->cpu,
@@ -66803,10 +69530,23 @@ diff -urNp linux-3.1.3/kernel/trace/trace_workqueue.c linux-3.1.3/kernel/trace/t
                                   tsk->comm);
                        put_task_struct(tsk);
                }
-diff -urNp linux-3.1.3/lib/bitmap.c linux-3.1.3/lib/bitmap.c
---- linux-3.1.3/lib/bitmap.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/lib/bitmap.c   2011-11-16 18:39:08.000000000 -0500
-@@ -419,7 +419,7 @@ int __bitmap_parse(const char *buf, unsi
+diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
+index c0cb9c4..f33aa89 100644
+--- a/lib/Kconfig.debug
++++ b/lib/Kconfig.debug
+@@ -1091,6 +1091,7 @@ config LATENCYTOP
+       depends on DEBUG_KERNEL
+       depends on STACKTRACE_SUPPORT
+       depends on PROC_FS
++      depends on !GRKERNSEC_HIDESYM
+       select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE
+       select KALLSYMS
+       select KALLSYMS_ALL
+diff --git a/lib/bitmap.c b/lib/bitmap.c
+index 2f4412e..a557e27 100644
+--- a/lib/bitmap.c
++++ b/lib/bitmap.c
+@@ -419,7 +419,7 @@ int __bitmap_parse(const char *buf, unsigned int buflen,
  {
        int c, old_c, totaldigits, ndigits, nchunks, nbits;
        u32 chunk;
@@ -66815,7 +69555,7 @@ diff -urNp linux-3.1.3/lib/bitmap.c linux-3.1.3/lib/bitmap.c
  
        bitmap_zero(maskp, nmaskbits);
  
-@@ -504,7 +504,7 @@ int bitmap_parse_user(const char __user 
+@@ -504,7 +504,7 @@ int bitmap_parse_user(const char __user *ubuf,
  {
        if (!access_ok(VERIFY_READ, ubuf, ulen))
                return -EFAULT;
@@ -66824,7 +69564,7 @@ diff -urNp linux-3.1.3/lib/bitmap.c linux-3.1.3/lib/bitmap.c
  }
  EXPORT_SYMBOL(bitmap_parse_user);
  
-@@ -594,7 +594,7 @@ static int __bitmap_parselist(const char
+@@ -594,7 +594,7 @@ static int __bitmap_parselist(const char *buf, unsigned int buflen,
  {
        unsigned a, b;
        int c, old_c, totaldigits;
@@ -66833,7 +69573,7 @@ diff -urNp linux-3.1.3/lib/bitmap.c linux-3.1.3/lib/bitmap.c
        int exp_digit, in_range;
  
        totaldigits = c = 0;
-@@ -694,7 +694,7 @@ int bitmap_parselist_user(const char __u
+@@ -694,7 +694,7 @@ int bitmap_parselist_user(const char __user *ubuf,
  {
        if (!access_ok(VERIFY_READ, ubuf, ulen))
                return -EFAULT;
@@ -66842,10 +69582,11 @@ diff -urNp linux-3.1.3/lib/bitmap.c linux-3.1.3/lib/bitmap.c
                                        ulen, 1, maskp, nmaskbits);
  }
  EXPORT_SYMBOL(bitmap_parselist_user);
-diff -urNp linux-3.1.3/lib/bug.c linux-3.1.3/lib/bug.c
---- linux-3.1.3/lib/bug.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/lib/bug.c      2011-11-16 18:39:08.000000000 -0500
-@@ -133,6 +133,8 @@ enum bug_trap_type report_bug(unsigned l
+diff --git a/lib/bug.c b/lib/bug.c
+index 1955209..cbbb2ad 100644
+--- a/lib/bug.c
++++ b/lib/bug.c
+@@ -133,6 +133,8 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs)
                return BUG_TRAP_TYPE_NONE;
  
        bug = find_bug(bugaddr);
@@ -66854,10 +69595,11 @@ diff -urNp linux-3.1.3/lib/bug.c linux-3.1.3/lib/bug.c
  
        file = NULL;
        line = 0;
-diff -urNp linux-3.1.3/lib/debugobjects.c linux-3.1.3/lib/debugobjects.c
---- linux-3.1.3/lib/debugobjects.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/lib/debugobjects.c     2011-11-16 18:39:08.000000000 -0500
-@@ -284,7 +284,7 @@ static void debug_object_is_on_stack(voi
+diff --git a/lib/debugobjects.c b/lib/debugobjects.c
+index a78b7c6..2c73084 100644
+--- a/lib/debugobjects.c
++++ b/lib/debugobjects.c
+@@ -284,7 +284,7 @@ static void debug_object_is_on_stack(void *addr, int onstack)
        if (limit > 4)
                return;
  
@@ -66866,9 +69608,10 @@ diff -urNp linux-3.1.3/lib/debugobjects.c linux-3.1.3/lib/debugobjects.c
        if (is_on_stack == onstack)
                return;
  
-diff -urNp linux-3.1.3/lib/devres.c linux-3.1.3/lib/devres.c
---- linux-3.1.3/lib/devres.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/lib/devres.c   2011-11-16 18:39:08.000000000 -0500
+diff --git a/lib/devres.c b/lib/devres.c
+index 7c0e953..f642b5c 100644
+--- a/lib/devres.c
++++ b/lib/devres.c
 @@ -80,7 +80,7 @@ EXPORT_SYMBOL(devm_ioremap_nocache);
  void devm_iounmap(struct device *dev, void __iomem *addr)
  {
@@ -66878,7 +69621,7 @@ diff -urNp linux-3.1.3/lib/devres.c linux-3.1.3/lib/devres.c
        iounmap(addr);
  }
  EXPORT_SYMBOL(devm_iounmap);
-@@ -141,7 +141,7 @@ void devm_ioport_unmap(struct device *de
+@@ -141,7 +141,7 @@ void devm_ioport_unmap(struct device *dev, void __iomem *addr)
  {
        ioport_unmap(addr);
        WARN_ON(devres_destroy(dev, devm_ioport_map_release,
@@ -66887,9 +69630,10 @@ diff -urNp linux-3.1.3/lib/devres.c linux-3.1.3/lib/devres.c
  }
  EXPORT_SYMBOL(devm_ioport_unmap);
  
-diff -urNp linux-3.1.3/lib/dma-debug.c linux-3.1.3/lib/dma-debug.c
---- linux-3.1.3/lib/dma-debug.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/lib/dma-debug.c        2011-11-16 18:39:08.000000000 -0500
+diff --git a/lib/dma-debug.c b/lib/dma-debug.c
+index db07bfd..719b5ab 100644
+--- a/lib/dma-debug.c
++++ b/lib/dma-debug.c
 @@ -870,7 +870,7 @@ out:
  
  static void check_for_stack(struct device *dev, void *addr)
@@ -66899,9 +69643,10 @@ diff -urNp linux-3.1.3/lib/dma-debug.c linux-3.1.3/lib/dma-debug.c
                err_printk(dev, NULL, "DMA-API: device driver maps memory from"
                                "stack [addr=%p]\n", addr);
  }
-diff -urNp linux-3.1.3/lib/extable.c linux-3.1.3/lib/extable.c
---- linux-3.1.3/lib/extable.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/lib/extable.c  2011-11-16 18:39:08.000000000 -0500
+diff --git a/lib/extable.c b/lib/extable.c
+index 4cac81e..63e9b8f 100644
+--- a/lib/extable.c
++++ b/lib/extable.c
 @@ -13,6 +13,7 @@
  #include <linux/init.h>
  #include <linux/sort.h>
@@ -66910,7 +69655,7 @@ diff -urNp linux-3.1.3/lib/extable.c linux-3.1.3/lib/extable.c
  
  #ifndef ARCH_HAS_SORT_EXTABLE
  /*
-@@ -36,8 +37,10 @@ static int cmp_ex(const void *a, const v
+@@ -36,8 +37,10 @@ static int cmp_ex(const void *a, const void *b)
  void sort_extable(struct exception_table_entry *start,
                  struct exception_table_entry *finish)
  {
@@ -66921,9 +69666,10 @@ diff -urNp linux-3.1.3/lib/extable.c linux-3.1.3/lib/extable.c
  }
  
  #ifdef CONFIG_MODULES
-diff -urNp linux-3.1.3/lib/inflate.c linux-3.1.3/lib/inflate.c
---- linux-3.1.3/lib/inflate.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/lib/inflate.c  2011-11-16 18:39:08.000000000 -0500
+diff --git a/lib/inflate.c b/lib/inflate.c
+index 013a761..c28f3fc 100644
+--- a/lib/inflate.c
++++ b/lib/inflate.c
 @@ -269,7 +269,7 @@ static void free(void *where)
                malloc_ptr = free_mem_ptr;
  }
@@ -66933,20 +69679,10 @@ diff -urNp linux-3.1.3/lib/inflate.c linux-3.1.3/lib/inflate.c
  #define free(a) kfree(a)
  #endif
  
-diff -urNp linux-3.1.3/lib/Kconfig.debug linux-3.1.3/lib/Kconfig.debug
---- linux-3.1.3/lib/Kconfig.debug      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/lib/Kconfig.debug      2011-11-16 18:40:44.000000000 -0500
-@@ -1091,6 +1091,7 @@ config LATENCYTOP
-       depends on DEBUG_KERNEL
-       depends on STACKTRACE_SUPPORT
-       depends on PROC_FS
-+      depends on !GRKERNSEC_HIDESYM
-       select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE
-       select KALLSYMS
-       select KALLSYMS_ALL
-diff -urNp linux-3.1.3/lib/kref.c linux-3.1.3/lib/kref.c
---- linux-3.1.3/lib/kref.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/lib/kref.c     2011-11-16 18:39:08.000000000 -0500
+diff --git a/lib/kref.c b/lib/kref.c
+index 3efb882..8492f4c 100644
+--- a/lib/kref.c
++++ b/lib/kref.c
 @@ -52,7 +52,7 @@ void kref_get(struct kref *kref)
   */
  int kref_put(struct kref *kref, void (*release)(struct kref *kref))
@@ -66956,9 +69692,10 @@ diff -urNp linux-3.1.3/lib/kref.c linux-3.1.3/lib/kref.c
        WARN_ON(release == (void (*)(struct kref *))kfree);
  
        if (atomic_dec_and_test(&kref->refcount)) {
-diff -urNp linux-3.1.3/lib/radix-tree.c linux-3.1.3/lib/radix-tree.c
---- linux-3.1.3/lib/radix-tree.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/lib/radix-tree.c       2011-11-16 18:39:08.000000000 -0500
+diff --git a/lib/radix-tree.c b/lib/radix-tree.c
+index a2f9da5..3bcadb6 100644
+--- a/lib/radix-tree.c
++++ b/lib/radix-tree.c
 @@ -80,7 +80,7 @@ struct radix_tree_preload {
        int nr;
        struct radix_tree_node *nodes[RADIX_TREE_MAX_PATH];
@@ -66968,9 +69705,10 @@ diff -urNp linux-3.1.3/lib/radix-tree.c linux-3.1.3/lib/radix-tree.c
  
  static inline void *ptr_to_indirect(void *ptr)
  {
-diff -urNp linux-3.1.3/lib/vsprintf.c linux-3.1.3/lib/vsprintf.c
---- linux-3.1.3/lib/vsprintf.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/lib/vsprintf.c 2011-11-16 18:40:44.000000000 -0500
+diff --git a/lib/vsprintf.c b/lib/vsprintf.c
+index d7222a9..2172edc 100644
+--- a/lib/vsprintf.c
++++ b/lib/vsprintf.c
 @@ -16,6 +16,9 @@
   * - scnprintf and vscnprintf
   */
@@ -66981,7 +69719,7 @@ diff -urNp linux-3.1.3/lib/vsprintf.c linux-3.1.3/lib/vsprintf.c
  #include <stdarg.h>
  #include <linux/module.h>
  #include <linux/types.h>
-@@ -432,7 +435,7 @@ char *symbol_string(char *buf, char *end
+@@ -432,7 +435,7 @@ char *symbol_string(char *buf, char *end, void *ptr,
        char sym[KSYM_SYMBOL_LEN];
        if (ext == 'B')
                sprint_backtrace(sym, value);
@@ -66990,7 +69728,7 @@ diff -urNp linux-3.1.3/lib/vsprintf.c linux-3.1.3/lib/vsprintf.c
                sprint_symbol(sym, value);
        else
                kallsyms_lookup(value, NULL, NULL, NULL, sym);
-@@ -796,7 +799,11 @@ char *uuid_string(char *buf, char *end, 
+@@ -796,7 +799,11 @@ char *uuid_string(char *buf, char *end, const u8 *addr,
        return string(buf, end, uuid, spec);
  }
  
@@ -67011,7 +69749,7 @@ diff -urNp linux-3.1.3/lib/vsprintf.c linux-3.1.3/lib/vsprintf.c
   * - 'R' For decoded struct resource, e.g., [mem 0x0-0x1f 64bit pref]
   * - 'r' For raw struct resource, e.g., [mem 0x0-0x1f flags 0x201]
   * - 'M' For a 6-byte MAC address, it prints the address in the
-@@ -854,12 +863,12 @@ char *pointer(const char *fmt, char *buf
+@@ -854,12 +863,12 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
  {
        if (!ptr && *fmt != 'K') {
                /*
@@ -67026,7 +69764,7 @@ diff -urNp linux-3.1.3/lib/vsprintf.c linux-3.1.3/lib/vsprintf.c
        }
  
        switch (*fmt) {
-@@ -869,6 +878,13 @@ char *pointer(const char *fmt, char *buf
+@@ -869,6 +878,13 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
                /* Fallthrough */
        case 'S':
        case 's':
@@ -67040,7 +69778,7 @@ diff -urNp linux-3.1.3/lib/vsprintf.c linux-3.1.3/lib/vsprintf.c
        case 'B':
                return symbol_string(buf, end, ptr, spec, *fmt);
        case 'R':
-@@ -1627,11 +1643,11 @@ int bstr_printf(char *buf, size_t size, 
+@@ -1627,11 +1643,11 @@ int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf)
        typeof(type) value;                                             \
        if (sizeof(type) == 8) {                                        \
                args = PTR_ALIGN(args, sizeof(u32));                    \
@@ -67055,7 +69793,7 @@ diff -urNp linux-3.1.3/lib/vsprintf.c linux-3.1.3/lib/vsprintf.c
        }                                                               \
        args += sizeof(type);                                           \
        value;                                                          \
-@@ -1694,7 +1710,7 @@ int bstr_printf(char *buf, size_t size, 
+@@ -1694,7 +1710,7 @@ int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf)
                case FORMAT_TYPE_STR: {
                        const char *str_arg = args;
                        args += strlen(str_arg) + 1;
@@ -67064,191 +69802,36 @@ diff -urNp linux-3.1.3/lib/vsprintf.c linux-3.1.3/lib/vsprintf.c
                        break;
                }
  
-diff -urNp linux-3.1.3/localversion-grsec linux-3.1.3/localversion-grsec
---- linux-3.1.3/localversion-grsec     1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/localversion-grsec     2011-11-16 18:40:44.000000000 -0500
+diff --git a/localversion-grsec b/localversion-grsec
+new file mode 100644
+index 0000000..7cd6065
+--- /dev/null
++++ b/localversion-grsec
 @@ -0,0 +1 @@
 +-grsec
-diff -urNp linux-3.1.3/Makefile linux-3.1.3/Makefile
---- linux-3.1.3/Makefile       2011-11-26 19:57:29.000000000 -0500
-+++ linux-3.1.3/Makefile       2011-11-26 20:00:43.000000000 -0500
-@@ -245,8 +245,9 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH"
- HOSTCC       = gcc
- HOSTCXX      = g++
--HOSTCFLAGS   = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer
--HOSTCXXFLAGS = -O2
-+HOSTCFLAGS   = -Wall -W -Wmissing-prototypes -Wstrict-prototypes -Wno-unused-parameter -Wno-missing-field-initializers -O2 -fomit-frame-pointer -fno-delete-null-pointer-checks
-+HOSTCLFAGS  += $(call cc-option, -Wno-empty-body)
-+HOSTCXXFLAGS = -O2 -Wall -W -fno-delete-null-pointer-checks
- # Decide whether to build built-in, modular, or both.
- # Normally, just do built-in.
-@@ -407,8 +408,8 @@ export RCS_TAR_IGNORE := --exclude SCCS 
- # Rules shared between *config targets and build targets
- # Basic helpers built in scripts/
--PHONY += scripts_basic
--scripts_basic:
-+PHONY += scripts_basic gcc-plugins
-+scripts_basic: gcc-plugins
-       $(Q)$(MAKE) $(build)=scripts/basic
-       $(Q)rm -f .tmp_quiet_recordmcount
-@@ -564,6 +565,41 @@ else
- KBUILD_CFLAGS += -O2
- endif
-+ifndef DISABLE_PAX_PLUGINS
-+ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-plugin.sh "$(HOSTCC)" "$(CC)"), y)
-+ifndef DISABLE_PAX_CONSTIFY_PLUGIN
-+CONSTIFY_PLUGIN := -fplugin=$(objtree)/tools/gcc/constify_plugin.so -DCONSTIFY_PLUGIN
-+endif
-+ifdef CONFIG_PAX_MEMORY_STACKLEAK
-+STACKLEAK_PLUGIN := -fplugin=$(objtree)/tools/gcc/stackleak_plugin.so -DSTACKLEAK_PLUGIN
-+STACKLEAK_PLUGIN += -fplugin-arg-stackleak_plugin-track-lowest-sp=100
-+endif
-+ifdef CONFIG_KALLOCSTAT_PLUGIN
-+KALLOCSTAT_PLUGIN := -fplugin=$(objtree)/tools/gcc/kallocstat_plugin.so
-+endif
-+ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+KERNEXEC_PLUGIN := -fplugin=$(objtree)/tools/gcc/kernexec_plugin.so
-+endif
-+ifdef CONFIG_CHECKER_PLUGIN
-+ifeq ($(call cc-ifversion, -ge, 0406, y), y)
-+CHECKER_PLUGIN := -fplugin=$(objtree)/tools/gcc/checker_plugin.so -DCHECKER_PLUGIN
-+endif
-+endif
-+GCC_PLUGINS := $(CONSTIFY_PLUGIN) $(STACKLEAK_PLUGIN) $(KALLOCSTAT_PLUGIN) $(KERNEXEC_PLUGIN) $(CHECKER_PLUGIN)
-+export CONSTIFY_PLUGIN STACKLEAK_PLUGIN KERNEXEC_PLUGIN CHECKER_PLUGIN
-+gcc-plugins:
-+      $(Q)$(MAKE) $(build)=tools/gcc
-+else
-+gcc-plugins:
-+ifeq ($(call cc-ifversion, -ge, 0405, y), y)
-+      $(error Your gcc installation does not support plugins.  If the necessary headers for plugin support are missing, they should be installed.  On Debian, apt-get install gcc-<ver>-plugin-dev.  If you choose to ignore this error and lessen the improvements provided by this patch, re-run make with the DISABLE_PAX_PLUGINS=y argument.))
-+else
-+      $(Q)echo "warning, your gcc version does not support plugins, you should upgrade it to gcc 4.5 at least"
-+endif
-+      $(Q)echo "PAX_MEMORY_STACKLEAK and other features will be less secure"
-+endif
-+endif
-+
- include $(srctree)/arch/$(SRCARCH)/Makefile
- ifneq ($(CONFIG_FRAME_WARN),0)
-@@ -708,7 +744,7 @@ export mod_strip_cmd
- ifeq ($(KBUILD_EXTMOD),)
--core-y                += kernel/ mm/ fs/ ipc/ security/ crypto/ block/
-+core-y                += kernel/ mm/ fs/ ipc/ security/ crypto/ block/ grsecurity/
- vmlinux-dirs  := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
-                    $(core-y) $(core-m) $(drivers-y) $(drivers-m) \
-@@ -932,6 +968,7 @@ vmlinux.o: $(modpost-init) $(vmlinux-mai
- # The actual objects are generated when descending, 
- # make sure no implicit rule kicks in
-+$(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): KBUILD_CFLAGS += $(GCC_PLUGINS)
- $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ;
- # Handle descending into subdirectories listed in $(vmlinux-dirs)
-@@ -941,7 +978,7 @@ $(sort $(vmlinux-init) $(vmlinux-main)) 
- # Error messages still appears in the original language
- PHONY += $(vmlinux-dirs)
--$(vmlinux-dirs): prepare scripts
-+$(vmlinux-dirs): gcc-plugins prepare scripts
-       $(Q)$(MAKE) $(build)=$@
- # Store (new) KERNELRELASE string in include/config/kernel.release
-@@ -986,6 +1023,7 @@ prepare0: archprepare FORCE
-       $(Q)$(MAKE) $(build)=. missing-syscalls
- # All the preparing..
-+prepare: KBUILD_CFLAGS := $(filter-out $(GCC_PLUGINS),$(KBUILD_CFLAGS))
- prepare: prepare0
- # Generate some files
-@@ -1087,6 +1125,7 @@ all: modules
- #     using awk while concatenating to the final file.
- PHONY += modules
-+modules: KBUILD_CFLAGS += $(GCC_PLUGINS)
- modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin
-       $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order
-       @$(kecho) '  Building modules, stage 2.';
-@@ -1102,7 +1141,7 @@ modules.builtin: $(vmlinux-dirs:%=%/modu
- # Target to prepare building external modules
- PHONY += modules_prepare
--modules_prepare: prepare scripts
-+modules_prepare: gcc-plugins prepare scripts
- # Target to install modules
- PHONY += modules_install
-@@ -1198,7 +1237,7 @@ distclean: mrproper
-       @find $(srctree) $(RCS_FIND_IGNORE) \
-               \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
-               -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
--              -o -name '.*.rej' -o -size 0 \
-+              -o -name '.*.rej' -o -name '*.so' -o -size 0 \
-               -o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \
-               -type f -print | xargs rm -f
-@@ -1360,6 +1399,7 @@ PHONY += $(module-dirs) modules
- $(module-dirs): crmodverdir $(objtree)/Module.symvers
-       $(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@)
-+modules: KBUILD_CFLAGS += $(GCC_PLUGINS)
- modules: $(module-dirs)
-       @$(kecho) '  Building modules, stage 2.';
-       $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
-@@ -1486,17 +1526,19 @@ else
-         target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@))
- endif
+diff --git a/mm/Kconfig b/mm/Kconfig
+index f2f1ca1..0645f06 100644
+--- a/mm/Kconfig
++++ b/mm/Kconfig
+@@ -238,10 +238,10 @@ config KSM
+         root has set /sys/kernel/mm/ksm/run to 1 (if CONFIG_SYSFS is set).
  
--%.s: %.c prepare scripts FORCE
-+%.s: KBUILD_CFLAGS += $(GCC_PLUGINS)
-+%.s: %.c gcc-plugins prepare scripts FORCE
-       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
- %.i: %.c prepare scripts FORCE
-       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
--%.o: %.c prepare scripts FORCE
-+%.o: KBUILD_CFLAGS += $(GCC_PLUGINS)
-+%.o: %.c gcc-plugins prepare scripts FORCE
-       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
- %.lst: %.c prepare scripts FORCE
-       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
--%.s: %.S prepare scripts FORCE
-+%.s: %.S gcc-plugins prepare scripts FORCE
-       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
--%.o: %.S prepare scripts FORCE
-+%.o: %.S gcc-plugins prepare scripts FORCE
-       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
- %.symtypes: %.c prepare scripts FORCE
-       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
-@@ -1506,11 +1548,13 @@ endif
-       $(cmd_crmodverdir)
-       $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
-       $(build)=$(build-dir)
--%/: prepare scripts FORCE
-+%/: KBUILD_CFLAGS += $(GCC_PLUGINS)
-+%/: gcc-plugins prepare scripts FORCE
-       $(cmd_crmodverdir)
-       $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
-       $(build)=$(build-dir)
--%.ko: prepare scripts FORCE
-+%.ko: KBUILD_CFLAGS += $(GCC_PLUGINS)
-+%.ko: gcc-plugins prepare scripts FORCE
-       $(cmd_crmodverdir)
-       $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1)   \
-       $(build)=$(build-dir) $(@:.ko=.o)
-diff -urNp linux-3.1.3/mm/filemap.c linux-3.1.3/mm/filemap.c
---- linux-3.1.3/mm/filemap.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/filemap.c   2011-11-16 18:40:44.000000000 -0500
-@@ -1784,7 +1784,7 @@ int generic_file_mmap(struct file * file
+ config DEFAULT_MMAP_MIN_ADDR
+-        int "Low address space to protect from user allocation"
++      int "Low address space to protect from user allocation"
+       depends on MMU
+-        default 4096
+-        help
++      default 65536
++      help
+         This is the portion of low virtual memory which should be protected
+         from userspace allocation.  Keeping a user from writing to low pages
+         can help reduce the impact of kernel NULL pointer bugs.
+diff --git a/mm/filemap.c b/mm/filemap.c
+index 7771871..91bcdb4 100644
+--- a/mm/filemap.c
++++ b/mm/filemap.c
+@@ -1784,7 +1784,7 @@ int generic_file_mmap(struct file * file, struct vm_area_struct * vma)
        struct address_space *mapping = file->f_mapping;
  
        if (!mapping->a_ops->readpage)
@@ -67257,7 +69840,7 @@ diff -urNp linux-3.1.3/mm/filemap.c linux-3.1.3/mm/filemap.c
        file_accessed(file);
        vma->vm_ops = &generic_file_vm_ops;
        vma->vm_flags |= VM_CAN_NONLINEAR;
-@@ -2190,6 +2190,7 @@ inline int generic_write_checks(struct f
+@@ -2190,6 +2190,7 @@ inline int generic_write_checks(struct file *file, loff_t *pos, size_t *count, i
                          *pos = i_size_read(inode);
  
                if (limit != RLIM_INFINITY) {
@@ -67265,10 +69848,11 @@ diff -urNp linux-3.1.3/mm/filemap.c linux-3.1.3/mm/filemap.c
                        if (*pos >= limit) {
                                send_sig(SIGXFSZ, current, 0);
                                return -EFBIG;
-diff -urNp linux-3.1.3/mm/fremap.c linux-3.1.3/mm/fremap.c
---- linux-3.1.3/mm/fremap.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/fremap.c    2011-11-16 18:39:08.000000000 -0500
-@@ -156,6 +156,11 @@ SYSCALL_DEFINE5(remap_file_pages, unsign
+diff --git a/mm/fremap.c b/mm/fremap.c
+index b8e0e2d..076e171 100644
+--- a/mm/fremap.c
++++ b/mm/fremap.c
+@@ -156,6 +156,11 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
   retry:
        vma = find_vma(mm, start);
  
@@ -67280,9 +69864,10 @@ diff -urNp linux-3.1.3/mm/fremap.c linux-3.1.3/mm/fremap.c
        /*
         * Make sure the vma is shared, that it supports prefaulting,
         * and that the remapped range is valid and fully within
-diff -urNp linux-3.1.3/mm/highmem.c linux-3.1.3/mm/highmem.c
---- linux-3.1.3/mm/highmem.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/highmem.c   2011-11-16 18:39:08.000000000 -0500
+diff --git a/mm/highmem.c b/mm/highmem.c
+index 5ef672c..d7660f4 100644
+--- a/mm/highmem.c
++++ b/mm/highmem.c
 @@ -125,9 +125,10 @@ static void flush_all_zero_pkmaps(void)
                 * So no dangers, even with speculative execution.
                 */
@@ -67308,9 +69893,10 @@ diff -urNp linux-3.1.3/mm/highmem.c linux-3.1.3/mm/highmem.c
        pkmap_count[last_pkmap_nr] = 1;
        set_page_address(page, (void *)vaddr);
  
-diff -urNp linux-3.1.3/mm/huge_memory.c linux-3.1.3/mm/huge_memory.c
---- linux-3.1.3/mm/huge_memory.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/huge_memory.c       2011-11-16 18:39:08.000000000 -0500
+diff --git a/mm/huge_memory.c b/mm/huge_memory.c
+index d819d93..468e18f 100644
+--- a/mm/huge_memory.c
++++ b/mm/huge_memory.c
 @@ -702,7 +702,7 @@ out:
         * run pte_offset_map on the pmd, if an huge pmd could
         * materialize from under us from a different thread.
@@ -67320,10 +69906,28 @@ diff -urNp linux-3.1.3/mm/huge_memory.c linux-3.1.3/mm/huge_memory.c
                return VM_FAULT_OOM;
        /* if an huge pmd materialized from under us just retry later */
        if (unlikely(pmd_trans_huge(*pmd)))
-diff -urNp linux-3.1.3/mm/hugetlb.c linux-3.1.3/mm/hugetlb.c
---- linux-3.1.3/mm/hugetlb.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/hugetlb.c   2011-11-16 18:39:08.000000000 -0500
-@@ -2346,6 +2346,27 @@ static int unmap_ref_private(struct mm_s
+@@ -829,7 +829,7 @@ static int do_huge_pmd_wp_page_fallback(struct mm_struct *mm,
+       for (i = 0; i < HPAGE_PMD_NR; i++) {
+               copy_user_highpage(pages[i], page + i,
+-                                 haddr + PAGE_SHIFT*i, vma);
++                                 haddr + PAGE_SIZE*i, vma);
+               __SetPageUptodate(pages[i]);
+               cond_resched();
+       }
+diff --git a/mm/hugetlb.c b/mm/hugetlb.c
+index bb28a5f..fef0140 100644
+--- a/mm/hugetlb.c
++++ b/mm/hugetlb.c
+@@ -576,6 +576,7 @@ static void prep_compound_gigantic_page(struct page *page, unsigned long order)
+       __SetPageHead(page);
+       for (i = 1; i < nr_pages; i++, p = mem_map_next(p, page, i)) {
+               __SetPageTail(p);
++              set_page_count(p, 0);
+               p->first_page = page;
+       }
+ }
+@@ -2346,6 +2347,27 @@ static int unmap_ref_private(struct mm_struct *mm, struct vm_area_struct *vma,
        return 1;
  }
  
@@ -67351,7 +69955,7 @@ diff -urNp linux-3.1.3/mm/hugetlb.c linux-3.1.3/mm/hugetlb.c
  /*
   * Hugetlb_cow() should be called with page lock of the original hugepage held.
   */
-@@ -2447,6 +2468,11 @@ retry_avoidcopy:
+@@ -2449,6 +2471,11 @@ retry_avoidcopy:
                                make_huge_pte(vma, new_page, 1));
                page_remove_rmap(old_page);
                hugepage_add_new_anon_rmap(new_page, vma, address);
@@ -67363,7 +69967,7 @@ diff -urNp linux-3.1.3/mm/hugetlb.c linux-3.1.3/mm/hugetlb.c
                /* Make the old page be freed below */
                new_page = old_page;
                mmu_notifier_invalidate_range_end(mm,
-@@ -2598,6 +2624,10 @@ retry:
+@@ -2600,6 +2627,10 @@ retry:
                                && (vma->vm_flags & VM_SHARED)));
        set_huge_pte_at(mm, address, ptep, new_pte);
  
@@ -67374,7 +69978,7 @@ diff -urNp linux-3.1.3/mm/hugetlb.c linux-3.1.3/mm/hugetlb.c
        if ((flags & FAULT_FLAG_WRITE) && !(vma->vm_flags & VM_SHARED)) {
                /* Optimization, do the COW without a second fault */
                ret = hugetlb_cow(mm, vma, address, ptep, new_pte, page);
-@@ -2627,6 +2657,10 @@ int hugetlb_fault(struct mm_struct *mm, 
+@@ -2629,6 +2660,10 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
        static DEFINE_MUTEX(hugetlb_instantiation_mutex);
        struct hstate *h = hstate_vma(vma);
  
@@ -67385,7 +69989,7 @@ diff -urNp linux-3.1.3/mm/hugetlb.c linux-3.1.3/mm/hugetlb.c
        ptep = huge_pte_offset(mm, address);
        if (ptep) {
                entry = huge_ptep_get(ptep);
-@@ -2638,6 +2672,26 @@ int hugetlb_fault(struct mm_struct *mm, 
+@@ -2640,6 +2675,26 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
                               VM_FAULT_SET_HINDEX(h - hstates);
        }
  
@@ -67412,10 +70016,11 @@ diff -urNp linux-3.1.3/mm/hugetlb.c linux-3.1.3/mm/hugetlb.c
        ptep = huge_pte_alloc(mm, address, huge_page_size(h));
        if (!ptep)
                return VM_FAULT_OOM;
-diff -urNp linux-3.1.3/mm/internal.h linux-3.1.3/mm/internal.h
---- linux-3.1.3/mm/internal.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/internal.h  2011-11-16 18:39:08.000000000 -0500
-@@ -95,6 +95,7 @@ extern void putback_lru_page(struct page
+diff --git a/mm/internal.h b/mm/internal.h
+index 2189af4..f2ca332 100644
+--- a/mm/internal.h
++++ b/mm/internal.h
+@@ -95,6 +95,7 @@ extern void putback_lru_page(struct page *page);
   * in mm/page_alloc.c
   */
  extern void __free_pages_bootmem(struct page *page, unsigned int order);
@@ -67423,27 +70028,11 @@ diff -urNp linux-3.1.3/mm/internal.h linux-3.1.3/mm/internal.h
  extern void prep_compound_page(struct page *page, unsigned long order);
  #ifdef CONFIG_MEMORY_FAILURE
  extern bool is_free_buddy_page(struct page *page);
-diff -urNp linux-3.1.3/mm/Kconfig linux-3.1.3/mm/Kconfig
---- linux-3.1.3/mm/Kconfig     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/Kconfig     2011-11-17 18:57:00.000000000 -0500
-@@ -238,10 +238,10 @@ config KSM
-         root has set /sys/kernel/mm/ksm/run to 1 (if CONFIG_SYSFS is set).
- config DEFAULT_MMAP_MIN_ADDR
--        int "Low address space to protect from user allocation"
-+      int "Low address space to protect from user allocation"
-       depends on MMU
--        default 4096
--        help
-+      default 65536
-+      help
-         This is the portion of low virtual memory which should be protected
-         from userspace allocation.  Keeping a user from writing to low pages
-         can help reduce the impact of kernel NULL pointer bugs.
-diff -urNp linux-3.1.3/mm/kmemleak.c linux-3.1.3/mm/kmemleak.c
---- linux-3.1.3/mm/kmemleak.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/kmemleak.c  2011-11-16 18:40:44.000000000 -0500
-@@ -357,7 +357,7 @@ static void print_unreferenced(struct se
+diff --git a/mm/kmemleak.c b/mm/kmemleak.c
+index d6880f5..ed77913 100644
+--- a/mm/kmemleak.c
++++ b/mm/kmemleak.c
+@@ -357,7 +357,7 @@ static void print_unreferenced(struct seq_file *seq,
  
        for (i = 0; i < object->trace_len; i++) {
                void *ptr = (void *)object->trace[i];
@@ -67452,10 +70041,11 @@ diff -urNp linux-3.1.3/mm/kmemleak.c linux-3.1.3/mm/kmemleak.c
        }
  }
  
-diff -urNp linux-3.1.3/mm/maccess.c linux-3.1.3/mm/maccess.c
---- linux-3.1.3/mm/maccess.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/maccess.c   2011-11-16 18:39:08.000000000 -0500
-@@ -26,7 +26,7 @@ long __probe_kernel_read(void *dst, cons
+diff --git a/mm/maccess.c b/mm/maccess.c
+index 4cee182..e00511d 100644
+--- a/mm/maccess.c
++++ b/mm/maccess.c
+@@ -26,7 +26,7 @@ long __probe_kernel_read(void *dst, const void *src, size_t size)
        set_fs(KERNEL_DS);
        pagefault_disable();
        ret = __copy_from_user_inatomic(dst,
@@ -67464,7 +70054,7 @@ diff -urNp linux-3.1.3/mm/maccess.c linux-3.1.3/mm/maccess.c
        pagefault_enable();
        set_fs(old_fs);
  
-@@ -53,7 +53,7 @@ long __probe_kernel_write(void *dst, con
+@@ -53,7 +53,7 @@ long __probe_kernel_write(void *dst, const void *src, size_t size)
  
        set_fs(KERNEL_DS);
        pagefault_disable();
@@ -67473,10 +70063,11 @@ diff -urNp linux-3.1.3/mm/maccess.c linux-3.1.3/mm/maccess.c
        pagefault_enable();
        set_fs(old_fs);
  
-diff -urNp linux-3.1.3/mm/madvise.c linux-3.1.3/mm/madvise.c
---- linux-3.1.3/mm/madvise.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/madvise.c   2011-11-16 18:39:08.000000000 -0500
-@@ -45,6 +45,10 @@ static long madvise_behavior(struct vm_a
+diff --git a/mm/madvise.c b/mm/madvise.c
+index 74bf193..feb6fd3 100644
+--- a/mm/madvise.c
++++ b/mm/madvise.c
+@@ -45,6 +45,10 @@ static long madvise_behavior(struct vm_area_struct * vma,
        pgoff_t pgoff;
        unsigned long new_flags = vma->vm_flags;
  
@@ -67501,7 +70092,7 @@ diff -urNp linux-3.1.3/mm/madvise.c linux-3.1.3/mm/madvise.c
        vma->vm_flags = new_flags;
  
  out:
-@@ -168,6 +179,11 @@ static long madvise_dontneed(struct vm_a
+@@ -168,6 +179,11 @@ static long madvise_dontneed(struct vm_area_struct * vma,
                             struct vm_area_struct ** prev,
                             unsigned long start, unsigned long end)
  {
@@ -67513,7 +70104,7 @@ diff -urNp linux-3.1.3/mm/madvise.c linux-3.1.3/mm/madvise.c
        *prev = vma;
        if (vma->vm_flags & (VM_LOCKED|VM_HUGETLB|VM_PFNMAP))
                return -EINVAL;
-@@ -180,6 +196,21 @@ static long madvise_dontneed(struct vm_a
+@@ -180,6 +196,21 @@ static long madvise_dontneed(struct vm_area_struct * vma,
                zap_page_range(vma, start, end - start, &details);
        } else
                zap_page_range(vma, start, end - start, NULL);
@@ -67535,7 +70126,7 @@ diff -urNp linux-3.1.3/mm/madvise.c linux-3.1.3/mm/madvise.c
        return 0;
  }
  
-@@ -376,6 +407,16 @@ SYSCALL_DEFINE3(madvise, unsigned long, 
+@@ -376,6 +407,16 @@ SYSCALL_DEFINE3(madvise, unsigned long, start, size_t, len_in, int, behavior)
        if (end < start)
                goto out;
  
@@ -67552,10 +70143,96 @@ diff -urNp linux-3.1.3/mm/madvise.c linux-3.1.3/mm/madvise.c
        error = 0;
        if (end == start)
                goto out;
-diff -urNp linux-3.1.3/mm/memory.c linux-3.1.3/mm/memory.c
---- linux-3.1.3/mm/memory.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/memory.c    2011-11-16 18:39:08.000000000 -0500
-@@ -457,8 +457,12 @@ static inline void free_pmd_range(struct
+diff --git a/mm/memory-failure.c b/mm/memory-failure.c
+index 2b43ba0..fc09657 100644
+--- a/mm/memory-failure.c
++++ b/mm/memory-failure.c
+@@ -60,7 +60,7 @@ int sysctl_memory_failure_early_kill __read_mostly = 0;
+ int sysctl_memory_failure_recovery __read_mostly = 1;
+-atomic_long_t mce_bad_pages __read_mostly = ATOMIC_LONG_INIT(0);
++atomic_long_unchecked_t mce_bad_pages __read_mostly = ATOMIC_LONG_INIT(0);
+ #if defined(CONFIG_HWPOISON_INJECT) || defined(CONFIG_HWPOISON_INJECT_MODULE)
+@@ -201,7 +201,7 @@ static int kill_proc_ao(struct task_struct *t, unsigned long addr, int trapno,
+       si.si_signo = SIGBUS;
+       si.si_errno = 0;
+       si.si_code = BUS_MCEERR_AO;
+-      si.si_addr = (void *)addr;
++      si.si_addr = (void __user *)addr;
+ #ifdef __ARCH_SI_TRAPNO
+       si.si_trapno = trapno;
+ #endif
+@@ -1009,7 +1009,7 @@ int __memory_failure(unsigned long pfn, int trapno, int flags)
+       }
+       nr_pages = 1 << compound_trans_order(hpage);
+-      atomic_long_add(nr_pages, &mce_bad_pages);
++      atomic_long_add_unchecked(nr_pages, &mce_bad_pages);
+       /*
+        * We need/can do nothing about count=0 pages.
+@@ -1039,7 +1039,7 @@ int __memory_failure(unsigned long pfn, int trapno, int flags)
+                       if (!PageHWPoison(hpage)
+                           || (hwpoison_filter(p) && TestClearPageHWPoison(p))
+                           || (p != hpage && TestSetPageHWPoison(hpage))) {
+-                              atomic_long_sub(nr_pages, &mce_bad_pages);
++                              atomic_long_sub_unchecked(nr_pages, &mce_bad_pages);
+                               return 0;
+                       }
+                       set_page_hwpoison_huge_page(hpage);
+@@ -1097,7 +1097,7 @@ int __memory_failure(unsigned long pfn, int trapno, int flags)
+       }
+       if (hwpoison_filter(p)) {
+               if (TestClearPageHWPoison(p))
+-                      atomic_long_sub(nr_pages, &mce_bad_pages);
++                      atomic_long_sub_unchecked(nr_pages, &mce_bad_pages);
+               unlock_page(hpage);
+               put_page(hpage);
+               return 0;
+@@ -1314,7 +1314,7 @@ int unpoison_memory(unsigned long pfn)
+                       return 0;
+               }
+               if (TestClearPageHWPoison(p))
+-                      atomic_long_sub(nr_pages, &mce_bad_pages);
++                      atomic_long_sub_unchecked(nr_pages, &mce_bad_pages);
+               pr_info("MCE: Software-unpoisoned free page %#lx\n", pfn);
+               return 0;
+       }
+@@ -1328,7 +1328,7 @@ int unpoison_memory(unsigned long pfn)
+        */
+       if (TestClearPageHWPoison(page)) {
+               pr_info("MCE: Software-unpoisoned page %#lx\n", pfn);
+-              atomic_long_sub(nr_pages, &mce_bad_pages);
++              atomic_long_sub_unchecked(nr_pages, &mce_bad_pages);
+               freeit = 1;
+               if (PageHuge(page))
+                       clear_page_hwpoison_huge_page(page);
+@@ -1441,7 +1441,7 @@ static int soft_offline_huge_page(struct page *page, int flags)
+       }
+ done:
+       if (!PageHWPoison(hpage))
+-              atomic_long_add(1 << compound_trans_order(hpage), &mce_bad_pages);
++              atomic_long_add_unchecked(1 << compound_trans_order(hpage), &mce_bad_pages);
+       set_page_hwpoison_huge_page(hpage);
+       dequeue_hwpoisoned_huge_page(hpage);
+       /* keep elevated page count for bad page */
+@@ -1572,7 +1572,7 @@ int soft_offline_page(struct page *page, int flags)
+               return ret;
+ done:
+-      atomic_long_add(1, &mce_bad_pages);
++      atomic_long_add_unchecked(1, &mce_bad_pages);
+       SetPageHWPoison(page);
+       /* keep elevated page count for bad page */
+       return ret;
+diff --git a/mm/memory.c b/mm/memory.c
+index b2b8731..6080174 100644
+--- a/mm/memory.c
++++ b/mm/memory.c
+@@ -457,8 +457,12 @@ static inline void free_pmd_range(struct mmu_gather *tlb, pud_t *pud,
                return;
  
        pmd = pmd_offset(pud, start);
@@ -67568,7 +70245,7 @@ diff -urNp linux-3.1.3/mm/memory.c linux-3.1.3/mm/memory.c
  }
  
  static inline void free_pud_range(struct mmu_gather *tlb, pgd_t *pgd,
-@@ -489,9 +493,12 @@ static inline void free_pud_range(struct
+@@ -489,9 +493,12 @@ static inline void free_pud_range(struct mmu_gather *tlb, pgd_t *pgd,
        if (end - 1 > ceiling - 1)
                return;
  
@@ -67594,7 +70271,7 @@ diff -urNp linux-3.1.3/mm/memory.c linux-3.1.3/mm/memory.c
  /**
   * __get_user_pages() - pin user pages in memory
   * @tsk:      task_struct of target task
-@@ -1644,10 +1645,10 @@ int __get_user_pages(struct task_struct 
+@@ -1644,10 +1645,10 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
                        (VM_MAYREAD | VM_MAYWRITE) : (VM_READ | VM_WRITE);
        i = 0;
  
@@ -67607,7 +70284,7 @@ diff -urNp linux-3.1.3/mm/memory.c linux-3.1.3/mm/memory.c
                if (!vma && in_gate_area(mm, start)) {
                        unsigned long pg = start & PAGE_MASK;
                        pgd_t *pgd;
-@@ -1695,7 +1696,7 @@ int __get_user_pages(struct task_struct 
+@@ -1695,7 +1696,7 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
                        goto next_page;
                }
  
@@ -67616,7 +70293,7 @@ diff -urNp linux-3.1.3/mm/memory.c linux-3.1.3/mm/memory.c
                    (vma->vm_flags & (VM_IO | VM_PFNMAP)) ||
                    !(vm_flags & vma->vm_flags))
                        return i ? : -EFAULT;
-@@ -1722,11 +1723,6 @@ int __get_user_pages(struct task_struct 
+@@ -1722,11 +1723,6 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
                                int ret;
                                unsigned int fault_flags = 0;
  
@@ -67637,7 +70314,7 @@ diff -urNp linux-3.1.3/mm/memory.c linux-3.1.3/mm/memory.c
        return i;
  }
  EXPORT_SYMBOL(__get_user_pages);
-@@ -2007,6 +2003,10 @@ static int insert_page(struct vm_area_st
+@@ -2007,6 +2003,10 @@ static int insert_page(struct vm_area_struct *vma, unsigned long addr,
        page_add_file_rmap(page);
        set_pte_at(mm, addr, pte, mk_pte(page, prot));
  
@@ -67671,7 +70348,7 @@ diff -urNp linux-3.1.3/mm/memory.c linux-3.1.3/mm/memory.c
        vma->vm_flags |= VM_INSERTPAGE;
        return insert_page(vma, addr, page, vma->vm_page_prot);
  }
-@@ -2130,6 +2142,7 @@ int vm_insert_mixed(struct vm_area_struc
+@@ -2130,6 +2142,7 @@ int vm_insert_mixed(struct vm_area_struct *vma, unsigned long addr,
                        unsigned long pfn)
  {
        BUG_ON(!(vma->vm_flags & VM_MIXEDMAP));
@@ -67679,7 +70356,7 @@ diff -urNp linux-3.1.3/mm/memory.c linux-3.1.3/mm/memory.c
  
        if (addr < vma->vm_start || addr >= vma->vm_end)
                return -EFAULT;
-@@ -2445,6 +2458,186 @@ static inline void cow_user_page(struct 
+@@ -2445,6 +2458,186 @@ static inline void cow_user_page(struct page *dst, struct page *src, unsigned lo
                copy_user_highpage(dst, src, va, vma);
  }
  
@@ -67890,7 +70567,7 @@ diff -urNp linux-3.1.3/mm/memory.c linux-3.1.3/mm/memory.c
                /* Free the old page.. */
                new_page = old_page;
                ret |= VM_FAULT_WRITE;
-@@ -2986,6 +3189,11 @@ static int do_swap_page(struct mm_struct
+@@ -2986,6 +3189,11 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma,
        swap_free(entry);
        if (vm_swap_full() || (vma->vm_flags & VM_LOCKED) || PageMlocked(page))
                try_to_free_swap(page);
@@ -67902,7 +70579,7 @@ diff -urNp linux-3.1.3/mm/memory.c linux-3.1.3/mm/memory.c
        unlock_page(page);
        if (swapcache) {
                /*
-@@ -3009,6 +3217,11 @@ static int do_swap_page(struct mm_struct
+@@ -3009,6 +3217,11 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma,
  
        /* No need to invalidate - it was non-present before */
        update_mmu_cache(vma, address, page_table);
@@ -67955,7 +70632,7 @@ diff -urNp linux-3.1.3/mm/memory.c linux-3.1.3/mm/memory.c
   * We enter with non-exclusive mmap_sem (to exclude vma changes,
   * but allow concurrent faults), and pte mapped but not yet locked.
   * We return with mmap_sem still held, but pte unmapped and unlocked.
-@@ -3070,27 +3249,23 @@ static int do_anonymous_page(struct mm_s
+@@ -3070,27 +3249,23 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
                unsigned long address, pte_t *page_table, pmd_t *pmd,
                unsigned int flags)
  {
@@ -67988,7 +70665,7 @@ diff -urNp linux-3.1.3/mm/memory.c linux-3.1.3/mm/memory.c
        if (unlikely(anon_vma_prepare(vma)))
                goto oom;
        page = alloc_zeroed_user_highpage_movable(vma, address);
-@@ -3109,6 +3284,11 @@ static int do_anonymous_page(struct mm_s
+@@ -3109,6 +3284,11 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
        if (!pte_none(*page_table))
                goto release;
  
@@ -68013,7 +70690,7 @@ diff -urNp linux-3.1.3/mm/memory.c linux-3.1.3/mm/memory.c
  unlock:
        pte_unmap_unlock(page_table, ptl);
        return 0;
-@@ -3259,6 +3445,12 @@ static int __do_fault(struct mm_struct *
+@@ -3259,6 +3445,12 @@ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma,
         */
        /* Only go through if we didn't race with anybody else... */
        if (likely(pte_same(*page_table, orig_pte))) {
@@ -68026,7 +70703,7 @@ diff -urNp linux-3.1.3/mm/memory.c linux-3.1.3/mm/memory.c
                flush_icache_page(vma, page);
                entry = mk_pte(page, vma->vm_page_prot);
                if (flags & FAULT_FLAG_WRITE)
-@@ -3278,6 +3470,14 @@ static int __do_fault(struct mm_struct *
+@@ -3278,6 +3470,14 @@ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma,
  
                /* no need to invalidate: a not-present page won't be cached */
                update_mmu_cache(vma, address, page_table);
@@ -68041,7 +70718,7 @@ diff -urNp linux-3.1.3/mm/memory.c linux-3.1.3/mm/memory.c
        } else {
                if (cow_page)
                        mem_cgroup_uncharge_page(cow_page);
-@@ -3431,6 +3631,12 @@ int handle_pte_fault(struct mm_struct *m
+@@ -3431,6 +3631,12 @@ int handle_pte_fault(struct mm_struct *mm,
                if (flags & FAULT_FLAG_WRITE)
                        flush_tlb_fix_spurious_fault(vma, address);
        }
@@ -68054,7 +70731,7 @@ diff -urNp linux-3.1.3/mm/memory.c linux-3.1.3/mm/memory.c
  unlock:
        pte_unmap_unlock(pte, ptl);
        return 0;
-@@ -3447,6 +3653,10 @@ int handle_mm_fault(struct mm_struct *mm
+@@ -3447,6 +3653,10 @@ int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma,
        pmd_t *pmd;
        pte_t *pte;
  
@@ -68065,7 +70742,7 @@ diff -urNp linux-3.1.3/mm/memory.c linux-3.1.3/mm/memory.c
        __set_current_state(TASK_RUNNING);
  
        count_vm_event(PGFAULT);
-@@ -3458,6 +3668,34 @@ int handle_mm_fault(struct mm_struct *mm
+@@ -3458,6 +3668,34 @@ int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma,
        if (unlikely(is_vm_hugetlb_page(vma)))
                return hugetlb_fault(mm, vma, address, flags);
  
@@ -68100,7 +70777,7 @@ diff -urNp linux-3.1.3/mm/memory.c linux-3.1.3/mm/memory.c
        pgd = pgd_offset(mm, address);
        pud = pud_alloc(mm, pgd, address);
        if (!pud)
-@@ -3487,7 +3725,7 @@ int handle_mm_fault(struct mm_struct *mm
+@@ -3487,7 +3725,7 @@ int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma,
         * run pte_offset_map on the pmd, if an huge pmd could
         * materialize from under us from a different thread.
         */
@@ -68118,94 +70795,11 @@ diff -urNp linux-3.1.3/mm/memory.c linux-3.1.3/mm/memory.c
        /*
         * Make sure the vDSO gets into every core dump.
         * Dumping its contents makes post-mortem fully interpretable later
-diff -urNp linux-3.1.3/mm/memory-failure.c linux-3.1.3/mm/memory-failure.c
---- linux-3.1.3/mm/memory-failure.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/memory-failure.c    2011-11-16 18:39:08.000000000 -0500
-@@ -60,7 +60,7 @@ int sysctl_memory_failure_early_kill __r
- int sysctl_memory_failure_recovery __read_mostly = 1;
--atomic_long_t mce_bad_pages __read_mostly = ATOMIC_LONG_INIT(0);
-+atomic_long_unchecked_t mce_bad_pages __read_mostly = ATOMIC_LONG_INIT(0);
- #if defined(CONFIG_HWPOISON_INJECT) || defined(CONFIG_HWPOISON_INJECT_MODULE)
-@@ -201,7 +201,7 @@ static int kill_proc_ao(struct task_stru
-       si.si_signo = SIGBUS;
-       si.si_errno = 0;
-       si.si_code = BUS_MCEERR_AO;
--      si.si_addr = (void *)addr;
-+      si.si_addr = (void __user *)addr;
- #ifdef __ARCH_SI_TRAPNO
-       si.si_trapno = trapno;
- #endif
-@@ -1009,7 +1009,7 @@ int __memory_failure(unsigned long pfn, 
-       }
-       nr_pages = 1 << compound_trans_order(hpage);
--      atomic_long_add(nr_pages, &mce_bad_pages);
-+      atomic_long_add_unchecked(nr_pages, &mce_bad_pages);
-       /*
-        * We need/can do nothing about count=0 pages.
-@@ -1039,7 +1039,7 @@ int __memory_failure(unsigned long pfn, 
-                       if (!PageHWPoison(hpage)
-                           || (hwpoison_filter(p) && TestClearPageHWPoison(p))
-                           || (p != hpage && TestSetPageHWPoison(hpage))) {
--                              atomic_long_sub(nr_pages, &mce_bad_pages);
-+                              atomic_long_sub_unchecked(nr_pages, &mce_bad_pages);
-                               return 0;
-                       }
-                       set_page_hwpoison_huge_page(hpage);
-@@ -1097,7 +1097,7 @@ int __memory_failure(unsigned long pfn, 
-       }
-       if (hwpoison_filter(p)) {
-               if (TestClearPageHWPoison(p))
--                      atomic_long_sub(nr_pages, &mce_bad_pages);
-+                      atomic_long_sub_unchecked(nr_pages, &mce_bad_pages);
-               unlock_page(hpage);
-               put_page(hpage);
-               return 0;
-@@ -1314,7 +1314,7 @@ int unpoison_memory(unsigned long pfn)
-                       return 0;
-               }
-               if (TestClearPageHWPoison(p))
--                      atomic_long_sub(nr_pages, &mce_bad_pages);
-+                      atomic_long_sub_unchecked(nr_pages, &mce_bad_pages);
-               pr_info("MCE: Software-unpoisoned free page %#lx\n", pfn);
-               return 0;
-       }
-@@ -1328,7 +1328,7 @@ int unpoison_memory(unsigned long pfn)
-        */
-       if (TestClearPageHWPoison(page)) {
-               pr_info("MCE: Software-unpoisoned page %#lx\n", pfn);
--              atomic_long_sub(nr_pages, &mce_bad_pages);
-+              atomic_long_sub_unchecked(nr_pages, &mce_bad_pages);
-               freeit = 1;
-               if (PageHuge(page))
-                       clear_page_hwpoison_huge_page(page);
-@@ -1441,7 +1441,7 @@ static int soft_offline_huge_page(struct
-       }
- done:
-       if (!PageHWPoison(hpage))
--              atomic_long_add(1 << compound_trans_order(hpage), &mce_bad_pages);
-+              atomic_long_add_unchecked(1 << compound_trans_order(hpage), &mce_bad_pages);
-       set_page_hwpoison_huge_page(hpage);
-       dequeue_hwpoisoned_huge_page(hpage);
-       /* keep elevated page count for bad page */
-@@ -1572,7 +1572,7 @@ int soft_offline_page(struct page *page,
-               return ret;
- done:
--      atomic_long_add(1, &mce_bad_pages);
-+      atomic_long_add_unchecked(1, &mce_bad_pages);
-       SetPageHWPoison(page);
-       /* keep elevated page count for bad page */
-       return ret;
-diff -urNp linux-3.1.3/mm/mempolicy.c linux-3.1.3/mm/mempolicy.c
---- linux-3.1.3/mm/mempolicy.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/mempolicy.c 2011-11-16 18:40:44.000000000 -0500
-@@ -639,6 +639,10 @@ static int mbind_range(struct mm_struct 
+diff --git a/mm/mempolicy.c b/mm/mempolicy.c
+index 9c51f9f..a9416cf 100644
+--- a/mm/mempolicy.c
++++ b/mm/mempolicy.c
+@@ -639,6 +639,10 @@ static int mbind_range(struct mm_struct *mm, unsigned long start,
        unsigned long vmstart;
        unsigned long vmend;
  
@@ -68216,7 +70810,7 @@ diff -urNp linux-3.1.3/mm/mempolicy.c linux-3.1.3/mm/mempolicy.c
        vma = find_vma_prev(mm, start, &prev);
        if (!vma || vma->vm_start > start)
                return -EFAULT;
-@@ -669,6 +673,16 @@ static int mbind_range(struct mm_struct 
+@@ -669,6 +673,16 @@ static int mbind_range(struct mm_struct *mm, unsigned long start,
                err = policy_vma(vma, new_pol);
                if (err)
                        goto out;
@@ -68233,7 +70827,7 @@ diff -urNp linux-3.1.3/mm/mempolicy.c linux-3.1.3/mm/mempolicy.c
        }
  
   out:
-@@ -1102,6 +1116,17 @@ static long do_mbind(unsigned long start
+@@ -1102,6 +1116,17 @@ static long do_mbind(unsigned long start, unsigned long len,
  
        if (end < start)
                return -EINVAL;
@@ -68251,7 +70845,7 @@ diff -urNp linux-3.1.3/mm/mempolicy.c linux-3.1.3/mm/mempolicy.c
        if (end == start)
                return 0;
  
-@@ -1320,6 +1345,14 @@ SYSCALL_DEFINE4(migrate_pages, pid_t, pi
+@@ -1320,6 +1345,14 @@ SYSCALL_DEFINE4(migrate_pages, pid_t, pid, unsigned long, maxnode,
        if (!mm)
                goto out;
  
@@ -68266,7 +70860,7 @@ diff -urNp linux-3.1.3/mm/mempolicy.c linux-3.1.3/mm/mempolicy.c
        /*
         * Check if this process has the right to modify the specified
         * process. The right exists if the process has administrative
-@@ -1329,8 +1362,7 @@ SYSCALL_DEFINE4(migrate_pages, pid_t, pi
+@@ -1329,8 +1362,7 @@ SYSCALL_DEFINE4(migrate_pages, pid_t, pid, unsigned long, maxnode,
        rcu_read_lock();
        tcred = __task_cred(task);
        if (cred->euid != tcred->suid && cred->euid != tcred->uid &&
@@ -68276,10 +70870,22 @@ diff -urNp linux-3.1.3/mm/mempolicy.c linux-3.1.3/mm/mempolicy.c
                rcu_read_unlock();
                err = -EPERM;
                goto out;
-diff -urNp linux-3.1.3/mm/migrate.c linux-3.1.3/mm/migrate.c
---- linux-3.1.3/mm/migrate.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/migrate.c   2011-11-16 18:40:44.000000000 -0500
-@@ -1124,6 +1124,8 @@ static int do_pages_move(struct mm_struc
+diff --git a/mm/migrate.c b/mm/migrate.c
+index 14d0a6a..0360908 100644
+--- a/mm/migrate.c
++++ b/mm/migrate.c
+@@ -866,9 +866,9 @@ static int unmap_and_move_huge_page(new_page_t get_new_page,
+       if (anon_vma)
+               put_anon_vma(anon_vma);
+-out:
+       unlock_page(hpage);
++out:
+       if (rc != -EAGAIN) {
+               list_del(&hpage->lru);
+               put_page(hpage);
+@@ -1124,6 +1124,8 @@ static int do_pages_move(struct mm_struct *mm, struct task_struct *task,
        unsigned long chunk_start;
        int err;
  
@@ -68288,7 +70894,7 @@ diff -urNp linux-3.1.3/mm/migrate.c linux-3.1.3/mm/migrate.c
        task_nodes = cpuset_mems_allowed(task);
  
        err = -ENOMEM;
-@@ -1308,6 +1310,14 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, 
+@@ -1308,6 +1310,14 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages,
        if (!mm)
                return -EINVAL;
  
@@ -68303,7 +70909,7 @@ diff -urNp linux-3.1.3/mm/migrate.c linux-3.1.3/mm/migrate.c
        /*
         * Check if this process has the right to modify the specified
         * process. The right exists if the process has administrative
-@@ -1317,8 +1327,7 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, 
+@@ -1317,8 +1327,7 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages,
        rcu_read_lock();
        tcred = __task_cred(task);
        if (cred->euid != tcred->suid && cred->euid != tcred->uid &&
@@ -68313,9 +70919,10 @@ diff -urNp linux-3.1.3/mm/migrate.c linux-3.1.3/mm/migrate.c
                rcu_read_unlock();
                err = -EPERM;
                goto out;
-diff -urNp linux-3.1.3/mm/mlock.c linux-3.1.3/mm/mlock.c
---- linux-3.1.3/mm/mlock.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/mlock.c     2011-11-16 18:40:44.000000000 -0500
+diff --git a/mm/mlock.c b/mm/mlock.c
+index 048260c..57f4a4e 100644
+--- a/mm/mlock.c
++++ b/mm/mlock.c
 @@ -13,6 +13,7 @@
  #include <linux/pagemap.h>
  #include <linux/mempolicy.h>
@@ -68324,7 +70931,7 @@ diff -urNp linux-3.1.3/mm/mlock.c linux-3.1.3/mm/mlock.c
  #include <linux/sched.h>
  #include <linux/module.h>
  #include <linux/rmap.h>
-@@ -377,6 +378,9 @@ static int do_mlock(unsigned long start,
+@@ -377,6 +378,9 @@ static int do_mlock(unsigned long start, size_t len, int on)
                return -EINVAL;
        if (end == start)
                return 0;
@@ -68334,7 +70941,7 @@ diff -urNp linux-3.1.3/mm/mlock.c linux-3.1.3/mm/mlock.c
        vma = find_vma_prev(current->mm, start, &prev);
        if (!vma || vma->vm_start > start)
                return -ENOMEM;
-@@ -387,6 +391,11 @@ static int do_mlock(unsigned long start,
+@@ -387,6 +391,11 @@ static int do_mlock(unsigned long start, size_t len, int on)
        for (nstart = start ; ; ) {
                vm_flags_t newflags;
  
@@ -68346,7 +70953,7 @@ diff -urNp linux-3.1.3/mm/mlock.c linux-3.1.3/mm/mlock.c
                /* Here we know that  vma->vm_start <= nstart < vma->vm_end. */
  
                newflags = vma->vm_flags | VM_LOCKED;
-@@ -492,6 +501,7 @@ SYSCALL_DEFINE2(mlock, unsigned long, st
+@@ -492,6 +501,7 @@ SYSCALL_DEFINE2(mlock, unsigned long, start, size_t, len)
        lock_limit >>= PAGE_SHIFT;
  
        /* check against resource limits */
@@ -68354,7 +70961,7 @@ diff -urNp linux-3.1.3/mm/mlock.c linux-3.1.3/mm/mlock.c
        if ((locked <= lock_limit) || capable(CAP_IPC_LOCK))
                error = do_mlock(start, len, 1);
        up_write(&current->mm->mmap_sem);
-@@ -515,17 +525,23 @@ SYSCALL_DEFINE2(munlock, unsigned long, 
+@@ -515,17 +525,23 @@ SYSCALL_DEFINE2(munlock, unsigned long, start, size_t, len)
  static int do_mlockall(int flags)
  {
        struct vm_area_struct * vma, * prev = NULL;
@@ -68389,9 +70996,10 @@ diff -urNp linux-3.1.3/mm/mlock.c linux-3.1.3/mm/mlock.c
        if (!(flags & MCL_CURRENT) || (current->mm->total_vm <= lock_limit) ||
            capable(CAP_IPC_LOCK))
                ret = do_mlockall(flags);
-diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
---- linux-3.1.3/mm/mmap.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/mmap.c      2011-11-16 18:40:44.000000000 -0500
+diff --git a/mm/mmap.c b/mm/mmap.c
+index a65efd4..17d61ff 100644
+--- a/mm/mmap.c
++++ b/mm/mmap.c
 @@ -46,6 +46,16 @@
  #define arch_rebalance_pgtables(addr, len)            (addr)
  #endif
@@ -68409,7 +71017,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
  static void unmap_region(struct mm_struct *mm,
                struct vm_area_struct *vma, struct vm_area_struct *prev,
                unsigned long start, unsigned long end);
-@@ -71,22 +81,32 @@ static void unmap_region(struct mm_struc
+@@ -71,22 +81,32 @@ static void unmap_region(struct mm_struct *mm,
   *            x: (no) no      x: (no) yes     x: (no) yes     x: (yes) yes
   *
   */
@@ -68445,7 +71053,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
  /*
   * Make sure vm_committed_as in one cacheline and not cacheline shared with
   * other variables. It can be updated by several CPUs frequently.
-@@ -228,6 +248,7 @@ static struct vm_area_struct *remove_vma
+@@ -228,6 +248,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma)
        struct vm_area_struct *next = vma->vm_next;
  
        might_sleep();
@@ -68487,7 +71095,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
        if (is_mergeable_vma(vma, file, vm_flags) &&
            is_mergeable_anon_vma(anon_vma, vma->anon_vma, vma)) {
                pgoff_t vm_pglen;
-@@ -750,13 +784,20 @@ can_vma_merge_after(struct vm_area_struc
+@@ -750,13 +784,20 @@ can_vma_merge_after(struct vm_area_struct *vma, unsigned long vm_flags,
  struct vm_area_struct *vma_merge(struct mm_struct *mm,
                        struct vm_area_struct *prev, unsigned long addr,
                        unsigned long end, unsigned long vm_flags,
@@ -68509,7 +71117,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
        /*
         * We later require that vma->vm_flags == vm_flags,
         * so this tests vma->vm_flags & VM_SPECIAL, too.
-@@ -772,6 +813,15 @@ struct vm_area_struct *vma_merge(struct 
+@@ -772,6 +813,15 @@ struct vm_area_struct *vma_merge(struct mm_struct *mm,
        if (next && next->vm_end == end)                /* cases 6, 7, 8 */
                next = next->vm_next;
  
@@ -68525,7 +71133,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
        /*
         * Can it merge with the predecessor?
         */
-@@ -791,9 +841,24 @@ struct vm_area_struct *vma_merge(struct 
+@@ -791,9 +841,24 @@ struct vm_area_struct *vma_merge(struct mm_struct *mm,
                                                        /* cases 1, 6 */
                        err = vma_adjust(prev, prev->vm_start,
                                next->vm_end, prev->vm_pgoff, NULL);
@@ -68551,7 +71159,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
                if (err)
                        return NULL;
                khugepaged_enter_vma_merge(prev);
-@@ -807,12 +872,27 @@ struct vm_area_struct *vma_merge(struct 
+@@ -807,12 +872,27 @@ struct vm_area_struct *vma_merge(struct mm_struct *mm,
                        mpol_equal(policy, vma_policy(next)) &&
                        can_vma_merge_before(next, vm_flags,
                                        anon_vma, file, pgoff+pglen)) {
@@ -68597,7 +71205,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
                mm->stack_vm += pages;
        if (flags & (VM_RESERVED|VM_IO))
                mm->reserved_vm += pages;
-@@ -955,7 +1032,7 @@ unsigned long do_mmap_pgoff(struct file 
+@@ -955,7 +1032,7 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
         * (the exception is when the underlying filesystem is noexec
         *  mounted, in which case we dont add PROT_EXEC.)
         */
@@ -68606,7 +71214,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
                if (!(file && (file->f_path.mnt->mnt_flags & MNT_NOEXEC)))
                        prot |= PROT_EXEC;
  
-@@ -981,7 +1058,7 @@ unsigned long do_mmap_pgoff(struct file 
+@@ -981,7 +1058,7 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
        /* Obtain the address to map to. we verify (or select) it and ensure
         * that it represents a valid section of the address space.
         */
@@ -68615,7 +71223,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
        if (addr & ~PAGE_MASK)
                return addr;
  
-@@ -992,6 +1069,36 @@ unsigned long do_mmap_pgoff(struct file 
+@@ -992,6 +1069,36 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
        vm_flags = calc_vm_prot_bits(prot) | calc_vm_flag_bits(flags) |
                        mm->def_flags | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC;
  
@@ -68652,7 +71260,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
        if (flags & MAP_LOCKED)
                if (!can_do_mlock())
                        return -EPERM;
-@@ -1003,6 +1110,7 @@ unsigned long do_mmap_pgoff(struct file 
+@@ -1003,6 +1110,7 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
                locked += mm->locked_vm;
                lock_limit = rlimit(RLIMIT_MEMLOCK);
                lock_limit >>= PAGE_SHIFT;
@@ -68660,7 +71268,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
                if (locked > lock_limit && !capable(CAP_IPC_LOCK))
                        return -EAGAIN;
        }
-@@ -1073,6 +1181,9 @@ unsigned long do_mmap_pgoff(struct file 
+@@ -1073,6 +1181,9 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
        if (error)
                return error;
  
@@ -68670,7 +71278,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
        return mmap_region(file, addr, len, flags, vm_flags, pgoff);
  }
  EXPORT_SYMBOL(do_mmap_pgoff);
-@@ -1153,7 +1264,7 @@ int vma_wants_writenotify(struct vm_area
+@@ -1153,7 +1264,7 @@ int vma_wants_writenotify(struct vm_area_struct *vma)
        vm_flags_t vm_flags = vma->vm_flags;
  
        /* If it was private or non-writable, the write bit is already clear */
@@ -68679,7 +71287,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
                return 0;
  
        /* The backer wishes to know when pages are first written to? */
-@@ -1202,14 +1313,24 @@ unsigned long mmap_region(struct file *f
+@@ -1202,14 +1313,24 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
        unsigned long charged = 0;
        struct inode *inode =  file ? file->f_path.dentry->d_inode : NULL;
  
@@ -68821,7 +71429,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
  /* Get an address range which is currently unmapped.
   * For shmat() with addr=0.
   *
-@@ -1374,18 +1568,23 @@ arch_get_unmapped_area(struct file *filp
+@@ -1374,18 +1568,23 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
        if (flags & MAP_FIXED)
                return addr;
  
@@ -68904,7 +71512,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
                mm->free_area_cache = addr;
                mm->cached_hole_size = ~0UL;
        }
-@@ -1441,7 +1646,7 @@ arch_get_unmapped_area_topdown(struct fi
+@@ -1441,7 +1646,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
  {
        struct vm_area_struct *vma;
        struct mm_struct *mm = current->mm;
@@ -68913,7 +71521,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
  
        /* requested length too big for entire address space */
        if (len > TASK_SIZE)
-@@ -1450,13 +1655,18 @@ arch_get_unmapped_area_topdown(struct fi
+@@ -1450,13 +1655,18 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
        if (flags & MAP_FIXED)
                return addr;
  
@@ -68936,7 +71544,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
        }
  
        /* check if free_area_cache is useful for us */
-@@ -1471,7 +1681,7 @@ arch_get_unmapped_area_topdown(struct fi
+@@ -1471,7 +1681,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
        /* make sure it can fit in the remaining address space */
        if (addr > len) {
                vma = find_vma(mm, addr-len);
@@ -68945,7 +71553,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
                        /* remember the address as a hint for next time */
                        return (mm->free_area_cache = addr-len);
        }
-@@ -1488,7 +1698,7 @@ arch_get_unmapped_area_topdown(struct fi
+@@ -1488,7 +1698,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
                 * return with success:
                 */
                vma = find_vma(mm, addr);
@@ -68954,7 +71562,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
                        /* remember the address as a hint for next time */
                        return (mm->free_area_cache = addr);
  
-@@ -1497,8 +1707,8 @@ arch_get_unmapped_area_topdown(struct fi
+@@ -1497,8 +1707,8 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
                        mm->cached_hole_size = vma->vm_start - addr;
  
                /* try just below the current vma->vm_start */
@@ -69002,7 +71610,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
        /*
         * Is this a new hole at the highest possible address?
         */
-@@ -1529,8 +1753,10 @@ void arch_unmap_area_topdown(struct mm_s
+@@ -1529,8 +1753,10 @@ void arch_unmap_area_topdown(struct mm_struct *mm, unsigned long addr)
                mm->free_area_cache = addr;
  
        /* dont allow allocations above current base */
@@ -69043,7 +71651,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
  /*
   * Verify that the stack growth is acceptable and
   * update accounting. This is shared with both the
-@@ -1654,6 +1902,7 @@ static int acct_stack_growth(struct vm_a
+@@ -1654,6 +1902,7 @@ static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, uns
                return -ENOMEM;
  
        /* Stack limit test */
@@ -69051,7 +71659,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
        if (size > ACCESS_ONCE(rlim[RLIMIT_STACK].rlim_cur))
                return -ENOMEM;
  
-@@ -1664,6 +1913,7 @@ static int acct_stack_growth(struct vm_a
+@@ -1664,6 +1913,7 @@ static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, uns
                locked = mm->locked_vm + grow;
                limit = ACCESS_ONCE(rlim[RLIMIT_MEMLOCK].rlim_cur);
                limit >>= PAGE_SHIFT;
@@ -69059,7 +71667,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
                if (locked > limit && !capable(CAP_IPC_LOCK))
                        return -ENOMEM;
        }
-@@ -1694,37 +1944,48 @@ static int acct_stack_growth(struct vm_a
+@@ -1694,37 +1944,48 @@ static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, uns
   * PA-RISC uses this for its stack; IA64 for its Register Backing Store.
   * vma is the last one with address > vma->vm_end.  Have to extend vma.
   */
@@ -69117,7 +71725,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
                unsigned long size, grow;
  
                size = address - vma->vm_start;
-@@ -1739,6 +2000,8 @@ int expand_upwards(struct vm_area_struct
+@@ -1739,6 +2000,8 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address)
                        }
                }
        }
@@ -69126,7 +71734,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
        vma_unlock_anon_vma(vma);
        khugepaged_enter_vma_merge(vma);
        return error;
-@@ -1752,6 +2015,8 @@ int expand_downwards(struct vm_area_stru
+@@ -1752,6 +2015,8 @@ int expand_downwards(struct vm_area_struct *vma,
                                   unsigned long address)
  {
        int error;
@@ -69135,7 +71743,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
  
        /*
         * We must make sure the anon_vma is allocated
-@@ -1765,6 +2030,15 @@ int expand_downwards(struct vm_area_stru
+@@ -1765,6 +2030,15 @@ int expand_downwards(struct vm_area_struct *vma,
        if (error)
                return error;
  
@@ -69151,7 +71759,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
        vma_lock_anon_vma(vma);
  
        /*
-@@ -1774,9 +2048,17 @@ int expand_downwards(struct vm_area_stru
+@@ -1774,9 +2048,17 @@ int expand_downwards(struct vm_area_struct *vma,
         */
  
        /* Somebody else might have raced and expanded it already */
@@ -69170,7 +71778,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
                size = vma->vm_end - address;
                grow = (vma->vm_start - address) >> PAGE_SHIFT;
  
-@@ -1786,11 +2068,22 @@ int expand_downwards(struct vm_area_stru
+@@ -1786,11 +2068,22 @@ int expand_downwards(struct vm_area_struct *vma,
                        if (!error) {
                                vma->vm_start = address;
                                vma->vm_pgoff -= grow;
@@ -69193,7 +71801,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
        khugepaged_enter_vma_merge(vma);
        return error;
  }
-@@ -1860,6 +2153,13 @@ static void remove_vma_list(struct mm_st
+@@ -1860,6 +2153,13 @@ static void remove_vma_list(struct mm_struct *mm, struct vm_area_struct *vma)
        do {
                long nrpages = vma_pages(vma);
  
@@ -69207,7 +71815,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
                mm->total_vm -= nrpages;
                vm_stat_account(mm, vma->vm_flags, vma->vm_file, -nrpages);
                vma = remove_vma(vma);
-@@ -1905,6 +2205,16 @@ detach_vmas_to_be_unmapped(struct mm_str
+@@ -1905,6 +2205,16 @@ detach_vmas_to_be_unmapped(struct mm_struct *mm, struct vm_area_struct *vma,
        insertion_point = (prev ? &prev->vm_next : &mm->mmap);
        vma->vm_prev = NULL;
        do {
@@ -69224,7 +71832,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
                rb_erase(&vma->vm_rb, &mm->mm_rb);
                mm->map_count--;
                tail_vma = vma;
-@@ -1933,14 +2243,33 @@ static int __split_vma(struct mm_struct 
+@@ -1933,14 +2243,33 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma,
        struct vm_area_struct *new;
        int err = -ENOMEM;
  
@@ -69258,7 +71866,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
        /* most fields are the same, copy all, and then fixup */
        *new = *vma;
  
-@@ -1953,6 +2282,22 @@ static int __split_vma(struct mm_struct 
+@@ -1953,6 +2282,22 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma,
                new->vm_pgoff += ((addr - vma->vm_start) >> PAGE_SHIFT);
        }
  
@@ -69281,7 +71889,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
        pol = mpol_dup(vma_policy(vma));
        if (IS_ERR(pol)) {
                err = PTR_ERR(pol);
-@@ -1978,6 +2323,42 @@ static int __split_vma(struct mm_struct 
+@@ -1978,6 +2323,42 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma,
        else
                err = vma_adjust(vma, vma->vm_start, addr, vma->vm_pgoff, new);
  
@@ -69324,7 +71932,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
        /* Success. */
        if (!err)
                return 0;
-@@ -1990,10 +2371,18 @@ static int __split_vma(struct mm_struct 
+@@ -1990,10 +2371,18 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma,
                        removed_exe_file_vma(mm);
                fput(new->vm_file);
        }
@@ -69344,7 +71952,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
        kmem_cache_free(vm_area_cachep, new);
   out_err:
        return err;
-@@ -2006,6 +2395,15 @@ static int __split_vma(struct mm_struct 
+@@ -2006,6 +2395,15 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma,
  int split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
              unsigned long addr, int new_below)
  {
@@ -69360,7 +71968,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
        if (mm->map_count >= sysctl_max_map_count)
                return -ENOMEM;
  
-@@ -2017,11 +2415,30 @@ int split_vma(struct mm_struct *mm, stru
+@@ -2017,11 +2415,30 @@ int split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
   * work.  This now handles partial unmappings.
   * Jeremy Fitzhardinge <jeremy@goop.org>
   */
@@ -69391,7 +71999,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
        if ((start & ~PAGE_MASK) || start > TASK_SIZE || len > TASK_SIZE-start)
                return -EINVAL;
  
-@@ -2096,6 +2513,8 @@ int do_munmap(struct mm_struct *mm, unsi
+@@ -2096,6 +2513,8 @@ int do_munmap(struct mm_struct *mm, unsigned long start, size_t len)
        /* Fix up all other VM information */
        remove_vma_list(mm, vma);
  
@@ -69400,7 +72008,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
        return 0;
  }
  
-@@ -2108,22 +2527,18 @@ SYSCALL_DEFINE2(munmap, unsigned long, a
+@@ -2108,22 +2527,18 @@ SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len)
  
        profile_munmap(addr);
  
@@ -69429,7 +72037,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
  /*
   *  this is really a simplified "do_mmap".  it only handles
   *  anonymous maps.  eventually we may be able to do some
-@@ -2137,6 +2552,7 @@ unsigned long do_brk(unsigned long addr,
+@@ -2137,6 +2552,7 @@ unsigned long do_brk(unsigned long addr, unsigned long len)
        struct rb_node ** rb_link, * rb_parent;
        pgoff_t pgoff = addr >> PAGE_SHIFT;
        int error;
@@ -69437,7 +72045,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
  
        len = PAGE_ALIGN(len);
        if (!len)
-@@ -2148,16 +2564,30 @@ unsigned long do_brk(unsigned long addr,
+@@ -2148,16 +2564,30 @@ unsigned long do_brk(unsigned long addr, unsigned long len)
  
        flags = VM_DATA_DEFAULT_FLAGS | VM_ACCOUNT | mm->def_flags;
  
@@ -69469,7 +72077,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
                locked += mm->locked_vm;
                lock_limit = rlimit(RLIMIT_MEMLOCK);
                lock_limit >>= PAGE_SHIFT;
-@@ -2174,22 +2604,22 @@ unsigned long do_brk(unsigned long addr,
+@@ -2174,22 +2604,22 @@ unsigned long do_brk(unsigned long addr, unsigned long len)
        /*
         * Clear old maps.  this also does some error checking for us
         */
@@ -69496,7 +72104,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
                return -ENOMEM;
  
        /* Can we just expand an old private anonymous mapping? */
-@@ -2203,7 +2633,7 @@ unsigned long do_brk(unsigned long addr,
+@@ -2203,7 +2633,7 @@ unsigned long do_brk(unsigned long addr, unsigned long len)
         */
        vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL);
        if (!vma) {
@@ -69505,7 +72113,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
                return -ENOMEM;
        }
  
-@@ -2217,11 +2647,12 @@ unsigned long do_brk(unsigned long addr,
+@@ -2217,11 +2647,12 @@ unsigned long do_brk(unsigned long addr, unsigned long len)
        vma_link(mm, vma, prev, rb_link, rb_parent);
  out:
        perf_event_mmap(vma);
@@ -69532,7 +72140,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
  
        BUG_ON(mm->nr_ptes > (FIRST_USER_ADDRESS+PMD_SIZE-1)>>PMD_SHIFT);
  }
-@@ -2283,6 +2716,13 @@ int insert_vm_struct(struct mm_struct * 
+@@ -2283,6 +2716,13 @@ int insert_vm_struct(struct mm_struct * mm, struct vm_area_struct * vma)
        struct vm_area_struct * __vma, * prev;
        struct rb_node ** rb_link, * rb_parent;
  
@@ -69546,7 +72154,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
        /*
         * The vm_pgoff of a purely anonymous vma should be irrelevant
         * until its first write fault, when page's anon_vma and index
-@@ -2305,7 +2745,22 @@ int insert_vm_struct(struct mm_struct * 
+@@ -2305,7 +2745,22 @@ int insert_vm_struct(struct mm_struct * mm, struct vm_area_struct * vma)
        if ((vma->vm_flags & VM_ACCOUNT) &&
             security_vm_enough_memory_mm(mm, vma_pages(vma)))
                return -ENOMEM;
@@ -69569,7 +72177,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
        return 0;
  }
  
-@@ -2323,6 +2778,8 @@ struct vm_area_struct *copy_vma(struct v
+@@ -2323,6 +2778,8 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
        struct rb_node **rb_link, *rb_parent;
        struct mempolicy *pol;
  
@@ -69578,7 +72186,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
        /*
         * If anonymous vma has not yet been faulted, update new pgoff
         * to match new location, to increase its chance of merging.
-@@ -2373,6 +2830,39 @@ struct vm_area_struct *copy_vma(struct v
+@@ -2373,6 +2830,39 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
        return NULL;
  }
  
@@ -69618,7 +72226,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
  /*
   * Return true if the calling process may expand its vm space by the passed
   * number of pages
-@@ -2383,7 +2873,7 @@ int may_expand_vm(struct mm_struct *mm, 
+@@ -2383,7 +2873,7 @@ int may_expand_vm(struct mm_struct *mm, unsigned long npages)
        unsigned long lim;
  
        lim = rlimit(RLIMIT_AS) >> PAGE_SHIFT;
@@ -69627,7 +72235,7 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
        if (cur + npages > lim)
                return 0;
        return 1;
-@@ -2454,6 +2944,22 @@ int install_special_mapping(struct mm_st
+@@ -2454,6 +2944,22 @@ int install_special_mapping(struct mm_struct *mm,
        vma->vm_start = addr;
        vma->vm_end = addr + len;
  
@@ -69650,9 +72258,10 @@ diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
        vma->vm_flags = vm_flags | mm->def_flags | VM_DONTEXPAND;
        vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
  
-diff -urNp linux-3.1.3/mm/mprotect.c linux-3.1.3/mm/mprotect.c
---- linux-3.1.3/mm/mprotect.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/mprotect.c  2011-11-16 18:40:44.000000000 -0500
+diff --git a/mm/mprotect.c b/mm/mprotect.c
+index 5a688a2..27e031c 100644
+--- a/mm/mprotect.c
++++ b/mm/mprotect.c
 @@ -23,10 +23,16 @@
  #include <linux/mmu_notifier.h>
  #include <linux/migrate.h>
@@ -69670,7 +72279,7 @@ diff -urNp linux-3.1.3/mm/mprotect.c linux-3.1.3/mm/mprotect.c
  
  #ifndef pgprot_modify
  static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot)
-@@ -141,6 +147,48 @@ static void change_protection(struct vm_
+@@ -141,6 +147,48 @@ static void change_protection(struct vm_area_struct *vma,
        flush_tlb_range(vma, start, end);
  }
  
@@ -69719,7 +72328,7 @@ diff -urNp linux-3.1.3/mm/mprotect.c linux-3.1.3/mm/mprotect.c
  int
  mprotect_fixup(struct vm_area_struct *vma, struct vm_area_struct **pprev,
        unsigned long start, unsigned long end, unsigned long newflags)
-@@ -153,11 +201,29 @@ mprotect_fixup(struct vm_area_struct *vm
+@@ -153,11 +201,29 @@ mprotect_fixup(struct vm_area_struct *vma, struct vm_area_struct **pprev,
        int error;
        int dirty_accountable = 0;
  
@@ -69749,7 +72358,7 @@ diff -urNp linux-3.1.3/mm/mprotect.c linux-3.1.3/mm/mprotect.c
        /*
         * If we make a private mapping writable we increase our commit;
         * but (without finer accounting) cannot reduce our commit if we
-@@ -174,6 +240,42 @@ mprotect_fixup(struct vm_area_struct *vm
+@@ -174,6 +240,42 @@ mprotect_fixup(struct vm_area_struct *vma, struct vm_area_struct **pprev,
                }
        }
  
@@ -69815,7 +72424,7 @@ diff -urNp linux-3.1.3/mm/mprotect.c linux-3.1.3/mm/mprotect.c
  
        if (vma_wants_writenotify(vma)) {
                vma->vm_page_prot = vm_get_page_prot(newflags & ~VM_SHARED);
-@@ -248,6 +362,17 @@ SYSCALL_DEFINE3(mprotect, unsigned long,
+@@ -248,6 +362,17 @@ SYSCALL_DEFINE3(mprotect, unsigned long, start, size_t, len,
        end = start + len;
        if (end <= start)
                return -ENOMEM;
@@ -69833,7 +72442,7 @@ diff -urNp linux-3.1.3/mm/mprotect.c linux-3.1.3/mm/mprotect.c
        if (!arch_validate_prot(prot))
                return -EINVAL;
  
-@@ -255,7 +380,7 @@ SYSCALL_DEFINE3(mprotect, unsigned long,
+@@ -255,7 +380,7 @@ SYSCALL_DEFINE3(mprotect, unsigned long, start, size_t, len,
        /*
         * Does the application expect PROT_READ to imply PROT_EXEC:
         */
@@ -69842,7 +72451,7 @@ diff -urNp linux-3.1.3/mm/mprotect.c linux-3.1.3/mm/mprotect.c
                prot |= PROT_EXEC;
  
        vm_flags = calc_vm_prot_bits(prot);
-@@ -287,6 +412,11 @@ SYSCALL_DEFINE3(mprotect, unsigned long,
+@@ -287,6 +412,11 @@ SYSCALL_DEFINE3(mprotect, unsigned long, start, size_t, len,
        if (start > vma->vm_start)
                prev = vma;
  
@@ -69854,7 +72463,7 @@ diff -urNp linux-3.1.3/mm/mprotect.c linux-3.1.3/mm/mprotect.c
        for (nstart = start ; ; ) {
                unsigned long newflags;
  
-@@ -296,6 +426,14 @@ SYSCALL_DEFINE3(mprotect, unsigned long,
+@@ -296,6 +426,14 @@ SYSCALL_DEFINE3(mprotect, unsigned long, start, size_t, len,
  
                /* newflags >> 4 shift VM_MAY% in place of VM_% */
                if ((newflags & ~(newflags >> 4)) & (VM_READ | VM_WRITE | VM_EXEC)) {
@@ -69869,7 +72478,7 @@ diff -urNp linux-3.1.3/mm/mprotect.c linux-3.1.3/mm/mprotect.c
                        error = -EACCES;
                        goto out;
                }
-@@ -310,6 +448,9 @@ SYSCALL_DEFINE3(mprotect, unsigned long,
+@@ -310,6 +448,9 @@ SYSCALL_DEFINE3(mprotect, unsigned long, start, size_t, len,
                error = mprotect_fixup(vma, &prev, nstart, tmp, newflags);
                if (error)
                        goto out;
@@ -69879,10 +72488,11 @@ diff -urNp linux-3.1.3/mm/mprotect.c linux-3.1.3/mm/mprotect.c
                nstart = tmp;
  
                if (nstart < prev->vm_end)
-diff -urNp linux-3.1.3/mm/mremap.c linux-3.1.3/mm/mremap.c
---- linux-3.1.3/mm/mremap.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/mremap.c    2011-11-16 18:39:08.000000000 -0500
-@@ -113,6 +113,12 @@ static void move_ptes(struct vm_area_str
+diff --git a/mm/mremap.c b/mm/mremap.c
+index 506fa44..ccc0ba9 100644
+--- a/mm/mremap.c
++++ b/mm/mremap.c
+@@ -113,6 +113,12 @@ static void move_ptes(struct vm_area_struct *vma, pmd_t *old_pmd,
                        continue;
                pte = ptep_clear_flush(vma, old_addr, old_pte);
                pte = move_pte(pte, new_vma->vm_page_prot, old_addr, new_addr);
@@ -69895,7 +72505,7 @@ diff -urNp linux-3.1.3/mm/mremap.c linux-3.1.3/mm/mremap.c
                set_pte_at(mm, new_addr, new_pte, pte);
        }
  
-@@ -272,6 +278,11 @@ static struct vm_area_struct *vma_to_res
+@@ -272,6 +278,11 @@ static struct vm_area_struct *vma_to_resize(unsigned long addr,
        if (is_vm_hugetlb_page(vma))
                goto Einval;
  
@@ -69907,7 +72517,7 @@ diff -urNp linux-3.1.3/mm/mremap.c linux-3.1.3/mm/mremap.c
        /* We can't remap across vm area boundaries */
        if (old_len > vma->vm_end - addr)
                goto Efault;
-@@ -328,20 +339,25 @@ static unsigned long mremap_to(unsigned 
+@@ -328,20 +339,25 @@ static unsigned long mremap_to(unsigned long addr,
        unsigned long ret = -EINVAL;
        unsigned long charged = 0;
        unsigned long map_flags;
@@ -69938,7 +72548,7 @@ diff -urNp linux-3.1.3/mm/mremap.c linux-3.1.3/mm/mremap.c
                goto out;
  
        ret = security_file_mmap(NULL, 0, 0, 0, new_addr, 1);
-@@ -413,6 +429,7 @@ unsigned long do_mremap(unsigned long ad
+@@ -413,6 +429,7 @@ unsigned long do_mremap(unsigned long addr,
        struct vm_area_struct *vma;
        unsigned long ret = -EINVAL;
        unsigned long charged = 0;
@@ -69946,7 +72556,7 @@ diff -urNp linux-3.1.3/mm/mremap.c linux-3.1.3/mm/mremap.c
  
        if (flags & ~(MREMAP_FIXED | MREMAP_MAYMOVE))
                goto out;
-@@ -431,6 +448,17 @@ unsigned long do_mremap(unsigned long ad
+@@ -431,6 +448,17 @@ unsigned long do_mremap(unsigned long addr,
        if (!new_len)
                goto out;
  
@@ -69964,7 +72574,7 @@ diff -urNp linux-3.1.3/mm/mremap.c linux-3.1.3/mm/mremap.c
        if (flags & MREMAP_FIXED) {
                if (flags & MREMAP_MAYMOVE)
                        ret = mremap_to(addr, old_len, new_addr, new_len);
-@@ -480,6 +508,7 @@ unsigned long do_mremap(unsigned long ad
+@@ -480,6 +508,7 @@ unsigned long do_mremap(unsigned long addr,
                                                   addr + new_len);
                        }
                        ret = addr;
@@ -69972,7 +72582,7 @@ diff -urNp linux-3.1.3/mm/mremap.c linux-3.1.3/mm/mremap.c
                        goto out;
                }
        }
-@@ -506,7 +535,13 @@ unsigned long do_mremap(unsigned long ad
+@@ -506,7 +535,13 @@ unsigned long do_mremap(unsigned long addr,
                ret = security_file_mmap(NULL, 0, 0, 0, new_addr, 1);
                if (ret)
                        goto out;
@@ -69986,10 +72596,11 @@ diff -urNp linux-3.1.3/mm/mremap.c linux-3.1.3/mm/mremap.c
        }
  out:
        if (ret & ~PAGE_MASK)
-diff -urNp linux-3.1.3/mm/nobootmem.c linux-3.1.3/mm/nobootmem.c
---- linux-3.1.3/mm/nobootmem.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/nobootmem.c 2011-11-16 18:39:08.000000000 -0500
-@@ -110,19 +110,30 @@ static void __init __free_pages_memory(u
+diff --git a/mm/nobootmem.c b/mm/nobootmem.c
+index 6e93dc7..c98df0c 100644
+--- a/mm/nobootmem.c
++++ b/mm/nobootmem.c
+@@ -110,19 +110,30 @@ static void __init __free_pages_memory(unsigned long start, unsigned long end)
  unsigned long __init free_all_memory_core_early(int nodeid)
  {
        int i;
@@ -70022,10 +72633,11 @@ diff -urNp linux-3.1.3/mm/nobootmem.c linux-3.1.3/mm/nobootmem.c
  
        return count;
  }
-diff -urNp linux-3.1.3/mm/nommu.c linux-3.1.3/mm/nommu.c
---- linux-3.1.3/mm/nommu.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/nommu.c     2011-11-16 18:39:08.000000000 -0500
-@@ -62,7 +62,6 @@ int sysctl_overcommit_memory = OVERCOMMI
+diff --git a/mm/nommu.c b/mm/nommu.c
+index 4358032..e79b99f 100644
+--- a/mm/nommu.c
++++ b/mm/nommu.c
+@@ -62,7 +62,6 @@ int sysctl_overcommit_memory = OVERCOMMIT_GUESS; /* heuristic overcommit */
  int sysctl_overcommit_ratio = 50; /* default is 50% */
  int sysctl_max_map_count = DEFAULT_MAX_MAP_COUNT;
  int sysctl_nr_trim_pages = CONFIG_NOMMU_INITIAL_TRIM_EXCESS;
@@ -70033,7 +72645,7 @@ diff -urNp linux-3.1.3/mm/nommu.c linux-3.1.3/mm/nommu.c
  
  atomic_long_t mmap_pages_allocated;
  
-@@ -825,15 +824,6 @@ struct vm_area_struct *find_vma(struct m
+@@ -825,15 +824,6 @@ struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr)
  EXPORT_SYMBOL(find_vma);
  
  /*
@@ -70049,7 +72661,7 @@ diff -urNp linux-3.1.3/mm/nommu.c linux-3.1.3/mm/nommu.c
   * expand a stack to a given address
   * - not supported under NOMMU conditions
   */
-@@ -1553,6 +1543,7 @@ int split_vma(struct mm_struct *mm, stru
+@@ -1553,6 +1543,7 @@ int split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
  
        /* most fields are the same, copy all, and then fixup */
        *new = *vma;
@@ -70057,10 +72669,11 @@ diff -urNp linux-3.1.3/mm/nommu.c linux-3.1.3/mm/nommu.c
        *region = *vma->vm_region;
        new->vm_region = region;
  
-diff -urNp linux-3.1.3/mm/oom_kill.c linux-3.1.3/mm/oom_kill.c
---- linux-3.1.3/mm/oom_kill.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/oom_kill.c  2011-11-18 18:44:21.000000000 -0500
-@@ -162,7 +162,7 @@ static bool oom_unkillable_task(struct t
+diff --git a/mm/oom_kill.c b/mm/oom_kill.c
+index 626303b..e9a1785 100644
+--- a/mm/oom_kill.c
++++ b/mm/oom_kill.c
+@@ -162,7 +162,7 @@ static bool oom_unkillable_task(struct task_struct *p,
  unsigned int oom_badness(struct task_struct *p, struct mem_cgroup *mem,
                      const nodemask_t *nodemask, unsigned long totalpages)
  {
@@ -70069,9 +72682,10 @@ diff -urNp linux-3.1.3/mm/oom_kill.c linux-3.1.3/mm/oom_kill.c
  
        if (oom_unkillable_task(p, mem, nodemask))
                return 0;
-diff -urNp linux-3.1.3/mm/page_alloc.c linux-3.1.3/mm/page_alloc.c
---- linux-3.1.3/mm/page_alloc.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/page_alloc.c        2011-11-16 18:40:44.000000000 -0500
+diff --git a/mm/page_alloc.c b/mm/page_alloc.c
+index 6e8ecb6..d9e3d7a 100644
+--- a/mm/page_alloc.c
++++ b/mm/page_alloc.c
 @@ -340,7 +340,7 @@ out:
   * This usage means that zero-order pages may not be compound.
   */
@@ -70081,7 +72695,17 @@ diff -urNp linux-3.1.3/mm/page_alloc.c linux-3.1.3/mm/page_alloc.c
  {
        __free_pages_ok(page, compound_order(page));
  }
-@@ -653,6 +653,10 @@ static bool free_pages_prepare(struct pa
+@@ -355,8 +355,8 @@ void prep_compound_page(struct page *page, unsigned long order)
+       __SetPageHead(page);
+       for (i = 1; i < nr_pages; i++) {
+               struct page *p = page + i;
+-
+               __SetPageTail(p);
++              set_page_count(p, 0);
+               p->first_page = page;
+       }
+ }
+@@ -653,6 +653,10 @@ static bool free_pages_prepare(struct page *page, unsigned int order)
        int i;
        int bad = 0;
  
@@ -70092,7 +72716,7 @@ diff -urNp linux-3.1.3/mm/page_alloc.c linux-3.1.3/mm/page_alloc.c
        trace_mm_page_free_direct(page, order);
        kmemcheck_free_shadow(page, order);
  
-@@ -668,6 +672,12 @@ static bool free_pages_prepare(struct pa
+@@ -668,6 +672,12 @@ static bool free_pages_prepare(struct page *page, unsigned int order)
                debug_check_no_obj_freed(page_address(page),
                                           PAGE_SIZE << order);
        }
@@ -70105,7 +72729,7 @@ diff -urNp linux-3.1.3/mm/page_alloc.c linux-3.1.3/mm/page_alloc.c
        arch_free_page(page, order);
        kernel_map_pages(page, 1 << order, 0);
  
-@@ -783,8 +793,10 @@ static int prep_new_page(struct page *pa
+@@ -783,8 +793,10 @@ static int prep_new_page(struct page *page, int order, gfp_t gfp_flags)
        arch_alloc_page(page, order);
        kernel_map_pages(page, 1 << order, 1);
  
@@ -70116,7 +72740,7 @@ diff -urNp linux-3.1.3/mm/page_alloc.c linux-3.1.3/mm/page_alloc.c
  
        if (order && (gfp_flags & __GFP_COMP))
                prep_compound_page(page, order);
-@@ -2539,6 +2551,8 @@ void show_free_areas(unsigned int filter
+@@ -2539,6 +2551,8 @@ void show_free_areas(unsigned int filter)
        int cpu;
        struct zone *zone;
  
@@ -70125,7 +72749,7 @@ diff -urNp linux-3.1.3/mm/page_alloc.c linux-3.1.3/mm/page_alloc.c
        for_each_populated_zone(zone) {
                if (skip_free_areas_node(filter, zone_to_nid(zone)))
                        continue;
-@@ -3350,7 +3364,13 @@ static int pageblock_is_reserved(unsigne
+@@ -3350,7 +3364,13 @@ static int pageblock_is_reserved(unsigned long start_pfn, unsigned long end_pfn)
        unsigned long pfn;
  
        for (pfn = start_pfn; pfn < end_pfn; pfn++) {
@@ -70139,10 +72763,19 @@ diff -urNp linux-3.1.3/mm/page_alloc.c linux-3.1.3/mm/page_alloc.c
                        return 1;
        }
        return 0;
-diff -urNp linux-3.1.3/mm/percpu.c linux-3.1.3/mm/percpu.c
---- linux-3.1.3/mm/percpu.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/percpu.c    2011-11-16 18:39:08.000000000 -0500
-@@ -121,7 +121,7 @@ static unsigned int pcpu_first_unit_cpu 
+@@ -3373,6 +3393,7 @@ static void setup_zone_migrate_reserve(struct zone *zone)
+       /* Get the start pfn, end pfn and the number of blocks to reserve */
+       start_pfn = zone->zone_start_pfn;
+       end_pfn = start_pfn + zone->spanned_pages;
++      start_pfn = roundup(start_pfn, pageblock_nr_pages);
+       reserve = roundup(min_wmark_pages(zone), pageblock_nr_pages) >>
+                                                       pageblock_order;
+diff --git a/mm/percpu.c b/mm/percpu.c
+index bf80e55..c7c3f9a 100644
+--- a/mm/percpu.c
++++ b/mm/percpu.c
+@@ -121,7 +121,7 @@ static unsigned int pcpu_first_unit_cpu __read_mostly;
  static unsigned int pcpu_last_unit_cpu __read_mostly;
  
  /* the address of the first chunk which starts with the kernel static area */
@@ -70151,10 +72784,11 @@ diff -urNp linux-3.1.3/mm/percpu.c linux-3.1.3/mm/percpu.c
  EXPORT_SYMBOL_GPL(pcpu_base_addr);
  
  static const int *pcpu_unit_map __read_mostly;                /* cpu -> unit */
-diff -urNp linux-3.1.3/mm/rmap.c linux-3.1.3/mm/rmap.c
---- linux-3.1.3/mm/rmap.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/rmap.c      2011-11-16 18:39:08.000000000 -0500
-@@ -152,6 +152,10 @@ int anon_vma_prepare(struct vm_area_stru
+diff --git a/mm/rmap.c b/mm/rmap.c
+index 8005080..198c2cd 100644
+--- a/mm/rmap.c
++++ b/mm/rmap.c
+@@ -152,6 +152,10 @@ int anon_vma_prepare(struct vm_area_struct *vma)
        struct anon_vma *anon_vma = vma->anon_vma;
        struct anon_vma_chain *avc;
  
@@ -70165,7 +72799,7 @@ diff -urNp linux-3.1.3/mm/rmap.c linux-3.1.3/mm/rmap.c
        might_sleep();
        if (unlikely(!anon_vma)) {
                struct mm_struct *mm = vma->vm_mm;
-@@ -161,6 +165,12 @@ int anon_vma_prepare(struct vm_area_stru
+@@ -161,6 +165,12 @@ int anon_vma_prepare(struct vm_area_struct *vma)
                if (!avc)
                        goto out_enomem;
  
@@ -70178,7 +72812,7 @@ diff -urNp linux-3.1.3/mm/rmap.c linux-3.1.3/mm/rmap.c
                anon_vma = find_mergeable_anon_vma(vma);
                allocated = NULL;
                if (!anon_vma) {
-@@ -174,6 +184,21 @@ int anon_vma_prepare(struct vm_area_stru
+@@ -174,6 +184,21 @@ int anon_vma_prepare(struct vm_area_struct *vma)
                /* page_table_lock to protect against threads */
                spin_lock(&mm->page_table_lock);
                if (likely(!vma->anon_vma)) {
@@ -70200,7 +72834,7 @@ diff -urNp linux-3.1.3/mm/rmap.c linux-3.1.3/mm/rmap.c
                        vma->anon_vma = anon_vma;
                        avc->anon_vma = anon_vma;
                        avc->vma = vma;
-@@ -187,12 +212,24 @@ int anon_vma_prepare(struct vm_area_stru
+@@ -187,12 +212,24 @@ int anon_vma_prepare(struct vm_area_struct *vma)
  
                if (unlikely(allocated))
                        put_anon_vma(allocated);
@@ -70225,7 +72859,7 @@ diff -urNp linux-3.1.3/mm/rmap.c linux-3.1.3/mm/rmap.c
        anon_vma_chain_free(avc);
   out_enomem:
        return -ENOMEM;
-@@ -243,7 +280,7 @@ static void anon_vma_chain_link(struct v
+@@ -243,7 +280,7 @@ static void anon_vma_chain_link(struct vm_area_struct *vma,
   * Attach the anon_vmas from src to dst.
   * Returns 0 on success, -ENOMEM on failure.
   */
@@ -70234,7 +72868,7 @@ diff -urNp linux-3.1.3/mm/rmap.c linux-3.1.3/mm/rmap.c
  {
        struct anon_vma_chain *avc, *pavc;
        struct anon_vma *root = NULL;
-@@ -276,7 +313,7 @@ int anon_vma_clone(struct vm_area_struct
+@@ -276,7 +313,7 @@ int anon_vma_clone(struct vm_area_struct *dst, struct vm_area_struct *src)
   * the corresponding VMA in the parent process is attached to.
   * Returns 0 on success, non-zero on failure.
   */
@@ -70243,9 +72877,10 @@ diff -urNp linux-3.1.3/mm/rmap.c linux-3.1.3/mm/rmap.c
  {
        struct anon_vma_chain *avc;
        struct anon_vma *anon_vma;
-diff -urNp linux-3.1.3/mm/shmem.c linux-3.1.3/mm/shmem.c
---- linux-3.1.3/mm/shmem.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/shmem.c     2011-11-16 19:28:28.000000000 -0500
+diff --git a/mm/shmem.c b/mm/shmem.c
+index 32f6763..431c405 100644
+--- a/mm/shmem.c
++++ b/mm/shmem.c
 @@ -31,7 +31,7 @@
  #include <linux/module.h>
  #include <linux/swap.h>
@@ -70264,7 +72899,7 @@ diff -urNp linux-3.1.3/mm/shmem.c linux-3.1.3/mm/shmem.c
  
  struct shmem_xattr {
        struct list_head list;  /* anchored by shmem_inode_info->xattr_list */
-@@ -769,6 +769,8 @@ static struct page *shmem_swapin(swp_ent
+@@ -769,6 +769,8 @@ static struct page *shmem_swapin(swp_entry_t swap, gfp_t gfp,
        struct mempolicy mpol, *spol;
        struct vm_area_struct pvma;
  
@@ -70273,7 +72908,7 @@ diff -urNp linux-3.1.3/mm/shmem.c linux-3.1.3/mm/shmem.c
        spol = mpol_cond_copy(&mpol,
                        mpol_shared_policy_lookup(&info->policy, index));
  
-@@ -2149,8 +2151,7 @@ int shmem_fill_super(struct super_block 
+@@ -2149,8 +2151,7 @@ int shmem_fill_super(struct super_block *sb, void *data, int silent)
        int err = -ENOMEM;
  
        /* Round up to L1_CACHE_BYTES to resist false sharing */
@@ -70283,9 +72918,10 @@ diff -urNp linux-3.1.3/mm/shmem.c linux-3.1.3/mm/shmem.c
        if (!sbinfo)
                return -ENOMEM;
  
-diff -urNp linux-3.1.3/mm/slab.c linux-3.1.3/mm/slab.c
---- linux-3.1.3/mm/slab.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/slab.c      2011-11-16 18:40:44.000000000 -0500
+diff --git a/mm/slab.c b/mm/slab.c
+index 893c76d..a742de2 100644
+--- a/mm/slab.c
++++ b/mm/slab.c
 @@ -151,7 +151,7 @@
  
  /* Legal flag mask for kmem_cache_create(). */
@@ -70313,7 +72949,7 @@ diff -urNp linux-3.1.3/mm/slab.c linux-3.1.3/mm/slab.c
  #define       CACHE_CACHE 0
  #define       SIZE_AC MAX_NUMNODES
  #define       SIZE_L3 (2 * MAX_NUMNODES)
-@@ -389,10 +389,10 @@ static void kmem_list3_init(struct kmem_
+@@ -389,10 +389,10 @@ static void kmem_list3_init(struct kmem_list3 *parent)
                if ((x)->max_freeable < i)                              \
                        (x)->max_freeable = i;                          \
        } while (0)
@@ -70328,7 +72964,7 @@ diff -urNp linux-3.1.3/mm/slab.c linux-3.1.3/mm/slab.c
  #else
  #define       STATS_INC_ACTIVE(x)     do { } while (0)
  #define       STATS_DEC_ACTIVE(x)     do { } while (0)
-@@ -538,7 +538,7 @@ static inline void *index_to_obj(struct 
+@@ -538,7 +538,7 @@ static inline void *index_to_obj(struct kmem_cache *cache, struct slab *slab,
   *   reciprocal_divide(offset, cache->reciprocal_buffer_size)
   */
  static inline unsigned int obj_to_index(const struct kmem_cache *cache,
@@ -70346,7 +72982,7 @@ diff -urNp linux-3.1.3/mm/slab.c linux-3.1.3/mm/slab.c
  #undef CACHE
  };
  
-@@ -1571,7 +1571,7 @@ void __init kmem_cache_init(void)
+@@ -1572,7 +1572,7 @@ void __init kmem_cache_init(void)
        sizes[INDEX_AC].cs_cachep = kmem_cache_create(names[INDEX_AC].name,
                                        sizes[INDEX_AC].cs_size,
                                        ARCH_KMALLOC_MINALIGN,
@@ -70355,7 +72991,7 @@ diff -urNp linux-3.1.3/mm/slab.c linux-3.1.3/mm/slab.c
                                        NULL);
  
        if (INDEX_AC != INDEX_L3) {
-@@ -1579,7 +1579,7 @@ void __init kmem_cache_init(void)
+@@ -1580,7 +1580,7 @@ void __init kmem_cache_init(void)
                        kmem_cache_create(names[INDEX_L3].name,
                                sizes[INDEX_L3].cs_size,
                                ARCH_KMALLOC_MINALIGN,
@@ -70364,7 +73000,7 @@ diff -urNp linux-3.1.3/mm/slab.c linux-3.1.3/mm/slab.c
                                NULL);
        }
  
-@@ -1597,7 +1597,7 @@ void __init kmem_cache_init(void)
+@@ -1598,7 +1598,7 @@ void __init kmem_cache_init(void)
                        sizes->cs_cachep = kmem_cache_create(names->name,
                                        sizes->cs_size,
                                        ARCH_KMALLOC_MINALIGN,
@@ -70373,7 +73009,7 @@ diff -urNp linux-3.1.3/mm/slab.c linux-3.1.3/mm/slab.c
                                        NULL);
                }
  #ifdef CONFIG_ZONE_DMA
-@@ -4324,10 +4324,10 @@ static int s_show(struct seq_file *m, vo
+@@ -4327,10 +4327,10 @@ static int s_show(struct seq_file *m, void *p)
        }
        /* cpu stats */
        {
@@ -70388,7 +73024,7 @@ diff -urNp linux-3.1.3/mm/slab.c linux-3.1.3/mm/slab.c
  
                seq_printf(m, " : cpustat %6lu %6lu %6lu %6lu",
                           allochit, allocmiss, freehit, freemiss);
-@@ -4584,15 +4584,70 @@ static const struct file_operations proc
+@@ -4587,15 +4587,70 @@ static const struct file_operations proc_slabstats_operations = {
  
  static int __init slab_proc_init(void)
  {
@@ -70461,9 +73097,10 @@ diff -urNp linux-3.1.3/mm/slab.c linux-3.1.3/mm/slab.c
  /**
   * ksize - get the actual amount of memory allocated for a given object
   * @objp: Pointer to the object
-diff -urNp linux-3.1.3/mm/slob.c linux-3.1.3/mm/slob.c
---- linux-3.1.3/mm/slob.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/slob.c      2011-11-16 18:39:08.000000000 -0500
+diff --git a/mm/slob.c b/mm/slob.c
+index bf39181..727f7a3 100644
+--- a/mm/slob.c
++++ b/mm/slob.c
 @@ -29,7 +29,7 @@
   * If kmalloc is asked for objects of PAGE_SIZE or larger, it calls
   * alloc_pages() directly, allocating compound pages so the page order
@@ -70500,7 +73137,7 @@ diff -urNp linux-3.1.3/mm/slob.c linux-3.1.3/mm/slob.c
  }
  
  static inline void set_slob_page(struct slob_page *sp)
-@@ -150,7 +152,7 @@ static inline void clear_slob_page(struc
+@@ -150,7 +152,7 @@ static inline void clear_slob_page(struct slob_page *sp)
  
  static inline struct slob_page *slob_page(const void *addr)
  {
@@ -70509,7 +73146,7 @@ diff -urNp linux-3.1.3/mm/slob.c linux-3.1.3/mm/slob.c
  }
  
  /*
-@@ -210,7 +212,7 @@ static void set_slob(slob_t *s, slobidx_
+@@ -210,7 +212,7 @@ static void set_slob(slob_t *s, slobidx_t size, slob_t *next)
  /*
   * Return the size of a slob block.
   */
@@ -70536,7 +73173,7 @@ diff -urNp linux-3.1.3/mm/slob.c linux-3.1.3/mm/slob.c
  {
        return !((unsigned long)slob_next(s) & ~PAGE_MASK);
  }
-@@ -254,6 +256,7 @@ static void *slob_new_pages(gfp_t gfp, i
+@@ -254,6 +256,7 @@ static void *slob_new_pages(gfp_t gfp, int order, int node)
        if (!page)
                return NULL;
  
@@ -70544,7 +73181,7 @@ diff -urNp linux-3.1.3/mm/slob.c linux-3.1.3/mm/slob.c
        return page_address(page);
  }
  
-@@ -370,11 +373,11 @@ static void *slob_alloc(size_t size, gfp
+@@ -370,11 +373,11 @@ static void *slob_alloc(size_t size, gfp_t gfp, int align, int node)
                if (!b)
                        return NULL;
                sp = slob_page(b);
@@ -70570,7 +73207,7 @@ diff -urNp linux-3.1.3/mm/slob.c linux-3.1.3/mm/slob.c
        void *ret;
  
        gfp &= gfp_allowed_mask;
-@@ -494,7 +496,10 @@ void *__kmalloc_node(size_t size, gfp_t 
+@@ -494,7 +496,10 @@ void *__kmalloc_node(size_t size, gfp_t gfp, int node)
  
                if (!m)
                        return NULL;
@@ -70582,7 +73219,7 @@ diff -urNp linux-3.1.3/mm/slob.c linux-3.1.3/mm/slob.c
                ret = (void *)m + align;
  
                trace_kmalloc_node(_RET_IP_, ret,
-@@ -506,16 +511,25 @@ void *__kmalloc_node(size_t size, gfp_t 
+@@ -506,16 +511,25 @@ void *__kmalloc_node(size_t size, gfp_t gfp, int node)
                        gfp |= __GFP_COMP;
                ret = slob_new_pages(gfp, order, node);
                if (ret) {
@@ -70722,7 +73359,7 @@ diff -urNp linux-3.1.3/mm/slob.c linux-3.1.3/mm/slob.c
  }
  EXPORT_SYMBOL(ksize);
  
-@@ -571,8 +664,13 @@ struct kmem_cache *kmem_cache_create(con
+@@ -571,8 +664,13 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size,
  {
        struct kmem_cache *c;
  
@@ -70736,7 +73373,7 @@ diff -urNp linux-3.1.3/mm/slob.c linux-3.1.3/mm/slob.c
  
        if (c) {
                c->name = name;
-@@ -614,17 +712,25 @@ void *kmem_cache_alloc_node(struct kmem_
+@@ -614,17 +712,25 @@ void *kmem_cache_alloc_node(struct kmem_cache *c, gfp_t flags, int node)
  
        lockdep_trace_alloc(flags);
  
@@ -70781,7 +73418,7 @@ diff -urNp linux-3.1.3/mm/slob.c linux-3.1.3/mm/slob.c
  }
  
  static void kmem_rcu_free(struct rcu_head *head)
-@@ -652,17 +764,31 @@ static void kmem_rcu_free(struct rcu_hea
+@@ -652,17 +764,31 @@ static void kmem_rcu_free(struct rcu_head *head)
  
  void kmem_cache_free(struct kmem_cache *c, void *b)
  {
@@ -70816,9 +73453,10 @@ diff -urNp linux-3.1.3/mm/slob.c linux-3.1.3/mm/slob.c
  }
  EXPORT_SYMBOL(kmem_cache_free);
  
-diff -urNp linux-3.1.3/mm/slub.c linux-3.1.3/mm/slub.c
---- linux-3.1.3/mm/slub.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/slub.c      2011-11-16 19:27:25.000000000 -0500
+diff --git a/mm/slub.c b/mm/slub.c
+index 7c54fe8..0bb4ac5 100644
+--- a/mm/slub.c
++++ b/mm/slub.c
 @@ -208,7 +208,7 @@ struct track {
  
  enum track_item { TRACK_ALLOC, TRACK_FREE };
@@ -70828,7 +73466,7 @@ diff -urNp linux-3.1.3/mm/slub.c linux-3.1.3/mm/slub.c
  static int sysfs_slab_add(struct kmem_cache *);
  static int sysfs_slab_alias(struct kmem_cache *, const char *);
  static void sysfs_slab_remove(struct kmem_cache *);
-@@ -556,7 +556,7 @@ static void print_track(const char *s, s
+@@ -556,7 +556,7 @@ static void print_track(const char *s, struct track *t)
        if (!t->addr)
                return;
  
@@ -70837,7 +73475,7 @@ diff -urNp linux-3.1.3/mm/slub.c linux-3.1.3/mm/slub.c
                s, (void *)t->addr, jiffies - t->when, t->cpu, t->pid);
  #ifdef CONFIG_STACKTRACE
        {
-@@ -2456,6 +2456,8 @@ void kmem_cache_free(struct kmem_cache *
+@@ -2456,6 +2456,8 @@ void kmem_cache_free(struct kmem_cache *s, void *x)
  
        page = virt_to_head_page(x);
  
@@ -70855,7 +73493,7 @@ diff -urNp linux-3.1.3/mm/slub.c linux-3.1.3/mm/slub.c
  
  /*
   * Calculate the order of allocation given an slab object size.
-@@ -2912,7 +2914,7 @@ static int kmem_cache_open(struct kmem_c
+@@ -2912,7 +2914,7 @@ static int kmem_cache_open(struct kmem_cache *s,
         * list to avoid pounding the page allocator excessively.
         */
        set_min_partial(s, ilog2(s->size));
@@ -70864,7 +73502,7 @@ diff -urNp linux-3.1.3/mm/slub.c linux-3.1.3/mm/slub.c
  #ifdef CONFIG_NUMA
        s->remote_node_defrag_ratio = 1000;
  #endif
-@@ -3017,8 +3019,7 @@ static inline int kmem_cache_close(struc
+@@ -3017,8 +3019,7 @@ static inline int kmem_cache_close(struct kmem_cache *s)
  void kmem_cache_destroy(struct kmem_cache *s)
  {
        down_write(&slub_lock);
@@ -70874,7 +73512,7 @@ diff -urNp linux-3.1.3/mm/slub.c linux-3.1.3/mm/slub.c
                list_del(&s->list);
                if (kmem_cache_close(s)) {
                        printk(KERN_ERR "SLUB %s: %s called for cache that "
-@@ -3228,6 +3229,50 @@ void *__kmalloc_node(size_t size, gfp_t 
+@@ -3228,6 +3229,50 @@ void *__kmalloc_node(size_t size, gfp_t flags, int node)
  EXPORT_SYMBOL(__kmalloc_node);
  #endif
  
@@ -70925,7 +73563,7 @@ diff -urNp linux-3.1.3/mm/slub.c linux-3.1.3/mm/slub.c
  size_t ksize(const void *object)
  {
        struct page *page;
-@@ -3502,7 +3547,7 @@ static void __init kmem_cache_bootstrap_
+@@ -3502,7 +3547,7 @@ static void __init kmem_cache_bootstrap_fixup(struct kmem_cache *s)
        int node;
  
        list_add(&s->list, &slab_caches);
@@ -70955,7 +73593,7 @@ diff -urNp linux-3.1.3/mm/slub.c linux-3.1.3/mm/slub.c
                caches++;
        }
  
-@@ -3697,7 +3742,7 @@ static int slab_unmergeable(struct kmem_
+@@ -3697,7 +3742,7 @@ static int slab_unmergeable(struct kmem_cache *s)
        /*
         * We may have set a slab to be unmergeable during bootstrap.
         */
@@ -70964,7 +73602,7 @@ diff -urNp linux-3.1.3/mm/slub.c linux-3.1.3/mm/slub.c
                return 1;
  
        return 0;
-@@ -3756,7 +3801,7 @@ struct kmem_cache *kmem_cache_create(con
+@@ -3756,7 +3801,7 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size,
        down_write(&slub_lock);
        s = find_mergeable(size, align, flags, name, ctor);
        if (s) {
@@ -70973,7 +73611,7 @@ diff -urNp linux-3.1.3/mm/slub.c linux-3.1.3/mm/slub.c
                /*
                 * Adjust the object sizes so that we clear
                 * the complete object on kzalloc.
-@@ -3765,7 +3810,7 @@ struct kmem_cache *kmem_cache_create(con
+@@ -3765,7 +3810,7 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size,
                s->inuse = max_t(int, s->inuse, ALIGN(size, sizeof(void *)));
  
                if (sysfs_slab_alias(s, name)) {
@@ -70982,7 +73620,7 @@ diff -urNp linux-3.1.3/mm/slub.c linux-3.1.3/mm/slub.c
                        goto err;
                }
                up_write(&slub_lock);
-@@ -3893,7 +3938,7 @@ void *__kmalloc_node_track_caller(size_t
+@@ -3893,7 +3938,7 @@ void *__kmalloc_node_track_caller(size_t size, gfp_t gfpflags,
  }
  #endif
  
@@ -71015,7 +73653,7 @@ diff -urNp linux-3.1.3/mm/slub.c linux-3.1.3/mm/slub.c
  }
  SLAB_ATTR_RO(aliases);
  
-@@ -5025,6 +5070,7 @@ static char *create_unique_id(struct kme
+@@ -5025,6 +5070,7 @@ static char *create_unique_id(struct kmem_cache *s)
        return name;
  }
  
@@ -71023,7 +73661,7 @@ diff -urNp linux-3.1.3/mm/slub.c linux-3.1.3/mm/slub.c
  static int sysfs_slab_add(struct kmem_cache *s)
  {
        int err;
-@@ -5087,6 +5133,7 @@ static void sysfs_slab_remove(struct kme
+@@ -5087,6 +5133,7 @@ static void sysfs_slab_remove(struct kmem_cache *s)
        kobject_del(&s->kobj);
        kobject_put(&s->kobj);
  }
@@ -71039,7 +73677,7 @@ diff -urNp linux-3.1.3/mm/slub.c linux-3.1.3/mm/slub.c
  static int sysfs_slab_alias(struct kmem_cache *s, const char *name)
  {
        struct saved_alias *al;
-@@ -5122,6 +5170,7 @@ static int sysfs_slab_alias(struct kmem_
+@@ -5122,6 +5170,7 @@ static int sysfs_slab_alias(struct kmem_cache *s, const char *name)
        alias_list = al;
        return 0;
  }
@@ -71047,7 +73685,7 @@ diff -urNp linux-3.1.3/mm/slub.c linux-3.1.3/mm/slub.c
  
  static int __init slab_sysfs_init(void)
  {
-@@ -5257,7 +5306,13 @@ static const struct file_operations proc
+@@ -5257,7 +5306,13 @@ static const struct file_operations proc_slabinfo_operations = {
  
  static int __init slab_proc_init(void)
  {
@@ -71062,9 +73700,10 @@ diff -urNp linux-3.1.3/mm/slub.c linux-3.1.3/mm/slub.c
        return 0;
  }
  module_init(slab_proc_init);
-diff -urNp linux-3.1.3/mm/swap.c linux-3.1.3/mm/swap.c
---- linux-3.1.3/mm/swap.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/swap.c      2011-11-16 18:39:08.000000000 -0500
+diff --git a/mm/swap.c b/mm/swap.c
+index 87627f1..8a9eb34 100644
+--- a/mm/swap.c
++++ b/mm/swap.c
 @@ -31,6 +31,7 @@
  #include <linux/backing-dev.h>
  #include <linux/memcontrol.h>
@@ -71073,7 +73712,7 @@ diff -urNp linux-3.1.3/mm/swap.c linux-3.1.3/mm/swap.c
  
  #include "internal.h"
  
-@@ -71,6 +72,8 @@ static void __put_compound_page(struct p
+@@ -71,6 +72,8 @@ static void __put_compound_page(struct page *page)
  
        __page_cache_release(page);
        dtor = get_compound_page_dtor(page);
@@ -71082,9 +73721,10 @@ diff -urNp linux-3.1.3/mm/swap.c linux-3.1.3/mm/swap.c
        (*dtor)(page);
  }
  
-diff -urNp linux-3.1.3/mm/swapfile.c linux-3.1.3/mm/swapfile.c
---- linux-3.1.3/mm/swapfile.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/swapfile.c  2011-11-16 18:39:08.000000000 -0500
+diff --git a/mm/swapfile.c b/mm/swapfile.c
+index 17bc224..1677059 100644
+--- a/mm/swapfile.c
++++ b/mm/swapfile.c
 @@ -62,7 +62,7 @@ static DEFINE_MUTEX(swapon_mutex);
  
  static DECLARE_WAIT_QUEUE_HEAD(proc_poll_wait);
@@ -71094,7 +73734,7 @@ diff -urNp linux-3.1.3/mm/swapfile.c linux-3.1.3/mm/swapfile.c
  
  static inline unsigned char swap_count(unsigned char ent)
  {
-@@ -1671,7 +1671,7 @@ SYSCALL_DEFINE1(swapoff, const char __us
+@@ -1671,7 +1671,7 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile)
        }
        filp_close(swap_file, NULL);
        err = 0;
@@ -71103,7 +73743,7 @@ diff -urNp linux-3.1.3/mm/swapfile.c linux-3.1.3/mm/swapfile.c
        wake_up_interruptible(&proc_poll_wait);
  
  out_dput:
-@@ -1687,8 +1687,8 @@ static unsigned swaps_poll(struct file *
+@@ -1687,8 +1687,8 @@ static unsigned swaps_poll(struct file *file, poll_table *wait)
  
        poll_wait(file, &proc_poll_wait, wait);
  
@@ -71114,7 +73754,7 @@ diff -urNp linux-3.1.3/mm/swapfile.c linux-3.1.3/mm/swapfile.c
                return POLLIN | POLLRDNORM | POLLERR | POLLPRI;
        }
  
-@@ -1786,7 +1786,7 @@ static int swaps_open(struct inode *inod
+@@ -1786,7 +1786,7 @@ static int swaps_open(struct inode *inode, struct file *file)
                return ret;
  
        seq = file->private_data;
@@ -71123,7 +73763,7 @@ diff -urNp linux-3.1.3/mm/swapfile.c linux-3.1.3/mm/swapfile.c
        return 0;
  }
  
-@@ -2124,7 +2124,7 @@ SYSCALL_DEFINE2(swapon, const char __use
+@@ -2124,7 +2124,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
                (p->flags & SWP_DISCARDABLE) ? "D" : "");
  
        mutex_unlock(&swapon_mutex);
@@ -71132,9 +73772,10 @@ diff -urNp linux-3.1.3/mm/swapfile.c linux-3.1.3/mm/swapfile.c
        wake_up_interruptible(&proc_poll_wait);
  
        if (S_ISREG(inode->i_mode))
-diff -urNp linux-3.1.3/mm/util.c linux-3.1.3/mm/util.c
---- linux-3.1.3/mm/util.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/util.c      2011-11-16 18:39:08.000000000 -0500
+diff --git a/mm/util.c b/mm/util.c
+index 88ea1bd..0f1dfdb 100644
+--- a/mm/util.c
++++ b/mm/util.c
 @@ -114,6 +114,7 @@ EXPORT_SYMBOL(memdup_user);
   * allocated buffer. Use this if you don't want to free the buffer immediately
   * like, for example, with RCU.
@@ -71151,7 +73792,7 @@ diff -urNp linux-3.1.3/mm/util.c linux-3.1.3/mm/util.c
  void *krealloc(const void *p, size_t new_size, gfp_t flags)
  {
        void *ret;
-@@ -243,6 +245,12 @@ void __vma_link_list(struct mm_struct *m
+@@ -243,6 +245,12 @@ void __vma_link_list(struct mm_struct *mm, struct vm_area_struct *vma,
  void arch_pick_mmap_layout(struct mm_struct *mm)
  {
        mm->mmap_base = TASK_UNMAPPED_BASE;
@@ -71164,10 +73805,11 @@ diff -urNp linux-3.1.3/mm/util.c linux-3.1.3/mm/util.c
        mm->get_unmapped_area = arch_get_unmapped_area;
        mm->unmap_area = arch_unmap_area;
  }
-diff -urNp linux-3.1.3/mm/vmalloc.c linux-3.1.3/mm/vmalloc.c
---- linux-3.1.3/mm/vmalloc.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/vmalloc.c   2011-11-16 18:40:44.000000000 -0500
-@@ -39,8 +39,19 @@ static void vunmap_pte_range(pmd_t *pmd,
+diff --git a/mm/vmalloc.c b/mm/vmalloc.c
+index 56faf31..862c072 100644
+--- a/mm/vmalloc.c
++++ b/mm/vmalloc.c
+@@ -39,8 +39,19 @@ static void vunmap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end)
  
        pte = pte_offset_kernel(pmd, addr);
        do {
@@ -71189,7 +73831,7 @@ diff -urNp linux-3.1.3/mm/vmalloc.c linux-3.1.3/mm/vmalloc.c
        } while (pte++, addr += PAGE_SIZE, addr != end);
  }
  
-@@ -91,6 +102,7 @@ static int vmap_pte_range(pmd_t *pmd, un
+@@ -91,6 +102,7 @@ static int vmap_pte_range(pmd_t *pmd, unsigned long addr,
                unsigned long end, pgprot_t prot, struct page **pages, int *nr)
  {
        pte_t *pte;
@@ -71197,7 +73839,7 @@ diff -urNp linux-3.1.3/mm/vmalloc.c linux-3.1.3/mm/vmalloc.c
  
        /*
         * nr is a running index into the array which helps higher level
-@@ -100,17 +112,30 @@ static int vmap_pte_range(pmd_t *pmd, un
+@@ -100,17 +112,30 @@ static int vmap_pte_range(pmd_t *pmd, unsigned long addr,
        pte = pte_alloc_kernel(pmd, addr);
        if (!pte)
                return -ENOMEM;
@@ -71233,7 +73875,7 @@ diff -urNp linux-3.1.3/mm/vmalloc.c linux-3.1.3/mm/vmalloc.c
  }
  
  static int vmap_pmd_range(pud_t *pud, unsigned long addr,
-@@ -191,11 +216,20 @@ int is_vmalloc_or_module_addr(const void
+@@ -191,11 +216,20 @@ int is_vmalloc_or_module_addr(const void *x)
         * and fall back on vmalloc() if that fails. Others
         * just put it in the vmalloc space.
         */
@@ -71255,7 +73897,7 @@ diff -urNp linux-3.1.3/mm/vmalloc.c linux-3.1.3/mm/vmalloc.c
        return is_vmalloc_addr(x);
  }
  
-@@ -216,8 +250,14 @@ struct page *vmalloc_to_page(const void 
+@@ -216,8 +250,14 @@ struct page *vmalloc_to_page(const void *vmalloc_addr)
  
        if (!pgd_none(*pgd)) {
                pud_t *pud = pud_offset(pgd, addr);
@@ -71270,7 +73912,7 @@ diff -urNp linux-3.1.3/mm/vmalloc.c linux-3.1.3/mm/vmalloc.c
                        if (!pmd_none(*pmd)) {
                                pte_t *ptep, pte;
  
-@@ -1294,6 +1334,16 @@ static struct vm_struct *__get_vm_area_n
+@@ -1294,6 +1334,16 @@ static struct vm_struct *__get_vm_area_node(unsigned long size,
        struct vm_struct *area;
  
        BUG_ON(in_interrupt());
@@ -71287,7 +73929,7 @@ diff -urNp linux-3.1.3/mm/vmalloc.c linux-3.1.3/mm/vmalloc.c
        if (flags & VM_IOREMAP) {
                int bit = fls(size);
  
-@@ -1526,6 +1576,11 @@ void *vmap(struct page **pages, unsigned
+@@ -1526,6 +1576,11 @@ void *vmap(struct page **pages, unsigned int count,
        if (count > totalram_pages)
                return NULL;
  
@@ -71299,7 +73941,7 @@ diff -urNp linux-3.1.3/mm/vmalloc.c linux-3.1.3/mm/vmalloc.c
        area = get_vm_area_caller((count << PAGE_SHIFT), flags,
                                        __builtin_return_address(0));
        if (!area)
-@@ -1627,6 +1682,13 @@ void *__vmalloc_node_range(unsigned long
+@@ -1627,6 +1682,13 @@ void *__vmalloc_node_range(unsigned long size, unsigned long align,
        if (!size || (size >> PAGE_SHIFT) > totalram_pages)
                return NULL;
  
@@ -71313,7 +73955,16 @@ diff -urNp linux-3.1.3/mm/vmalloc.c linux-3.1.3/mm/vmalloc.c
        area = __get_vm_area_node(size, align, VM_ALLOC | VM_UNLIST,
                                  start, end, node, gfp_mask, caller);
  
-@@ -1672,6 +1734,7 @@ static void *__vmalloc_node(unsigned lon
+@@ -1634,6 +1696,8 @@ void *__vmalloc_node_range(unsigned long size, unsigned long align,
+               return NULL;
+       addr = __vmalloc_area_node(area, gfp_mask, prot, node, caller);
++      if (!addr)
++              return NULL;
+       /*
+        * In this function, newly allocated vm_struct is not added
+@@ -1672,6 +1736,7 @@ static void *__vmalloc_node(unsigned long size, unsigned long align,
                                gfp_mask, prot, node, caller);
  }
  
@@ -71321,7 +73972,7 @@ diff -urNp linux-3.1.3/mm/vmalloc.c linux-3.1.3/mm/vmalloc.c
  void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot)
  {
        return __vmalloc_node(size, 1, gfp_mask, prot, -1,
-@@ -1695,6 +1758,7 @@ static inline void *__vmalloc_node_flags
+@@ -1695,6 +1760,7 @@ static inline void *__vmalloc_node_flags(unsigned long size,
   *    For tight control over page level allocator and protection flags
   *    use __vmalloc() instead.
   */
@@ -71329,7 +73980,7 @@ diff -urNp linux-3.1.3/mm/vmalloc.c linux-3.1.3/mm/vmalloc.c
  void *vmalloc(unsigned long size)
  {
        return __vmalloc_node_flags(size, -1, GFP_KERNEL | __GFP_HIGHMEM);
-@@ -1711,6 +1775,7 @@ EXPORT_SYMBOL(vmalloc);
+@@ -1711,6 +1777,7 @@ EXPORT_SYMBOL(vmalloc);
   *    For tight control over page level allocator and protection flags
   *    use __vmalloc() instead.
   */
@@ -71337,7 +73988,7 @@ diff -urNp linux-3.1.3/mm/vmalloc.c linux-3.1.3/mm/vmalloc.c
  void *vzalloc(unsigned long size)
  {
        return __vmalloc_node_flags(size, -1,
-@@ -1725,6 +1790,7 @@ EXPORT_SYMBOL(vzalloc);
+@@ -1725,6 +1792,7 @@ EXPORT_SYMBOL(vzalloc);
   * The resulting memory area is zeroed so it can be mapped to userspace
   * without leaking data.
   */
@@ -71345,7 +73996,7 @@ diff -urNp linux-3.1.3/mm/vmalloc.c linux-3.1.3/mm/vmalloc.c
  void *vmalloc_user(unsigned long size)
  {
        struct vm_struct *area;
-@@ -1752,6 +1818,7 @@ EXPORT_SYMBOL(vmalloc_user);
+@@ -1752,6 +1820,7 @@ EXPORT_SYMBOL(vmalloc_user);
   *    For tight control over page level allocator and protection flags
   *    use __vmalloc() instead.
   */
@@ -71353,7 +74004,7 @@ diff -urNp linux-3.1.3/mm/vmalloc.c linux-3.1.3/mm/vmalloc.c
  void *vmalloc_node(unsigned long size, int node)
  {
        return __vmalloc_node(size, 1, GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL,
-@@ -1771,6 +1838,7 @@ EXPORT_SYMBOL(vmalloc_node);
+@@ -1771,6 +1840,7 @@ EXPORT_SYMBOL(vmalloc_node);
   * For tight control over page level allocator and protection flags
   * use __vmalloc_node() instead.
   */
@@ -71361,7 +74012,7 @@ diff -urNp linux-3.1.3/mm/vmalloc.c linux-3.1.3/mm/vmalloc.c
  void *vzalloc_node(unsigned long size, int node)
  {
        return __vmalloc_node_flags(size, node,
-@@ -1793,10 +1861,10 @@ EXPORT_SYMBOL(vzalloc_node);
+@@ -1793,10 +1863,10 @@ EXPORT_SYMBOL(vzalloc_node);
   *    For tight control over page level allocator and protection flags
   *    use __vmalloc() instead.
   */
@@ -71374,7 +74025,7 @@ diff -urNp linux-3.1.3/mm/vmalloc.c linux-3.1.3/mm/vmalloc.c
                              -1, __builtin_return_address(0));
  }
  
-@@ -1815,6 +1883,7 @@ void *vmalloc_exec(unsigned long size)
+@@ -1815,6 +1885,7 @@ void *vmalloc_exec(unsigned long size)
   *    Allocate enough 32bit PA addressable pages to cover @size from the
   *    page level allocator and map them into contiguous kernel virtual space.
   */
@@ -71382,7 +74033,7 @@ diff -urNp linux-3.1.3/mm/vmalloc.c linux-3.1.3/mm/vmalloc.c
  void *vmalloc_32(unsigned long size)
  {
        return __vmalloc_node(size, 1, GFP_VMALLOC32, PAGE_KERNEL,
-@@ -1829,6 +1898,7 @@ EXPORT_SYMBOL(vmalloc_32);
+@@ -1829,6 +1900,7 @@ EXPORT_SYMBOL(vmalloc_32);
   * The resulting memory area is 32bit addressable and zeroed so it can be
   * mapped to userspace without leaking data.
   */
@@ -71390,7 +74041,7 @@ diff -urNp linux-3.1.3/mm/vmalloc.c linux-3.1.3/mm/vmalloc.c
  void *vmalloc_32_user(unsigned long size)
  {
        struct vm_struct *area;
-@@ -2091,6 +2161,8 @@ int remap_vmalloc_range(struct vm_area_s
+@@ -2091,6 +2163,8 @@ int remap_vmalloc_range(struct vm_area_struct *vma, void *addr,
        unsigned long uaddr = vma->vm_start;
        unsigned long usize = vma->vm_end - vma->vm_start;
  
@@ -71399,9 +74050,10 @@ diff -urNp linux-3.1.3/mm/vmalloc.c linux-3.1.3/mm/vmalloc.c
        if ((PAGE_SIZE-1) & (unsigned long)addr)
                return -EINVAL;
  
-diff -urNp linux-3.1.3/mm/vmstat.c linux-3.1.3/mm/vmstat.c
---- linux-3.1.3/mm/vmstat.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/mm/vmstat.c    2011-11-16 18:40:44.000000000 -0500
+diff --git a/mm/vmstat.c b/mm/vmstat.c
+index d52b13d..381d1ac 100644
+--- a/mm/vmstat.c
++++ b/mm/vmstat.c
 @@ -78,7 +78,7 @@ void vm_events_fold_cpu(int cpu)
   *
   * vm_stat contains the global counters
@@ -71454,10 +74106,11 @@ diff -urNp linux-3.1.3/mm/vmstat.c linux-3.1.3/mm/vmstat.c
  #endif
        return 0;
  }
-diff -urNp linux-3.1.3/net/8021q/vlan.c linux-3.1.3/net/8021q/vlan.c
---- linux-3.1.3/net/8021q/vlan.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/8021q/vlan.c       2011-11-16 18:39:08.000000000 -0500
-@@ -588,8 +588,7 @@ static int vlan_ioctl_handler(struct net
+diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
+index 8970ba1..e3361fe 100644
+--- a/net/8021q/vlan.c
++++ b/net/8021q/vlan.c
+@@ -588,8 +588,7 @@ static int vlan_ioctl_handler(struct net *net, void __user *arg)
                err = -EPERM;
                if (!capable(CAP_NET_ADMIN))
                        break;
@@ -71467,10 +74120,11 @@ diff -urNp linux-3.1.3/net/8021q/vlan.c linux-3.1.3/net/8021q/vlan.c
                        struct vlan_net *vn;
  
                        vn = net_generic(net, vlan_net_id);
-diff -urNp linux-3.1.3/net/9p/trans_fd.c linux-3.1.3/net/9p/trans_fd.c
---- linux-3.1.3/net/9p/trans_fd.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/9p/trans_fd.c      2011-11-16 18:39:08.000000000 -0500
-@@ -423,7 +423,7 @@ static int p9_fd_write(struct p9_client 
+diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
+index fdfdb57..38d368c 100644
+--- a/net/9p/trans_fd.c
++++ b/net/9p/trans_fd.c
+@@ -423,7 +423,7 @@ static int p9_fd_write(struct p9_client *client, void *v, int len)
        oldfs = get_fs();
        set_fs(get_ds());
        /* The cast to a user pointer is valid due to the set_fs() */
@@ -71479,9 +74133,10 @@ diff -urNp linux-3.1.3/net/9p/trans_fd.c linux-3.1.3/net/9p/trans_fd.c
        set_fs(oldfs);
  
        if (ret <= 0 && ret != -ERESTARTSYS && ret != -EAGAIN)
-diff -urNp linux-3.1.3/net/9p/trans_virtio.c linux-3.1.3/net/9p/trans_virtio.c
---- linux-3.1.3/net/9p/trans_virtio.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/9p/trans_virtio.c  2011-11-16 18:39:08.000000000 -0500
+diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
+index e317583..3c8aeaf 100644
+--- a/net/9p/trans_virtio.c
++++ b/net/9p/trans_virtio.c
 @@ -327,7 +327,7 @@ req_retry_pinned:
                } else {
                        char *pbuf;
@@ -71500,10 +74155,11 @@ diff -urNp linux-3.1.3/net/9p/trans_virtio.c linux-3.1.3/net/9p/trans_virtio.c
                        else
                                pbuf = req->tc->pkbuf;
  
-diff -urNp linux-3.1.3/net/atm/atm_misc.c linux-3.1.3/net/atm/atm_misc.c
---- linux-3.1.3/net/atm/atm_misc.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/atm/atm_misc.c     2011-11-16 18:39:08.000000000 -0500
-@@ -17,7 +17,7 @@ int atm_charge(struct atm_vcc *vcc, int 
+diff --git a/net/atm/atm_misc.c b/net/atm/atm_misc.c
+index f41f026..fe76ea8 100644
+--- a/net/atm/atm_misc.c
++++ b/net/atm/atm_misc.c
+@@ -17,7 +17,7 @@ int atm_charge(struct atm_vcc *vcc, int truesize)
        if (atomic_read(&sk_atm(vcc)->sk_rmem_alloc) <= sk_atm(vcc)->sk_rcvbuf)
                return 1;
        atm_return(vcc, truesize);
@@ -71512,7 +74168,7 @@ diff -urNp linux-3.1.3/net/atm/atm_misc.c linux-3.1.3/net/atm/atm_misc.c
        return 0;
  }
  EXPORT_SYMBOL(atm_charge);
-@@ -39,7 +39,7 @@ struct sk_buff *atm_alloc_charge(struct 
+@@ -39,7 +39,7 @@ struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc, int pdu_size,
                }
        }
        atm_return(vcc, guess);
@@ -71539,9 +74195,10 @@ diff -urNp linux-3.1.3/net/atm/atm_misc.c linux-3.1.3/net/atm/atm_misc.c
        __SONET_ITEMS
  #undef __HANDLE_ITEM
  }
-diff -urNp linux-3.1.3/net/atm/lec.h linux-3.1.3/net/atm/lec.h
---- linux-3.1.3/net/atm/lec.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/atm/lec.h  2011-11-16 18:39:08.000000000 -0500
+diff --git a/net/atm/lec.h b/net/atm/lec.h
+index dfc0719..47c5322 100644
+--- a/net/atm/lec.h
++++ b/net/atm/lec.h
 @@ -48,7 +48,7 @@ struct lane2_ops {
                              const u8 *tlvs, u32 sizeoftlvs);
        void (*associate_indicator) (struct net_device *dev, const u8 *mac_addr,
@@ -71551,9 +74208,10 @@ diff -urNp linux-3.1.3/net/atm/lec.h linux-3.1.3/net/atm/lec.h
  
  /*
   * ATM LAN Emulation supports both LLC & Dix Ethernet EtherType
-diff -urNp linux-3.1.3/net/atm/mpc.h linux-3.1.3/net/atm/mpc.h
---- linux-3.1.3/net/atm/mpc.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/atm/mpc.h  2011-11-16 18:39:08.000000000 -0500
+diff --git a/net/atm/mpc.h b/net/atm/mpc.h
+index 0919a88..a23d54e 100644
+--- a/net/atm/mpc.h
++++ b/net/atm/mpc.h
 @@ -33,7 +33,7 @@ struct mpoa_client {
        struct mpc_parameters parameters;  /* parameters for this client    */
  
@@ -71563,10 +74221,11 @@ diff -urNp linux-3.1.3/net/atm/mpc.h linux-3.1.3/net/atm/mpc.h
  };
  
  
-diff -urNp linux-3.1.3/net/atm/mpoa_caches.c linux-3.1.3/net/atm/mpoa_caches.c
---- linux-3.1.3/net/atm/mpoa_caches.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/atm/mpoa_caches.c  2011-11-16 18:40:44.000000000 -0500
-@@ -255,6 +255,8 @@ static void check_resolving_entries(stru
+diff --git a/net/atm/mpoa_caches.c b/net/atm/mpoa_caches.c
+index d1b2d9a..7cc2219 100644
+--- a/net/atm/mpoa_caches.c
++++ b/net/atm/mpoa_caches.c
+@@ -255,6 +255,8 @@ static void check_resolving_entries(struct mpoa_client *client)
        struct timeval now;
        struct k_message msg;
  
@@ -71575,10 +74234,11 @@ diff -urNp linux-3.1.3/net/atm/mpoa_caches.c linux-3.1.3/net/atm/mpoa_caches.c
        do_gettimeofday(&now);
  
        read_lock_bh(&client->ingress_lock);
-diff -urNp linux-3.1.3/net/atm/proc.c linux-3.1.3/net/atm/proc.c
---- linux-3.1.3/net/atm/proc.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/atm/proc.c 2011-11-16 18:39:08.000000000 -0500
-@@ -45,9 +45,9 @@ static void add_stats(struct seq_file *s
+diff --git a/net/atm/proc.c b/net/atm/proc.c
+index 0d020de..011c7bb 100644
+--- a/net/atm/proc.c
++++ b/net/atm/proc.c
+@@ -45,9 +45,9 @@ static void add_stats(struct seq_file *seq, const char *aal,
    const struct k_atm_aal_stats *stats)
  {
        seq_printf(seq, "%s ( %d %d %d %d %d )", aal,
@@ -71591,9 +74251,10 @@ diff -urNp linux-3.1.3/net/atm/proc.c linux-3.1.3/net/atm/proc.c
  }
  
  static void atm_dev_info(struct seq_file *seq, const struct atm_dev *dev)
-diff -urNp linux-3.1.3/net/atm/resources.c linux-3.1.3/net/atm/resources.c
---- linux-3.1.3/net/atm/resources.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/atm/resources.c    2011-11-16 18:39:08.000000000 -0500
+diff --git a/net/atm/resources.c b/net/atm/resources.c
+index 23f45ce..c748f1a 100644
+--- a/net/atm/resources.c
++++ b/net/atm/resources.c
 @@ -160,7 +160,7 @@ EXPORT_SYMBOL(atm_dev_deregister);
  static void copy_aal_stats(struct k_atm_aal_stats *from,
      struct atm_aal_stats *to)
@@ -71603,7 +74264,7 @@ diff -urNp linux-3.1.3/net/atm/resources.c linux-3.1.3/net/atm/resources.c
        __AAL_STAT_ITEMS
  #undef __HANDLE_ITEM
  }
-@@ -168,7 +168,7 @@ static void copy_aal_stats(struct k_atm_
+@@ -168,7 +168,7 @@ static void copy_aal_stats(struct k_atm_aal_stats *from,
  static void subtract_aal_stats(struct k_atm_aal_stats *from,
      struct atm_aal_stats *to)
  {
@@ -71612,10 +74273,11 @@ diff -urNp linux-3.1.3/net/atm/resources.c linux-3.1.3/net/atm/resources.c
        __AAL_STAT_ITEMS
  #undef __HANDLE_ITEM
  }
-diff -urNp linux-3.1.3/net/batman-adv/hard-interface.c linux-3.1.3/net/batman-adv/hard-interface.c
---- linux-3.1.3/net/batman-adv/hard-interface.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/batman-adv/hard-interface.c        2011-11-16 18:39:08.000000000 -0500
-@@ -347,8 +347,8 @@ int hardif_enable_interface(struct hard_
+diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
+index db7aacf..991e539 100644
+--- a/net/batman-adv/hard-interface.c
++++ b/net/batman-adv/hard-interface.c
+@@ -347,8 +347,8 @@ int hardif_enable_interface(struct hard_iface *hard_iface,
        hard_iface->batman_adv_ptype.dev = hard_iface->net_dev;
        dev_add_pack(&hard_iface->batman_adv_ptype);
  
@@ -71626,10 +74288,11 @@ diff -urNp linux-3.1.3/net/batman-adv/hard-interface.c linux-3.1.3/net/batman-ad
        bat_info(hard_iface->soft_iface, "Adding interface: %s\n",
                 hard_iface->net_dev->name);
  
-diff -urNp linux-3.1.3/net/batman-adv/routing.c linux-3.1.3/net/batman-adv/routing.c
---- linux-3.1.3/net/batman-adv/routing.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/batman-adv/routing.c       2011-11-16 18:39:08.000000000 -0500
-@@ -656,7 +656,7 @@ void receive_bat_packet(const struct eth
+diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
+index 0f32c81..82d1895 100644
+--- a/net/batman-adv/routing.c
++++ b/net/batman-adv/routing.c
+@@ -656,7 +656,7 @@ void receive_bat_packet(const struct ethhdr *ethhdr,
                return;
  
        /* could be changed by schedule_own_packet() */
@@ -71638,10 +74301,11 @@ diff -urNp linux-3.1.3/net/batman-adv/routing.c linux-3.1.3/net/batman-adv/routi
  
        has_directlink_flag = (batman_packet->flags & DIRECTLINK ? 1 : 0);
  
-diff -urNp linux-3.1.3/net/batman-adv/send.c linux-3.1.3/net/batman-adv/send.c
---- linux-3.1.3/net/batman-adv/send.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/batman-adv/send.c  2011-11-16 18:39:08.000000000 -0500
-@@ -326,7 +326,7 @@ void schedule_own_packet(struct hard_ifa
+diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c
+index 58d1447..2a66c8c 100644
+--- a/net/batman-adv/send.c
++++ b/net/batman-adv/send.c
+@@ -326,7 +326,7 @@ void schedule_own_packet(struct hard_iface *hard_iface)
  
        /* change sequence number to network order */
        batman_packet->seqno =
@@ -71650,7 +74314,7 @@ diff -urNp linux-3.1.3/net/batman-adv/send.c linux-3.1.3/net/batman-adv/send.c
  
        batman_packet->ttvn = atomic_read(&bat_priv->ttvn);
        batman_packet->tt_crc = htons((uint16_t)atomic_read(&bat_priv->tt_crc));
-@@ -343,7 +343,7 @@ void schedule_own_packet(struct hard_ifa
+@@ -343,7 +343,7 @@ void schedule_own_packet(struct hard_iface *hard_iface)
        else
                batman_packet->gw_flags = NO_FLAGS;
  
@@ -71659,10 +74323,11 @@ diff -urNp linux-3.1.3/net/batman-adv/send.c linux-3.1.3/net/batman-adv/send.c
  
        slide_own_bcast_window(hard_iface);
        send_time = own_send_time(bat_priv);
-diff -urNp linux-3.1.3/net/batman-adv/soft-interface.c linux-3.1.3/net/batman-adv/soft-interface.c
---- linux-3.1.3/net/batman-adv/soft-interface.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/batman-adv/soft-interface.c        2011-11-16 18:39:08.000000000 -0500
-@@ -632,7 +632,7 @@ static int interface_tx(struct sk_buff *
+diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
+index 05dd351..2ecd19b 100644
+--- a/net/batman-adv/soft-interface.c
++++ b/net/batman-adv/soft-interface.c
+@@ -632,7 +632,7 @@ static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface)
  
                /* set broadcast sequence number */
                bcast_packet->seqno =
@@ -71671,7 +74336,7 @@ diff -urNp linux-3.1.3/net/batman-adv/soft-interface.c linux-3.1.3/net/batman-ad
  
                add_bcast_packet_to_list(bat_priv, skb, 1);
  
-@@ -824,7 +824,7 @@ struct net_device *softif_create(const c
+@@ -824,7 +824,7 @@ struct net_device *softif_create(const char *name)
        atomic_set(&bat_priv->batman_queue_left, BATMAN_QUEUE_LEN);
  
        atomic_set(&bat_priv->mesh_state, MESH_INACTIVE);
@@ -71680,9 +74345,10 @@ diff -urNp linux-3.1.3/net/batman-adv/soft-interface.c linux-3.1.3/net/batman-ad
        atomic_set(&bat_priv->ttvn, 0);
        atomic_set(&bat_priv->tt_local_changes, 0);
        atomic_set(&bat_priv->tt_ogm_append_cnt, 0);
-diff -urNp linux-3.1.3/net/batman-adv/types.h linux-3.1.3/net/batman-adv/types.h
---- linux-3.1.3/net/batman-adv/types.h 2011-11-26 19:57:29.000000000 -0500
-+++ linux-3.1.3/net/batman-adv/types.h 2011-11-26 20:00:43.000000000 -0500
+diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
+index 51a0db7..b8a62be 100644
+--- a/net/batman-adv/types.h
++++ b/net/batman-adv/types.h
 @@ -38,8 +38,8 @@ struct hard_iface {
        int16_t if_num;
        char if_status;
@@ -71703,10 +74369,11 @@ diff -urNp linux-3.1.3/net/batman-adv/types.h linux-3.1.3/net/batman-adv/types.h
        atomic_t bcast_queue_left;
        atomic_t batman_queue_left;
        atomic_t ttvn; /* tranlation table version number */
-diff -urNp linux-3.1.3/net/batman-adv/unicast.c linux-3.1.3/net/batman-adv/unicast.c
---- linux-3.1.3/net/batman-adv/unicast.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/batman-adv/unicast.c       2011-11-16 18:39:08.000000000 -0500
-@@ -264,7 +264,7 @@ int frag_send_skb(struct sk_buff *skb, s
+diff --git a/net/batman-adv/unicast.c b/net/batman-adv/unicast.c
+index 32b125f..f1447e0 100644
+--- a/net/batman-adv/unicast.c
++++ b/net/batman-adv/unicast.c
+@@ -264,7 +264,7 @@ int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
        frag1->flags = UNI_FRAG_HEAD | large_tail;
        frag2->flags = large_tail;
  
@@ -71715,10 +74382,11 @@ diff -urNp linux-3.1.3/net/batman-adv/unicast.c linux-3.1.3/net/batman-adv/unica
        frag1->seqno = htons(seqno - 1);
        frag2->seqno = htons(seqno);
  
-diff -urNp linux-3.1.3/net/bluetooth/hci_conn.c linux-3.1.3/net/bluetooth/hci_conn.c
---- linux-3.1.3/net/bluetooth/hci_conn.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/bluetooth/hci_conn.c       2011-11-16 18:39:08.000000000 -0500
-@@ -218,7 +218,7 @@ void hci_le_start_enc(struct hci_conn *c
+diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
+index ea7f031..0615edc 100644
+--- a/net/bluetooth/hci_conn.c
++++ b/net/bluetooth/hci_conn.c
+@@ -218,7 +218,7 @@ void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __u8 rand[8],
        cp.handle = cpu_to_le16(conn->handle);
        memcpy(cp.ltk, ltk, sizeof(cp.ltk));
        cp.ediv = ediv;
@@ -71727,7 +74395,7 @@ diff -urNp linux-3.1.3/net/bluetooth/hci_conn.c linux-3.1.3/net/bluetooth/hci_co
  
        hci_send_cmd(hdev, HCI_OP_LE_START_ENC, sizeof(cp), &cp);
  }
-@@ -234,7 +234,7 @@ void hci_le_ltk_reply(struct hci_conn *c
+@@ -234,7 +234,7 @@ void hci_le_ltk_reply(struct hci_conn *conn, u8 ltk[16])
        memset(&cp, 0, sizeof(cp));
  
        cp.handle = cpu_to_le16(conn->handle);
@@ -71736,10 +74404,11 @@ diff -urNp linux-3.1.3/net/bluetooth/hci_conn.c linux-3.1.3/net/bluetooth/hci_co
  
        hci_send_cmd(hdev, HCI_OP_LE_LTK_REPLY, sizeof(cp), &cp);
  }
-diff -urNp linux-3.1.3/net/bridge/br_multicast.c linux-3.1.3/net/bridge/br_multicast.c
---- linux-3.1.3/net/bridge/br_multicast.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/bridge/br_multicast.c      2011-11-16 18:39:08.000000000 -0500
-@@ -1485,7 +1485,7 @@ static int br_multicast_ipv6_rcv(struct 
+diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
+index e79ff75..215b57d 100644
+--- a/net/bridge/br_multicast.c
++++ b/net/bridge/br_multicast.c
+@@ -1485,7 +1485,7 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br,
        nexthdr = ip6h->nexthdr;
        offset = ipv6_skip_exthdr(skb, sizeof(*ip6h), &nexthdr);
  
@@ -71748,10 +74417,11 @@ diff -urNp linux-3.1.3/net/bridge/br_multicast.c linux-3.1.3/net/bridge/br_multi
                return 0;
  
        /* Okay, we found ICMPv6 header */
-diff -urNp linux-3.1.3/net/bridge/netfilter/ebtables.c linux-3.1.3/net/bridge/netfilter/ebtables.c
---- linux-3.1.3/net/bridge/netfilter/ebtables.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/bridge/netfilter/ebtables.c        2011-11-16 18:40:44.000000000 -0500
-@@ -1513,7 +1513,7 @@ static int do_ebt_get_ctl(struct sock *s
+diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
+index 5864cc4..94cab18 100644
+--- a/net/bridge/netfilter/ebtables.c
++++ b/net/bridge/netfilter/ebtables.c
+@@ -1513,7 +1513,7 @@ static int do_ebt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
                        tmp.valid_hooks = t->table->valid_hooks;
                }
                mutex_unlock(&ebt_mutex);
@@ -71760,7 +74430,7 @@ diff -urNp linux-3.1.3/net/bridge/netfilter/ebtables.c linux-3.1.3/net/bridge/ne
                        BUGPRINT("c2u Didn't work\n");
                        ret = -EFAULT;
                        break;
-@@ -1781,6 +1781,8 @@ static int compat_copy_everything_to_use
+@@ -1781,6 +1781,8 @@ static int compat_copy_everything_to_user(struct ebt_table *t,
        int ret;
        void __user *pos;
  
@@ -71769,9 +74439,10 @@ diff -urNp linux-3.1.3/net/bridge/netfilter/ebtables.c linux-3.1.3/net/bridge/ne
        memset(&tinfo, 0, sizeof(tinfo));
  
        if (cmd == EBT_SO_GET_ENTRIES) {
-diff -urNp linux-3.1.3/net/caif/caif_socket.c linux-3.1.3/net/caif/caif_socket.c
---- linux-3.1.3/net/caif/caif_socket.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/caif/caif_socket.c 2011-11-16 18:39:08.000000000 -0500
+diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c
+index a986280..13444a1 100644
+--- a/net/caif/caif_socket.c
++++ b/net/caif/caif_socket.c
 @@ -48,19 +48,20 @@ static struct dentry *debugfsdir;
  #ifdef CONFIG_DEBUG_FS
  struct debug_fs_counter {
@@ -71803,7 +74474,7 @@ diff -urNp linux-3.1.3/net/caif/caif_socket.c linux-3.1.3/net/caif/caif_socket.c
  #define       dbfs_atomic_dec(v) atomic_dec_return(v)
  #else
  #define       dbfs_atomic_inc(v) 0
-@@ -161,7 +162,7 @@ static int caif_queue_rcv_skb(struct soc
+@@ -161,7 +162,7 @@ static int caif_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
                                        atomic_read(&cf_sk->sk.sk_rmem_alloc),
                                        sk_rcvbuf_lowwater(cf_sk));
                set_rx_flow_off(cf_sk);
@@ -71812,7 +74483,7 @@ diff -urNp linux-3.1.3/net/caif/caif_socket.c linux-3.1.3/net/caif/caif_socket.c
                caif_flow_ctrl(sk, CAIF_MODEMCMD_FLOW_OFF_REQ);
        }
  
-@@ -172,7 +173,7 @@ static int caif_queue_rcv_skb(struct soc
+@@ -172,7 +173,7 @@ static int caif_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
                set_rx_flow_off(cf_sk);
                if (net_ratelimit())
                        pr_debug("sending flow OFF due to rmem_schedule\n");
@@ -71821,7 +74492,7 @@ diff -urNp linux-3.1.3/net/caif/caif_socket.c linux-3.1.3/net/caif/caif_socket.c
                caif_flow_ctrl(sk, CAIF_MODEMCMD_FLOW_OFF_REQ);
        }
        skb->dev = NULL;
-@@ -233,14 +234,14 @@ static void caif_ctrl_cb(struct cflayer 
+@@ -233,14 +234,14 @@ static void caif_ctrl_cb(struct cflayer *layr,
        switch (flow) {
        case CAIF_CTRLCMD_FLOW_ON_IND:
                /* OK from modem to start sending again */
@@ -71838,7 +74509,7 @@ diff -urNp linux-3.1.3/net/caif/caif_socket.c linux-3.1.3/net/caif/caif_socket.c
                set_tx_flow_off(cf_sk);
                cf_sk->sk.sk_state_change(&cf_sk->sk);
                break;
-@@ -249,7 +250,7 @@ static void caif_ctrl_cb(struct cflayer 
+@@ -249,7 +250,7 @@ static void caif_ctrl_cb(struct cflayer *layr,
                /* We're now connected */
                caif_client_register_refcnt(&cf_sk->layer,
                                                cfsk_hold, cfsk_put);
@@ -71847,7 +74518,7 @@ diff -urNp linux-3.1.3/net/caif/caif_socket.c linux-3.1.3/net/caif/caif_socket.c
                cf_sk->sk.sk_state = CAIF_CONNECTED;
                set_tx_flow_on(cf_sk);
                cf_sk->sk.sk_state_change(&cf_sk->sk);
-@@ -263,7 +264,7 @@ static void caif_ctrl_cb(struct cflayer 
+@@ -263,7 +264,7 @@ static void caif_ctrl_cb(struct cflayer *layr,
  
        case CAIF_CTRLCMD_INIT_FAIL_RSP:
                /* Connect request failed */
@@ -71856,7 +74527,7 @@ diff -urNp linux-3.1.3/net/caif/caif_socket.c linux-3.1.3/net/caif/caif_socket.c
                cf_sk->sk.sk_err = ECONNREFUSED;
                cf_sk->sk.sk_state = CAIF_DISCONNECTED;
                cf_sk->sk.sk_shutdown = SHUTDOWN_MASK;
-@@ -277,7 +278,7 @@ static void caif_ctrl_cb(struct cflayer 
+@@ -277,7 +278,7 @@ static void caif_ctrl_cb(struct cflayer *layr,
  
        case CAIF_CTRLCMD_REMOTE_SHUTDOWN_IND:
                /* Modem has closed this connection, or device is down. */
@@ -71865,7 +74536,7 @@ diff -urNp linux-3.1.3/net/caif/caif_socket.c linux-3.1.3/net/caif/caif_socket.c
                cf_sk->sk.sk_shutdown = SHUTDOWN_MASK;
                cf_sk->sk.sk_err = ECONNRESET;
                set_rx_flow_on(cf_sk);
-@@ -297,7 +298,7 @@ static void caif_check_flow_release(stru
+@@ -297,7 +298,7 @@ static void caif_check_flow_release(struct sock *sk)
                return;
  
        if (atomic_read(&sk->sk_rmem_alloc) <= sk_rcvbuf_lowwater(cf_sk)) {
@@ -71874,7 +74545,7 @@ diff -urNp linux-3.1.3/net/caif/caif_socket.c linux-3.1.3/net/caif/caif_socket.c
                        set_rx_flow_on(cf_sk);
                        caif_flow_ctrl(sk, CAIF_MODEMCMD_FLOW_ON_REQ);
        }
-@@ -854,7 +855,7 @@ static int caif_connect(struct socket *s
+@@ -854,7 +855,7 @@ static int caif_connect(struct socket *sock, struct sockaddr *uaddr,
        /*ifindex = id of the interface.*/
        cf_sk->conn_req.ifindex = cf_sk->sk.sk_bound_dev_if;
  
@@ -71883,7 +74554,7 @@ diff -urNp linux-3.1.3/net/caif/caif_socket.c linux-3.1.3/net/caif/caif_socket.c
        cf_sk->layer.receive = caif_sktrecv_cb;
  
        err = caif_connect_client(sock_net(sk), &cf_sk->conn_req,
-@@ -943,7 +944,7 @@ static int caif_release(struct socket *s
+@@ -943,7 +944,7 @@ static int caif_release(struct socket *sock)
        spin_unlock_bh(&sk->sk_receive_queue.lock);
        sock->sk = NULL;
  
@@ -71892,7 +74563,7 @@ diff -urNp linux-3.1.3/net/caif/caif_socket.c linux-3.1.3/net/caif/caif_socket.c
  
        WARN_ON(IS_ERR(cf_sk->debugfs_socket_dir));
        if (cf_sk->debugfs_socket_dir != NULL)
-@@ -1122,7 +1123,7 @@ static int caif_create(struct net *net, 
+@@ -1122,7 +1123,7 @@ static int caif_create(struct net *net, struct socket *sock, int protocol,
        cf_sk->conn_req.protocol = protocol;
        /* Increase the number of sockets created. */
        dbfs_atomic_inc(&cnt.caif_nr_socks);
@@ -71901,9 +74572,10 @@ diff -urNp linux-3.1.3/net/caif/caif_socket.c linux-3.1.3/net/caif/caif_socket.c
  #ifdef CONFIG_DEBUG_FS
        if (!IS_ERR(debugfsdir)) {
  
-diff -urNp linux-3.1.3/net/caif/cfctrl.c linux-3.1.3/net/caif/cfctrl.c
---- linux-3.1.3/net/caif/cfctrl.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/caif/cfctrl.c      2011-11-16 18:40:44.000000000 -0500
+diff --git a/net/caif/cfctrl.c b/net/caif/cfctrl.c
+index e22671b..6598ea0 100644
+--- a/net/caif/cfctrl.c
++++ b/net/caif/cfctrl.c
 @@ -9,6 +9,7 @@
  #include <linux/stddef.h>
  #include <linux/spinlock.h>
@@ -71923,7 +74595,7 @@ diff -urNp linux-3.1.3/net/caif/cfctrl.c linux-3.1.3/net/caif/cfctrl.c
        this->serv.layer.receive = cfctrl_recv;
        sprintf(this->serv.layer.name, "ctrl");
        this->serv.layer.ctrlcmd = cfctrl_ctrlcmd;
-@@ -132,8 +133,8 @@ static void cfctrl_insert_req(struct cfc
+@@ -132,8 +133,8 @@ static void cfctrl_insert_req(struct cfctrl *ctrl,
                              struct cfctrl_request_info *req)
  {
        spin_lock_bh(&ctrl->info_list_lock);
@@ -71934,7 +74606,7 @@ diff -urNp linux-3.1.3/net/caif/cfctrl.c linux-3.1.3/net/caif/cfctrl.c
        list_add_tail(&req->list, &ctrl->list);
        spin_unlock_bh(&ctrl->info_list_lock);
  }
-@@ -151,7 +152,7 @@ static struct cfctrl_request_info *cfctr
+@@ -151,7 +152,7 @@ static struct cfctrl_request_info *cfctrl_remove_req(struct cfctrl *ctrl,
                        if (p != first)
                                pr_warn("Requests are not received in order\n");
  
@@ -71943,7 +74615,7 @@ diff -urNp linux-3.1.3/net/caif/cfctrl.c linux-3.1.3/net/caif/cfctrl.c
                                         p->sequence_no);
                        list_del(&p->list);
                        goto out;
-@@ -364,6 +365,7 @@ static int cfctrl_recv(struct cflayer *l
+@@ -364,6 +365,7 @@ static int cfctrl_recv(struct cflayer *layer, struct cfpkt *pkt)
        struct cfctrl *cfctrl = container_obj(layer);
        struct cfctrl_request_info rsp, *req;
  
@@ -71951,10 +74623,11 @@ diff -urNp linux-3.1.3/net/caif/cfctrl.c linux-3.1.3/net/caif/cfctrl.c
  
        cfpkt_extr_head(pkt, &cmdrsp, 1);
        cmd = cmdrsp & CFCTRL_CMD_MASK;
-diff -urNp linux-3.1.3/net/compat.c linux-3.1.3/net/compat.c
---- linux-3.1.3/net/compat.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/compat.c   2011-11-16 18:39:08.000000000 -0500
-@@ -70,9 +70,9 @@ int get_compat_msghdr(struct msghdr *kms
+diff --git a/net/compat.c b/net/compat.c
+index c578d93..257fab7 100644
+--- a/net/compat.c
++++ b/net/compat.c
+@@ -70,9 +70,9 @@ int get_compat_msghdr(struct msghdr *kmsg, struct compat_msghdr __user *umsg)
            __get_user(kmsg->msg_controllen, &umsg->msg_controllen) ||
            __get_user(kmsg->msg_flags, &umsg->msg_flags))
                return -EFAULT;
@@ -71967,7 +74640,7 @@ diff -urNp linux-3.1.3/net/compat.c linux-3.1.3/net/compat.c
        return 0;
  }
  
-@@ -84,7 +84,7 @@ int verify_compat_iovec(struct msghdr *k
+@@ -84,7 +84,7 @@ int verify_compat_iovec(struct msghdr *kern_msg, struct iovec *kern_iov,
  
        if (kern_msg->msg_namelen) {
                if (mode == VERIFY_READ) {
@@ -71976,7 +74649,7 @@ diff -urNp linux-3.1.3/net/compat.c linux-3.1.3/net/compat.c
                                                      kern_msg->msg_namelen,
                                                      kern_address);
                        if (err < 0)
-@@ -95,7 +95,7 @@ int verify_compat_iovec(struct msghdr *k
+@@ -95,7 +95,7 @@ int verify_compat_iovec(struct msghdr *kern_msg, struct iovec *kern_iov,
                kern_msg->msg_name = NULL;
  
        tot_len = iov_from_user_compat_to_kern(kern_iov,
@@ -71985,7 +74658,7 @@ diff -urNp linux-3.1.3/net/compat.c linux-3.1.3/net/compat.c
                                          kern_msg->msg_iovlen);
        if (tot_len >= 0)
                kern_msg->msg_iov = kern_iov;
-@@ -115,20 +115,20 @@ int verify_compat_iovec(struct msghdr *k
+@@ -115,20 +115,20 @@ int verify_compat_iovec(struct msghdr *kern_msg, struct iovec *kern_iov,
  
  #define CMSG_COMPAT_FIRSTHDR(msg)                     \
        (((msg)->msg_controllen) >= sizeof(struct compat_cmsghdr) ?     \
@@ -72009,7 +74682,7 @@ diff -urNp linux-3.1.3/net/compat.c linux-3.1.3/net/compat.c
                        msg->msg_controllen)
                return NULL;
        return (struct compat_cmsghdr __user *)ptr;
-@@ -220,7 +220,7 @@ int put_cmsg_compat(struct msghdr *kmsg,
+@@ -220,7 +220,7 @@ int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *dat
  {
        struct compat_timeval ctv;
        struct compat_timespec cts[3];
@@ -72018,7 +74691,7 @@ diff -urNp linux-3.1.3/net/compat.c linux-3.1.3/net/compat.c
        struct compat_cmsghdr cmhdr;
        int cmlen;
  
-@@ -272,7 +272,7 @@ int put_cmsg_compat(struct msghdr *kmsg,
+@@ -272,7 +272,7 @@ int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *dat
  
  void scm_detach_fds_compat(struct msghdr *kmsg, struct scm_cookie *scm)
  {
@@ -72027,7 +74700,7 @@ diff -urNp linux-3.1.3/net/compat.c linux-3.1.3/net/compat.c
        int fdmax = (kmsg->msg_controllen - sizeof(struct compat_cmsghdr)) / sizeof(int);
        int fdnum = scm->fp->count;
        struct file **fp = scm->fp->fp;
-@@ -369,7 +369,7 @@ static int do_set_sock_timeout(struct so
+@@ -369,7 +369,7 @@ static int do_set_sock_timeout(struct socket *sock, int level,
                return -EFAULT;
        old_fs = get_fs();
        set_fs(KERNEL_DS);
@@ -72036,7 +74709,7 @@ diff -urNp linux-3.1.3/net/compat.c linux-3.1.3/net/compat.c
        set_fs(old_fs);
  
        return err;
-@@ -430,7 +430,7 @@ static int do_get_sock_timeout(struct so
+@@ -430,7 +430,7 @@ static int do_get_sock_timeout(struct socket *sock, int level, int optname,
        len = sizeof(ktime);
        old_fs = get_fs();
        set_fs(KERNEL_DS);
@@ -72045,7 +74718,7 @@ diff -urNp linux-3.1.3/net/compat.c linux-3.1.3/net/compat.c
        set_fs(old_fs);
  
        if (!err) {
-@@ -565,7 +565,7 @@ int compat_mc_setsockopt(struct sock *so
+@@ -565,7 +565,7 @@ int compat_mc_setsockopt(struct sock *sock, int level, int optname,
        case MCAST_JOIN_GROUP:
        case MCAST_LEAVE_GROUP:
        {
@@ -72054,7 +74727,7 @@ diff -urNp linux-3.1.3/net/compat.c linux-3.1.3/net/compat.c
                struct group_req __user *kgr =
                        compat_alloc_user_space(sizeof(struct group_req));
                u32 interface;
-@@ -586,7 +586,7 @@ int compat_mc_setsockopt(struct sock *so
+@@ -586,7 +586,7 @@ int compat_mc_setsockopt(struct sock *sock, int level, int optname,
        case MCAST_BLOCK_SOURCE:
        case MCAST_UNBLOCK_SOURCE:
        {
@@ -72063,7 +74736,7 @@ diff -urNp linux-3.1.3/net/compat.c linux-3.1.3/net/compat.c
                struct group_source_req __user *kgsr = compat_alloc_user_space(
                        sizeof(struct group_source_req));
                u32 interface;
-@@ -607,7 +607,7 @@ int compat_mc_setsockopt(struct sock *so
+@@ -607,7 +607,7 @@ int compat_mc_setsockopt(struct sock *sock, int level, int optname,
        }
        case MCAST_MSFILTER:
        {
@@ -72072,7 +74745,7 @@ diff -urNp linux-3.1.3/net/compat.c linux-3.1.3/net/compat.c
                struct group_filter __user *kgf;
                u32 interface, fmode, numsrc;
  
-@@ -645,7 +645,7 @@ int compat_mc_getsockopt(struct sock *so
+@@ -645,7 +645,7 @@ int compat_mc_getsockopt(struct sock *sock, int level, int optname,
        char __user *optval, int __user *optlen,
        int (*getsockopt)(struct sock *, int, int, char __user *, int __user *))
  {
@@ -72081,10 +74754,11 @@ diff -urNp linux-3.1.3/net/compat.c linux-3.1.3/net/compat.c
        struct group_filter __user *kgf;
        int __user      *koptlen;
        u32 interface, fmode, numsrc;
-diff -urNp linux-3.1.3/net/core/datagram.c linux-3.1.3/net/core/datagram.c
---- linux-3.1.3/net/core/datagram.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/core/datagram.c    2011-11-16 18:39:08.000000000 -0500
-@@ -285,7 +285,7 @@ int skb_kill_datagram(struct sock *sk, s
+diff --git a/net/core/datagram.c b/net/core/datagram.c
+index 18ac112..fe95ed9 100644
+--- a/net/core/datagram.c
++++ b/net/core/datagram.c
+@@ -285,7 +285,7 @@ int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, unsigned int flags)
        }
  
        kfree_skb(skb);
@@ -72093,10 +74767,11 @@ diff -urNp linux-3.1.3/net/core/datagram.c linux-3.1.3/net/core/datagram.c
        sk_mem_reclaim_partial(sk);
  
        return err;
-diff -urNp linux-3.1.3/net/core/dev.c linux-3.1.3/net/core/dev.c
---- linux-3.1.3/net/core/dev.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/core/dev.c 2011-11-16 18:40:44.000000000 -0500
-@@ -1135,10 +1135,14 @@ void dev_load(struct net *net, const cha
+diff --git a/net/core/dev.c b/net/core/dev.c
+index ae5cf2d..2c950a1 100644
+--- a/net/core/dev.c
++++ b/net/core/dev.c
+@@ -1135,10 +1135,14 @@ void dev_load(struct net *net, const char *name)
        if (no_module && capable(CAP_NET_ADMIN))
                no_module = request_module("netdev-%s", name);
        if (no_module && capable(CAP_SYS_MODULE)) {
@@ -72111,7 +74786,7 @@ diff -urNp linux-3.1.3/net/core/dev.c linux-3.1.3/net/core/dev.c
        }
  }
  EXPORT_SYMBOL(dev_load);
-@@ -1977,7 +1981,7 @@ static int illegal_highdma(struct net_de
+@@ -1977,7 +1981,7 @@ static int illegal_highdma(struct net_device *dev, struct sk_buff *skb)
  
  struct dev_gso_cb {
        void (*destructor)(struct sk_buff *skb);
@@ -72129,7 +74804,7 @@ diff -urNp linux-3.1.3/net/core/dev.c linux-3.1.3/net/core/dev.c
  {
        struct softnet_data *sd = &__get_cpu_var(softnet_data);
  
-@@ -3779,7 +3783,7 @@ void netif_napi_del(struct napi_struct *
+@@ -3779,7 +3783,7 @@ void netif_napi_del(struct napi_struct *napi)
  }
  EXPORT_SYMBOL(netif_napi_del);
  
@@ -72138,9 +74813,10 @@ diff -urNp linux-3.1.3/net/core/dev.c linux-3.1.3/net/core/dev.c
  {
        struct softnet_data *sd = &__get_cpu_var(softnet_data);
        unsigned long time_limit = jiffies + 2;
-diff -urNp linux-3.1.3/net/core/flow.c linux-3.1.3/net/core/flow.c
---- linux-3.1.3/net/core/flow.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/core/flow.c        2011-11-16 18:39:08.000000000 -0500
+diff --git a/net/core/flow.c b/net/core/flow.c
+index 555a456..de48421 100644
+--- a/net/core/flow.c
++++ b/net/core/flow.c
 @@ -61,7 +61,7 @@ struct flow_cache {
        struct timer_list               rnd_timer;
  };
@@ -72150,7 +74826,7 @@ diff -urNp linux-3.1.3/net/core/flow.c linux-3.1.3/net/core/flow.c
  EXPORT_SYMBOL(flow_cache_genid);
  static struct flow_cache flow_cache_global;
  static struct kmem_cache *flow_cachep __read_mostly;
-@@ -86,7 +86,7 @@ static void flow_cache_new_hashrnd(unsig
+@@ -86,7 +86,7 @@ static void flow_cache_new_hashrnd(unsigned long arg)
  
  static int flow_entry_valid(struct flow_cache_entry *fle)
  {
@@ -72159,7 +74835,7 @@ diff -urNp linux-3.1.3/net/core/flow.c linux-3.1.3/net/core/flow.c
                return 0;
        if (fle->object && !fle->object->ops->check(fle->object))
                return 0;
-@@ -259,7 +259,7 @@ flow_cache_lookup(struct net *net, const
+@@ -259,7 +259,7 @@ flow_cache_lookup(struct net *net, const struct flowi *key, u16 family, u8 dir,
                        hlist_add_head(&fle->u.hlist, &fcp->hash_table[hash]);
                        fcp->hash_count++;
                }
@@ -72177,10 +74853,11 @@ diff -urNp linux-3.1.3/net/core/flow.c linux-3.1.3/net/core/flow.c
                if (!IS_ERR(flo))
                        fle->object = flo;
                else
-diff -urNp linux-3.1.3/net/core/iovec.c linux-3.1.3/net/core/iovec.c
---- linux-3.1.3/net/core/iovec.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/core/iovec.c       2011-11-16 18:39:08.000000000 -0500
-@@ -42,7 +42,7 @@ int verify_iovec(struct msghdr *m, struc
+diff --git a/net/core/iovec.c b/net/core/iovec.c
+index c40f27e..7f49254 100644
+--- a/net/core/iovec.c
++++ b/net/core/iovec.c
+@@ -42,7 +42,7 @@ int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address,
        if (m->msg_namelen) {
                if (mode == VERIFY_READ) {
                        void __user *namep;
@@ -72189,7 +74866,7 @@ diff -urNp linux-3.1.3/net/core/iovec.c linux-3.1.3/net/core/iovec.c
                        err = move_addr_to_kernel(namep, m->msg_namelen,
                                                  address);
                        if (err < 0)
-@@ -54,7 +54,7 @@ int verify_iovec(struct msghdr *m, struc
+@@ -54,7 +54,7 @@ int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address,
        }
  
        size = m->msg_iovlen * sizeof(struct iovec);
@@ -72198,9 +74875,10 @@ diff -urNp linux-3.1.3/net/core/iovec.c linux-3.1.3/net/core/iovec.c
                return -EFAULT;
  
        m->msg_iov = iov;
-diff -urNp linux-3.1.3/net/core/rtnetlink.c linux-3.1.3/net/core/rtnetlink.c
---- linux-3.1.3/net/core/rtnetlink.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/core/rtnetlink.c   2011-11-16 18:39:08.000000000 -0500
+diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
+index 99d9e95..209bae2 100644
+--- a/net/core/rtnetlink.c
++++ b/net/core/rtnetlink.c
 @@ -57,7 +57,7 @@ struct rtnl_link {
        rtnl_doit_func          doit;
        rtnl_dumpit_func        dumpit;
@@ -72210,9 +74888,10 @@ diff -urNp linux-3.1.3/net/core/rtnetlink.c linux-3.1.3/net/core/rtnetlink.c
  
  static DEFINE_MUTEX(rtnl_mutex);
  static u16 min_ifinfo_dump_size;
-diff -urNp linux-3.1.3/net/core/scm.c linux-3.1.3/net/core/scm.c
---- linux-3.1.3/net/core/scm.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/core/scm.c 2011-11-16 18:39:08.000000000 -0500
+diff --git a/net/core/scm.c b/net/core/scm.c
+index 811b53f..5d6c343 100644
+--- a/net/core/scm.c
++++ b/net/core/scm.c
 @@ -218,7 +218,7 @@ EXPORT_SYMBOL(__scm_send);
  int put_cmsg(struct msghdr * msg, int level, int type, int len, void *data)
  {
@@ -72222,7 +74901,7 @@ diff -urNp linux-3.1.3/net/core/scm.c linux-3.1.3/net/core/scm.c
        struct cmsghdr cmhdr;
        int cmlen = CMSG_LEN(len);
        int err;
-@@ -241,7 +241,7 @@ int put_cmsg(struct msghdr * msg, int le
+@@ -241,7 +241,7 @@ int put_cmsg(struct msghdr * msg, int level, int type, int len, void *data)
        err = -EFAULT;
        if (copy_to_user(cm, &cmhdr, sizeof cmhdr))
                goto out;
@@ -72240,7 +74919,7 @@ diff -urNp linux-3.1.3/net/core/scm.c linux-3.1.3/net/core/scm.c
  
        int fdmax = 0;
        int fdnum = scm->fp->count;
-@@ -277,7 +277,7 @@ void scm_detach_fds(struct msghdr *msg, 
+@@ -277,7 +277,7 @@ void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm)
        if (fdnum < fdmax)
                fdmax = fdnum;
  
@@ -72249,10 +74928,11 @@ diff -urNp linux-3.1.3/net/core/scm.c linux-3.1.3/net/core/scm.c
             i++, cmfptr++)
        {
                int new_fd;
-diff -urNp linux-3.1.3/net/core/skbuff.c linux-3.1.3/net/core/skbuff.c
---- linux-3.1.3/net/core/skbuff.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/core/skbuff.c      2011-11-16 18:40:44.000000000 -0500
-@@ -1650,6 +1650,8 @@ int skb_splice_bits(struct sk_buff *skb,
+diff --git a/net/core/skbuff.c b/net/core/skbuff.c
+index 387703f..035abcf 100644
+--- a/net/core/skbuff.c
++++ b/net/core/skbuff.c
+@@ -1650,6 +1650,8 @@ int skb_splice_bits(struct sk_buff *skb, unsigned int offset,
        struct sock *sk = skb->sk;
        int ret = 0;
  
@@ -72261,10 +74941,11 @@ diff -urNp linux-3.1.3/net/core/skbuff.c linux-3.1.3/net/core/skbuff.c
        if (splice_grow_spd(pipe, &spd))
                return -ENOMEM;
  
-diff -urNp linux-3.1.3/net/core/sock.c linux-3.1.3/net/core/sock.c
---- linux-3.1.3/net/core/sock.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/core/sock.c        2011-11-16 18:40:44.000000000 -0500
-@@ -293,7 +293,7 @@ int sock_queue_rcv_skb(struct sock *sk, 
+diff --git a/net/core/sock.c b/net/core/sock.c
+index 11d67b3..df26d4b 100644
+--- a/net/core/sock.c
++++ b/net/core/sock.c
+@@ -293,7 +293,7 @@ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
         */
        if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >=
            (unsigned)sk->sk_rcvbuf) {
@@ -72273,7 +74954,7 @@ diff -urNp linux-3.1.3/net/core/sock.c linux-3.1.3/net/core/sock.c
                trace_sock_rcvqueue_full(sk, skb);
                return -ENOMEM;
        }
-@@ -303,7 +303,7 @@ int sock_queue_rcv_skb(struct sock *sk, 
+@@ -303,7 +303,7 @@ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
                return err;
  
        if (!sk_rmem_schedule(sk, skb->truesize)) {
@@ -72282,7 +74963,7 @@ diff -urNp linux-3.1.3/net/core/sock.c linux-3.1.3/net/core/sock.c
                return -ENOBUFS;
        }
  
-@@ -323,7 +323,7 @@ int sock_queue_rcv_skb(struct sock *sk, 
+@@ -323,7 +323,7 @@ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
        skb_dst_force(skb);
  
        spin_lock_irqsave(&list->lock, flags);
@@ -72291,7 +74972,7 @@ diff -urNp linux-3.1.3/net/core/sock.c linux-3.1.3/net/core/sock.c
        __skb_queue_tail(list, skb);
        spin_unlock_irqrestore(&list->lock, flags);
  
-@@ -343,7 +343,7 @@ int sk_receive_skb(struct sock *sk, stru
+@@ -343,7 +343,7 @@ int sk_receive_skb(struct sock *sk, struct sk_buff *skb, const int nested)
        skb->dev = NULL;
  
        if (sk_rcvqueues_full(sk, skb)) {
@@ -72300,7 +74981,7 @@ diff -urNp linux-3.1.3/net/core/sock.c linux-3.1.3/net/core/sock.c
                goto discard_and_relse;
        }
        if (nested)
-@@ -361,7 +361,7 @@ int sk_receive_skb(struct sock *sk, stru
+@@ -361,7 +361,7 @@ int sk_receive_skb(struct sock *sk, struct sk_buff *skb, const int nested)
                mutex_release(&sk->sk_lock.dep_map, 1, _RET_IP_);
        } else if (sk_add_backlog(sk, skb)) {
                bh_unlock_sock(sk);
@@ -72309,7 +74990,7 @@ diff -urNp linux-3.1.3/net/core/sock.c linux-3.1.3/net/core/sock.c
                goto discard_and_relse;
        }
  
-@@ -924,7 +924,7 @@ int sock_getsockopt(struct socket *sock,
+@@ -924,7 +924,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
                if (len > sizeof(peercred))
                        len = sizeof(peercred);
                cred_to_ucred(sk->sk_peer_pid, sk->sk_peer_cred, &peercred);
@@ -72318,7 +74999,7 @@ diff -urNp linux-3.1.3/net/core/sock.c linux-3.1.3/net/core/sock.c
                        return -EFAULT;
                goto lenout;
        }
-@@ -937,7 +937,7 @@ int sock_getsockopt(struct socket *sock,
+@@ -937,7 +937,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
                        return -ENOTCONN;
                if (lv < len)
                        return -EINVAL;
@@ -72327,7 +75008,7 @@ diff -urNp linux-3.1.3/net/core/sock.c linux-3.1.3/net/core/sock.c
                        return -EFAULT;
                goto lenout;
        }
-@@ -970,7 +970,7 @@ int sock_getsockopt(struct socket *sock,
+@@ -970,7 +970,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
  
        if (len > lv)
                len = lv;
@@ -72336,7 +75017,7 @@ diff -urNp linux-3.1.3/net/core/sock.c linux-3.1.3/net/core/sock.c
                return -EFAULT;
  lenout:
        if (put_user(len, optlen))
-@@ -2029,7 +2029,7 @@ void sock_init_data(struct socket *sock,
+@@ -2029,7 +2029,7 @@ void sock_init_data(struct socket *sock, struct sock *sk)
         */
        smp_wmb();
        atomic_set(&sk->sk_refcnt, 1);
@@ -72345,10 +75026,11 @@ diff -urNp linux-3.1.3/net/core/sock.c linux-3.1.3/net/core/sock.c
  }
  EXPORT_SYMBOL(sock_init_data);
  
-diff -urNp linux-3.1.3/net/decnet/sysctl_net_decnet.c linux-3.1.3/net/decnet/sysctl_net_decnet.c
---- linux-3.1.3/net/decnet/sysctl_net_decnet.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/decnet/sysctl_net_decnet.c 2011-11-16 18:39:08.000000000 -0500
-@@ -174,7 +174,7 @@ static int dn_node_address_handler(ctl_t
+diff --git a/net/decnet/sysctl_net_decnet.c b/net/decnet/sysctl_net_decnet.c
+index 02e75d1..9a57a7c 100644
+--- a/net/decnet/sysctl_net_decnet.c
++++ b/net/decnet/sysctl_net_decnet.c
+@@ -174,7 +174,7 @@ static int dn_node_address_handler(ctl_table *table, int write,
  
        if (len > *lenp) len = *lenp;
  
@@ -72357,7 +75039,7 @@ diff -urNp linux-3.1.3/net/decnet/sysctl_net_decnet.c linux-3.1.3/net/decnet/sys
                return -EFAULT;
  
        *lenp = len;
-@@ -237,7 +237,7 @@ static int dn_def_dev_handler(ctl_table 
+@@ -237,7 +237,7 @@ static int dn_def_dev_handler(ctl_table *table, int write,
  
        if (len > *lenp) len = *lenp;
  
@@ -72366,9 +75048,10 @@ diff -urNp linux-3.1.3/net/decnet/sysctl_net_decnet.c linux-3.1.3/net/decnet/sys
                return -EFAULT;
  
        *lenp = len;
-diff -urNp linux-3.1.3/net/econet/Kconfig linux-3.1.3/net/econet/Kconfig
---- linux-3.1.3/net/econet/Kconfig     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/econet/Kconfig     2011-11-16 18:40:44.000000000 -0500
+diff --git a/net/econet/Kconfig b/net/econet/Kconfig
+index 39a2d29..f39c0fe 100644
+--- a/net/econet/Kconfig
++++ b/net/econet/Kconfig
 @@ -4,7 +4,7 @@
  
  config ECONET
@@ -72378,10 +75061,11 @@ diff -urNp linux-3.1.3/net/econet/Kconfig linux-3.1.3/net/econet/Kconfig
        ---help---
          Econet is a fairly old and slow networking protocol mainly used by
          Acorn computers to access file and print servers. It uses native
-diff -urNp linux-3.1.3/net/ipv4/fib_frontend.c linux-3.1.3/net/ipv4/fib_frontend.c
---- linux-3.1.3/net/ipv4/fib_frontend.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/ipv4/fib_frontend.c        2011-11-16 18:39:08.000000000 -0500
-@@ -970,12 +970,12 @@ static int fib_inetaddr_event(struct not
+diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
+index 92fc5f6..b790d91 100644
+--- a/net/ipv4/fib_frontend.c
++++ b/net/ipv4/fib_frontend.c
+@@ -970,12 +970,12 @@ static int fib_inetaddr_event(struct notifier_block *this, unsigned long event,
  #ifdef CONFIG_IP_ROUTE_MULTIPATH
                fib_sync_up(dev);
  #endif
@@ -72396,7 +75080,7 @@ diff -urNp linux-3.1.3/net/ipv4/fib_frontend.c linux-3.1.3/net/ipv4/fib_frontend
                if (ifa->ifa_dev->ifa_list == NULL) {
                        /* Last address was deleted from this interface.
                         * Disable IP.
-@@ -1011,7 +1011,7 @@ static int fib_netdev_event(struct notif
+@@ -1011,7 +1011,7 @@ static int fib_netdev_event(struct notifier_block *this, unsigned long event, vo
  #ifdef CONFIG_IP_ROUTE_MULTIPATH
                fib_sync_up(dev);
  #endif
@@ -72405,10 +75089,11 @@ diff -urNp linux-3.1.3/net/ipv4/fib_frontend.c linux-3.1.3/net/ipv4/fib_frontend
                rt_cache_flush(dev_net(dev), -1);
                break;
        case NETDEV_DOWN:
-diff -urNp linux-3.1.3/net/ipv4/fib_semantics.c linux-3.1.3/net/ipv4/fib_semantics.c
---- linux-3.1.3/net/ipv4/fib_semantics.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/ipv4/fib_semantics.c       2011-11-16 18:39:08.000000000 -0500
-@@ -699,7 +699,7 @@ __be32 fib_info_update_nh_saddr(struct n
+diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
+index 80106d8..232e898 100644
+--- a/net/ipv4/fib_semantics.c
++++ b/net/ipv4/fib_semantics.c
+@@ -699,7 +699,7 @@ __be32 fib_info_update_nh_saddr(struct net *net, struct fib_nh *nh)
        nh->nh_saddr = inet_select_addr(nh->nh_dev,
                                        nh->nh_gw,
                                        nh->nh_parent->fib_scope);
@@ -72417,10 +75102,11 @@ diff -urNp linux-3.1.3/net/ipv4/fib_semantics.c linux-3.1.3/net/ipv4/fib_semanti
  
        return nh->nh_saddr;
  }
-diff -urNp linux-3.1.3/net/ipv4/inet_diag.c linux-3.1.3/net/ipv4/inet_diag.c
---- linux-3.1.3/net/ipv4/inet_diag.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/ipv4/inet_diag.c   2011-11-16 18:40:44.000000000 -0500
-@@ -114,8 +114,14 @@ static int inet_csk_diag_fill(struct soc
+diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
+index 389a2e6..ac1c1de 100644
+--- a/net/ipv4/inet_diag.c
++++ b/net/ipv4/inet_diag.c
+@@ -114,8 +114,14 @@ static int inet_csk_diag_fill(struct sock *sk,
        r->idiag_retrans = 0;
  
        r->id.idiag_if = sk->sk_bound_dev_if;
@@ -72435,7 +75121,7 @@ diff -urNp linux-3.1.3/net/ipv4/inet_diag.c linux-3.1.3/net/ipv4/inet_diag.c
  
        r->id.idiag_sport = inet->inet_sport;
        r->id.idiag_dport = inet->inet_dport;
-@@ -201,8 +207,15 @@ static int inet_twsk_diag_fill(struct in
+@@ -201,8 +207,15 @@ static int inet_twsk_diag_fill(struct inet_timewait_sock *tw,
        r->idiag_family       = tw->tw_family;
        r->idiag_retrans      = 0;
        r->id.idiag_if        = tw->tw_bound_dev_if;
@@ -72451,7 +75137,7 @@ diff -urNp linux-3.1.3/net/ipv4/inet_diag.c linux-3.1.3/net/ipv4/inet_diag.c
        r->id.idiag_sport     = tw->tw_sport;
        r->id.idiag_dport     = tw->tw_dport;
        r->id.idiag_src[0]    = tw->tw_rcv_saddr;
-@@ -285,12 +298,14 @@ static int inet_diag_get_exact(struct sk
+@@ -285,12 +298,14 @@ static int inet_diag_get_exact(struct sk_buff *in_skb,
        if (sk == NULL)
                goto unlock;
  
@@ -72466,7 +75152,7 @@ diff -urNp linux-3.1.3/net/ipv4/inet_diag.c linux-3.1.3/net/ipv4/inet_diag.c
  
        err = -ENOMEM;
        rep = alloc_skb(NLMSG_SPACE((sizeof(struct inet_diag_msg) +
-@@ -580,8 +595,14 @@ static int inet_diag_fill_req(struct sk_
+@@ -580,8 +595,14 @@ static int inet_diag_fill_req(struct sk_buff *skb, struct sock *sk,
        r->idiag_retrans = req->retrans;
  
        r->id.idiag_if = sk->sk_bound_dev_if;
@@ -72481,9 +75167,10 @@ diff -urNp linux-3.1.3/net/ipv4/inet_diag.c linux-3.1.3/net/ipv4/inet_diag.c
  
        tmo = req->expires - jiffies;
        if (tmo < 0)
-diff -urNp linux-3.1.3/net/ipv4/inet_hashtables.c linux-3.1.3/net/ipv4/inet_hashtables.c
---- linux-3.1.3/net/ipv4/inet_hashtables.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/ipv4/inet_hashtables.c     2011-11-16 18:40:44.000000000 -0500
+diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c
+index 984ec65..97ac518 100644
+--- a/net/ipv4/inet_hashtables.c
++++ b/net/ipv4/inet_hashtables.c
 @@ -18,12 +18,15 @@
  #include <linux/sched.h>
  #include <linux/slab.h>
@@ -72509,10 +75196,11 @@ diff -urNp linux-3.1.3/net/ipv4/inet_hashtables.c linux-3.1.3/net/ipv4/inet_hash
                if (tw) {
                        inet_twsk_deschedule(tw, death_row);
                        while (twrefcnt) {
-diff -urNp linux-3.1.3/net/ipv4/inetpeer.c linux-3.1.3/net/ipv4/inetpeer.c
---- linux-3.1.3/net/ipv4/inetpeer.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/ipv4/inetpeer.c    2011-11-16 19:18:22.000000000 -0500
-@@ -400,6 +400,8 @@ struct inet_peer *inet_getpeer(const str
+diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c
+index 86f13c67..0bce60f 100644
+--- a/net/ipv4/inetpeer.c
++++ b/net/ipv4/inetpeer.c
+@@ -400,6 +400,8 @@ struct inet_peer *inet_getpeer(const struct inetpeer_addr *daddr, int create)
        unsigned int sequence;
        int invalidated, gccnt = 0;
  
@@ -72532,40 +75220,11 @@ diff -urNp linux-3.1.3/net/ipv4/inetpeer.c linux-3.1.3/net/ipv4/inetpeer.c
                                (daddr->family == AF_INET) ?
                                        secure_ip_id(daddr->addr.a4) :
                                        secure_ipv6_id(daddr->addr.a6));
-diff -urNp linux-3.1.3/net/ipv4/ipconfig.c linux-3.1.3/net/ipv4/ipconfig.c
---- linux-3.1.3/net/ipv4/ipconfig.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/ipv4/ipconfig.c    2011-11-16 18:39:08.000000000 -0500
-@@ -313,7 +313,7 @@ static int __init ic_devinet_ioctl(unsig
-       mm_segment_t oldfs = get_fs();
-       set_fs(get_ds());
--      res = devinet_ioctl(&init_net, cmd, (struct ifreq __user *) arg);
-+      res = devinet_ioctl(&init_net, cmd, (struct ifreq __force_user *) arg);
-       set_fs(oldfs);
-       return res;
- }
-@@ -324,7 +324,7 @@ static int __init ic_dev_ioctl(unsigned 
-       mm_segment_t oldfs = get_fs();
-       set_fs(get_ds());
--      res = dev_ioctl(&init_net, cmd, (struct ifreq __user *) arg);
-+      res = dev_ioctl(&init_net, cmd, (struct ifreq __force_user *) arg);
-       set_fs(oldfs);
-       return res;
- }
-@@ -335,7 +335,7 @@ static int __init ic_route_ioctl(unsigne
-       mm_segment_t oldfs = get_fs();
-       set_fs(get_ds());
--      res = ip_rt_ioctl(&init_net, cmd, (void __user *) arg);
-+      res = ip_rt_ioctl(&init_net, cmd, (void __force_user *) arg);
-       set_fs(oldfs);
-       return res;
- }
-diff -urNp linux-3.1.3/net/ipv4/ip_fragment.c linux-3.1.3/net/ipv4/ip_fragment.c
---- linux-3.1.3/net/ipv4/ip_fragment.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/ipv4/ip_fragment.c 2011-11-16 18:39:08.000000000 -0500
-@@ -316,7 +316,7 @@ static inline int ip_frag_too_far(struct
+diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
+index 0e0ab98..2ed7dd5 100644
+--- a/net/ipv4/ip_fragment.c
++++ b/net/ipv4/ip_fragment.c
+@@ -316,7 +316,7 @@ static inline int ip_frag_too_far(struct ipq *qp)
                return 0;
  
        start = qp->rid;
@@ -72574,10 +75233,11 @@ diff -urNp linux-3.1.3/net/ipv4/ip_fragment.c linux-3.1.3/net/ipv4/ip_fragment.c
        qp->rid = end;
  
        rc = qp->q.fragments && (end - start) > max;
-diff -urNp linux-3.1.3/net/ipv4/ip_sockglue.c linux-3.1.3/net/ipv4/ip_sockglue.c
---- linux-3.1.3/net/ipv4/ip_sockglue.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/ipv4/ip_sockglue.c 2011-11-16 18:40:44.000000000 -0500
-@@ -1073,6 +1073,8 @@ static int do_ip_getsockopt(struct sock 
+diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
+index 8905e92..0b179fb 100644
+--- a/net/ipv4/ip_sockglue.c
++++ b/net/ipv4/ip_sockglue.c
+@@ -1073,6 +1073,8 @@ static int do_ip_getsockopt(struct sock *sk, int level, int optname,
        int val;
        int len;
  
@@ -72586,7 +75246,7 @@ diff -urNp linux-3.1.3/net/ipv4/ip_sockglue.c linux-3.1.3/net/ipv4/ip_sockglue.c
        if (level != SOL_IP)
                return -EOPNOTSUPP;
  
-@@ -1110,7 +1112,8 @@ static int do_ip_getsockopt(struct sock 
+@@ -1110,7 +1112,8 @@ static int do_ip_getsockopt(struct sock *sk, int level, int optname,
                len = min_t(unsigned int, len, opt->optlen);
                if (put_user(len, optlen))
                        return -EFAULT;
@@ -72596,7 +75256,7 @@ diff -urNp linux-3.1.3/net/ipv4/ip_sockglue.c linux-3.1.3/net/ipv4/ip_sockglue.c
                        return -EFAULT;
                return 0;
        }
-@@ -1238,7 +1241,7 @@ static int do_ip_getsockopt(struct sock 
+@@ -1238,7 +1241,7 @@ static int do_ip_getsockopt(struct sock *sk, int level, int optname,
                if (sk->sk_type != SOCK_STREAM)
                        return -ENOPROTOOPT;
  
@@ -72605,10 +75265,42 @@ diff -urNp linux-3.1.3/net/ipv4/ip_sockglue.c linux-3.1.3/net/ipv4/ip_sockglue.c
                msg.msg_controllen = len;
                msg.msg_flags = flags;
  
-diff -urNp linux-3.1.3/net/ipv4/netfilter/nf_nat_snmp_basic.c linux-3.1.3/net/ipv4/netfilter/nf_nat_snmp_basic.c
---- linux-3.1.3/net/ipv4/netfilter/nf_nat_snmp_basic.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/ipv4/netfilter/nf_nat_snmp_basic.c 2011-11-16 18:39:08.000000000 -0500
-@@ -399,7 +399,7 @@ static unsigned char asn1_octets_decode(
+diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
+index 472a8c4..6507cd4 100644
+--- a/net/ipv4/ipconfig.c
++++ b/net/ipv4/ipconfig.c
+@@ -313,7 +313,7 @@ static int __init ic_devinet_ioctl(unsigned int cmd, struct ifreq *arg)
+       mm_segment_t oldfs = get_fs();
+       set_fs(get_ds());
+-      res = devinet_ioctl(&init_net, cmd, (struct ifreq __user *) arg);
++      res = devinet_ioctl(&init_net, cmd, (struct ifreq __force_user *) arg);
+       set_fs(oldfs);
+       return res;
+ }
+@@ -324,7 +324,7 @@ static int __init ic_dev_ioctl(unsigned int cmd, struct ifreq *arg)
+       mm_segment_t oldfs = get_fs();
+       set_fs(get_ds());
+-      res = dev_ioctl(&init_net, cmd, (struct ifreq __user *) arg);
++      res = dev_ioctl(&init_net, cmd, (struct ifreq __force_user *) arg);
+       set_fs(oldfs);
+       return res;
+ }
+@@ -335,7 +335,7 @@ static int __init ic_route_ioctl(unsigned int cmd, struct rtentry *arg)
+       mm_segment_t oldfs = get_fs();
+       set_fs(get_ds());
+-      res = ip_rt_ioctl(&init_net, cmd, (void __user *) arg);
++      res = ip_rt_ioctl(&init_net, cmd, (void __force_user *) arg);
+       set_fs(oldfs);
+       return res;
+ }
+diff --git a/net/ipv4/netfilter/nf_nat_snmp_basic.c b/net/ipv4/netfilter/nf_nat_snmp_basic.c
+index 076b7c8..9c8d038 100644
+--- a/net/ipv4/netfilter/nf_nat_snmp_basic.c
++++ b/net/ipv4/netfilter/nf_nat_snmp_basic.c
+@@ -399,7 +399,7 @@ static unsigned char asn1_octets_decode(struct asn1_ctx *ctx,
  
        *len = 0;
  
@@ -72617,10 +75309,11 @@ diff -urNp linux-3.1.3/net/ipv4/netfilter/nf_nat_snmp_basic.c linux-3.1.3/net/ip
        if (*octets == NULL) {
                if (net_ratelimit())
                        pr_notice("OOM in bsalg (%d)\n", __LINE__);
-diff -urNp linux-3.1.3/net/ipv4/ping.c linux-3.1.3/net/ipv4/ping.c
---- linux-3.1.3/net/ipv4/ping.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/ipv4/ping.c        2011-11-16 18:39:08.000000000 -0500
-@@ -837,7 +837,7 @@ static void ping_format_sock(struct sock
+diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
+index 39b403f..8e6a0a8 100644
+--- a/net/ipv4/ping.c
++++ b/net/ipv4/ping.c
+@@ -837,7 +837,7 @@ static void ping_format_sock(struct sock *sp, struct seq_file *f,
                sk_rmem_alloc_get(sp),
                0, 0L, 0, sock_i_uid(sp), 0, sock_i_ino(sp),
                atomic_read(&sp->sk_refcnt), sp,
@@ -72629,10 +75322,11 @@ diff -urNp linux-3.1.3/net/ipv4/ping.c linux-3.1.3/net/ipv4/ping.c
  }
  
  static int ping_seq_show(struct seq_file *seq, void *v)
-diff -urNp linux-3.1.3/net/ipv4/raw.c linux-3.1.3/net/ipv4/raw.c
---- linux-3.1.3/net/ipv4/raw.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/ipv4/raw.c 2011-11-17 18:58:40.000000000 -0500
-@@ -302,7 +302,7 @@ static int raw_rcv_skb(struct sock * sk,
+diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
+index 61714bd..c9cee6d 100644
+--- a/net/ipv4/raw.c
++++ b/net/ipv4/raw.c
+@@ -302,7 +302,7 @@ static int raw_rcv_skb(struct sock * sk, struct sk_buff * skb)
  int raw_rcv(struct sock *sk, struct sk_buff *skb)
  {
        if (!xfrm4_policy_check(sk, XFRM_POLICY_IN, skb)) {
@@ -72663,7 +75357,7 @@ diff -urNp linux-3.1.3/net/ipv4/raw.c linux-3.1.3/net/ipv4/raw.c
  
        if (get_user(len, optlen))
                goto out;
-@@ -756,8 +760,8 @@ static int raw_geticmpfilter(struct sock
+@@ -756,8 +760,8 @@ static int raw_geticmpfilter(struct sock *sk, char __user *optval, int __user *o
        if (len > sizeof(struct icmp_filter))
                len = sizeof(struct icmp_filter);
        ret = -EFAULT;
@@ -72674,7 +75368,7 @@ diff -urNp linux-3.1.3/net/ipv4/raw.c linux-3.1.3/net/ipv4/raw.c
                goto out;
        ret = 0;
  out:  return ret;
-@@ -985,7 +989,13 @@ static void raw_sock_seq_show(struct seq
+@@ -985,7 +989,13 @@ static void raw_sock_seq_show(struct seq_file *seq, struct sock *sp, int i)
                sk_wmem_alloc_get(sp),
                sk_rmem_alloc_get(sp),
                0, 0L, 0, sock_i_uid(sp), 0, sock_i_ino(sp),
@@ -72689,10 +75383,11 @@ diff -urNp linux-3.1.3/net/ipv4/raw.c linux-3.1.3/net/ipv4/raw.c
  }
  
  static int raw_seq_show(struct seq_file *seq, void *v)
-diff -urNp linux-3.1.3/net/ipv4/route.c linux-3.1.3/net/ipv4/route.c
---- linux-3.1.3/net/ipv4/route.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/ipv4/route.c       2011-11-16 18:39:08.000000000 -0500
-@@ -308,7 +308,7 @@ static inline unsigned int rt_hash(__be3
+diff --git a/net/ipv4/route.c b/net/ipv4/route.c
+index 05ac666c..82384a7 100644
+--- a/net/ipv4/route.c
++++ b/net/ipv4/route.c
+@@ -309,7 +309,7 @@ static inline unsigned int rt_hash(__be32 daddr, __be32 saddr, int idx,
  
  static inline int rt_genid(struct net *net)
  {
@@ -72701,16 +75396,16 @@ diff -urNp linux-3.1.3/net/ipv4/route.c linux-3.1.3/net/ipv4/route.c
  }
  
  #ifdef CONFIG_PROC_FS
-@@ -837,7 +837,7 @@ static void rt_cache_invalidate(struct n
+@@ -842,7 +842,7 @@ static void rt_cache_invalidate(struct net *net)
        unsigned char shuffle;
  
        get_random_bytes(&shuffle, sizeof(shuffle));
 -      atomic_add(shuffle + 1U, &net->ipv4.rt_genid);
 +      atomic_add_unchecked(shuffle + 1U, &net->ipv4.rt_genid);
+       redirect_genid++;
  }
  
- /*
-@@ -2872,7 +2872,7 @@ static int rt_fill_info(struct net *net,
+@@ -2920,7 +2920,7 @@ static int rt_fill_info(struct net *net,
        error = rt->dst.error;
        if (peer) {
                inet_peer_refcheck(rt->peer);
@@ -72719,10 +75414,11 @@ diff -urNp linux-3.1.3/net/ipv4/route.c linux-3.1.3/net/ipv4/route.c
                if (peer->tcp_ts_stamp) {
                        ts = peer->tcp_ts;
                        tsage = get_seconds() - peer->tcp_ts_stamp;
-diff -urNp linux-3.1.3/net/ipv4/tcp.c linux-3.1.3/net/ipv4/tcp.c
---- linux-3.1.3/net/ipv4/tcp.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/ipv4/tcp.c 2011-11-16 18:40:44.000000000 -0500
-@@ -2122,6 +2122,8 @@ static int do_tcp_setsockopt(struct sock
+diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
+index 46febca..98b73a4 100644
+--- a/net/ipv4/tcp.c
++++ b/net/ipv4/tcp.c
+@@ -2122,6 +2122,8 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
        int val;
        int err = 0;
  
@@ -72731,7 +75427,7 @@ diff -urNp linux-3.1.3/net/ipv4/tcp.c linux-3.1.3/net/ipv4/tcp.c
        /* These are data/string values, all the others are ints */
        switch (optname) {
        case TCP_CONGESTION: {
-@@ -2501,6 +2503,8 @@ static int do_tcp_getsockopt(struct sock
+@@ -2501,6 +2503,8 @@ static int do_tcp_getsockopt(struct sock *sk, int level,
        struct tcp_sock *tp = tcp_sk(sk);
        int val, len;
  
@@ -72740,9 +75436,10 @@ diff -urNp linux-3.1.3/net/ipv4/tcp.c linux-3.1.3/net/ipv4/tcp.c
        if (get_user(len, optlen))
                return -EFAULT;
  
-diff -urNp linux-3.1.3/net/ipv4/tcp_ipv4.c linux-3.1.3/net/ipv4/tcp_ipv4.c
---- linux-3.1.3/net/ipv4/tcp_ipv4.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/ipv4/tcp_ipv4.c    2011-11-16 18:40:44.000000000 -0500
+diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
+index 7963e03..c44f5d0 100644
+--- a/net/ipv4/tcp_ipv4.c
++++ b/net/ipv4/tcp_ipv4.c
 @@ -87,6 +87,9 @@ int sysctl_tcp_tw_reuse __read_mostly;
  int sysctl_tcp_low_latency __read_mostly;
  EXPORT_SYMBOL(sysctl_tcp_low_latency);
@@ -72753,7 +75450,7 @@ diff -urNp linux-3.1.3/net/ipv4/tcp_ipv4.c linux-3.1.3/net/ipv4/tcp_ipv4.c
  
  #ifdef CONFIG_TCP_MD5SIG
  static struct tcp_md5sig_key *tcp_v4_md5_do_lookup(struct sock *sk,
-@@ -1622,6 +1625,9 @@ int tcp_v4_do_rcv(struct sock *sk, struc
+@@ -1622,6 +1625,9 @@ int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb)
        return 0;
  
  reset:
@@ -72797,7 +75494,7 @@ diff -urNp linux-3.1.3/net/ipv4/tcp_ipv4.c linux-3.1.3/net/ipv4/tcp_ipv4.c
                tcp_v4_send_reset(NULL, skb);
        }
  
-@@ -2403,7 +2420,11 @@ static void get_openreq4(struct sock *sk
+@@ -2403,7 +2420,11 @@ static void get_openreq4(struct sock *sk, struct request_sock *req,
                0,  /* non standard timer */
                0, /* open_requests have no inode */
                atomic_read(&sk->sk_refcnt),
@@ -72809,7 +75506,7 @@ diff -urNp linux-3.1.3/net/ipv4/tcp_ipv4.c linux-3.1.3/net/ipv4/tcp_ipv4.c
                len);
  }
  
-@@ -2453,7 +2474,12 @@ static void get_tcp4_sock(struct sock *s
+@@ -2453,7 +2474,12 @@ static void get_tcp4_sock(struct sock *sk, struct seq_file *f, int i, int *len)
                sock_i_uid(sk),
                icsk->icsk_probes_out,
                sock_i_ino(sk),
@@ -72823,7 +75520,7 @@ diff -urNp linux-3.1.3/net/ipv4/tcp_ipv4.c linux-3.1.3/net/ipv4/tcp_ipv4.c
                jiffies_to_clock_t(icsk->icsk_rto),
                jiffies_to_clock_t(icsk->icsk_ack.ato),
                (icsk->icsk_ack.quick << 1) | icsk->icsk_ack.pingpong,
-@@ -2481,7 +2507,13 @@ static void get_timewait4_sock(struct in
+@@ -2481,7 +2507,13 @@ static void get_timewait4_sock(struct inet_timewait_sock *tw,
                " %02X %08X:%08X %02X:%08lX %08X %5d %8d %d %d %pK%n",
                i, src, srcp, dest, destp, tw->tw_substate, 0, 0,
                3, jiffies_to_clock_t(ttd), 0, 0, 0, 0,
@@ -72838,9 +75535,10 @@ diff -urNp linux-3.1.3/net/ipv4/tcp_ipv4.c linux-3.1.3/net/ipv4/tcp_ipv4.c
  }
  
  #define TMPSZ 150
-diff -urNp linux-3.1.3/net/ipv4/tcp_minisocks.c linux-3.1.3/net/ipv4/tcp_minisocks.c
---- linux-3.1.3/net/ipv4/tcp_minisocks.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/ipv4/tcp_minisocks.c       2011-11-16 18:40:44.000000000 -0500
+diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
+index 0ce3d06..e182e59 100644
+--- a/net/ipv4/tcp_minisocks.c
++++ b/net/ipv4/tcp_minisocks.c
 @@ -27,6 +27,10 @@
  #include <net/inet_common.h>
  #include <net/xfrm.h>
@@ -72863,10 +75561,11 @@ diff -urNp linux-3.1.3/net/ipv4/tcp_minisocks.c linux-3.1.3/net/ipv4/tcp_minisoc
        if (!(flg & TCP_FLAG_RST))
                req->rsk_ops->send_reset(sk, skb);
  
-diff -urNp linux-3.1.3/net/ipv4/tcp_output.c linux-3.1.3/net/ipv4/tcp_output.c
---- linux-3.1.3/net/ipv4/tcp_output.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/ipv4/tcp_output.c  2011-11-16 18:40:44.000000000 -0500
-@@ -2421,6 +2421,8 @@ struct sk_buff *tcp_make_synack(struct s
+diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
+index 882e0b0..2eba47f 100644
+--- a/net/ipv4/tcp_output.c
++++ b/net/ipv4/tcp_output.c
+@@ -2421,6 +2421,8 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst,
        int mss;
        int s_data_desired = 0;
  
@@ -72875,10 +75574,11 @@ diff -urNp linux-3.1.3/net/ipv4/tcp_output.c linux-3.1.3/net/ipv4/tcp_output.c
        if (cvp != NULL && cvp->s_data_constant && cvp->s_data_desired)
                s_data_desired = cvp->s_data_desired;
        skb = sock_wmalloc(sk, MAX_TCP_HEADER + 15 + s_data_desired, 1, GFP_ATOMIC);
-diff -urNp linux-3.1.3/net/ipv4/tcp_probe.c linux-3.1.3/net/ipv4/tcp_probe.c
---- linux-3.1.3/net/ipv4/tcp_probe.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/ipv4/tcp_probe.c   2011-11-16 18:39:08.000000000 -0500
-@@ -202,7 +202,7 @@ static ssize_t tcpprobe_read(struct file
+diff --git a/net/ipv4/tcp_probe.c b/net/ipv4/tcp_probe.c
+index 85ee7eb..53277ab 100644
+--- a/net/ipv4/tcp_probe.c
++++ b/net/ipv4/tcp_probe.c
+@@ -202,7 +202,7 @@ static ssize_t tcpprobe_read(struct file *file, char __user *buf,
                if (cnt + width >= len)
                        break;
  
@@ -72887,9 +75587,10 @@ diff -urNp linux-3.1.3/net/ipv4/tcp_probe.c linux-3.1.3/net/ipv4/tcp_probe.c
                        return -EFAULT;
                cnt += width;
        }
-diff -urNp linux-3.1.3/net/ipv4/tcp_timer.c linux-3.1.3/net/ipv4/tcp_timer.c
---- linux-3.1.3/net/ipv4/tcp_timer.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/ipv4/tcp_timer.c   2011-11-16 18:40:44.000000000 -0500
+diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
+index ecd44b0..b32fba6 100644
+--- a/net/ipv4/tcp_timer.c
++++ b/net/ipv4/tcp_timer.c
 @@ -22,6 +22,10 @@
  #include <linux/gfp.h>
  #include <net/tcp.h>
@@ -72901,7 +75602,7 @@ diff -urNp linux-3.1.3/net/ipv4/tcp_timer.c linux-3.1.3/net/ipv4/tcp_timer.c
  int sysctl_tcp_syn_retries __read_mostly = TCP_SYN_RETRIES;
  int sysctl_tcp_synack_retries __read_mostly = TCP_SYNACK_RETRIES;
  int sysctl_tcp_keepalive_time __read_mostly = TCP_KEEPALIVE_TIME;
-@@ -199,6 +203,13 @@ static int tcp_write_timeout(struct sock
+@@ -199,6 +203,13 @@ static int tcp_write_timeout(struct sock *sk)
                }
        }
  
@@ -72915,9 +75616,10 @@ diff -urNp linux-3.1.3/net/ipv4/tcp_timer.c linux-3.1.3/net/ipv4/tcp_timer.c
        if (retransmits_timed_out(sk, retry_until,
                                  syn_set ? 0 : icsk->icsk_user_timeout, syn_set)) {
                /* Has it gone just too far? */
-diff -urNp linux-3.1.3/net/ipv4/udp.c linux-3.1.3/net/ipv4/udp.c
---- linux-3.1.3/net/ipv4/udp.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/ipv4/udp.c 2011-11-16 19:17:54.000000000 -0500
+diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
+index 1b5a193..bd354b0 100644
+--- a/net/ipv4/udp.c
++++ b/net/ipv4/udp.c
 @@ -86,6 +86,7 @@
  #include <linux/types.h>
  #include <linux/fcntl.h>
@@ -72947,7 +75649,7 @@ diff -urNp linux-3.1.3/net/ipv4/udp.c linux-3.1.3/net/ipv4/udp.c
  /*
   * This routine is called by the ICMP module when it gets some
   * sort of error condition.  If err < 0 then the socket should
-@@ -856,9 +864,18 @@ int udp_sendmsg(struct kiocb *iocb, stru
+@@ -856,9 +864,18 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
                dport = usin->sin_port;
                if (dport == 0)
                        return -EINVAL;
@@ -72966,7 +75668,7 @@ diff -urNp linux-3.1.3/net/ipv4/udp.c linux-3.1.3/net/ipv4/udp.c
                daddr = inet->inet_daddr;
                dport = inet->inet_dport;
                /* Open fast path for connected socket.
-@@ -1099,7 +1116,7 @@ static unsigned int first_packet_length(
+@@ -1099,7 +1116,7 @@ static unsigned int first_packet_length(struct sock *sk)
                udp_lib_checksum_complete(skb)) {
                UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS,
                                 IS_UDPLITE(sk));
@@ -72986,7 +75688,7 @@ diff -urNp linux-3.1.3/net/ipv4/udp.c linux-3.1.3/net/ipv4/udp.c
        ulen = skb->len - sizeof(struct udphdr);
        if (len > ulen)
                len = ulen;
-@@ -1485,7 +1506,7 @@ int udp_queue_rcv_skb(struct sock *sk, s
+@@ -1485,7 +1506,7 @@ int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
  
  drop:
        UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS, is_udplite);
@@ -72995,7 +75697,7 @@ diff -urNp linux-3.1.3/net/ipv4/udp.c linux-3.1.3/net/ipv4/udp.c
        kfree_skb(skb);
        return -1;
  }
-@@ -1504,7 +1525,7 @@ static void flush_stack(struct sock **st
+@@ -1504,7 +1525,7 @@ static void flush_stack(struct sock **stack, unsigned int count,
                        skb1 = (i == final) ? skb : skb_clone(skb, GFP_ATOMIC);
  
                if (!skb1) {
@@ -73004,7 +75706,7 @@ diff -urNp linux-3.1.3/net/ipv4/udp.c linux-3.1.3/net/ipv4/udp.c
                        UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_RCVBUFERRORS,
                                         IS_UDPLITE(sk));
                        UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS,
-@@ -1673,6 +1694,9 @@ int __udp4_lib_rcv(struct sk_buff *skb, 
+@@ -1673,6 +1694,9 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
                goto csum_error;
  
        UDP_INC_STATS_BH(net, UDP_MIB_NOPORTS, proto == IPPROTO_UDPLITE);
@@ -73014,7 +75716,7 @@ diff -urNp linux-3.1.3/net/ipv4/udp.c linux-3.1.3/net/ipv4/udp.c
        icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0);
  
        /*
-@@ -2100,8 +2124,13 @@ static void udp4_format_sock(struct sock
+@@ -2100,8 +2124,13 @@ static void udp4_format_sock(struct sock *sp, struct seq_file *f,
                sk_wmem_alloc_get(sp),
                sk_rmem_alloc_get(sp),
                0, 0L, 0, sock_i_uid(sp), 0, sock_i_ino(sp),
@@ -73030,10 +75732,11 @@ diff -urNp linux-3.1.3/net/ipv4/udp.c linux-3.1.3/net/ipv4/udp.c
  }
  
  int udp4_seq_show(struct seq_file *seq, void *v)
-diff -urNp linux-3.1.3/net/ipv6/addrconf.c linux-3.1.3/net/ipv6/addrconf.c
---- linux-3.1.3/net/ipv6/addrconf.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/ipv6/addrconf.c    2011-11-16 18:39:08.000000000 -0500
-@@ -2083,7 +2083,7 @@ int addrconf_set_dstaddr(struct net *net
+diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
+index 12368c5..fbf899f 100644
+--- a/net/ipv6/addrconf.c
++++ b/net/ipv6/addrconf.c
+@@ -2083,7 +2083,7 @@ int addrconf_set_dstaddr(struct net *net, void __user *arg)
                p.iph.ihl = 5;
                p.iph.protocol = IPPROTO_IPV6;
                p.iph.ttl = 64;
@@ -73042,10 +75745,11 @@ diff -urNp linux-3.1.3/net/ipv6/addrconf.c linux-3.1.3/net/ipv6/addrconf.c
  
                if (ops->ndo_do_ioctl) {
                        mm_segment_t oldfs = get_fs();
-diff -urNp linux-3.1.3/net/ipv6/inet6_connection_sock.c linux-3.1.3/net/ipv6/inet6_connection_sock.c
---- linux-3.1.3/net/ipv6/inet6_connection_sock.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/ipv6/inet6_connection_sock.c       2011-11-16 18:39:08.000000000 -0500
-@@ -178,7 +178,7 @@ void __inet6_csk_dst_store(struct sock *
+diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c
+index 8a58e8c..8b5e631 100644
+--- a/net/ipv6/inet6_connection_sock.c
++++ b/net/ipv6/inet6_connection_sock.c
+@@ -178,7 +178,7 @@ void __inet6_csk_dst_store(struct sock *sk, struct dst_entry *dst,
  #ifdef CONFIG_XFRM
        {
                struct rt6_info *rt = (struct rt6_info  *)dst;
@@ -73054,7 +75758,7 @@ diff -urNp linux-3.1.3/net/ipv6/inet6_connection_sock.c linux-3.1.3/net/ipv6/ine
        }
  #endif
  }
-@@ -193,7 +193,7 @@ struct dst_entry *__inet6_csk_dst_check(
+@@ -193,7 +193,7 @@ struct dst_entry *__inet6_csk_dst_check(struct sock *sk, u32 cookie)
  #ifdef CONFIG_XFRM
        if (dst) {
                struct rt6_info *rt = (struct rt6_info *)dst;
@@ -73063,10 +75767,11 @@ diff -urNp linux-3.1.3/net/ipv6/inet6_connection_sock.c linux-3.1.3/net/ipv6/ine
                        __sk_dst_reset(sk);
                        dst = NULL;
                }
-diff -urNp linux-3.1.3/net/ipv6/ipv6_sockglue.c linux-3.1.3/net/ipv6/ipv6_sockglue.c
---- linux-3.1.3/net/ipv6/ipv6_sockglue.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/ipv6/ipv6_sockglue.c       2011-11-16 18:40:44.000000000 -0500
-@@ -129,6 +129,8 @@ static int do_ipv6_setsockopt(struct soc
+diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
+index 2fbda5f..26ed683 100644
+--- a/net/ipv6/ipv6_sockglue.c
++++ b/net/ipv6/ipv6_sockglue.c
+@@ -129,6 +129,8 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
        int val, valbool;
        int retv = -ENOPROTOOPT;
  
@@ -73075,7 +75780,7 @@ diff -urNp linux-3.1.3/net/ipv6/ipv6_sockglue.c linux-3.1.3/net/ipv6/ipv6_sockgl
        if (optval == NULL)
                val=0;
        else {
-@@ -919,6 +921,8 @@ static int do_ipv6_getsockopt(struct soc
+@@ -919,6 +921,8 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname,
        int len;
        int val;
  
@@ -73084,7 +75789,7 @@ diff -urNp linux-3.1.3/net/ipv6/ipv6_sockglue.c linux-3.1.3/net/ipv6/ipv6_sockgl
        if (ip6_mroute_opt(optname))
                return ip6_mroute_getsockopt(sk, optname, optval, optlen);
  
-@@ -960,7 +964,7 @@ static int do_ipv6_getsockopt(struct soc
+@@ -960,7 +964,7 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname,
                if (sk->sk_type != SOCK_STREAM)
                        return -ENOPROTOOPT;
  
@@ -73093,10 +75798,11 @@ diff -urNp linux-3.1.3/net/ipv6/ipv6_sockglue.c linux-3.1.3/net/ipv6/ipv6_sockgl
                msg.msg_controllen = len;
                msg.msg_flags = flags;
  
-diff -urNp linux-3.1.3/net/ipv6/raw.c linux-3.1.3/net/ipv6/raw.c
---- linux-3.1.3/net/ipv6/raw.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/ipv6/raw.c 2011-11-16 18:40:44.000000000 -0500
-@@ -376,7 +376,7 @@ static inline int rawv6_rcv_skb(struct s
+diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
+index 343852e..c92bd15 100644
+--- a/net/ipv6/raw.c
++++ b/net/ipv6/raw.c
+@@ -376,7 +376,7 @@ static inline int rawv6_rcv_skb(struct sock * sk, struct sk_buff * skb)
  {
        if ((raw6_sk(sk)->checksum || rcu_dereference_raw(sk->sk_filter)) &&
            skb_checksum_complete(skb)) {
@@ -73105,7 +75811,7 @@ diff -urNp linux-3.1.3/net/ipv6/raw.c linux-3.1.3/net/ipv6/raw.c
                kfree_skb(skb);
                return NET_RX_DROP;
        }
-@@ -403,7 +403,7 @@ int rawv6_rcv(struct sock *sk, struct sk
+@@ -403,7 +403,7 @@ int rawv6_rcv(struct sock *sk, struct sk_buff *skb)
        struct raw6_sock *rp = raw6_sk(sk);
  
        if (!xfrm6_policy_check(sk, XFRM_POLICY_IN, skb)) {
@@ -73114,7 +75820,7 @@ diff -urNp linux-3.1.3/net/ipv6/raw.c linux-3.1.3/net/ipv6/raw.c
                kfree_skb(skb);
                return NET_RX_DROP;
        }
-@@ -427,7 +427,7 @@ int rawv6_rcv(struct sock *sk, struct sk
+@@ -427,7 +427,7 @@ int rawv6_rcv(struct sock *sk, struct sk_buff *skb)
  
        if (inet->hdrincl) {
                if (skb_checksum_complete(skb)) {
@@ -73132,7 +75838,7 @@ diff -urNp linux-3.1.3/net/ipv6/raw.c linux-3.1.3/net/ipv6/raw.c
                        struct flowi6 *fl6, struct dst_entry **dstp,
                        unsigned int flags)
  {
-@@ -742,6 +742,8 @@ static int rawv6_sendmsg(struct kiocb *i
+@@ -742,6 +742,8 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
        u16 proto;
        int err;
  
@@ -73158,7 +75864,7 @@ diff -urNp linux-3.1.3/net/ipv6/raw.c linux-3.1.3/net/ipv6/raw.c
                return 0;
        default:
                return -ENOPROTOOPT;
-@@ -927,6 +932,7 @@ static int rawv6_geticmpfilter(struct so
+@@ -927,6 +932,7 @@ static int rawv6_geticmpfilter(struct sock *sk, int level, int optname,
                               char __user *optval, int __user *optlen)
  {
        int len;
@@ -73166,7 +75872,7 @@ diff -urNp linux-3.1.3/net/ipv6/raw.c linux-3.1.3/net/ipv6/raw.c
  
        switch (optname) {
        case ICMPV6_FILTER:
-@@ -938,7 +944,8 @@ static int rawv6_geticmpfilter(struct so
+@@ -938,7 +944,8 @@ static int rawv6_geticmpfilter(struct sock *sk, int level, int optname,
                        len = sizeof(struct icmp6_filter);
                if (put_user(len, optlen))
                        return -EFAULT;
@@ -73176,7 +75882,7 @@ diff -urNp linux-3.1.3/net/ipv6/raw.c linux-3.1.3/net/ipv6/raw.c
                        return -EFAULT;
                return 0;
        default:
-@@ -1245,7 +1252,13 @@ static void raw6_sock_seq_show(struct se
+@@ -1245,7 +1252,13 @@ static void raw6_sock_seq_show(struct seq_file *seq, struct sock *sp, int i)
                   0, 0L, 0,
                   sock_i_uid(sp), 0,
                   sock_i_ino(sp),
@@ -73191,10 +75897,11 @@ diff -urNp linux-3.1.3/net/ipv6/raw.c linux-3.1.3/net/ipv6/raw.c
  }
  
  static int raw6_seq_show(struct seq_file *seq, void *v)
-diff -urNp linux-3.1.3/net/ipv6/tcp_ipv6.c linux-3.1.3/net/ipv6/tcp_ipv6.c
---- linux-3.1.3/net/ipv6/tcp_ipv6.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/ipv6/tcp_ipv6.c    2011-11-16 18:40:44.000000000 -0500
-@@ -93,6 +93,10 @@ static struct tcp_md5sig_key *tcp_v6_md5
+diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
+index 7b8fc57..c6185da 100644
+--- a/net/ipv6/tcp_ipv6.c
++++ b/net/ipv6/tcp_ipv6.c
+@@ -93,6 +93,10 @@ static struct tcp_md5sig_key *tcp_v6_md5_do_lookup(struct sock *sk,
  }
  #endif
  
@@ -73205,7 +75912,7 @@ diff -urNp linux-3.1.3/net/ipv6/tcp_ipv6.c linux-3.1.3/net/ipv6/tcp_ipv6.c
  static void tcp_v6_hash(struct sock *sk)
  {
        if (sk->sk_state != TCP_CLOSE) {
-@@ -1647,6 +1651,9 @@ static int tcp_v6_do_rcv(struct sock *sk
+@@ -1647,6 +1651,9 @@ static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb)
        return 0;
  
  reset:
@@ -73215,7 +75922,7 @@ diff -urNp linux-3.1.3/net/ipv6/tcp_ipv6.c linux-3.1.3/net/ipv6/tcp_ipv6.c
        tcp_v6_send_reset(sk, skb);
  discard:
        if (opt_skb)
-@@ -1726,12 +1733,20 @@ static int tcp_v6_rcv(struct sk_buff *sk
+@@ -1726,12 +1733,20 @@ static int tcp_v6_rcv(struct sk_buff *skb)
        TCP_SKB_CB(skb)->sacked = 0;
  
        sk = __inet6_lookup_skb(&tcp_hashinfo, skb, th->source, th->dest);
@@ -73249,7 +75956,7 @@ diff -urNp linux-3.1.3/net/ipv6/tcp_ipv6.c linux-3.1.3/net/ipv6/tcp_ipv6.c
                tcp_v6_send_reset(NULL, skb);
        }
  
-@@ -2039,7 +2058,13 @@ static void get_openreq6(struct seq_file
+@@ -2039,7 +2058,13 @@ static void get_openreq6(struct seq_file *seq,
                   uid,
                   0,  /* non standard timer */
                   0, /* open_requests have no inode */
@@ -73264,7 +75971,7 @@ diff -urNp linux-3.1.3/net/ipv6/tcp_ipv6.c linux-3.1.3/net/ipv6/tcp_ipv6.c
  }
  
  static void get_tcp6_sock(struct seq_file *seq, struct sock *sp, int i)
-@@ -2089,7 +2114,12 @@ static void get_tcp6_sock(struct seq_fil
+@@ -2089,7 +2114,12 @@ static void get_tcp6_sock(struct seq_file *seq, struct sock *sp, int i)
                   sock_i_uid(sp),
                   icsk->icsk_probes_out,
                   sock_i_ino(sp),
@@ -73278,7 +75985,7 @@ diff -urNp linux-3.1.3/net/ipv6/tcp_ipv6.c linux-3.1.3/net/ipv6/tcp_ipv6.c
                   jiffies_to_clock_t(icsk->icsk_rto),
                   jiffies_to_clock_t(icsk->icsk_ack.ato),
                   (icsk->icsk_ack.quick << 1 ) | icsk->icsk_ack.pingpong,
-@@ -2124,7 +2154,13 @@ static void get_timewait6_sock(struct se
+@@ -2124,7 +2154,13 @@ static void get_timewait6_sock(struct seq_file *seq,
                   dest->s6_addr32[2], dest->s6_addr32[3], destp,
                   tw->tw_substate, 0, 0,
                   3, jiffies_to_clock_t(ttd), 0, 0, 0, 0,
@@ -73293,9 +76000,10 @@ diff -urNp linux-3.1.3/net/ipv6/tcp_ipv6.c linux-3.1.3/net/ipv6/tcp_ipv6.c
  }
  
  static int tcp6_seq_show(struct seq_file *seq, void *v)
-diff -urNp linux-3.1.3/net/ipv6/udp.c linux-3.1.3/net/ipv6/udp.c
---- linux-3.1.3/net/ipv6/udp.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/ipv6/udp.c 2011-11-16 18:40:44.000000000 -0500
+diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
+index bb95e8e..ae0ee80 100644
+--- a/net/ipv6/udp.c
++++ b/net/ipv6/udp.c
 @@ -50,6 +50,10 @@
  #include <linux/seq_file.h>
  #include "udp_impl.h"
@@ -73307,7 +76015,7 @@ diff -urNp linux-3.1.3/net/ipv6/udp.c linux-3.1.3/net/ipv6/udp.c
  int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2)
  {
        const struct in6_addr *sk_rcv_saddr6 = &inet6_sk(sk)->rcv_saddr;
-@@ -548,7 +552,7 @@ int udpv6_queue_rcv_skb(struct sock * sk
+@@ -548,7 +552,7 @@ int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
  
        return 0;
  drop:
@@ -73316,7 +76024,7 @@ diff -urNp linux-3.1.3/net/ipv6/udp.c linux-3.1.3/net/ipv6/udp.c
  drop_no_sk_drops_inc:
        UDP6_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS, is_udplite);
        kfree_skb(skb);
-@@ -624,7 +628,7 @@ static void flush_stack(struct sock **st
+@@ -624,7 +628,7 @@ static void flush_stack(struct sock **stack, unsigned int count,
                        continue;
                }
  drop:
@@ -73325,7 +76033,7 @@ diff -urNp linux-3.1.3/net/ipv6/udp.c linux-3.1.3/net/ipv6/udp.c
                UDP6_INC_STATS_BH(sock_net(sk),
                                UDP_MIB_RCVBUFERRORS, IS_UDPLITE(sk));
                UDP6_INC_STATS_BH(sock_net(sk),
-@@ -779,6 +783,9 @@ int __udp6_lib_rcv(struct sk_buff *skb, 
+@@ -779,6 +783,9 @@ int __udp6_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
                UDP6_INC_STATS_BH(net, UDP_MIB_NOPORTS,
                                proto == IPPROTO_UDPLITE);
  
@@ -73335,7 +76043,7 @@ diff -urNp linux-3.1.3/net/ipv6/udp.c linux-3.1.3/net/ipv6/udp.c
                icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_PORT_UNREACH, 0);
  
                kfree_skb(skb);
-@@ -795,7 +802,7 @@ int __udp6_lib_rcv(struct sk_buff *skb, 
+@@ -795,7 +802,7 @@ int __udp6_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
        if (!sock_owned_by_user(sk))
                udpv6_queue_rcv_skb(sk, skb);
        else if (sk_add_backlog(sk, skb)) {
@@ -73344,7 +76052,7 @@ diff -urNp linux-3.1.3/net/ipv6/udp.c linux-3.1.3/net/ipv6/udp.c
                bh_unlock_sock(sk);
                sock_put(sk);
                goto discard;
-@@ -1406,8 +1413,13 @@ static void udp6_sock_seq_show(struct se
+@@ -1406,8 +1413,13 @@ static void udp6_sock_seq_show(struct seq_file *seq, struct sock *sp, int bucket
                   0, 0L, 0,
                   sock_i_uid(sp), 0,
                   sock_i_ino(sp),
@@ -73360,10 +76068,11 @@ diff -urNp linux-3.1.3/net/ipv6/udp.c linux-3.1.3/net/ipv6/udp.c
  }
  
  int udp6_seq_show(struct seq_file *seq, void *v)
-diff -urNp linux-3.1.3/net/irda/ircomm/ircomm_tty.c linux-3.1.3/net/irda/ircomm/ircomm_tty.c
---- linux-3.1.3/net/irda/ircomm/ircomm_tty.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/irda/ircomm/ircomm_tty.c   2011-11-16 18:39:08.000000000 -0500
-@@ -282,16 +282,16 @@ static int ircomm_tty_block_til_ready(st
+diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c
+index b3cc8b3..baa02d0 100644
+--- a/net/irda/ircomm/ircomm_tty.c
++++ b/net/irda/ircomm/ircomm_tty.c
+@@ -282,16 +282,16 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self,
        add_wait_queue(&self->open_wait, &wait);
  
        IRDA_DEBUG(2, "%s(%d):block_til_ready before block on %s open_count=%d\n",
@@ -73383,7 +76092,7 @@ diff -urNp linux-3.1.3/net/irda/ircomm/ircomm_tty.c linux-3.1.3/net/irda/ircomm/
  
        while (1) {
                if (tty->termios->c_cflag & CBAUD) {
-@@ -331,7 +331,7 @@ static int ircomm_tty_block_til_ready(st
+@@ -331,7 +331,7 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self,
                }
  
                IRDA_DEBUG(1, "%s(%d):block_til_ready blocking on %s open_count=%d\n",
@@ -73392,7 +76101,7 @@ diff -urNp linux-3.1.3/net/irda/ircomm/ircomm_tty.c linux-3.1.3/net/irda/ircomm/
  
                schedule();
        }
-@@ -342,13 +342,13 @@ static int ircomm_tty_block_til_ready(st
+@@ -342,13 +342,13 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self,
        if (extra_count) {
                /* ++ is not atomic, so this should be protected - Jean II */
                spin_lock_irqsave(&self->spinlock, flags);
@@ -73409,7 +76118,7 @@ diff -urNp linux-3.1.3/net/irda/ircomm/ircomm_tty.c linux-3.1.3/net/irda/ircomm/
  
        if (!retval)
                self->flags |= ASYNC_NORMAL_ACTIVE;
-@@ -417,14 +417,14 @@ static int ircomm_tty_open(struct tty_st
+@@ -417,14 +417,14 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp)
        }
        /* ++ is not atomic, so this should be protected - Jean II */
        spin_lock_irqsave(&self->spinlock, flags);
@@ -73426,7 +76135,7 @@ diff -urNp linux-3.1.3/net/irda/ircomm/ircomm_tty.c linux-3.1.3/net/irda/ircomm/
  
        /* Not really used by us, but lets do it anyway */
        self->tty->low_latency = (self->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
-@@ -510,7 +510,7 @@ static void ircomm_tty_close(struct tty_
+@@ -510,7 +510,7 @@ static void ircomm_tty_close(struct tty_struct *tty, struct file *filp)
                return;
        }
  
@@ -73435,7 +76144,7 @@ diff -urNp linux-3.1.3/net/irda/ircomm/ircomm_tty.c linux-3.1.3/net/irda/ircomm/
                /*
                 * Uh, oh.  tty->count is 1, which means that the tty
                 * structure will be freed.  state->count should always
-@@ -520,16 +520,16 @@ static void ircomm_tty_close(struct tty_
+@@ -520,16 +520,16 @@ static void ircomm_tty_close(struct tty_struct *tty, struct file *filp)
                 */
                IRDA_DEBUG(0, "%s(), bad serial port count; "
                           "tty->count is 1, state->count is %d\n", __func__ ,
@@ -73458,7 +76167,7 @@ diff -urNp linux-3.1.3/net/irda/ircomm/ircomm_tty.c linux-3.1.3/net/irda/ircomm/
                spin_unlock_irqrestore(&self->spinlock, flags);
  
                IRDA_DEBUG(0, "%s(), open count > 0\n", __func__ );
-@@ -561,7 +561,7 @@ static void ircomm_tty_close(struct tty_
+@@ -561,7 +561,7 @@ static void ircomm_tty_close(struct tty_struct *tty, struct file *filp)
        tty->closing = 0;
        self->tty = NULL;
  
@@ -73467,7 +76176,7 @@ diff -urNp linux-3.1.3/net/irda/ircomm/ircomm_tty.c linux-3.1.3/net/irda/ircomm/
                if (self->close_delay)
                        schedule_timeout_interruptible(self->close_delay);
                wake_up_interruptible(&self->open_wait);
-@@ -1013,7 +1013,7 @@ static void ircomm_tty_hangup(struct tty
+@@ -1013,7 +1013,7 @@ static void ircomm_tty_hangup(struct tty_struct *tty)
        spin_lock_irqsave(&self->spinlock, flags);
        self->flags &= ~ASYNC_NORMAL_ACTIVE;
        self->tty = NULL;
@@ -73476,7 +76185,7 @@ diff -urNp linux-3.1.3/net/irda/ircomm/ircomm_tty.c linux-3.1.3/net/irda/ircomm/
        spin_unlock_irqrestore(&self->spinlock, flags);
  
        wake_up_interruptible(&self->open_wait);
-@@ -1360,7 +1360,7 @@ static void ircomm_tty_line_info(struct 
+@@ -1360,7 +1360,7 @@ static void ircomm_tty_line_info(struct ircomm_tty_cb *self, struct seq_file *m)
        seq_putc(m, '\n');
  
        seq_printf(m, "Role: %s\n", self->client ? "client" : "server");
@@ -73485,10 +76194,11 @@ diff -urNp linux-3.1.3/net/irda/ircomm/ircomm_tty.c linux-3.1.3/net/irda/ircomm/
        seq_printf(m, "Max data size: %d\n", self->max_data_size);
        seq_printf(m, "Max header size: %d\n", self->max_header_size);
  
-diff -urNp linux-3.1.3/net/iucv/af_iucv.c linux-3.1.3/net/iucv/af_iucv.c
---- linux-3.1.3/net/iucv/af_iucv.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/iucv/af_iucv.c     2011-11-16 18:39:08.000000000 -0500
-@@ -648,10 +648,10 @@ static int iucv_sock_autobind(struct soc
+diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
+index e2013e4..edfc1e3 100644
+--- a/net/iucv/af_iucv.c
++++ b/net/iucv/af_iucv.c
+@@ -648,10 +648,10 @@ static int iucv_sock_autobind(struct sock *sk)
  
        write_lock_bh(&iucv_sk_list.lock);
  
@@ -73501,10 +76211,11 @@ diff -urNp linux-3.1.3/net/iucv/af_iucv.c linux-3.1.3/net/iucv/af_iucv.c
        }
  
        write_unlock_bh(&iucv_sk_list.lock);
-diff -urNp linux-3.1.3/net/key/af_key.c linux-3.1.3/net/key/af_key.c
---- linux-3.1.3/net/key/af_key.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/key/af_key.c       2011-11-16 18:40:44.000000000 -0500
-@@ -2481,6 +2481,8 @@ static int pfkey_migrate(struct sock *sk
+diff --git a/net/key/af_key.c b/net/key/af_key.c
+index 1e733e9..c84de2f 100644
+--- a/net/key/af_key.c
++++ b/net/key/af_key.c
+@@ -2481,6 +2481,8 @@ static int pfkey_migrate(struct sock *sk, struct sk_buff *skb,
        struct xfrm_migrate m[XFRM_MAX_DEPTH];
        struct xfrm_kmaddress k;
  
@@ -73513,7 +76224,7 @@ diff -urNp linux-3.1.3/net/key/af_key.c linux-3.1.3/net/key/af_key.c
        if (!present_and_same_family(ext_hdrs[SADB_EXT_ADDRESS_SRC - 1],
                                     ext_hdrs[SADB_EXT_ADDRESS_DST - 1]) ||
            !ext_hdrs[SADB_X_EXT_POLICY - 1]) {
-@@ -3016,10 +3018,10 @@ static int pfkey_send_policy_notify(stru
+@@ -3016,10 +3018,10 @@ static int pfkey_send_policy_notify(struct xfrm_policy *xp, int dir, const struc
  static u32 get_acqseq(void)
  {
        u32 res;
@@ -73526,10 +76237,11 @@ diff -urNp linux-3.1.3/net/key/af_key.c linux-3.1.3/net/key/af_key.c
        } while (!res);
        return res;
  }
-diff -urNp linux-3.1.3/net/lapb/lapb_iface.c linux-3.1.3/net/lapb/lapb_iface.c
---- linux-3.1.3/net/lapb/lapb_iface.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/lapb/lapb_iface.c  2011-11-16 18:39:08.000000000 -0500
-@@ -158,7 +158,7 @@ int lapb_register(struct net_device *dev
+diff --git a/net/lapb/lapb_iface.c b/net/lapb/lapb_iface.c
+index 956b7e4..f01d328 100644
+--- a/net/lapb/lapb_iface.c
++++ b/net/lapb/lapb_iface.c
+@@ -158,7 +158,7 @@ int lapb_register(struct net_device *dev, struct lapb_register_struct *callbacks
                goto out;
  
        lapb->dev       = dev;
@@ -73538,7 +76250,7 @@ diff -urNp linux-3.1.3/net/lapb/lapb_iface.c linux-3.1.3/net/lapb/lapb_iface.c
  
        __lapb_insert_cb(lapb);
  
-@@ -380,32 +380,32 @@ int lapb_data_received(struct net_device
+@@ -380,32 +380,32 @@ int lapb_data_received(struct net_device *dev, struct sk_buff *skb)
  
  void lapb_connect_confirmation(struct lapb_cb *lapb, int reason)
  {
@@ -73581,7 +76293,7 @@ diff -urNp linux-3.1.3/net/lapb/lapb_iface.c linux-3.1.3/net/lapb/lapb_iface.c
  
        kfree_skb(skb);
        return NET_RX_SUCCESS; /* For now; must be != NET_RX_DROP */
-@@ -415,8 +415,8 @@ int lapb_data_transmit(struct lapb_cb *l
+@@ -415,8 +415,8 @@ int lapb_data_transmit(struct lapb_cb *lapb, struct sk_buff *skb)
  {
        int used = 0;
  
@@ -73592,10 +76304,11 @@ diff -urNp linux-3.1.3/net/lapb/lapb_iface.c linux-3.1.3/net/lapb/lapb_iface.c
                used = 1;
        }
  
-diff -urNp linux-3.1.3/net/mac80211/debugfs_sta.c linux-3.1.3/net/mac80211/debugfs_sta.c
---- linux-3.1.3/net/mac80211/debugfs_sta.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/mac80211/debugfs_sta.c     2011-11-16 18:40:44.000000000 -0500
-@@ -140,6 +140,8 @@ static ssize_t sta_agg_status_read(struc
+diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c
+index a01d213..6a1f1ab 100644
+--- a/net/mac80211/debugfs_sta.c
++++ b/net/mac80211/debugfs_sta.c
+@@ -140,6 +140,8 @@ static ssize_t sta_agg_status_read(struct file *file, char __user *userbuf,
        struct tid_ampdu_rx *tid_rx;
        struct tid_ampdu_tx *tid_tx;
  
@@ -73604,7 +76317,7 @@ diff -urNp linux-3.1.3/net/mac80211/debugfs_sta.c linux-3.1.3/net/mac80211/debug
        rcu_read_lock();
  
        p += scnprintf(p, sizeof(buf) + buf - p, "next dialog_token: %#02x\n",
-@@ -240,6 +242,8 @@ static ssize_t sta_ht_capa_read(struct f
+@@ -240,6 +242,8 @@ static ssize_t sta_ht_capa_read(struct file *file, char __user *userbuf,
        struct sta_info *sta = file->private_data;
        struct ieee80211_sta_ht_cap *htc = &sta->sta.ht_cap;
  
@@ -73613,9 +76326,10 @@ diff -urNp linux-3.1.3/net/mac80211/debugfs_sta.c linux-3.1.3/net/mac80211/debug
        p += scnprintf(p, sizeof(buf) + buf - p, "ht %ssupported\n",
                        htc->ht_supported ? "" : "not ");
        if (htc->ht_supported) {
-diff -urNp linux-3.1.3/net/mac80211/ieee80211_i.h linux-3.1.3/net/mac80211/ieee80211_i.h
---- linux-3.1.3/net/mac80211/ieee80211_i.h     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/mac80211/ieee80211_i.h     2011-11-16 18:39:08.000000000 -0500
+diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
+index 9fab144..7f0fc14 100644
+--- a/net/mac80211/ieee80211_i.h
++++ b/net/mac80211/ieee80211_i.h
 @@ -27,6 +27,7 @@
  #include <net/ieee80211_radiotap.h>
  #include <net/cfg80211.h>
@@ -73633,10 +76347,11 @@ diff -urNp linux-3.1.3/net/mac80211/ieee80211_i.h linux-3.1.3/net/mac80211/ieee8
        int monitors, cooked_mntrs;
        /* number of interfaces with corresponding FIF_ flags */
        int fif_fcsfail, fif_plcpfail, fif_control, fif_other_bss, fif_pspoll,
-diff -urNp linux-3.1.3/net/mac80211/iface.c linux-3.1.3/net/mac80211/iface.c
---- linux-3.1.3/net/mac80211/iface.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/mac80211/iface.c   2011-11-16 18:39:08.000000000 -0500
-@@ -211,7 +211,7 @@ static int ieee80211_do_open(struct net_
+diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
+index 556e7e6..120dcaf 100644
+--- a/net/mac80211/iface.c
++++ b/net/mac80211/iface.c
+@@ -211,7 +211,7 @@ static int ieee80211_do_open(struct net_device *dev, bool coming_up)
                break;
        }
  
@@ -73645,7 +76360,7 @@ diff -urNp linux-3.1.3/net/mac80211/iface.c linux-3.1.3/net/mac80211/iface.c
                res = drv_start(local);
                if (res)
                        goto err_del_bss;
-@@ -235,7 +235,7 @@ static int ieee80211_do_open(struct net_
+@@ -235,7 +235,7 @@ static int ieee80211_do_open(struct net_device *dev, bool coming_up)
                memcpy(dev->perm_addr, dev->dev_addr, ETH_ALEN);
  
                if (!is_valid_ether_addr(dev->dev_addr)) {
@@ -73654,7 +76369,7 @@ diff -urNp linux-3.1.3/net/mac80211/iface.c linux-3.1.3/net/mac80211/iface.c
                                drv_stop(local);
                        return -EADDRNOTAVAIL;
                }
-@@ -327,7 +327,7 @@ static int ieee80211_do_open(struct net_
+@@ -327,7 +327,7 @@ static int ieee80211_do_open(struct net_device *dev, bool coming_up)
        mutex_unlock(&local->mtx);
  
        if (coming_up)
@@ -73663,7 +76378,7 @@ diff -urNp linux-3.1.3/net/mac80211/iface.c linux-3.1.3/net/mac80211/iface.c
  
        if (hw_reconf_flags) {
                ieee80211_hw_config(local, hw_reconf_flags);
-@@ -347,7 +347,7 @@ static int ieee80211_do_open(struct net_
+@@ -347,7 +347,7 @@ static int ieee80211_do_open(struct net_device *dev, bool coming_up)
   err_del_interface:
        drv_remove_interface(local, &sdata->vif);
   err_stop:
@@ -73672,7 +76387,7 @@ diff -urNp linux-3.1.3/net/mac80211/iface.c linux-3.1.3/net/mac80211/iface.c
                drv_stop(local);
   err_del_bss:
        sdata->bss = NULL;
-@@ -474,7 +474,7 @@ static void ieee80211_do_stop(struct iee
+@@ -474,7 +474,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
        }
  
        if (going_down)
@@ -73681,7 +76396,7 @@ diff -urNp linux-3.1.3/net/mac80211/iface.c linux-3.1.3/net/mac80211/iface.c
  
        switch (sdata->vif.type) {
        case NL80211_IFTYPE_AP_VLAN:
-@@ -533,7 +533,7 @@ static void ieee80211_do_stop(struct iee
+@@ -533,7 +533,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
  
        ieee80211_recalc_ps(local, -1);
  
@@ -73690,10 +76405,11 @@ diff -urNp linux-3.1.3/net/mac80211/iface.c linux-3.1.3/net/mac80211/iface.c
                if (local->ops->napi_poll)
                        napi_disable(&local->napi);
                ieee80211_clear_tx_pending(local);
-diff -urNp linux-3.1.3/net/mac80211/main.c linux-3.1.3/net/mac80211/main.c
---- linux-3.1.3/net/mac80211/main.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/mac80211/main.c    2011-11-16 18:39:08.000000000 -0500
-@@ -209,7 +209,7 @@ int ieee80211_hw_config(struct ieee80211
+diff --git a/net/mac80211/main.c b/net/mac80211/main.c
+index 3d90dad..36884d5 100644
+--- a/net/mac80211/main.c
++++ b/net/mac80211/main.c
+@@ -209,7 +209,7 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed)
                local->hw.conf.power_level = power;
        }
  
@@ -73702,10 +76418,11 @@ diff -urNp linux-3.1.3/net/mac80211/main.c linux-3.1.3/net/mac80211/main.c
                ret = drv_config(local, changed);
                /*
                 * Goal:
-diff -urNp linux-3.1.3/net/mac80211/mlme.c linux-3.1.3/net/mac80211/mlme.c
---- linux-3.1.3/net/mac80211/mlme.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/mac80211/mlme.c    2011-11-16 18:40:44.000000000 -0500
-@@ -1464,6 +1464,8 @@ static bool ieee80211_assoc_success(stru
+diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
+index 0f48368..d48e688 100644
+--- a/net/mac80211/mlme.c
++++ b/net/mac80211/mlme.c
+@@ -1464,6 +1464,8 @@ static bool ieee80211_assoc_success(struct ieee80211_work *wk,
        bool have_higher_than_11mbit = false;
        u16 ap_ht_cap_flags;
  
@@ -73714,10 +76431,11 @@ diff -urNp linux-3.1.3/net/mac80211/mlme.c linux-3.1.3/net/mac80211/mlme.c
        /* AssocResp and ReassocResp have identical structure */
  
        aid = le16_to_cpu(mgmt->u.assoc_resp.aid);
-diff -urNp linux-3.1.3/net/mac80211/pm.c linux-3.1.3/net/mac80211/pm.c
---- linux-3.1.3/net/mac80211/pm.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/mac80211/pm.c      2011-11-16 18:39:08.000000000 -0500
-@@ -34,7 +34,7 @@ int __ieee80211_suspend(struct ieee80211
+diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c
+index 6326d34..7225f61 100644
+--- a/net/mac80211/pm.c
++++ b/net/mac80211/pm.c
+@@ -34,7 +34,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
        struct ieee80211_sub_if_data *sdata;
        struct sta_info *sta;
  
@@ -73726,7 +76444,7 @@ diff -urNp linux-3.1.3/net/mac80211/pm.c linux-3.1.3/net/mac80211/pm.c
                goto suspend;
  
        ieee80211_scan_cancel(local);
-@@ -72,7 +72,7 @@ int __ieee80211_suspend(struct ieee80211
+@@ -72,7 +72,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
        cancel_work_sync(&local->dynamic_ps_enable_work);
        del_timer_sync(&local->dynamic_ps_timer);
  
@@ -73735,7 +76453,7 @@ diff -urNp linux-3.1.3/net/mac80211/pm.c linux-3.1.3/net/mac80211/pm.c
        if (local->wowlan) {
                int err = drv_suspend(local, wowlan);
                if (err < 0) {
-@@ -129,7 +129,7 @@ int __ieee80211_suspend(struct ieee80211
+@@ -129,7 +129,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
        }
  
        /* stop hardware - this must stop RX */
@@ -73744,10 +76462,11 @@ diff -urNp linux-3.1.3/net/mac80211/pm.c linux-3.1.3/net/mac80211/pm.c
                ieee80211_stop_device(local);
  
   suspend:
-diff -urNp linux-3.1.3/net/mac80211/rate.c linux-3.1.3/net/mac80211/rate.c
---- linux-3.1.3/net/mac80211/rate.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/mac80211/rate.c    2011-11-16 18:39:08.000000000 -0500
-@@ -371,7 +371,7 @@ int ieee80211_init_rate_ctrl_alg(struct 
+diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c
+index 3d5a2cb..b17ad48 100644
+--- a/net/mac80211/rate.c
++++ b/net/mac80211/rate.c
+@@ -371,7 +371,7 @@ int ieee80211_init_rate_ctrl_alg(struct ieee80211_local *local,
  
        ASSERT_RTNL();
  
@@ -73756,10 +76475,11 @@ diff -urNp linux-3.1.3/net/mac80211/rate.c linux-3.1.3/net/mac80211/rate.c
                return -EBUSY;
  
        if (local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL) {
-diff -urNp linux-3.1.3/net/mac80211/rc80211_pid_debugfs.c linux-3.1.3/net/mac80211/rc80211_pid_debugfs.c
---- linux-3.1.3/net/mac80211/rc80211_pid_debugfs.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/mac80211/rc80211_pid_debugfs.c     2011-11-16 18:39:08.000000000 -0500
-@@ -192,7 +192,7 @@ static ssize_t rate_control_pid_events_r
+diff --git a/net/mac80211/rc80211_pid_debugfs.c b/net/mac80211/rc80211_pid_debugfs.c
+index 4851e9e..d860e05 100644
+--- a/net/mac80211/rc80211_pid_debugfs.c
++++ b/net/mac80211/rc80211_pid_debugfs.c
+@@ -192,7 +192,7 @@ static ssize_t rate_control_pid_events_read(struct file *file, char __user *buf,
  
        spin_unlock_irqrestore(&events->lock, status);
  
@@ -73768,10 +76488,11 @@ diff -urNp linux-3.1.3/net/mac80211/rc80211_pid_debugfs.c linux-3.1.3/net/mac802
                return -EFAULT;
  
        return p;
-diff -urNp linux-3.1.3/net/mac80211/util.c linux-3.1.3/net/mac80211/util.c
---- linux-3.1.3/net/mac80211/util.c    2011-11-26 19:57:29.000000000 -0500
-+++ linux-3.1.3/net/mac80211/util.c    2011-11-26 20:00:43.000000000 -0500
-@@ -1170,7 +1170,7 @@ int ieee80211_reconfig(struct ieee80211_
+diff --git a/net/mac80211/util.c b/net/mac80211/util.c
+index fd031e8..84fbfcf 100644
+--- a/net/mac80211/util.c
++++ b/net/mac80211/util.c
+@@ -1170,7 +1170,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)
        drv_set_coverage_class(local, hw->wiphy->coverage_class);
  
        /* everything else happens only if HW was up & running */
@@ -73780,10 +76501,44 @@ diff -urNp linux-3.1.3/net/mac80211/util.c linux-3.1.3/net/mac80211/util.c
                goto wake_up;
  
        /*
-diff -urNp linux-3.1.3/net/netfilter/ipvs/ip_vs_conn.c linux-3.1.3/net/netfilter/ipvs/ip_vs_conn.c
---- linux-3.1.3/net/netfilter/ipvs/ip_vs_conn.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/netfilter/ipvs/ip_vs_conn.c        2011-11-16 18:39:08.000000000 -0500
-@@ -556,7 +556,7 @@ ip_vs_bind_dest(struct ip_vs_conn *cp, s
+diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
+index 32bff6d..d0cf986 100644
+--- a/net/netfilter/Kconfig
++++ b/net/netfilter/Kconfig
+@@ -781,6 +781,16 @@ config NETFILTER_XT_MATCH_ESP
+         To compile it as a module, choose M here.  If unsure, say N.
++config NETFILTER_XT_MATCH_GRADM
++      tristate '"gradm" match support'
++      depends on NETFILTER_XTABLES && NETFILTER_ADVANCED
++      depends on GRKERNSEC && !GRKERNSEC_NO_RBAC
++      ---help---
++        The gradm match allows to match on grsecurity RBAC being enabled.
++        It is useful when iptables rules are applied early on bootup to
++        prevent connections to the machine (except from a trusted host)
++        while the RBAC system is disabled.
++
+ config NETFILTER_XT_MATCH_HASHLIMIT
+       tristate '"hashlimit" match support'
+       depends on (IP6_NF_IPTABLES || IP6_NF_IPTABLES=n)
+diff --git a/net/netfilter/Makefile b/net/netfilter/Makefile
+index 1a02853..5d8c22e 100644
+--- a/net/netfilter/Makefile
++++ b/net/netfilter/Makefile
+@@ -81,6 +81,7 @@ obj-$(CONFIG_NETFILTER_XT_MATCH_DCCP) += xt_dccp.o
+ obj-$(CONFIG_NETFILTER_XT_MATCH_DEVGROUP) += xt_devgroup.o
+ obj-$(CONFIG_NETFILTER_XT_MATCH_DSCP) += xt_dscp.o
+ obj-$(CONFIG_NETFILTER_XT_MATCH_ESP) += xt_esp.o
++obj-$(CONFIG_NETFILTER_XT_MATCH_GRADM) += xt_gradm.o
+ obj-$(CONFIG_NETFILTER_XT_MATCH_HASHLIMIT) += xt_hashlimit.o
+ obj-$(CONFIG_NETFILTER_XT_MATCH_HELPER) += xt_helper.o
+ obj-$(CONFIG_NETFILTER_XT_MATCH_HL) += xt_hl.o
+diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
+index 12571fb..fb73976 100644
+--- a/net/netfilter/ipvs/ip_vs_conn.c
++++ b/net/netfilter/ipvs/ip_vs_conn.c
+@@ -556,7 +556,7 @@ ip_vs_bind_dest(struct ip_vs_conn *cp, struct ip_vs_dest *dest)
        /* Increase the refcnt counter of the dest */
        atomic_inc(&dest->refcnt);
  
@@ -73792,7 +76547,7 @@ diff -urNp linux-3.1.3/net/netfilter/ipvs/ip_vs_conn.c linux-3.1.3/net/netfilter
        if (cp->protocol != IPPROTO_UDP)
                conn_flags &= ~IP_VS_CONN_F_ONE_PACKET;
        /* Bind with the destination and its corresponding transmitter */
-@@ -869,7 +869,7 @@ ip_vs_conn_new(const struct ip_vs_conn_p
+@@ -869,7 +869,7 @@ ip_vs_conn_new(const struct ip_vs_conn_param *p,
        atomic_set(&cp->refcnt, 1);
  
        atomic_set(&cp->n_control, 0);
@@ -73801,7 +76556,7 @@ diff -urNp linux-3.1.3/net/netfilter/ipvs/ip_vs_conn.c linux-3.1.3/net/netfilter
  
        atomic_inc(&ipvs->conn_count);
        if (flags & IP_VS_CONN_F_NO_CPORT)
-@@ -1149,7 +1149,7 @@ static inline int todrop_entry(struct ip
+@@ -1149,7 +1149,7 @@ static inline int todrop_entry(struct ip_vs_conn *cp)
  
        /* Don't drop the entry if its number of incoming packets is not
           located in [0, 8] */
@@ -73810,10 +76565,11 @@ diff -urNp linux-3.1.3/net/netfilter/ipvs/ip_vs_conn.c linux-3.1.3/net/netfilter
        if (i > 8 || i < 0) return 0;
  
        if (!todrop_rate[i]) return 0;
-diff -urNp linux-3.1.3/net/netfilter/ipvs/ip_vs_core.c linux-3.1.3/net/netfilter/ipvs/ip_vs_core.c
---- linux-3.1.3/net/netfilter/ipvs/ip_vs_core.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/netfilter/ipvs/ip_vs_core.c        2011-11-16 18:39:08.000000000 -0500
-@@ -563,7 +563,7 @@ int ip_vs_leave(struct ip_vs_service *sv
+diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
+index 4f77bb1..5d0bc26 100644
+--- a/net/netfilter/ipvs/ip_vs_core.c
++++ b/net/netfilter/ipvs/ip_vs_core.c
+@@ -563,7 +563,7 @@ int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb,
                ret = cp->packet_xmit(skb, cp, pd->pp);
                /* do not touch skb anymore */
  
@@ -73822,7 +76578,7 @@ diff -urNp linux-3.1.3/net/netfilter/ipvs/ip_vs_core.c linux-3.1.3/net/netfilter
                ip_vs_conn_put(cp);
                return ret;
        }
-@@ -1612,7 +1612,7 @@ ip_vs_in(unsigned int hooknum, struct sk
+@@ -1612,7 +1612,7 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb, int af)
        if (cp->flags & IP_VS_CONN_F_ONE_PACKET)
                pkts = sysctl_sync_threshold(ipvs);
        else
@@ -73831,10 +76587,11 @@ diff -urNp linux-3.1.3/net/netfilter/ipvs/ip_vs_core.c linux-3.1.3/net/netfilter
  
        if ((ipvs->sync_state & IP_VS_STATE_MASTER) &&
            cp->protocol == IPPROTO_SCTP) {
-diff -urNp linux-3.1.3/net/netfilter/ipvs/ip_vs_ctl.c linux-3.1.3/net/netfilter/ipvs/ip_vs_ctl.c
---- linux-3.1.3/net/netfilter/ipvs/ip_vs_ctl.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/netfilter/ipvs/ip_vs_ctl.c 2011-11-16 19:13:12.000000000 -0500
-@@ -782,7 +782,7 @@ __ip_vs_update_dest(struct ip_vs_service
+diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
+index e3be48b..d658c8c 100644
+--- a/net/netfilter/ipvs/ip_vs_ctl.c
++++ b/net/netfilter/ipvs/ip_vs_ctl.c
+@@ -782,7 +782,7 @@ __ip_vs_update_dest(struct ip_vs_service *svc, struct ip_vs_dest *dest,
                ip_vs_rs_hash(ipvs, dest);
                write_unlock_bh(&ipvs->rs_lock);
        }
@@ -73843,7 +76600,7 @@ diff -urNp linux-3.1.3/net/netfilter/ipvs/ip_vs_ctl.c linux-3.1.3/net/netfilter/
  
        /* bind the service */
        if (!dest->svc) {
-@@ -2027,7 +2027,7 @@ static int ip_vs_info_seq_show(struct se
+@@ -2027,7 +2027,7 @@ static int ip_vs_info_seq_show(struct seq_file *seq, void *v)
                                           "      %-7s %-6d %-10d %-10d\n",
                                           &dest->addr.in6,
                                           ntohs(dest->port),
@@ -73852,7 +76609,7 @@ diff -urNp linux-3.1.3/net/netfilter/ipvs/ip_vs_ctl.c linux-3.1.3/net/netfilter/
                                           atomic_read(&dest->weight),
                                           atomic_read(&dest->activeconns),
                                           atomic_read(&dest->inactconns));
-@@ -2038,7 +2038,7 @@ static int ip_vs_info_seq_show(struct se
+@@ -2038,7 +2038,7 @@ static int ip_vs_info_seq_show(struct seq_file *seq, void *v)
                                           "%-7s %-6d %-10d %-10d\n",
                                           ntohl(dest->addr.ip),
                                           ntohs(dest->port),
@@ -73861,7 +76618,7 @@ diff -urNp linux-3.1.3/net/netfilter/ipvs/ip_vs_ctl.c linux-3.1.3/net/netfilter/
                                           atomic_read(&dest->weight),
                                           atomic_read(&dest->activeconns),
                                           atomic_read(&dest->inactconns));
-@@ -2285,6 +2285,8 @@ do_ip_vs_set_ctl(struct sock *sk, int cm
+@@ -2285,6 +2285,8 @@ do_ip_vs_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len)
        struct ip_vs_dest_user_kern udest;
        struct netns_ipvs *ipvs = net_ipvs(net);
  
@@ -73870,7 +76627,7 @@ diff -urNp linux-3.1.3/net/netfilter/ipvs/ip_vs_ctl.c linux-3.1.3/net/netfilter/
        if (!capable(CAP_NET_ADMIN))
                return -EPERM;
  
-@@ -2508,7 +2510,7 @@ __ip_vs_get_dest_entries(struct net *net
+@@ -2508,7 +2510,7 @@ __ip_vs_get_dest_entries(struct net *net, const struct ip_vs_get_dests *get,
  
                        entry.addr = dest->addr.ip;
                        entry.port = dest->port;
@@ -73879,7 +76636,7 @@ diff -urNp linux-3.1.3/net/netfilter/ipvs/ip_vs_ctl.c linux-3.1.3/net/netfilter/
                        entry.weight = atomic_read(&dest->weight);
                        entry.u_threshold = dest->u_threshold;
                        entry.l_threshold = dest->l_threshold;
-@@ -3041,7 +3043,7 @@ static int ip_vs_genl_fill_dest(struct s
+@@ -3041,7 +3043,7 @@ static int ip_vs_genl_fill_dest(struct sk_buff *skb, struct ip_vs_dest *dest)
        NLA_PUT_U16(skb, IPVS_DEST_ATTR_PORT, dest->port);
  
        NLA_PUT_U32(skb, IPVS_DEST_ATTR_FWD_METHOD,
@@ -73888,9 +76645,10 @@ diff -urNp linux-3.1.3/net/netfilter/ipvs/ip_vs_ctl.c linux-3.1.3/net/netfilter/
        NLA_PUT_U32(skb, IPVS_DEST_ATTR_WEIGHT, atomic_read(&dest->weight));
        NLA_PUT_U32(skb, IPVS_DEST_ATTR_U_THRESH, dest->u_threshold);
        NLA_PUT_U32(skb, IPVS_DEST_ATTR_L_THRESH, dest->l_threshold);
-diff -urNp linux-3.1.3/net/netfilter/ipvs/ip_vs_sync.c linux-3.1.3/net/netfilter/ipvs/ip_vs_sync.c
---- linux-3.1.3/net/netfilter/ipvs/ip_vs_sync.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/netfilter/ipvs/ip_vs_sync.c        2011-11-16 18:39:08.000000000 -0500
+diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
+index 3cdd479..116afa8 100644
+--- a/net/netfilter/ipvs/ip_vs_sync.c
++++ b/net/netfilter/ipvs/ip_vs_sync.c
 @@ -649,7 +649,7 @@ control:
         * i.e only increment in_pkts for Templates.
         */
@@ -73900,7 +76658,7 @@ diff -urNp linux-3.1.3/net/netfilter/ipvs/ip_vs_sync.c linux-3.1.3/net/netfilter
  
                if (pkts % sysctl_sync_period(ipvs) != 1)
                        return;
-@@ -795,7 +795,7 @@ static void ip_vs_proc_conn(struct net *
+@@ -795,7 +795,7 @@ static void ip_vs_proc_conn(struct net *net, struct ip_vs_conn_param *param,
  
        if (opt)
                memcpy(&cp->in_seq, opt, sizeof(*opt));
@@ -73909,10 +76667,11 @@ diff -urNp linux-3.1.3/net/netfilter/ipvs/ip_vs_sync.c linux-3.1.3/net/netfilter
        cp->state = state;
        cp->old_state = cp->state;
        /*
-diff -urNp linux-3.1.3/net/netfilter/ipvs/ip_vs_xmit.c linux-3.1.3/net/netfilter/ipvs/ip_vs_xmit.c
---- linux-3.1.3/net/netfilter/ipvs/ip_vs_xmit.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/netfilter/ipvs/ip_vs_xmit.c        2011-11-16 18:39:08.000000000 -0500
-@@ -1151,7 +1151,7 @@ ip_vs_icmp_xmit(struct sk_buff *skb, str
+diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c
+index ee319a4..8a285ee 100644
+--- a/net/netfilter/ipvs/ip_vs_xmit.c
++++ b/net/netfilter/ipvs/ip_vs_xmit.c
+@@ -1151,7 +1151,7 @@ ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
                else
                        rc = NF_ACCEPT;
                /* do not touch skb anymore */
@@ -73921,7 +76680,7 @@ diff -urNp linux-3.1.3/net/netfilter/ipvs/ip_vs_xmit.c linux-3.1.3/net/netfilter
                goto out;
        }
  
-@@ -1272,7 +1272,7 @@ ip_vs_icmp_xmit_v6(struct sk_buff *skb, 
+@@ -1272,7 +1272,7 @@ ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
                else
                        rc = NF_ACCEPT;
                /* do not touch skb anymore */
@@ -73930,40 +76689,10 @@ diff -urNp linux-3.1.3/net/netfilter/ipvs/ip_vs_xmit.c linux-3.1.3/net/netfilter
                goto out;
        }
  
-diff -urNp linux-3.1.3/net/netfilter/Kconfig linux-3.1.3/net/netfilter/Kconfig
---- linux-3.1.3/net/netfilter/Kconfig  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/netfilter/Kconfig  2011-11-16 18:40:44.000000000 -0500
-@@ -781,6 +781,16 @@ config NETFILTER_XT_MATCH_ESP
-         To compile it as a module, choose M here.  If unsure, say N.
-+config NETFILTER_XT_MATCH_GRADM
-+      tristate '"gradm" match support'
-+      depends on NETFILTER_XTABLES && NETFILTER_ADVANCED
-+      depends on GRKERNSEC && !GRKERNSEC_NO_RBAC
-+      ---help---
-+        The gradm match allows to match on grsecurity RBAC being enabled.
-+        It is useful when iptables rules are applied early on bootup to
-+        prevent connections to the machine (except from a trusted host)
-+        while the RBAC system is disabled.
-+
- config NETFILTER_XT_MATCH_HASHLIMIT
-       tristate '"hashlimit" match support'
-       depends on (IP6_NF_IPTABLES || IP6_NF_IPTABLES=n)
-diff -urNp linux-3.1.3/net/netfilter/Makefile linux-3.1.3/net/netfilter/Makefile
---- linux-3.1.3/net/netfilter/Makefile 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/netfilter/Makefile 2011-11-16 18:40:44.000000000 -0500
-@@ -81,6 +81,7 @@ obj-$(CONFIG_NETFILTER_XT_MATCH_DCCP) +=
- obj-$(CONFIG_NETFILTER_XT_MATCH_DEVGROUP) += xt_devgroup.o
- obj-$(CONFIG_NETFILTER_XT_MATCH_DSCP) += xt_dscp.o
- obj-$(CONFIG_NETFILTER_XT_MATCH_ESP) += xt_esp.o
-+obj-$(CONFIG_NETFILTER_XT_MATCH_GRADM) += xt_gradm.o
- obj-$(CONFIG_NETFILTER_XT_MATCH_HASHLIMIT) += xt_hashlimit.o
- obj-$(CONFIG_NETFILTER_XT_MATCH_HELPER) += xt_helper.o
- obj-$(CONFIG_NETFILTER_XT_MATCH_HL) += xt_hl.o
-diff -urNp linux-3.1.3/net/netfilter/nfnetlink_log.c linux-3.1.3/net/netfilter/nfnetlink_log.c
---- linux-3.1.3/net/netfilter/nfnetlink_log.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/netfilter/nfnetlink_log.c  2011-11-16 18:39:08.000000000 -0500
+diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
+index 2d8158a..5dca296 100644
+--- a/net/netfilter/nfnetlink_log.c
++++ b/net/netfilter/nfnetlink_log.c
 @@ -70,7 +70,7 @@ struct nfulnl_instance {
  };
  
@@ -73973,7 +76702,7 @@ diff -urNp linux-3.1.3/net/netfilter/nfnetlink_log.c linux-3.1.3/net/netfilter/n
  
  #define INSTANCE_BUCKETS      16
  static struct hlist_head instance_table[INSTANCE_BUCKETS];
-@@ -505,7 +505,7 @@ __build_packet_message(struct nfulnl_ins
+@@ -505,7 +505,7 @@ __build_packet_message(struct nfulnl_instance *inst,
        /* global sequence number */
        if (inst->flags & NFULNL_CFG_F_SEQ_GLOBAL)
                NLA_PUT_BE32(inst->skb, NFULA_SEQ_GLOBAL,
@@ -73982,9 +76711,11 @@ diff -urNp linux-3.1.3/net/netfilter/nfnetlink_log.c linux-3.1.3/net/netfilter/n
  
        if (data_len) {
                struct nlattr *nla;
-diff -urNp linux-3.1.3/net/netfilter/xt_gradm.c linux-3.1.3/net/netfilter/xt_gradm.c
---- linux-3.1.3/net/netfilter/xt_gradm.c       1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/net/netfilter/xt_gradm.c       2011-11-16 18:40:44.000000000 -0500
+diff --git a/net/netfilter/xt_gradm.c b/net/netfilter/xt_gradm.c
+new file mode 100644
+index 0000000..6905327
+--- /dev/null
++++ b/net/netfilter/xt_gradm.c
 @@ -0,0 +1,51 @@
 +/*
 + *    gradm match for netfilter
@@ -74037,9 +76768,10 @@ diff -urNp linux-3.1.3/net/netfilter/xt_gradm.c linux-3.1.3/net/netfilter/xt_gra
 +MODULE_LICENSE("GPL");
 +MODULE_ALIAS("ipt_gradm");
 +MODULE_ALIAS("ip6t_gradm");
-diff -urNp linux-3.1.3/net/netfilter/xt_statistic.c linux-3.1.3/net/netfilter/xt_statistic.c
---- linux-3.1.3/net/netfilter/xt_statistic.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/netfilter/xt_statistic.c   2011-11-16 18:39:08.000000000 -0500
+diff --git a/net/netfilter/xt_statistic.c b/net/netfilter/xt_statistic.c
+index 42ecb71..8d687c0 100644
+--- a/net/netfilter/xt_statistic.c
++++ b/net/netfilter/xt_statistic.c
 @@ -18,7 +18,7 @@
  #include <linux/netfilter/x_tables.h>
  
@@ -74049,7 +76781,7 @@ diff -urNp linux-3.1.3/net/netfilter/xt_statistic.c linux-3.1.3/net/netfilter/xt
  } ____cacheline_aligned_in_smp;
  
  MODULE_LICENSE("GPL");
-@@ -41,9 +41,9 @@ statistic_mt(const struct sk_buff *skb, 
+@@ -41,9 +41,9 @@ statistic_mt(const struct sk_buff *skb, struct xt_action_param *par)
                break;
        case XT_STATISTIC_MODE_NTH:
                do {
@@ -74061,7 +76793,7 @@ diff -urNp linux-3.1.3/net/netfilter/xt_statistic.c linux-3.1.3/net/netfilter/xt
                if (nval == 0)
                        ret = !ret;
                break;
-@@ -63,7 +63,7 @@ static int statistic_mt_check(const stru
+@@ -63,7 +63,7 @@ static int statistic_mt_check(const struct xt_mtchk_param *par)
        info->master = kzalloc(sizeof(*info->master), GFP_KERNEL);
        if (info->master == NULL)
                return -ENOMEM;
@@ -74070,10 +76802,11 @@ diff -urNp linux-3.1.3/net/netfilter/xt_statistic.c linux-3.1.3/net/netfilter/xt
  
        return 0;
  }
-diff -urNp linux-3.1.3/net/netlink/af_netlink.c linux-3.1.3/net/netlink/af_netlink.c
---- linux-3.1.3/net/netlink/af_netlink.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/netlink/af_netlink.c       2011-11-16 18:39:08.000000000 -0500
-@@ -742,7 +742,7 @@ static void netlink_overrun(struct sock 
+diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
+index 0a4db02..604f748 100644
+--- a/net/netlink/af_netlink.c
++++ b/net/netlink/af_netlink.c
+@@ -742,7 +742,7 @@ static void netlink_overrun(struct sock *sk)
                        sk->sk_error_report(sk);
                }
        }
@@ -74082,7 +76815,7 @@ diff -urNp linux-3.1.3/net/netlink/af_netlink.c linux-3.1.3/net/netlink/af_netli
  }
  
  static struct sock *netlink_getsockbypid(struct sock *ssk, u32 pid)
-@@ -2000,7 +2000,7 @@ static int netlink_seq_show(struct seq_f
+@@ -2000,7 +2000,7 @@ static int netlink_seq_show(struct seq_file *seq, void *v)
                           sk_wmem_alloc_get(s),
                           nlk->cb,
                           atomic_read(&s->sk_refcnt),
@@ -74091,10 +76824,11 @@ diff -urNp linux-3.1.3/net/netlink/af_netlink.c linux-3.1.3/net/netlink/af_netli
                           sock_i_ino(s)
                        );
  
-diff -urNp linux-3.1.3/net/netrom/af_netrom.c linux-3.1.3/net/netrom/af_netrom.c
---- linux-3.1.3/net/netrom/af_netrom.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/netrom/af_netrom.c 2011-11-16 18:40:44.000000000 -0500
-@@ -839,6 +839,7 @@ static int nr_getname(struct socket *soc
+diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
+index 732152f..60bb09e 100644
+--- a/net/netrom/af_netrom.c
++++ b/net/netrom/af_netrom.c
+@@ -839,6 +839,7 @@ static int nr_getname(struct socket *sock, struct sockaddr *uaddr,
        struct sock *sk = sock->sk;
        struct nr_sock *nr = nr_sk(sk);
  
@@ -74102,7 +76836,7 @@ diff -urNp linux-3.1.3/net/netrom/af_netrom.c linux-3.1.3/net/netrom/af_netrom.c
        lock_sock(sk);
        if (peer != 0) {
                if (sk->sk_state != TCP_ESTABLISHED) {
-@@ -853,7 +854,6 @@ static int nr_getname(struct socket *soc
+@@ -853,7 +854,6 @@ static int nr_getname(struct socket *sock, struct sockaddr *uaddr,
                *uaddr_len = sizeof(struct full_sockaddr_ax25);
        } else {
                sax->fsa_ax25.sax25_family = AF_NETROM;
@@ -74110,10 +76844,11 @@ diff -urNp linux-3.1.3/net/netrom/af_netrom.c linux-3.1.3/net/netrom/af_netrom.c
                sax->fsa_ax25.sax25_call   = nr->source_addr;
                *uaddr_len = sizeof(struct sockaddr_ax25);
        }
-diff -urNp linux-3.1.3/net/packet/af_packet.c linux-3.1.3/net/packet/af_packet.c
---- linux-3.1.3/net/packet/af_packet.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/packet/af_packet.c 2011-11-16 18:39:08.000000000 -0500
-@@ -954,7 +954,7 @@ static int packet_rcv(struct sk_buff *sk
+diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
+index fabb4fa..e146b73 100644
+--- a/net/packet/af_packet.c
++++ b/net/packet/af_packet.c
+@@ -954,7 +954,7 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev,
  
        spin_lock(&sk->sk_receive_queue.lock);
        po->stats.tp_packets++;
@@ -74122,7 +76857,7 @@ diff -urNp linux-3.1.3/net/packet/af_packet.c linux-3.1.3/net/packet/af_packet.c
        __skb_queue_tail(&sk->sk_receive_queue, skb);
        spin_unlock(&sk->sk_receive_queue.lock);
        sk->sk_data_ready(sk, skb->len);
-@@ -963,7 +963,7 @@ static int packet_rcv(struct sk_buff *sk
+@@ -963,7 +963,7 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev,
  drop_n_acct:
        spin_lock(&sk->sk_receive_queue.lock);
        po->stats.tp_drops++;
@@ -74131,7 +76866,7 @@ diff -urNp linux-3.1.3/net/packet/af_packet.c linux-3.1.3/net/packet/af_packet.c
        spin_unlock(&sk->sk_receive_queue.lock);
  
  drop_n_restore:
-@@ -2479,7 +2479,7 @@ static int packet_getsockopt(struct sock
+@@ -2479,7 +2479,7 @@ static int packet_getsockopt(struct socket *sock, int level, int optname,
        case PACKET_HDRLEN:
                if (len > sizeof(int))
                        len = sizeof(int);
@@ -74140,7 +76875,7 @@ diff -urNp linux-3.1.3/net/packet/af_packet.c linux-3.1.3/net/packet/af_packet.c
                        return -EFAULT;
                switch (val) {
                case TPACKET_V1:
-@@ -2526,7 +2526,7 @@ static int packet_getsockopt(struct sock
+@@ -2526,7 +2526,7 @@ static int packet_getsockopt(struct socket *sock, int level, int optname,
  
        if (put_user(len, optlen))
                return -EFAULT;
@@ -74149,10 +76884,11 @@ diff -urNp linux-3.1.3/net/packet/af_packet.c linux-3.1.3/net/packet/af_packet.c
                return -EFAULT;
        return 0;
  }
-diff -urNp linux-3.1.3/net/phonet/af_phonet.c linux-3.1.3/net/phonet/af_phonet.c
---- linux-3.1.3/net/phonet/af_phonet.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/phonet/af_phonet.c 2011-11-16 18:40:44.000000000 -0500
-@@ -41,7 +41,7 @@ static struct phonet_protocol *phonet_pr
+diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c
+index c6fffd9..a7ffa0c 100644
+--- a/net/phonet/af_phonet.c
++++ b/net/phonet/af_phonet.c
+@@ -41,7 +41,7 @@ static struct phonet_protocol *phonet_proto_get(unsigned int protocol)
  {
        struct phonet_protocol *pp;
  
@@ -74161,7 +76897,7 @@ diff -urNp linux-3.1.3/net/phonet/af_phonet.c linux-3.1.3/net/phonet/af_phonet.c
                return NULL;
  
        rcu_read_lock();
-@@ -469,7 +469,7 @@ int __init_or_module phonet_proto_regist
+@@ -469,7 +469,7 @@ int __init_or_module phonet_proto_register(unsigned int protocol,
  {
        int err = 0;
  
@@ -74170,10 +76906,11 @@ diff -urNp linux-3.1.3/net/phonet/af_phonet.c linux-3.1.3/net/phonet/af_phonet.c
                return -EINVAL;
  
        err = proto_register(pp->prot, 1);
-diff -urNp linux-3.1.3/net/phonet/pep.c linux-3.1.3/net/phonet/pep.c
---- linux-3.1.3/net/phonet/pep.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/phonet/pep.c       2011-11-16 18:39:08.000000000 -0500
-@@ -387,7 +387,7 @@ static int pipe_do_rcv(struct sock *sk, 
+diff --git a/net/phonet/pep.c b/net/phonet/pep.c
+index f17fd84..edffce8 100644
+--- a/net/phonet/pep.c
++++ b/net/phonet/pep.c
+@@ -387,7 +387,7 @@ static int pipe_do_rcv(struct sock *sk, struct sk_buff *skb)
  
        case PNS_PEP_CTRL_REQ:
                if (skb_queue_len(&pn->ctrlreq_queue) >= PNPIPE_CTRLREQ_MAX) {
@@ -74182,7 +76919,7 @@ diff -urNp linux-3.1.3/net/phonet/pep.c linux-3.1.3/net/phonet/pep.c
                        break;
                }
                __skb_pull(skb, 4);
-@@ -408,7 +408,7 @@ static int pipe_do_rcv(struct sock *sk, 
+@@ -408,7 +408,7 @@ static int pipe_do_rcv(struct sock *sk, struct sk_buff *skb)
                }
  
                if (pn->rx_credits == 0) {
@@ -74191,7 +76928,7 @@ diff -urNp linux-3.1.3/net/phonet/pep.c linux-3.1.3/net/phonet/pep.c
                        err = -ENOBUFS;
                        break;
                }
-@@ -556,7 +556,7 @@ static int pipe_handler_do_rcv(struct so
+@@ -556,7 +556,7 @@ static int pipe_handler_do_rcv(struct sock *sk, struct sk_buff *skb)
                }
  
                if (pn->rx_credits == 0) {
@@ -74200,10 +76937,11 @@ diff -urNp linux-3.1.3/net/phonet/pep.c linux-3.1.3/net/phonet/pep.c
                        err = NET_RX_DROP;
                        break;
                }
-diff -urNp linux-3.1.3/net/phonet/socket.c linux-3.1.3/net/phonet/socket.c
---- linux-3.1.3/net/phonet/socket.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/phonet/socket.c    2011-11-16 18:40:44.000000000 -0500
-@@ -612,8 +612,13 @@ static int pn_sock_seq_show(struct seq_f
+diff --git a/net/phonet/socket.c b/net/phonet/socket.c
+index ab07711..9d4ac5d 100644
+--- a/net/phonet/socket.c
++++ b/net/phonet/socket.c
+@@ -612,8 +612,13 @@ static int pn_sock_seq_show(struct seq_file *seq, void *v)
                        pn->resource, sk->sk_state,
                        sk_wmem_alloc_get(sk), sk_rmem_alloc_get(sk),
                        sock_i_uid(sk), sock_i_ino(sk),
@@ -74219,9 +76957,10 @@ diff -urNp linux-3.1.3/net/phonet/socket.c linux-3.1.3/net/phonet/socket.c
        }
        seq_printf(seq, "%*s\n", 127 - len, "");
        return 0;
-diff -urNp linux-3.1.3/net/rds/cong.c linux-3.1.3/net/rds/cong.c
---- linux-3.1.3/net/rds/cong.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/rds/cong.c 2011-11-16 18:39:08.000000000 -0500
+diff --git a/net/rds/cong.c b/net/rds/cong.c
+index 6daaa49..fbf6af5 100644
+--- a/net/rds/cong.c
++++ b/net/rds/cong.c
 @@ -77,7 +77,7 @@
   * finds that the saved generation number is smaller than the global generation
   * number, it wakes up the process.
@@ -74231,7 +76970,7 @@ diff -urNp linux-3.1.3/net/rds/cong.c linux-3.1.3/net/rds/cong.c
  
  /*
   * Congestion monitoring
-@@ -232,7 +232,7 @@ void rds_cong_map_updated(struct rds_con
+@@ -232,7 +232,7 @@ void rds_cong_map_updated(struct rds_cong_map *map, uint64_t portmask)
        rdsdebug("waking map %p for %pI4\n",
          map, &map->m_addr);
        rds_stats_inc(s_cong_update_received);
@@ -74249,21 +76988,10 @@ diff -urNp linux-3.1.3/net/rds/cong.c linux-3.1.3/net/rds/cong.c
  
        if (likely(*recent == gen))
                return 0;
-diff -urNp linux-3.1.3/net/rds/ib_cm.c linux-3.1.3/net/rds/ib_cm.c
---- linux-3.1.3/net/rds/ib_cm.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/rds/ib_cm.c        2011-11-16 18:39:08.000000000 -0500
-@@ -720,7 +720,7 @@ void rds_ib_conn_shutdown(struct rds_con
-       /* Clear the ACK state */
-       clear_bit(IB_ACK_IN_FLIGHT, &ic->i_ack_flags);
- #ifdef KERNEL_HAS_ATOMIC64
--      atomic64_set(&ic->i_ack_next, 0);
-+      atomic64_set_unchecked(&ic->i_ack_next, 0);
- #else
-       ic->i_ack_next = 0;
- #endif
-diff -urNp linux-3.1.3/net/rds/ib.h linux-3.1.3/net/rds/ib.h
---- linux-3.1.3/net/rds/ib.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/rds/ib.h   2011-11-16 18:39:08.000000000 -0500
+diff --git a/net/rds/ib.h b/net/rds/ib.h
+index edfaaaf..8c89879 100644
+--- a/net/rds/ib.h
++++ b/net/rds/ib.h
 @@ -128,7 +128,7 @@ struct rds_ib_connection {
        /* sending acks */
        unsigned long           i_ack_flags;
@@ -74273,10 +77001,24 @@ diff -urNp linux-3.1.3/net/rds/ib.h linux-3.1.3/net/rds/ib.h
  #else
        spinlock_t              i_ack_lock;     /* protect i_ack_next */
        u64                     i_ack_next;     /* next ACK to send */
-diff -urNp linux-3.1.3/net/rds/ib_recv.c linux-3.1.3/net/rds/ib_recv.c
---- linux-3.1.3/net/rds/ib_recv.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/rds/ib_recv.c      2011-11-16 18:39:08.000000000 -0500
-@@ -592,7 +592,7 @@ static u64 rds_ib_get_ack(struct rds_ib_
+diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c
+index cd67026..0b9a54a 100644
+--- a/net/rds/ib_cm.c
++++ b/net/rds/ib_cm.c
+@@ -720,7 +720,7 @@ void rds_ib_conn_shutdown(struct rds_connection *conn)
+       /* Clear the ACK state */
+       clear_bit(IB_ACK_IN_FLIGHT, &ic->i_ack_flags);
+ #ifdef KERNEL_HAS_ATOMIC64
+-      atomic64_set(&ic->i_ack_next, 0);
++      atomic64_set_unchecked(&ic->i_ack_next, 0);
+ #else
+       ic->i_ack_next = 0;
+ #endif
+diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c
+index e29e0ca..fa3a6a3 100644
+--- a/net/rds/ib_recv.c
++++ b/net/rds/ib_recv.c
+@@ -592,7 +592,7 @@ static u64 rds_ib_get_ack(struct rds_ib_connection *ic)
  static void rds_ib_set_ack(struct rds_ib_connection *ic, u64 seq,
                                int ack_required)
  {
@@ -74285,7 +77027,7 @@ diff -urNp linux-3.1.3/net/rds/ib_recv.c linux-3.1.3/net/rds/ib_recv.c
        if (ack_required) {
                smp_mb__before_clear_bit();
                set_bit(IB_ACK_REQUESTED, &ic->i_ack_flags);
-@@ -604,7 +604,7 @@ static u64 rds_ib_get_ack(struct rds_ib_
+@@ -604,7 +604,7 @@ static u64 rds_ib_get_ack(struct rds_ib_connection *ic)
        clear_bit(IB_ACK_REQUESTED, &ic->i_ack_flags);
        smp_mb__after_clear_bit();
  
@@ -74294,21 +77036,10 @@ diff -urNp linux-3.1.3/net/rds/ib_recv.c linux-3.1.3/net/rds/ib_recv.c
  }
  #endif
  
-diff -urNp linux-3.1.3/net/rds/iw_cm.c linux-3.1.3/net/rds/iw_cm.c
---- linux-3.1.3/net/rds/iw_cm.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/rds/iw_cm.c        2011-11-16 18:39:08.000000000 -0500
-@@ -663,7 +663,7 @@ void rds_iw_conn_shutdown(struct rds_con
-       /* Clear the ACK state */
-       clear_bit(IB_ACK_IN_FLIGHT, &ic->i_ack_flags);
- #ifdef KERNEL_HAS_ATOMIC64
--      atomic64_set(&ic->i_ack_next, 0);
-+      atomic64_set_unchecked(&ic->i_ack_next, 0);
- #else
-       ic->i_ack_next = 0;
- #endif
-diff -urNp linux-3.1.3/net/rds/iw.h linux-3.1.3/net/rds/iw.h
---- linux-3.1.3/net/rds/iw.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/rds/iw.h   2011-11-16 18:39:08.000000000 -0500
+diff --git a/net/rds/iw.h b/net/rds/iw.h
+index 04ce3b1..48119a6 100644
+--- a/net/rds/iw.h
++++ b/net/rds/iw.h
 @@ -134,7 +134,7 @@ struct rds_iw_connection {
        /* sending acks */
        unsigned long           i_ack_flags;
@@ -74318,10 +77049,24 @@ diff -urNp linux-3.1.3/net/rds/iw.h linux-3.1.3/net/rds/iw.h
  #else
        spinlock_t              i_ack_lock;     /* protect i_ack_next */
        u64                     i_ack_next;     /* next ACK to send */
-diff -urNp linux-3.1.3/net/rds/iw_rdma.c linux-3.1.3/net/rds/iw_rdma.c
---- linux-3.1.3/net/rds/iw_rdma.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/rds/iw_rdma.c      2011-11-16 18:40:44.000000000 -0500
-@@ -184,6 +184,8 @@ int rds_iw_update_cm_id(struct rds_iw_de
+diff --git a/net/rds/iw_cm.c b/net/rds/iw_cm.c
+index 9556d28..f046d0e 100644
+--- a/net/rds/iw_cm.c
++++ b/net/rds/iw_cm.c
+@@ -663,7 +663,7 @@ void rds_iw_conn_shutdown(struct rds_connection *conn)
+       /* Clear the ACK state */
+       clear_bit(IB_ACK_IN_FLIGHT, &ic->i_ack_flags);
+ #ifdef KERNEL_HAS_ATOMIC64
+-      atomic64_set(&ic->i_ack_next, 0);
++      atomic64_set_unchecked(&ic->i_ack_next, 0);
+ #else
+       ic->i_ack_next = 0;
+ #endif
+diff --git a/net/rds/iw_rdma.c b/net/rds/iw_rdma.c
+index 4e1de17..d121708 100644
+--- a/net/rds/iw_rdma.c
++++ b/net/rds/iw_rdma.c
+@@ -184,6 +184,8 @@ int rds_iw_update_cm_id(struct rds_iw_device *rds_iwdev, struct rdma_cm_id *cm_i
        struct rdma_cm_id *pcm_id;
        int rc;
  
@@ -74330,10 +77075,11 @@ diff -urNp linux-3.1.3/net/rds/iw_rdma.c linux-3.1.3/net/rds/iw_rdma.c
        src_addr = (struct sockaddr_in *)&cm_id->route.addr.src_addr;
        dst_addr = (struct sockaddr_in *)&cm_id->route.addr.dst_addr;
  
-diff -urNp linux-3.1.3/net/rds/iw_recv.c linux-3.1.3/net/rds/iw_recv.c
---- linux-3.1.3/net/rds/iw_recv.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/rds/iw_recv.c      2011-11-16 18:39:08.000000000 -0500
-@@ -427,7 +427,7 @@ static u64 rds_iw_get_ack(struct rds_iw_
+diff --git a/net/rds/iw_recv.c b/net/rds/iw_recv.c
+index 5e57347..3916042 100644
+--- a/net/rds/iw_recv.c
++++ b/net/rds/iw_recv.c
+@@ -427,7 +427,7 @@ static u64 rds_iw_get_ack(struct rds_iw_connection *ic)
  static void rds_iw_set_ack(struct rds_iw_connection *ic, u64 seq,
                                int ack_required)
  {
@@ -74342,7 +77088,7 @@ diff -urNp linux-3.1.3/net/rds/iw_recv.c linux-3.1.3/net/rds/iw_recv.c
        if (ack_required) {
                smp_mb__before_clear_bit();
                set_bit(IB_ACK_REQUESTED, &ic->i_ack_flags);
-@@ -439,7 +439,7 @@ static u64 rds_iw_get_ack(struct rds_iw_
+@@ -439,7 +439,7 @@ static u64 rds_iw_get_ack(struct rds_iw_connection *ic)
        clear_bit(IB_ACK_REQUESTED, &ic->i_ack_flags);
        smp_mb__after_clear_bit();
  
@@ -74351,10 +77097,11 @@ diff -urNp linux-3.1.3/net/rds/iw_recv.c linux-3.1.3/net/rds/iw_recv.c
  }
  #endif
  
-diff -urNp linux-3.1.3/net/rds/tcp.c linux-3.1.3/net/rds/tcp.c
---- linux-3.1.3/net/rds/tcp.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/rds/tcp.c  2011-11-16 18:39:08.000000000 -0500
-@@ -58,7 +58,7 @@ void rds_tcp_nonagle(struct socket *sock
+diff --git a/net/rds/tcp.c b/net/rds/tcp.c
+index 8e0a320..ee8e38f 100644
+--- a/net/rds/tcp.c
++++ b/net/rds/tcp.c
+@@ -58,7 +58,7 @@ void rds_tcp_nonagle(struct socket *sock)
        int val = 1;
  
        set_fs(KERNEL_DS);
@@ -74363,10 +77110,11 @@ diff -urNp linux-3.1.3/net/rds/tcp.c linux-3.1.3/net/rds/tcp.c
                              sizeof(val));
        set_fs(oldfs);
  }
-diff -urNp linux-3.1.3/net/rds/tcp_send.c linux-3.1.3/net/rds/tcp_send.c
---- linux-3.1.3/net/rds/tcp_send.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/rds/tcp_send.c     2011-11-16 18:39:08.000000000 -0500
-@@ -43,7 +43,7 @@ static void rds_tcp_cork(struct socket *
+diff --git a/net/rds/tcp_send.c b/net/rds/tcp_send.c
+index 1b4fd68..2234175 100644
+--- a/net/rds/tcp_send.c
++++ b/net/rds/tcp_send.c
+@@ -43,7 +43,7 @@ static void rds_tcp_cork(struct socket *sock, int val)
  
        oldfs = get_fs();
        set_fs(KERNEL_DS);
@@ -74375,10 +77123,11 @@ diff -urNp linux-3.1.3/net/rds/tcp_send.c linux-3.1.3/net/rds/tcp_send.c
                              sizeof(val));
        set_fs(oldfs);
  }
-diff -urNp linux-3.1.3/net/rxrpc/af_rxrpc.c linux-3.1.3/net/rxrpc/af_rxrpc.c
---- linux-3.1.3/net/rxrpc/af_rxrpc.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/rxrpc/af_rxrpc.c   2011-11-16 18:39:08.000000000 -0500
-@@ -39,7 +39,7 @@ static const struct proto_ops rxrpc_rpc_
+diff --git a/net/rxrpc/af_rxrpc.c b/net/rxrpc/af_rxrpc.c
+index 74c064c..fdec26f 100644
+--- a/net/rxrpc/af_rxrpc.c
++++ b/net/rxrpc/af_rxrpc.c
+@@ -39,7 +39,7 @@ static const struct proto_ops rxrpc_rpc_ops;
  __be32 rxrpc_epoch;
  
  /* current debugging ID */
@@ -74387,10 +77136,11 @@ diff -urNp linux-3.1.3/net/rxrpc/af_rxrpc.c linux-3.1.3/net/rxrpc/af_rxrpc.c
  
  /* count of skbs currently in use */
  atomic_t rxrpc_n_skbs;
-diff -urNp linux-3.1.3/net/rxrpc/ar-ack.c linux-3.1.3/net/rxrpc/ar-ack.c
---- linux-3.1.3/net/rxrpc/ar-ack.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/rxrpc/ar-ack.c     2011-11-16 18:40:44.000000000 -0500
-@@ -175,7 +175,7 @@ static void rxrpc_resend(struct rxrpc_ca
+diff --git a/net/rxrpc/ar-ack.c b/net/rxrpc/ar-ack.c
+index f99cfce..3682692 100644
+--- a/net/rxrpc/ar-ack.c
++++ b/net/rxrpc/ar-ack.c
+@@ -175,7 +175,7 @@ static void rxrpc_resend(struct rxrpc_call *call)
  
        _enter("{%d,%d,%d,%d},",
               call->acks_hard, call->acks_unacked,
@@ -74399,7 +77149,7 @@ diff -urNp linux-3.1.3/net/rxrpc/ar-ack.c linux-3.1.3/net/rxrpc/ar-ack.c
               CIRC_CNT(call->acks_head, call->acks_tail, call->acks_winsz));
  
        stop = 0;
-@@ -199,7 +199,7 @@ static void rxrpc_resend(struct rxrpc_ca
+@@ -199,7 +199,7 @@ static void rxrpc_resend(struct rxrpc_call *call)
  
                        /* each Tx packet has a new serial number */
                        sp->hdr.serial =
@@ -74408,7 +77158,7 @@ diff -urNp linux-3.1.3/net/rxrpc/ar-ack.c linux-3.1.3/net/rxrpc/ar-ack.c
  
                        hdr = (struct rxrpc_header *) txb->head;
                        hdr->serial = sp->hdr.serial;
-@@ -403,7 +403,7 @@ static void rxrpc_rotate_tx_window(struc
+@@ -403,7 +403,7 @@ static void rxrpc_rotate_tx_window(struct rxrpc_call *call, u32 hard)
   */
  static void rxrpc_clear_tx_window(struct rxrpc_call *call)
  {
@@ -74426,7 +77176,7 @@ diff -urNp linux-3.1.3/net/rxrpc/ar-ack.c linux-3.1.3/net/rxrpc/ar-ack.c
  
                _proto("Rx ACK %%%u { m=%hu f=#%u p=#%u s=%%%u r=%s n=%u }",
                       latest,
-@@ -842,6 +842,8 @@ void rxrpc_process_call(struct work_stru
+@@ -842,6 +842,8 @@ void rxrpc_process_call(struct work_struct *work)
        u32 abort_code = RX_PROTOCOL_ERROR;
        u8 *acks = NULL;
  
@@ -74435,7 +77185,7 @@ diff -urNp linux-3.1.3/net/rxrpc/ar-ack.c linux-3.1.3/net/rxrpc/ar-ack.c
        //printk("\n--------------------\n");
        _enter("{%d,%s,%lx} [%lu]",
               call->debug_id, rxrpc_call_states[call->state], call->events,
-@@ -1161,7 +1163,7 @@ void rxrpc_process_call(struct work_stru
+@@ -1161,7 +1163,7 @@ void rxrpc_process_call(struct work_struct *work)
        goto maybe_reschedule;
  
  send_ACK_with_skew:
@@ -74462,10 +77212,11 @@ diff -urNp linux-3.1.3/net/rxrpc/ar-ack.c linux-3.1.3/net/rxrpc/ar-ack.c
        _proto("Tx %s %%%u", rxrpc_pkts[hdr.type], ntohl(hdr.serial));
  send_message_2:
  
-diff -urNp linux-3.1.3/net/rxrpc/ar-call.c linux-3.1.3/net/rxrpc/ar-call.c
---- linux-3.1.3/net/rxrpc/ar-call.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/rxrpc/ar-call.c    2011-11-16 18:39:08.000000000 -0500
-@@ -83,7 +83,7 @@ static struct rxrpc_call *rxrpc_alloc_ca
+diff --git a/net/rxrpc/ar-call.c b/net/rxrpc/ar-call.c
+index bf656c2..48f9d27 100644
+--- a/net/rxrpc/ar-call.c
++++ b/net/rxrpc/ar-call.c
+@@ -83,7 +83,7 @@ static struct rxrpc_call *rxrpc_alloc_call(gfp_t gfp)
        spin_lock_init(&call->lock);
        rwlock_init(&call->state_lock);
        atomic_set(&call->usage, 1);
@@ -74474,10 +77225,11 @@ diff -urNp linux-3.1.3/net/rxrpc/ar-call.c linux-3.1.3/net/rxrpc/ar-call.c
        call->state = RXRPC_CALL_CLIENT_SEND_REQUEST;
  
        memset(&call->sock_node, 0xed, sizeof(call->sock_node));
-diff -urNp linux-3.1.3/net/rxrpc/ar-connection.c linux-3.1.3/net/rxrpc/ar-connection.c
---- linux-3.1.3/net/rxrpc/ar-connection.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/rxrpc/ar-connection.c      2011-11-16 18:39:08.000000000 -0500
-@@ -206,7 +206,7 @@ static struct rxrpc_connection *rxrpc_al
+diff --git a/net/rxrpc/ar-connection.c b/net/rxrpc/ar-connection.c
+index 4106ca9..a338d7a 100644
+--- a/net/rxrpc/ar-connection.c
++++ b/net/rxrpc/ar-connection.c
+@@ -206,7 +206,7 @@ static struct rxrpc_connection *rxrpc_alloc_connection(gfp_t gfp)
                rwlock_init(&conn->lock);
                spin_lock_init(&conn->state_lock);
                atomic_set(&conn->usage, 1);
@@ -74486,10 +77238,11 @@ diff -urNp linux-3.1.3/net/rxrpc/ar-connection.c linux-3.1.3/net/rxrpc/ar-connec
                conn->avail_calls = RXRPC_MAXCALLS;
                conn->size_align = 4;
                conn->header_size = sizeof(struct rxrpc_header);
-diff -urNp linux-3.1.3/net/rxrpc/ar-connevent.c linux-3.1.3/net/rxrpc/ar-connevent.c
---- linux-3.1.3/net/rxrpc/ar-connevent.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/rxrpc/ar-connevent.c       2011-11-16 18:39:08.000000000 -0500
-@@ -109,7 +109,7 @@ static int rxrpc_abort_connection(struct
+diff --git a/net/rxrpc/ar-connevent.c b/net/rxrpc/ar-connevent.c
+index e7ed43a..6afa140 100644
+--- a/net/rxrpc/ar-connevent.c
++++ b/net/rxrpc/ar-connevent.c
+@@ -109,7 +109,7 @@ static int rxrpc_abort_connection(struct rxrpc_connection *conn,
  
        len = iov[0].iov_len + iov[1].iov_len;
  
@@ -74498,10 +77251,11 @@ diff -urNp linux-3.1.3/net/rxrpc/ar-connevent.c linux-3.1.3/net/rxrpc/ar-conneve
        _proto("Tx CONN ABORT %%%u { %d }", ntohl(hdr.serial), abort_code);
  
        ret = kernel_sendmsg(conn->trans->local->socket, &msg, iov, 2, len);
-diff -urNp linux-3.1.3/net/rxrpc/ar-input.c linux-3.1.3/net/rxrpc/ar-input.c
---- linux-3.1.3/net/rxrpc/ar-input.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/rxrpc/ar-input.c   2011-11-16 18:39:08.000000000 -0500
-@@ -340,9 +340,9 @@ void rxrpc_fast_process_packet(struct rx
+diff --git a/net/rxrpc/ar-input.c b/net/rxrpc/ar-input.c
+index 1a2b0633..e8d1382 100644
+--- a/net/rxrpc/ar-input.c
++++ b/net/rxrpc/ar-input.c
+@@ -340,9 +340,9 @@ void rxrpc_fast_process_packet(struct rxrpc_call *call, struct sk_buff *skb)
        /* track the latest serial number on this connection for ACK packet
         * information */
        serial = ntohl(sp->hdr.serial);
@@ -74513,9 +77267,10 @@ diff -urNp linux-3.1.3/net/rxrpc/ar-input.c linux-3.1.3/net/rxrpc/ar-input.c
                                           serial);
  
        /* request ACK generation for any ACK or DATA packet that requests
-diff -urNp linux-3.1.3/net/rxrpc/ar-internal.h linux-3.1.3/net/rxrpc/ar-internal.h
---- linux-3.1.3/net/rxrpc/ar-internal.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/rxrpc/ar-internal.h        2011-11-16 18:39:08.000000000 -0500
+diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h
+index 8e22bd3..f66d1c0 100644
+--- a/net/rxrpc/ar-internal.h
++++ b/net/rxrpc/ar-internal.h
 @@ -272,8 +272,8 @@ struct rxrpc_connection {
        int                     error;          /* error code for local abort */
        int                     debug_id;       /* debug ID for printks */
@@ -74536,7 +77291,7 @@ diff -urNp linux-3.1.3/net/rxrpc/ar-internal.h linux-3.1.3/net/rxrpc/ar-internal
        u32                     abort_code;     /* local/remote abort code */
        enum {                                  /* current state of call */
                RXRPC_CALL_CLIENT_SEND_REQUEST, /* - client sending request phase */
-@@ -420,7 +420,7 @@ static inline void rxrpc_abort_call(stru
+@@ -420,7 +420,7 @@ static inline void rxrpc_abort_call(struct rxrpc_call *call, u32 abort_code)
   */
  extern atomic_t rxrpc_n_skbs;
  extern __be32 rxrpc_epoch;
@@ -74545,10 +77300,11 @@ diff -urNp linux-3.1.3/net/rxrpc/ar-internal.h linux-3.1.3/net/rxrpc/ar-internal
  extern struct workqueue_struct *rxrpc_workqueue;
  
  /*
-diff -urNp linux-3.1.3/net/rxrpc/ar-local.c linux-3.1.3/net/rxrpc/ar-local.c
---- linux-3.1.3/net/rxrpc/ar-local.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/rxrpc/ar-local.c   2011-11-16 18:39:08.000000000 -0500
-@@ -45,7 +45,7 @@ struct rxrpc_local *rxrpc_alloc_local(st
+diff --git a/net/rxrpc/ar-local.c b/net/rxrpc/ar-local.c
+index 87f7135..74d3703 100644
+--- a/net/rxrpc/ar-local.c
++++ b/net/rxrpc/ar-local.c
+@@ -45,7 +45,7 @@ struct rxrpc_local *rxrpc_alloc_local(struct sockaddr_rxrpc *srx)
                spin_lock_init(&local->lock);
                rwlock_init(&local->services_lock);
                atomic_set(&local->usage, 1);
@@ -74557,10 +77313,11 @@ diff -urNp linux-3.1.3/net/rxrpc/ar-local.c linux-3.1.3/net/rxrpc/ar-local.c
                memcpy(&local->srx, srx, sizeof(*srx));
        }
  
-diff -urNp linux-3.1.3/net/rxrpc/ar-output.c linux-3.1.3/net/rxrpc/ar-output.c
---- linux-3.1.3/net/rxrpc/ar-output.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/rxrpc/ar-output.c  2011-11-16 18:39:08.000000000 -0500
-@@ -681,9 +681,9 @@ static int rxrpc_send_data(struct kiocb 
+diff --git a/net/rxrpc/ar-output.c b/net/rxrpc/ar-output.c
+index 5f22e26..e5bd20f 100644
+--- a/net/rxrpc/ar-output.c
++++ b/net/rxrpc/ar-output.c
+@@ -681,9 +681,9 @@ static int rxrpc_send_data(struct kiocb *iocb,
                        sp->hdr.cid = call->cid;
                        sp->hdr.callNumber = call->call_id;
                        sp->hdr.seq =
@@ -74572,10 +77329,11 @@ diff -urNp linux-3.1.3/net/rxrpc/ar-output.c linux-3.1.3/net/rxrpc/ar-output.c
                        sp->hdr.type = RXRPC_PACKET_TYPE_DATA;
                        sp->hdr.userStatus = 0;
                        sp->hdr.securityIndex = conn->security_ix;
-diff -urNp linux-3.1.3/net/rxrpc/ar-peer.c linux-3.1.3/net/rxrpc/ar-peer.c
---- linux-3.1.3/net/rxrpc/ar-peer.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/rxrpc/ar-peer.c    2011-11-16 18:39:08.000000000 -0500
-@@ -72,7 +72,7 @@ static struct rxrpc_peer *rxrpc_alloc_pe
+diff --git a/net/rxrpc/ar-peer.c b/net/rxrpc/ar-peer.c
+index 2754f09..b20e38f 100644
+--- a/net/rxrpc/ar-peer.c
++++ b/net/rxrpc/ar-peer.c
+@@ -72,7 +72,7 @@ static struct rxrpc_peer *rxrpc_alloc_peer(struct sockaddr_rxrpc *srx,
                INIT_LIST_HEAD(&peer->error_targets);
                spin_lock_init(&peer->lock);
                atomic_set(&peer->usage, 1);
@@ -74584,10 +77342,11 @@ diff -urNp linux-3.1.3/net/rxrpc/ar-peer.c linux-3.1.3/net/rxrpc/ar-peer.c
                memcpy(&peer->srx, srx, sizeof(*srx));
  
                rxrpc_assess_MTU_size(peer);
-diff -urNp linux-3.1.3/net/rxrpc/ar-proc.c linux-3.1.3/net/rxrpc/ar-proc.c
---- linux-3.1.3/net/rxrpc/ar-proc.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/rxrpc/ar-proc.c    2011-11-16 18:39:08.000000000 -0500
-@@ -164,8 +164,8 @@ static int rxrpc_connection_seq_show(str
+diff --git a/net/rxrpc/ar-proc.c b/net/rxrpc/ar-proc.c
+index 38047f7..9f48511 100644
+--- a/net/rxrpc/ar-proc.c
++++ b/net/rxrpc/ar-proc.c
+@@ -164,8 +164,8 @@ static int rxrpc_connection_seq_show(struct seq_file *seq, void *v)
                   atomic_read(&conn->usage),
                   rxrpc_conn_states[conn->state],
                   key_serial(conn->key),
@@ -74598,10 +77357,11 @@ diff -urNp linux-3.1.3/net/rxrpc/ar-proc.c linux-3.1.3/net/rxrpc/ar-proc.c
  
        return 0;
  }
-diff -urNp linux-3.1.3/net/rxrpc/ar-transport.c linux-3.1.3/net/rxrpc/ar-transport.c
---- linux-3.1.3/net/rxrpc/ar-transport.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/rxrpc/ar-transport.c       2011-11-16 18:39:08.000000000 -0500
-@@ -47,7 +47,7 @@ static struct rxrpc_transport *rxrpc_all
+diff --git a/net/rxrpc/ar-transport.c b/net/rxrpc/ar-transport.c
+index 92df566..87ec1bf 100644
+--- a/net/rxrpc/ar-transport.c
++++ b/net/rxrpc/ar-transport.c
+@@ -47,7 +47,7 @@ static struct rxrpc_transport *rxrpc_alloc_transport(struct rxrpc_local *local,
                spin_lock_init(&trans->client_lock);
                rwlock_init(&trans->conn_lock);
                atomic_set(&trans->usage, 1);
@@ -74610,10 +77370,11 @@ diff -urNp linux-3.1.3/net/rxrpc/ar-transport.c linux-3.1.3/net/rxrpc/ar-transpo
  
                if (peer->srx.transport.family == AF_INET) {
                        switch (peer->srx.transport_type) {
-diff -urNp linux-3.1.3/net/rxrpc/rxkad.c linux-3.1.3/net/rxrpc/rxkad.c
---- linux-3.1.3/net/rxrpc/rxkad.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/rxrpc/rxkad.c      2011-11-16 18:40:44.000000000 -0500
-@@ -211,6 +211,8 @@ static int rxkad_secure_packet_encrypt(c
+diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c
+index 7635107..5000b71 100644
+--- a/net/rxrpc/rxkad.c
++++ b/net/rxrpc/rxkad.c
+@@ -211,6 +211,8 @@ static int rxkad_secure_packet_encrypt(const struct rxrpc_call *call,
        u16 check;
        int nsg;
  
@@ -74622,7 +77383,7 @@ diff -urNp linux-3.1.3/net/rxrpc/rxkad.c linux-3.1.3/net/rxrpc/rxkad.c
        sp = rxrpc_skb(skb);
  
        _enter("");
-@@ -338,6 +340,8 @@ static int rxkad_verify_packet_auth(cons
+@@ -338,6 +340,8 @@ static int rxkad_verify_packet_auth(const struct rxrpc_call *call,
        u16 check;
        int nsg;
  
@@ -74631,7 +77392,7 @@ diff -urNp linux-3.1.3/net/rxrpc/rxkad.c linux-3.1.3/net/rxrpc/rxkad.c
        _enter("");
  
        sp = rxrpc_skb(skb);
-@@ -610,7 +614,7 @@ static int rxkad_issue_challenge(struct 
+@@ -610,7 +614,7 @@ static int rxkad_issue_challenge(struct rxrpc_connection *conn)
  
        len = iov[0].iov_len + iov[1].iov_len;
  
@@ -74640,7 +77401,7 @@ diff -urNp linux-3.1.3/net/rxrpc/rxkad.c linux-3.1.3/net/rxrpc/rxkad.c
        _proto("Tx CHALLENGE %%%u", ntohl(hdr.serial));
  
        ret = kernel_sendmsg(conn->trans->local->socket, &msg, iov, 2, len);
-@@ -660,7 +664,7 @@ static int rxkad_send_response(struct rx
+@@ -660,7 +664,7 @@ static int rxkad_send_response(struct rxrpc_connection *conn,
  
        len = iov[0].iov_len + iov[1].iov_len + iov[2].iov_len;
  
@@ -74649,10 +77410,24 @@ diff -urNp linux-3.1.3/net/rxrpc/rxkad.c linux-3.1.3/net/rxrpc/rxkad.c
        _proto("Tx RESPONSE %%%u", ntohl(hdr->serial));
  
        ret = kernel_sendmsg(conn->trans->local->socket, &msg, iov, 3, len);
-diff -urNp linux-3.1.3/net/sctp/proc.c linux-3.1.3/net/sctp/proc.c
---- linux-3.1.3/net/sctp/proc.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/sctp/proc.c        2011-11-16 18:40:44.000000000 -0500
-@@ -318,7 +318,8 @@ static int sctp_assocs_seq_show(struct s
+diff --git a/net/sctp/auth.c b/net/sctp/auth.c
+index 865e68f..bf81204 100644
+--- a/net/sctp/auth.c
++++ b/net/sctp/auth.c
+@@ -82,7 +82,7 @@ static struct sctp_auth_bytes *sctp_auth_create_key(__u32 key_len, gfp_t gfp)
+       struct sctp_auth_bytes *key;
+       /* Verify that we are not going to overflow INT_MAX */
+-      if ((INT_MAX - key_len) < sizeof(struct sctp_auth_bytes))
++      if (key_len > (INT_MAX - sizeof(struct sctp_auth_bytes)))
+               return NULL;
+       /* Allocate the shared key */
+diff --git a/net/sctp/proc.c b/net/sctp/proc.c
+index 05a6ce2..c8bf836 100644
+--- a/net/sctp/proc.c
++++ b/net/sctp/proc.c
+@@ -318,7 +318,8 @@ static int sctp_assocs_seq_show(struct seq_file *seq, void *v)
                seq_printf(seq,
                           "%8pK %8pK %-3d %-3d %-2d %-4d "
                           "%4d %8d %8d %7d %5lu %-5d %5d ",
@@ -74662,10 +77437,11 @@ diff -urNp linux-3.1.3/net/sctp/proc.c linux-3.1.3/net/sctp/proc.c
                           assoc->state, hash,
                           assoc->assoc_id,
                           assoc->sndbuf_used,
-diff -urNp linux-3.1.3/net/sctp/socket.c linux-3.1.3/net/sctp/socket.c
---- linux-3.1.3/net/sctp/socket.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/sctp/socket.c      2011-11-16 18:39:08.000000000 -0500
-@@ -4575,7 +4575,7 @@ static int sctp_getsockopt_peer_addrs(st
+diff --git a/net/sctp/socket.c b/net/sctp/socket.c
+index 836aa63..d779d7b 100644
+--- a/net/sctp/socket.c
++++ b/net/sctp/socket.c
+@@ -4575,7 +4575,7 @@ static int sctp_getsockopt_peer_addrs(struct sock *sk, int len,
                addrlen = sctp_get_af_specific(temp.sa.sa_family)->sockaddr_len;
                if (space_left < addrlen)
                        return -ENOMEM;
@@ -74674,9 +77450,10 @@ diff -urNp linux-3.1.3/net/sctp/socket.c linux-3.1.3/net/sctp/socket.c
                        return -EFAULT;
                to += addrlen;
                cnt++;
-diff -urNp linux-3.1.3/net/socket.c linux-3.1.3/net/socket.c
---- linux-3.1.3/net/socket.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/socket.c   2011-11-16 18:40:44.000000000 -0500
+diff --git a/net/socket.c b/net/socket.c
+index ffe92ca..8057b85 100644
+--- a/net/socket.c
++++ b/net/socket.c
 @@ -88,6 +88,7 @@
  #include <linux/nsproxy.h>
  #include <linux/magic.h>
@@ -74694,7 +77471,7 @@ diff -urNp linux-3.1.3/net/socket.c linux-3.1.3/net/socket.c
  static int sock_no_open(struct inode *irrelevant, struct file *dontcare);
  static ssize_t sock_aio_read(struct kiocb *iocb, const struct iovec *iov,
                         unsigned long nr_segs, loff_t pos);
-@@ -321,7 +324,7 @@ static struct dentry *sockfs_mount(struc
+@@ -321,7 +324,7 @@ static struct dentry *sockfs_mount(struct file_system_type *fs_type,
                &sockfs_dentry_operations, SOCKFS_MAGIC);
  }
  
@@ -74703,7 +77480,7 @@ diff -urNp linux-3.1.3/net/socket.c linux-3.1.3/net/socket.c
  
  static struct file_system_type sock_fs_type = {
        .name =         "sockfs",
-@@ -1187,6 +1190,8 @@ int __sock_create(struct net *net, int f
+@@ -1187,6 +1190,8 @@ int __sock_create(struct net *net, int family, int type, int protocol,
                return -EAFNOSUPPORT;
        if (type < 0 || type >= SOCK_MAX)
                return -EINVAL;
@@ -74712,7 +77489,7 @@ diff -urNp linux-3.1.3/net/socket.c linux-3.1.3/net/socket.c
  
        /* Compatibility.
  
-@@ -1319,6 +1324,16 @@ SYSCALL_DEFINE3(socket, int, family, int
+@@ -1319,6 +1324,16 @@ SYSCALL_DEFINE3(socket, int, family, int, type, int, protocol)
        if (SOCK_NONBLOCK != O_NONBLOCK && (flags & SOCK_NONBLOCK))
                flags = (flags & ~SOCK_NONBLOCK) | O_NONBLOCK;
  
@@ -74729,7 +77506,7 @@ diff -urNp linux-3.1.3/net/socket.c linux-3.1.3/net/socket.c
        retval = sock_create(family, type, protocol, &sock);
        if (retval < 0)
                goto out;
-@@ -1431,6 +1446,14 @@ SYSCALL_DEFINE3(bind, int, fd, struct so
+@@ -1431,6 +1446,14 @@ SYSCALL_DEFINE3(bind, int, fd, struct sockaddr __user *, umyaddr, int, addrlen)
        if (sock) {
                err = move_addr_to_kernel(umyaddr, addrlen, (struct sockaddr *)&address);
                if (err >= 0) {
@@ -74744,7 +77521,7 @@ diff -urNp linux-3.1.3/net/socket.c linux-3.1.3/net/socket.c
                        err = security_socket_bind(sock,
                                                   (struct sockaddr *)&address,
                                                   addrlen);
-@@ -1439,6 +1462,7 @@ SYSCALL_DEFINE3(bind, int, fd, struct so
+@@ -1439,6 +1462,7 @@ SYSCALL_DEFINE3(bind, int, fd, struct sockaddr __user *, umyaddr, int, addrlen)
                                                      (struct sockaddr *)
                                                      &address, addrlen);
                }
@@ -74752,7 +77529,7 @@ diff -urNp linux-3.1.3/net/socket.c linux-3.1.3/net/socket.c
                fput_light(sock->file, fput_needed);
        }
        return err;
-@@ -1462,10 +1486,20 @@ SYSCALL_DEFINE2(listen, int, fd, int, ba
+@@ -1462,10 +1486,20 @@ SYSCALL_DEFINE2(listen, int, fd, int, backlog)
                if ((unsigned)backlog > somaxconn)
                        backlog = somaxconn;
  
@@ -74773,7 +77550,7 @@ diff -urNp linux-3.1.3/net/socket.c linux-3.1.3/net/socket.c
                fput_light(sock->file, fput_needed);
        }
        return err;
-@@ -1509,6 +1543,18 @@ SYSCALL_DEFINE4(accept4, int, fd, struct
+@@ -1509,6 +1543,18 @@ SYSCALL_DEFINE4(accept4, int, fd, struct sockaddr __user *, upeer_sockaddr,
        newsock->type = sock->type;
        newsock->ops = sock->ops;
  
@@ -74792,7 +77569,7 @@ diff -urNp linux-3.1.3/net/socket.c linux-3.1.3/net/socket.c
        /*
         * We don't need try_module_get here, as the listening socket (sock)
         * has the protocol module (sock->ops->owner) held.
-@@ -1547,6 +1593,8 @@ SYSCALL_DEFINE4(accept4, int, fd, struct
+@@ -1547,6 +1593,8 @@ SYSCALL_DEFINE4(accept4, int, fd, struct sockaddr __user *, upeer_sockaddr,
        fd_install(newfd, newfile);
        err = newfd;
  
@@ -74801,7 +77578,7 @@ diff -urNp linux-3.1.3/net/socket.c linux-3.1.3/net/socket.c
  out_put:
        fput_light(sock->file, fput_needed);
  out:
-@@ -1579,6 +1627,7 @@ SYSCALL_DEFINE3(connect, int, fd, struct
+@@ -1579,6 +1627,7 @@ SYSCALL_DEFINE3(connect, int, fd, struct sockaddr __user *, uservaddr,
                int, addrlen)
  {
        struct socket *sock;
@@ -74809,7 +77586,7 @@ diff -urNp linux-3.1.3/net/socket.c linux-3.1.3/net/socket.c
        struct sockaddr_storage address;
        int err, fput_needed;
  
-@@ -1589,6 +1638,17 @@ SYSCALL_DEFINE3(connect, int, fd, struct
+@@ -1589,6 +1638,17 @@ SYSCALL_DEFINE3(connect, int, fd, struct sockaddr __user *, uservaddr,
        if (err < 0)
                goto out_put;
  
@@ -74827,7 +77604,7 @@ diff -urNp linux-3.1.3/net/socket.c linux-3.1.3/net/socket.c
        err =
            security_socket_connect(sock, (struct sockaddr *)&address, addrlen);
        if (err)
-@@ -1890,6 +1950,8 @@ static int __sys_sendmsg(struct socket *
+@@ -1890,6 +1950,8 @@ static int __sys_sendmsg(struct socket *sock, struct msghdr __user *msg,
        unsigned char *ctl_buf = ctl;
        int err, ctl_len, iov_size, total_len;
  
@@ -74836,7 +77613,7 @@ diff -urNp linux-3.1.3/net/socket.c linux-3.1.3/net/socket.c
        err = -EFAULT;
        if (MSG_CMSG_COMPAT & flags) {
                if (get_compat_msghdr(msg_sys, msg_compat))
-@@ -1950,7 +2012,7 @@ static int __sys_sendmsg(struct socket *
+@@ -1950,7 +2012,7 @@ static int __sys_sendmsg(struct socket *sock, struct msghdr __user *msg,
                 * checking falls down on this.
                 */
                if (copy_from_user(ctl_buf,
@@ -74845,7 +77622,7 @@ diff -urNp linux-3.1.3/net/socket.c linux-3.1.3/net/socket.c
                                   ctl_len))
                        goto out_freectl;
                msg_sys->msg_control = ctl_buf;
-@@ -2120,7 +2182,7 @@ static int __sys_recvmsg(struct socket *
+@@ -2120,7 +2182,7 @@ static int __sys_recvmsg(struct socket *sock, struct msghdr __user *msg,
         *      kernel msghdr to use the kernel address space)
         */
  
@@ -74854,7 +77631,7 @@ diff -urNp linux-3.1.3/net/socket.c linux-3.1.3/net/socket.c
        uaddr_len = COMPAT_NAMELEN(msg);
        if (MSG_CMSG_COMPAT & flags) {
                err = verify_compat_iovec(msg_sys, iov,
-@@ -2748,7 +2810,7 @@ static int ethtool_ioctl(struct net *net
+@@ -2748,7 +2810,7 @@ static int ethtool_ioctl(struct net *net, struct compat_ifreq __user *ifr32)
        }
  
        ifr = compat_alloc_user_space(buf_size);
@@ -74863,7 +77640,7 @@ diff -urNp linux-3.1.3/net/socket.c linux-3.1.3/net/socket.c
  
        if (copy_in_user(&ifr->ifr_name, &ifr32->ifr_name, IFNAMSIZ))
                return -EFAULT;
-@@ -2772,12 +2834,12 @@ static int ethtool_ioctl(struct net *net
+@@ -2772,12 +2834,12 @@ static int ethtool_ioctl(struct net *net, struct compat_ifreq __user *ifr32)
                        offsetof(struct ethtool_rxnfc, fs.ring_cookie));
  
                if (copy_in_user(rxnfc, compat_rxnfc,
@@ -74880,7 +77657,7 @@ diff -urNp linux-3.1.3/net/socket.c linux-3.1.3/net/socket.c
                    copy_in_user(&rxnfc->rule_cnt, &compat_rxnfc->rule_cnt,
                                 sizeof(rxnfc->rule_cnt)))
                        return -EFAULT;
-@@ -2789,12 +2851,12 @@ static int ethtool_ioctl(struct net *net
+@@ -2789,12 +2851,12 @@ static int ethtool_ioctl(struct net *net, struct compat_ifreq __user *ifr32)
  
        if (convert_out) {
                if (copy_in_user(compat_rxnfc, rxnfc,
@@ -74897,7 +77674,7 @@ diff -urNp linux-3.1.3/net/socket.c linux-3.1.3/net/socket.c
                    copy_in_user(&compat_rxnfc->rule_cnt, &rxnfc->rule_cnt,
                                 sizeof(rxnfc->rule_cnt)))
                        return -EFAULT;
-@@ -2864,7 +2926,7 @@ static int bond_ioctl(struct net *net, u
+@@ -2864,7 +2926,7 @@ static int bond_ioctl(struct net *net, unsigned int cmd,
                old_fs = get_fs();
                set_fs(KERNEL_DS);
                err = dev_ioctl(net, cmd,
@@ -74906,7 +77683,7 @@ diff -urNp linux-3.1.3/net/socket.c linux-3.1.3/net/socket.c
                set_fs(old_fs);
  
                return err;
-@@ -2973,7 +3035,7 @@ static int compat_sioc_ifmap(struct net 
+@@ -2973,7 +3035,7 @@ static int compat_sioc_ifmap(struct net *net, unsigned int cmd,
  
        old_fs = get_fs();
        set_fs(KERNEL_DS);
@@ -74915,7 +77692,7 @@ diff -urNp linux-3.1.3/net/socket.c linux-3.1.3/net/socket.c
        set_fs(old_fs);
  
        if (cmd == SIOCGIFMAP && !err) {
-@@ -3078,7 +3140,7 @@ static int routing_ioctl(struct net *net
+@@ -3078,7 +3140,7 @@ static int routing_ioctl(struct net *net, struct socket *sock,
                ret |= __get_user(rtdev, &(ur4->rt_dev));
                if (rtdev) {
                        ret |= copy_from_user(devname, compat_ptr(rtdev), 15);
@@ -74924,7 +77701,7 @@ diff -urNp linux-3.1.3/net/socket.c linux-3.1.3/net/socket.c
                        devname[15] = 0;
                } else
                        r4.rt_dev = NULL;
-@@ -3318,8 +3380,8 @@ int kernel_getsockopt(struct socket *soc
+@@ -3318,8 +3380,8 @@ int kernel_getsockopt(struct socket *sock, int level, int optname,
        int __user *uoptlen;
        int err;
  
@@ -74935,7 +77712,7 @@ diff -urNp linux-3.1.3/net/socket.c linux-3.1.3/net/socket.c
  
        set_fs(KERNEL_DS);
        if (level == SOL_SOCKET)
-@@ -3339,7 +3401,7 @@ int kernel_setsockopt(struct socket *soc
+@@ -3339,7 +3401,7 @@ int kernel_setsockopt(struct socket *sock, int level, int optname,
        char __user *uoptval;
        int err;
  
@@ -74944,10 +77721,11 @@ diff -urNp linux-3.1.3/net/socket.c linux-3.1.3/net/socket.c
  
        set_fs(KERNEL_DS);
        if (level == SOL_SOCKET)
-diff -urNp linux-3.1.3/net/sunrpc/sched.c linux-3.1.3/net/sunrpc/sched.c
---- linux-3.1.3/net/sunrpc/sched.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/sunrpc/sched.c     2011-11-16 18:39:08.000000000 -0500
-@@ -238,9 +238,9 @@ static int rpc_wait_bit_killable(void *w
+diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
+index d12ffa5..0b5a6e2 100644
+--- a/net/sunrpc/sched.c
++++ b/net/sunrpc/sched.c
+@@ -238,9 +238,9 @@ static int rpc_wait_bit_killable(void *word)
  #ifdef RPC_DEBUG
  static void rpc_task_set_debuginfo(struct rpc_task *task)
  {
@@ -74959,10 +77737,11 @@ diff -urNp linux-3.1.3/net/sunrpc/sched.c linux-3.1.3/net/sunrpc/sched.c
  }
  #else
  static inline void rpc_task_set_debuginfo(struct rpc_task *task)
-diff -urNp linux-3.1.3/net/sunrpc/svcsock.c linux-3.1.3/net/sunrpc/svcsock.c
---- linux-3.1.3/net/sunrpc/svcsock.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/sunrpc/svcsock.c   2011-11-16 18:39:08.000000000 -0500
-@@ -394,7 +394,7 @@ static int svc_partial_recvfrom(struct s
+diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
+index 767d494..fe17e9d 100644
+--- a/net/sunrpc/svcsock.c
++++ b/net/sunrpc/svcsock.c
+@@ -394,7 +394,7 @@ static int svc_partial_recvfrom(struct svc_rqst *rqstp,
                                int buflen, unsigned int base)
  {
        size_t save_iovlen;
@@ -74971,10 +77750,11 @@ diff -urNp linux-3.1.3/net/sunrpc/svcsock.c linux-3.1.3/net/sunrpc/svcsock.c
        unsigned int i;
        int ret;
  
-diff -urNp linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma.c linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma.c
---- linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma.c 2011-11-16 18:39:08.000000000 -0500
-@@ -61,15 +61,15 @@ unsigned int svcrdma_max_req_size = RPCR
+diff --git a/net/sunrpc/xprtrdma/svc_rdma.c b/net/sunrpc/xprtrdma/svc_rdma.c
+index 09af4fa..77110a9 100644
+--- a/net/sunrpc/xprtrdma/svc_rdma.c
++++ b/net/sunrpc/xprtrdma/svc_rdma.c
+@@ -61,15 +61,15 @@ unsigned int svcrdma_max_req_size = RPCRDMA_MAX_REQ_SIZE;
  static unsigned int min_max_inline = 4096;
  static unsigned int max_max_inline = 65536;
  
@@ -74999,7 +77779,7 @@ diff -urNp linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma.c linux-3.1.3/net/sunrpc/xpr
  
  /* Temporary NFS request map and context caches */
  struct kmem_cache *svc_rdma_map_cachep;
-@@ -109,7 +109,7 @@ static int read_reset_stat(ctl_table *ta
+@@ -109,7 +109,7 @@ static int read_reset_stat(ctl_table *table, int write,
                len -= *ppos;
                if (len > *lenp)
                        len = *lenp;
@@ -75008,7 +77788,7 @@ diff -urNp linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma.c linux-3.1.3/net/sunrpc/xpr
                        return -EFAULT;
                *lenp = len;
                *ppos += len;
-@@ -150,63 +150,63 @@ static ctl_table svcrdma_parm_table[] = 
+@@ -150,63 +150,63 @@ static ctl_table svcrdma_parm_table[] = {
        {
                .procname       = "rdma_stat_read",
                .data           = &rdma_stat_read,
@@ -75081,9 +77861,10 @@ diff -urNp linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma.c linux-3.1.3/net/sunrpc/xpr
                .mode           = 0644,
                .proc_handler   = read_reset_stat,
        },
-diff -urNp linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
---- linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c        2011-11-16 18:39:08.000000000 -0500
+diff --git a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
+index df67211..c354b13 100644
+--- a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
++++ b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
 @@ -499,7 +499,7 @@ next_sge:
                        svc_rdma_put_context(ctxt, 0);
                        goto out;
@@ -75093,7 +77874,7 @@ diff -urNp linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c linux-3.1.3/net/s
  
                if (read_wr.num_sge < chl_map->ch[ch_no].count) {
                        chl_map->ch[ch_no].count -= read_wr.num_sge;
-@@ -609,7 +609,7 @@ int svc_rdma_recvfrom(struct svc_rqst *r
+@@ -609,7 +609,7 @@ int svc_rdma_recvfrom(struct svc_rqst *rqstp)
                                  dto_q);
                list_del_init(&ctxt->dto_q);
        } else {
@@ -75102,7 +77883,7 @@ diff -urNp linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c linux-3.1.3/net/s
                clear_bit(XPT_DATA, &xprt->xpt_flags);
                ctxt = NULL;
        }
-@@ -629,7 +629,7 @@ int svc_rdma_recvfrom(struct svc_rqst *r
+@@ -629,7 +629,7 @@ int svc_rdma_recvfrom(struct svc_rqst *rqstp)
        dprintk("svcrdma: processing ctxt=%p on xprt=%p, rqstp=%p, status=%d\n",
                ctxt, rdma_xprt, rqstp, ctxt->wc_status);
        BUG_ON(ctxt->wc_status != IB_WC_SUCCESS);
@@ -75111,10 +77892,11 @@ diff -urNp linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c linux-3.1.3/net/s
  
        /* Build up the XDR from the receive buffers. */
        rdma_build_arg_xdr(rqstp, ctxt, ctxt->byte_len);
-diff -urNp linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_sendto.c linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_sendto.c
---- linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_sendto.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_sendto.c  2011-11-16 18:39:08.000000000 -0500
-@@ -362,7 +362,7 @@ static int send_write(struct svcxprt_rdm
+diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
+index 249a835..fb2794b 100644
+--- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c
++++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
+@@ -362,7 +362,7 @@ static int send_write(struct svcxprt_rdma *xprt, struct svc_rqst *rqstp,
        write_wr.wr.rdma.remote_addr = to;
  
        /* Post It */
@@ -75123,10 +77905,11 @@ diff -urNp linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_sendto.c linux-3.1.3/net/sun
        if (svc_rdma_send(xprt, &write_wr))
                goto err;
        return 0;
-diff -urNp linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_transport.c linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_transport.c
---- linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_transport.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_transport.c       2011-11-16 18:39:08.000000000 -0500
-@@ -299,7 +299,7 @@ static void rq_cq_reap(struct svcxprt_rd
+diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c
+index a385430..32254ea 100644
+--- a/net/sunrpc/xprtrdma/svc_rdma_transport.c
++++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c
+@@ -299,7 +299,7 @@ static void rq_cq_reap(struct svcxprt_rdma *xprt)
                return;
  
        ib_req_notify_cq(xprt->sc_rq_cq, IB_CQ_NEXT_COMP);
@@ -75135,7 +77918,7 @@ diff -urNp linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_transport.c linux-3.1.3/net/
  
        while ((ret = ib_poll_cq(xprt->sc_rq_cq, 1, &wc)) > 0) {
                ctxt = (struct svc_rdma_op_ctxt *)(unsigned long)wc.wr_id;
-@@ -321,7 +321,7 @@ static void rq_cq_reap(struct svcxprt_rd
+@@ -321,7 +321,7 @@ static void rq_cq_reap(struct svcxprt_rdma *xprt)
        }
  
        if (ctxt)
@@ -75144,7 +77927,7 @@ diff -urNp linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_transport.c linux-3.1.3/net/
  
        set_bit(XPT_DATA, &xprt->sc_xprt.xpt_flags);
        /*
-@@ -393,7 +393,7 @@ static void sq_cq_reap(struct svcxprt_rd
+@@ -393,7 +393,7 @@ static void sq_cq_reap(struct svcxprt_rdma *xprt)
                return;
  
        ib_req_notify_cq(xprt->sc_sq_cq, IB_CQ_NEXT_COMP);
@@ -75153,7 +77936,7 @@ diff -urNp linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_transport.c linux-3.1.3/net/
        while ((ret = ib_poll_cq(cq, 1, &wc)) > 0) {
                if (wc.status != IB_WC_SUCCESS)
                        /* Close the transport */
-@@ -411,7 +411,7 @@ static void sq_cq_reap(struct svcxprt_rd
+@@ -411,7 +411,7 @@ static void sq_cq_reap(struct svcxprt_rdma *xprt)
        }
  
        if (ctxt)
@@ -75162,7 +77945,7 @@ diff -urNp linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_transport.c linux-3.1.3/net/
  }
  
  static void sq_comp_handler(struct ib_cq *cq, void *cq_context)
-@@ -1273,7 +1273,7 @@ int svc_rdma_send(struct svcxprt_rdma *x
+@@ -1273,7 +1273,7 @@ int svc_rdma_send(struct svcxprt_rdma *xprt, struct ib_send_wr *wr)
                spin_lock_bh(&xprt->sc_lock);
                if (xprt->sc_sq_depth < atomic_read(&xprt->sc_sq_count) + wr_count) {
                        spin_unlock_bh(&xprt->sc_lock);
@@ -75171,10 +77954,11 @@ diff -urNp linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_transport.c linux-3.1.3/net/
  
                        /* See if we can opportunistically reap SQ WR to make room */
                        sq_cq_reap(xprt);
-diff -urNp linux-3.1.3/net/sysctl_net.c linux-3.1.3/net/sysctl_net.c
---- linux-3.1.3/net/sysctl_net.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/sysctl_net.c       2011-11-16 18:40:44.000000000 -0500
-@@ -46,7 +46,7 @@ static int net_ctl_permissions(struct ct
+diff --git a/net/sysctl_net.c b/net/sysctl_net.c
+index ca84212..3aa338f 100644
+--- a/net/sysctl_net.c
++++ b/net/sysctl_net.c
+@@ -46,7 +46,7 @@ static int net_ctl_permissions(struct ctl_table_root *root,
                               struct ctl_table *table)
  {
        /* Allow network administrator to have same access as root. */
@@ -75183,10 +77967,11 @@ diff -urNp linux-3.1.3/net/sysctl_net.c linux-3.1.3/net/sysctl_net.c
                int mode = (table->mode >> 6) & 7;
                return (mode << 6) | (mode << 3) | mode;
        }
-diff -urNp linux-3.1.3/net/tipc/link.c linux-3.1.3/net/tipc/link.c
---- linux-3.1.3/net/tipc/link.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/tipc/link.c        2011-11-16 18:39:08.000000000 -0500
-@@ -1170,7 +1170,7 @@ static int link_send_sections_long(struc
+diff --git a/net/tipc/link.c b/net/tipc/link.c
+index f89570c..016cf63 100644
+--- a/net/tipc/link.c
++++ b/net/tipc/link.c
+@@ -1170,7 +1170,7 @@ static int link_send_sections_long(struct tipc_port *sender,
        struct tipc_msg fragm_hdr;
        struct sk_buff *buf, *buf_chain, *prev;
        u32 fragm_crs, fragm_rest, hsz, sect_rest;
@@ -75213,10 +77998,11 @@ diff -urNp linux-3.1.3/net/tipc/link.c linux-3.1.3/net/tipc/link.c
                sect_crs += sz;
                sect_rest -= sz;
                fragm_crs += sz;
-diff -urNp linux-3.1.3/net/tipc/msg.c linux-3.1.3/net/tipc/msg.c
---- linux-3.1.3/net/tipc/msg.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/tipc/msg.c 2011-11-16 18:39:08.000000000 -0500
-@@ -99,7 +99,7 @@ int tipc_msg_build(struct tipc_msg *hdr,
+diff --git a/net/tipc/msg.c b/net/tipc/msg.c
+index 83d5096..dcba497 100644
+--- a/net/tipc/msg.c
++++ b/net/tipc/msg.c
+@@ -99,7 +99,7 @@ int tipc_msg_build(struct tipc_msg *hdr, struct iovec const *msg_sect,
                                              msg_sect[cnt].iov_len);
                else
                        skb_copy_to_linear_data_offset(*buf, pos,
@@ -75225,10 +78011,11 @@ diff -urNp linux-3.1.3/net/tipc/msg.c linux-3.1.3/net/tipc/msg.c
                                                       msg_sect[cnt].iov_len);
                pos += msg_sect[cnt].iov_len;
        }
-diff -urNp linux-3.1.3/net/tipc/subscr.c linux-3.1.3/net/tipc/subscr.c
---- linux-3.1.3/net/tipc/subscr.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/tipc/subscr.c      2011-11-16 18:39:08.000000000 -0500
-@@ -101,7 +101,7 @@ static void subscr_send_event(struct sub
+diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c
+index 6cf7268..7a488ce 100644
+--- a/net/tipc/subscr.c
++++ b/net/tipc/subscr.c
+@@ -101,7 +101,7 @@ static void subscr_send_event(struct subscription *sub,
  {
        struct iovec msg_sect;
  
@@ -75237,10 +78024,11 @@ diff -urNp linux-3.1.3/net/tipc/subscr.c linux-3.1.3/net/tipc/subscr.c
        msg_sect.iov_len = sizeof(struct tipc_event);
  
        sub->evt.event = htohl(event, sub->swap);
-diff -urNp linux-3.1.3/net/unix/af_unix.c linux-3.1.3/net/unix/af_unix.c
---- linux-3.1.3/net/unix/af_unix.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/unix/af_unix.c     2011-11-16 19:17:17.000000000 -0500
-@@ -767,6 +767,12 @@ static struct sock *unix_find_other(stru
+diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
+index ec68e1c..fdd792f 100644
+--- a/net/unix/af_unix.c
++++ b/net/unix/af_unix.c
+@@ -767,6 +767,12 @@ static struct sock *unix_find_other(struct net *net,
                err = -ECONNREFUSED;
                if (!S_ISSOCK(inode->i_mode))
                        goto put_fail;
@@ -75253,7 +78041,7 @@ diff -urNp linux-3.1.3/net/unix/af_unix.c linux-3.1.3/net/unix/af_unix.c
                u = unix_find_socket_byinode(inode);
                if (!u)
                        goto put_fail;
-@@ -787,6 +793,13 @@ static struct sock *unix_find_other(stru
+@@ -787,6 +793,13 @@ static struct sock *unix_find_other(struct net *net,
                if (u) {
                        struct dentry *dentry;
                        dentry = unix_sk(u)->dentry;
@@ -75267,7 +78055,7 @@ diff -urNp linux-3.1.3/net/unix/af_unix.c linux-3.1.3/net/unix/af_unix.c
                        if (dentry)
                                touch_atime(unix_sk(u)->mnt, dentry);
                } else
-@@ -869,11 +882,18 @@ static int unix_bind(struct socket *sock
+@@ -869,11 +882,18 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
                err = security_path_mknod(&path, dentry, mode, 0);
                if (err)
                        goto out_mknod_drop_write;
@@ -75286,9 +78074,10 @@ diff -urNp linux-3.1.3/net/unix/af_unix.c linux-3.1.3/net/unix/af_unix.c
                mutex_unlock(&path.dentry->d_inode->i_mutex);
                dput(path.dentry);
                path.dentry = dentry;
-diff -urNp linux-3.1.3/net/wireless/core.h linux-3.1.3/net/wireless/core.h
---- linux-3.1.3/net/wireless/core.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/wireless/core.h    2011-11-16 18:39:08.000000000 -0500
+diff --git a/net/wireless/core.h b/net/wireless/core.h
+index 8672e02..48782dd 100644
+--- a/net/wireless/core.h
++++ b/net/wireless/core.h
 @@ -27,7 +27,7 @@ struct cfg80211_registered_device {
        struct mutex mtx;
  
@@ -75298,10 +78087,11 @@ diff -urNp linux-3.1.3/net/wireless/core.h linux-3.1.3/net/wireless/core.h
        struct rfkill *rfkill;
        struct work_struct rfkill_sync;
  
-diff -urNp linux-3.1.3/net/wireless/wext-core.c linux-3.1.3/net/wireless/wext-core.c
---- linux-3.1.3/net/wireless/wext-core.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/wireless/wext-core.c       2011-11-16 18:39:08.000000000 -0500
-@@ -746,8 +746,7 @@ static int ioctl_standard_iw_point(struc
+diff --git a/net/wireless/wext-core.c b/net/wireless/wext-core.c
+index fdbc23c..212d53e 100644
+--- a/net/wireless/wext-core.c
++++ b/net/wireless/wext-core.c
+@@ -746,8 +746,7 @@ static int ioctl_standard_iw_point(struct iw_point *iwp, unsigned int cmd,
                 */
  
                /* Support for very large requests */
@@ -75311,7 +78101,7 @@ diff -urNp linux-3.1.3/net/wireless/wext-core.c linux-3.1.3/net/wireless/wext-co
                        /* Allow userspace to GET more than max so
                         * we can support any size GET requests.
                         * There is still a limit : -ENOMEM.
-@@ -784,22 +783,6 @@ static int ioctl_standard_iw_point(struc
+@@ -784,22 +783,6 @@ static int ioctl_standard_iw_point(struct iw_point *iwp, unsigned int cmd,
                }
        }
  
@@ -75334,10 +78124,11 @@ diff -urNp linux-3.1.3/net/wireless/wext-core.c linux-3.1.3/net/wireless/wext-co
        err = handler(dev, info, (union iwreq_data *) iwp, extra);
  
        iwp->length += essid_compat;
-diff -urNp linux-3.1.3/net/xfrm/xfrm_policy.c linux-3.1.3/net/xfrm/xfrm_policy.c
---- linux-3.1.3/net/xfrm/xfrm_policy.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/xfrm/xfrm_policy.c 2011-11-16 18:39:08.000000000 -0500
-@@ -299,7 +299,7 @@ static void xfrm_policy_kill(struct xfrm
+diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
+index 552df27..8e7f238 100644
+--- a/net/xfrm/xfrm_policy.c
++++ b/net/xfrm/xfrm_policy.c
+@@ -299,7 +299,7 @@ static void xfrm_policy_kill(struct xfrm_policy *policy)
  {
        policy->walk.dead = 1;
  
@@ -75346,7 +78137,7 @@ diff -urNp linux-3.1.3/net/xfrm/xfrm_policy.c linux-3.1.3/net/xfrm/xfrm_policy.c
  
        if (del_timer(&policy->timer))
                xfrm_pol_put(policy);
-@@ -583,7 +583,7 @@ int xfrm_policy_insert(int dir, struct x
+@@ -583,7 +583,7 @@ int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl)
                hlist_add_head(&policy->bydst, chain);
        xfrm_pol_hold(policy);
        net->xfrm.policy_count[dir]++;
@@ -75364,7 +78155,7 @@ diff -urNp linux-3.1.3/net/xfrm/xfrm_policy.c linux-3.1.3/net/xfrm/xfrm_policy.c
  xfrm_dst_alloc_copy(void **target, const void *src, int size)
  {
        if (!*target) {
-@@ -1542,7 +1542,7 @@ xfrm_dst_alloc_copy(void **target, const
+@@ -1542,7 +1542,7 @@ xfrm_dst_alloc_copy(void **target, const void *src, int size)
        return 0;
  }
  
@@ -75373,7 +78164,7 @@ diff -urNp linux-3.1.3/net/xfrm/xfrm_policy.c linux-3.1.3/net/xfrm/xfrm_policy.c
  xfrm_dst_update_parent(struct dst_entry *dst, const struct xfrm_selector *sel)
  {
  #ifdef CONFIG_XFRM_SUB_POLICY
-@@ -1554,7 +1554,7 @@ xfrm_dst_update_parent(struct dst_entry 
+@@ -1554,7 +1554,7 @@ xfrm_dst_update_parent(struct dst_entry *dst, const struct xfrm_selector *sel)
  #endif
  }
  
@@ -75382,7 +78173,7 @@ diff -urNp linux-3.1.3/net/xfrm/xfrm_policy.c linux-3.1.3/net/xfrm/xfrm_policy.c
  xfrm_dst_update_origin(struct dst_entry *dst, const struct flowi *fl)
  {
  #ifdef CONFIG_XFRM_SUB_POLICY
-@@ -1648,7 +1648,7 @@ xfrm_resolve_and_create_bundle(struct xf
+@@ -1648,7 +1648,7 @@ xfrm_resolve_and_create_bundle(struct xfrm_policy **pols, int num_pols,
  
        xdst->num_pols = num_pols;
        memcpy(xdst->pols, pols, sizeof(struct xfrm_policy*) * num_pols);
@@ -75391,7 +78182,7 @@ diff -urNp linux-3.1.3/net/xfrm/xfrm_policy.c linux-3.1.3/net/xfrm/xfrm_policy.c
  
        return xdst;
  }
-@@ -2335,7 +2335,7 @@ static int xfrm_bundle_ok(struct xfrm_ds
+@@ -2335,7 +2335,7 @@ static int xfrm_bundle_ok(struct xfrm_dst *first)
                if (xdst->xfrm_genid != dst->xfrm->genid)
                        return 0;
                if (xdst->num_pols > 0 &&
@@ -75400,7 +78191,7 @@ diff -urNp linux-3.1.3/net/xfrm/xfrm_policy.c linux-3.1.3/net/xfrm/xfrm_policy.c
                        return 0;
  
                mtu = dst_mtu(dst->child);
-@@ -2870,7 +2870,7 @@ static int xfrm_policy_migrate(struct xf
+@@ -2870,7 +2870,7 @@ static int xfrm_policy_migrate(struct xfrm_policy *pol,
                               sizeof(pol->xfrm_vec[i].saddr));
                        pol->xfrm_vec[i].encap_family = mp->new_family;
                        /* flush bundles */
@@ -75409,10 +78200,11 @@ diff -urNp linux-3.1.3/net/xfrm/xfrm_policy.c linux-3.1.3/net/xfrm/xfrm_policy.c
                }
        }
  
-diff -urNp linux-3.1.3/net/xfrm/xfrm_user.c linux-3.1.3/net/xfrm/xfrm_user.c
---- linux-3.1.3/net/xfrm/xfrm_user.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/net/xfrm/xfrm_user.c   2011-11-16 18:40:44.000000000 -0500
-@@ -1394,6 +1394,8 @@ static int copy_to_user_tmpl(struct xfrm
+diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
+index 0256b8a..9341ef6 100644
+--- a/net/xfrm/xfrm_user.c
++++ b/net/xfrm/xfrm_user.c
+@@ -1394,6 +1394,8 @@ static int copy_to_user_tmpl(struct xfrm_policy *xp, struct sk_buff *skb)
        struct xfrm_user_tmpl vec[XFRM_MAX_DEPTH];
        int i;
  
@@ -75421,7 +78213,7 @@ diff -urNp linux-3.1.3/net/xfrm/xfrm_user.c linux-3.1.3/net/xfrm/xfrm_user.c
        if (xp->xfrm_nr == 0)
                return 0;
  
-@@ -2062,6 +2064,8 @@ static int xfrm_do_migrate(struct sk_buf
+@@ -2062,6 +2064,8 @@ static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh,
        int err;
        int n = 0;
  
@@ -75430,10 +78222,58 @@ diff -urNp linux-3.1.3/net/xfrm/xfrm_user.c linux-3.1.3/net/xfrm/xfrm_user.c
        if (attrs[XFRMA_MIGRATE] == NULL)
                return -EINVAL;
  
-diff -urNp linux-3.1.3/scripts/basic/fixdep.c linux-3.1.3/scripts/basic/fixdep.c
---- linux-3.1.3/scripts/basic/fixdep.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/scripts/basic/fixdep.c 2011-11-16 18:39:08.000000000 -0500
-@@ -161,7 +161,7 @@ static unsigned int strhash(const char *
+diff --git a/scripts/Makefile.build b/scripts/Makefile.build
+index a0fd502..a8e6e83 100644
+--- a/scripts/Makefile.build
++++ b/scripts/Makefile.build
+@@ -109,7 +109,7 @@ endif
+ endif
+ # Do not include host rules unless needed
+-ifneq ($(hostprogs-y)$(hostprogs-m),)
++ifneq ($(hostprogs-y)$(hostprogs-m)$(hostlibs-y)$(hostlibs-m),)
+ include scripts/Makefile.host
+ endif
+diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean
+index 686cb0d..9d653bf 100644
+--- a/scripts/Makefile.clean
++++ b/scripts/Makefile.clean
+@@ -43,7 +43,8 @@ subdir-ymn   := $(addprefix $(obj)/,$(subdir-ymn))
+ __clean-files := $(extra-y) $(always)                  \
+                  $(targets) $(clean-files)             \
+                  $(host-progs)                         \
+-                 $(hostprogs-y) $(hostprogs-m) $(hostprogs-)
++                 $(hostprogs-y) $(hostprogs-m) $(hostprogs-) \
++                 $(hostlibs-y) $(hostlibs-m) $(hostlibs-)
+ __clean-files   := $(filter-out $(no-clean-files), $(__clean-files))
+diff --git a/scripts/Makefile.host b/scripts/Makefile.host
+index 1ac414f..a1c1451 100644
+--- a/scripts/Makefile.host
++++ b/scripts/Makefile.host
+@@ -31,6 +31,7 @@
+ # Note: Shared libraries consisting of C++ files are not supported
+ __hostprogs := $(sort $(hostprogs-y) $(hostprogs-m))
++__hostlibs := $(sort $(hostlibs-y) $(hostlibs-m))
+ # C code
+ # Executables compiled from a single .c file
+@@ -54,6 +55,7 @@ host-cxxobjs := $(sort $(foreach m,$(host-cxxmulti),$($(m)-cxxobjs)))
+ # Shared libaries (only .c supported)
+ # Shared libraries (.so) - all .so files referenced in "xxx-objs"
+ host-cshlib   := $(sort $(filter %.so, $(host-cobjs)))
++host-cshlib   += $(sort $(filter %.so, $(__hostlibs)))
+ # Remove .so files from "xxx-objs"
+ host-cobjs    := $(filter-out %.so,$(host-cobjs))
+diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
+index 291228e..6c55203 100644
+--- a/scripts/basic/fixdep.c
++++ b/scripts/basic/fixdep.c
+@@ -161,7 +161,7 @@ static unsigned int strhash(const char *str, unsigned int sz)
  /*
   * Lookup a value in the configuration string.
   */
@@ -75455,7 +78295,7 @@ diff -urNp linux-3.1.3/scripts/basic/fixdep.c linux-3.1.3/scripts/basic/fixdep.c
  
        if (is_defined_config(m, slen, hash))
            return;
-@@ -235,9 +235,9 @@ static void use_config(const char *m, in
+@@ -235,9 +235,9 @@ static void use_config(const char *m, int slen)
  
  static void parse_config_file(const char *map, size_t len)
  {
@@ -75476,60 +78316,19 @@ diff -urNp linux-3.1.3/scripts/basic/fixdep.c linux-3.1.3/scripts/basic/fixdep.c
  
        if (*p != INT_CONF) {
                fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianess? %#x\n",
-diff -urNp linux-3.1.3/scripts/gcc-plugin.sh linux-3.1.3/scripts/gcc-plugin.sh
---- linux-3.1.3/scripts/gcc-plugin.sh  1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/scripts/gcc-plugin.sh  2011-11-20 19:21:53.000000000 -0500
+diff --git a/scripts/gcc-plugin.sh b/scripts/gcc-plugin.sh
+new file mode 100644
+index 0000000..8729101
+--- /dev/null
++++ b/scripts/gcc-plugin.sh
 @@ -0,0 +1,2 @@
 +#!/bin/sh
 +echo -e "#include \"gcc-plugin.h\"\n#include \"tree.h\"\n#include \"tm.h\"\n#include \"rtl.h\"" | $1 -x c -shared - -o /dev/null -I`$2 -print-file-name=plugin`/include >/dev/null 2>&1 && echo "y"
-diff -urNp linux-3.1.3/scripts/Makefile.build linux-3.1.3/scripts/Makefile.build
---- linux-3.1.3/scripts/Makefile.build 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/scripts/Makefile.build 2011-11-16 18:40:44.000000000 -0500
-@@ -109,7 +109,7 @@ endif
- endif
- # Do not include host rules unless needed
--ifneq ($(hostprogs-y)$(hostprogs-m),)
-+ifneq ($(hostprogs-y)$(hostprogs-m)$(hostlibs-y)$(hostlibs-m),)
- include scripts/Makefile.host
- endif
-diff -urNp linux-3.1.3/scripts/Makefile.clean linux-3.1.3/scripts/Makefile.clean
---- linux-3.1.3/scripts/Makefile.clean 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/scripts/Makefile.clean 2011-11-16 18:39:08.000000000 -0500
-@@ -43,7 +43,8 @@ subdir-ymn   := $(addprefix $(obj)/,$(subd
- __clean-files := $(extra-y) $(always)                  \
-                  $(targets) $(clean-files)             \
-                  $(host-progs)                         \
--                 $(hostprogs-y) $(hostprogs-m) $(hostprogs-)
-+                 $(hostprogs-y) $(hostprogs-m) $(hostprogs-) \
-+                 $(hostlibs-y) $(hostlibs-m) $(hostlibs-)
- __clean-files   := $(filter-out $(no-clean-files), $(__clean-files))
-diff -urNp linux-3.1.3/scripts/Makefile.host linux-3.1.3/scripts/Makefile.host
---- linux-3.1.3/scripts/Makefile.host  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/scripts/Makefile.host  2011-11-16 18:39:08.000000000 -0500
-@@ -31,6 +31,7 @@
- # Note: Shared libraries consisting of C++ files are not supported
- __hostprogs := $(sort $(hostprogs-y) $(hostprogs-m))
-+__hostlibs := $(sort $(hostlibs-y) $(hostlibs-m))
- # C code
- # Executables compiled from a single .c file
-@@ -54,6 +55,7 @@ host-cxxobjs := $(sort $(foreach m,$(hos
- # Shared libaries (only .c supported)
- # Shared libraries (.so) - all .so files referenced in "xxx-objs"
- host-cshlib   := $(sort $(filter %.so, $(host-cobjs)))
-+host-cshlib   += $(sort $(filter %.so, $(__hostlibs)))
- # Remove .so files from "xxx-objs"
- host-cobjs    := $(filter-out %.so,$(host-cobjs))
-diff -urNp linux-3.1.3/scripts/mod/file2alias.c linux-3.1.3/scripts/mod/file2alias.c
---- linux-3.1.3/scripts/mod/file2alias.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/scripts/mod/file2alias.c       2011-11-16 18:39:08.000000000 -0500
-@@ -72,7 +72,7 @@ static void device_id_check(const char *
+diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
+index e26e2fb..f84937b 100644
+--- a/scripts/mod/file2alias.c
++++ b/scripts/mod/file2alias.c
+@@ -72,7 +72,7 @@ static void device_id_check(const char *modname, const char *device_id,
                            unsigned long size, unsigned long id_size,
                            void *symval)
  {
@@ -75538,7 +78337,7 @@ diff -urNp linux-3.1.3/scripts/mod/file2alias.c linux-3.1.3/scripts/mod/file2ali
  
        if (size % id_size || size < id_size) {
                if (cross_build != 0)
-@@ -102,7 +102,7 @@ static void device_id_check(const char *
+@@ -102,7 +102,7 @@ static void device_id_check(const char *modname, const char *device_id,
  /* USB is special because the bcdDevice can be matched against a numeric range */
  /* Looks like "usb:vNpNdNdcNdscNdpNicNiscNipN" */
  static void do_usb_entry(struct usb_device_id *id,
@@ -75547,7 +78346,7 @@ diff -urNp linux-3.1.3/scripts/mod/file2alias.c linux-3.1.3/scripts/mod/file2ali
                         unsigned char range_lo, unsigned char range_hi,
                         unsigned char max, struct module *mod)
  {
-@@ -203,7 +203,7 @@ static void do_usb_entry_multi(struct us
+@@ -203,7 +203,7 @@ static void do_usb_entry_multi(struct usb_device_id *id, struct module *mod)
  {
        unsigned int devlo, devhi;
        unsigned char chi, clo, max;
@@ -75556,7 +78355,7 @@ diff -urNp linux-3.1.3/scripts/mod/file2alias.c linux-3.1.3/scripts/mod/file2ali
  
        id->match_flags = TO_NATIVE(id->match_flags);
        id->idVendor = TO_NATIVE(id->idVendor);
-@@ -437,7 +437,7 @@ static void do_pnp_device_entry(void *sy
+@@ -437,7 +437,7 @@ static void do_pnp_device_entry(void *symval, unsigned long size,
        for (i = 0; i < count; i++) {
                const char *id = (char *)devs[i].id;
                char acpi_id[sizeof(devs[0].id)];
@@ -75565,7 +78364,7 @@ diff -urNp linux-3.1.3/scripts/mod/file2alias.c linux-3.1.3/scripts/mod/file2ali
  
                buf_printf(&mod->dev_table_buf,
                           "MODULE_ALIAS(\"pnp:d%s*\");\n", id);
-@@ -467,7 +467,7 @@ static void do_pnp_card_entries(void *sy
+@@ -467,7 +467,7 @@ static void do_pnp_card_entries(void *symval, unsigned long size,
  
                for (j = 0; j < PNP_MAX_DEVICES; j++) {
                        const char *id = (char *)card->devs[j].id;
@@ -75574,7 +78373,7 @@ diff -urNp linux-3.1.3/scripts/mod/file2alias.c linux-3.1.3/scripts/mod/file2ali
                        int dup = 0;
  
                        if (!id[0])
-@@ -493,7 +493,7 @@ static void do_pnp_card_entries(void *sy
+@@ -493,7 +493,7 @@ static void do_pnp_card_entries(void *symval, unsigned long size,
                        /* add an individual alias for every device entry */
                        if (!dup) {
                                char acpi_id[sizeof(card->devs[0].id)];
@@ -75583,7 +78382,7 @@ diff -urNp linux-3.1.3/scripts/mod/file2alias.c linux-3.1.3/scripts/mod/file2ali
  
                                buf_printf(&mod->dev_table_buf,
                                           "MODULE_ALIAS(\"pnp:d%s*\");\n", id);
-@@ -786,7 +786,7 @@ static void dmi_ascii_filter(char *d, co
+@@ -786,7 +786,7 @@ static void dmi_ascii_filter(char *d, const char *s)
  static int do_dmi_entry(const char *filename, struct dmi_system_id *id,
                        char *alias)
  {
@@ -75592,9 +78391,10 @@ diff -urNp linux-3.1.3/scripts/mod/file2alias.c linux-3.1.3/scripts/mod/file2ali
  
        sprintf(alias, "dmi*");
  
-diff -urNp linux-3.1.3/scripts/mod/modpost.c linux-3.1.3/scripts/mod/modpost.c
---- linux-3.1.3/scripts/mod/modpost.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/scripts/mod/modpost.c  2011-11-16 18:39:08.000000000 -0500
+diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
+index a509ff8..5822633 100644
+--- a/scripts/mod/modpost.c
++++ b/scripts/mod/modpost.c
 @@ -919,6 +919,7 @@ enum mismatch {
        ANY_INIT_TO_ANY_EXIT,
        ANY_EXIT_TO_ANY_INIT,
@@ -75603,7 +78403,7 @@ diff -urNp linux-3.1.3/scripts/mod/modpost.c linux-3.1.3/scripts/mod/modpost.c
  };
  
  struct sectioncheck {
-@@ -1027,6 +1028,12 @@ const struct sectioncheck sectioncheck[]
+@@ -1027,6 +1028,12 @@ const struct sectioncheck sectioncheck[] = {
        .tosec   = { INIT_SECTIONS, EXIT_SECTIONS, NULL },
        .mismatch = EXPORT_TO_INIT_EXIT,
        .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },
@@ -75616,7 +78416,7 @@ diff -urNp linux-3.1.3/scripts/mod/modpost.c linux-3.1.3/scripts/mod/modpost.c
  }
  };
  
-@@ -1149,10 +1156,10 @@ static Elf_Sym *find_elf_symbol(struct e
+@@ -1149,10 +1156,10 @@ static Elf_Sym *find_elf_symbol(struct elf_info *elf, Elf64_Sword addr,
                        continue;
                if (ELF_ST_TYPE(sym->st_info) == STT_SECTION)
                        continue;
@@ -75629,7 +78429,7 @@ diff -urNp linux-3.1.3/scripts/mod/modpost.c linux-3.1.3/scripts/mod/modpost.c
                if (d < 0)
                        d = addr - sym->st_value;
                if (d < distance) {
-@@ -1431,6 +1438,14 @@ static void report_sec_mismatch(const ch
+@@ -1431,6 +1438,14 @@ static void report_sec_mismatch(const char *modname,
                tosym, prl_to, prl_to, tosym);
                free(prl_to);
                break;
@@ -75644,7 +78444,7 @@ diff -urNp linux-3.1.3/scripts/mod/modpost.c linux-3.1.3/scripts/mod/modpost.c
        }
        fprintf(stderr, "\n");
  }
-@@ -1656,7 +1671,7 @@ static void section_rel(const char *modn
+@@ -1656,7 +1671,7 @@ static void section_rel(const char *modname, struct elf_info *elf,
  static void check_sec_ref(struct module *mod, const char *modname,
                            struct elf_info *elf)
  {
@@ -75653,7 +78453,7 @@ diff -urNp linux-3.1.3/scripts/mod/modpost.c linux-3.1.3/scripts/mod/modpost.c
        Elf_Shdr *sechdrs = elf->sechdrs;
  
        /* Walk through all sections */
-@@ -1754,7 +1769,7 @@ void __attribute__((format(printf, 2, 3)
+@@ -1754,7 +1769,7 @@ void __attribute__((format(printf, 2, 3))) buf_printf(struct buffer *buf,
        va_end(ap);
  }
  
@@ -75662,7 +78462,7 @@ diff -urNp linux-3.1.3/scripts/mod/modpost.c linux-3.1.3/scripts/mod/modpost.c
  {
        if (buf->size - buf->pos < len) {
                buf->size += len + SZ;
-@@ -1966,7 +1981,7 @@ static void write_if_changed(struct buff
+@@ -1966,7 +1981,7 @@ static void write_if_changed(struct buffer *b, const char *fname)
        if (fstat(fileno(file), &st) < 0)
                goto close_write;
  
@@ -75671,10 +78471,11 @@ diff -urNp linux-3.1.3/scripts/mod/modpost.c linux-3.1.3/scripts/mod/modpost.c
                goto close_write;
  
        tmp = NOFAIL(malloc(b->pos));
-diff -urNp linux-3.1.3/scripts/mod/modpost.h linux-3.1.3/scripts/mod/modpost.h
---- linux-3.1.3/scripts/mod/modpost.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/scripts/mod/modpost.h  2011-11-16 18:39:08.000000000 -0500
-@@ -92,15 +92,15 @@ void *do_nofail(void *ptr, const char *e
+diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h
+index 2031119..b5433af 100644
+--- a/scripts/mod/modpost.h
++++ b/scripts/mod/modpost.h
+@@ -92,15 +92,15 @@ void *do_nofail(void *ptr, const char *expr);
  
  struct buffer {
        char *p;
@@ -75693,10 +78494,11 @@ diff -urNp linux-3.1.3/scripts/mod/modpost.h linux-3.1.3/scripts/mod/modpost.h
  
  struct module {
        struct module *next;
-diff -urNp linux-3.1.3/scripts/mod/sumversion.c linux-3.1.3/scripts/mod/sumversion.c
---- linux-3.1.3/scripts/mod/sumversion.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/scripts/mod/sumversion.c       2011-11-16 18:39:08.000000000 -0500
-@@ -470,7 +470,7 @@ static void write_version(const char *fi
+diff --git a/scripts/mod/sumversion.c b/scripts/mod/sumversion.c
+index 9dfcd6d..099068e 100644
+--- a/scripts/mod/sumversion.c
++++ b/scripts/mod/sumversion.c
+@@ -470,7 +470,7 @@ static void write_version(const char *filename, const char *sum,
                goto out;
        }
  
@@ -75705,9 +78507,10 @@ diff -urNp linux-3.1.3/scripts/mod/sumversion.c linux-3.1.3/scripts/mod/sumversi
                warn("writing sum in %s failed: %s\n",
                        filename, strerror(errno));
                goto out;
-diff -urNp linux-3.1.3/scripts/pnmtologo.c linux-3.1.3/scripts/pnmtologo.c
---- linux-3.1.3/scripts/pnmtologo.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/scripts/pnmtologo.c    2011-11-16 18:39:08.000000000 -0500
+diff --git a/scripts/pnmtologo.c b/scripts/pnmtologo.c
+index 5c11312..72742b5 100644
+--- a/scripts/pnmtologo.c
++++ b/scripts/pnmtologo.c
 @@ -237,14 +237,14 @@ static void write_header(void)
      fprintf(out, " *  Linux logo %s\n", logoname);
      fputs(" */\n\n", out);
@@ -75734,108 +78537,11 @@ diff -urNp linux-3.1.3/scripts/pnmtologo.c linux-3.1.3/scripts/pnmtologo.c
            logoname);
      write_hex_cnt = 0;
      for (i = 0; i < logo_clutsize; i++) {
-diff -urNp linux-3.1.3/security/apparmor/lsm.c linux-3.1.3/security/apparmor/lsm.c
---- linux-3.1.3/security/apparmor/lsm.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/security/apparmor/lsm.c        2011-11-16 18:40:44.000000000 -0500
-@@ -621,7 +621,7 @@ static int apparmor_task_setrlimit(struc
-       return error;
- }
--static struct security_operations apparmor_ops = {
-+static struct security_operations apparmor_ops __read_only = {
-       .name =                         "apparmor",
-       .ptrace_access_check =          apparmor_ptrace_access_check,
-diff -urNp linux-3.1.3/security/commoncap.c linux-3.1.3/security/commoncap.c
---- linux-3.1.3/security/commoncap.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/security/commoncap.c   2011-11-16 18:40:44.000000000 -0500
-@@ -28,6 +28,7 @@
- #include <linux/prctl.h>
- #include <linux/securebits.h>
- #include <linux/user_namespace.h>
-+#include <net/sock.h>
- /*
-  * If a non-root user executes a setuid-root binary in
-@@ -58,7 +59,7 @@ int cap_netlink_send(struct sock *sk, st
- int cap_netlink_recv(struct sk_buff *skb, int cap)
- {
--      if (!cap_raised(current_cap(), cap))
-+      if (!cap_raised(current_cap(), cap) || !gr_is_capable(cap))
-               return -EPERM;
-       return 0;
- }
-@@ -575,6 +576,9 @@ int cap_bprm_secureexec(struct linux_bin
- {
-       const struct cred *cred = current_cred();
-+      if (gr_acl_enable_at_secure())
-+              return 1;
-+
-       if (cred->uid != 0) {
-               if (bprm->cap_effective)
-                       return 1;
-diff -urNp linux-3.1.3/security/integrity/ima/ima_api.c linux-3.1.3/security/integrity/ima/ima_api.c
---- linux-3.1.3/security/integrity/ima/ima_api.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/security/integrity/ima/ima_api.c       2011-11-16 18:39:08.000000000 -0500
-@@ -75,7 +75,7 @@ void ima_add_violation(struct inode *ino
-       int result;
-       /* can overflow, only indicator */
--      atomic_long_inc(&ima_htable.violations);
-+      atomic_long_inc_unchecked(&ima_htable.violations);
-       entry = kmalloc(sizeof(*entry), GFP_KERNEL);
-       if (!entry) {
-diff -urNp linux-3.1.3/security/integrity/ima/ima_fs.c linux-3.1.3/security/integrity/ima/ima_fs.c
---- linux-3.1.3/security/integrity/ima/ima_fs.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/security/integrity/ima/ima_fs.c        2011-11-16 18:39:08.000000000 -0500
-@@ -28,12 +28,12 @@
- static int valid_policy = 1;
- #define TMPBUFLEN 12
- static ssize_t ima_show_htable_value(char __user *buf, size_t count,
--                                   loff_t *ppos, atomic_long_t *val)
-+                                   loff_t *ppos, atomic_long_unchecked_t *val)
- {
-       char tmpbuf[TMPBUFLEN];
-       ssize_t len;
--      len = scnprintf(tmpbuf, TMPBUFLEN, "%li\n", atomic_long_read(val));
-+      len = scnprintf(tmpbuf, TMPBUFLEN, "%li\n", atomic_long_read_unchecked(val));
-       return simple_read_from_buffer(buf, count, ppos, tmpbuf, len);
- }
-diff -urNp linux-3.1.3/security/integrity/ima/ima.h linux-3.1.3/security/integrity/ima/ima.h
---- linux-3.1.3/security/integrity/ima/ima.h   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/security/integrity/ima/ima.h   2011-11-16 18:39:08.000000000 -0500
-@@ -85,8 +85,8 @@ void ima_add_violation(struct inode *ino
- extern spinlock_t ima_queue_lock;
- struct ima_h_table {
--      atomic_long_t len;      /* number of stored measurements in the list */
--      atomic_long_t violations;
-+      atomic_long_unchecked_t len;    /* number of stored measurements in the list */
-+      atomic_long_unchecked_t violations;
-       struct hlist_head queue[IMA_MEASURE_HTABLE_SIZE];
- };
- extern struct ima_h_table ima_htable;
-diff -urNp linux-3.1.3/security/integrity/ima/ima_queue.c linux-3.1.3/security/integrity/ima/ima_queue.c
---- linux-3.1.3/security/integrity/ima/ima_queue.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/security/integrity/ima/ima_queue.c     2011-11-16 18:39:08.000000000 -0500
-@@ -79,7 +79,7 @@ static int ima_add_digest_entry(struct i
-       INIT_LIST_HEAD(&qe->later);
-       list_add_tail_rcu(&qe->later, &ima_measurements);
--      atomic_long_inc(&ima_htable.len);
-+      atomic_long_inc_unchecked(&ima_htable.len);
-       key = ima_hash_key(entry->digest);
-       hlist_add_head_rcu(&qe->hnext, &ima_htable.queue[key]);
-       return 0;
-diff -urNp linux-3.1.3/security/Kconfig linux-3.1.3/security/Kconfig
---- linux-3.1.3/security/Kconfig       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/security/Kconfig       2011-11-16 18:40:44.000000000 -0500
-@@ -4,6 +4,558 @@
+diff --git a/security/Kconfig b/security/Kconfig
+index e0f08b5..7388edd 100644
+--- a/security/Kconfig
++++ b/security/Kconfig
+@@ -4,6 +4,586 @@
  
  menu "Security options"
  
@@ -76168,6 +78874,34 @@ diff -urNp linux-3.1.3/security/Kconfig linux-3.1.3/security/Kconfig
 +        Note that on x86_64 kernels there is a known regression when
 +        this feature and KVM/VMX are both enabled in the host kernel.
 +
++choice
++      prompt "Return Address Instrumentation Method"
++      default PAX_KERNEXEC_PLUGIN_METHOD_BTS
++      depends on PAX_KERNEXEC_PLUGIN
++      help
++        Select the method used to instrument function pointer dereferences.
++        Note that binary modules cannot be instrumented by this approach.
++
++      config PAX_KERNEXEC_PLUGIN_METHOD_BTS
++              bool "bts"
++              help
++                This method is compatible with binary only modules but has
++                a higher runtime overhead.
++
++      config PAX_KERNEXEC_PLUGIN_METHOD_OR
++              bool "or"
++              depends on !PARAVIRT
++              help
++                This method is incompatible with binary only modules but has
++                a lower runtime overhead.
++endchoice
++
++config PAX_KERNEXEC_PLUGIN_METHOD
++      string
++      default "bts" if PAX_KERNEXEC_PLUGIN_METHOD_BTS
++      default "or" if PAX_KERNEXEC_PLUGIN_METHOD_OR
++      default ""
++
 +config PAX_KERNEXEC_MODULE_TEXT
 +      int "Minimum amount of memory reserved for module code"
 +      default "4"
@@ -76394,7 +79128,7 @@ diff -urNp linux-3.1.3/security/Kconfig linux-3.1.3/security/Kconfig
  config KEYS
        bool "Enable access key retention support"
        help
-@@ -167,7 +719,7 @@ config INTEL_TXT
+@@ -167,7 +747,7 @@ config INTEL_TXT
  config LSM_MMAP_MIN_ADDR
        int "Low address space for LSM to protect from user allocation"
        depends on SECURITY && SECURITY_SELINUX
@@ -76403,9 +79137,114 @@ diff -urNp linux-3.1.3/security/Kconfig linux-3.1.3/security/Kconfig
        default 65536
        help
          This is the portion of low virtual memory which should be protected
-diff -urNp linux-3.1.3/security/keys/compat.c linux-3.1.3/security/keys/compat.c
---- linux-3.1.3/security/keys/compat.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/security/keys/compat.c 2011-11-16 18:39:08.000000000 -0500
+diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
+index 3783202..1852837 100644
+--- a/security/apparmor/lsm.c
++++ b/security/apparmor/lsm.c
+@@ -621,7 +621,7 @@ static int apparmor_task_setrlimit(struct task_struct *task,
+       return error;
+ }
+-static struct security_operations apparmor_ops = {
++static struct security_operations apparmor_ops __read_only = {
+       .name =                         "apparmor",
+       .ptrace_access_check =          apparmor_ptrace_access_check,
+diff --git a/security/commoncap.c b/security/commoncap.c
+index a93b3b7..4410df9 100644
+--- a/security/commoncap.c
++++ b/security/commoncap.c
+@@ -28,6 +28,7 @@
+ #include <linux/prctl.h>
+ #include <linux/securebits.h>
+ #include <linux/user_namespace.h>
++#include <net/sock.h>
+ /*
+  * If a non-root user executes a setuid-root binary in
+@@ -58,7 +59,7 @@ int cap_netlink_send(struct sock *sk, struct sk_buff *skb)
+ int cap_netlink_recv(struct sk_buff *skb, int cap)
+ {
+-      if (!cap_raised(current_cap(), cap))
++      if (!cap_raised(current_cap(), cap) || !gr_is_capable(cap))
+               return -EPERM;
+       return 0;
+ }
+@@ -575,6 +576,9 @@ int cap_bprm_secureexec(struct linux_binprm *bprm)
+ {
+       const struct cred *cred = current_cred();
++      if (gr_acl_enable_at_secure())
++              return 1;
++
+       if (cred->uid != 0) {
+               if (bprm->cap_effective)
+                       return 1;
+diff --git a/security/integrity/ima/ima.h b/security/integrity/ima/ima.h
+index 08408bd..67e6e78 100644
+--- a/security/integrity/ima/ima.h
++++ b/security/integrity/ima/ima.h
+@@ -85,8 +85,8 @@ void ima_add_violation(struct inode *inode, const unsigned char *filename,
+ extern spinlock_t ima_queue_lock;
+ struct ima_h_table {
+-      atomic_long_t len;      /* number of stored measurements in the list */
+-      atomic_long_t violations;
++      atomic_long_unchecked_t len;    /* number of stored measurements in the list */
++      atomic_long_unchecked_t violations;
+       struct hlist_head queue[IMA_MEASURE_HTABLE_SIZE];
+ };
+ extern struct ima_h_table ima_htable;
+diff --git a/security/integrity/ima/ima_api.c b/security/integrity/ima/ima_api.c
+index da36d2c..e1e1965 100644
+--- a/security/integrity/ima/ima_api.c
++++ b/security/integrity/ima/ima_api.c
+@@ -75,7 +75,7 @@ void ima_add_violation(struct inode *inode, const unsigned char *filename,
+       int result;
+       /* can overflow, only indicator */
+-      atomic_long_inc(&ima_htable.violations);
++      atomic_long_inc_unchecked(&ima_htable.violations);
+       entry = kmalloc(sizeof(*entry), GFP_KERNEL);
+       if (!entry) {
+diff --git a/security/integrity/ima/ima_fs.c b/security/integrity/ima/ima_fs.c
+index ef21b96..d53e674 100644
+--- a/security/integrity/ima/ima_fs.c
++++ b/security/integrity/ima/ima_fs.c
+@@ -28,12 +28,12 @@
+ static int valid_policy = 1;
+ #define TMPBUFLEN 12
+ static ssize_t ima_show_htable_value(char __user *buf, size_t count,
+-                                   loff_t *ppos, atomic_long_t *val)
++                                   loff_t *ppos, atomic_long_unchecked_t *val)
+ {
+       char tmpbuf[TMPBUFLEN];
+       ssize_t len;
+-      len = scnprintf(tmpbuf, TMPBUFLEN, "%li\n", atomic_long_read(val));
++      len = scnprintf(tmpbuf, TMPBUFLEN, "%li\n", atomic_long_read_unchecked(val));
+       return simple_read_from_buffer(buf, count, ppos, tmpbuf, len);
+ }
+diff --git a/security/integrity/ima/ima_queue.c b/security/integrity/ima/ima_queue.c
+index 8e28f04..d5951b1 100644
+--- a/security/integrity/ima/ima_queue.c
++++ b/security/integrity/ima/ima_queue.c
+@@ -79,7 +79,7 @@ static int ima_add_digest_entry(struct ima_template_entry *entry)
+       INIT_LIST_HEAD(&qe->later);
+       list_add_tail_rcu(&qe->later, &ima_measurements);
+-      atomic_long_inc(&ima_htable.len);
++      atomic_long_inc_unchecked(&ima_htable.len);
+       key = ima_hash_key(entry->digest);
+       hlist_add_head_rcu(&qe->hnext, &ima_htable.queue[key]);
+       return 0;
+diff --git a/security/keys/compat.c b/security/keys/compat.c
+index 338b510..a235861 100644
+--- a/security/keys/compat.c
++++ b/security/keys/compat.c
 @@ -44,7 +44,7 @@ long compat_keyctl_instantiate_key_iov(
        if (ret == 0)
                goto no_payload_free;
@@ -76415,10 +79254,11 @@ diff -urNp linux-3.1.3/security/keys/compat.c linux-3.1.3/security/keys/compat.c
  
        if (iov != iovstack)
                kfree(iov);
-diff -urNp linux-3.1.3/security/keys/keyctl.c linux-3.1.3/security/keys/keyctl.c
---- linux-3.1.3/security/keys/keyctl.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/security/keys/keyctl.c 2011-11-16 18:39:08.000000000 -0500
-@@ -921,7 +921,7 @@ static int keyctl_change_reqkey_auth(str
+diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c
+index eca5191..da9c7f0 100644
+--- a/security/keys/keyctl.c
++++ b/security/keys/keyctl.c
+@@ -921,7 +921,7 @@ static int keyctl_change_reqkey_auth(struct key *key)
  /*
   * Copy the iovec data from userspace
   */
@@ -76427,7 +79267,7 @@ diff -urNp linux-3.1.3/security/keys/keyctl.c linux-3.1.3/security/keys/keyctl.c
                                 unsigned ioc)
  {
        for (; ioc > 0; ioc--) {
-@@ -943,7 +943,7 @@ static long copy_from_user_iovec(void *b
+@@ -943,7 +943,7 @@ static long copy_from_user_iovec(void *buffer, const struct iovec *iov,
   * If successful, 0 will be returned.
   */
  long keyctl_instantiate_key_common(key_serial_t id,
@@ -76436,7 +79276,7 @@ diff -urNp linux-3.1.3/security/keys/keyctl.c linux-3.1.3/security/keys/keyctl.c
                                   unsigned ioc,
                                   size_t plen,
                                   key_serial_t ringid)
-@@ -1038,7 +1038,7 @@ long keyctl_instantiate_key(key_serial_t
+@@ -1038,7 +1038,7 @@ long keyctl_instantiate_key(key_serial_t id,
                        [0].iov_len  = plen
                };
  
@@ -76445,7 +79285,7 @@ diff -urNp linux-3.1.3/security/keys/keyctl.c linux-3.1.3/security/keys/keyctl.c
        }
  
        return keyctl_instantiate_key_common(id, NULL, 0, 0, ringid);
-@@ -1071,7 +1071,7 @@ long keyctl_instantiate_key_iov(key_seri
+@@ -1071,7 +1071,7 @@ long keyctl_instantiate_key_iov(key_serial_t id,
        if (ret == 0)
                goto no_payload_free;
  
@@ -76454,10 +79294,11 @@ diff -urNp linux-3.1.3/security/keys/keyctl.c linux-3.1.3/security/keys/keyctl.c
  
        if (iov != iovstack)
                kfree(iov);
-diff -urNp linux-3.1.3/security/keys/keyring.c linux-3.1.3/security/keys/keyring.c
---- linux-3.1.3/security/keys/keyring.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/security/keys/keyring.c        2011-11-16 18:39:08.000000000 -0500
-@@ -214,15 +214,15 @@ static long keyring_read(const struct ke
+diff --git a/security/keys/keyring.c b/security/keys/keyring.c
+index 30e242f..ec111ab 100644
+--- a/security/keys/keyring.c
++++ b/security/keys/keyring.c
+@@ -214,15 +214,15 @@ static long keyring_read(const struct key *keyring,
                        ret = -EFAULT;
  
                        for (loop = 0; loop < klist->nkeys; loop++) {
@@ -76476,10 +79317,11 @@ diff -urNp linux-3.1.3/security/keys/keyring.c linux-3.1.3/security/keys/keyring
                                        goto error;
  
                                buflen -= tmp;
-diff -urNp linux-3.1.3/security/min_addr.c linux-3.1.3/security/min_addr.c
---- linux-3.1.3/security/min_addr.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/security/min_addr.c    2011-11-16 18:40:44.000000000 -0500
-@@ -14,6 +14,7 @@ unsigned long dac_mmap_min_addr = CONFIG
+diff --git a/security/min_addr.c b/security/min_addr.c
+index f728728..6457a0c 100644
+--- a/security/min_addr.c
++++ b/security/min_addr.c
+@@ -14,6 +14,7 @@ unsigned long dac_mmap_min_addr = CONFIG_DEFAULT_MMAP_MIN_ADDR;
   */
  static void update_mmap_min_addr(void)
  {
@@ -76495,10 +79337,11 @@ diff -urNp linux-3.1.3/security/min_addr.c linux-3.1.3/security/min_addr.c
  }
  
  /*
-diff -urNp linux-3.1.3/security/security.c linux-3.1.3/security/security.c
---- linux-3.1.3/security/security.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/security/security.c    2011-11-16 18:40:44.000000000 -0500
-@@ -25,8 +25,8 @@ static __initdata char chosen_lsm[SECURI
+diff --git a/security/security.c b/security/security.c
+index d9e1533..91427f2 100644
+--- a/security/security.c
++++ b/security/security.c
+@@ -25,8 +25,8 @@ static __initdata char chosen_lsm[SECURITY_NAME_MAX + 1] =
  /* things that live in capability.c */
  extern void __init security_fixup_ops(struct security_operations *ops);
  
@@ -76519,9 +79362,10 @@ diff -urNp linux-3.1.3/security/security.c linux-3.1.3/security/security.c
  }
  
  /* Save user chosen LSM */
-diff -urNp linux-3.1.3/security/selinux/hooks.c linux-3.1.3/security/selinux/hooks.c
---- linux-3.1.3/security/selinux/hooks.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/security/selinux/hooks.c       2011-11-16 18:40:44.000000000 -0500
+diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
+index 266a229..61bd553 100644
+--- a/security/selinux/hooks.c
++++ b/security/selinux/hooks.c
 @@ -93,7 +93,6 @@
  #define NUM_SEL_MNT_OPTS 5
  
@@ -76530,7 +79374,7 @@ diff -urNp linux-3.1.3/security/selinux/hooks.c linux-3.1.3/security/selinux/hoo
  
  /* SECMARK reference count */
  atomic_t selinux_secmark_refcount = ATOMIC_INIT(0);
-@@ -5455,7 +5454,7 @@ static int selinux_key_getsecurity(struc
+@@ -5455,7 +5454,7 @@ static int selinux_key_getsecurity(struct key *key, char **_buffer)
  
  #endif
  
@@ -76539,10 +79383,11 @@ diff -urNp linux-3.1.3/security/selinux/hooks.c linux-3.1.3/security/selinux/hoo
        .name =                         "selinux",
  
        .ptrace_access_check =          selinux_ptrace_access_check,
-diff -urNp linux-3.1.3/security/selinux/include/xfrm.h linux-3.1.3/security/selinux/include/xfrm.h
---- linux-3.1.3/security/selinux/include/xfrm.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/security/selinux/include/xfrm.h        2011-11-16 18:39:08.000000000 -0500
-@@ -48,7 +48,7 @@ int selinux_xfrm_decode_session(struct s
+diff --git a/security/selinux/include/xfrm.h b/security/selinux/include/xfrm.h
+index b43813c..74be837 100644
+--- a/security/selinux/include/xfrm.h
++++ b/security/selinux/include/xfrm.h
+@@ -48,7 +48,7 @@ int selinux_xfrm_decode_session(struct sk_buff *skb, u32 *sid, int ckall);
  
  static inline void selinux_xfrm_notify_policyload(void)
  {
@@ -76551,10 +79396,11 @@ diff -urNp linux-3.1.3/security/selinux/include/xfrm.h linux-3.1.3/security/seli
  }
  #else
  static inline int selinux_xfrm_enabled(void)
-diff -urNp linux-3.1.3/security/selinux/ss/services.c linux-3.1.3/security/selinux/ss/services.c
---- linux-3.1.3/security/selinux/ss/services.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/security/selinux/ss/services.c 2011-11-16 18:40:44.000000000 -0500
-@@ -1814,6 +1814,8 @@ int security_load_policy(void *data, siz
+diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
+index f6917bc..8e8713e 100644
+--- a/security/selinux/ss/services.c
++++ b/security/selinux/ss/services.c
+@@ -1814,6 +1814,8 @@ int security_load_policy(void *data, size_t len)
        int rc = 0;
        struct policy_file file = { data, len }, *fp = &file;
  
@@ -76563,10 +79409,11 @@ diff -urNp linux-3.1.3/security/selinux/ss/services.c linux-3.1.3/security/selin
        if (!ss_initialized) {
                avtab_cache_init();
                rc = policydb_read(&policydb, fp);
-diff -urNp linux-3.1.3/security/smack/smack_lsm.c linux-3.1.3/security/smack/smack_lsm.c
---- linux-3.1.3/security/smack/smack_lsm.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/security/smack/smack_lsm.c     2011-11-16 18:39:08.000000000 -0500
-@@ -3393,7 +3393,7 @@ static int smack_inode_getsecctx(struct 
+diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
+index b9c5e14..20ab779 100644
+--- a/security/smack/smack_lsm.c
++++ b/security/smack/smack_lsm.c
+@@ -3393,7 +3393,7 @@ static int smack_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen)
        return 0;
  }
  
@@ -76575,10 +79422,11 @@ diff -urNp linux-3.1.3/security/smack/smack_lsm.c linux-3.1.3/security/smack/sma
        .name =                         "smack",
  
        .ptrace_access_check =          smack_ptrace_access_check,
-diff -urNp linux-3.1.3/security/tomoyo/tomoyo.c linux-3.1.3/security/tomoyo/tomoyo.c
---- linux-3.1.3/security/tomoyo/tomoyo.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/security/tomoyo/tomoyo.c       2011-11-16 18:39:08.000000000 -0500
-@@ -446,7 +446,7 @@ static int tomoyo_sb_pivotroot(struct pa
+diff --git a/security/tomoyo/tomoyo.c b/security/tomoyo/tomoyo.c
+index f776400..f95b158c 100644
+--- a/security/tomoyo/tomoyo.c
++++ b/security/tomoyo/tomoyo.c
+@@ -446,7 +446,7 @@ static int tomoyo_sb_pivotroot(struct path *old_path, struct path *new_path)
   * tomoyo_security_ops is a "struct security_operations" which is used for
   * registering TOMOYO.
   */
@@ -76587,9 +79435,10 @@ diff -urNp linux-3.1.3/security/tomoyo/tomoyo.c linux-3.1.3/security/tomoyo/tomo
        .name                = "tomoyo",
        .cred_alloc_blank    = tomoyo_cred_alloc_blank,
        .cred_prepare        = tomoyo_cred_prepare,
-diff -urNp linux-3.1.3/sound/aoa/codecs/onyx.c linux-3.1.3/sound/aoa/codecs/onyx.c
---- linux-3.1.3/sound/aoa/codecs/onyx.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/sound/aoa/codecs/onyx.c        2011-11-16 18:39:08.000000000 -0500
+diff --git a/sound/aoa/codecs/onyx.c b/sound/aoa/codecs/onyx.c
+index 3687a6c..652565e 100644
+--- a/sound/aoa/codecs/onyx.c
++++ b/sound/aoa/codecs/onyx.c
 @@ -54,7 +54,7 @@ struct onyx {
                                spdif_locked:1,
                                analog_locked:1,
@@ -76599,7 +79448,7 @@ diff -urNp linux-3.1.3/sound/aoa/codecs/onyx.c linux-3.1.3/sound/aoa/codecs/onyx
        struct codec_info       *codec_info;
  
        /* mutex serializes concurrent access to the device
-@@ -753,7 +753,7 @@ static int onyx_open(struct codec_info_i
+@@ -753,7 +753,7 @@ static int onyx_open(struct codec_info_item *cii,
        struct onyx *onyx = cii->codec_data;
  
        mutex_lock(&onyx->mutex);
@@ -76608,7 +79457,7 @@ diff -urNp linux-3.1.3/sound/aoa/codecs/onyx.c linux-3.1.3/sound/aoa/codecs/onyx
        mutex_unlock(&onyx->mutex);
  
        return 0;
-@@ -765,8 +765,7 @@ static int onyx_close(struct codec_info_
+@@ -765,8 +765,7 @@ static int onyx_close(struct codec_info_item *cii,
        struct onyx *onyx = cii->codec_data;
  
        mutex_lock(&onyx->mutex);
@@ -76618,9 +79467,10 @@ diff -urNp linux-3.1.3/sound/aoa/codecs/onyx.c linux-3.1.3/sound/aoa/codecs/onyx
                onyx->spdif_locked = onyx->analog_locked = 0;
        mutex_unlock(&onyx->mutex);
  
-diff -urNp linux-3.1.3/sound/aoa/codecs/onyx.h linux-3.1.3/sound/aoa/codecs/onyx.h
---- linux-3.1.3/sound/aoa/codecs/onyx.h        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/sound/aoa/codecs/onyx.h        2011-11-16 18:39:08.000000000 -0500
+diff --git a/sound/aoa/codecs/onyx.h b/sound/aoa/codecs/onyx.h
+index ffd2025..df062c9 100644
+--- a/sound/aoa/codecs/onyx.h
++++ b/sound/aoa/codecs/onyx.h
 @@ -11,6 +11,7 @@
  #include <linux/i2c.h>
  #include <asm/pmac_low_i2c.h>
@@ -76629,10 +79479,11 @@ diff -urNp linux-3.1.3/sound/aoa/codecs/onyx.h linux-3.1.3/sound/aoa/codecs/onyx
  
  /* PCM3052 register definitions */
  
-diff -urNp linux-3.1.3/sound/core/oss/pcm_oss.c linux-3.1.3/sound/core/oss/pcm_oss.c
---- linux-3.1.3/sound/core/oss/pcm_oss.c       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/sound/core/oss/pcm_oss.c       2011-11-16 18:39:08.000000000 -0500
-@@ -1189,10 +1189,10 @@ snd_pcm_sframes_t snd_pcm_oss_write3(str
+diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
+index 23c34a0..a2673a5 100644
+--- a/sound/core/oss/pcm_oss.c
++++ b/sound/core/oss/pcm_oss.c
+@@ -1189,10 +1189,10 @@ snd_pcm_sframes_t snd_pcm_oss_write3(struct snd_pcm_substream *substream, const
                if (in_kernel) {
                        mm_segment_t fs;
                        fs = snd_enter_user();
@@ -76645,7 +79496,7 @@ diff -urNp linux-3.1.3/sound/core/oss/pcm_oss.c linux-3.1.3/sound/core/oss/pcm_o
                }
                if (ret != -EPIPE && ret != -ESTRPIPE)
                        break;
-@@ -1234,10 +1234,10 @@ snd_pcm_sframes_t snd_pcm_oss_read3(stru
+@@ -1234,10 +1234,10 @@ snd_pcm_sframes_t snd_pcm_oss_read3(struct snd_pcm_substream *substream, char *p
                if (in_kernel) {
                        mm_segment_t fs;
                        fs = snd_enter_user();
@@ -76658,7 +79509,7 @@ diff -urNp linux-3.1.3/sound/core/oss/pcm_oss.c linux-3.1.3/sound/core/oss/pcm_o
                }
                if (ret == -EPIPE) {
                        if (runtime->status->state == SNDRV_PCM_STATE_DRAINING) {
-@@ -1337,7 +1337,7 @@ static ssize_t snd_pcm_oss_write2(struct
+@@ -1337,7 +1337,7 @@ static ssize_t snd_pcm_oss_write2(struct snd_pcm_substream *substream, const cha
                struct snd_pcm_plugin_channel *channels;
                size_t oss_frame_bytes = (runtime->oss.plugin_first->src_width * runtime->oss.plugin_first->src_format.channels) / 8;
                if (!in_kernel) {
@@ -76667,7 +79518,7 @@ diff -urNp linux-3.1.3/sound/core/oss/pcm_oss.c linux-3.1.3/sound/core/oss/pcm_o
                                return -EFAULT;
                        buf = runtime->oss.buffer;
                }
-@@ -1407,7 +1407,7 @@ static ssize_t snd_pcm_oss_write1(struct
+@@ -1407,7 +1407,7 @@ static ssize_t snd_pcm_oss_write1(struct snd_pcm_substream *substream, const cha
                        }
                } else {
                        tmp = snd_pcm_oss_write2(substream,
@@ -76676,7 +79527,7 @@ diff -urNp linux-3.1.3/sound/core/oss/pcm_oss.c linux-3.1.3/sound/core/oss/pcm_o
                                                 runtime->oss.period_bytes, 0);
                        if (tmp <= 0)
                                goto err;
-@@ -1433,7 +1433,7 @@ static ssize_t snd_pcm_oss_read2(struct 
+@@ -1433,7 +1433,7 @@ static ssize_t snd_pcm_oss_read2(struct snd_pcm_substream *substream, char *buf,
        struct snd_pcm_runtime *runtime = substream->runtime;
        snd_pcm_sframes_t frames, frames1;
  #ifdef CONFIG_SND_PCM_OSS_PLUGINS
@@ -76685,7 +79536,7 @@ diff -urNp linux-3.1.3/sound/core/oss/pcm_oss.c linux-3.1.3/sound/core/oss/pcm_o
        if (runtime->oss.plugin_first) {
                struct snd_pcm_plugin_channel *channels;
                size_t oss_frame_bytes = (runtime->oss.plugin_last->dst_width * runtime->oss.plugin_last->dst_format.channels) / 8;
-@@ -1495,7 +1495,7 @@ static ssize_t snd_pcm_oss_read1(struct 
+@@ -1495,7 +1495,7 @@ static ssize_t snd_pcm_oss_read1(struct snd_pcm_substream *substream, char __use
                        xfer += tmp;
                        runtime->oss.buffer_used -= tmp;
                } else {
@@ -76694,7 +79545,7 @@ diff -urNp linux-3.1.3/sound/core/oss/pcm_oss.c linux-3.1.3/sound/core/oss/pcm_o
                                                runtime->oss.period_bytes, 0);
                        if (tmp <= 0)
                                goto err;
-@@ -1663,7 +1663,7 @@ static int snd_pcm_oss_sync(struct snd_p
+@@ -1663,7 +1663,7 @@ static int snd_pcm_oss_sync(struct snd_pcm_oss_file *pcm_oss_file)
                                                                   size1);
                                        size1 /= runtime->channels; /* frames */
                                        fs = snd_enter_user();
@@ -76703,10 +79554,11 @@ diff -urNp linux-3.1.3/sound/core/oss/pcm_oss.c linux-3.1.3/sound/core/oss/pcm_o
                                        snd_leave_user(fs);
                                }
                        } else if (runtime->access == SNDRV_PCM_ACCESS_RW_NONINTERLEAVED) {
-diff -urNp linux-3.1.3/sound/core/pcm_compat.c linux-3.1.3/sound/core/pcm_compat.c
---- linux-3.1.3/sound/core/pcm_compat.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/sound/core/pcm_compat.c        2011-11-16 18:39:08.000000000 -0500
-@@ -31,7 +31,7 @@ static int snd_pcm_ioctl_delay_compat(st
+diff --git a/sound/core/pcm_compat.c b/sound/core/pcm_compat.c
+index 91cdf94..4085161 100644
+--- a/sound/core/pcm_compat.c
++++ b/sound/core/pcm_compat.c
+@@ -31,7 +31,7 @@ static int snd_pcm_ioctl_delay_compat(struct snd_pcm_substream *substream,
        int err;
  
        fs = snd_enter_user();
@@ -76715,10 +79567,11 @@ diff -urNp linux-3.1.3/sound/core/pcm_compat.c linux-3.1.3/sound/core/pcm_compat
        snd_leave_user(fs);
        if (err < 0)
                return err;
-diff -urNp linux-3.1.3/sound/core/pcm_native.c linux-3.1.3/sound/core/pcm_native.c
---- linux-3.1.3/sound/core/pcm_native.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/sound/core/pcm_native.c        2011-11-16 18:39:08.000000000 -0500
-@@ -2770,11 +2770,11 @@ int snd_pcm_kernel_ioctl(struct snd_pcm_
+diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
+index 1c6be91..c761a59 100644
+--- a/sound/core/pcm_native.c
++++ b/sound/core/pcm_native.c
+@@ -2770,11 +2770,11 @@ int snd_pcm_kernel_ioctl(struct snd_pcm_substream *substream,
        switch (substream->stream) {
        case SNDRV_PCM_STREAM_PLAYBACK:
                result = snd_pcm_playback_ioctl1(NULL, substream, cmd,
@@ -76732,9 +79585,10 @@ diff -urNp linux-3.1.3/sound/core/pcm_native.c linux-3.1.3/sound/core/pcm_native
                break;
        default:
                result = -EINVAL;
-diff -urNp linux-3.1.3/sound/core/seq/seq_device.c linux-3.1.3/sound/core/seq/seq_device.c
---- linux-3.1.3/sound/core/seq/seq_device.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/sound/core/seq/seq_device.c    2011-11-16 18:39:08.000000000 -0500
+diff --git a/sound/core/seq/seq_device.c b/sound/core/seq/seq_device.c
+index 1f99767..14636533 100644
+--- a/sound/core/seq/seq_device.c
++++ b/sound/core/seq/seq_device.c
 @@ -63,7 +63,7 @@ struct ops_list {
        int argsize;            /* argument size */
  
@@ -76744,7 +79598,7 @@ diff -urNp linux-3.1.3/sound/core/seq/seq_device.c linux-3.1.3/sound/core/seq/se
  
        /* registred devices */
        struct list_head dev_list;      /* list of devices */
-@@ -332,7 +332,7 @@ int snd_seq_device_register_driver(char 
+@@ -332,7 +332,7 @@ int snd_seq_device_register_driver(char *id, struct snd_seq_dev_ops *entry,
  
        mutex_lock(&ops->reg_mutex);
        /* copy driver operators */
@@ -76753,7 +79607,7 @@ diff -urNp linux-3.1.3/sound/core/seq/seq_device.c linux-3.1.3/sound/core/seq/se
        ops->driver |= DRIVER_LOADED;
        ops->argsize = argsize;
  
-@@ -462,7 +462,7 @@ static int init_device(struct snd_seq_de
+@@ -462,7 +462,7 @@ static int init_device(struct snd_seq_device *dev, struct ops_list *ops)
                           dev->name, ops->id, ops->argsize, dev->argsize);
                return -EINVAL;
        }
@@ -76762,7 +79616,7 @@ diff -urNp linux-3.1.3/sound/core/seq/seq_device.c linux-3.1.3/sound/core/seq/se
                dev->status = SNDRV_SEQ_DEVICE_REGISTERED;
                ops->num_init_devices++;
        } else {
-@@ -489,7 +489,7 @@ static int free_device(struct snd_seq_de
+@@ -489,7 +489,7 @@ static int free_device(struct snd_seq_device *dev, struct ops_list *ops)
                           dev->name, ops->id, ops->argsize, dev->argsize);
                return -EINVAL;
        }
@@ -76771,9 +79625,10 @@ diff -urNp linux-3.1.3/sound/core/seq/seq_device.c linux-3.1.3/sound/core/seq/se
                dev->status = SNDRV_SEQ_DEVICE_FREE;
                dev->driver_data = NULL;
                ops->num_init_devices--;
-diff -urNp linux-3.1.3/sound/drivers/mts64.c linux-3.1.3/sound/drivers/mts64.c
---- linux-3.1.3/sound/drivers/mts64.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/sound/drivers/mts64.c  2011-11-16 18:39:08.000000000 -0500
+diff --git a/sound/drivers/mts64.c b/sound/drivers/mts64.c
+index 8539ab0..be8a121 100644
+--- a/sound/drivers/mts64.c
++++ b/sound/drivers/mts64.c
 @@ -28,6 +28,7 @@
  #include <sound/initval.h>
  #include <sound/rawmidi.h>
@@ -76791,7 +79646,7 @@ diff -urNp linux-3.1.3/sound/drivers/mts64.c linux-3.1.3/sound/drivers/mts64.c
        int current_midi_output_port;
        int current_midi_input_port;
        u8 mode[MTS64_NUM_INPUT_PORTS];
-@@ -696,7 +697,7 @@ static int snd_mts64_rawmidi_open(struct
+@@ -696,7 +697,7 @@ static int snd_mts64_rawmidi_open(struct snd_rawmidi_substream *substream)
  {
        struct mts64 *mts = substream->rmidi->private_data;
  
@@ -76800,7 +79655,7 @@ diff -urNp linux-3.1.3/sound/drivers/mts64.c linux-3.1.3/sound/drivers/mts64.c
                /* We don't need a spinlock here, because this is just called 
                   if the device has not been opened before. 
                   So there aren't any IRQs from the device */
-@@ -704,7 +705,7 @@ static int snd_mts64_rawmidi_open(struct
+@@ -704,7 +705,7 @@ static int snd_mts64_rawmidi_open(struct snd_rawmidi_substream *substream)
  
                msleep(50);
        }
@@ -76809,7 +79664,7 @@ diff -urNp linux-3.1.3/sound/drivers/mts64.c linux-3.1.3/sound/drivers/mts64.c
  
        return 0;
  }
-@@ -714,8 +715,7 @@ static int snd_mts64_rawmidi_close(struc
+@@ -714,8 +715,7 @@ static int snd_mts64_rawmidi_close(struct snd_rawmidi_substream *substream)
        struct mts64 *mts = substream->rmidi->private_data;
        unsigned long flags;
  
@@ -76819,7 +79674,7 @@ diff -urNp linux-3.1.3/sound/drivers/mts64.c linux-3.1.3/sound/drivers/mts64.c
                /* We need the spinlock_irqsave here because we can still
                   have IRQs at this point */
                spin_lock_irqsave(&mts->lock, flags);
-@@ -724,8 +724,8 @@ static int snd_mts64_rawmidi_close(struc
+@@ -724,8 +724,8 @@ static int snd_mts64_rawmidi_close(struct snd_rawmidi_substream *substream)
  
                msleep(500);
  
@@ -76830,10 +79685,11 @@ diff -urNp linux-3.1.3/sound/drivers/mts64.c linux-3.1.3/sound/drivers/mts64.c
  
        return 0;
  }
-diff -urNp linux-3.1.3/sound/drivers/opl4/opl4_lib.c linux-3.1.3/sound/drivers/opl4/opl4_lib.c
---- linux-3.1.3/sound/drivers/opl4/opl4_lib.c  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/sound/drivers/opl4/opl4_lib.c  2011-11-16 18:39:08.000000000 -0500
-@@ -28,7 +28,7 @@ MODULE_AUTHOR("Clemens Ladisch <clemens@
+diff --git a/sound/drivers/opl4/opl4_lib.c b/sound/drivers/opl4/opl4_lib.c
+index f07e38d..7aae69a 100644
+--- a/sound/drivers/opl4/opl4_lib.c
++++ b/sound/drivers/opl4/opl4_lib.c
+@@ -28,7 +28,7 @@ MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>");
  MODULE_DESCRIPTION("OPL4 driver");
  MODULE_LICENSE("GPL");
  
@@ -76842,9 +79698,10 @@ diff -urNp linux-3.1.3/sound/drivers/opl4/opl4_lib.c linux-3.1.3/sound/drivers/o
  {
        int timeout = 10;
        while ((inb(opl4->fm_port) & OPL4_STATUS_BUSY) && --timeout > 0)
-diff -urNp linux-3.1.3/sound/drivers/portman2x4.c linux-3.1.3/sound/drivers/portman2x4.c
---- linux-3.1.3/sound/drivers/portman2x4.c     2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/sound/drivers/portman2x4.c     2011-11-16 18:39:08.000000000 -0500
+diff --git a/sound/drivers/portman2x4.c b/sound/drivers/portman2x4.c
+index f2b0ba2..429efc5 100644
+--- a/sound/drivers/portman2x4.c
++++ b/sound/drivers/portman2x4.c
 @@ -47,6 +47,7 @@
  #include <sound/initval.h>
  #include <sound/rawmidi.h>
@@ -76862,10 +79719,11 @@ diff -urNp linux-3.1.3/sound/drivers/portman2x4.c linux-3.1.3/sound/drivers/port
        int mode[PORTMAN_NUM_INPUT_PORTS];
        struct snd_rawmidi_substream *midi_input[PORTMAN_NUM_INPUT_PORTS];
  };
-diff -urNp linux-3.1.3/sound/firewire/amdtp.c linux-3.1.3/sound/firewire/amdtp.c
---- linux-3.1.3/sound/firewire/amdtp.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/sound/firewire/amdtp.c 2011-11-16 18:39:08.000000000 -0500
-@@ -371,7 +371,7 @@ static void queue_out_packet(struct amdt
+diff --git a/sound/firewire/amdtp.c b/sound/firewire/amdtp.c
+index 87657dd..a8268d4 100644
+--- a/sound/firewire/amdtp.c
++++ b/sound/firewire/amdtp.c
+@@ -371,7 +371,7 @@ static void queue_out_packet(struct amdtp_out_stream *s, unsigned int cycle)
                ptr = s->pcm_buffer_pointer + data_blocks;
                if (ptr >= pcm->runtime->buffer_size)
                        ptr -= pcm->runtime->buffer_size;
@@ -76883,10 +79741,11 @@ diff -urNp linux-3.1.3/sound/firewire/amdtp.c linux-3.1.3/sound/firewire/amdtp.c
                (fw_parent_device(s->unit)->card->node_id & 0x3f) << 24;
  }
  EXPORT_SYMBOL(amdtp_out_stream_update);
-diff -urNp linux-3.1.3/sound/firewire/amdtp.h linux-3.1.3/sound/firewire/amdtp.h
---- linux-3.1.3/sound/firewire/amdtp.h 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/sound/firewire/amdtp.h 2011-11-16 18:39:08.000000000 -0500
-@@ -146,7 +146,7 @@ static inline void amdtp_out_stream_pcm_
+diff --git a/sound/firewire/amdtp.h b/sound/firewire/amdtp.h
+index 537a9cb..8e8c8e9 100644
+--- a/sound/firewire/amdtp.h
++++ b/sound/firewire/amdtp.h
+@@ -146,7 +146,7 @@ static inline void amdtp_out_stream_pcm_prepare(struct amdtp_out_stream *s)
  static inline void amdtp_out_stream_pcm_trigger(struct amdtp_out_stream *s,
                                                struct snd_pcm_substream *pcm)
  {
@@ -76895,10 +79754,11 @@ diff -urNp linux-3.1.3/sound/firewire/amdtp.h linux-3.1.3/sound/firewire/amdtp.h
  }
  
  /**
-diff -urNp linux-3.1.3/sound/firewire/isight.c linux-3.1.3/sound/firewire/isight.c
---- linux-3.1.3/sound/firewire/isight.c        2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/sound/firewire/isight.c        2011-11-16 18:39:08.000000000 -0500
-@@ -97,7 +97,7 @@ static void isight_update_pointers(struc
+diff --git a/sound/firewire/isight.c b/sound/firewire/isight.c
+index 4400308..261e9f3 100644
+--- a/sound/firewire/isight.c
++++ b/sound/firewire/isight.c
+@@ -97,7 +97,7 @@ static void isight_update_pointers(struct isight *isight, unsigned int count)
        ptr += count;
        if (ptr >= runtime->buffer_size)
                ptr -= runtime->buffer_size;
@@ -76907,7 +79767,7 @@ diff -urNp linux-3.1.3/sound/firewire/isight.c linux-3.1.3/sound/firewire/isight
  
        isight->period_counter += count;
        if (isight->period_counter >= runtime->period_size) {
-@@ -308,7 +308,7 @@ static int isight_hw_params(struct snd_p
+@@ -308,7 +308,7 @@ static int isight_hw_params(struct snd_pcm_substream *substream,
        if (err < 0)
                return err;
  
@@ -76916,7 +79776,7 @@ diff -urNp linux-3.1.3/sound/firewire/isight.c linux-3.1.3/sound/firewire/isight
  
        return 0;
  }
-@@ -341,7 +341,7 @@ static int isight_hw_free(struct snd_pcm
+@@ -341,7 +341,7 @@ static int isight_hw_free(struct snd_pcm_substream *substream)
  {
        struct isight *isight = substream->private_data;
  
@@ -76925,7 +79785,7 @@ diff -urNp linux-3.1.3/sound/firewire/isight.c linux-3.1.3/sound/firewire/isight
  
        mutex_lock(&isight->mutex);
        isight_stop_streaming(isight);
-@@ -434,10 +434,10 @@ static int isight_trigger(struct snd_pcm
+@@ -434,10 +434,10 @@ static int isight_trigger(struct snd_pcm_substream *substream, int cmd)
  
        switch (cmd) {
        case SNDRV_PCM_TRIGGER_START:
@@ -76938,9 +79798,10 @@ diff -urNp linux-3.1.3/sound/firewire/isight.c linux-3.1.3/sound/firewire/isight
                break;
        default:
                return -EINVAL;
-diff -urNp linux-3.1.3/sound/isa/cmi8330.c linux-3.1.3/sound/isa/cmi8330.c
---- linux-3.1.3/sound/isa/cmi8330.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/sound/isa/cmi8330.c    2011-11-16 18:39:08.000000000 -0500
+diff --git a/sound/isa/cmi8330.c b/sound/isa/cmi8330.c
+index fe79a16..4d9714e 100644
+--- a/sound/isa/cmi8330.c
++++ b/sound/isa/cmi8330.c
 @@ -172,7 +172,7 @@ struct snd_cmi8330 {
  
        struct snd_pcm *pcm;
@@ -76950,9 +79811,10 @@ diff -urNp linux-3.1.3/sound/isa/cmi8330.c linux-3.1.3/sound/isa/cmi8330.c
                snd_pcm_open_callback_t open;
                void *private_data; /* sb or wss */
        } streams[2];
-diff -urNp linux-3.1.3/sound/oss/sb_audio.c linux-3.1.3/sound/oss/sb_audio.c
---- linux-3.1.3/sound/oss/sb_audio.c   2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/sound/oss/sb_audio.c   2011-11-16 18:39:08.000000000 -0500
+diff --git a/sound/oss/sb_audio.c b/sound/oss/sb_audio.c
+index 733b014..56ce96f 100644
+--- a/sound/oss/sb_audio.c
++++ b/sound/oss/sb_audio.c
 @@ -901,7 +901,7 @@ sb16_copy_from_user(int dev,
                buf16 = (signed short *)(localbuf + localoffs);
                while (c)
@@ -76962,9 +79824,10 @@ diff -urNp linux-3.1.3/sound/oss/sb_audio.c linux-3.1.3/sound/oss/sb_audio.c
                        if (copy_from_user(lbuf8,
                                           userbuf+useroffs + p,
                                           locallen))
-diff -urNp linux-3.1.3/sound/oss/swarm_cs4297a.c linux-3.1.3/sound/oss/swarm_cs4297a.c
---- linux-3.1.3/sound/oss/swarm_cs4297a.c      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/sound/oss/swarm_cs4297a.c      2011-11-16 18:39:08.000000000 -0500
+diff --git a/sound/oss/swarm_cs4297a.c b/sound/oss/swarm_cs4297a.c
+index 09d4648..cf234c7 100644
+--- a/sound/oss/swarm_cs4297a.c
++++ b/sound/oss/swarm_cs4297a.c
 @@ -2606,7 +2606,6 @@ static int __init cs4297a_init(void)
  {
        struct cs4297a_state *s;
@@ -76999,9 +79862,10 @@ diff -urNp linux-3.1.3/sound/oss/swarm_cs4297a.c linux-3.1.3/sound/oss/swarm_cs4
  
                  list_add(&s->list, &cs4297a_devs);
  
-diff -urNp linux-3.1.3/sound/pci/hda/hda_codec.h linux-3.1.3/sound/pci/hda/hda_codec.h
---- linux-3.1.3/sound/pci/hda/hda_codec.h      2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/sound/pci/hda/hda_codec.h      2011-11-16 18:39:08.000000000 -0500
+diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h
+index 755f2b0..5c12361 100644
+--- a/sound/pci/hda/hda_codec.h
++++ b/sound/pci/hda/hda_codec.h
 @@ -611,7 +611,7 @@ struct hda_bus_ops {
        /* notify power-up/down from codec to controller */
        void (*pm_notify)(struct hda_bus *bus);
@@ -77037,9 +79901,10 @@ diff -urNp linux-3.1.3/sound/pci/hda/hda_codec.h linux-3.1.3/sound/pci/hda/hda_c
  
        /* PCM to create, set by patch_ops.build_pcms callback */
        unsigned int num_pcms;
-diff -urNp linux-3.1.3/sound/pci/ice1712/ice1712.h linux-3.1.3/sound/pci/ice1712/ice1712.h
---- linux-3.1.3/sound/pci/ice1712/ice1712.h    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/sound/pci/ice1712/ice1712.h    2011-11-16 18:39:08.000000000 -0500
+diff --git a/sound/pci/ice1712/ice1712.h b/sound/pci/ice1712/ice1712.h
+index 0da778a..bc38b84 100644
+--- a/sound/pci/ice1712/ice1712.h
++++ b/sound/pci/ice1712/ice1712.h
 @@ -269,7 +269,7 @@ struct snd_ak4xxx_private {
        unsigned int mask_flags;        /* total mask bits */
        struct snd_akm4xxx_ops {
@@ -77058,10 +79923,11 @@ diff -urNp linux-3.1.3/sound/pci/ice1712/ice1712.h linux-3.1.3/sound/pci/ice1712
  };
  
  
-diff -urNp linux-3.1.3/sound/pci/ymfpci/ymfpci_main.c linux-3.1.3/sound/pci/ymfpci/ymfpci_main.c
---- linux-3.1.3/sound/pci/ymfpci/ymfpci_main.c 2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/sound/pci/ymfpci/ymfpci_main.c 2011-11-16 18:39:08.000000000 -0500
-@@ -202,8 +202,8 @@ static void snd_ymfpci_hw_stop(struct sn
+diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c
+index f3260e6..4a285d8 100644
+--- a/sound/pci/ymfpci/ymfpci_main.c
++++ b/sound/pci/ymfpci/ymfpci_main.c
+@@ -202,8 +202,8 @@ static void snd_ymfpci_hw_stop(struct snd_ymfpci *chip)
                if ((snd_ymfpci_readl(chip, YDSXGR_STATUS) & 2) == 0)
                        break;
        }
@@ -77072,7 +79938,7 @@ diff -urNp linux-3.1.3/sound/pci/ymfpci/ymfpci_main.c linux-3.1.3/sound/pci/ymfp
                wake_up(&chip->interrupt_sleep);
        }
        __end:
-@@ -787,7 +787,7 @@ static void snd_ymfpci_irq_wait(struct s
+@@ -787,7 +787,7 @@ static void snd_ymfpci_irq_wait(struct snd_ymfpci *chip)
                        continue;
                init_waitqueue_entry(&wait, current);
                add_wait_queue(&chip->interrupt_sleep, &wait);
@@ -77081,7 +79947,7 @@ diff -urNp linux-3.1.3/sound/pci/ymfpci/ymfpci_main.c linux-3.1.3/sound/pci/ymfp
                schedule_timeout_uninterruptible(msecs_to_jiffies(50));
                remove_wait_queue(&chip->interrupt_sleep, &wait);
        }
-@@ -825,8 +825,8 @@ static irqreturn_t snd_ymfpci_interrupt(
+@@ -825,8 +825,8 @@ static irqreturn_t snd_ymfpci_interrupt(int irq, void *dev_id)
                snd_ymfpci_writel(chip, YDSXGR_MODE, mode);
                spin_unlock(&chip->reg_lock);
  
@@ -77092,7 +79958,7 @@ diff -urNp linux-3.1.3/sound/pci/ymfpci/ymfpci_main.c linux-3.1.3/sound/pci/ymfp
                        wake_up(&chip->interrupt_sleep);
                }
        }
-@@ -2363,7 +2363,7 @@ int __devinit snd_ymfpci_create(struct s
+@@ -2363,7 +2363,7 @@ int __devinit snd_ymfpci_create(struct snd_card *card,
        spin_lock_init(&chip->reg_lock);
        spin_lock_init(&chip->voice_lock);
        init_waitqueue_head(&chip->interrupt_sleep);
@@ -77101,10 +79967,11 @@ diff -urNp linux-3.1.3/sound/pci/ymfpci/ymfpci_main.c linux-3.1.3/sound/pci/ymfp
        chip->card = card;
        chip->pci = pci;
        chip->irq = -1;
-diff -urNp linux-3.1.3/sound/soc/soc-pcm.c linux-3.1.3/sound/soc/soc-pcm.c
---- linux-3.1.3/sound/soc/soc-pcm.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/sound/soc/soc-pcm.c    2011-11-16 18:39:08.000000000 -0500
-@@ -568,7 +568,7 @@ static snd_pcm_uframes_t soc_pcm_pointer
+diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
+index 2879c88..224159e 100644
+--- a/sound/soc/soc-pcm.c
++++ b/sound/soc/soc-pcm.c
+@@ -568,7 +568,7 @@ static snd_pcm_uframes_t soc_pcm_pointer(struct snd_pcm_substream *substream)
  }
  
  /* ASoC PCM operations */
@@ -77113,9 +79980,10 @@ diff -urNp linux-3.1.3/sound/soc/soc-pcm.c linux-3.1.3/sound/soc/soc-pcm.c
        .open           = soc_pcm_open,
        .close          = soc_pcm_close,
        .hw_params      = soc_pcm_hw_params,
-diff -urNp linux-3.1.3/sound/usb/card.h linux-3.1.3/sound/usb/card.h
---- linux-3.1.3/sound/usb/card.h       2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/sound/usb/card.h       2011-11-16 18:39:08.000000000 -0500
+diff --git a/sound/usb/card.h b/sound/usb/card.h
+index ae4251d..0961361 100644
+--- a/sound/usb/card.h
++++ b/sound/usb/card.h
 @@ -44,6 +44,7 @@ struct snd_urb_ops {
        int (*prepare_sync)(struct snd_usb_substream *subs, struct snd_pcm_runtime *runtime, struct urb *u);
        int (*retire_sync)(struct snd_usb_substream *subs, struct snd_pcm_runtime *runtime, struct urb *u);
@@ -77133,9 +80001,38 @@ diff -urNp linux-3.1.3/sound/usb/card.h linux-3.1.3/sound/usb/card.h
  };
  
  struct snd_usb_stream {
-diff -urNp linux-3.1.3/tools/gcc/checker_plugin.c linux-3.1.3/tools/gcc/checker_plugin.c
---- linux-3.1.3/tools/gcc/checker_plugin.c     1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/tools/gcc/checker_plugin.c     2011-11-16 18:39:08.000000000 -0500
+diff --git a/tools/gcc/Makefile b/tools/gcc/Makefile
+new file mode 100644
+index 0000000..b044b80
+--- /dev/null
++++ b/tools/gcc/Makefile
+@@ -0,0 +1,21 @@
++#CC := gcc
++#PLUGIN_SOURCE_FILES := pax_plugin.c
++#PLUGIN_OBJECT_FILES := $(patsubst %.c,%.o,$(PLUGIN_SOURCE_FILES))
++GCCPLUGINS_DIR := $(shell $(CC) -print-file-name=plugin)
++#CFLAGS += -I$(GCCPLUGINS_DIR)/include -fPIC -O2 -Wall -W
++
++HOST_EXTRACFLAGS += -I$(GCCPLUGINS_DIR)/include
++
++hostlibs-y := constify_plugin.so
++hostlibs-$(CONFIG_PAX_MEMORY_STACKLEAK) += stackleak_plugin.so
++hostlibs-$(CONFIG_KALLOCSTAT_PLUGIN) += kallocstat_plugin.so
++hostlibs-$(CONFIG_PAX_KERNEXEC_PLUGIN) += kernexec_plugin.so
++hostlibs-$(CONFIG_CHECKER_PLUGIN) += checker_plugin.so
++
++always := $(hostlibs-y)
++
++constify_plugin-objs := constify_plugin.o
++stackleak_plugin-objs := stackleak_plugin.o
++kallocstat_plugin-objs := kallocstat_plugin.o
++kernexec_plugin-objs := kernexec_plugin.o
++checker_plugin-objs := checker_plugin.o
+diff --git a/tools/gcc/checker_plugin.c b/tools/gcc/checker_plugin.c
+new file mode 100644
+index 0000000..d41b5af
+--- /dev/null
++++ b/tools/gcc/checker_plugin.c
 @@ -0,0 +1,171 @@
 +/*
 + * Copyright 2011 by the PaX Team <pageexec@freemail.hu>
@@ -77304,13 +80201,15 @@ diff -urNp linux-3.1.3/tools/gcc/checker_plugin.c linux-3.1.3/tools/gcc/checker_
 +      if (TARGET_64BIT == 0)
 +              return 0;
 +
-+      register_callback (plugin_name, PLUGIN_PRAGMAS, register_checker_address_spaces, NULL);
++      register_callback(plugin_name, PLUGIN_PRAGMAS, register_checker_address_spaces, NULL);
 +
 +      return 0;
 +}
-diff -urNp linux-3.1.3/tools/gcc/constify_plugin.c linux-3.1.3/tools/gcc/constify_plugin.c
---- linux-3.1.3/tools/gcc/constify_plugin.c    1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/tools/gcc/constify_plugin.c    2011-11-16 18:39:08.000000000 -0500
+diff --git a/tools/gcc/constify_plugin.c b/tools/gcc/constify_plugin.c
+new file mode 100644
+index 0000000..704a564
+--- /dev/null
++++ b/tools/gcc/constify_plugin.c
 @@ -0,0 +1,303 @@
 +/*
 + * Copyright 2011 by Emese Revfy <re.emese@gmail.com>
@@ -77447,7 +80346,7 @@ diff -urNp linux-3.1.3/tools/gcc/constify_plugin.c linux-3.1.3/tools/gcc/constif
 +      .type_required          = false,
 +      .function_type_required = false,
 +      .handler                = handle_no_const_attribute,
-+#if __GNUC__ > 4 || __GNUC_MINOR__ >= 7
++#if BUILDING_GCC_VERSION >= 4007
 +      .affects_type_identity  = true
 +#endif
 +};
@@ -77460,7 +80359,7 @@ diff -urNp linux-3.1.3/tools/gcc/constify_plugin.c linux-3.1.3/tools/gcc/constif
 +      .type_required          = false,
 +      .function_type_required = false,
 +      .handler                = handle_do_const_attribute,
-+#if __GNUC__ > 4 || __GNUC_MINOR__ >= 7
++#if BUILDING_GCC_VERSION >= 4007
 +      .affects_type_identity  = true
 +#endif
 +};
@@ -77548,7 +80447,7 @@ diff -urNp linux-3.1.3/tools/gcc/constify_plugin.c linux-3.1.3/tools/gcc/constif
 +      tree var;
 +      referenced_var_iterator rvi;
 +
-+#if __GNUC__ == 4 && __GNUC_MINOR__ == 5
++#if BUILDING_GCC_VERSION == 4005
 +      FOR_EACH_REFERENCED_VAR(var, rvi) {
 +#else
 +      FOR_EACH_REFERENCED_VAR(cfun, var, rvi) {
@@ -77615,9 +80514,11 @@ diff -urNp linux-3.1.3/tools/gcc/constify_plugin.c linux-3.1.3/tools/gcc/constif
 +
 +      return 0;
 +}
-diff -urNp linux-3.1.3/tools/gcc/kallocstat_plugin.c linux-3.1.3/tools/gcc/kallocstat_plugin.c
---- linux-3.1.3/tools/gcc/kallocstat_plugin.c  1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/tools/gcc/kallocstat_plugin.c  2011-11-16 18:39:08.000000000 -0500
+diff --git a/tools/gcc/kallocstat_plugin.c b/tools/gcc/kallocstat_plugin.c
+new file mode 100644
+index 0000000..a5eabce
+--- /dev/null
++++ b/tools/gcc/kallocstat_plugin.c
 @@ -0,0 +1,167 @@
 +/*
 + * Copyright 2011 by the PaX Team <pageexec@freemail.hu>
@@ -77786,10 +80687,12 @@ diff -urNp linux-3.1.3/tools/gcc/kallocstat_plugin.c linux-3.1.3/tools/gcc/kallo
 +
 +      return 0;
 +}
-diff -urNp linux-3.1.3/tools/gcc/kernexec_plugin.c linux-3.1.3/tools/gcc/kernexec_plugin.c
---- linux-3.1.3/tools/gcc/kernexec_plugin.c    1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/tools/gcc/kernexec_plugin.c    2011-11-18 17:57:07.000000000 -0500
-@@ -0,0 +1,275 @@
+diff --git a/tools/gcc/kernexec_plugin.c b/tools/gcc/kernexec_plugin.c
+new file mode 100644
+index 0000000..51f747e
+--- /dev/null
++++ b/tools/gcc/kernexec_plugin.c
+@@ -0,0 +1,348 @@
 +/*
 + * Copyright 2011 by the PaX Team <pageexec@freemail.hu>
 + * Licensed under the GPL v2
@@ -77833,13 +80736,17 @@ diff -urNp linux-3.1.3/tools/gcc/kernexec_plugin.c linux-3.1.3/tools/gcc/kernexe
 +int plugin_is_GPL_compatible;
 +
 +static struct plugin_info kernexec_plugin_info = {
-+      .version        = "201111150100",
++      .version        = "201111291120",
++      .help           = "method=[bts|or]\tinstrumentation method\n"
 +};
 +
 +static unsigned int execute_kernexec_fptr(void);
 +static unsigned int execute_kernexec_retaddr(void);
 +static bool kernexec_cmodel_check(void);
 +
++static void (*kernexec_instrument_fptr)(gimple_stmt_iterator);
++static void (*kernexec_instrument_retaddr)(rtx);
++
 +static struct gimple_opt_pass kernexec_fptr_pass = {
 +      .pass = {
 +              .type                   = GIMPLE_PASS,
@@ -77898,7 +80805,7 @@ diff -urNp linux-3.1.3/tools/gcc/kernexec_plugin.c linux-3.1.3/tools/gcc/kernexe
 + * add special KERNEXEC instrumentation: force MSB of fptr to 1, which will produce
 + * a non-canonical address from a userland ptr and will just trigger a GPF on dereference
 + */
-+static void kernexec_instrument_fptr(gimple_stmt_iterator gsi)
++static void kernexec_instrument_fptr_bts(gimple_stmt_iterator gsi)
 +{
 +      gimple assign_intptr, assign_new_fptr, call_stmt;
 +      tree intptr, old_fptr, new_fptr, kernexec_mask;
@@ -77907,27 +80814,59 @@ diff -urNp linux-3.1.3/tools/gcc/kernexec_plugin.c linux-3.1.3/tools/gcc/kernexe
 +      old_fptr = gimple_call_fn(call_stmt);
 +
 +      // create temporary unsigned long variable used for bitops and cast fptr to it
-+      intptr = create_tmp_var(long_unsigned_type_node, NULL);
++      intptr = create_tmp_var(long_unsigned_type_node, "kernexec_bts");
 +      add_referenced_var(intptr);
 +      mark_sym_for_renaming(intptr);
 +      assign_intptr = gimple_build_assign(intptr, fold_convert(long_unsigned_type_node, old_fptr));
-+      update_stmt(assign_intptr);
 +      gsi_insert_before(&gsi, assign_intptr, GSI_SAME_STMT);
++      update_stmt(assign_intptr);
 +
 +      // apply logical or to temporary unsigned long and bitmask
 +      kernexec_mask = build_int_cstu(long_long_unsigned_type_node, 0x8000000000000000LL);
 +//    kernexec_mask = build_int_cstu(long_long_unsigned_type_node, 0xffffffff80000000LL);
 +      assign_intptr = gimple_build_assign(intptr, fold_build2(BIT_IOR_EXPR, long_long_unsigned_type_node, intptr, kernexec_mask));
-+      update_stmt(assign_intptr);
 +      gsi_insert_before(&gsi, assign_intptr, GSI_SAME_STMT);
++      update_stmt(assign_intptr);
 +
 +      // cast temporary unsigned long back to a temporary fptr variable
-+      new_fptr = create_tmp_var(TREE_TYPE(old_fptr), NULL);
++      new_fptr = create_tmp_var(TREE_TYPE(old_fptr), "kernexec");
 +      add_referenced_var(new_fptr);
 +      mark_sym_for_renaming(new_fptr);
 +      assign_new_fptr = gimple_build_assign(new_fptr, fold_convert(TREE_TYPE(old_fptr), intptr));
-+      update_stmt(assign_new_fptr);
 +      gsi_insert_before(&gsi, assign_new_fptr, GSI_SAME_STMT);
++      update_stmt(assign_new_fptr);
++
++      // replace call stmt fn with the new fptr
++      gimple_call_set_fn(call_stmt, new_fptr);
++      update_stmt(call_stmt);
++}
++
++static void kernexec_instrument_fptr_or(gimple_stmt_iterator gsi)
++{
++      gimple asm_or_stmt, call_stmt;
++      tree old_fptr, new_fptr, input, output;
++      VEC(tree, gc) *inputs = NULL;
++      VEC(tree, gc) *outputs = NULL;
++
++      call_stmt = gsi_stmt(gsi);
++      old_fptr = gimple_call_fn(call_stmt);
++
++      // create temporary fptr variable
++      new_fptr = create_tmp_var(TREE_TYPE(old_fptr), "kernexec_or");
++      add_referenced_var(new_fptr);
++      mark_sym_for_renaming(new_fptr);
++
++      // build asm volatile("orq %%r10, %0\n\t" : "=r"(new_fptr) : "0"(old_fptr));
++      input = build_tree_list(NULL_TREE, build_string(2, "0"));
++      input = chainon(NULL_TREE, build_tree_list(input, old_fptr));
++      output = build_tree_list(NULL_TREE, build_string(3, "=r"));
++      output = chainon(NULL_TREE, build_tree_list(output, new_fptr));
++      VEC_safe_push(tree, gc, inputs, input);
++      VEC_safe_push(tree, gc, outputs, output);
++      asm_or_stmt = gimple_build_asm_vec("orq %%r10, %0\n\t", inputs, outputs, NULL, NULL);
++      gimple_asm_set_volatile(asm_or_stmt, true);
++      gsi_insert_before(&gsi, asm_or_stmt, GSI_SAME_STMT);
++      update_stmt(asm_or_stmt);
 +
 +      // replace call stmt fn with the new fptr
 +      gimple_call_set_fn(call_stmt, new_fptr);
@@ -77981,7 +80920,7 @@ diff -urNp linux-3.1.3/tools/gcc/kernexec_plugin.c linux-3.1.3/tools/gcc/kernexe
 +}
 +
 +// add special KERNEXEC instrumentation: btsq $63,(%rsp) just before retn
-+static void kernexec_instrument_retaddr(rtx insn)
++static void kernexec_instrument_retaddr_bts(rtx insn)
 +{
 +      rtx btsq;
 +      rtvec argvec, constraintvec, labelvec;
@@ -77998,6 +80937,24 @@ diff -urNp linux-3.1.3/tools/gcc/kernexec_plugin.c linux-3.1.3/tools/gcc/kernexe
 +      emit_insn_before(btsq, insn);
 +}
 +
++// add special KERNEXEC instrumentation: orq %r10,(%rsp) just before retn
++static void kernexec_instrument_retaddr_or(rtx insn)
++{
++      rtx orq;
++      rtvec argvec, constraintvec, labelvec;
++      int line;
++
++      // create asm volatile("orq %%r10,(%%rsp)":::)
++      argvec = rtvec_alloc(0);
++      constraintvec = rtvec_alloc(0);
++      labelvec = rtvec_alloc(0);
++      line = expand_location(RTL_LOCATION(insn)).line;
++      orq = gen_rtx_ASM_OPERANDS(VOIDmode, "orq %%r10,(%%rsp)", empty_string, 0, argvec, constraintvec, labelvec, line);
++      MEM_VOLATILE_P(orq) = 1;
++//    RTX_FRAME_RELATED_P(orq) = 1; // not for ASM_OPERANDS
++      emit_insn_before(orq, insn);
++}
++
 +/*
 + * find all asm level function returns and forcibly set the highest bit of the return address
 + */
@@ -78054,45 +81011,41 @@ diff -urNp linux-3.1.3/tools/gcc/kernexec_plugin.c linux-3.1.3/tools/gcc/kernexe
 +
 +      register_callback(plugin_name, PLUGIN_INFO, NULL, &kernexec_plugin_info);
 +
-+      for (i = 0; i < argc; ++i)
-+              error(G_("unkown option '-fplugin-arg-%s-%s'"), plugin_name, argv[i].key);
-+
 +      if (TARGET_64BIT == 0)
 +              return 0;
 +
++      for (i = 0; i < argc; ++i) {
++              if (!strcmp(argv[i].key, "method")) {
++                      if (!argv[i].value) {
++                              error(G_("no value supplied for option '-fplugin-arg-%s-%s'"), plugin_name, argv[i].key);
++                              continue;
++                      }
++                      if (!strcmp(argv[i].value, "bts")) {
++                              kernexec_instrument_fptr = kernexec_instrument_fptr_bts;
++                              kernexec_instrument_retaddr = kernexec_instrument_retaddr_bts;
++                      } else if (!strcmp(argv[i].value, "or")) {
++                              kernexec_instrument_fptr = kernexec_instrument_fptr_or;
++                              kernexec_instrument_retaddr = kernexec_instrument_retaddr_or;
++                              fix_register("r10", 1, 1);
++                      } else
++                              error(G_("invalid option argument '-fplugin-arg-%s-%s=%s'"), plugin_name, argv[i].key, argv[i].value);
++                      continue;
++              }
++              error(G_("unkown option '-fplugin-arg-%s-%s'"), plugin_name, argv[i].key);
++      }
++      if (!kernexec_instrument_fptr || !kernexec_instrument_retaddr)
++              error(G_("no instrumentation method was selected via '-fplugin-arg-%s-method'"), plugin_name);
++
 +      register_callback(plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL, &kernexec_fptr_pass_info);
 +      register_callback(plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL, &kernexec_retaddr_pass_info);
 +
 +      return 0;
 +}
-diff -urNp linux-3.1.3/tools/gcc/Makefile linux-3.1.3/tools/gcc/Makefile
---- linux-3.1.3/tools/gcc/Makefile     1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/tools/gcc/Makefile     2011-11-16 20:37:08.000000000 -0500
-@@ -0,0 +1,21 @@
-+#CC := gcc
-+#PLUGIN_SOURCE_FILES := pax_plugin.c
-+#PLUGIN_OBJECT_FILES := $(patsubst %.c,%.o,$(PLUGIN_SOURCE_FILES))
-+GCCPLUGINS_DIR := $(shell $(CC) -print-file-name=plugin)
-+#CFLAGS += -I$(GCCPLUGINS_DIR)/include -fPIC -O2 -Wall -W
-+
-+HOST_EXTRACFLAGS += -I$(GCCPLUGINS_DIR)/include
-+
-+hostlibs-y := constify_plugin.so
-+hostlibs-$(CONFIG_PAX_MEMORY_STACKLEAK) += stackleak_plugin.so
-+hostlibs-$(CONFIG_KALLOCSTAT_PLUGIN) += kallocstat_plugin.so
-+hostlibs-$(CONFIG_PAX_KERNEXEC_PLUGIN) += kernexec_plugin.so
-+hostlibs-$(CONFIG_CHECKER_PLUGIN) += checker_plugin.so
-+
-+always := $(hostlibs-y)
-+
-+constify_plugin-objs := constify_plugin.o
-+stackleak_plugin-objs := stackleak_plugin.o
-+kallocstat_plugin-objs := kallocstat_plugin.o
-+kernexec_plugin-objs := kernexec_plugin.o
-+checker_plugin-objs := checker_plugin.o
-diff -urNp linux-3.1.3/tools/gcc/stackleak_plugin.c linux-3.1.3/tools/gcc/stackleak_plugin.c
---- linux-3.1.3/tools/gcc/stackleak_plugin.c   1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.1.3/tools/gcc/stackleak_plugin.c   2011-11-16 18:39:08.000000000 -0500
+diff --git a/tools/gcc/stackleak_plugin.c b/tools/gcc/stackleak_plugin.c
+new file mode 100644
+index 0000000..d44f37c
+--- /dev/null
++++ b/tools/gcc/stackleak_plugin.c
 @@ -0,0 +1,291 @@
 +/*
 + * Copyright 2011 by the PaX Team <pageexec@freemail.hu>
@@ -78220,7 +81173,7 @@ diff -urNp linux-3.1.3/tools/gcc/stackleak_plugin.c linux-3.1.3/tools/gcc/stackl
 +      gsi_insert_after(&gsi, track_stack, GSI_CONTINUE_LINKING);
 +}
 +
-+#if __GNUC__ == 4 && __GNUC_MINOR__ == 5
++#if BUILDING_GCC_VERSION == 4005
 +static bool gimple_call_builtin_p(gimple stmt, enum built_in_function code)
 +{
 +      tree fndecl;
@@ -78242,7 +81195,7 @@ diff -urNp linux-3.1.3/tools/gcc/stackleak_plugin.c linux-3.1.3/tools/gcc/stackl
 +      if (gimple_call_builtin_p(stmt, BUILT_IN_ALLOCA))
 +              return true;
 +
-+#if __GNUC__ > 4 || __GNUC_MINOR__ >= 7
++#if BUILDING_GCC_VERSION >= 4007
 +      if (gimple_call_builtin_p(stmt, BUILT_IN_ALLOCA_WITH_ALIGN))
 +              return true;
 +#endif
@@ -78318,7 +81271,7 @@ diff -urNp linux-3.1.3/tools/gcc/stackleak_plugin.c linux-3.1.3/tools/gcc/stackl
 +//            warning(0, "track_frame_size: %d %ld %d", cfun->calls_alloca, get_frame_size(), track_frame_size);
 +              // 2. delete call
 +              insn = delete_insn_and_edges(insn);
-+#if __GNUC__ > 4 || __GNUC_MINOR__ >= 7
++#if BUILDING_GCC_VERSION >= 4007
 +              if (GET_CODE(insn) == NOTE && NOTE_KIND(insn) == NOTE_INSN_CALL_ARG_LOCATION)
 +                      insn = delete_insn_and_edges(insn);
 +#endif
@@ -78385,21 +81338,23 @@ diff -urNp linux-3.1.3/tools/gcc/stackleak_plugin.c linux-3.1.3/tools/gcc/stackl
 +
 +      return 0;
 +}
-diff -urNp linux-3.1.3/tools/perf/util/include/asm/alternative-asm.h linux-3.1.3/tools/perf/util/include/asm/alternative-asm.h
---- linux-3.1.3/tools/perf/util/include/asm/alternative-asm.h  2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/tools/perf/util/include/asm/alternative-asm.h  2011-11-16 18:39:08.000000000 -0500
+diff --git a/tools/perf/util/include/asm/alternative-asm.h b/tools/perf/util/include/asm/alternative-asm.h
+index 6789d78..4afd019 100644
+--- a/tools/perf/util/include/asm/alternative-asm.h
++++ b/tools/perf/util/include/asm/alternative-asm.h
 @@ -5,4 +5,7 @@
  
  #define altinstruction_entry #
  
-+      .macro pax_force_retaddr rip=0
++      .macro pax_force_retaddr rip=0, reload=0
 +      .endm
 +
  #endif
-diff -urNp linux-3.1.3/usr/gen_init_cpio.c linux-3.1.3/usr/gen_init_cpio.c
---- linux-3.1.3/usr/gen_init_cpio.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/usr/gen_init_cpio.c    2011-11-16 18:39:08.000000000 -0500
-@@ -303,7 +303,7 @@ static int cpio_mkfile(const char *name,
+diff --git a/usr/gen_init_cpio.c b/usr/gen_init_cpio.c
+index af0f22f..9a7d479 100644
+--- a/usr/gen_init_cpio.c
++++ b/usr/gen_init_cpio.c
+@@ -303,7 +303,7 @@ static int cpio_mkfile(const char *name, const char *location,
        int retval;
        int rc = -1;
        int namesize;
@@ -78408,7 +81363,7 @@ diff -urNp linux-3.1.3/usr/gen_init_cpio.c linux-3.1.3/usr/gen_init_cpio.c
  
        mode |= S_IFREG;
  
-@@ -392,9 +392,10 @@ static char *cpio_replace_env(char *new_
+@@ -392,9 +392,10 @@ static char *cpio_replace_env(char *new_location)
                         *env_var = *expanded = '\0';
                         strncat(env_var, start + 2, end - start - 2);
                         strncat(expanded, new_location, start - new_location);
@@ -78421,9 +81376,10 @@ diff -urNp linux-3.1.3/usr/gen_init_cpio.c linux-3.1.3/usr/gen_init_cpio.c
                 } else
                         break;
         }
-diff -urNp linux-3.1.3/virt/kvm/kvm_main.c linux-3.1.3/virt/kvm/kvm_main.c
---- linux-3.1.3/virt/kvm/kvm_main.c    2011-11-11 15:19:27.000000000 -0500
-+++ linux-3.1.3/virt/kvm/kvm_main.c    2011-11-16 18:39:08.000000000 -0500
+diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
+index aefdda3..8e8fbb9 100644
+--- a/virt/kvm/kvm_main.c
++++ b/virt/kvm/kvm_main.c
 @@ -73,7 +73,7 @@ LIST_HEAD(vm_list);
  
  static cpumask_var_t cpus_hardware_enabled;
@@ -78433,7 +81389,7 @@ diff -urNp linux-3.1.3/virt/kvm/kvm_main.c linux-3.1.3/virt/kvm/kvm_main.c
  
  struct kmem_cache *kvm_vcpu_cache;
  EXPORT_SYMBOL_GPL(kvm_vcpu_cache);
-@@ -2266,7 +2266,7 @@ static void hardware_enable_nolock(void 
+@@ -2266,7 +2266,7 @@ static void hardware_enable_nolock(void *junk)
  
        if (r) {
                cpumask_clear_cpu(cpu, cpus_hardware_enabled);
@@ -78455,7 +81411,7 @@ diff -urNp linux-3.1.3/virt/kvm/kvm_main.c linux-3.1.3/virt/kvm/kvm_main.c
                        hardware_disable_all_nolock();
                        r = -EBUSY;
                }
-@@ -2588,7 +2588,7 @@ static void kvm_sched_out(struct preempt
+@@ -2588,7 +2588,7 @@ static void kvm_sched_out(struct preempt_notifier *pn,
        kvm_arch_vcpu_put(vcpu);
  }
  
@@ -78464,7 +81420,7 @@ diff -urNp linux-3.1.3/virt/kvm/kvm_main.c linux-3.1.3/virt/kvm/kvm_main.c
                  struct module *module)
  {
        int r;
-@@ -2651,7 +2651,7 @@ int kvm_init(void *opaque, unsigned vcpu
+@@ -2651,7 +2651,7 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
        if (!vcpu_align)
                vcpu_align = __alignof__(struct kvm_vcpu);
        kvm_vcpu_cache = kmem_cache_create("kvm_vcpu", vcpu_size, vcpu_align,
@@ -78473,7 +81429,7 @@ diff -urNp linux-3.1.3/virt/kvm/kvm_main.c linux-3.1.3/virt/kvm/kvm_main.c
        if (!kvm_vcpu_cache) {
                r = -ENOMEM;
                goto out_free_3;
-@@ -2661,9 +2661,11 @@ int kvm_init(void *opaque, unsigned vcpu
+@@ -2661,9 +2661,11 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
        if (r)
                goto out_free;
  
diff --git a/kernel/patches/linux-3.1-bridge-master-device-stuck-in-no-carrier-state-forever-when-in-user-stp-mode.patch b/kernel/patches/linux-3.1-bridge-master-device-stuck-in-no-carrier-state-forever-when-in-user-stp-mode.patch
new file mode 100644 (file)
index 0000000..2e3d327
--- /dev/null
@@ -0,0 +1,98 @@
+From b03b6dd58cef7d15b7c46a6729b83dd535ef08ab Mon Sep 17 00:00:00 2001
+From: Vitalii Demianets <vitas@nppfactor.kiev.ua>
+Date: Fri, 25 Nov 2011 00:16:37 +0000
+Subject: [PATCH] bridge: master device stuck in no-carrier state forever when
+ in user-stp mode
+
+When in user-stp mode, bridge master do not follow state of its slaves, so
+after the following sequence of events it can stuck forever in no-carrier
+state:
+1) turn stp off
+2) put all slaves down - master device will follow their state and also go in
+no-carrier state
+3) turn stp on with bridge-stp script returning 0 (go to the user-stp mode)
+Now bridge master won't follow slaves' state and will never reach running
+state.
+
+This patch solves the problem by making user-stp and kernel-stp behavior
+similar regarding master following slaves' states.
+
+Signed-off-by: Vitalii Demianets <vitas@nppfactor.kiev.ua>
+Acked-by: Stephen Hemminger <shemminger@vyatta.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ net/bridge/br_netlink.c |    6 ++++++
+ net/bridge/br_stp.c     |   29 ++++++++++++++---------------
+ 2 files changed, 20 insertions(+), 15 deletions(-)
+
+diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
+index e5f9ece3..a1daf82 100644
+--- a/net/bridge/br_netlink.c
++++ b/net/bridge/br_netlink.c
+@@ -18,6 +18,7 @@
+ #include <net/sock.h>
+ #include "br_private.h"
++#include "br_private_stp.h"
+ static inline size_t br_nlmsg_size(void)
+ {
+@@ -188,6 +189,11 @@ static int br_rtm_setlink(struct sk_buff *skb,  struct nlmsghdr *nlh, void *arg)
+       p->state = new_state;
+       br_log_state(p);
++
++      spin_lock_bh(&p->br->lock);
++      br_port_state_selection(p->br);
++      spin_unlock_bh(&p->br->lock);
++
+       br_ifinfo_notify(RTM_NEWLINK, p);
+       return 0;
+diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c
+index ad0a3f7..dd147d7 100644
+--- a/net/bridge/br_stp.c
++++ b/net/bridge/br_stp.c
+@@ -399,25 +399,24 @@ void br_port_state_selection(struct net_bridge *br)
+       struct net_bridge_port *p;
+       unsigned int liveports = 0;
+-      /* Don't change port states if userspace is handling STP */
+-      if (br->stp_enabled == BR_USER_STP)
+-              return;
+-
+       list_for_each_entry(p, &br->port_list, list) {
+               if (p->state == BR_STATE_DISABLED)
+                       continue;
+-              if (p->port_no == br->root_port) {
+-                      p->config_pending = 0;
+-                      p->topology_change_ack = 0;
+-                      br_make_forwarding(p);
+-              } else if (br_is_designated_port(p)) {
+-                      del_timer(&p->message_age_timer);
+-                      br_make_forwarding(p);
+-              } else {
+-                      p->config_pending = 0;
+-                      p->topology_change_ack = 0;
+-                      br_make_blocking(p);
++              /* Don't change port states if userspace is handling STP */
++              if (br->stp_enabled != BR_USER_STP) {
++                      if (p->port_no == br->root_port) {
++                              p->config_pending = 0;
++                              p->topology_change_ack = 0;
++                              br_make_forwarding(p);
++                      } else if (br_is_designated_port(p)) {
++                              del_timer(&p->message_age_timer);
++                              br_make_forwarding(p);
++                      } else {
++                              p->config_pending = 0;
++                              p->topology_change_ack = 0;
++                              br_make_blocking(p);
++                      }
+               }
+               if (p->state == BR_STATE_FORWARDING)
+-- 
+1.7.6.2
+
diff --git a/kernel/patches/linux-3.1-bridge-push-blocking-slaves-to-forwarding-when-turning-stp-off.patch.off b/kernel/patches/linux-3.1-bridge-push-blocking-slaves-to-forwarding-when-turning-stp-off.patch.off
new file mode 100644 (file)
index 0000000..e822b73
--- /dev/null
@@ -0,0 +1,86 @@
+From vitas@nppfactor.kiev.ua Tue Dec 13 10:36:46 2011
+Return-Path: <vitas@nppfactor.kiev.ua>
+Delivered-To: <ms@ipfire.org>
+Received: from mail01.ipfire.org by hedwig.ipfire.org (Dovecot) with LMTP
+ id JdGONK4c504YFwAAVNLeVg for <ms@ipfire.org>; Tue, 13 Dec 2011 10:36:46
+ +0100
+Received: from mx3.cyfra.ua (mx3.cyfra.ua [62.80.160.182]) by
+ mail01.ipfire.org (Postfix) with ESMTPS id B6735115 for
+ <michael.tremer@ipfire.org>; Tue, 13 Dec 2011 10:36:35 +0100 (CET)
+Received: from c.1.173.a246.dynamic.cyfra.net ([62.80.173.1]
+ helo=nppfactor.kiev.ua) by mx3.cyfra.ua with esmtp (Exim 4.63)
+ (envelope-from <vitas@nppfactor.kiev.ua>) id 1RaOmo-0005Hq-Jy; Tue, 13 Dec
+ 2011 11:36:34 +0200
+Received: from [192.168.0.20] (LUX [192.168.0.20]) by nppfactor.kiev.ua
+ (Postfix) with ESMTP id 0F9BA22F128; Tue, 13 Dec 2011 11:36:26 +0200 (EET)
+From: Vitalii Demianets <vitas@nppfactor.kiev.ua>
+Organization: Factor-SPE
+To: netdev@vger.kernel.org
+Subject: [PATCH] bridge: push blocking slaves to forwarding when turning
+ stp off
+Date: Tue, 13 Dec 2011 11:36:25 +0200
+User-Agent: KMail/1.9.10
+Cc: bridge@lists.linux-foundation.org, Stephen Hemminger
+ <shemminger@vyatta.com>, Michael Tremer <michael.tremer@ipfire.org>
+MIME-Version: 1.0
+Content-Type: text/plain; charset="us-ascii"
+Content-Disposition: inline
+Message-Id: <201112131136.25919.vitas@nppfactor.kiev.ua>
+X-Evolution-Source: 1292431680.19116.5@rice-oxley.tremer.info
+Content-Transfer-Encoding: 8bit
+
+If there is a slave in blocking state when stp is turned off, that slave will 
+remain in blocking state for indefinitely long time until interface state 
+changed. We should push all blocking slaves into forwarding state after 
+turning stp off.
+
+Signed-off-by: Vitalii Demianets <vitas@nppfactor.kiev.ua>
+
+---
+ net/bridge/br_stp.c    |    5 ++++-
+ net/bridge/br_stp_if.c |   10 +++++-----
+ 2 files changed, 9 insertions(+), 6 deletions(-)
+
+diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c
+index dd147d7..aed7e21 100644
+--- a/net/bridge/br_stp.c
++++ b/net/bridge/br_stp.c
+@@ -415,7 +415,10 @@ void br_port_state_selection(struct net_bridge *br)
+                       } else {
+                               p->config_pending = 0;
+                               p->topology_change_ack = 0;
+-                              br_make_blocking(p);
++                              if(br->stp_enabled == BR_NO_STP)
++                                      br_make_forwarding(p);
++                              else
++                                      br_make_blocking(p);
+                       }
+               }
+diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c
+index 19308e3..38d8dd7 100644
+--- a/net/bridge/br_stp_if.c
++++ b/net/bridge/br_stp_if.c
+@@ -153,14 +153,14 @@ static void br_stp_stop(struct net_bridge *br)
+       if (br->stp_enabled == BR_USER_STP) {
+               r = call_usermodehelper(BR_STP_PROG, argv, envp, UMH_WAIT_PROC);
+               br_info(br, "userspace STP stopped, return code %d\n", r);
+-
+-              /* To start timers on any ports left in blocking */
+-              spin_lock_bh(&br->lock);
+-              br_port_state_selection(br);
+-              spin_unlock_bh(&br->lock);
+       }
+       br->stp_enabled = BR_NO_STP;
++
++      /* To push in forwarding state any ports left in blocking */
++      spin_lock_bh(&br->lock);
++      br_port_state_selection(br);
++      spin_unlock_bh(&br->lock);
+ }
+ void br_stp_set_enabled(struct net_bridge *br, unsigned long val)
+-- 
+1.7.3.4
+