01 Mar, 2013

1 commit

  • Pull LZO compression update from Markus Oberhumer:
    "Summary:
    ========

    Update the Linux kernel LZO compression and decompression code to the
    current upstream version which features significant performance
    improvements on modern machines.

    Some *synthetic* benchmarks:
    ============================

    x86_64 (Sandy Bridge), gcc-4.6 -O3, Silesia test corpus, 256 kB block-size:

    compression speed decompression speed

    LZO-2005 : 150 MB/sec 468 MB/sec
    LZO-2012 : 434 MB/sec 1210 MB/sec

    i386 (Sandy Bridge), gcc-4.6 -O3, Silesia test corpus, 256 kB block-size:

    compression speed decompression speed

    LZO-2005 : 143 MB/sec 409 MB/sec
    LZO-2012 : 372 MB/sec 1121 MB/sec

    armv7 (Cortex-A9), Linaro gcc-4.6 -O3, Silesia test corpus, 256 kB block-size:

    compression speed decompression speed

    LZO-2005 : 27 MB/sec 84 MB/sec
    LZO-2012 : 44 MB/sec 117 MB/sec
    **LZO-2013-UA : 47 MB/sec 167 MB/sec

    Legend:

    LZO-2005 : LZO version in current 3.8 kernel (which is based on
    the LZO 2.02 release from 2005)
    LZO-2012 : updated LZO version available in linux-next
    **LZO-2013-UA : updated LZO version available in linux-next plus experimental
    ARM Unaligned Access patch. This needs approval
    from some ARM maintainer ist NOT YET INCLUDED."

    Andrew Morton acks it and says:
    "There's a new LZ4 on the block which is even faster than the sped-up
    LZO, but various filesystems and things use LZO"

    * tag 'lzo-update-signature-20130226' of git://github.com/markus-oberhumer/linux:
    crypto: testmgr - update LZO compression test vectors
    lib/lzo: Update LZO compression to current upstream version
    lib/lzo: Rename lzo1x_decompress.c to lzo1x_decompress_safe.c

    Linus Torvalds
     

28 Feb, 2013

1 commit

  • I'm not sure why, but the hlist for each entry iterators were conceived

    list_for_each_entry(pos, head, member)

    The hlist ones were greedy and wanted an extra parameter:

    hlist_for_each_entry(tpos, pos, head, member)

    Why did they need an extra pos parameter? I'm not quite sure. Not only
    they don't really need it, it also prevents the iterator from looking
    exactly like the list iterator, which is unfortunate.

    Besides the semantic patch, there was some manual work required:

    - Fix up the actual hlist iterators in linux/list.h
    - Fix up the declaration of other iterators based on the hlist ones.
    - A very small amount of places were using the 'node' parameter, this
    was modified to use 'obj->member' instead.
    - Coccinelle didn't handle the hlist_for_each_entry_safe iterator
    properly, so those had to be fixed up manually.

    The semantic patch which is mostly the work of Peter Senna Tschudin is here:

    @@
    iterator name hlist_for_each_entry, hlist_for_each_entry_continue, hlist_for_each_entry_from, hlist_for_each_entry_rcu, hlist_for_each_entry_rcu_bh, hlist_for_each_entry_continue_rcu_bh, for_each_busy_worker, ax25_uid_for_each, ax25_for_each, inet_bind_bucket_for_each, sctp_for_each_hentry, sk_for_each, sk_for_each_rcu, sk_for_each_from, sk_for_each_safe, sk_for_each_bound, hlist_for_each_entry_safe, hlist_for_each_entry_continue_rcu, nr_neigh_for_each, nr_neigh_for_each_safe, nr_node_for_each, nr_node_for_each_safe, for_each_gfn_indirect_valid_sp, for_each_gfn_sp, for_each_host;

    type T;
    expression a,c,d,e;
    identifier b;
    statement S;
    @@

    -T b;

    [akpm@linux-foundation.org: drop bogus change from net/ipv4/raw.c]
    [akpm@linux-foundation.org: drop bogus hunk from net/ipv6/raw.c]
    [akpm@linux-foundation.org: checkpatch fixes]
    [akpm@linux-foundation.org: fix warnings]
    [akpm@linux-foudnation.org: redo intrusive kvm changes]
    Tested-by: Peter Senna Tschudin
    Acked-by: Paul E. McKenney
    Signed-off-by: Sasha Levin
    Cc: Wu Fengguang
    Cc: Marcelo Tosatti
    Cc: Gleb Natapov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sasha Levin
     

