All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] memblock: Add limit checking to memblock_virt_alloc
@ 2014-01-28 22:04 Yinghai Lu
  2014-01-28 22:08 ` Dave Hansen
                   ` (4 more replies)
  0 siblings, 5 replies; 22+ messages in thread
From: Yinghai Lu @ 2014-01-28 22:04 UTC (permalink / raw)
  To: Andrew Morton, Linus Torvalds, Ingo Molnar, H. Peter Anvin,
	'Russell King - ARM Linux', Kevin Hilman, Olof Johansson,
	Konrad Rzeszutek Wilk
  Cc: Dave Hansen, Santosh Shilimkar, linux-kernel, Yinghai Lu

In original bootmem wrapper for memblock, we have limit checking.

Add it to memblock_virt_alloc, to address arm and x86 booting crash.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 mm/memblock.c |    3 +++
 1 file changed, 3 insertions(+)

Index: linux-2.6/mm/memblock.c
===================================================================
--- linux-2.6.orig/mm/memblock.c
+++ linux-2.6/mm/memblock.c
@@ -1077,6 +1077,9 @@ static void * __init memblock_virt_alloc
 	if (!align)
 		align = SMP_CACHE_BYTES;
 
+	if (max_addr > memblock.current_limit)
+		max_addr = memblock.current_limit;
+
 again:
 	alloc = memblock_find_in_range_node(size, align, min_addr, max_addr,
 					    nid);

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

end of thread, other threads:[~2014-01-30  4:46 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-28 22:04 [PATCH] memblock: Add limit checking to memblock_virt_alloc Yinghai Lu
2014-01-28 22:08 ` Dave Hansen
2014-01-28 22:47   ` Yinghai Lu
2014-01-28 22:55     ` Dave Hansen
2014-01-29  1:50     ` Konrad Rzeszutek Wilk
2014-01-29 23:07       ` Tony Luck
2014-01-29 23:39         ` Yinghai Lu
2014-01-29 23:39         ` Yinghai Lu
2014-01-29 23:53           ` Yinghai Lu
2014-01-29 23:53           ` Yinghai Lu
2014-01-30  0:12             ` Tony Luck
2014-01-30  0:12             ` Tony Luck
2014-01-30  0:34               ` Andrew Morton
2014-01-30  0:34               ` Andrew Morton
2014-01-30  0:46                 ` Tony Luck
2014-01-30  0:46                 ` Tony Luck
2014-01-29 23:07       ` Tony Luck
2014-01-29  1:50     ` Konrad Rzeszutek Wilk
2014-01-28 22:08 ` Andrew Morton
2014-01-28 22:08 ` Olof Johansson
2014-01-29  1:25 ` Kevin Hilman
2014-01-30  4:46 ` Sachin Kamat

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.