]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Sat, 27 Oct 2007 17:11:12 +0000 (10:11 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sat, 27 Oct 2007 17:11:12 +0000 (10:11 -0700)
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
  [SPARC32]: Fix build-warning in io-unit.c
  [SPARC64]: Fix BACKOFF_SPIN on non-SMP.
  [SPARC32]: __inline__ --> inline
  [SPARC64]: __inline__ --> inline

42 files changed:
Makefile
arch/i386/.gitignore [deleted file]
arch/x86/Kconfig.cpu [moved from arch/i386/Kconfig.cpu with 100% similarity]
arch/x86/Kconfig.debug [moved from arch/i386/Kconfig.debug with 65% similarity]
arch/x86/Kconfig.i386 [moved from arch/i386/Kconfig with 99% similarity]
arch/x86/Kconfig.x86_64 [moved from arch/x86_64/Kconfig with 99% similarity]
arch/x86/Makefile [new file with mode: 0644]
arch/x86/Makefile_32 [moved from arch/i386/Makefile with 98% similarity]
arch/x86/Makefile_32.cpu [moved from arch/i386/Makefile.cpu with 100% similarity]
arch/x86/Makefile_64 [moved from arch/x86_64/Makefile with 99% similarity]
arch/x86/boot/boot.h
arch/x86/boot/header.S
arch/x86/boot/video-bios.c
arch/x86/boot/video-vesa.c
arch/x86/boot/video.c
arch/x86/configs/i386_defconfig [moved from arch/i386/defconfig with 100% similarity]
arch/x86/configs/x86_64_defconfig [moved from arch/x86_64/defconfig with 100% similarity]
arch/x86_64/.gitignore [deleted file]
arch/x86_64/Kconfig.debug [deleted file]
crypto/tcrypt.c
drivers/crypto/padlock-sha.c
drivers/md/dm-crypt.c
drivers/net/loopback.c
drivers/net/ppp_mppe.c
drivers/scsi/iscsi_tcp.c
fs/ecryptfs/crypto.c
fs/proc/proc_net.c
include/net/net_namespace.h
net/core/dev.c
net/core/dev_mcast.c
net/core/rtnetlink.c
net/ipv4/esp4.c
net/ipv6/esp6.c
net/ipv6/tcp_ipv6.c
net/netlink/af_netlink.c
net/rxrpc/rxkad.c
net/sctp/auth.c
net/sctp/sm_make_chunk.c
net/sunrpc/auth_gss/gss_krb5_crypto.c
net/sunrpc/auth_gss/gss_spkm3_seal.c
net/sunrpc/xdr.c
scripts/kconfig/Makefile

index 2a4729024dfb1e6d1f7552cd0736db1fdb6524a6..8816060cdf4046a62221838d899a604f64dc8526 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -196,6 +196,9 @@ CROSS_COMPILE       ?=
 UTS_MACHINE    := $(ARCH)
 SRCARCH        := $(ARCH)
 
+# for i386 and x86_64 we use SRCARCH equal to x86
+SRCARCH := $(if $(filter x86_64 i386,$(SRCARCH)),x86,$(SRCARCH))
+
 KCONFIG_CONFIG ?= .config
 
 # SHELL used by kbuild
@@ -418,7 +421,7 @@ ifeq ($(config-targets),1)
 # Read arch specific Makefile to set KBUILD_DEFCONFIG as needed.
 # KBUILD_DEFCONFIG may point out an alternative default configuration
 # used for 'make defconfig'
-include $(srctree)/arch/$(ARCH)/Makefile
+include $(srctree)/arch/$(SRCARCH)/Makefile
 export KBUILD_DEFCONFIG
 
 config %config: scripts_basic outputmakefile FORCE
@@ -497,7 +500,7 @@ else
 KBUILD_CFLAGS  += -O2
 endif
 
-include $(srctree)/arch/$(ARCH)/Makefile
+include $(srctree)/arch/$(SRCARCH)/Makefile
 
 ifdef CONFIG_FRAME_POINTER
 KBUILD_CFLAGS  += -fno-omit-frame-pointer -fno-optimize-sibling-calls
diff --git a/arch/i386/.gitignore b/arch/i386/.gitignore
deleted file mode 100644 (file)
index 36ef4c3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-boot
similarity index 100%
rename from arch/i386/Kconfig.cpu
rename to arch/x86/Kconfig.cpu
similarity index 65%
rename from arch/i386/Kconfig.debug
rename to arch/x86/Kconfig.debug
index f03531eacdfbe6936e2a4f8808babcd6f29411e4..970b2defe7df3206a7706a39a98c79279866ae04 100644 (file)
@@ -1,14 +1,14 @@
 menu "Kernel hacking"
 
 config TRACE_IRQFLAGS_SUPPORT
-       bool
-       default y
+       def_bool y
 
 source "lib/Kconfig.debug"
 
 config EARLY_PRINTK
        bool "Early printk" if EMBEDDED && DEBUG_KERNEL
        default y
+       depends on X86_32
        help
          Write kernel log output directly into the VGA buffer or to a serial
          port.
@@ -37,10 +37,12 @@ config DEBUG_STACK_USAGE
 
 comment "Page alloc debug is incompatible with Software Suspend on i386"
        depends on DEBUG_KERNEL && HIBERNATION
+       depends on X86_32
 
 config DEBUG_PAGEALLOC
        bool "Debug page memory allocations"
        depends on DEBUG_KERNEL && !HIBERNATION && !HUGETLBFS
+       depends on X86_32
        help
          Unmap pages from the kernel linear mapping after free_pages().
          This results in a large slowdown, but helps to find certain types
@@ -59,6 +61,7 @@ config DEBUG_RODATA
 config 4KSTACKS
        bool "Use 4Kb for kernel stacks instead of 8Kb"
        depends on DEBUG_KERNEL
+       depends on X86_32
        help
          If you say Y here the kernel will use a 4Kb stacksize for the
          kernel stack attached to each process/thread. This facilitates
@@ -67,22 +70,50 @@ config 4KSTACKS
          will also use IRQ stacks to compensate for the reduced stackspace.
 
 config X86_FIND_SMP_CONFIG
-       bool
+       def_bool y
        depends on X86_LOCAL_APIC || X86_VOYAGER
-       default y
+       depends on X86_32
 
 config X86_MPPARSE
-       bool
+       def_bool y
        depends on X86_LOCAL_APIC && !X86_VISWS
-       default y
+       depends on X86_32
 
 config DOUBLEFAULT
        default y
        bool "Enable doublefault exception handler" if EMBEDDED
+       depends on X86_32
+       help
+         This option allows trapping of rare doublefault exceptions that
+         would otherwise cause a system to silently reboot. Disabling this
+         option saves about 4k and might cause you much additional grey
+         hair.
+
+config IOMMU_DEBUG
+       bool "Enable IOMMU debugging"
+       depends on IOMMU && DEBUG_KERNEL
+       depends on X86_64
        help
-          This option allows trapping of rare doublefault exceptions that
-          would otherwise cause a system to silently reboot. Disabling this
-          option saves about 4k and might cause you much additional grey
-          hair.
+         Force the IOMMU to on even when you have less than 4GB of
+         memory and add debugging code. On overflow always panic. And
+         allow to enable IOMMU leak tracing. Can be disabled at boot
+         time with iommu=noforce. This will also enable scatter gather
+         list merging.  Currently not recommended for production
+         code. When you use it make sure you have a big enough
+         IOMMU/AGP aperture.  Most of the options enabled by this can
+         be set more finegrained using the iommu= command line
+         options. See Documentation/x86_64/boot-options.txt for more
+         details.
+
+config IOMMU_LEAK
+       bool "IOMMU leak tracing"
+       depends on DEBUG_KERNEL
+       depends on IOMMU_DEBUG
+       help
+         Add a simple leak tracer to the IOMMU code. This is useful when you
+         are debugging a buggy device driver that leaks IOMMU mappings.
+
+#config X86_REMOTE_DEBUG
+#      bool "kgdb debugging stub"
 
 endmenu
similarity index 99%
rename from arch/i386/Kconfig
rename to arch/x86/Kconfig.i386
index b4437ce0f9734f801c9c2108be254e12643a78f1..7331efe891a7cb5d5e0b9d4f3cafa8339b1cab00 100644 (file)
@@ -287,7 +287,7 @@ config ES7000_CLUSTERED_APIC
        default y
        depends on SMP && X86_ES7000 && MPENTIUMIII
 
-source "arch/i386/Kconfig.cpu"
+source "arch/x86/Kconfig.cpu"
 
 config HPET_TIMER
        bool "HPET Timer Support"
@@ -1272,7 +1272,7 @@ source "fs/Kconfig"
 
 source "kernel/Kconfig.instrumentation"
 
-source "arch/i386/Kconfig.debug"
+source "arch/x86/Kconfig.debug"
 
 source "security/Kconfig"
 
similarity index 99%
rename from arch/x86_64/Kconfig
rename to arch/x86/Kconfig.x86_64
index 308970aa5382867550f6d1b8af2c94505cd96407..e2542e5b536c2113ea5fd4750534c590656a03d2 100644 (file)
@@ -835,7 +835,7 @@ source fs/Kconfig
 
 source "kernel/Kconfig.instrumentation"
 
-source "arch/x86_64/Kconfig.debug"
+source "arch/x86/Kconfig.debug"
 
 source "security/Kconfig"
 
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
new file mode 100644 (file)
index 0000000..3095973
--- /dev/null
@@ -0,0 +1,16 @@
+# Unified Makefile for i386 and x86_64
+
+# select defconfig based on actual architecture
+KBUILD_DEFCONFIG := $(ARCH)_defconfig
+
+# # No need to remake these files
+$(srctree)/arch/x86/Makefile%: ;
+
+ifeq ($(ARCH),i386)
+        include $(srctree)/arch/x86/Makefile_32
+else
+        include $(srctree)/arch/x86/Makefile_64
+endif
+
+
+
similarity index 98%
rename from arch/i386/Makefile
rename to arch/x86/Makefile_32
index f5b9a37def8bdc7e6bc732518fab5c9dcebae671..346ac07668758f2beb24450d942c039451b01056 100644 (file)
@@ -1,5 +1,5 @@
 #
-# i386/Makefile
+# i386 Makefile
 #
 # This file is included by the global makefile so that you can add your own
 # architecture-specific flags and dependencies. Remember to do have actions
@@ -17,9 +17,6 @@
 # 20050320  Kianusch Sayah Karadji <kianusch@sk-tech.net>
 #           Added support for GEODE CPU
 
-# Fill in SRCARCH
-SRCARCH        := x86
-
 # BITS is used as extension for files which are available in a 32 bit
 # and a 64 bit version to simplify shared Makefiles.
 # e.g.: obj-y += foo_$(BITS).o
@@ -46,7 +43,7 @@ KBUILD_CFLAGS += -pipe -msoft-float -mregparm=3 -freg-struct-return
 KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2)
 
 # CPU-specific tuning. Anything which can be shared with UML should go here.
