1. 26 1月, 2017 1 次提交
  2. 16 12月, 2016 1 次提交
    • G
      crypto: add virtio-crypto driver · dbaf0624
      Gonglei 提交于
      This patch introduces virtio-crypto driver for Linux Kernel.
      
      The virtio crypto device is a virtual cryptography device
      as well as a kind of virtual hardware accelerator for
      virtual machines. The encryption anddecryption requests
      are placed in the data queue and are ultimately handled by
      thebackend crypto accelerators. The second queue is the
      control queue used to create or destroy sessions for
      symmetric algorithms and will control some advanced features
      in the future. The virtio crypto device provides the following
      cryptoservices: CIPHER, MAC, HASH, and AEAD.
      
      For more information about virtio-crypto device, please see:
        http://qemu-project.org/Features/VirtioCrypto
      
      CC: Michael S. Tsirkin <mst@redhat.com>
      CC: Cornelia Huck <cornelia.huck@de.ibm.com>
      CC: Stefan Hajnoczi <stefanha@redhat.com>
      CC: Herbert Xu <herbert@gondor.apana.org.au>
      CC: Halil Pasic <pasic@linux.vnet.ibm.com>
      CC: David S. Miller <davem@davemloft.net>
      CC: Zeng Xin <xin.zeng@intel.com>
      Signed-off-by: NGonglei <arei.gonglei@huawei.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      dbaf0624
  3. 22 11月, 2016 1 次提交
    • D
      leds: Introduce userspace LED class driver · e381322b
      David Lechner 提交于
      This driver creates a userspace leds driver similar to uinput.
      
      New LEDs are created by opening /dev/uleds and writing a uleds_user_dev
      struct. A new LED class device is registered with the name given in the
      struct. Reading will return a single byte that is the current brightness.
      The poll() syscall is also supported. It will be triggered whenever the
      brightness changes. Closing the file handle to /dev/uleds will remove
      the leds class device.
      Signed-off-by: NDavid Lechner <david@lechnology.com>
      Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
      e381322b
  4. 17 11月, 2016 1 次提交
  5. 19 10月, 2016 1 次提交
  6. 04 10月, 2016 1 次提交
  7. 30 9月, 2016 1 次提交
    • A
      ipmi: add an Aspeed BT IPMI BMC driver · 54f9c4d0
      Alistair Popple 提交于
      This patch adds a simple device driver to expose the iBT interface on
      Aspeed SOCs (AST2400 and AST2500) as a character device. Such SOCs are
      commonly used as BMCs (BaseBoard Management Controllers) and this
      driver implements the BMC side of the BT interface.
      
      The BT (Block Transfer) interface is used to perform in-band IPMI
      communication between a host and its BMC. Entire messages are buffered
      before sending a notification to the other end, host or BMC, that
      there is data to be read. Usually, the host emits requests and the BMC
      responses but the specification provides a mean for the BMC to send
      SMS Attention (BMC-to-Host attention or System Management Software
      attention) messages.
      
      For this purpose, the driver introduces a specific ioctl on the
      device: 'BT_BMC_IOCTL_SMS_ATN' that can be used by the system running
      on the BMC to signal the host of such an event.
      
      The device name defaults to '/dev/ipmi-bt-host'
      Signed-off-by: NAlistair Popple <alistair@popple.id.au>
      Signed-off-by: NJeremy Kerr <jk@ozlabs.org>
      Signed-off-by: NJoel Stanley <joel@jms.id.au>
      [clg: - checkpatch fixes
            - added a devicetree binding documentation
            - replace 'bt_host' by 'bt_bmc' to reflect that the driver is
              the BMC side of the IPMI BT interface
            - renamed the device to 'ipmi-bt-host'
            - introduced a temporary buffer to copy_{to,from}_user
            - used platform_get_irq()
            - moved the driver under drivers/char/ipmi/ but kept it as a misc
              device
            - changed the compatible cell to "aspeed,ast2400-bt-bmc"
      ]
      Signed-off-by: NCédric Le Goater <clg@kaod.org>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      [clg: - checkpatch --strict fixes
            - removed the use of devm_iounmap, devm_kfree in cleanup paths
            - introduced an atomic-t to limit opens to 1
            - introduced a mutex to protect write/read operations]
      Acked-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NCédric Le Goater <clg@kaod.org>
      Signed-off-by: NCorey Minyard <cminyard@mvista.com>
      54f9c4d0
  8. 28 9月, 2016 1 次提交
  9. 03 9月, 2016 1 次提交
    • A
      bpf: introduce BPF_PROG_TYPE_PERF_EVENT program type · 0515e599
      Alexei Starovoitov 提交于
      Introduce BPF_PROG_TYPE_PERF_EVENT programs that can be attached to
      HW and SW perf events (PERF_TYPE_HARDWARE and PERF_TYPE_SOFTWARE
      correspondingly in uapi/linux/perf_event.h)
      
      The program visible context meta structure is
      struct bpf_perf_event_data {
          struct pt_regs regs;
           __u64 sample_period;
      };
      which is accessible directly from the program:
      int bpf_prog(struct bpf_perf_event_data *ctx)
      {
        ... ctx->sample_period ...
        ... ctx->regs.ip ...
      }
      
      The bpf verifier rewrites the accesses into kernel internal
      struct bpf_perf_event_data_kern which allows changing
      struct perf_sample_data without affecting bpf programs.
      New fields can be added to the end of struct bpf_perf_event_data
      in the future.
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Acked-by: NDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0515e599
  10. 03 8月, 2016 1 次提交
  11. 02 8月, 2016 1 次提交
  12. 15 7月, 2016 1 次提交
  13. 25 6月, 2016 1 次提交
  14. 11 5月, 2016 1 次提交
  15. 12 4月, 2016 1 次提交
  16. 23 3月, 2016 1 次提交
  17. 14 3月, 2016 1 次提交
  18. 09 2月, 2016 1 次提交
    • L
      gpio: add a userspace chardev ABI for GPIOs · 3c702e99
      Linus Walleij 提交于
      A new chardev that is to be used for userspace GPIO access is
      added in this patch. It is intended to gradually replace the
      horribly broken sysfs ABI.
      
      Using a chardev has many upsides:
      
      - All operations are per-gpiochip, which is the actual
        device underlying the GPIOs, making us tie in to the
        kernel device model properly.
      
      - Hotpluggable GPIO controllers can come and go, as this
        kind of problem has been know to userspace for character
        devices since ages, and if a gpiochip handle is held in
        userspace we know we will break something, whereas the
        sysfs is stateless.
      
      - The one-value-per-file rule of sysfs is really hard to
        maintain when you want to twist more than one knob at a time,
        for example have in-kernel APIs to switch several GPIO
        lines at the same time, and this will be possible to do
        with a single ioctl() from userspace, saving a lot of
        context switching.
      
      We also need to add a new bus type for GPIO. This is
      necessary for example for userspace coldplug, where sysfs is
      traversed to find the boot-time device nodes and create the
      character devices in /dev.
      
      This new chardev ABI is *non* *optional* and can be counted
      on to be present in the future, emphasizing the preference
      of this ABI.
      
      The ABI only implements one single ioctl() to get the name
      and number of GPIO lines of a chip. Even this is debatable:
      see it as a minimal example for review. This ABI shall be
      ruthlessly reviewed and etched in stone.
      
      The old /sys/class/gpio is still optional to compile in,
      but will be deprecated.
      
      Unique device IDs are created using IDR, which is overkill
      and insanely scalable, but also well tested.
      
      Cc: Johan Hovold <johan@kernel.org>
      Cc: Michael Welling <mwelling@ieee.org>
      Cc: Markus Pargmann <mpa@pengutronix.de>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      3c702e99
  19. 14 1月, 2016 1 次提交
  20. 12 12月, 2015 1 次提交
  21. 19 10月, 2015 1 次提交
  22. 17 10月, 2015 1 次提交
  23. 12 9月, 2015 1 次提交
    • M
      sys_membarrier(): system-wide memory barrier (generic, x86) · 5b25b13a
      Mathieu Desnoyers 提交于
      Here is an implementation of a new system call, sys_membarrier(), which
      executes a memory barrier on all threads running on the system.  It is
      implemented by calling synchronize_sched().  It can be used to
      distribute the cost of user-space memory barriers asymmetrically by
      transforming pairs of memory barriers into pairs consisting of
      sys_membarrier() and a compiler barrier.  For synchronization primitives
      that distinguish between read-side and write-side (e.g.  userspace RCU
      [1], rwlocks), the read-side can be accelerated significantly by moving
      the bulk of the memory barrier overhead to the write-side.
      
      The existing applications of which I am aware that would be improved by
      this system call are as follows:
      
      * Through Userspace RCU library (http://urcu.so)
        - DNS server (Knot DNS) https://www.knot-dns.cz/
        - Network sniffer (http://netsniff-ng.org/)
        - Distributed object storage (https://sheepdog.github.io/sheepdog/)
        - User-space tracing (http://lttng.org)
        - Network storage system (https://www.gluster.org/)
        - Virtual routers (https://events.linuxfoundation.org/sites/events/files/slides/DPDK_RCU_0MQ.pdf)
        - Financial software (https://lkml.org/lkml/2015/3/23/189)
      
      Those projects use RCU in userspace to increase read-side speed and
      scalability compared to locking.  Especially in the case of RCU used by
      libraries, sys_membarrier can speed up the read-side by moving the bulk of
      the memory barrier cost to synchronize_rcu().
      
      * Direct users of sys_membarrier
        - core dotnet garbage collector (https://github.com/dotnet/coreclr/issues/198)
      
      Microsoft core dotnet GC developers are planning to use the mprotect()
      side-effect of issuing memory barriers through IPIs as a way to implement
      Windows FlushProcessWriteBuffers() on Linux.  They are referring to
      sys_membarrier in their github thread, specifically stating that
      sys_membarrier() is what they are looking for.
      
      To explain the benefit of this scheme, let's introduce two example threads:
      
      Thread A (non-frequent, e.g. executing liburcu synchronize_rcu())
      Thread B (frequent, e.g. executing liburcu
      rcu_read_lock()/rcu_read_unlock())
      
      In a scheme where all smp_mb() in thread A are ordering memory accesses
      with respect to smp_mb() present in Thread B, we can change each
      smp_mb() within Thread A into calls to sys_membarrier() and each
      smp_mb() within Thread B into compiler barriers "barrier()".
      
      Before the change, we had, for each smp_mb() pairs:
      
      Thread A                    Thread B
      previous mem accesses       previous mem accesses
      smp_mb()                    smp_mb()
      following mem accesses      following mem accesses
      
      After the change, these pairs become:
      
      Thread A                    Thread B
      prev mem accesses           prev mem accesses
      sys_membarrier()            barrier()
      follow mem accesses         follow mem accesses
      
      As we can see, there are two possible scenarios: either Thread B memory
      accesses do not happen concurrently with Thread A accesses (1), or they
      do (2).
      
      1) Non-concurrent Thread A vs Thread B accesses:
      
      Thread A                    Thread B
      prev mem accesses
      sys_membarrier()
      follow mem accesses
                                  prev mem accesses
                                  barrier()
                                  follow mem accesses
      
      In this case, thread B accesses will be weakly ordered. This is OK,
      because at that point, thread A is not particularly interested in
      ordering them with respect to its own accesses.
      
      2) Concurrent Thread A vs Thread B accesses
      
      Thread A                    Thread B
      prev mem accesses           prev mem accesses
      sys_membarrier()            barrier()
      follow mem accesses         follow mem accesses
      
      In this case, thread B accesses, which are ensured to be in program
      order thanks to the compiler barrier, will be "upgraded" to full
      smp_mb() by synchronize_sched().
      
      * Benchmarks
      
      On Intel Xeon E5405 (8 cores)
      (one thread is calling sys_membarrier, the other 7 threads are busy
      looping)
      
      1000 non-expedited sys_membarrier calls in 33s =3D 33 milliseconds/call.
      
      * User-space user of this system call: Userspace RCU library
      
      Both the signal-based and the sys_membarrier userspace RCU schemes
      permit us to remove the memory barrier from the userspace RCU
      rcu_read_lock() and rcu_read_unlock() primitives, thus significantly
      accelerating them. These memory barriers are replaced by compiler
      barriers on the read-side, and all matching memory barriers on the
      write-side are turned into an invocation of a memory barrier on all
      active threads in the process. By letting the kernel perform this
      synchronization rather than dumbly sending a signal to every process
      threads (as we currently do), we diminish the number of unnecessary wake
      ups and only issue the memory barriers on active threads. Non-running
      threads do not need to execute such barrier anyway, because these are
      implied by the scheduler context switches.
      
      Results in liburcu:
      
      Operations in 10s, 6 readers, 2 writers:
      
      memory barriers in reader:    1701557485 reads, 2202847 writes
      signal-based scheme:          9830061167 reads,    6700 writes
      sys_membarrier:               9952759104 reads,     425 writes
      sys_membarrier (dyn. check):  7970328887 reads,     425 writes
      
      The dynamic sys_membarrier availability check adds some overhead to
      the read-side compared to the signal-based scheme, but besides that,
      sys_membarrier slightly outperforms the signal-based scheme. However,
      this non-expedited sys_membarrier implementation has a much slower grace
      period than signal and memory barrier schemes.
      
      Besides diminishing the number of wake-ups, one major advantage of the
      membarrier system call over the signal-based scheme is that it does not
      need to reserve a signal. This plays much more nicely with libraries,
      and with processes injected into for tracing purposes, for which we
      cannot expect that signals will be unused by the application.
      
      An expedited version of this system call can be added later on to speed
      up the grace period. Its implementation will likely depend on reading
      the cpu_curr()->mm without holding each CPU's rq lock.
      
      This patch adds the system call to x86 and to asm-generic.
      
      [1] http://urcu.so
      
      membarrier(2) man page:
      
      MEMBARRIER(2)              Linux Programmer's Manual             MEMBARRIER(2)
      
      NAME
             membarrier - issue memory barriers on a set of threads
      
      SYNOPSIS
             #include <linux/membarrier.h>
      
             int membarrier(int cmd, int flags);
      
      DESCRIPTION
             The cmd argument is one of the following:
      
             MEMBARRIER_CMD_QUERY
                    Query  the  set  of  supported commands. It returns a bitmask of
                    supported commands.
      
             MEMBARRIER_CMD_SHARED
                    Execute a memory barrier on all threads running on  the  system.
                    Upon  return from system call, the caller thread is ensured that
                    all running threads have passed through a state where all memory
                    accesses  to  user-space  addresses  match program order between
                    entry to and return from the system  call  (non-running  threads
                    are de facto in such a state). This covers threads from all pro=E2=80=90
                    cesses running on the system.  This command returns 0.
      
             The flags argument needs to be 0. For future extensions.
      
             All memory accesses performed  in  program  order  from  each  targeted
             thread is guaranteed to be ordered with respect to sys_membarrier(). If
             we use the semantic "barrier()" to represent a compiler barrier forcing
             memory  accesses  to  be performed in program order across the barrier,
             and smp_mb() to represent explicit memory barriers forcing full  memory
             ordering  across  the barrier, we have the following ordering table for
             each pair of barrier(), sys_membarrier() and smp_mb():
      
             The pair ordering is detailed as (O: ordered, X: not ordered):
      
                                    barrier()   smp_mb() sys_membarrier()
                    barrier()          X           X            O
                    smp_mb()           X           O            O
                    sys_membarrier()   O           O            O
      
      RETURN VALUE
             On success, these system calls return zero.  On error, -1 is  returned,
             and errno is set appropriately. For a given command, with flags
             argument set to 0, this system call is guaranteed to always return the
             same value until reboot.
      
      ERRORS
             ENOSYS System call is not implemented.
      
             EINVAL Invalid arguments.
      
      Linux                             2015-04-15                     MEMBARRIER(2)
      Signed-off-by: NMathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Reviewed-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Reviewed-by: NJosh Triplett <josh@joshtriplett.org>
      Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Nicholas Miell <nmiell@comcast.net>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Alan Cox <gnomes@lxorguk.ukuu.org.uk>
      Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
      Cc: Stephen Hemminger <stephen@networkplumber.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Pranith Kumar <bobby.prani@gmail.com>
      Cc: Michael Kerrisk <mtk.manpages@gmail.com>
      Cc: Shuah Khan <shuahkh@osg.samsung.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5b25b13a
  24. 05 9月, 2015 1 次提交
    • A
      userfaultfd: uAPI · 1038628d
      Andrea Arcangeli 提交于
      Defines the uAPI of the userfaultfd, notably the ioctl numbers and protocol.
      Signed-off-by: NAndrea Arcangeli <aarcange@redhat.com>
      Acked-by: NPavel Emelyanov <xemul@parallels.com>
      Cc: Sanidhya Kashyap <sanidhya.gatech@gmail.com>
      Cc: zhang.zhanghailiang@huawei.com
      Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
      Cc: Andres Lagar-Cavilla <andreslc@google.com>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Peter Feiner <pfeiner@google.com>
      Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: "Huangpeng (Peter)" <peter.huangpeng@huawei.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1038628d
  25. 27 7月, 2015 1 次提交
  26. 25 6月, 2015 1 次提交
    • D
      libnvdimm: control (ioctl) messages for nvdimm_bus and nvdimm devices · 62232e45
      Dan Williams 提交于
      Most discovery/configuration of the nvdimm-subsystem is done via sysfs
      attributes.  However, some nvdimm_bus instances, particularly the
      ACPI.NFIT bus, define a small set of messages that can be passed to the
      platform.  For convenience we derive the initial libnvdimm-ioctl command
      formats directly from the NFIT DSM Interface Example formats.
      
          ND_CMD_SMART: media health and diagnostics
          ND_CMD_GET_CONFIG_SIZE: size of the label space
          ND_CMD_GET_CONFIG_DATA: read label space
          ND_CMD_SET_CONFIG_DATA: write label space
          ND_CMD_VENDOR: vendor-specific command passthrough
          ND_CMD_ARS_CAP: report address-range-scrubbing capabilities
          ND_CMD_ARS_START: initiate scrubbing
          ND_CMD_ARS_STATUS: report on scrubbing state
          ND_CMD_SMART_THRESHOLD: configure alarm thresholds for smart events
      
      If a platform later defines different commands than this set it is
      straightforward to extend support to those formats.
      
      Most of the commands target a specific dimm.  However, the
      address-range-scrubbing commands target the bus.  The 'commands'
      attribute in sysfs of an nvdimm_bus, or nvdimm, enumerate the supported
      commands for that object.
      
      Cc: <linux-acpi@vger.kernel.org>
      Cc: Robert Moore <robert.moore@intel.com>
      Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reported-by: NNicholas Moulin <nicholas.w.moulin@linux.intel.com>
      Acked-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      62232e45
  27. 03 6月, 2015 1 次提交
    • D
      Add virtio gpu driver. · dc5698e8
      Dave Airlie 提交于
      This patch adds a kms driver for the virtio gpu.  The xorg modesetting
      driver can handle the device just fine, the framebuffer for fbcon is
      there too.
      
      Qemu patches for the host side are under review currently.
      
      The pci version of the device comes in two variants: with and without
      vga compatibility.  The former has a extra memory bar for the vga
      framebuffer, the later is a pure virtio device.  The only concern for
      this driver is that in the virtio-vga case we have to kick out the
      firmware framebuffer.
      
      Initial revision has only 2d support, 3d (virgl) support requires
      some more work on the qemu side and will be added later.
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      dc5698e8
  28. 01 6月, 2015 1 次提交
  29. 25 5月, 2015 1 次提交
  30. 03 4月, 2015 1 次提交
  31. 29 3月, 2015 1 次提交
  32. 17 2月, 2015 1 次提交
  33. 15 2月, 2015 1 次提交
  34. 20 1月, 2015 1 次提交
  35. 23 12月, 2014 1 次提交
  36. 09 12月, 2014 3 次提交
  37. 06 12月, 2014 1 次提交
  38. 05 12月, 2014 1 次提交