From 0f662eabce25bd7eaafa31944f6f483f6777f28e Mon Sep 17 00:00:00 2001 From: Mikhail Novosyolov Date: Tue, 14 Sep 2021 22:36:28 +0300 Subject: [PATCH] Rediff patch for kernel v5.10.64 --- ...-secondary-CPUs-boot-on-BE-M1000-SoC.patch | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/0607-Fixed-secondary-CPUs-boot-on-BE-M1000-SoC.patch b/0607-Fixed-secondary-CPUs-boot-on-BE-M1000-SoC.patch index cbc5131..e33253b 100644 --- a/0607-Fixed-secondary-CPUs-boot-on-BE-M1000-SoC.patch +++ b/0607-Fixed-secondary-CPUs-boot-on-BE-M1000-SoC.patch @@ -1,7 +1,7 @@ -From 460b2ff3c8509372228afae9e869aa375b85c319 Mon Sep 17 00:00:00 2001 +From f2c459c92298deb7054414bd857fe26723be5dab Mon Sep 17 00:00:00 2001 From: Alexey Sheplyakov Date: Tue, 10 Nov 2020 19:05:39 +0400 -Subject: [PATCH 607/625] Fixed secondary CPUs boot on BE-M1000 SoC +Subject: [PATCH 607/631] Fixed secondary CPUs boot on BE-M1000 SoC The secure world on BE-M1000 SoC denies execution attempts outside of the ranges [0x80000000, 0x8FFFFFFF] [0xA0000000, 0xBFFFFFFF]. Thus @@ -19,7 +19,7 @@ ones) and forcibly relocate the kernel to a low(er) address. 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/efi/libstub/arm64-stub.c b/drivers/firmware/efi/libstub/arm64-stub.c -index 22ece1ad68a8..897708508909 100644 +index c1b57dfb1277..411f1546d171 100644 --- a/drivers/firmware/efi/libstub/arm64-stub.c +++ b/drivers/firmware/efi/libstub/arm64-stub.c @@ -11,6 +11,7 @@ @@ -60,10 +60,10 @@ index 22ece1ad68a8..897708508909 100644 +} + /* - * Although relocatable kernels can fix up the misalignment with respect to - * MIN_KIMG_ALIGN, the resulting virtual text addresses are subtly out of -@@ -46,6 +72,19 @@ static u64 min_kimg_align(void) - return efi_nokaslr ? MIN_KIMG_ALIGN : EFI_KIMG_ALIGN; + * Distro versions of GRUB may ignore the BSS allocation entirely (i.e., fail + * to provide space, and fail to zero it). Check for this condition by double +@@ -79,6 +105,19 @@ static bool check_image_region(u64 base, u64 size) + return ret; } +static inline efi_status_t efi_low_alloc(unsigned long size, unsigned long align, @@ -82,7 +82,7 @@ index 22ece1ad68a8..897708508909 100644 efi_status_t handle_kernel_image(unsigned long *image_addr, unsigned long *image_size, unsigned long *reserve_addr, -@@ -55,6 +94,13 @@ efi_status_t handle_kernel_image(unsigned long *image_addr, +@@ -88,6 +127,13 @@ 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; @@ -94,9 +94,9 @@ index 22ece1ad68a8..897708508909 100644 + } + } - if (IS_ENABLED(CONFIG_RANDOMIZE_BASE)) { - if (!efi_nokaslr) { -@@ -69,7 +115,8 @@ efi_status_t handle_kernel_image(unsigned long *image_addr, + /* + * Although relocatable kernels can fix up the misalignment with +@@ -112,7 +158,8 @@ efi_status_t handle_kernel_image(unsigned long *image_addr, efi_nokaslr = true; } } else { @@ -106,7 +106,7 @@ index 22ece1ad68a8..897708508909 100644 } } -@@ -91,6 +138,15 @@ efi_status_t handle_kernel_image(unsigned long *image_addr, +@@ -138,6 +185,15 @@ efi_status_t handle_kernel_image(unsigned long *image_addr, status = EFI_OUT_OF_RESOURCES; } @@ -120,9 +120,9 @@ index 22ece1ad68a8..897708508909 100644 + } + if (status != EFI_SUCCESS) { - if (IS_ALIGNED((u64)_text, min_kimg_align())) { - /* -@@ -113,6 +169,9 @@ efi_status_t handle_kernel_image(unsigned long *image_addr, + if (!check_image_region((u64)_text, kernel_memsize)) { + efi_err("FIRMWARE BUG: Image BSS overlaps adjacent EFI memory region\n"); +@@ -162,6 +218,9 @@ efi_status_t handle_kernel_image(unsigned long *image_addr, } *image_addr = *reserve_addr;