27 Feb, 2013

1 commit

  • Pull slave-dmaengine updates from Vinod Koul:
    "This is fairly big pull by my standards as I had missed last merge
    window. So we have the support for device tree for slave-dmaengine,
    large updates to dw_dmac driver from Andy for reusing on different
    architectures. Along with this we have fixes on bunch of the drivers"

    Fix up trivial conflicts, usually due to #include line movement next to
    each other.

    * 'next' of git://git.infradead.org/users/vkoul/slave-dma: (111 commits)
    Revert "ARM: SPEAr13xx: Pass DW DMAC platform data from DT"
    ARM: dts: pl330: Add #dma-cells for generic dma binding support
    DMA: PL330: Register the DMA controller with the generic DMA helpers
    DMA: PL330: Add xlate function
    DMA: PL330: Add new pl330 filter for DT case.
    dma: tegra20-apb-dma: remove unnecessary assignment
    edma: do not waste memory for dma_mask
    dma: coh901318: set residue only if dma is in progress
    dma: coh901318: avoid unbalanced locking
    dmaengine.h: remove redundant else keyword
    dma: of-dma: protect list write operation by spin_lock
    dmaengine: ste_dma40: do not remove descriptors for cyclic transfers
    dma: of-dma.c: fix memory leakage
    dw_dmac: apply default dma_mask if needed
    dmaengine: ioat - fix spare sparse complain
    dmaengine: move drivers/of/dma.c -> drivers/dma/of-dma.c
    ioatdma: fix race between updating ioat->head and IOAT_COMPLETION_PENDING
    dw_dmac: add support for Lynxpoint DMA controllers
    dw_dmac: return proper residue value
    dw_dmac: fill individual length of descriptor
    ...

    Linus Torvalds
     

26 Feb, 2013

1 commit

  • Pull crypto update from Herbert Xu:
    "Here is the crypto update for 3.9:

    - Added accelerated implementation of crc32 using pclmulqdq.

    - Added test vector for fcrypt.

    - Added support for OMAP4/AM33XX cipher and hash.

    - Fixed loose crypto_user input checks.

    - Misc fixes"

    * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (43 commits)
    crypto: user - ensure user supplied strings are nul-terminated
    crypto: user - fix empty string test in report API
    crypto: user - fix info leaks in report API
    crypto: caam - Added property fsl,sec-era in SEC4.0 device tree binding.
    crypto: use ERR_CAST
    crypto: atmel-aes - adjust duplicate test
    crypto: crc32-pclmul - Kill warning on x86-32
    crypto: x86/twofish - assembler clean-ups: use ENTRY/ENDPROC, localize jump labels
    crypto: x86/sha1 - assembler clean-ups: use ENTRY/ENDPROC
    crypto: x86/serpent - use ENTRY/ENDPROC for assember functions and localize jump targets
    crypto: x86/salsa20 - assembler cleanup, use ENTRY/ENDPROC for assember functions and rename ECRYPT_* to salsa20_*
    crypto: x86/ghash - assembler clean-up: use ENDPROC at end of assember functions
    crypto: x86/crc32c - assembler clean-up: use ENTRY/ENDPROC
    crypto: cast6-avx: use ENTRY()/ENDPROC() for assembler functions
    crypto: cast5-avx: use ENTRY()/ENDPROC() for assembler functions and localize jump targets
    crypto: camellia-x86_64/aes-ni: use ENTRY()/ENDPROC() for assembler functions and localize jump targets
    crypto: blowfish-x86_64: use ENTRY()/ENDPROC() for assembler functions and localize jump targets
    crypto: aesni-intel - add ENDPROC statements for assembler functions
    crypto: x86/aes - assembler clean-ups: use ENTRY/ENDPROC, localize jump targets
    crypto: testmgr - add test vector for fcrypt
    ...

    Linus Torvalds
     

