s390/boot: make type of __vmlinux_relocs_64_start|end consistent
authorAlexander Gordeev <agordeev@linux.ibm.com>
Wed, 21 Feb 2024 13:32:24 +0000 (14:32 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Mon, 26 Feb 2024 09:25:09 +0000 (10:25 +0100)
Make the type of __vmlinux_relocs_64_start|end symbols as
char array, just like it is done for all other sections.
Function rescue_relocs() is simplified as result.

Suggested-by: Heiko Carstens <hca@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/boot/boot.h
arch/s390/boot/startup.c

index cebf9feba6b1c477c0321f6bafcd368c6967dbcb..567d60f78bbcca273378a6f66e748df167a4af13 100644 (file)
@@ -88,7 +88,7 @@ extern unsigned long vmalloc_size;
 extern int vmalloc_size_set;
 extern char __boot_data_start[], __boot_data_end[];
 extern char __boot_data_preserved_start[], __boot_data_preserved_end[];
-extern int __vmlinux_relocs_64_start[], __vmlinux_relocs_64_end[];
+extern char __vmlinux_relocs_64_start[], __vmlinux_relocs_64_end[];
 extern char _decompressor_syms_start[], _decompressor_syms_end[];
 extern char _stack_start[], _stack_end[];
 extern char _end[], _decompressor_end[];
index 09490ddd6973d664f526f4f3261ac6aed1b2dd72..d6709fd80fef1110ed3d142b811333b98b45dcf5 100644 (file)
@@ -177,18 +177,16 @@ static void kaslr_adjust_got(unsigned long offset) {}
 static void rescue_relocs(void) {}
 static void free_relocs(void) {}
 #else
-int *vmlinux_relocs_64_start;
-int *vmlinux_relocs_64_end;
+static int *vmlinux_relocs_64_start;
+static int *vmlinux_relocs_64_end;
 
 static void rescue_relocs(void)
 {
-       unsigned long size, nrelocs;
+       unsigned long size = __vmlinux_relocs_64_end - __vmlinux_relocs_64_start;
 
-       nrelocs = __vmlinux_relocs_64_end - __vmlinux_relocs_64_start;
-       size = nrelocs * sizeof(uint32_t);
        vmlinux_relocs_64_start = (void *)physmem_alloc_top_down(RR_RELOC, size, 0);
-       memmove(vmlinux_relocs_64_start, (void *)__vmlinux_relocs_64_start, size);
-       vmlinux_relocs_64_end = vmlinux_relocs_64_start + nrelocs;
+       vmlinux_relocs_64_end = (void *)vmlinux_relocs_64_start + size;
+       memmove(vmlinux_relocs_64_start, __vmlinux_relocs_64_start, size);
 }
 
 static void free_relocs(void)