public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* Creating kernel mappings for memory initially marked with bootmem NOMAP?
@ 2017-03-08 19:03 Florian Fainelli
  2017-03-08 19:14 ` Ard Biesheuvel
  2017-03-08 19:26 ` Russell King - ARM Linux
  0 siblings, 2 replies; 9+ messages in thread
From: Florian Fainelli @ 2017-03-08 19:03 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On our platforms (brcmstb) we have an use case where we boot with some
(a lot actually) memory carved out and marked initially with bootmem
NOMAP in order for this memory not to be mapped in the kernel's linear
mapping.

Now, we have some peripherals that want large chunks of physically and
virtually contiguous memory that belong to these memblock NOMAP ranges.
I have no problems using mmap() against this memory, because the kernel
will do what is necessary for a process to map it for me. The struggle
is for a kernel driver which specifies a range of physical memory and
size, and expects a virtually contiguous mapping in return (not using
DMA-API, because reasons).

Essentially the problem is that there are no PTEs created for these
memory regions (and pfn_valid() returns 0, since this is NOMAP memory),
so I have been playing with __add_pages() from the memory hotplug code
in an attempt to get proper page references to this memory, but I am
clearly missing something.

Yes I know it's a terrible idea, but what if I wanted to get that working?

Thanks in advance!
-- 
Florian

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

end of thread, other threads:[~2017-03-16 20:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-08 19:03 Creating kernel mappings for memory initially marked with bootmem NOMAP? Florian Fainelli
2017-03-08 19:14 ` Ard Biesheuvel
2017-03-08 19:52   ` Florian Fainelli
2017-03-08 22:06     ` Ard Biesheuvel
2017-03-08 22:10       ` Florian Fainelli
2017-03-16 19:04         ` Florian Fainelli
2017-03-16 20:00           ` Russell King - ARM Linux
2017-03-08 19:26 ` Russell King - ARM Linux
2017-03-08 19:29   ` Russell King - ARM Linux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox