All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC/PATCHv2 v2 0/4] request_firmware() on memory constrained devices
@ 2016-04-20  1:04 Stephen Boyd
  2016-04-20  1:04 ` [RFC/PATCHv2 v2 1/4] ARM64: dma: Add support for NO_KERNEL_MAPPING attribute Stephen Boyd
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Stephen Boyd @ 2016-04-20  1:04 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arm, Robin Murphy, Laura Abbott, Arnd Bergmann,
	Marek Szyprowski, Mimi Zohar, Andrew Morton, Mark Brown,
	Catalin Marinas, Will Deacon, Ming Lei

I'm sending this again to solicit feedback on if this is even the right
approach. After Mimi's patches that change where firmware loading code
is done, I've had to modify fs/exec.c and add a struct to linux/fs.h,
and that feels wrong. If that is OK, then my only other concern is
doing the security checks a page at at time vs. all at once on the
whole buffer. If there isn't any opposition to doing that I'll start
working on the necessary changes.

Some systems are memory constrained but they need to load very
large firmwares. The firmware subsystem allows drivers to request
this firmware be loaded from the filesystem, but this requires
that the entire firmware be loaded into kernel memory first
before it's provided to the driver. This can lead to a situation
where we map the firmware twice, once to load the firmware into
kernel memory and once to copy the firmware into the final
resting place.

This design creates needless memory pressure and delays loading
because we have to copy from kernel memory to somewhere else.
This patch sets adds support to the request firmware and DMA APIs
to map DMA buffers a page at a time and load the firmware directly
into those pages, skipping the intermediate copying step and
alleviating memory pressure during firmware loading. The drawback
is that we can't use the firmware caching feature because the
memory for the firmware cache is never allocated.

Patches based on v4.6-rc1.

Changes since v1:
 * Rebased onto v4.6-rc1 (large conflicts due to movement of code from Mimi)
 * Added some CONFIG_HAS_DMA ifdefs around code that's using DMA ops

TODO:
 * Performance metrics for DMA vs. non-DMA based loading
 * Test on tiny memory parts with big firmwares
 * Integrate/test with IMA/security checks

Laura Abbott (1):
  dma-mapping: Add dma_remap() APIs

Stephen Boyd (2):
  ARM64: dma: Add support for NO_KERNEL_MAPPING attribute
  firmware: Support requesting firmware directly into DMA memory

Vikram Mulukutla (1):
  firmware_class: Provide infrastructure to make fw caching optional

 arch/arm64/mm/dma-mapping.c     |  78 ++++++++++++++--
 drivers/base/firmware_class.c   | 192 +++++++++++++++++++++++++++++-----------
 fs/exec.c                       |  95 +++++++++++++++-----
 include/linux/dma-mapping.h     |  35 ++++++++
 include/linux/firmware.h        |  13 +++
 include/linux/fs.h              |  14 ++-
 security/integrity/ima/ima_fs.c |   3 +-
 7 files changed, 347 insertions(+), 83 deletions(-)

-- 
2.8.0.rc4

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-04-27 18:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-20  1:04 [RFC/PATCHv2 v2 0/4] request_firmware() on memory constrained devices Stephen Boyd
2016-04-20  1:04 ` [RFC/PATCHv2 v2 1/4] ARM64: dma: Add support for NO_KERNEL_MAPPING attribute Stephen Boyd
2016-04-20  1:04 ` [RFC/PATCHv2 v2 2/4] dma-mapping: Add dma_remap() APIs Stephen Boyd
2016-04-21 10:35   ` Catalin Marinas
     [not found]     ` <20160423003516.12876.30413@sboyd-linaro>
2016-04-27 15:25       ` Catalin Marinas
2016-04-27 18:16         ` Laura Abbott
2016-04-20  1:04 ` [RFC/PATCHv2 v2 3/4] firmware_class: Provide infrastructure to make fw caching optional Stephen Boyd
2016-04-20  1:04 ` [RFC/PATCHv2 v2 4/4] firmware: Support requesting firmware directly into DMA memory Stephen Boyd
2016-04-20 12:32 ` [RFC/PATCHv2 v2 0/4] request_firmware() on memory constrained devices Mimi Zohar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.