1. 07 Oct, 2012 1 commit
  2. 06 Oct, 2012 1 commit
    • Lance Ortiz's avatar
      ACPI: Add new sysfs interface to export device description · d1efe3c3
      Lance Ortiz authored
      Add support to export the device description obtained from the ACPI _STR
      method, if one exists for a device, to user-space via a sysfs interface.
      This new interface provides a standard and platform neutral way for users
      to obtain the description text stored in the ACPI _STR method.  If no
      _STR method exists for the device, no sysfs 'description' file will be
      created.  The 'description' file will be located in the /sys/devices/
      directory using the device's path.
      
      /sys/device/<bus>/<bridge path>/<device path>.../firmware_node/description
      
      Example:
      
      /sys/devices/pci0000:00/0000:00.07.0/0000:0e:00.0/firmware_node/description
      
      It can also be located using the ACPI device path, for example:
      
      /sys/devices/LNXSYSTM:00/device:00/ACPI0004:00/PNP0A08:00/device:13/device:15/description
      /sys/devices/LNXSYSTM:00/device:00/ACPI0004:00/ACPI0004:01/ACPI0007:02/description
      
      Execute the 'cat' command on the 'description' file to obtain the
      description string for that device.
      
      This patch also includes documentation describing how the new sysfs
      interface works
      
      Changes from v1-v2 based on comments by Len Brown and Fengguang Wu
      * Removed output "No Description" and leaving a NULL attribute if the
      _STR method failed to evaluate.
      
      * In acpi_device_remove_files() removed the redundent check of
      dev->pnp.str_obj before calling free.  This check triggered a message
      from smatch.
      Signed-off-by: default avatarLance Ortiz <lance.ortiz@hp.com>
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      d1efe3c3
  3. 01 Oct, 2012 3 commits
    • Alex Elder's avatar
      rbd: add an rbd features field · 34b13184
      Alex Elder authored
      Record the features values for each rbd image and each of its
      snapshots.  This is really something that only becomes meaningful
      for version 2 images, so this is just putting in place code
      that will form common infrastructure.
      
      It may be useful to expand the sysfs entries--and therefore the
      information we maintain--for the image and for each snapshot.
      But I'm going to hold off doing that until we start making
      active use of the feature bits.
      Signed-off-by: default avatarAlex Elder <elder@inktank.com>
      Reviewed-by: default avatarJosh Durgin <josh.durgin@inktank.com>
      34b13184
    • Alex Elder's avatar
      rbd: kill create_snap sysfs entry · 02cdb02c
      Alex Elder authored
      Josh proposed the following change, and I don't think I could
      explain it any better than he did:
      
          From: Josh Durgin <josh.durgin@inktank.com>
          Date: Tue, 24 Jul 2012 14:22:11 -0700
          To: ceph-devel <ceph-devel@vger.kernel.org>
          Message-ID: <500F1203.9050605@inktank.com>
      
          Right now the kernel still has one piece of rbd management
          duplicated from the rbd command line tool: snapshot creation.
          There's nothing special about snapshot creation that makes it
          advantageous to do from the kernel, so I'd like to remove the
          create_snap sysfs interface.  That is,
      	/sys/bus/rbd/devices/<id>/create_snap
          would be removed.
      
          Does anyone rely on the sysfs interface for creating rbd
          snapshots?  If so, how hard would it be to replace with:
      
      	rbd snap create pool/image@snap
      
          Is there any benefit to the sysfs interface that I'm missing?
      
          Josh
      
      This patch implements this proposal, removing the code that
      implements the "snap_create" sysfs interface for rbd images.
      As a result, quite a lot of other supporting code goes away.
      Suggested-by: default avatarJosh Durgin <josh.durgin@inktank.com>
      Signed-off-by: default avatarAlex Elder <elder@inktank.com>
      Reviewed-by: default avatarJosh Durgin <josh.durgin@inktank.com>
      02cdb02c
    • Alex Elder's avatar
      rbd: define rbd_dev_image_id() · 589d30e0
      Alex Elder authored
      New format 2 rbd images are permanently identified by a unique image
      id.  Each rbd image also has a name, but the name can be changed.
      A format 2 rbd image will have an object--whose name is based on the
      image name--which maps an image's name to its image id.
      
      Create a new function rbd_dev_image_id() that checks for the
      existence of the image id object, and if it's found, records the
      image id in the rbd_device structure.
      
      Create a new rbd device attribute (/sys/bus/rbd/<num>/image_id) that
      makes this information available.
      Signed-off-by: default avatarAlex Elder <elder@inktank.com>
      Reviewed-by: default avatarJosh Durgin <josh.durgin@inktank.com>
      589d30e0
  4. 24 Sep, 2012 1 commit
  5. 22 Sep, 2012 1 commit
  6. 20 Sep, 2012 1 commit
    • Martin K. Petersen's avatar
      block: Implement support for WRITE SAME · 4363ac7c
      Martin K. Petersen authored
      The WRITE SAME command supported on some SCSI devices allows the same
      block to be efficiently replicated throughout a block range. Only a
      single logical block is transferred from the host and the storage device
      writes the same data to all blocks described by the I/O.
      
      This patch implements support for WRITE SAME in the block layer. The
      blkdev_issue_write_same() function can be used by filesystems and block
      drivers to replicate a buffer across a block range. This can be used to
      efficiently initialize software RAID devices, etc.
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      Acked-by: default avatarMike Snitzer <snitzer@redhat.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      4363ac7c
  7. 13 Sep, 2012 1 commit
    • Peter Moody's avatar
      ima: audit log hashes · e7c568e0
      Peter Moody authored
      This adds an 'audit' policy action which audit logs file measurements.
      
      Changelog v6:
       - use new action flag handling (Dmitry Kasatkin).
       - removed whitespace (Mimi)
      
      Changelog v5:
       - use audit_log_untrustedstring.
      
      Changelog v4:
       - cleanup digest -> hash conversion.
       - use filename rather than d_path in ima_audit_measurement.
      
      Changelog v3:
       - Use newly exported audit_log_task_info for logging pid/ppid/uid/etc.
       - Update the ima_policy ABI documentation.
      
      Changelog v2:
       - Use 'audit' action rather than 'measure_and_audit' to permit
       auditing in the absence of measuring..
      
      Changelog v1:
       - Initial posting.
      Signed-off-by: default avatarPeter Moody <pmoody@google.com>
      Signed-off-by: default avatarMimi Zohar <zohar@linux.vnet.ibm.com>
      e7c568e0
  8. 10 Sep, 2012 2 commits
  9. 09 Sep, 2012 2 commits
    • Mark Brown's avatar
      regulator: core: Support bypass mode · f59c8f9f
      Mark Brown authored
      Many regulators support a bypass mode where they simply switch their
      input supply to the output. This is mainly used in low power retention
      states where power consumption is extremely low so higher voltage or
      less clean supplies can be used.
      
      Support this by providing ops for the drivers and a consumer API which
      allows the device to be put into bypass mode if all consumers enable it
      and the machine enables permission for this.
      
      This is not supported as a mode since the existing modes are rarely used
      due to fuzzy definition and mostly redundant with modern hardware which is
      able to respond promptly to load changes.
      Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
      Reviewed-by: default avatarGraeme Gregory <gg@slimlogic.co.uk>
      f59c8f9f
    • Andre Przywara's avatar
      acpi-cpufreq: Add support for disabling dynamic overclocking · 615b7300
      Andre Przywara authored
      One feature present in powernow-k8 that isn't present in acpi-cpufreq
      is support for enabling or disabling AMD's core performance boost
      technology. This patch adds support to acpi-cpufreq, but also
      includes support for Intel's dynamic acceleration.
      
      The original boost disabling sysfs file was per CPU, but acted
      globally. Also the naming (cpb) was at least not intuitive.
      So lets introduce a single file simply called "boost", which sits
      once in /sys/devices/system/cpu/cpufreq.
      This should be the only way of using this feature, so add
      documentation about the rationale and the usage.
      
      A following patch will re-introduce the cpb knob for compatibility
      reasons on AMD CPUs.
      
      Per-CPU boost switching is possible, but not trivial and is thus
      postponed to a later patch series.
      Signed-off-by: default avatarAndre Przywara <andre.przywara@amd.com>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      615b7300
  10. 07 Sep, 2012 1 commit
    • Mimi Zohar's avatar
      ima: add appraise action keywords and default rules · 07f6a794
      Mimi Zohar authored
      Unlike the IMA measurement policy, the appraise policy can not be dependent
      on runtime process information, such as the task uid, as the 'security.ima'
      xattr is written on file close and must be updated each time the file changes,
      regardless of the current task uid.
      
      This patch extends the policy language with 'fowner', defines an appraise
      policy, which appraises all files owned by root, and defines 'ima_appraise_tcb',
      a new boot command line option, to enable the appraise policy.
      
      Changelog v3:
      - separate the measure from the appraise rules in order to support measuring
        without appraising and appraising without measuring.
      - change appraisal default for filesystems without xattr support to fail
      - update default appraise policy for cgroups
      
      Changelog v1:
      - don't appraise RAMFS (Dmitry Kasatkin)
      - merged rest of "ima: ima_must_appraise_or_measure API change" commit
        (Dmtiry Kasatkin)
      
        ima_must_appraise_or_measure() called ima_match_policy twice, which
        searched the policy for a matching rule.  Once for a matching measurement
        rule and subsequently for an appraisal rule. Searching the policy twice
        is unnecessary overhead, which could be noticeable with a large policy.
      
        The new version of ima_must_appraise_or_measure() does everything in a
        single iteration using a new version of ima_match_policy().  It returns
        IMA_MEASURE, IMA_APPRAISE mask.
      
        With the use of action mask only one efficient matching function
        is enough.  Removed other specific versions of matching functions.
      
      Changelog:
      - change 'owner' to 'fowner' to conform to the new LSM conditions posted by
        Roberto Sassu.
      - fix calls to ima_log_string()
      Signed-off-by: default avatarMimi Zohar <zohar@us.ibm.com>
      Signed-off-by: default avatarDmitry Kasatkin <dmitry.kasatkin@intel.com>
      07f6a794
  11. 06 Sep, 2012 1 commit
  12. 05 Sep, 2012 1 commit
  13. 22 Aug, 2012 1 commit
  14. 21 Aug, 2012 1 commit
  15. 20 Aug, 2012 1 commit
  16. 17 Aug, 2012 1 commit
    • Zheng Liu's avatar
      ext4: make the zero-out chunk size tunable · 67a5da56
      Zheng Liu authored
      Currently in ext4 the length of zero-out chunk is set to 7 file system
      blocks.  But if an inode has uninitailized extents from using
      fallocate to preallocate space, and the workload issues many random
      writes, this can cause a fragmented extent tree that will
      unnecessarily grow the extent tree.
      
      So create a new sysfs tunable, extent_max_zeroout_kb, which controls
      the maximum size where blocks will be zeroed out instead of creating a
      new uninitialized extent.  The default of this has been sent to 32kb.
      
      CC: Zach Brown <zab@zabbo.net>
      CC: Andreas Dilger <adilger@dilger.ca>
      Signed-off-by: default avatarZheng Liu <wenqing.lz@taobao.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      67a5da56
  17. 15 Aug, 2012 1 commit
  18. 30 Jul, 2012 2 commits
    • Jesper Juhl's avatar
      [media] Documentation: Add newline at end-of-file to files lacking one · 79980d9c
      Jesper Juhl authored
      This patch simply adds a newline character at end-of-file to those
      files in Documentation/ that currently lack one.
      
      This is done for a few different reasons:
      
      A) It's rather annoying when you do "cat some_file.txt" that your
         prompt/cursor ends up at the end of the last line of output rather
         than on a new line.
      
      B) Some tools that process files line-by-line may get confused by the
         lack of a newline on the last line.
      
      C) The "\ No newline at end of file" line in diffs annoys me for some
         reason.
      
      So, let's just add the missing newline once and for all.
      Signed-off-by: default avatarJesper Juhl <jj@chaosbits.net>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      79980d9c
    • Alex Elder's avatar
      rbd: create pool_id device attribute · 9bb2f334
      Alex Elder authored
      Add an entry under /sys/bus/rbd/devices/<N>/ named "pool_id" that
      provides the id for the pool the rbd image is assocatied with.  This
      is in addition to the pool name already provided.
      
      Rename the "poolid" field in struct rbd_device  to be "pool_id".
      
      Update the documentation to reflect the addition of this new entry.
      Signed-off-by: default avatarAlex Elder <elder@inktank.com>
      Reviewed-by: default avatarJosh Durgin <josh.durgin@inktank.com>
      9bb2f334
  19. 27 Jul, 2012 1 commit
    • AceLan Kao's avatar
      asus-wmi: enable resume on lid open · c0b91b6d
      AceLan Kao authored
      According to the ASUS WMI spec., to enable resume on lid open should
      use the device ID(0x00120032), but it doesn't work indeed.
      
      After discussing with ASUS' BIOS engineer, they say wake on lid open
      doesn't have a uniq device ID(0x00120032) in the BIOS. It shares the same
      device ID with deep S3(0x00120031), and the deep S3(resume on lid open)
      is disable by default.
      
      Adding this option in asus wmi sysfs
         /sys/devices/platform/<platform>/lid_resume
      so that userspace apps can enable/disable this feature by themselves.
      Signed-off-by: default avatarAceLan Kao <acelan.kao@canonical.com>
      Signed-off-by: default avatarCorentin Chary <corentin.chary@gmail.com>
      Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
      c0b91b6d
  20. 20 Jul, 2012 2 commits
  21. 19 Jul, 2012 1 commit
  22. 16 Jul, 2012 1 commit
    • Kay Sievers's avatar
      kmsg - export "continuation record" flag to /dev/kmsg · d39f3d77
      Kay Sievers authored
      In some cases we are forced to store individual records for a continuation
      line print.
      
      Export a flag to allow the external re-construction of the line. The flag
      allows us to apply a similar logic externally which is used internally when
      the console, /proc/kmsg or the syslog() output is printed.
      
        $ cat /dev/kmsg
        4,165,0,-;Free swap  = 0kB
        4,166,0,-;Total swap = 0kB
        6,167,0,c;[
        4,168,0,+;0
        4,169,0,+;1
        4,170,0,+;2
        4,171,0,+;3
        4,172,0,+;]
        6,173,0,-;[0 1 2 3 ]
        6,174,0,-;Console: colour VGA+ 80x25
        6,175,0,-;console [tty0] enabled
      Signed-off-by: default avatarKay Sievers <kay@vrfy.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d39f3d77
  23. 11 Jul, 2012 1 commit
  24. 08 Jul, 2012 1 commit
  25. 06 Jul, 2012 1 commit
  26. 01 Jul, 2012 1 commit
  27. 28 Jun, 2012 1 commit
  28. 25 Jun, 2012 1 commit
    • Alex Williamson's avatar
      iommu: IOMMU Groups · d72e31c9
      Alex Williamson authored
      IOMMU device groups are currently a rather vague associative notion
      with assembly required by the user or user level driver provider to
      do anything useful.  This patch intends to grow the IOMMU group concept
      into something a bit more consumable.
      
      To do this, we first create an object representing the group, struct
      iommu_group.  This structure is allocated (iommu_group_alloc) and
      filled (iommu_group_add_device) by the iommu driver.  The iommu driver
      is free to add devices to the group using it's own set of policies.
      This allows inclusion of devices based on physical hardware or topology
      limitations of the platform, as well as soft requirements, such as
      multi-function trust levels or peer-to-peer protection of the
      interconnects.  Each device may only belong to a single iommu group,
      which is linked from struct device.iommu_group.  IOMMU groups are
      maintained using kobject reference counting, allowing for automatic
      removal of empty, unreferenced groups.  It is the responsibility of
      the iommu driver to remove devices from the group
      (iommu_group_remove_device).
      
      IOMMU groups also include a userspace representation in sysfs under
      /sys/kernel/iommu_groups.  When allocated, each group is given a
      dynamically assign ID (int).  The ID is managed by the core IOMMU group
      code to support multiple heterogeneous iommu drivers, which could
      potentially collide in group naming/numbering.  This also keeps group
      IDs to small, easily managed values.  A directory is created under
      /sys/kernel/iommu_groups for each group.  A further subdirectory named
      "devices" contains links to each device within the group.  The iommu_group
      file in the device's sysfs directory, which formerly contained a group
      number when read, is now a link to the iommu group.  Example:
      
      $ ls -l /sys/kernel/iommu_groups/26/devices/
      total 0
      lrwxrwxrwx. 1 root root 0 Apr 17 12:57 0000:00:1e.0 ->
      		../../../../devices/pci0000:00/0000:00:1e.0
      lrwxrwxrwx. 1 root root 0 Apr 17 12:57 0000:06:0d.0 ->
      		../../../../devices/pci0000:00/0000:00:1e.0/0000:06:0d.0
      lrwxrwxrwx. 1 root root 0 Apr 17 12:57 0000:06:0d.1 ->
      		../../../../devices/pci0000:00/0000:00:1e.0/0000:06:0d.1
      
      $ ls -l  /sys/kernel/iommu_groups/26/devices/*/iommu_group
      [truncating perms/owner/timestamp]
      /sys/kernel/iommu_groups/26/devices/0000:00:1e.0/iommu_group ->
      					../../../kernel/iommu_groups/26
      /sys/kernel/iommu_groups/26/devices/0000:06:0d.0/iommu_group ->
      					../../../../kernel/iommu_groups/26
      /sys/kernel/iommu_groups/26/devices/0000:06:0d.1/iommu_group ->
      					../../../../kernel/iommu_groups/26
      
      Groups also include several exported functions for use by user level
      driver providers, for example VFIO.  These include:
      
      iommu_group_get(): Acquires a reference to a group from a device
      iommu_group_put(): Releases reference
      iommu_group_for_each_dev(): Iterates over group devices using callback
      iommu_group_[un]register_notifier(): Allows notification of device add
              and remove operations relevant to the group
      iommu_group_id(): Return the group number
      
      This patch also extends the IOMMU API to allow attaching groups to
      domains.  This is currently a simple wrapper for iterating through
      devices within a group, but it's expected that the IOMMU API may
      eventually make groups a more integral part of domains.
      
      Groups intentionally do not try to manage group ownership.  A user
      level driver provider must independently acquire ownership for each
      device within a group before making use of the group as a whole.
      This may change in the future if group usage becomes more pervasive
      across both DMA and IOMMU ops.
      
      Groups intentionally do not provide a mechanism for driver locking
      or otherwise manipulating driver matching/probing of devices within
      the group.  Such interfaces are generic to devices and beyond the
      scope of IOMMU groups.  If implemented, user level providers have
      ready access via iommu_group_for_each_dev and group notifiers.
      
      iommu_device_group() is removed here as it has no users.  The
      replacement is:
      
      	group = iommu_group_get(dev);
      	id = iommu_group_id(group);
      	iommu_group_put(group);
      
      AMD-Vi & Intel VT-d support re-added in following patches.
      Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
      Acked-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarJoerg Roedel <joerg.roedel@amd.com>
      d72e31c9
  29. 20 Jun, 2012 1 commit
  30. 15 Jun, 2012 2 commits
  31. 12 Jun, 2012 1 commit
  32. 11 Jun, 2012 2 commits