Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/setup: Make relocated_ramdisk a local variable of relocate_initrd()

After

0b62f6cb0773 ("x86/microcode/32: Move early loading after paging enable"),

the global variable relocated_ramdisk is no longer used anywhere except
for the relocate_initrd() function. Make it a local variable of that
function.

Signed-off-by: Yuntao Wang <ytcoode@gmail.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Baoquan He <bhe@redhat.com>
Link: https://lore.kernel.org/r/20231113034026.130679-1-ytcoode@gmail.com

authored by

Yuntao Wang and committed by
Borislav Petkov (AMD)
f7a25cf1 b85ea95d

+1 -5
-2
arch/x86/include/asm/setup.h
··· 31 31 #include <asm/bootparam.h> 32 32 #include <asm/x86_init.h> 33 33 34 - extern u64 relocated_ramdisk; 35 - 36 34 /* Interrupt control for vSMPowered x86_64 systems */ 37 35 #ifdef CONFIG_X86_64 38 36 void vsmp_init(void);
+1 -3
arch/x86/kernel/setup.c
··· 226 226 _brk_start = 0; 227 227 } 228 228 229 - u64 relocated_ramdisk; 230 - 231 229 #ifdef CONFIG_BLK_DEV_INITRD 232 230 233 231 static u64 __init get_ramdisk_image(void) ··· 259 261 u64 area_size = PAGE_ALIGN(ramdisk_size); 260 262 261 263 /* We need to move the initrd down into directly mapped mem */ 262 - relocated_ramdisk = memblock_phys_alloc_range(area_size, PAGE_SIZE, 0, 264 + u64 relocated_ramdisk = memblock_phys_alloc_range(area_size, PAGE_SIZE, 0, 263 265 PFN_PHYS(max_pfn_mapped)); 264 266 if (!relocated_ramdisk) 265 267 panic("Cannot find place for new RAMDISK of size %lld\n",