1. 09 8月, 2014 8 次提交
    • V
      nilfs2: add /sys/fs/nilfs2/<device>/mounted_snapshots/<snapshot> group · a5a7332a
      Vyacheslav Dubeyko 提交于
      This patch adds creation of <snapshot> group for every mounted
      snapshot in /sys/fs/nilfs2/<device>/mounted_snapshots group.
      
      The group contains details about mounted snapshot:
      (1) inodes_count - show number of inodes for snapshot.
      (2) blocks_count - show number of blocks for snapshot.
      Signed-off-by: NVyacheslav Dubeyko <Vyacheslav.Dubeyko@hgst.com>
      Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
      Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: Michael L. Semon <mlsemon35@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a5a7332a
    • V
      nilfs2: add /sys/fs/nilfs2/<device>/mounted_snapshots group · a2ecb791
      Vyacheslav Dubeyko 提交于
      This patch adds creation of /sys/fs/nilfs2/<device>/mounted_snapshots
      group.
      
      The mounted_snapshots group contains group for every
      mounted snapshot.
      Signed-off-by: NVyacheslav Dubeyko <Vyacheslav.Dubeyko@hgst.com>
      Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
      Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: Michael L. Semon <mlsemon35@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a2ecb791
    • V
      nilfs2: add /sys/fs/nilfs2/<device>/checkpoints group · 02a0ba1c
      Vyacheslav Dubeyko 提交于
      This patch adds creation of /sys/fs/nilfs2/<device>/checkpoints
      group.
      
      The checkpoints group contains attributes that describe
      details about volume's checkpoints:
      (1) checkpoints_number - show number of checkpoints on volume.
      (2) snapshots_number - show number of snapshots on volume.
      (3) last_seg_checkpoint - show checkpoint number of the latest segment.
      (4) next_checkpoint - show next checkpoint number.
      Signed-off-by: NVyacheslav Dubeyko <Vyacheslav.Dubeyko@hgst.com>
      Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
      Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: Michael L. Semon <mlsemon35@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      02a0ba1c
    • V
      nilfs2: add /sys/fs/nilfs2/<device>/segments group · ef43d5cd
      Vyacheslav Dubeyko 提交于
      This patch adds creation of /sys/fs/nilfs2/<device>/segments
      group.
      
      The segments group contains attributes that describe
      details about volume's segments:
      (1) segments_number - show number of segments on volume.
      (2) blocks_per_segment - show number of blocks in segment.
      (3) clean_segments - show count of clean segments.
      (4) dirty_segments - show count of dirty segments.
      Signed-off-by: NVyacheslav Dubeyko <Vyacheslav.Dubeyko@hgst.com>
      Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
      Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: Michael L. Semon <mlsemon35@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ef43d5cd
    • V
      nilfs2: add /sys/fs/nilfs2/<device>/segctor group · abc968db
      Vyacheslav Dubeyko 提交于
      This patch adds creation of /sys/fs/nilfs2/<device>/segctor
      group.
      
      The segctor group contains attributes that describe
      segctor thread activity details:
      (1) last_pseg_block - show start block number of the latest segment.
      (2) last_seg_sequence - show sequence value of the latest segment.
      (3) last_seg_checkpoint - show checkpoint number of the latest segment.
      (4) current_seg_sequence - show segment sequence counter.
      (5) current_last_full_seg - show index number of the latest full segment.
      (6) next_full_seg - show index number of the full segment index
      to be used next.
      (7) next_pseg_offset - show offset of next partial segment in
      the current full segment.
      (8) next_checkpoint - show next checkpoint number.
      (9) last_seg_write_time - show write time of the last segment
      in human-readable format.
      (10) last_seg_write_time_secs - show write time of the last segment
      in seconds.
      (11) last_nongc_write_time - show write time of the last segment
      not for cleaner operation in human-readable format.
      (12) last_nongc_write_time_secs - show write time of the last segment
      not for cleaner operation in seconds.
      (13) dirty_data_blocks_count - show number of dirty data blocks.
      Signed-off-by: NVyacheslav Dubeyko <Vyacheslav.Dubeyko@hgst.com>
      Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
      Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: Michael L. Semon <mlsemon35@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      abc968db
    • V
      nilfs2: add /sys/fs/nilfs2/<device>/superblock group · caa05d49
      Vyacheslav Dubeyko 提交于
      This patch adds creation of /sys/fs/nilfs2/<device>/superblock
      group.
      
      The superblock group contains attributes that describe
      superblock's details:
      (1) sb_write_time - show previous write time of super block in
      human-readable format.
      (2) sb_write_time_secs - show previous write time of super block
      in seconds.
      (3) sb_write_count - show write count of super block.
      (4) sb_update_frequency - show/set interval of periodical update
      of superblock (in seconds). You can set preferable frequency of
      superblock update by command:
      
      echo <value> > /sys/fs/nilfs2/<device>/superblock/sb_update_frequency
      Signed-off-by: NVyacheslav Dubeyko <Vyacheslav.Dubeyko@hgst.com>
      Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
      Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: Michael L. Semon <mlsemon35@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      caa05d49
    • V
      nilfs2: add /sys/fs/nilfs2/<device> group · da7141fb
      Vyacheslav Dubeyko 提交于
      This patch adds creation of /sys/fs/nilfs2/<device> group.
      
      The <device> group contains attributes that describe file
      system partition's details:
      (1) revision - show NILFS file system revision.
      (2) blocksize - show volume block size in bytes.
      (3) device_size - show volume size in bytes.
      (4) free_blocks - show count of free blocks on volume.
      (5) uuid - show volume's UUID.
      (6) volume_name - show volume's name.
      Signed-off-by: NVyacheslav Dubeyko <Vyacheslav.Dubeyko@hgst.com>
      Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
      Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: Michael L. Semon <mlsemon35@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      da7141fb
    • V
      nilfs2: add /sys/fs/nilfs2/features group · aebe17f6
      Vyacheslav Dubeyko 提交于
      This patchset implements creation of sysfs groups and attributes with
      the purpose to show NILFS2 volume details, internal state of the driver
      and to manage internal state of NILFS2 driver.
      
      Sysfs is a virtual file system that exports information about devices
      and drivers from the kernel device model to user space, and is also used
      for configuration.  NILFS2 is a complex file system that has segctor
      thread, GC thread, checkpoint/snapshot model and so on.  Sysfs namespace
      provides native and easy way for: (1) getting info and statistics about
      volume state; (2) getting info and configuration of internal subsystems
      (segctor thread); (3) snapshots management.
      
      Suggested patchset provides basis for managing segctor thread behaviour
      and manipulation by snapshots.  Currently, it informs only about segctor
      thread's internal parameters and about mounted snapshots.  But sysfs
      interface can provide easy and simple way for deep management of segctor
      thread and snapshots.
      
      This patchset provides opportunity to manage interval of periodical
      update of superblock (in seconds).  Default value is 10 seconds.  Now a
      user can increase this value by means of
      nilfs2/<device>/superblock/sb_update_frequency attribute in the case of
      necessity.
      
      Also the patchset provides opportunity to get information easily about
      key volumes's parameters (free blocks, superblock write count,
      superblock update frequency, latest segment info, dirty data blocks
      count, count of clean segments, count of dirty segments and so on) in
      real time manner.  Such information can be used in scripts for subtle
      management of filesystem.
      
      Implemented functionality creates such groups:
      (1) /sys/fs/nilfs2 - root group
      (2) /sys/fs/nilfs2/features - group contains attributes that describe NILFS
      file system driver features
      (3) /sys/fs/nilfs2/<device> - group contains attributes that describe file
      system partition's details
      (4) /sys/fs/nilfs2/<device>/superblock - group contains attributes that describe
      superblock's details
      (5) /sys/fs/nilfs2/<device>/segctor - group contains attributes that describe
      segctor thread activity details
      (6) /sys/fs/nilfs2/<device>/segments - group contains attributes that describe
      details about volume's segments
      (7) /sys/fs/nilfs2/<device>/checkpoints - group contains attributes that describe
      details about volume's checkpoints
      (8) /sys/fs/nilfs2/<device>/mounted_snapshots - group contains group for every
      mounted snapshot
      (9) /sys/fs/nilfs2/<device>/mounted_snapshots/<snapshot> - group contains
      details about mounted snapshot
      
      This patch (of 9):
      
      This patch adds code of creation /sys/fs/nilfs2 group and
      /sys/fs/nilfs2/features group.
      
      The features group contains attributes that describe NILFS
      file system driver features:
      (1) revision - show current revision of NILFS file system driver.
      
      There are two formats of timestamp output - seconds and human-readable
      format.  Every showed timestamp has two sysfs files (time-<xxx> and
      time-<xxx>-secs).  One sysfs file (time-<xxx>) shows time in
      human-readable format.  Another sysfs file (time-<xxx>-secs) shows time in
      seconds.
      
      It was reported by Michael Semon that timestamp output in human-readable
      format should be changed from "2014-4-12 14:5:38" to "2014-04-12
      14:05:38".  Second version of the patch fixes this issue.
      Reported-by: NMichael L. Semon <mlsemon35@gmail.com>
      Signed-off-by: NVyacheslav Dubeyko <Vyacheslav.Dubeyko@hgst.com>
      Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
      Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      aebe17f6
  2. 08 8月, 2014 1 次提交
  3. 01 8月, 2014 1 次提交
  4. 29 7月, 2014 2 次提交
  5. 26 7月, 2014 1 次提交
  6. 25 7月, 2014 1 次提交
  7. 20 7月, 2014 1 次提交
  8. 18 7月, 2014 2 次提交
    • Y
      serial/uart/8250: Add tunable RX interrupt trigger I/F of FIFO buffers · aef9a7bd
      Yoshihiro YUNOMAE 提交于
      Add tunable RX interrupt trigger I/F of FIFO buffers.
      
      Serial devices are used as not only message communication devices but control
      or sending communication devices. For the latter uses, normally small data
      will be exchanged, so user applications want to receive data unit as soon as
      possible for real-time tendency. If we have a sensor which sends a 1 byte data
      each time and must control a device based on the sensor feedback, the RX
      interrupt should be triggered for each data.
      
      According to HW specification of serial UART devices, RX interrupt trigger
      can be changed, but the trigger is hard-coded. For example, RX interrupt trigger
      in 16550A can be set to 1, 4, 8, or 14 bytes for HW, but current driver sets
      the trigger to only 8bytes.
      
      This patch makes some devices change RX interrupt trigger from userland.
      
      <How to use>
      - Read current setting
       # cat /sys/class/tty/ttyS0/rx_trig_bytes
       8
      
      - Write user setting
       # echo 1 > /sys/class/tty/ttyS0/rx_trig_bytes
       # cat /sys/class/tty/ttyS0/rx_trig_bytes
       1
      
      <Support uart devices>
      - 16550A and Tegra (1, 4, 8, or 14 bytes)
      - 16650V2 (8, 16, 24, or 28 bytes)
      - 16654 (8, 16, 56, or 60 bytes)
      - 16750 (1, 16, 32, or 56 bytes)
      
      <Change log>
      Changes in V9:
       - Use attr_group instead of dev_spec_attr_group of uart_port structure
      
      Changes in V8:
       - Divide this patch from V7's patch based on Greg's comment
      
      Changes in V7:
       - Add Documentation
       - Change I/F name from rx_int_trig to rx_trig_bytes because the name
         rx_int_trig is hard to understand how users specify the value
      
      Changes in V6:
       - Move FCR_RX_TRIG_* definition in 8250.h to include/uapi/linux/serial_reg.h,
         rename those to UART_FCR_R_TRIG_*, and use UART_FCR_TRIGGER_MASK to
         UART_FCR_R_TRIG_BITS()
       - Change following function names:
          convert_fcr2val() => fcr_get_rxtrig_bytes()
          convert_val2rxtrig() => bytes_to_fcr_rxtrig()
       - Fix typo in serial8250_do_set_termios()
       - Delete the verbose error message pr_info() in bytes_to_fcr_rxtrig()
       - Rename *rx_int_trig/rx_trig* to *rxtrig* for several functions or variables
         (but UI remains rx_int_trig)
       - Change the meaningless variable name 'val' to 'bytes' following functions:
          fcr_get_rxtrig_bytes(), bytes_to_fcr_rxtrig(), do_set_rxtrig(),
          do_serial8250_set_rxtrig(), and serial8250_set_attr_rxtrig()
       - Use up->fcr in order to get rxtrig_bytes instead of rx_trig_raw in
         fcr_get_rxtrig_bytes()
       - Use conf_type->rxtrig_bytes[0] instead of switch statement for support check
         in register_dev_spec_attr_grp()
       - Delete the checking whether a user changed FCR or not when minimum buffer
         is needed in serial8250_do_set_termios()
      
      Changes in V5.1:
       - Fix FCR_RX_TRIG_MAX_STATE definition
      
      Changes in V5:
       - Support Tegra, 16650V2, 16654, and 16750
       - Store default FCR value to up->fcr when the port is first created
       - Add rx_trig_byte[] in uart_config[] for each device and use rx_trig_byte[]
         in convert_fcr2val() and convert_val2rxtrig()
      
      Changes in V4:
       - Introduce fifo_bug flag in uart_8250_port structure
         This is enabled only when parity is enabled and UART_BUG_PARITY is enabled
         for up->bugs. If this flag is enabled, user cannot set RX trigger.
       - Return -EOPNOTSUPP when it does not support device at convert_fcr2val() and
         at convert_val2rxtrig()
       - Set the nearest lower RX trigger when users input a meaningless value at
         convert_val2rxtrig()
       - Check whether p->fcr is existing at serial8250_clear_and_reinit_fifos()
       - Set fcr = up->fcr in the begging of serial8250_do_set_termios()
      
      Changes in V3:
       - Change I/F from ioctl(2) to sysfs(rx_int_trig)
      
      Changed in V2:
       - Use _IOW for TIOCSFIFORTRIG definition
       - Pass the interrupt trigger value itself
      Signed-off-by: NYoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      aef9a7bd
    • P
      USB: Add LVS Test device driver · ce21bfe6
      Pratyush Anand 提交于
      OTG3 and EH Compliance Plan 1.0 talks about Super Speed OTG Verification
      system (SS-OVS) which consists of an excersizer and analyzer.
      
      USB Compliance Suite from Lecroy or Ellisys can act as such SS-OVS for
      Link Layer Validation (LVS).
      
      Some modifications are needed for an embedded Linux USB host to pass all
      these tests.  Most of these tests require just Link to be in U0. They do
      not work with default Linux USB stack since, default stack does port
      reset and then starts sending setup packet, which is not expected by
      Link Layer Validation (LVS) device of Lecroy Compliance Suit.  Then,
      There are many Link Layer Tests which need host to generate specific
      traffic.
      
      This patch supports specific traffic generation cases. As of now all the
      host Lecroy Link Layer-USBIF tests (except TD7.26) passes
      with this patch for single run using  Lecroy USB Compliance Suite
      Version 1.98 Build 239 and Lecroy USB Protocol Analyzer version 4.80
      Build 1603. Therefore patch seems to be a good candidate for inclusion.
      Further modification can be done on top of it.
      
      lvstest driver will not bind to any device by default. It can bind
      manually to a super speed USB host controller root hub. Therefore, regular
      hub driver must be unbound before this driver is bound. For example, if
      2-0:1.0 is the xhci root hub, then execute following to unbind hub driver.
      
       echo 2-0:1.0 > /sys/bus/usb/drivers/hub/unbind
      
      Then write Linux Foundation's vendor ID which is used by root hubs and
      SS root hub's device ID into new_id file. Writing IDs into new_id file
      will also bind the lvs driver with any available SS root hub interfaces.
      
       echo "1D6B 3" > /sys/bus/usb/drivers/lvs/new_id
      
      Now connect LVS device with root hub port.
      
      Test case specific traffic can be generated as follows whenever needed:
      
      1. To issue "Get Device descriptor" command for TD.7.06:
       echo  > /sys/bus/usb/devices/2-0\:1.0/get_dev_desc
      
      2. To set U1 timeout to 127 for TD.7.18
       echo 127 > /sys/bus/usb/devices/2-0\:1.0/u1_timeout
      
      3. To set U2 timeout to 0 for TD.7.18
       echo 0 > /sys/bus/usb/devices/2-0\:1.0/u2_timeout
      
      4. To issue "Hot Reset" for TD.7.29
       echo  > /sys/bus/usb/devices/2-0\:1.0/hot_reset
      
      5. To issue "U3 Entry" for TD.7.35
       echo  > /sys/bus/usb/devices/2-0\:1.0/u3_entry
      
      6. To issue "U3 Exit" for TD.7.36
       echo  > /sys/bus/usb/devices/2-0\:1.0/u3_exit
      Signed-off-by: NPratyush Anand <pratyush.anand@st.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ce21bfe6
  9. 17 7月, 2014 2 次提交
  10. 16 7月, 2014 1 次提交
    • T
      net: add name_assign_type netdev attribute · 685343fc
      Tom Gundersen 提交于
      Based on a patch by David Herrmann.
      
      The name_assign_type attribute gives hints where the interface name of a
      given net-device comes from. These values are currently defined:
        NET_NAME_ENUM:
          The ifname is provided by the kernel with an enumerated
          suffix, typically based on order of discovery. Names may
          be reused and unpredictable.
        NET_NAME_PREDICTABLE:
          The ifname has been assigned by the kernel in a predictable way
          that is guaranteed to avoid reuse and always be the same for a
          given device. Examples include statically created devices like
          the loopback device and names deduced from hardware properties
          (including being given explicitly by the firmware). Names
          depending on the order of discovery, or in any other way on the
          existence of other devices, must not be marked as PREDICTABLE.
        NET_NAME_USER:
          The ifname was provided by user-space during net-device setup.
        NET_NAME_RENAMED:
          The net-device has been renamed from userspace. Once this type is set,
          it cannot change again.
        NET_NAME_UNKNOWN:
          This is an internal placeholder to indicate that we yet haven't yet
          categorized the name. It will not be exposed to userspace, rather
          -EINVAL is returned.
      
      The aim of these patches is to improve user-space renaming of interfaces. As
      a general rule, userspace must rename interfaces to guarantee that names stay
      the same every time a given piece of hardware appears (at boot, or when
      attaching it). However, there are several situations where userspace should
      not perform the renaming, and that depends on both the policy of the local
      admin, but crucially also on the nature of the current interface name.
      
      If an interface was created in repsonse to a userspace request, and userspace
      already provided a name, we most probably want to leave that name alone. The
      main instance of this is wifi-P2P devices created over nl80211, which currently
      have a long-standing bug where they are getting renamed by udev. We label such
      names NET_NAME_USER.
      
      If an interface, unbeknown to us, has already been renamed from userspace, we
      most probably want to leave also that alone. This will typically happen when
      third-party plugins (for instance to udev, but the interface is generic so could
      be from anywhere) renames the interface without informing udev about it. A
      typical situation is when you switch root from an installer or an initrd to the
      real system and the new instance of udev does not know what happened before
      the switch. These types of problems have caused repeated issues in the past. To
      solve this, once an interface has been renamed, its name is labelled
      NET_NAME_RENAMED.
      
      In many cases, the kernel is actually able to name interfaces in such a
      way that there is no need for userspace to rename them. This is the case when
      the enumeration order of devices, or in fact any other (non-parent) device on
      the system, can not influence the name of the interface. Examples include
      statically created devices, or any naming schemes based on hardware properties
      of the interface. In this case the admin may prefer to use the kernel-provided
      names, and to make that possible we label such names NET_NAME_PREDICTABLE.
      We want the kernel to have tho possibilty of performing predictable interface
      naming itself (and exposing to userspace that it has), as the information
      necessary for a proper naming scheme for a certain class of devices may not
      be exposed to userspace.
      
      The case where renaming is almost certainly desired, is when the kernel has
      given the interface a name using global device enumeration based on order of
      discovery (ethX, wlanY, etc). These naming schemes are labelled NET_NAME_ENUM.
      
      Lastly, a fallback is left as NET_NAME_UNKNOWN, to indicate that a driver has
      not yet been ported. This is mostly useful as a transitionary measure, allowing
      us to label the various naming schemes bit by bit.
      
      v8: minor documentation fixes
      v9: move comment to the right commit
      Signed-off-by: NTom Gundersen <teg@jklm.no>
      Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Reviewed-by: NKay Sievers <kay@vrfy.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      685343fc
  11. 15 7月, 2014 1 次提交
  12. 10 7月, 2014 3 次提交
  13. 09 7月, 2014 2 次提交
  14. 04 7月, 2014 4 次提交
    • A
      iommu/amd: Add sysfs support · 066f2e98
      Alex Williamson 提交于
      AMD-Vi support for IOMMU sysfs.  This allows us to associate devices
      with a specific IOMMU device and examine the capabilities and features
      of that IOMMU.  The AMD IOMMU is hosted on and actual PCI device, so
      we make that device the parent for the IOMMU class device.  This
      initial implementaiton exposes only the capability header and extended
      features register for the IOMMU.
      
      # find /sys | grep ivhd
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/devices
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/devices/0000:00:00.0
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/devices/0000:00:02.0
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/devices/0000:00:04.0
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/devices/0000:00:09.0
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/devices/0000:00:11.0
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/devices/0000:00:12.0
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/devices/0000:00:12.2
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/devices/0000:00:13.0
      ...
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/power
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/power/control
      ...
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/device
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/subsystem
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/amd-iommu
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/amd-iommu/cap
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/amd-iommu/features
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/uevent
      /sys/class/iommu/ivhd0
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      066f2e98
    • A
      iommu/vt-d: Make use of IOMMU sysfs support · a5459cfe
      Alex Williamson 提交于
      Register our DRHD IOMMUs, cross link devices, and provide a base set
      of attributes for the IOMMU.  Note that IRQ remapping support parses
      the DMAR table very early in boot, well before the iommu_class can
      reasonably be setup, so our registration is split between
      intel_iommu_init(), which occurs later, and alloc_iommu(), which
      typically occurs much earlier, but may happen at any time later
      with IOMMU hot-add support.
      
      On a typical desktop system, this provides the following (pruned):
      
      $ find /sys | grep dmar
      /sys/devices/virtual/iommu/dmar0
      /sys/devices/virtual/iommu/dmar0/devices
      /sys/devices/virtual/iommu/dmar0/devices/0000:00:02.0
      /sys/devices/virtual/iommu/dmar0/intel-iommu
      /sys/devices/virtual/iommu/dmar0/intel-iommu/cap
      /sys/devices/virtual/iommu/dmar0/intel-iommu/ecap
      /sys/devices/virtual/iommu/dmar0/intel-iommu/address
      /sys/devices/virtual/iommu/dmar0/intel-iommu/version
      /sys/devices/virtual/iommu/dmar1
      /sys/devices/virtual/iommu/dmar1/devices
      /sys/devices/virtual/iommu/dmar1/devices/0000:00:00.0
      /sys/devices/virtual/iommu/dmar1/devices/0000:00:01.0
      /sys/devices/virtual/iommu/dmar1/devices/0000:00:16.0
      /sys/devices/virtual/iommu/dmar1/devices/0000:00:1a.0
      /sys/devices/virtual/iommu/dmar1/devices/0000:00:1b.0
      /sys/devices/virtual/iommu/dmar1/devices/0000:00:1c.0
      ...
      /sys/devices/virtual/iommu/dmar1/intel-iommu
      /sys/devices/virtual/iommu/dmar1/intel-iommu/cap
      /sys/devices/virtual/iommu/dmar1/intel-iommu/ecap
      /sys/devices/virtual/iommu/dmar1/intel-iommu/address
      /sys/devices/virtual/iommu/dmar1/intel-iommu/version
      /sys/class/iommu/dmar0
      /sys/class/iommu/dmar1
      
      (devices also link back to the dmar units)
      
      This makes address, version, capabilities, and extended capabilities
      available, just like printed on boot.  I've tried not to duplicate
      data that can be found in the DMAR table, with the exception of the
      address, which provides an easy way to associate the sysfs device with
      a DRHD entry in the DMAR.  It's tempting to add scopes and RMRR data
      here, but the full DMAR table is already exposed under /sys/firmware/
      and therefore already provides a way for userspace to learn such
      details.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      a5459cfe
    • A
      iommu: Add sysfs support for IOMMUs · c61959ec
      Alex Williamson 提交于
      IOMMUs currently have no common representation to userspace, most
      seem to have no representation at all aside from a few printks
      on bootup.  There are however features of IOMMUs that are useful
      to know about.  For instance the IOMMU might support superpages,
      making use of processor large/huge pages more important in a device
      assignment scenario.  It's also useful to create cross links between
      devices and IOMMU hardware units, so that users might be able to
      load balance their devices to avoid thrashing a single hardware unit.
      
      This patch adds a device create and destroy interface as well as
      device linking, making it very lightweight for an IOMMU driver to add
      basic support.  IOMMU drivers can provide additional attributes
      automatically by using an attribute_group.
      
      The attributes exposed are expected to be relatively device specific,
      the means to retrieve them certainly are, so there are currently no
      common attributes for the new class created here.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      c61959ec
    • J
      HID: gt683r: move mode attribute to led-class devices · 6522fe1c
      Janne Kanniainen 提交于
      Move led_mode attribute from HID device to led-class devices and
      rename it mode. This will also fix race condition by using
      attribute-groups.
      
      (cooloney@gmai.com: fix a typo in commit message)
      Signed-off-by: NJanne Kanniainen <janne.kanniainen@gmail.com>
      Reviewed-by: NJohan Hovold <johan@kernel.org>
      Signed-off-by: NBryan Wu <cooloney@gmail.com>
      6522fe1c
  15. 01 7月, 2014 1 次提交
  16. 14 6月, 2014 1 次提交
  17. 04 6月, 2014 1 次提交
    • M
      ima: audit log files opened with O_DIRECT flag · f9b2a735
      Mimi Zohar 提交于
      Files are measured or appraised based on the IMA policy.  When a
      file, in policy, is opened with the O_DIRECT flag, a deadlock
      occurs.
      
      The first attempt at resolving this lockdep temporarily removed the
      O_DIRECT flag and restored it, after calculating the hash.  The
      second attempt introduced the O_DIRECT_HAVELOCK flag. Based on this
      flag, do_blockdev_direct_IO() would skip taking the i_mutex a second
      time.  The third attempt, by Dmitry Kasatkin, resolves the i_mutex
      locking issue, by re-introducing the IMA mutex, but uncovered
      another problem.  Reading a file with O_DIRECT flag set, writes
      directly to userspace pages.  A second patch allocates a user-space
      like memory.  This works for all IMA hooks, except ima_file_free(),
      which is called on __fput() to recalculate the file hash.
      
      Until this last issue is addressed, do not 'collect' the
      measurement for measuring, appraising, or auditing files opened
      with the O_DIRECT flag set.  Based on policy, permit or deny file
      access.  This patch defines a new IMA policy rule option named
      'permit_directio'.  Policy rules could be defined, based on LSM
      or other criteria, to permit specific applications to open files
      with the O_DIRECT flag set.
      
      Changelog v1:
      - permit or deny file access based IMA policy rules
      Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
      Acked-by: NDmitry Kasatkin <d.kasatkin@samsung.com>
      Cc: <stable@vger.kernel.org>
      f9b2a735
  18. 03 6月, 2014 1 次提交
  19. 30 5月, 2014 1 次提交
  20. 29 5月, 2014 1 次提交
    • A
      PCI: Introduce new device binding path using pci_dev.driver_override · 782a985d
      Alex Williamson 提交于
      The driver_override field allows us to specify the driver for a device
      rather than relying on the driver to provide a positive match of the
      device.  This shortcuts the existing process of looking up the vendor and
      device ID, adding them to the driver new_id, binding the device, then
      removing the ID, but it also provides a couple advantages.
      
      First, the above existing process allows the driver to bind to any device
      matching the new_id for the window where it's enabled.  This is often not
      desired, such as the case of trying to bind a single device to a meta
      driver like pci-stub or vfio-pci.  Using driver_override we can do this
      deterministically using:
      
        echo pci-stub > /sys/bus/pci/devices/0000:03:00.0/driver_override
        echo 0000:03:00.0 > /sys/bus/pci/devices/0000:03:00.0/driver/unbind
        echo 0000:03:00.0 > /sys/bus/pci/drivers_probe
      
      Previously we could not invoke drivers_probe after adding a device to
      new_id for a driver as we get non-deterministic behavior whether the driver
      we intend or the standard driver will claim the device.  Now it becomes a
      deterministic process, only the driver matching driver_override will probe
      the device.
      
      To return the device to the standard driver, we simply clear the
      driver_override and reprobe the device:
      
        echo > /sys/bus/pci/devices/0000:03:00.0/driver_override
        echo 0000:03:00.0 > /sys/bus/pci/devices/0000:03:00.0/driver/unbind
        echo 0000:03:00.0 > /sys/bus/pci/drivers_probe
      
      Another advantage to this approach is that we can specify a driver override
      to force a specific binding or prevent any binding.  For instance when an
      IOMMU group is exposed to userspace through VFIO we require that all
      devices within that group are owned by VFIO.  However, devices can be
      hot-added into an IOMMU group, in which case we want to prevent the device
      from binding to any driver (override driver = "none") or perhaps have it
      automatically bind to vfio-pci.  With driver_override it's a simple matter
      for this field to be set internally when the device is first discovered to
      prevent driver matches.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Reviewed-by: NAlexander Graf <agraf@suse.de>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      782a985d
  21. 28 5月, 2014 1 次提交
  22. 26 5月, 2014 3 次提交