-include $(srctree)/arch/i386/Makefile.cpu
+include $(srctree)/arch/x86/Makefile_32.cpu
 
 # temporary until string.h is fixed
 cflags-y += -ffreestanding
similarity index 99%
rename from arch/x86_64/Makefile
rename to arch/x86/Makefile_64
index 20eb69bd5a6da74a168629f286448905cfc022e4..57e714a47af7aff0e78512860c9a004db49c1d5f 100644 (file)
@@ -1,5 +1,5 @@
 #
-# x86_64/Makefile
+# x86_64 Makefile
 #
 # This file is included by the global makefile so that you can add your own
 # architecture-specific flags and dependencies. Remember to do have actions
@@ -21,9 +21,6 @@
 #
 # $Id: Makefile,v 1.31 2002/03/22 15:56:07 ak Exp $
 
-# Fill in SRCARCH
-SRCARCH        := x86
-
 # BITS is used as extension for files which are available in a 32 bit
 # and a 64 bit version to simplify shared Makefiles.
 # e.g.: obj-y += foo_$(BITS).o
index 5f9a2e72a731f48bc7b0565b89aebfc6e956c6d1..d2b5adf46512f20feb7fc27a14d39bc37c10e3e4 100644 (file)
@@ -17,6 +17,8 @@
 #ifndef BOOT_BOOT_H
 #define BOOT_BOOT_H
 
+#define STACK_SIZE     512     /* Minimum number of bytes for stack */
+
 #ifndef __ASSEMBLY__
 
 #include <stdarg.h>
@@ -198,8 +200,6 @@ static inline int isdigit(int ch)
 }
 
 /* Heap -- available for dynamic lists. */
-#define STACK_SIZE     512     /* Minimum number of bytes for stack */
-
 extern char _end[];
 extern char *HEAP;
 extern char *heap_end;
@@ -216,9 +216,9 @@ static inline char *__get_heap(size_t s, size_t a, size_t n)
 #define GET_HEAP(type, n) \
        ((type *)__get_heap(sizeof(type),__alignof__(type),(n)))
 
-static inline int heap_free(void)
+static inline bool heap_free(size_t n)
 {
-       return heap_end-HEAP;
+       return (int)(heap_end-HEAP) >= (int)n;
 }
 
 /* copy.S */
index 8353c81c41c02865384e227b24e4af8e0879bcee..6ef5a060fa11085df5be8d4616acd5541b53d5d2 100644 (file)
@@ -173,7 +173,8 @@ ramdisk_size:       .long   0               # its size in bytes
 bootsect_kludge:
                .long   0               # obsolete
 
-heap_end_ptr:  .word   _end+1024       # (Header version 0x0201 or later)
+heap_end_ptr:  .word   _end+STACK_SIZE-512
+                                       # (Header version 0x0201 or later)
                                        # space from here (exclusive) down to
                                        # end of setup code can be used by setup
                                        # for local heap purposes.
@@ -230,28 +231,53 @@ start_of_setup:
        int     $0x13
 #endif
 
-# We will have entered with %cs = %ds+0x20, normalize %cs so
-# it is on par with the other segments.
-       pushw   %ds
-       pushw   $setup2
-       lretw
-
-setup2:
 # Force %es = %ds
        movw    %ds, %ax
        movw    %ax, %es
        cld
 
