Skip to content

Read-only memremap()

Stephen Boyd linux-arm-kernel linux-arm-msm linux-devicetree lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest5 patches 5 repliesIn review
  2. v25 patches 2 repliesSuperseded
  3. v15 patches 4 repliesSuperseded

Changes from v1 from the cover letter

* Picked up tags and rebased to v5.2-rc3

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5reserved_mem: Add a devm_memremap_reserved_mem() APIdrivers/of/of_reserved_mem.c include/linux/of_reserved_mem.h+51 -00 replies
2/5soc: qcom: cmd-db: Migrate to devm_memremap_reserved_mem()drivers/soc/qcom/cmd-db.c+3 -100 replies
3/5memremap: Add support for read-only memory mappingsinclude/linux/io.h kernel/iomem.c+18 -34 replies
4/5arm64: Add support for arch_memremap_ro()arch/arm64/include/asm/io.h+1 -00 replies
5/5soc: qcom: cmd-db: Map with read-only mappingsdrivers/soc/qcom/cmd-db.c+2 -11 reply

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchBjorn AnderssonRob HerringCatalin Marinas
1/5R-b R-b
2/5R-b
3/5R-b
4/5R-b A-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v3 thread

Cover letter [PATCH v3 0/5] Read-only memremap()

This patch series implements a read-only version of memremap() via a new MEMREMAP_RO flag. If this is passed in the mapping call, we'll try to map the memory region as read-only if it doesn't intersect with an existing mapping. Otherwise, we'll try to fallback to other flags to try to map the memory that way.

The main use case I have is to map the command-db memory region on Qualcomm devices with a read-only mapping. It's already a const marked pointer and the API returns const pointers as well, so this series makes sure that even stray writes can't modify the memory. To get there we introduce a devm version of memremap() for a reserved memory region, add a memremap() flag, and implement support for that flag on arm64.

Changes from v2 (https://lkml.kernel.org/r/[email protected]):
* Added a comment to kerneldoc for the new MEMREMAP_RO flag
* Rebased to v5.3-rc1

Changes from v1:
* Picked up tags and rebased to v5.2-rc3

Stephen Boyd (5):
reserved_mem: Add a devm_memremap_reserved_mem() API
soc: qcom: cmd-db: Migrate to devm_memremap_reserved_mem()
memremap: Add support for read-only memory mappings
arm64: Add support for arch_memremap_ro()
soc: qcom: cmd-db: Map with read-only mappings

Cc Evan Green <[email protected]>
Cc Rob Herring <[email protected]>
Cc Bjorn Andersson <[email protected]>
Cc Andy Gross <[email protected]>
Cc Will Deacon <[email protected]>
Cc Catalin Marinas <[email protected]>
 arch/arm64/include/asm/io.h     |  1 +
 drivers/of/of_reserved_mem.c    | 45 +++++++++++++++++++++++++++++++++
 drivers/soc/qcom/cmd-db.c       | 14 +++-------
 include/linux/io.h              |  1 +
 include/linux/of_reserved_mem.h |  6 +++++
 kernel/iomem.c                  | 20 ++++++++++++---
 6 files changed, 74 insertions(+), 13 deletions(-)

base-commit: 5f9e832c137075045d15cd6899ab0505cfb2ca4b

Signature · 1 line
Sent by a computer through tubes