mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Olu Ogunbowale <Olu.Ogunbowale@imgtec.com>
To: <linux-mm@kvack.org>
Cc: <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Michel Lespinasse <walken@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Rik van Riel <riel@redhat.com>, Hugh Dickins <hughd@google.com>,
	Russell King <linux@arm.linux.org.uk>,
	Ralf Baechle <ralf@linux-mips.org>,
	Paul Mundt <lethal@linux-sh.org>,
	"David S. Miller" <davem@davemloft.net>,
	Chris Metcalf <cmetcalf@tilera.com>, Ingo Molnar <mingo@elte.hu>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Olujide Ogunbowale <Olu.Ogunbowale@imgtec.com>
Subject: [PATCH] mm: Export symbols unmapped_area() & unmapped_area_topdown()
Date: Wed, 16 Mar 2016 17:10:34 +0000	[thread overview]
Message-ID: <1458148234-4456-2-git-send-email-Olu.Ogunbowale@imgtec.com> (raw)
In-Reply-To: <1458148234-4456-1-git-send-email-Olu.Ogunbowale@imgtec.com>

From: Olujide Ogunbowale <Olu.Ogunbowale@imgtec.com>

Export the memory management functions, unmapped_area() &
unmapped_area_topdown(), as GPL symbols; this allows the kernel to
better support process address space mirroring on both CPU and device
for out-of-tree drivers by allowing the use of vm_unmapped_area() in a
driver's file operation get_unmapped_area().

This is required by drivers that want to control or limit a process VMA
range into which shared-virtual-memory (SVM) buffers are mapped during
an mmap() call in order to ensure that said SVM VMA does not collide
with any pre-existing VMAs used by non-buffer regions on the device
because SVM buffers must have identical VMAs on both CPU and device.

Exporting these functions is particularly useful for graphics devices as
SVM support is required by the OpenCL & HSA specifications and also SVM
support for 64-bit CPUs where the useable device SVM address range
is/maybe a subset of the full 64-bit range of the CPU. Exporting also
avoids the need to duplicate the VMA search code in such drivers.

Signed-off-by: Olu Ogunbowale <Olu.Ogunbowale@imgtec.com>
---
 mm/mmap.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/mm/mmap.c b/mm/mmap.c
index 76d1ec2..c08b518 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1804,6 +1804,8 @@ found:
 	return gap_start;
 }
 
+EXPORT_SYMBOL_GPL(unmapped_area);
+
 unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info)
 {
 	struct mm_struct *mm = current->mm;
@@ -1902,6 +1904,8 @@ found_highest:
 	return gap_end;
 }
 
+EXPORT_SYMBOL_GPL(unmapped_area_topdown);
+
 /* Get an address range which is currently unmapped.
  * For shmat() with addr=0.
  *
-- 
1.7.9.5

  reply	other threads:[~2016-03-16 17:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-16 17:10 Mirroring process address space on device Olu Ogunbowale
2016-03-16 17:10 ` Olu Ogunbowale [this message]
2016-03-16 20:36   ` [PATCH] mm: Export symbols unmapped_area() & unmapped_area_topdown() Christoph Hellwig
2016-03-16 21:00     ` Rik van Riel
2016-03-17  7:24       ` Ingo Molnar
2016-03-17 16:40       ` Olu Ogunbowale
2016-03-17 14:37   ` Jerome Glisse
2016-03-17 15:38     ` Oded Gabbay
2016-03-17 15:46     ` Olu Ogunbowale
2016-03-17 17:03       ` Jerome Glisse
2016-03-17 17:42         ` Olu Ogunbowale

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1458148234-4456-2-git-send-email-Olu.Ogunbowale@imgtec.com \
    --to=olu.ogunbowale@imgtec.com \
    --cc=akpm@linux-foundation.org \
    --cc=cmetcalf@tilera.com \
    --cc=davem@davemloft.net \
    --cc=hpa@zytor.com \
    --cc=hughd@google.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mingo@elte.hu \
    --cc=ralf@linux-mips.org \
    --cc=riel@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=walken@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®