24 Feb, 2013

1 commit

  • Pull powerpc updates from Benjamin Herrenschmidt:
    "So from the depth of frozen Minnesota, here's the powerpc pull request
    for 3.9. It has a few interesting highlights, in addition to the
    usual bunch of bug fixes, minor updates, embedded device tree updates
    and new boards:

    - Hand tuned asm implementation of SHA1 (by Paulus & Michael
    Ellerman)

    - Support for Doorbell interrupts on Power8 (kind of fast
    thread-thread IPIs) by Ian Munsie

    - Long overdue cleanup of the way we handle relocation of our open
    firmware trampoline (prom_init.c) on 64-bit by Anton Blanchard

    - Support for saving/restoring & context switching the PPR (Processor
    Priority Register) on server processors that support it. This
    allows the kernel to preserve thread priorities established by
    userspace. By Haren Myneni.

    - DAWR (new watchpoint facility) support on Power8 by Michael Neuling

    - Ability to change the DSCR (Data Stream Control Register) which
    controls cache prefetching on a running process via ptrace by
    Alexey Kardashevskiy

    - Support for context switching the TAR register on Power8 (new
    branch target register meant to be used by some new specific
    userspace perf event interrupt facility which is yet to be enabled)
    by Ian Munsie.

    - Improve preservation of the CFAR register (which captures the
    origin of a branch) on various exception conditions by Paulus.

    - Move the Bestcomm DMA driver from arch powerpc to drivers/dma where
    it belongs by Philippe De Muyter

    - Support for Transactional Memory on Power8 by Michael Neuling
    (based on original work by Matt Evans). For those curious about
    the feature, the patch contains a pretty good description."

    (See commit db8ff907027b: "powerpc: Documentation for transactional
    memory on powerpc" for the mentioned description added to the file
    Documentation/powerpc/transactional_memory.txt)

    * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (140 commits)
    powerpc/kexec: Disable hard IRQ before kexec
    powerpc/85xx: l2sram - Add compatible string for BSC9131 platform
    powerpc/85xx: bsc9131 - Correct typo in SDHC device node
    powerpc/e500/qemu-e500: enable coreint
    powerpc/mpic: allow coreint to be determined by MPIC version
    powerpc/fsl_pci: Store the pci ctlr device ptr in the pci ctlr struct
    powerpc/85xx: Board support for ppa8548
    powerpc/fsl: remove extraneous DIU platform functions
    arch/powerpc/platforms/85xx/p1022_ds.c: adjust duplicate test
    powerpc: Documentation for transactional memory on powerpc
    powerpc: Add transactional memory to pseries and ppc64 defconfigs
    powerpc: Add config option for transactional memory
    powerpc: Add transactional memory to POWER8 cpu features
    powerpc: Add new transactional memory state to the signal context
    powerpc: Hook in new transactional memory code
    powerpc: Routines for FP/VSX/VMX unavailable during a transaction
    powerpc: Add transactional memory unavaliable execption handler
    powerpc: Add reclaim and recheckpoint functions for context switching transactional memory processes
    powerpc: Add FP/VSX and VMX register load functions for transactional memory
    powerpc: Add helper functions for transactional memory context switching
    ...

    Linus Torvalds
     

22 Feb, 2013

