Merge tag 'fixes-2025-05-11' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock

Pull memblock fixes from Mike Rapoport:

 - Mark set_high_memory() as __init to fix section mismatch

 - Accept memory allocated in memblock_double_array() to mitigate crash
   of SNP guests

* tag 'fixes-2025-05-11' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock:
  memblock: Accept allocated memory before use in memblock_double_array()
  mm,mm_init: Mark set_high_memory as __init
This commit is contained in:
Linus Torvalds
2025-05-11 10:23:53 -07:00
2 changed files with 9 additions and 2 deletions

View File

@@ -457,7 +457,14 @@ static int __init_memblock memblock_double_array(struct memblock_type *type,
min(new_area_start, memblock.current_limit),
new_alloc_size, PAGE_SIZE);
new_array = addr ? __va(addr) : NULL;
if (addr) {
/* The memory may not have been accepted, yet. */
accept_memory(addr, new_alloc_size);
new_array = __va(addr);
} else {
new_array = NULL;
}
}
if (!addr) {
pr_err("memblock: Failed to double %s array from %ld to %ld entries !\n",

View File

@@ -1786,7 +1786,7 @@ static bool arch_has_descending_max_zone_pfns(void)
return IS_ENABLED(CONFIG_ARC) && !IS_ENABLED(CONFIG_ARC_HAS_PAE40);
}
static void set_high_memory(void)
static void __init set_high_memory(void)
{
phys_addr_t highmem = memblock_end_of_DRAM();