Skip to content

Commit f717acc

Browse files
committed
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
2 parents 3ce9925 + da8bf5d commit f717acc

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

mm/memblock.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,14 @@ static int __init_memblock memblock_double_array(struct memblock_type *type,
457457
min(new_area_start, memblock.current_limit),
458458
new_alloc_size, PAGE_SIZE);
459459

460-
new_array = addr ? __va(addr) : NULL;
460+
if (addr) {
461+
/* The memory may not have been accepted, yet. */
462+
accept_memory(addr, new_alloc_size);
463+
464+
new_array = __va(addr);
465+
} else {
466+
new_array = NULL;
467+
}
461468
}
462469
if (!addr) {
463470
pr_err("memblock: Failed to double %s array from %ld to %ld entries !\n",

mm/mm_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1786,7 +1786,7 @@ static bool arch_has_descending_max_zone_pfns(void)
17861786
return IS_ENABLED(CONFIG_ARC) && !IS_ENABLED(CONFIG_ARC_HAS_PAE40);
17871787
}
17881788

1789-
static void set_high_memory(void)
1789+
static void __init set_high_memory(void)
17901790
{
17911791
phys_addr_t highmem = memblock_end_of_DRAM();
17921792

0 commit comments

Comments
 (0)