mirror of
https://abf.rosa.ru/djam/kernel-5.15.git
synced 2025-02-23 10:32:54 +00:00

http://git.altlinux.org/gears/k/kernel-image-std-def.git?p=kernel-image-std-def.git;a=commitdiff;h=61a50e6f47fabdea107f9e94c43104347359e7d8
55 lines
1.9 KiB
Diff
55 lines
1.9 KiB
Diff
From 92b5312314e5eb9f4d153c4f54ad6876c3bafc86 Mon Sep 17 00:00:00 2001
|
|
From: Alexey Sheplyakov <asheplyakov@altlinux.org>
|
|
Date: Wed, 25 Aug 2021 20:48:10 +0400
|
|
Subject: [PATCH] BE-M1000 secondary CPUs boot fix
|
|
|
|
(adaptation for changes in newer minor release of kernel 5.10.x)
|
|
---
|
|
drivers/firmware/efi/libstub/arm64-stub.c | 17 +++++++++--------
|
|
1 file changed, 9 insertions(+), 8 deletions(-)
|
|
|
|
diff --git a/drivers/firmware/efi/libstub/arm64-stub.c b/drivers/firmware/efi/libstub/arm64-stub.c
|
|
index 411f1546d171..d21f21b105d7 100644
|
|
--- a/drivers/firmware/efi/libstub/arm64-stub.c
|
|
+++ b/drivers/firmware/efi/libstub/arm64-stub.c
|
|
@@ -127,13 +127,6 @@ efi_status_t handle_kernel_image(unsigned long *image_addr,
|
|
efi_status_t status;
|
|
unsigned long kernel_size, kernel_memsize = 0;
|
|
u32 phys_seed = 0;
|
|
- bool force_low_reloc = need_low_alloc();
|
|
- if (force_low_reloc) {
|
|
- if (!efi_nokaslr) {
|
|
- efi_info("booting on a broken firmware, KASLR will be disabled\n");
|
|
- efi_nokaslr = true;
|
|
- }
|
|
- }
|
|
|
|
/*
|
|
* Although relocatable kernels can fix up the misalignment with
|
|
@@ -145,6 +138,14 @@ efi_status_t handle_kernel_image(unsigned long *image_addr,
|
|
*/
|
|
u64 min_kimg_align = efi_nokaslr ? MIN_KIMG_ALIGN : EFI_KIMG_ALIGN;
|
|
|
|
+ bool force_low_reloc = need_low_alloc();
|
|
+ if (force_low_reloc) {
|
|
+ if (!efi_nokaslr) {
|
|
+ efi_info("booting on a broken firmware, KASLR will be disabled\n");
|
|
+ efi_nokaslr = true;
|
|
+ }
|
|
+ }
|
|
+
|
|
if (IS_ENABLED(CONFIG_RANDOMIZE_BASE)) {
|
|
if (!efi_nokaslr) {
|
|
status = efi_get_random_bytes(sizeof(phys_seed),
|
|
@@ -187,7 +188,7 @@ efi_status_t handle_kernel_image(unsigned long *image_addr,
|
|
|
|
if (force_low_reloc) {
|
|
status = efi_low_alloc(*reserve_size,
|
|
- min_kimg_align(),
|
|
+ min_kimg_align,
|
|
reserve_addr);
|
|
if (status != EFI_SUCCESS) {
|
|
efi_err("Failed to relocate kernel, expect secondary CPUs boot failure\n");
|
|
--
|
|
2.31.1
|
|
|