From: Greg Kroah-Hartman Date: Mon, 17 Apr 2023 08:14:47 +0000 (+0200) Subject: drop riscv-no-need-to-relocate-the-dtb-as-it-lies-in-the-fixmap-region.patch X-Git-Tag: v4.14.313~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=391b01ce7d00f46df1e01794a2d06399c78dc9f2;p=thirdparty%2Fkernel%2Fstable-queue.git drop riscv-no-need-to-relocate-the-dtb-as-it-lies-in-the-fixmap-region.patch --- diff --git a/queue-5.15/riscv-no-need-to-relocate-the-dtb-as-it-lies-in-the-fixmap-region.patch b/queue-5.15/riscv-no-need-to-relocate-the-dtb-as-it-lies-in-the-fixmap-region.patch deleted file mode 100644 index e7bd22f0842..00000000000 --- a/queue-5.15/riscv-no-need-to-relocate-the-dtb-as-it-lies-in-the-fixmap-region.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 1b50f956c8fe9082bdee4a9cfd798149c52f7043 Mon Sep 17 00:00:00 2001 -From: Alexandre Ghiti -Date: Wed, 29 Mar 2023 10:19:32 +0200 -Subject: riscv: No need to relocate the dtb as it lies in the fixmap region - -From: Alexandre Ghiti - -commit 1b50f956c8fe9082bdee4a9cfd798149c52f7043 upstream. - -We used to access the dtb via its linear mapping address but now that the -dtb early mapping was moved in the fixmap region, we can keep using this -address since it is present in swapper_pg_dir, and remove the dtb -relocation. - -Note that the relocation was wrong anyway since early_memremap() is -restricted to 256K whereas the maximum fdt size is 2MB. - -Signed-off-by: Alexandre Ghiti -Reviewed-by: Conor Dooley -Tested-by: Conor Dooley -Link: https://lore.kernel.org/r/20230329081932.79831-4-alexghiti@rivosinc.com -Cc: stable@vger.kernel.org -Signed-off-by: Palmer Dabbelt -Signed-off-by: Greg Kroah-Hartman ---- - arch/riscv/mm/init.c | 21 ++------------------- - 1 file changed, 2 insertions(+), 19 deletions(-) - ---- a/arch/riscv/mm/init.c -+++ b/arch/riscv/mm/init.c -@@ -222,25 +222,8 @@ static void __init setup_bootmem(void) - * early_init_fdt_reserve_self() since __pa() does - * not work for DTB pointers that are fixmap addresses - */ -- if (!IS_ENABLED(CONFIG_BUILTIN_DTB)) { -- /* -- * In case the DTB is not located in a memory region we won't -- * be able to locate it later on via the linear mapping and -- * get a segfault when accessing it via __va(dtb_early_pa). -- * To avoid this situation copy DTB to a memory region. -- * Note that memblock_phys_alloc will also reserve DTB region. -- */ -- if (!memblock_is_memory(dtb_early_pa)) { -- size_t fdt_size = fdt_totalsize(dtb_early_va); -- phys_addr_t new_dtb_early_pa = memblock_phys_alloc(fdt_size, PAGE_SIZE); -- void *new_dtb_early_va = early_memremap(new_dtb_early_pa, fdt_size); -- -- memcpy(new_dtb_early_va, dtb_early_va, fdt_size); -- early_memunmap(new_dtb_early_va, fdt_size); -- _dtb_early_pa = new_dtb_early_pa; -- } else -- memblock_reserve(dtb_early_pa, fdt_totalsize(dtb_early_va)); -- } -+ if (!IS_ENABLED(CONFIG_BUILTIN_DTB)) -+ memblock_reserve(dtb_early_pa, fdt_totalsize(dtb_early_va)); - - dma_contiguous_reserve(dma32_phys_limit); - if (IS_ENABLED(CONFIG_64BIT)) diff --git a/queue-5.15/series b/queue-5.15/series index 1f5b5c7da87..c4fd2c77d47 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -55,7 +55,6 @@ tracing-have-tracing_snapshot_instance_cond-write-er.patch i915-perf-replace-drm_debug-with-driver-specific-drm.patch drm-i915-fix-race-condition-uaf-in-i915_perf_add_con.patch riscv-do-not-set-initial_boot_params-to-the-linear-address-of-the-dtb.patch -riscv-no-need-to-relocate-the-dtb-as-it-lies-in-the-fixmap-region.patch riscv-add-icache-flush-for-nommu-sigreturn-trampoline.patch net-sfp-initialize-sfp-i2c_block_size-at-sfp-allocation.patch net-phy-nxp-c45-tja11xx-add-remove-callback.patch diff --git a/queue-6.1/riscv-no-need-to-relocate-the-dtb-as-it-lies-in-the-fixmap-region.patch b/queue-6.1/riscv-no-need-to-relocate-the-dtb-as-it-lies-in-the-fixmap-region.patch deleted file mode 100644 index e830e2bad24..00000000000 --- a/queue-6.1/riscv-no-need-to-relocate-the-dtb-as-it-lies-in-the-fixmap-region.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 1b50f956c8fe9082bdee4a9cfd798149c52f7043 Mon Sep 17 00:00:00 2001 -From: Alexandre Ghiti -Date: Wed, 29 Mar 2023 10:19:32 +0200 -Subject: riscv: No need to relocate the dtb as it lies in the fixmap region - -From: Alexandre Ghiti - -commit 1b50f956c8fe9082bdee4a9cfd798149c52f7043 upstream. - -We used to access the dtb via its linear mapping address but now that the -dtb early mapping was moved in the fixmap region, we can keep using this -address since it is present in swapper_pg_dir, and remove the dtb -relocation. - -Note that the relocation was wrong anyway since early_memremap() is -restricted to 256K whereas the maximum fdt size is 2MB. - -Signed-off-by: Alexandre Ghiti -Reviewed-by: Conor Dooley -Tested-by: Conor Dooley -Link: https://lore.kernel.org/r/20230329081932.79831-4-alexghiti@rivosinc.com -Cc: stable@vger.kernel.org -Signed-off-by: Palmer Dabbelt -Signed-off-by: Greg Kroah-Hartman ---- - arch/riscv/mm/init.c | 21 ++------------------- - 1 file changed, 2 insertions(+), 19 deletions(-) - ---- a/arch/riscv/mm/init.c -+++ b/arch/riscv/mm/init.c -@@ -242,25 +242,8 @@ static void __init setup_bootmem(void) - * early_init_fdt_reserve_self() since __pa() does - * not work for DTB pointers that are fixmap addresses - */ -- if (!IS_ENABLED(CONFIG_BUILTIN_DTB)) { -- /* -- * In case the DTB is not located in a memory region we won't -- * be able to locate it later on via the linear mapping and -- * get a segfault when accessing it via __va(dtb_early_pa). -- * To avoid this situation copy DTB to a memory region. -- * Note that memblock_phys_alloc will also reserve DTB region. -- */ -- if (!memblock_is_memory(dtb_early_pa)) { -- size_t fdt_size = fdt_totalsize(dtb_early_va); -- phys_addr_t new_dtb_early_pa = memblock_phys_alloc(fdt_size, PAGE_SIZE); -- void *new_dtb_early_va = early_memremap(new_dtb_early_pa, fdt_size); -- -- memcpy(new_dtb_early_va, dtb_early_va, fdt_size); -- early_memunmap(new_dtb_early_va, fdt_size); -- _dtb_early_pa = new_dtb_early_pa; -- } else -- memblock_reserve(dtb_early_pa, fdt_totalsize(dtb_early_va)); -- } -+ if (!IS_ENABLED(CONFIG_BUILTIN_DTB)) -+ memblock_reserve(dtb_early_pa, fdt_totalsize(dtb_early_va)); - - dma_contiguous_reserve(dma32_phys_limit); - if (IS_ENABLED(CONFIG_64BIT)) diff --git a/queue-6.1/series b/queue-6.1/series index d8c96b180de..07c43b52a62 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -101,7 +101,6 @@ tracing-have-tracing_snapshot_instance_cond-write-er.patch maple_tree-fix-write-memory-barrier-of-nodes-once-de.patch ksmbd-avoid-out-of-bounds-access-in-decode_preauth_ctxt.patch riscv-do-not-set-initial_boot_params-to-the-linear-address-of-the-dtb.patch -riscv-no-need-to-relocate-the-dtb-as-it-lies-in-the-fixmap-region.patch riscv-add-icache-flush-for-nommu-sigreturn-trampoline.patch hid-intel-ish-hid-fix-kernel-panic-during-warm-reset.patch net-sfp-initialize-sfp-i2c_block_size-at-sfp-allocation.patch diff --git a/queue-6.2/riscv-move-early-dtb-mapping-into-the-fixmap-region.patch b/queue-6.2/riscv-move-early-dtb-mapping-into-the-fixmap-region.patch index d029ddb8491..a0e77303bbc 100644 --- a/queue-6.2/riscv-move-early-dtb-mapping-into-the-fixmap-region.patch +++ b/queue-6.2/riscv-move-early-dtb-mapping-into-the-fixmap-region.patch @@ -147,7 +147,7 @@ Signed-off-by: Greg Kroah-Hartman /* * If DTB is built in, no need to reserve its memblock. * Otherwise, do reserve it but avoid using -@@ -262,9 +269,6 @@ pgd_t trampoline_pg_dir[PTRS_PER_PGD] __ +@@ -279,9 +286,6 @@ pgd_t trampoline_pg_dir[PTRS_PER_PGD] __ static pte_t fixmap_pte[PTRS_PER_PTE] __page_aligned_bss; pgd_t early_pg_dir[PTRS_PER_PGD] __initdata __aligned(PAGE_SIZE); @@ -157,7 +157,7 @@ Signed-off-by: Greg Kroah-Hartman #ifdef CONFIG_XIP_KERNEL #define pt_ops (*(struct pt_alloc_ops *)XIP_FIXUP(&pt_ops)) -@@ -609,9 +613,6 @@ static void __init create_p4d_mapping(p4 +@@ -626,9 +630,6 @@ static void __init create_p4d_mapping(p4 #define trampoline_pgd_next (pgtable_l5_enabled ? \ (uintptr_t)trampoline_p4d : (pgtable_l4_enabled ? \ (uintptr_t)trampoline_pud : (uintptr_t)trampoline_pmd)) @@ -167,7 +167,7 @@ Signed-off-by: Greg Kroah-Hartman #else #define pgd_next_t pte_t #define alloc_pgd_next(__va) pt_ops.alloc_pte(__va) -@@ -619,7 +620,6 @@ static void __init create_p4d_mapping(p4 +@@ -636,7 +637,6 @@ static void __init create_p4d_mapping(p4 #define create_pgd_next_mapping(__nextp, __va, __pa, __sz, __prot) \ create_pte_mapping(__nextp, __va, __pa, __sz, __prot) #define fixmap_pgd_next ((uintptr_t)fixmap_pte) @@ -175,7 +175,7 @@ Signed-off-by: Greg Kroah-Hartman #define create_p4d_mapping(__pmdp, __va, __pa, __sz, __prot) do {} while(0) #define create_pud_mapping(__pmdp, __va, __pa, __sz, __prot) do {} while(0) #define create_pmd_mapping(__pmdp, __va, __pa, __sz, __prot) do {} while(0) -@@ -843,32 +843,28 @@ static void __init create_kernel_page_ta +@@ -860,32 +860,28 @@ static void __init create_kernel_page_ta * this means 2 PMD entries whereas for 32-bit kernel, this is only 1 PGDIR * entry. */ @@ -222,7 +222,7 @@ Signed-off-by: Greg Kroah-Hartman #else /* * For 64-bit kernel, __va can't be used since it would return a linear -@@ -1038,7 +1034,8 @@ asmlinkage void __init setup_vm(uintptr_ +@@ -1055,7 +1051,8 @@ asmlinkage void __init setup_vm(uintptr_ create_kernel_page_table(early_pg_dir, true); /* Setup early mapping for FDT early scan */ @@ -232,7 +232,7 @@ Signed-off-by: Greg Kroah-Hartman /* * Bootime fixmap only can handle PMD_SIZE mapping. Thus, boot-ioremap -@@ -1080,6 +1077,16 @@ static void __init setup_vm_final(void) +@@ -1097,6 +1094,16 @@ static void __init setup_vm_final(void) u64 i; /* Setup swapper PGD for fixmap */ diff --git a/queue-6.2/riscv-no-need-to-relocate-the-dtb-as-it-lies-in-the-fixmap-region.patch b/queue-6.2/riscv-no-need-to-relocate-the-dtb-as-it-lies-in-the-fixmap-region.patch deleted file mode 100644 index e830e2bad24..00000000000 --- a/queue-6.2/riscv-no-need-to-relocate-the-dtb-as-it-lies-in-the-fixmap-region.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 1b50f956c8fe9082bdee4a9cfd798149c52f7043 Mon Sep 17 00:00:00 2001 -From: Alexandre Ghiti -Date: Wed, 29 Mar 2023 10:19:32 +0200 -Subject: riscv: No need to relocate the dtb as it lies in the fixmap region - -From: Alexandre Ghiti - -commit 1b50f956c8fe9082bdee4a9cfd798149c52f7043 upstream. - -We used to access the dtb via its linear mapping address but now that the -dtb early mapping was moved in the fixmap region, we can keep using this -address since it is present in swapper_pg_dir, and remove the dtb -relocation. - -Note that the relocation was wrong anyway since early_memremap() is -restricted to 256K whereas the maximum fdt size is 2MB. - -Signed-off-by: Alexandre Ghiti -Reviewed-by: Conor Dooley -Tested-by: Conor Dooley -Link: https://lore.kernel.org/r/20230329081932.79831-4-alexghiti@rivosinc.com -Cc: stable@vger.kernel.org -Signed-off-by: Palmer Dabbelt -Signed-off-by: Greg Kroah-Hartman ---- - arch/riscv/mm/init.c | 21 ++------------------- - 1 file changed, 2 insertions(+), 19 deletions(-) - ---- a/arch/riscv/mm/init.c -+++ b/arch/riscv/mm/init.c -@@ -242,25 +242,8 @@ static void __init setup_bootmem(void) - * early_init_fdt_reserve_self() since __pa() does - * not work for DTB pointers that are fixmap addresses - */ -- if (!IS_ENABLED(CONFIG_BUILTIN_DTB)) { -- /* -- * In case the DTB is not located in a memory region we won't -- * be able to locate it later on via the linear mapping and -- * get a segfault when accessing it via __va(dtb_early_pa). -- * To avoid this situation copy DTB to a memory region. -- * Note that memblock_phys_alloc will also reserve DTB region. -- */ -- if (!memblock_is_memory(dtb_early_pa)) { -- size_t fdt_size = fdt_totalsize(dtb_early_va); -- phys_addr_t new_dtb_early_pa = memblock_phys_alloc(fdt_size, PAGE_SIZE); -- void *new_dtb_early_va = early_memremap(new_dtb_early_pa, fdt_size); -- -- memcpy(new_dtb_early_va, dtb_early_va, fdt_size); -- early_memunmap(new_dtb_early_va, fdt_size); -- _dtb_early_pa = new_dtb_early_pa; -- } else -- memblock_reserve(dtb_early_pa, fdt_totalsize(dtb_early_va)); -- } -+ if (!IS_ENABLED(CONFIG_BUILTIN_DTB)) -+ memblock_reserve(dtb_early_pa, fdt_totalsize(dtb_early_va)); - - dma_contiguous_reserve(dma32_phys_limit); - if (IS_ENABLED(CONFIG_64BIT)) diff --git a/queue-6.2/series b/queue-6.2/series index aac3054668e..24cdde18d70 100644 --- a/queue-6.2/series +++ b/queue-6.2/series @@ -102,7 +102,6 @@ tracing-have-tracing_snapshot_instance_cond-write-er.patch maple_tree-fix-write-memory-barrier-of-nodes-once-de.patch ksmbd-avoid-out-of-bounds-access-in-decode_preauth_ctxt.patch riscv-do-not-set-initial_boot_params-to-the-linear-address-of-the-dtb.patch -riscv-no-need-to-relocate-the-dtb-as-it-lies-in-the-fixmap-region.patch riscv-move-early-dtb-mapping-into-the-fixmap-region.patch riscv-add-icache-flush-for-nommu-sigreturn-trampoline.patch hid-intel-ish-hid-fix-kernel-panic-during-warm-reset.patch