1 commit

  • Pull driver core patches from Greg Kroah-Hartman:
    "Here is the big driver core merge for 3.9-rc1

    There are two major series here, both of which touch lots of drivers
    all over the kernel, and will cause you some merge conflicts:

    - add a new function called devm_ioremap_resource() to properly be
    able to check return values.

    - remove CONFIG_EXPERIMENTAL

    Other than those patches, there's not much here, some minor fixes and
    updates"

    Fix up trivial conflicts

    * tag 'driver-core-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (221 commits)
    base: memory: fix soft/hard_offline_page permissions
    drivercore: Fix ordering between deferred_probe and exiting initcalls
    backlight: fix class_find_device() arguments
    TTY: mark tty_get_device call with the proper const values
    driver-core: constify data for class_find_device()
    firmware: Ignore abort check when no user-helper is used
    firmware: Reduce ifdef CONFIG_FW_LOADER_USER_HELPER
    firmware: Make user-mode helper optional
    firmware: Refactoring for splitting user-mode helper code
    Driver core: treat unregistered bus_types as having no devices
    watchdog: Convert to devm_ioremap_resource()
    thermal: Convert to devm_ioremap_resource()
    spi: Convert to devm_ioremap_resource()
    power: Convert to devm_ioremap_resource()
    mtd: Convert to devm_ioremap_resource()
    mmc: Convert to devm_ioremap_resource()
    mfd: Convert to devm_ioremap_resource()
    media: Convert to devm_ioremap_resource()
    iommu: Convert to devm_ioremap_resource()
    drm: Convert to devm_ioremap_resource()
    ...

    Linus Torvalds
     

21 Feb, 2013

1 commit


19 Feb, 2013

3 commits

  • To avoid misuse, ensure cru_name and cru_driver_name are always
    nul-terminated strings.

    Signed-off-by: Mathias Krause
    Signed-off-by: Herbert Xu

    Mathias Krause
     
  • The current test for empty strings fails because it is testing the
    address of a field, not a pointer. So the test will always be true.
    Test the first character in the string to not be null instead.

    Signed-off-by: Mathias Krause
    Cc: Steffen Klassert
    Signed-off-by: Herbert Xu

    Mathias Krause
     
  • Three errors resulting in kernel memory disclosure:

    1/ The structures used for the netlink based crypto algorithm report API
    are located on the stack. As snprintf() does not fill the remainder of
    the buffer with null bytes, those stack bytes will be disclosed to users
    of the API. Switch to strncpy() to fix this.

    2/ crypto_report_one() does not initialize all field of struct
    crypto_user_alg. Fix this to fix the heap info leak.

    3/ For the module name we should copy only as many bytes as
    module_name() returns -- not as much as the destination buffer could
    hold. But the current code does not and therefore copies random data
    from behind the end of the module name, as the module name is always
    shorter than CRYPTO_MAX_ALG_NAME.

    Also switch to use strncpy() to copy the algorithm's name and
    driver_name. They are strings, after all.

    Signed-off-by: Mathias Krause
    Cc: Steffen Klassert
    Signed-off-by: Herbert Xu

    Mathias Krause
     

04 Feb, 2013

1 commit

  • Replace PTR_ERR followed by ERR_PTR by ERR_CAST, to be more concise.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression err,x;
    @@
    - err = PTR_ERR(x);
    if (IS_ERR(x))
    - return ERR_PTR(err);
    + return ERR_CAST(x);
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Herbert Xu

    Julia Lawall
     

20 Jan, 2013

2 commits

  • fcrypt is used only as pcbc(fcrypt), but testmgr does not know this.
    Use the zero key, zero plaintext pcbc(fcrypt) test vector for
    testing plain 'fcrypt' to hide "no test for fcrypt" warnings.

    Signed-off-by: Jussi Kivilinna
    Acked-by: David S. Miller
    Signed-off-by: Herbert Xu

    Jussi Kivilinna
     
  • This patch adds crc32 algorithms to shash crypto api. One is wrapper to
    gerneric crc32_le function. Second is crc32 pclmulqdq implementation. It
    use hardware provided PCLMULQDQ instruction to accelerate the CRC32 disposal.
    This instruction present from Intel Westmere and AMD Bulldozer CPUs.

    For intel core i5 I got 450MB/s for table implementation and 2100MB/s
    for pclmulqdq implementation.

    Signed-off-by: Alexander Boyko
    Signed-off-by: Herbert Xu

    Alexander Boyko
     

12 Jan, 2013

1 commit

  • The CONFIG_EXPERIMENTAL config item has not carried much meaning for a
    while now and is almost always enabled by default. As agreed during the
    Linux kernel summit, remove it from any "depends on" lines in Kconfigs.

    CC: Herbert Xu
    CC: "David S. Miller"
    Signed-off-by: Kees Cook
    Acked-by: David S. Miller

    Kees Cook
     

10 Jan, 2013

1 commit

  • This patch adds a crypto driver which provides a powerpc accelerated
    implementation of SHA-1, accelerated in that it is written in asm.

    Original patch by Paul, minor fixups for upstream by moi.

    Lightly tested on 64-bit with the test program here:

    http://michael.ellerman.id.au/files/junkcode/sha1test.c

    Seems to work, and is "not slower" than the generic version.

    Needs testing on 32-bit.

    Signed-off-by: Paul Mackerras
    Signed-off-by: Michael Ellerman
    Signed-off-by: Benjamin Herrenschmidt

    Michael Ellerman
     

08 Jan, 2013

5 commits


16 Dec, 2012

1 commit

  • Pull crypto update from Herbert Xu:

    - Added aesni/avx/x86_64 implementations for camellia.

    - Optimised AVX code for cast5/serpent/twofish/cast6.

    - Fixed vmac bug with unaligned input.

    - Allow compression algorithms in FIPS mode.

    - Optimised crc32c implementation for Intel.

    - Misc fixes.

    * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (32 commits)
    crypto: caam - Updated SEC-4.0 device tree binding for ERA information.
    crypto: testmgr - remove superfluous initializers for xts(aes)
    crypto: testmgr - allow compression algs in fips mode
    crypto: testmgr - add larger crc32c test vector to test FPU path in crc32c_intel
    crypto: testmgr - clean alg_test_null entries in alg_test_descs[]
    crypto: testmgr - remove fips_allowed flag from camellia-aesni null-tests
    crypto: cast5/cast6 - move lookup tables to shared module
    padata: use __this_cpu_read per-cpu helper
    crypto: s5p-sss - Fix compilation error
    crypto: picoxcell - Add terminating entry for platform_device_id table
    crypto: omap-aes - select BLKCIPHER2
    crypto: camellia - add AES-NI/AVX/x86_64 assembler implementation of camellia cipher
    crypto: camellia-x86_64 - share common functions and move structures and function definitions to header file
    crypto: tcrypt - add async speed test for camellia cipher
    crypto: tegra-aes - fix error-valued pointer dereference
    crypto: tegra - fix missing unlock on error case
    crypto: cast5/avx - avoid using temporary stack buffers
    crypto: serpent/avx - avoid using temporary stack buffers
    crypto: twofish/avx - avoid using temporary stack buffers
    crypto: cast6/avx - avoid using temporary stack buffers
    ...

    Linus Torvalds
     

06 Dec, 2012

6 commits


09 Nov, 2012

