Commit f717acc6 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents 3ce99258 da8bf5da
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -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",
+1 −1
Original line number Diff line number Diff line
@@ -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();