-# Stack paranoia: align the stack and make sure it is good
-# for both 16- and 32-bit references.  In particular, if we
-# were meant to have been using the full 16-bit segment, the
-# caller might have set %sp to zero, which breaks %esp-based
-# references.
-       andw    $~3, %sp        # dword align (might as well...)
-       jnz     1f
-       movw    $0xfffc, %sp    # Make sure we're not zero
-1:     movzwl  %sp, %esp       # Clear upper half of %esp
-       sti
+# Apparently some ancient versions of LILO invoked the kernel
+# with %ss != %ds, which happened to work by accident for the
+# old code.  If the CAN_USE_HEAP flag is set in loadflags, or
+# %ss != %ds, then adjust the stack pointer.
+
+       # Smallest possible stack we can tolerate
+       movw    $(_end+STACK_SIZE), %cx
+
+       movw    heap_end_ptr, %dx
+       addw    $512, %dx
+       jnc     1f
+       xorw    %dx, %dx        # Wraparound - whole segment available
+1:     testb   $CAN_USE_HEAP, loadflags
+       jnz     2f
+
+       # No CAN_USE_HEAP
+       movw    %ss, %dx
+       cmpw    %ax, %dx        # %ds == %ss?
+       movw    %sp, %dx
+       # If so, assume %sp is reasonably set, otherwise use
+       # the smallest possible stack.
+       jne     4f              # -> Smallest possible stack...
+
+       # Make sure the stack is at least minimum size.  Take a value
+       # of zero to mean "full segment."
+2:
+       andw    $~3, %dx        # dword align (might as well...)
+       jnz     3f
+       movw    $0xfffc, %dx    # Make sure we're not zero
+3:     cmpw    %cx, %dx
+       jnb     5f
+4:     movw    %cx, %dx        # Minimum value we can possibly use
+5:     movw    %ax, %ss
+       movzwl  %dx, %esp       # Clear upper half of %esp
+       sti                     # Now we should have a working stack
+
+# We will have entered with %cs = %ds+0x20, normalize %cs so
+# it is on par with the other segments.
+       pushw   %ds
+       pushw   $6f
+       lretw
+6:
 
 # Check signature at end of setup
        cmpl    $0x5a5aaa55, setup_sig
