All of lore.kernel.org
 help / color / mirror / Atom feed
* mm/memblock: export memblock_{start/end}_of_DRAM
@ 2020-10-29 21:29 ` Sudarshan Rajagopalan
  0 siblings, 0 replies; 18+ messages in thread
From: Sudarshan Rajagopalan @ 2020-10-29 21:29 UTC (permalink / raw)
  To: Anshuman Khandual, Mark Rutland, David Hildenbrand, Steven Price,
	Mike Rapoport, linux-arm-kernel, linux-kernel
  Cc: Catalin Marinas, Will Deacon, Suren Baghdasaryan,
	Greg Kroah-Hartman, Pratik Patel

Hello all,

We have a usecase where a module driver adds certain memory blocks using 
add_memory_driver_managed(), so that it can perform memory hotplug 
operations on these blocks. In general, these memory blocks aren’t 
something that gets physically added later, but is part of actual RAM 
that system booted up with. Meaning – we set the ‘mem=’ cmdline 
parameter to limit the memory and later add the remaining ones using 
add_memory*() variants.

The basic idea is to have driver have ownership and manage certain 
memory blocks for hotplug operations.

For the driver be able to know how much memory was limited and how much 
actually present, we take the delta of ‘bootmem physical end address’ 
and ‘memblock_end_of_DRAM’. The 'bootmem physical end address' is 
obtained by scanning the reg values in ‘memory’ DT node and determining 
the max {addr,size}. Since our driver is getting modularized, we won’t 
have access to memblock_end_of_DRAM (i.e. end address of all memory 
blocks after ‘mem=’ is applied).

So checking if memblock_{start/end}_of_DRAM() symbols can be exported? 
Also, this information can be obtained by userspace by doing ‘cat 
/proc/iomem’ and greping for ‘System RAM’. So wondering if userspace can 
have access to such info, can we allow kernel module drivers have access 
by exporting memblock_{start/end}_of_DRAM().

Or are there any other ways where a module driver can get the end 
address of system memory block?


Sudarshan

--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a 
Linux Foundation Collaborative Project

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

end of thread, other threads:[~2020-11-03 16:52 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-29 21:29 mm/memblock: export memblock_{start/end}_of_DRAM Sudarshan Rajagopalan
2020-10-29 21:29 ` Sudarshan Rajagopalan
2020-10-30  6:41 ` David Hildenbrand
2020-10-30  6:41   ` David Hildenbrand
2020-11-03  2:15   ` Sudarshan Rajagopalan
2020-11-03  2:15     ` Sudarshan Rajagopalan
2020-10-30  8:38 ` Mike Rapoport
2020-10-30  8:38   ` Mike Rapoport
2020-10-31  9:18   ` Christoph Hellwig
2020-10-31  9:18     ` Christoph Hellwig
2020-10-31 10:05     ` David Hildenbrand
2020-10-31 10:05       ` David Hildenbrand
2020-11-03  8:38       ` Christoph Hellwig
2020-11-03  8:38         ` Christoph Hellwig
2020-11-03  2:51   ` Sudarshan Rajagopalan
2020-11-03  2:51     ` Sudarshan Rajagopalan
2020-11-03 16:51     ` Mike Rapoport
2020-11-03 16:51       ` Mike Rapoport

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.