2 commits

  • This patch adds AES-NI/AVX/x86_64 assembler implementation of Camellia block
    cipher. Implementation process data in sixteen block chunks, which are
    byte-sliced and AES SubBytes is reused for Camellia s-box with help of pre-
    and post-filtering.

    Patch has been tested with tcrypt and automated filesystem tests.

    tcrypt test results:

    Intel Core i5-2450M:

    camellia-aesni-avx vs camellia-asm-x86_64-2way:
    128bit key: (lrw:256bit) (xts:256bit)
    size ecb-enc ecb-dec cbc-enc cbc-dec ctr-enc ctr-dec lrw-enc lrw-dec xts-enc xts-dec
    16B 0.98x 0.96x 0.99x 0.96x 0.96x 0.95x 0.95x 0.94x 0.97x 0.98x
    64B 0.99x 0.98x 1.00x 0.98x 0.98x 0.99x 0.98x 0.93x 0.99x 0.98x
    256B 2.28x 2.28x 1.01x 2.29x 2.25x 2.24x 1.96x 1.97x 1.91x 1.90x
    1024B 2.57x 2.56x 1.00x 2.57x 2.51x 2.53x 2.19x 2.17x 2.19x 2.22x
    8192B 2.49x 2.49x 1.00x 2.53x 2.48x 2.49x 2.17x 2.17x 2.22x 2.22x

    256bit key: (lrw:384bit) (xts:512bit)
    size ecb-enc ecb-dec cbc-enc cbc-dec ctr-enc ctr-dec lrw-enc lrw-dec xts-enc xts-dec
    16B 0.97x 0.98x 0.99x 0.97x 0.97x 0.96x 0.97x 0.98x 0.98x 0.99x
    64B 1.00x 1.00x 1.01x 0.99x 0.98x 0.99x 0.99x 0.99x 0.99x 0.99x
    256B 2.37x 2.37x 1.01x 2.39x 2.35x 2.33x 2.10x 2.11x 1.99x 2.02x
    1024B 2.58x 2.60x 1.00x 2.58x 2.56x 2.56x 2.28x 2.29x 2.28x 2.29x
    8192B 2.50x 2.52x 1.00x 2.56x 2.51x 2.51x 2.24x 2.25x 2.26x 2.29x

    Signed-off-by: Jussi Kivilinna
    Acked-by: David S. Miller
    Signed-off-by: Herbert Xu

    Jussi Kivilinna
     
  • Signed-off-by: Jussi Kivilinna
    Acked-by: David S. Miller
    Signed-off-by: Herbert Xu

    Jussi Kivilinna
     

24 Oct, 2012

7 commits


15 Oct, 2012

4 commits

  • VMAC implementation, as it is, does not work with blocks that
    are not multiples of 128-bytes. Furthermore, this is a problem
    when using the implementation on scatterlists, even
    when the complete plain text is 128-byte multiple, as the pieces
    that get passed to vmac_update can be pretty much any size.

    I also added test cases for unaligned blocks.

    Signed-off-by: Salman Qazi
    Signed-off-by: Herbert Xu

    Salman Qazi
     
  • This patch adds a test case in tcrypt to perform speed test for
    crc32c checksum calculation.

    Signed-off-by: Tim Chen
    Signed-off-by: Herbert Xu

    Tim Chen
     
  • This patch adds the crc_pcl function that calculates CRC32C checksum using the
    PCLMULQDQ instruction on processors that support this feature. This will
    provide speedup over using CRC32 instruction only.
    The usage of PCLMULQDQ necessitate the invocation of kernel_fpu_begin and
    kernel_fpu_end and incur some overhead. So the new crc_pcl function is only
    invoked for buffer size of 512 bytes or more. Larger sized
    buffers will expect to see greater speedup. This feature is best used coupled
    with eager_fpu which reduces the kernel_fpu_begin/end overhead. For
    buffer size of 1K the speedup is around 1.6x and for buffer size greater than
    4K, the speedup is around 3x compared to original implementation in crc32c-intel
    module. Test was performed on Sandy Bridge based platform with constant frequency
    set for cpu.

    A white paper detailing the algorithm can be found here:
    http://download.intel.com/design/intarch/papers/323405.pdf

    Signed-off-by: Tim Chen
    Signed-off-by: Herbert Xu

    Tim Chen
     
  • Pull module signing support from Rusty Russell:
    "module signing is the highlight, but it's an all-over David Howells frenzy..."

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

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

    Linus Torvalds