Skip to contentSkip to conversation

Adds Kconfig option for Cross Memory Attach

PATCH In review Christopher Yeoh 2 participants 3 messages Apr 23, 2012 – Apr 24, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Adds Kconfig option for Cross Memory Attach

Hi Andrew,

Attached is a patch which you asked for a while back which adds a Kconfig option to allow people who don't want cross memory attach to not have it included in their build.

Regards,

Chris

Signature · 6 lines
[email protected]

Signed-off-by: Chris Yeoh <[email protected]>
 Kconfig  |   11 +++++++++++
 Makefile |    7 +++++--
 2 files changed, 16 insertions(+), 2 deletions(-)
mm/Kconfig +11 -0
index e338407..7619f90 100644
@@ -379,3 +379,14 @@ config CLEANCACHE
 	  in a negligible performance hit.
 
 	  If unsure, say Y to enable cleancache
+
+config CROSS_MEMORY_ATTACH
+	bool "Cross Memory Support"
+	depends on MMU
+	default y
+	help
+	  Enabling this option adds the system calls process_vm_readv and
+	  process_vm_writev which allow a process with the correct privileges
+	  to directly read from or write to to another process's address space.
+	  See the man page for more details.
+
mm/Makefile +5 -2
index 50ec00e..1ddd00f 100644
@@ -5,8 +5,11 @@
 mmu-y			:= nommu.o
 mmu-$(CONFIG_MMU)	:= fremap.o highmem.o madvise.o memory.o mincore.o \
 			   mlock.o mmap.o mprotect.o mremap.o msync.o rmap.o \
-			   vmalloc.o pagewalk.o pgtable-generic.o \
-			   process_vm_access.o
+			   vmalloc.o pagewalk.o pgtable-generic.o
+
+ifdef CONFIG_CROSS_MEMORY_ATTACH
+mmu-$(CONFIG_MMU)	+= process_vm_access.o
+endif
 
 obj-y			:= filemap.o mempool.o oom_kill.o fadvise.o \
 			   maccess.o page_alloc.o page-writeback.o \
#1 lore raw
Quoted 5 lines · Christopher Yeoh

Hi Andrew,

Attached is a patch which you asked for a while back which adds a Kconfig option to allow people who don't want cross memory attach to not have it included in their build.

and it shouldn't be default y.

Linus has written a diatribe on [not] making new options default to y.

Signature · 1 line
~Randy
#2 lore raw
Quoted 9 lines · On Mon, 23 Apr 2012 08:48:52 -0700 Randy Dunlap <[email protected]> wrote:
Quoted 5 lines · Christopher Yeoh

Hi Andrew,

Attached is a patch which you asked for a while back which adds a Kconfig option to allow people who don't want cross memory attach to not have it included in their build.

Quoted 4 lines

and it shouldn't be default y.

Linus has written a diatribe on [not] making new options default to y.

I'm not that fussed, but currently CMA is enabled whether you like it or not. This just allows you to disable it. IIRC there was an exception where a new config option allows you to disable an old feature (although CMA has not been out that long).

Regards,

Chris

Signature · 1 line
[email protected]