1. 18 1月, 2013 1 次提交
  2. 18 12月, 2012 1 次提交
  3. 08 10月, 2012 1 次提交
    • D
      X.509: Implement simple static OID registry · a77ad6ea
      David Howells 提交于
      Implement a simple static OID registry that allows the mapping of an encoded
      OID to an enum value for ease of use.
      
      The OID registry index enum appears in the:
      
      	linux/oid_registry.h
      
      header file.  A script generates the registry from lines in the header file
      that look like:
      
      	<sp*>OID_foo,<sp*>/*<sp*>1.2.3.4<sp*>*/
      
      The actual OID is taken to be represented by the numbers with interpolated
      dots in the comment.
      
      All other lines in the header are ignored.
      
      The registry is queries by calling:
      
      	OID look_up_oid(const void *data, size_t datasize);
      
      This returns a number from the registry enum representing the OID if found or
      OID__NR if not.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      a77ad6ea
  4. 31 7月, 2012 1 次提交
  5. 23 7月, 2012 1 次提交
    • D
      of/lib: Allow scripts/dtc/libfdt to be used from kernel code · ab253839
      David Daney 提交于
      libfdt is part of the device tree support in scripts/dtc/libfdt.  For
      some platforms that use the Device Tree, we want to be able to edit
      the flattened device tree form.
      
      We don't want to burden kernel builds that do not require it, so we
      gate compilation of libfdt files with CONFIG_LIBFDT.  So if it is
      needed, you need to do this in your Kconfig:
      
      	select LIBFDT
      
      And in the Makefile of the code using libfdt something like:
      
      ccflags-y := -I$(src)/../../../scripts/dtc/libfdt
      Signed-off-by: NDavid Daney <david.daney@cavium.com>
      Cc: linux-mips@linux-mips.org
      Cc: devicetree-discuss@lists.ozlabs.org
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Cc: linux-kernel@vger.kernel.org
      Acked-by: NRob Herring <rob.herring@calxeda.com>
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      ab253839
  6. 27 5月, 2012 1 次提交
    • L
      lib: add generic strnlen_user() function · a08c5356
      Linus Torvalds 提交于
      This adds a new generic optimized strnlen_user() function that uses the
      <asm/word-at-a-time.h> infrastructure to portably do efficient string
      handling.
      
      In many ways, strnlen is much simpler than strncpy, and in particular we
      can always pre-align the words we load from memory.  That means that all
      the worries about alignment etc are a non-issue, so this one can easily
      be used on any architecture.  You obviously do have to do the
      appropriate word-at-a-time.h macros.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a08c5356
  7. 26 5月, 2012 1 次提交
  8. 25 5月, 2012 1 次提交
  9. 02 5月, 2012 1 次提交
  10. 21 4月, 2012 1 次提交
    • W
      lib: add support for stmp-style devices · 4ccf4bea
      Wolfram Sang 提交于
      MX23/28 use IP cores which follow a register layout I have first seen on
      STMP3xxx SoCs. In this layout, every register actually has four u32:
      
       1.) to store a value directly
       2.) a SET register where every 1-bit sets the corresponding bit,
           others are unaffected
       3.) same with a CLR register
       4.) same with a TOG (toggle) register
      
      Also, the 2 MSBs in register 0 are always the same and can be used to reset
      the IP core.
      
      All this is strictly speaking not mach-specific (but IP core specific) and,
      thus, doesn't need to be in mach-mxs/include. At least mx6 also uses IP cores
      following this stmp-style. So:
      
      Introduce a stmp-style device, put the code and defines for that in a public
      place (lib/), and let drivers for stmp-style devices select that code.
      To avoid regressions and ease reviewing, the actual code is simply copied from
      mach-mxs. It definately wants updates, but those need a seperate patch series.
      
      Voila, mach dependency gone, reusable code introduced. Note that I didn't
      remove the duplicated code from mach-mxs yet, first the drivers have to be
      converted.
      Signed-off-by: NWolfram Sang <w.sang@pengutronix.de>
      Acked-by: NShawn Guo <shawn.guo@linaro.org>
      Acked-by: NDong Aisheng <dong.aisheng@linaro.org>
      4ccf4bea
  11. 29 3月, 2012 1 次提交
  12. 25 3月, 2012 1 次提交
    • R
      Introduce CONFIG_GENERIC_IO · 087fafd1
      Richard Weinberger 提交于
      There are situations where CONFIG_HAS_IOMEM is too restrictive.
      For example CONFIG_MTD_NAND_NANDSIM depends on CONFIG_HAS_IOMEM
      but it works perfectly fine if an architecture without io memory
      just includes asm-generic/io.h or implements everything defined in it.
      UML is such a corner case.
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      087fafd1
  13. 24 3月, 2012 3 次提交
  14. 02 2月, 2012 1 次提交
  15. 01 2月, 2012 1 次提交
  16. 18 1月, 2012 4 次提交
  17. 30 11月, 2011 1 次提交
    • T
      dql: Dynamic queue limits · 75957ba3
      Tom Herbert 提交于
      Implementation of dynamic queue limits (dql).  This is a libary which
      allows a queue limit to be dynamically managed.  The goal of dql is
      to set the queue limit, number of objects to the queue, to be minimized
      without allowing the queue to be starved.
      
      dql would be used with a queue which has these properties:
      
      1) Objects are queued up to some limit which can be expressed as a
         count of objects.
      2) Periodically a completion process executes which retires consumed
         objects.
      3) Starvation occurs when limit has been reached, all queued data has
         actually been consumed but completion processing has not yet run,
         so queuing new data is blocked.
      4) Minimizing the amount of queued data is desirable.
      
      A canonical example of such a queue would be a NIC HW transmit queue.
      
      The queue limit is dynamic, it will increase or decrease over time
      depending on the workload.  The queue limit is recalculated each time
      completion processing is done.  Increases occur when the queue is
      starved and can exponentially increase over successive intervals.
      Decreases occur when more data is being maintained in the queue than
      needed to prevent starvation.  The number of extra objects, or "slack",
      is measured over successive intervals, and to avoid hysteresis the
      limit is only reduced by the miminum slack seen over a configurable
      time period.
      
      dql API provides routines to manage the queue:
      - dql_init is called to intialize the dql structure
      - dql_reset is called to reset dynamic values
      - dql_queued called when objects are being enqueued
      - dql_avail returns availability in the queue
      - dql_completed is called when objects have be consumed in the queue
      
      Configuration consists of:
      - max_limit, maximum limit
      - min_limit, minimum limit
      - slack_hold_time, time to measure instances of slack before reducing
        queue limit
      Signed-off-by: NTom Herbert <therbert@google.com>
      Acked-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      75957ba3
  18. 29 11月, 2011 1 次提交
  19. 25 11月, 2011 1 次提交
  20. 22 11月, 2011 1 次提交
    • D
      digsig: build dependency fix · de353533
      Dmitry Kasatkin 提交于
      Fix build errors by adding Kconfig dependency on KEYS.
      CRYPTO dependency removed.
      
        CC      security/integrity/digsig.o
      security/integrity/digsig.c: In function ?integrity_digsig_verify?:
      security/integrity/digsig.c:38:4: error: implicit declaration of function ?request_key?
      security/integrity/digsig.c:38:17: error: ?key_type_keyring? undeclared (first use in this function)
      security/integrity/digsig.c:38:17: note: each undeclared identifier is reported only once for each function it appears in
      make[2]: *** [security/integrity/digsig.o] Error 1
      Reported-by: NRandy Dunlap <rdunlap@xenotime.net>
      Signed-off-by: NDmitry Kasatkin <dmitry.kasatkin@intel.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      de353533
  21. 09 11月, 2011 3 次提交
    • D
      crypto: digital signature verification support · 051dbb91
      Dmitry Kasatkin 提交于
      This patch implements RSA digital signature verification using GnuPG library.
      
      The format of the signature and the public key is defined by their respective
      headers. The signature header contains version information, algorithm,
      and keyid, which was used to generate the signature.
      The key header contains version and algorythim type.
      The payload of the signature and the key are multi-precision integers.
      
      The signing and key management utilities evm-utils provide functionality
      to generate signatures and load keys into the kernel keyring.
      When the key is added to the kernel keyring, the keyid defines the name
      of the key.
      Signed-off-by: NDmitry Kasatkin <dmitry.kasatkin@intel.com>
      Acked-by: NMimi Zohar <zohar@us.ibm.com>
      051dbb91
    • D
      crypto: GnuPG based MPI lib - additional sources (part 4) · 7e8dec91
      Dmitry Kasatkin 提交于
      Adds the multi-precision-integer maths library which was originally taken
      from GnuPG and ported to the kernel by (among others) David Howells.
      This version is taken from Fedora kernel 2.6.32-71.14.1.el6.
      The difference is that checkpatch reported errors and warnings have been fixed.
      
      This library is used to implemenet RSA digital signature verification
      used in IMA/EVM integrity protection subsystem.
      
      Due to patch size limitation, the patch is divided into 4 parts.
      
      This code is unnecessary for RSA digital signature verification,
      but for completeness it is included here and can be compiled,
      if CONFIG_MPILIB_EXTRA is enabled.
      Signed-off-by: NDmitry Kasatkin <dmitry.kasatkin@intel.com>
      7e8dec91
    • D
      crypto: GnuPG based MPI lib - make files (part 3) · d9c46b18
      Dmitry Kasatkin 提交于
      Adds the multi-precision-integer maths library which was originally taken
      from GnuPG and ported to the kernel by (among others) David Howells.
      This version is taken from Fedora kernel 2.6.32-71.14.1.el6.
      The difference is that checkpatch reported errors and warnings have been fixed.
      
      This library is used to implemenet RSA digital signature verification
      used in IMA/EVM integrity protection subsystem.
      
      Due to patch size limitation, the patch is divided into 4 parts.
      Signed-off-by: NDmitry Kasatkin <dmitry.kasatkin@intel.com>
      d9c46b18
  22. 30 10月, 2011 3 次提交
  23. 04 10月, 2011 1 次提交
  24. 03 8月, 2011 1 次提交
    • H
      lib, Add lock-less NULL terminated single list · f49f23ab
      Huang Ying 提交于
      Cmpxchg is used to implement adding new entry to the list, deleting
      all entries from the list, deleting first entry of the list and some
      other operations.
      
      Because this is a single list, so the tail can not be accessed in O(1).
      
      If there are multiple producers and multiple consumers, llist_add can
      be used in producers and llist_del_all can be used in consumers.  They
      can work simultaneously without lock.  But llist_del_first can not be
      used here.  Because llist_del_first depends on list->first->next does
      not changed if list->first is not changed during its operation, but
      llist_del_first, llist_add, llist_add (or llist_del_all, llist_add,
      llist_add) sequence in another consumer may violate that.
      
      If there are multiple producers and one consumer, llist_add can be
      used in producers and llist_del_all or llist_del_first can be used in
      the consumer.
      
      This can be summarized as follow:
      
                 |   add    | del_first |  del_all
       add       |    -     |     -     |     -
       del_first |          |     L     |     L
       del_all   |          |           |     -
      
      Where "-" stands for no lock is needed, while "L" stands for lock is
      needed.
      
      The list entries deleted via llist_del_all can be traversed with
      traversing function such as llist_for_each etc.  But the list entries
      can not be traversed safely before deleted from the list.  The order
      of deleted entries is from the newest to the oldest added one.  If you
      want to traverse from the oldest to the newest, you must reverse the
      order by yourself before traversing.
      
      The basic atomic operation of this list is cmpxchg on long.  On
      architectures that don't have NMI-safe cmpxchg implementation, the
      list can NOT be used in NMI handler.  So code uses the list in NMI
      handler should depend on CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG.
      Signed-off-by: NHuang Ying <ying.huang@intel.com>
      Reviewed-by: NAndi Kleen <ak@linux.intel.com>
      Reviewed-by: NMathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      f49f23ab
  25. 04 6月, 2011 2 次提交
  26. 27 5月, 2011 1 次提交
  27. 24 3月, 2011 1 次提交
  28. 11 3月, 2011 1 次提交
    • I
      lib: add shared BCH ECC library · 437aa565
      Ivan Djelic 提交于
      This is a new software BCH encoding/decoding library, similar to the shared
      Reed-Solomon library.
      
      Binary BCH (Bose-Chaudhuri-Hocquenghem) codes are widely used to correct
      errors in NAND flash devices requiring more than 1-bit ecc correction; they
      are generally better suited for NAND flash than RS codes because NAND bit
      errors do not occur in bursts. Latest SLC NAND devices typically require at
      least 4-bit ecc protection per 512 bytes block.
      
      This library provides software encoding/decoding, but may also be used with
      ASIC/SoC hardware BCH engines to perform error correction. It is being
      currently used for this purpose on an OMAP3630 board (4bit/8bit HW BCH). It
      has also been used to decode raw dumps of NAND devices with on-die BCH ecc
      engines (e.g. Micron 4bit ecc SLC devices).
      
      Latest NAND devices (including SLC) can exhibit high error rates (typically
      a dozen or more bitflips per hour during stress tests); in order to
      minimize the performance impact of error correction, this library
      implements recently developed algorithms for fast polynomial root finding
      (see bch.c header for details) instead of the traditional exhaustive Chien
      root search; a few performance figures are provided below:
      
      Platform: arm926ejs @ 468 MHz, 32 KiB icache, 16 KiB dcache
      BCH ecc : 4-bit per 512 bytes
      
      Encoding average throughput: 250 Mbits/s
      
      Error correction time (compared with Chien search):
      
              average   worst      average (Chien)  worst (Chien)
      ----------------------------------------------------------
      1 bit    8.5 µs   11 µs         200 µs           383 µs
      2 bit    9.7 µs   12.5 µs       477 µs           728 µs
      3 bit   18.1 µs   20.6 µs       758 µs          1010 µs
      4 bit   19.5 µs   23 µs        1028 µs          1280 µs
      
      In the above figures, "worst" is meant in terms of error pattern, not in
      terms of cache miss / page faults effects (not taken into account here).
      
      The library has been extensively tested on the following platforms: x86,
      x86_64, arm926ejs, omap3630, qemu-ppc64, qemu-mips.
      Signed-off-by: NIvan Djelic <ivan.djelic@parrot.com>
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      437aa565
  29. 05 3月, 2011 1 次提交
  30. 25 1月, 2011 1 次提交