]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
um: Update min_low_pfn to match changes in uml_reserved
authorTiwei Bie <tiwei.btw@antgroup.com>
Fri, 21 Feb 2025 04:18:55 +0000 (12:18 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 May 2025 09:12:37 +0000 (11:12 +0200)
[ Upstream commit e82cf3051e6193f61e03898f8dba035199064d36 ]

When uml_reserved is updated, min_low_pfn must also be updated
accordingly. Otherwise, min_low_pfn will not accurately reflect
the lowest available PFN.

Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com>
Link: https://patch.msgid.link/20250221041855.1156109-1-tiwei.btw@antgroup.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/um/kernel/mem.c

index befed230aac28e96fe54b3b41cd68f46fa2cfac3..91b7710c0a5f495f6249bfae9dccf4a4d280d3e9 100644 (file)
@@ -66,6 +66,7 @@ void __init mem_init(void)
        map_memory(brk_end, __pa(brk_end), uml_reserved - brk_end, 1, 1, 0);
        memblock_free((void *)brk_end, uml_reserved - brk_end);
        uml_reserved = brk_end;
+       min_low_pfn = PFN_UP(__pa(uml_reserved));
 
        /* this will put all low memory onto the freelists */
        memblock_free_all();