Thread (18 messages) 18 messages, 6 authors, 2024-06-12

Re: [PATCH v2 1/2] mm/memblock: Add "reserve_mem" to reserved named memory at boot up

From: Mike Rapoport <rppt@kernel.org>
Date: 2024-06-11 16:32:59
Also in: linux-hardening, linux-mm, lkml

On Tue, Jun 11, 2024 at 11:12:18AM -0400, Steven Rostedt wrote:
On Tue, 11 Jun 2024 14:40:29 +0000
Wei Yang [off-list ref] wrote:
quoted
quoted
+
+	align = memparse(p+1, &p);
+	if (*p != ':')
+		return -EINVAL;
+  
Make sure command line parameters are valid before doing the allocation.
You mean that size is non zero?

I don't know if we care what the align is. Zero is valid.
memblock won't like zero align, it should be SMP_CACHE_BYTES at least.
No point requiring it from user, just update the alignment if the user passed
zero.
 
quoted
quoted
+	start = memblock_phys_alloc(size, align);
+	if (!start)
+		return -ENOMEM;
+
-- 
Sincerely yours,
Mike.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help