1. 07 3月, 2012 2 次提交
    • O
      remoteproc: remove the single rpmsg vdev limitation · 7a186941
      Ohad Ben-Cohen 提交于
      Now that the resource table supports publishing a virtio device
      in a single resource entry, firmware images can start supporting
      more than a single vdev.
      
      This patch removes the single vdev limitation of the remoteproc
      framework so multi-vdev firmwares can be leveraged: VDEV resource
      entries are parsed when the rproc is registered, and as a result
      their vrings are set up and the virtio devices are registered
      (and they go away when the rproc goes away).
      
      Moreover, we no longer only support VIRTIO_ID_RPMSG vdevs; any
      virtio device type goes now. As a result, there's no more any
      rpmsg-specific APIs or code in remoteproc: it all becomes generic
      virtio handling.
      Signed-off-by: NOhad Ben-Cohen <ohad@wizery.com>
      Cc: Brian Swetland <swetland@google.com>
      Cc: Iliyan Malchev <malchev@google.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Mark Grosen <mgrosen@ti.com>
      Cc: John Williams <john.williams@petalogix.com>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Loic PALLARDY <loic.pallardy@stericsson.com>
      Cc: Ludovic BARRE <ludovic.barre@stericsson.com>
      Cc: Omar Ramirez Luna <omar.luna@linaro.org>
      Cc: Guzman Lugo Fernando <fernando.lugo@ti.com>
      Cc: Anna Suman <s-anna@ti.com>
      Cc: Clark Rob <rob@ti.com>
      Cc: Stephen Boyd <sboyd@codeaurora.org>
      Cc: Saravana Kannan <skannan@codeaurora.org>
      Cc: David Brown <davidb@codeaurora.org>
      Cc: Kieran Bingham <kieranbingham@gmail.com>
      Cc: Tony Lindgren <tony@atomide.com>
      7a186941
    • O
      remoteproc: resource table overhaul · fd2c15ec
      Ohad Ben-Cohen 提交于
      The resource table is an array of 'struct fw_resource' members, where
      each resource entry is expressed as a single member of that array.
      
      This approach got us this far, but it has a few drawbacks:
      
      1. Different resource entries end up overloading the same members of 'struct
         fw_resource' with different meanings. The resulting code is error prone
         and hard to read and maintain.
      
      2. It's impossible to extend 'struct fw_resource' without breaking the
         existing firmware images (and we already want to: we can't introduce the
         new virito device resource entry with the current scheme).
      
      3. It doesn't scale: 'struct fw_resource' must be as big as the largest
         resource entry type. As a result, smaller resource entries end up
         utilizing only small part of it.
      
      This is fixed by defining a dedicated structure for every resource type,
      and then converting the resource table to a list of type-value members.
      Instead of a rigid array of homogeneous structs, the resource table
      is turned into a collection of heterogeneous structures.
      
      This way:
      1. Resource entries consume exactly the amount of bytes they need.
      2. It's easy to extend: just create a new resource entry structure, and assign
         it a new type.
      3. The code is easier to read and maintain: the structures' members names are
         meaningful.
      
      While we're at it, this patch has several other resource table changes:
      1. The resource table gains a simple header which contains the
         number of entries in the table and their offsets within the table. This
         makes the parsing code simpler and easier to read.
      2. A version member is added to the resource table. Should we change the
         format again, we'll bump up this version to prevent breakage with
         existing firmware images.
      3. The VRING and VIRTIO_DEV resource entries are combined to a single
         VDEV entry. This paves the way to supporting multiple VDEV entries.
      4. Since we don't really support 64-bit rprocs yet, convert two stray u64
         members to u32.
      Signed-off-by: NOhad Ben-Cohen <ohad@wizery.com>
      Cc: Brian Swetland <swetland@google.com>
      Cc: Iliyan Malchev <malchev@google.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Mark Grosen <mgrosen@ti.com>
      Cc: John Williams <john.williams@petalogix.com>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Loic PALLARDY <loic.pallardy@stericsson.com>
      Cc: Ludovic BARRE <ludovic.barre@stericsson.com>
      Cc: Omar Ramirez Luna <omar.luna@linaro.org>
      Cc: Guzman Lugo Fernando <fernando.lugo@ti.com>
      Cc: Anna Suman <s-anna@ti.com>
      Cc: Clark Rob <rob@ti.com>
      Cc: Stephen Boyd <sboyd@codeaurora.org>
      Cc: Saravana Kannan <skannan@codeaurora.org>
      Cc: David Brown <davidb@codeaurora.org>
      Cc: Kieran Bingham <kieranbingham@gmail.com>
      Cc: Tony Lindgren <tony@atomide.com>
      fd2c15ec
  2. 23 2月, 2012 1 次提交
  3. 09 2月, 2012 3 次提交
    • O
      remoteproc: remove unused resource type · 2fd51811
      Ohad Ben-Cohen 提交于
      RSC_VIRTIO_CFG isn't being used, so remove it.
      
      Originally it was introduced to overcome a resource table limitation
      that prevented describing a virtio device in a single resource table
      entry.
      
      The plan though is to describe resource table entries in a TLV fashion,
      where each entry will consume the amount of space it requires,
      so the original limitation is anyway temporary.
      Reported-by: NStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: NOhad Ben-Cohen <ohad@wizery.com>
      2fd51811
    • O
      rpmsg: add virtio-based remote processor messaging bus · bcabbcca
      Ohad Ben-Cohen 提交于
      Add a virtio-based inter-processor communication bus, which enables
      kernel drivers to communicate with entities, running on remote
      processors, over shared memory using a simple messaging protocol.
      
      Every pair of AMP processors share two vrings, which are used to send
      and receive the messages over shared memory.
      
      The header of every message sent on the rpmsg bus contains src and dst
      addresses, which make it possible to multiplex several rpmsg channels on
      the same vring.
      
      Every rpmsg channel is a device on this bus. When a channel is added,
      and an appropriate rpmsg driver is found and probed, it is also assigned
      a local rpmsg address, which is then bound to the driver's callback.
      
      When inbound messages carry the local address of a bound driver,
      its callback is invoked by the bus.
      
      This patch provides a kernel interface only; user space interfaces
      will be later exposed by kernel users of this rpmsg bus.
      
      Designed with Brian Swetland <swetland@google.com>.
      Signed-off-by: NOhad Ben-Cohen <ohad@wizery.com>
      Acked-by: Rusty Russell <rusty@rustcorp.com.au> (virtio_ids.h)
      Cc: Brian Swetland <swetland@google.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Greg KH <greg@kroah.com>
      Cc: Stephen Boyd <sboyd@codeaurora.org>
      bcabbcca
    • O
      remoteproc: add framework for controlling remote processors · 400e64df
      Ohad Ben-Cohen 提交于
      Modern SoCs typically employ a central symmetric multiprocessing (SMP)
      application processor running Linux, with several other asymmetric
      multiprocessing (AMP) heterogeneous processors running different instances
      of operating system, whether Linux or any other flavor of real-time OS.
      
      Booting a remote processor in an AMP configuration typically involves:
      - Loading a firmware which contains the OS image
      - Allocating and providing it required system resources (e.g. memory)
      - Programming an IOMMU (when relevant)
      - Powering on the device
      
      This patch introduces a generic framework that allows drivers to do
      that. In the future, this framework will also include runtime power
      management and error recovery.
      
      Based on (but now quite far from) work done by Fernando Guzman Lugo
      <fernando.lugo@ti.com>.
      
      ELF loader was written by Mark Grosen <mgrosen@ti.com>, based on
      msm's Peripheral Image Loader (PIL) by Stephen Boyd <sboyd@codeaurora.org>.
      
      Designed with Brian Swetland <swetland@google.com>.
      Signed-off-by: NOhad Ben-Cohen <ohad@wizery.com>
      Acked-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Brian Swetland <swetland@google.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Greg KH <greg@kroah.com>
      Cc: Stephen Boyd <sboyd@codeaurora.org>
      400e64df
  4. 19 1月, 2012 1 次提交
  5. 18 1月, 2012 19 次提交
  6. 17 1月, 2012 3 次提交
  7. 16 1月, 2012 1 次提交
    • P
      netfilter: revert user-space expectation helper support · 9bf04646
      Pablo Neira Ayuso 提交于
      This patch partially reverts:
      3d058d7b netfilter: rework user-space expectation helper support
      that was applied during the 3.2 development cycle.
      
      After this patch, the tree remains just like before patch bc01befd,
      that initially added the preliminary infrastructure.
      
      I decided to partially revert this patch because the approach
      that I proposed to resolve this problem is broken in NAT setups.
      Moreover, a new infrastructure will be submitted for the 3.3.x
      development cycle that resolve the existing issues while
      providing a neat solution.
      
      Since nobody has been seriously using this infrastructure in
      user-space, the removal of this feature should affect any know
      FOSS project (to my knowledge).
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      9bf04646
  8. 15 1月, 2012 2 次提交
    • P
      block: fail SCSI passthrough ioctls on partition devices · 0bfc96cb
      Paolo Bonzini 提交于
      Linux allows executing the SG_IO ioctl on a partition or LVM volume, and
      will pass the command to the underlying block device.  This is
      well-known, but it is also a large security problem when (via Unix
      permissions, ACLs, SELinux or a combination thereof) a program or user
      needs to be granted access only to part of the disk.
      
      This patch lets partitions forward a small set of harmless ioctls;
      others are logged with printk so that we can see which ioctls are
      actually sent.  In my tests only CDROM_GET_CAPABILITY actually occurred.
      Of course it was being sent to a (partition on a) hard disk, so it would
      have failed with ENOTTY and the patch isn't changing anything in
      practice.  Still, I'm treating it specially to avoid spamming the logs.
      
      In principle, this restriction should include programs running with
      CAP_SYS_RAWIO.  If for example I let a program access /dev/sda2 and
      /dev/sdb, it still should not be able to read/write outside the
      boundaries of /dev/sda2 independent of the capabilities.  However, for
      now programs with CAP_SYS_RAWIO will still be allowed to send the
      ioctls.  Their actions will still be logged.
      
      This patch does not affect the non-libata IDE driver.  That driver
      however already tests for bd != bd->bd_contains before issuing some
      ioctl; it could be restricted further to forbid these ioctls even for
      programs running with CAP_SYS_ADMIN/CAP_SYS_RAWIO.
      
      Cc: linux-scsi@vger.kernel.org
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: James Bottomley <JBottomley@parallels.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      [ Make it also print the command name when warning - Linus ]
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0bfc96cb
    • P
      block: add and use scsi_blk_cmd_ioctl · 577ebb37
      Paolo Bonzini 提交于
      Introduce a wrapper around scsi_cmd_ioctl that takes a block device.
      
      The function will then be enhanced to detect partition block devices
      and, in that case, subject the ioctls to whitelisting.
      
      Cc: linux-scsi@vger.kernel.org
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: James Bottomley <JBottomley@parallels.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      577ebb37
  9. 14 1月, 2012 1 次提交
  10. 13 1月, 2012 7 次提交