index 68e65d95cdfd8627a69df2ed1ec7cf33cd392ca4..ed0672a818709b86d8c6ebd6416269434934091e 100644 (file)
@@ -79,7 +79,7 @@ static int bios_probe(void)
        video_bios.modes = GET_HEAP(struct mode_info, 0);
 
        for (mode = 0x14; mode <= 0x7f; mode++) {
-               if (heap_free() < sizeof(struct mode_info))
+               if (!heap_free(sizeof(struct mode_info)))
                        break;
 
                if (mode_defined(VIDEO_FIRST_BIOS+mode))
index 19219071071023e631518e102c4dbcc7481dea17..4716b9a963575aa8d0eedf703feaa7997ada608e 100644 (file)
@@ -57,7 +57,7 @@ static int vesa_probe(void)
        while ((mode = rdfs16(mode_ptr)) != 0xffff) {
                mode_ptr += 2;
 
-               if (heap_free() < sizeof(struct mode_info))
+               if (!heap_free(sizeof(struct mode_info)))
                        break;  /* Heap full, can't save mode info */
 
                if (mode & ~0x1ff)
index e4ba897bf9a3748c89e442141887ea9e0dbba721..ad9712f01739748c0d0d7d727ac34e20401de26f 100644 (file)
@@ -371,7 +371,7 @@ static void save_screen(void)
        saved.curx = boot_params.screen_info.orig_x;
        saved.cury = boot_params.screen_info.orig_y;
 
-       if (heap_free() < saved.x*saved.y*sizeof(u16)+512)
+       if (!heap_free(saved.x*saved.y*sizeof(u16)+512))
                return;         /* Not enough heap to save the screen */
 
        saved.data = GET_HEAP(u16, saved.x*saved.y);
diff --git a/arch/x86_64/.gitignore b/arch/x86_64/.gitignore
deleted file mode 100644 (file)
index 36ef4c3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-boot
diff --git a/arch/x86_64/Kconfig.debug b/arch/x86_64/Kconfig.debug
deleted file mode 100644 (file)
index 775d211..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-menu "Kernel hacking"
-
-config TRACE_IRQFLAGS_SUPPORT
-       bool
-       default y
-
-source "lib/Kconfig.debug"
-
-config DEBUG_RODATA
-       bool "Write protect kernel read-only data structures"
-       depends on DEBUG_KERNEL
-       help
-        Mark the kernel read-only data as write-protected in the pagetables,
-        in order to catch accidental (and incorrect) writes to such const data.
-        This option may have a slight performance impact because a portion
-        of the kernel code won't be covered by a 2MB TLB anymore.
-        If in doubt, say "N".
-
-config IOMMU_DEBUG
-       depends on IOMMU && DEBUG_KERNEL
-       bool "Enable IOMMU debugging"
-       help
-         Force the IOMMU to on even when you have less than 4GB of
-        memory and add debugging code. On overflow always panic. And
-        allow to enable IOMMU leak tracing. Can be disabled at boot
-        time with iommu=noforce. This will also enable scatter gather
-        list merging.  Currently not recommended for production
-        code. When you use it make sure you have a big enough
-        IOMMU/AGP aperture.  Most of the options enabled by this can
-        be set more finegrained using the iommu= command line
-        options. See Documentation/x86_64/boot-options.txt for more
-        details.
-
-config IOMMU_LEAK
-       bool "IOMMU leak tracing"
-       depends on DEBUG_KERNEL
-       depends on IOMMU_DEBUG
-       help
-         Add a simple leak tracer to the IOMMU code. This is useful when you
-        are debugging a buggy device driver that leaks IOMMU mappings.
-
-config DEBUG_STACKOVERFLOW
-        bool "Check for stack overflows"
-        depends on DEBUG_KERNEL
-        help
-         This option will cause messages to be printed if free stack space
-         drops below a certain limit.
-
-config DEBUG_STACK_USAGE
-        bool "Stack utilization instrumentation"
-        depends on DEBUG_KERNEL
-        help
-         Enables the display of the minimum amount of free stack which each
-         task has ever had available in the sysrq-T and sysrq-P debug output.
-
-         This option will slow down process creation somewhat.
-
-#config X86_REMOTE_DEBUG
-#       bool "kgdb debugging stub"
-
-endmenu
index c457bdb2a42b666f793122f759c445b11c6e0d3e..24141fb6f5cba0639ae25ccca4d42a79bcd4d032 100644 (file)
@@ -572,9 +572,11 @@ static int test_hash_jiffies_digest(struct hash_desc *desc, char *p, int blen,
        int bcount;
        int ret;
 
+       sg_init_table(sg, 1);
+
        for (start = jiffies, end = start + sec * HZ, bcount = 0;
             time_before(jiffies, end); bcount++) {
-               sg_init_one(sg, p, blen);
+               sg_set_buf(sg, p, blen);
                ret = crypto_hash_digest(desc, sg, blen, out);
                if (ret)
                        return ret;
@@ -597,13 +599,15 @@ static int test_hash_jiffies(struct hash_desc *desc, char *p, int blen,
        if (plen == blen)
                return test_hash_jiffies_digest(desc, p, blen, out, sec);
 
+       sg_init_table(sg, 1);
+
        for (start = jiffies, end = start + sec * HZ, bcount = 0;
             time_before(jiffies, end); bcount++) {
                ret = crypto_hash_init(desc);
                if (ret)
                        return ret;
                for (pcount = 0; pcount < blen; pcount += plen) {
-                       sg_init_one(sg, p + pcount, plen);
+                       sg_set_buf(sg, p + pcount, plen);
                        ret = crypto_hash_update(desc, sg, plen);
                        if (ret)
                                return ret;
@@ -628,12 +632,14 @@ static int test_hash_cycles_digest(struct hash_desc *desc, char *p, int blen,
        int i;
        int ret;
 
+       sg_init_table(sg, 1);
+
        local_bh_disable();
        local_irq_disable();
 
        /* Warm-up run. */
        for (i = 0; i < 4; i++) {
-               sg_init_one(sg, p, blen);
+               sg_set_buf(sg, p, blen);
                ret = crypto_hash_digest(desc, sg, blen, out);
                if (ret)
                        goto out;
@@ -645,7 +651,7 @@ static int test_hash_cycles_digest(struct hash_desc *desc, char *p, int blen,
 
                start = get_cycles();
 
-               sg_init_one(sg, p, blen);
+               sg_set_buf(sg, p, blen);
                ret = crypto_hash_digest(desc, sg, blen, out);
                if (ret)
                        goto out;
@@ -679,6 +685,8 @@ static int test_hash_cycles(struct hash_desc *desc, char *p, int blen,
        if (plen == blen)
                return test_hash_cycles_digest(desc, p, blen, out);
 
+       sg_init_table(sg, 1);
+
        local_bh_disable();
        local_irq_disable();
 
@@ -688,7 +696,7 @@ static int test_hash_cycles(struct hash_desc *desc, char *p, int blen,
                if (ret)
                        goto out;
                for (pcount = 0; pcount < blen; pcount += plen) {
-                       sg_init_one(sg, p + pcount, plen);
+                       sg_set_buf(sg, p + pcount, plen);
                        ret = crypto_hash_update(desc, sg, plen);
                        if (ret)
                                goto out;
@@ -708,7 +716,7 @@ static int test_hash_cycles(struct hash_desc *desc, char *p, int blen,
                if (ret)
                        goto out;
                for (pcount = 0; pcount < blen; pcount += plen) {
-                       sg_init_one(sg, p + pcount, plen);
+                       sg_set_buf(sg, p + pcount, plen);
                        ret = crypto_hash_update(desc, sg, plen);
                        if (ret)
                                goto out;
index 4e8de162fc12e8506bd932794f94ad383d3513b1..c666b4e0933e422442e57abd833db4641c4c6949 100644 (file)
@@ -55,7 +55,7 @@ static void padlock_sha_bypass(struct crypto_tfm *tfm)
        if (ctx(tfm)->data && ctx(tfm)->used) {
                struct scatterlist sg;
 
-               sg_set_buf(&sg, ctx(tfm)->data, ctx(tfm)->used);
+               sg_init_one(&sg, ctx(tfm)->data, ctx(tfm)->used);
                crypto_hash_update(&ctx(tfm)->fallback, &sg, sg.length);
        }
 
@@ -79,7 +79,7 @@ static void padlock_sha_update(struct crypto_tfm *tfm,
 
        if (unlikely(ctx(tfm)->bypass)) {
                struct scatterlist sg;
-               sg_set_buf(&sg, (uint8_t *)data, length);
+               sg_init_one(&sg, (uint8_t *)data, length);
                crypto_hash_update(&ctx(tfm)->fallback, &sg, length);
                return;
        }
index 1c159ac68c98f2372ffebe58f363fa1ff6e63a80..28c6ae095c560d9377aa5e182e8b8af38de11117 100644 (file)
@@ -168,7 +168,7 @@ static int crypt_iv_essiv_ctr(struct crypt_config *cc, struct dm_target *ti,
                return -ENOMEM;
        }
 
-       sg_set_buf(&sg, cc->key, cc->key_size);
+       sg_init_one(&sg, cc->key, cc->key_size);
        desc.tfm = hash_tfm;
        desc.flags = CRYPTO_TFM_REQ_MAY_SLEEP;
        err = crypto_hash_digest(&desc, &sg, cc->key_size, salt);
index 662b8d16803ce7fec85f59af645b60aabee75c41..45f30a2974b8f49405ec5ab07e4e605c6be60cb8 100644 (file)
@@ -284,7 +284,7 @@ static __net_exit void loopback_net_exit(struct net *net)
        unregister_netdev(dev);
 }
 
-static struct pernet_operations __net_initdata loopback_net_ops = {
+static struct pernet_operations loopback_net_ops = {
        .init = loopback_net_init,
        .exit = loopback_net_exit,
 };
index bcb0885011c8b1b410e335fa1fd0e8afe0877166..b35d79449500a50bafd8cbdb39f01130114e152a 100644 (file)
@@ -68,7 +68,7 @@ MODULE_VERSION("1.0.2");
 static unsigned int
 setup_sg(struct scatterlist *sg, const void *address, unsigned int length)
 {
-       sg_init_one(sg, address, length);
+       sg_set_buf(sg, address, length);
        return length;
 }
 
@@ -140,6 +140,8 @@ static void get_new_key_from_sha(struct ppp_mppe_state * state)
        struct scatterlist sg[4];
        unsigned int nbytes;
 
+       sg_init_table(sg, 4);
+
        nbytes = setup_sg(&sg[0], state->master_key, state->keylen);
        nbytes += setup_sg(&sg[1], sha_pad->sha_pad1,
                           sizeof(sha_pad->sha_pad1));
@@ -166,6 +168,8 @@ static void mppe_rekey(struct ppp_mppe_state * state, int initial_key)
        if (!initial_key) {
                crypto_blkcipher_setkey(state->arc4, state->sha1_digest,
                                        state->keylen);
+               sg_init_table(sg_in, 1);
+               sg_init_table(sg_out, 1);
                setup_sg(sg_in, state->sha1_digest, state->keylen);
                setup_sg(sg_out, state->session_key, state->keylen);
                if (crypto_blkcipher_encrypt(&desc, sg_out, sg_in,
@@ -421,6 +425,8 @@ mppe_compress(void *arg, unsigned char *ibuf, unsigned char *obuf,
        isize -= 2;
 
        /* Encrypt packet */
+       sg_init_table(sg_in, 1);
+       sg_init_table(sg_out, 1);
        setup_sg(sg_in, ibuf, isize);
        setup_sg(sg_out, obuf, osize);
        if (crypto_blkcipher_encrypt(&desc, sg_out, sg_in, isize) != 0) {
@@ -608,6 +614,8 @@ mppe_decompress(void *arg, unsigned char *ibuf, int isize, unsigned char *obuf,
         * Decrypt the first byte in order to check if it is
         * a compressed or uncompressed protocol field.
         */
+       sg_init_table(sg_in, 1);
+       sg_init_table(sg_out, 1);
        setup_sg(sg_in, ibuf, 1);
        setup_sg(sg_out, obuf, 1);
        if (crypto_blkcipher_decrypt(&desc, sg_out, sg_in, 1) != 0) {
index 097a136398cbd771d07cd98df22f813c63c93c52..4bcf916c21a7e0c50ef853bbe0cec582916f49c4 100644 (file)
@@ -674,9 +674,8 @@ partial_sg_digest_update(struct hash_desc *desc, struct scatterlist *sg,
 {
        struct scatterlist temp;
 
-       memcpy(&temp, sg, sizeof(struct scatterlist));
-       temp.offset = offset;
-       temp.length = length;
+       sg_init_table(&temp, 1);
+       sg_set_page(&temp, sg_page(sg), length, offset);
        crypto_hash_update(desc, &temp, length);
 }
 
index 7a472b129997e0113a0c3cec99a2a0d8743c3bbc..9d70289f7df328022e050bbcb3723923524c562f 100644 (file)
@@ -279,6 +279,8 @@ int virt_to_scatterlist(const void *addr, int size, struct scatterlist *sg,
        int offset;
        int remainder_of_page;
 
+       sg_init_table(sg, sg_size);
+
        while (size > 0 && i < sg_size) {
                pg = virt_to_page(addr);
                offset = offset_in_page(addr);
index 4edaad0d995ffa1f84af4b2a3856e14db622d313..749def054a341b62ff8f542a4bfa21bf5e93821a 100644 (file)
@@ -185,7 +185,7 @@ static __net_exit void proc_net_ns_exit(struct net *net)
        kfree(net->proc_net_root);
 }
 
-static struct pernet_operations __net_initdata proc_net_ns_ops = {
+static struct pernet_operations proc_net_ns_ops = {
        .init = proc_net_ns_init,
        .exit = proc_net_ns_exit,
 };
index 93aa87d328040b71877a31ee400e7adebd3e2073..5279466606d2bb33625431c4d6f000ddbbbd9c29 100644 (file)
@@ -102,11 +102,9 @@ static inline void release_net(struct net *net)
 #ifdef CONFIG_NET_NS
 #define __net_init
 #define __net_exit
-#define __net_initdata
 #else
 #define __net_init     __init
 #define __net_exit     __exit_refok
-#define __net_initdata __initdata
 #endif
 
 struct pernet_operations {
index ddfef3b45babd9486b00752c696c3b96addb653d..853c8b575f1d51d2300433073d8e1795b85806a5 100644 (file)
@@ -2668,7 +2668,7 @@ static void __net_exit dev_proc_net_exit(struct net *net)
        proc_net_remove(net, "dev");
 }
 
-static struct pernet_operations __net_initdata dev_proc_ops = {
+static struct pernet_operations dev_proc_ops = {
        .init = dev_proc_net_init,
        .exit = dev_proc_net_exit,
 };
@@ -4328,7 +4328,7 @@ static void __net_exit netdev_exit(struct net *net)
        kfree(net->dev_index_head);
 }
 
-static struct pernet_operations __net_initdata netdev_net_ops = {
+static struct pernet_operations  netdev_net_ops = {
        .init = netdev_init,
        .exit = netdev_exit,
 };
@@ -4359,7 +4359,7 @@ static void __net_exit default_device_exit(struct net *net)
        rtnl_unlock();
 }
 
-static struct pernet_operations __net_initdata default_device_ops = {
+static struct pernet_operations  default_device_ops = {
        .exit = default_device_exit,
 };
 
index 15241cf48af8a8b835a502978e1777c6c2d8ab12..ae354057d84cf5101b89126e343ce3903eed55d2 100644 (file)
@@ -285,7 +285,7 @@ static void __net_exit dev_mc_net_exit(struct net *net)
        proc_net_remove(net, "dev_mcast");
 }
 
-static struct pernet_operations __net_initdata dev_mc_net_ops = {
+static struct pernet_operations dev_mc_net_ops = {
        .init = dev_mc_net_init,
        .exit = dev_mc_net_exit,
 };
index 4a2640d3826166d98b066d626f9427e5daacc256..e1ba26fb4bf28052fd0150f08ed5d6eaa057fa19 100644 (file)
@@ -742,7 +742,7 @@ static struct net *get_net_ns_by_pid(pid_t pid)
        /* Lookup the network namespace */
        net = ERR_PTR(-ESRCH);
        rcu_read_lock();
-       tsk = find_task_by_pid(pid);
+       tsk = find_task_by_vpid(pid);
        if (tsk) {
                struct nsproxy *nsproxy;
                nsproxy = task_nsproxy(tsk);
index ba9840195cf259d8f0a8cd406d8bf68cab1d9263..cad4278025adc83b1b4430c949a3c65fa36f8f9c 100644 (file)
@@ -3,7 +3,7 @@
 #include <net/ip.h>
 #include <net/xfrm.h>
 #include <net/esp.h>
-#include <asm/scatterlist.h>
+#include <linux/scatterlist.h>
 #include <linux/crypto.h>
 #include <linux/kernel.h>
 #include <linux/pfkeyv2.h>
@@ -111,7 +111,9 @@ static int esp_output(struct xfrm_state *x, struct sk_buff *skb)
                                goto unlock;
                }
                sg_init_table(sg, nfrags);
-               skb_to_sgvec(skb, sg, esph->enc_data+esp->conf.ivlen-skb->data, clen);
+               sg_mark_end(sg, skb_to_sgvec(skb, sg, esph->enc_data +
+                                                     esp->conf.ivlen -
+                                                     skb->data, clen));
                err = crypto_blkcipher_encrypt(&desc, sg, sg, clen);
                if (unlikely(sg != &esp->sgbuf[0]))
                        kfree(sg);
@@ -203,7 +205,8 @@ static int esp_input(struct xfrm_state *x, struct sk_buff *skb)
                        goto out;
        }
        sg_init_table(sg, nfrags);
-       skb_to_sgvec(skb, sg, sizeof(*esph) + esp->conf.ivlen, elen);
+       sg_mark_end(sg, skb_to_sgvec(skb, sg, sizeof(*esph) + esp->conf.ivlen,
+                                    elen));
        err = crypto_blkcipher_decrypt(&desc, sg, sg, elen);
        if (unlikely(sg != &esp->sgbuf[0]))
                kfree(sg);
index f67d51a4e56d319b1f7588956b0dd48e080eb06b..ab17b5e62355f144770d005ede345912f04c186c 100644 (file)
@@ -29,7 +29,7 @@
 #include <net/ip.h>
 #include <net/xfrm.h>
 #include <net/esp.h>
-#include <asm/scatterlist.h>
+#include <linux/scatterlist.h>
 #include <linux/crypto.h>
 #include <linux/kernel.h>
 #include <linux/pfkeyv2.h>
@@ -110,7 +110,9 @@ static int esp6_output(struct xfrm_state *x, struct sk_buff *skb)
                                goto unlock;
                }
                sg_init_table(sg, nfrags);
-               skb_to_sgvec(skb, sg, esph->enc_data+esp->conf.ivlen-skb->data, clen);
+               sg_mark_end(sg, skb_to_sgvec(skb, sg, esph->enc_data +
+                                                     esp->conf.ivlen -
+                                                     skb->data, clen));
                err = crypto_blkcipher_encrypt(&desc, sg, sg, clen);
                if (unlikely(sg != &esp->sgbuf[0]))
                        kfree(sg);
@@ -207,7 +209,9 @@ static int esp6_input(struct xfrm_state *x, struct sk_buff *skb)
                        }
                }
                sg_init_table(sg, nfrags);
-               skb_to_sgvec(skb, sg, sizeof(*esph) + esp->conf.ivlen, elen);
+               sg_mark_end(sg, skb_to_sgvec(skb, sg,
+                                            sizeof(*esph) + esp->conf.ivlen,
+                                            elen));
                ret = crypto_blkcipher_decrypt(&desc, sg, sg, elen);
                if (unlikely(sg != &esp->sgbuf[0]))
                        kfree(sg);
index 06fa4baddf0527d224b78b33e9971d1336ea894e..85208026278b5a217123656a8c90e2ed25c93d46 100644 (file)
@@ -59,6 +59,7 @@
 #include <net/snmp.h>
 #include <net/dsfield.h>
 #include <net/timewait_sock.h>
+#include <net/netdma.h>
 
 #include <asm/uaccess.h>
 
index 325272925d0f32ba2e5f60058ae71197f6d4a1be..4f994c0fb3f80dcc4542a4e7a17475637601b690 100644 (file)
@@ -1888,7 +1888,7 @@ static void __net_exit netlink_net_exit(struct net *net)
 #endif
 }
 
-static struct pernet_operations __net_initdata netlink_net_ops = {
+static struct pernet_operations netlink_net_ops = {
        .init = netlink_net_init,
        .exit = netlink_net_exit,
 };
index ac3cabdca78cb9e2ec3285cf3d6084315c336015..eebefb6ef1392fef2c9b47007d141c299ee82b38 100644 (file)
@@ -135,9 +135,8 @@ static void rxkad_prime_packet_security(struct rxrpc_connection *conn)
        tmpbuf.x[2] = 0;
        tmpbuf.x[3] = htonl(conn->security_ix);
 
-       memset(sg, 0, sizeof(sg));
-       sg_set_buf(&sg[0], &tmpbuf, sizeof(tmpbuf));
-       sg_set_buf(&sg[1], &tmpbuf, sizeof(tmpbuf));
+       sg_init_one(&sg[0], &tmpbuf, sizeof(tmpbuf));
+       sg_init_one(&sg[1], &tmpbuf, sizeof(tmpbuf));
        crypto_blkcipher_encrypt_iv(&desc, &sg[0], &sg[1], sizeof(tmpbuf));
 
        memcpy(&conn->csum_iv, &tmpbuf.x[2], sizeof(conn->csum_iv));
@@ -180,9 +179,8 @@ static int rxkad_secure_packet_auth(const struct rxrpc_call *call,
        desc.info = iv.x;
        desc.flags = 0;
 
-       memset(sg, 0, sizeof(sg));
-       sg_set_buf(&sg[0], &tmpbuf, sizeof(tmpbuf));
-       sg_set_buf(&sg[1], &tmpbuf, sizeof(tmpbuf));
+       sg_init_one(&sg[0], &tmpbuf, sizeof(tmpbuf));
+       sg_init_one(&sg[1], &tmpbuf, sizeof(tmpbuf));
        crypto_blkcipher_encrypt_iv(&desc, &sg[0], &sg[1], sizeof(tmpbuf));
 
        memcpy(sechdr, &tmpbuf, sizeof(tmpbuf));
@@ -227,9 +225,8 @@ static int rxkad_secure_packet_encrypt(const struct rxrpc_call *call,
        desc.info = iv.x;
        desc.flags = 0;
 
-       memset(sg, 0, sizeof(sg[0]) * 2);
-       sg_set_buf(&sg[0], sechdr, sizeof(rxkhdr));
-       sg_set_buf(&sg[1], &rxkhdr, sizeof(rxkhdr));
+       sg_init_one(&sg[0], sechdr, sizeof(rxkhdr));
+       sg_init_one(&sg[1], &rxkhdr, sizeof(rxkhdr));
        crypto_blkcipher_encrypt_iv(&desc, &sg[0], &sg[1], sizeof(rxkhdr));
 
        /* we want to encrypt the skbuff in-place */
@@ -240,7 +237,7 @@ static int rxkad_secure_packet_encrypt(const struct rxrpc_call *call,
        len = data_size + call->conn->size_align - 1;
        len &= ~(call->conn->size_align - 1);
 
-       skb_to_sgvec(skb, sg, 0, len);
+       sg_init_table(sg, skb_to_sgvec(skb, sg, 0, len));
        crypto_blkcipher_encrypt_iv(&desc, sg, sg, len);
 
        _leave(" = 0");
@@ -290,9 +287,8 @@ static int rxkad_secure_packet(const struct rxrpc_call *call,
        tmpbuf.x[0] = sp->hdr.callNumber;
        tmpbuf.x[1] = x;
 
-       memset(&sg, 0, sizeof(sg));
-       sg_set_buf(&sg[0], &tmpbuf, sizeof(tmpbuf));
-       sg_set_buf(&sg[1], &tmpbuf, sizeof(tmpbuf));
+       sg_init_one(&sg[0], &tmpbuf, sizeof(tmpbuf));
+       sg_init_one(&sg[1], &tmpbuf, sizeof(tmpbuf));
        crypto_blkcipher_encrypt_iv(&desc, &sg[0], &sg[1], sizeof(tmpbuf));
 
        x = ntohl(tmpbuf.x[1]);
@@ -332,20 +328,23 @@ static int rxkad_verify_packet_auth(const struct rxrpc_call *call,
        struct rxrpc_skb_priv *sp;
        struct blkcipher_desc desc;
        struct rxrpc_crypt iv;
-       struct scatterlist sg[2];
+       struct scatterlist sg[16];
        struct sk_buff *trailer;
        u32 data_size, buf;
        u16 check;
+       int nsg;
 
        _enter("");
 
        sp = rxrpc_skb(skb);
 
        /* we want to decrypt the skbuff in-place */
-       if (skb_cow_data(skb, 0, &trailer) < 0)
+       nsg = skb_cow_data(skb, 0, &trailer);
+       if (nsg < 0 || nsg > 16)
                goto nomem;
 
-       skb_to_sgvec(skb, sg, 0, 8);
+       sg_init_table(sg, nsg);
+       sg_mark_end(sg, skb_to_sgvec(skb, sg, 0, 8));
 
        /* start the decryption afresh */
        memset(&iv, 0, sizeof(iv));
@@ -426,7 +425,8 @@ static int rxkad_verify_packet_encrypt(const struct rxrpc_call *call,
                        goto nomem;
        }
 
-       skb_to_sgvec(skb, sg, 0, skb->len);
+       sg_init_table(sg, nsg);
+       sg_mark_end(sg, skb_to_sgvec(skb, sg, 0, skb->len));
 
        /* decrypt from the session key */
        payload = call->conn->key->payload.data;
@@ -521,9 +521,8 @@ static int rxkad_verify_packet(const struct rxrpc_call *call,
        tmpbuf.x[0] = call->call_id;
        tmpbuf.x[1] = x;
 
-       memset(&sg, 0, sizeof(sg));
-       sg_set_buf(&sg[0], &tmpbuf, sizeof(tmpbuf));
-       sg_set_buf(&sg[1], &tmpbuf, sizeof(tmpbuf));
+       sg_init_one(&sg[0], &tmpbuf, sizeof(tmpbuf));
+       sg_init_one(&sg[1], &tmpbuf, sizeof(tmpbuf));
        crypto_blkcipher_encrypt_iv(&desc, &sg[0], &sg[1], sizeof(tmpbuf));
 
        x = ntohl(tmpbuf.x[1]);
@@ -690,16 +689,20 @@ static void rxkad_calc_response_checksum(struct rxkad_response *response)
 static void rxkad_sg_set_buf2(struct scatterlist sg[2],
                              void *buf, size_t buflen)
 {
+       int nsg = 1;
 
-       memset(sg, 0, sizeof(sg));
+       sg_init_table(sg, 2);
 
        sg_set_buf(&sg[0], buf, buflen);
        if (sg[0].offset + buflen > PAGE_SIZE) {
                /* the buffer was split over two pages */
                sg[0].length = PAGE_SIZE - sg[0].offset;
                sg_set_buf(&sg[1], buf + sg[0].length, buflen - sg[0].length);
+               nsg++;
        }
 
+       sg_mark_end(sg, nsg);
+
        ASSERTCMP(sg[0].length + sg[1].length, ==, buflen);
 }
 
@@ -712,7 +715,7 @@ static void rxkad_encrypt_response(struct rxrpc_connection *conn,
 {
        struct blkcipher_desc desc;
        struct rxrpc_crypt iv;
-       struct scatterlist ssg[2], dsg[2];
+       struct scatterlist sg[2];
 
        /* continue encrypting from where we left off */
        memcpy(&iv, s2->session_key, sizeof(iv));
@@ -720,9 +723,8 @@ static void rxkad_encrypt_response(struct rxrpc_connection *conn,
        desc.info = iv.x;
        desc.flags = 0;
 
-       rxkad_sg_set_buf2(ssg, &resp->encrypted, sizeof(resp->encrypted));
-       memcpy(dsg, ssg, sizeof(dsg));
-       crypto_blkcipher_encrypt_iv(&desc, dsg, ssg, sizeof(resp->encrypted));
+       rxkad_sg_set_buf2(sg, &resp->encrypted, sizeof(resp->encrypted));
+       crypto_blkcipher_encrypt_iv(&desc, sg, sg, sizeof(resp->encrypted));
 }
 
 /*
@@ -817,7 +819,7 @@ static int rxkad_decrypt_ticket(struct rxrpc_connection *conn,
 {
        struct blkcipher_desc desc;
        struct rxrpc_crypt iv, key;
-       struct scatterlist ssg[1], dsg[1];
+       struct scatterlist sg[1];
        struct in_addr addr;
        unsigned life;
        time_t issue, now;
@@ -850,9 +852,8 @@ static int rxkad_decrypt_ticket(struct rxrpc_connection *conn,
        desc.info = iv.x;
        desc.flags = 0;
 
-       sg_init_one(&ssg[0], ticket, ticket_len);
-       memcpy(dsg, ssg, sizeof(dsg));
-       crypto_blkcipher_decrypt_iv(&desc, dsg, ssg, ticket_len);
+       sg_init_one(&sg[0], ticket, ticket_len);
+       crypto_blkcipher_decrypt_iv(&desc, sg, sg, ticket_len);
 
        p = ticket;
        end = p + ticket_len;
@@ -961,7 +962,7 @@ static void rxkad_decrypt_response(struct rxrpc_connection *conn,
                                   const struct rxrpc_crypt *session_key)
 {
        struct blkcipher_desc desc;
-       struct scatterlist ssg[2], dsg[2];
+       struct scatterlist sg[2];
        struct rxrpc_crypt iv;
 
        _enter(",,%08x%08x",
@@ -979,9 +980,8 @@ static void rxkad_decrypt_response(struct rxrpc_connection *conn,
        desc.info = iv.x;
        desc.flags = 0;
 
-       rxkad_sg_set_buf2(ssg, &resp->encrypted, sizeof(resp->encrypted));
-       memcpy(dsg, ssg, sizeof(dsg));
-       crypto_blkcipher_decrypt_iv(&desc, dsg, ssg, sizeof(resp->encrypted));
+       rxkad_sg_set_buf2(sg, &resp->encrypted, sizeof(resp->encrypted));
+       crypto_blkcipher_decrypt_iv(&desc, sg, sg, sizeof(resp->encrypted));
        mutex_unlock(&rxkad_ci_mutex);
 
        _leave("");
index c9dbc3afa99f0dc0d86896f48d77990f9518835e..8af1004abefeb885a6ee10f4a12c2c939551e468 100644 (file)
@@ -726,8 +726,7 @@ void sctp_auth_calculate_hmac(const struct sctp_association *asoc,
 
        /* set up scatter list */
        end = skb_tail_pointer(skb);
-       sg_init_table(&sg, 1);
-       sg_set_buf(&sg, auth, end - (unsigned char *)auth);
+       sg_init_one(&sg, auth, end - (unsigned char *)auth);
 
        desc.tfm = asoc->ep->auth_hmacs[hmac_id];
        desc.flags = 0;
index c055212875f61331ec2d340ff92ff6f70197212c..c377e4e8f6533486ece6de765d0303b7bfa7f6fa 100644 (file)
@@ -1513,8 +1513,7 @@ static sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep,
                struct hash_desc desc;
 
                /* Sign the message.  */
-               sg_init_table(&sg, 1);
-               sg_set_buf(&sg, &cookie->c, bodysize);
+               sg_init_one(&sg, &cookie->c, bodysize);
                keylen = SCTP_SECRET_SIZE;
                key = (char *)ep->secret_key[ep->current_key];
                desc.tfm = sctp_sk(ep->base.sk)->hmac;
@@ -1584,8 +1583,7 @@ struct sctp_association *sctp_unpack_cookie(
 
        /* Check the signature.  */
        keylen = SCTP_SECRET_SIZE;
-       sg_init_table(&sg, 1);
-       sg_set_buf(&sg, bear_cookie, bodysize);
+       sg_init_one(&sg, bear_cookie, bodysize);
        key = (char *)ep->secret_key[ep->current_key];
        desc.tfm = sctp_sk(ep->base.sk)->hmac;
        desc.flags = 0;
index 24711be4b2dc89d6cfec7d002cd4eab41a8c815a..91cd8f0d1e10772c477d6de98b8268e58e775a51 100644 (file)
@@ -75,7 +75,7 @@ krb5_encrypt(
                memcpy(local_iv, iv, crypto_blkcipher_ivsize(tfm));
 
        memcpy(out, in, length);
-       sg_set_buf(sg, out, length);
+       sg_init_one(sg, out, length);
 
        ret = crypto_blkcipher_encrypt_iv(&desc, sg, sg, length);
 out:
@@ -110,7 +110,7 @@ krb5_decrypt(
                memcpy(local_iv,iv, crypto_blkcipher_ivsize(tfm));
 
        memcpy(out, in, length);
-       sg_set_buf(sg, out, length);
+       sg_init_one(sg, out, length);
 
        ret = crypto_blkcipher_decrypt_iv(&desc, sg, sg, length);
 out:
@@ -146,7 +146,7 @@ make_checksum(char *cksumname, char *header, int hdrlen, struct xdr_buf *body,
        err = crypto_hash_init(&desc);
        if (err)
                goto out;
-       sg_set_buf(sg, header, hdrlen);
+       sg_init_one(sg, header, hdrlen);
        err = crypto_hash_update(&desc, sg, hdrlen);
        if (err)
                goto out;
@@ -188,8 +188,6 @@ encryptor(struct scatterlist *sg, void *data)
        /* Worst case is 4 fragments: head, end of page 1, start
         * of page 2, tail.  Anything more is a bug. */
        BUG_ON(desc->fragno > 3);
-       desc->infrags[desc->fragno] = *sg;
-       desc->outfrags[desc->fragno] = *sg;
 
        page_pos = desc->pos - outbuf->head[0].iov_len;
        if (page_pos >= 0 && page_pos < outbuf->page_len) {
@@ -199,7 +197,10 @@ encryptor(struct scatterlist *sg, void *data)
        } else {
                in_page = sg_page(sg);
        }
-       sg_assign_page(&desc->infrags[desc->fragno], in_page);
+       sg_set_page(&desc->infrags[desc->fragno], in_page, sg->length,
+                   sg->offset);
+       sg_set_page(&desc->outfrags[desc->fragno], sg_page(sg), sg->length,
+                   sg->offset);
        desc->fragno++;
        desc->fraglen += sg->length;
        desc->pos += sg->length;
@@ -210,10 +211,17 @@ encryptor(struct scatterlist *sg, void *data)
        if (thislen == 0)
                return 0;
 
+       sg_mark_end(desc->infrags, desc->fragno);
+       sg_mark_end(desc->outfrags, desc->fragno);
+
        ret = crypto_blkcipher_encrypt_iv(&desc->desc, desc->outfrags,
                                          desc->infrags, thislen);
        if (ret)
                return ret;
+
+       sg_init_table(desc->infrags, 4);
+       sg_init_table(desc->outfrags, 4);
+
        if (fraglen) {
                sg_set_page(&desc->outfrags[0], sg_page(sg), fraglen,
                                sg->offset + sg->length - fraglen);
@@ -247,6 +255,9 @@ gss_encrypt_xdr_buf(struct crypto_blkcipher *tfm, struct xdr_buf *buf,
        desc.fragno = 0;
        desc.fraglen = 0;
 
+       sg_init_table(desc.infrags, 4);
+       sg_init_table(desc.outfrags, 4);
+
        ret = xdr_process_buf(buf, offset, buf->len - offset, encryptor, &desc);
        return ret;
 }
@@ -271,7 +282,8 @@ decryptor(struct scatterlist *sg, void *data)
        /* Worst case is 4 fragments: head, end of page 1, start
         * of page 2, tail.  Anything more is a bug. */
        BUG_ON(desc->fragno > 3);
-       desc->frags[desc->fragno] = *sg;
+       sg_set_page(&desc->frags[desc->fragno], sg_page(sg), sg->length,
+                   sg->offset);
        desc->fragno++;
        desc->fraglen += sg->length;
 
@@ -281,10 +293,15 @@ decryptor(struct scatterlist *sg, void *data)
        if (thislen == 0)
                return 0;
 
+       sg_mark_end(desc->frags, desc->fragno);
+
        ret = crypto_blkcipher_decrypt_iv(&desc->desc, desc->frags,
                                          desc->frags, thislen);
        if (ret)
                return ret;
+
+       sg_init_table(desc->frags, 4);
+
        if (fraglen) {
                sg_set_page(&desc->frags[0], sg_page(sg), fraglen,
                                sg->offset + sg->length - fraglen);
@@ -312,6 +329,9 @@ gss_decrypt_xdr_buf(struct crypto_blkcipher *tfm, struct xdr_buf *buf,
        desc.desc.flags = 0;
        desc.fragno = 0;
        desc.fraglen = 0;
+
+       sg_init_table(desc.frags, 4);
+
        return xdr_process_buf(buf, offset, buf->len - offset, decryptor, &desc);
 }
 
index d158635de6c08dc8a66a0b2f89fd79bed0f12d78..abf17ce2e3b1b13997c9b6181ea76fa5b1794882 100644 (file)
@@ -173,7 +173,7 @@ make_spkm3_checksum(s32 cksumtype, struct xdr_netobj *key, char *header,
        if (err)
                goto out;
 
-       sg_set_buf(sg, header, hdrlen);
+       sg_init_one(sg, header, hdrlen);
        crypto_hash_update(&desc, sg, sg->length);
 
        xdr_process_buf(body, body_offset, body->len - body_offset,
index f38dac30481b44d93344850494ea1ec041a148e5..fdc5e6d7562b72e6779308306feb7cedb14ba1bc 100644 (file)
@@ -1030,6 +1030,8 @@ xdr_process_buf(struct xdr_buf *buf, unsigned int offset, unsigned int len,
        unsigned page_len, thislen, page_offset;
        struct scatterlist      sg[1];
 
+       sg_init_table(sg, 1);
+
        if (offset >= buf->head[0].iov_len) {
                offset -= buf->head[0].iov_len;
        } else {
index 83c5e76414cec6b46f72ae9a63a75a699401cc0d..59594126e8b67d002de4624c2704178415de5c7b 100644 (file)
@@ -4,23 +4,30 @@
 
 PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config
 
+# If a arch/$(SRCARCH)/Kconfig.$(ARCH) file exist use it
+ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/Kconfig.$(ARCH)),)
+        Kconfig := arch/$(SRCARCH)/Kconfig.$(ARCH)
+else
+        Kconfig := arch/$(SRCARCH)/Kconfig
+endif
+
 xconfig: $(obj)/qconf
-       $< arch/$(ARCH)/Kconfig
+       $< $(Kconfig)
 
 gconfig: $(obj)/gconf
-       $< arch/$(ARCH)/Kconfig
+       $< $(Kconfig)
 
 menuconfig: $(obj)/mconf
-       $< arch/$(ARCH)/Kconfig
+       $< $(Kconfig)
 
 config: $(obj)/conf
-       $< arch/$(ARCH)/Kconfig
+       $< $(Kconfig)
 
 oldconfig: $(obj)/conf
-       $< -o arch/$(ARCH)/Kconfig
+       $< -o $(Kconfig)
 
 silentoldconfig: $(obj)/conf
-       $< -s arch/$(ARCH)/Kconfig
+       $< -s $(Kconfig)
 
 # Create new linux.po file
 # Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files
@@ -45,27 +52,27 @@ update-po-config: $(obj)/kxgettext
 PHONY += randconfig allyesconfig allnoconfig allmodconfig defconfig
 
 randconfig: $(obj)/conf
-       $< -r arch/$(ARCH)/Kconfig
+       $< -r $(Kconfig)
 
 allyesconfig: $(obj)/conf
-       $< -y arch/$(ARCH)/Kconfig
+       $< -y $(Kconfig)
 
 allnoconfig: $(obj)/conf
-       $< -n arch/$(ARCH)/Kconfig
+       $< -n $(Kconfig)
 
 allmodconfig: $(obj)/conf
-       $< -m arch/$(ARCH)/Kconfig
+       $< -m $(Kconfig)
 
 defconfig: $(obj)/conf
 ifeq ($(KBUILD_DEFCONFIG),)
-       $< -d arch/$(ARCH)/Kconfig
+       $< -d $(Kconfig)
 else
-       @echo *** Default configuration is based on '$(KBUILD_DEFCONFIG)'
-       $(Q)$< -D arch/$(ARCH)/configs/$(KBUILD_DEFCONFIG) arch/$(ARCH)/Kconfig
+       @echo "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'"
+       $(Q)$< -D arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig)
 endif
 
 %_defconfig: $(obj)/conf
-       $(Q)$< -D arch/$(ARCH)/configs/$@ arch/$(ARCH)/Kconfig
+       $(Q)$< -D arch/$(SRCARCH)/configs/$@ $(Kconfig)
 
 # Help text used by make help
 help: