]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
drop riscv-no-need-to-relocate-the-dtb-as-it-lies-in-the-fixmap-region.patch
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Apr 2023 08:14:47 +0000 (10:14 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Apr 2023 08:14:47 +0000 (10:14 +0200)
queue-5.15/riscv-no-need-to-relocate-the-dtb-as-it-lies-in-the-fixmap-region.patch [deleted file]
queue-5.15/series
queue-6.1/riscv-no-need-to-relocate-the-dtb-as-it-lies-in-the-fixmap-region.patch [deleted file]
queue-6.1/series
queue-6.2/riscv-move-early-dtb-mapping-into-the-fixmap-region.patch
queue-6.2/riscv-no-need-to-relocate-the-dtb-as-it-lies-in-the-fixmap-region.patch [deleted file]
queue-6.2/series

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 (file)
index e7bd22f..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-From 1b50f956c8fe9082bdee4a9cfd798149c52f7043 Mon Sep 17 00:00:00 2001
-From: Alexandre Ghiti <alexghiti@rivosinc.com>
-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 <alexghiti@rivosinc.com>
-
-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 <alexghiti@rivosinc.com>
-Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
-Tested-by: Conor Dooley <conor.dooley@microchip.com>
-Link: https://lore.kernel.org/r/20230329081932.79831-4-alexghiti@rivosinc.com
-Cc: stable@vger.kernel.org
-Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- 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))
index 1f5b5c7da87bf42082a82294e48812de43e1b045..c4fd2c77d47f438b54681a05bc606f8190bcca4b 100644 (file)
@@ -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 (file)
index e830e2b..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-From 1b50f956c8fe9082bdee4a9cfd798149c52f7043 Mon Sep 17 00:00:00 2001
-From: Alexandre Ghiti <alexghiti@rivosinc.com>
-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 <alexghiti@rivosinc.com>
-
-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 <alexghiti@rivosinc.com>
-Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
-Tested-by: Conor Dooley <conor.dooley@microchip.com>
-Link: https://lore.kernel.org/r/20230329081932.79831-4-alexghiti@rivosinc.com
-Cc: stable@vger.kernel.org
-Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- 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))
index d8c96b180de454589552412f4e732bddde20a9f8..07c43b52a62cfca0608e11bd8b615109a6afd8c3 100644 (file)
@@ -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
index d029ddb8491d8c52ba4cbad99ec1dacb4ec3bd87..a0e77303bbc2acf1e7adbde07b8df181d5f465be 100644 (file)
@@ -147,7 +147,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
        /*
         * 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 <gregkh@linuxfoundation.org>
  
  #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 <gregkh@linuxfoundation.org>
  #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 <gregkh@linuxfoundation.org>
  #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 <gregkh@linuxfoundation.org>
  #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 <gregkh@linuxfoundation.org>
  
        /*
         * 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 (file)
index e830e2b..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-From 1b50f956c8fe9082bdee4a9cfd798149c52f7043 Mon Sep 17 00:00:00 2001
-From: Alexandre Ghiti <alexghiti@rivosinc.com>
-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 <alexghiti@rivosinc.com>
-
-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 <alexghiti@rivosinc.com>
-Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
-Tested-by: Conor Dooley <conor.dooley@microchip.com>
-Link: https://lore.kernel.org/r/20230329081932.79831-4-alexghiti@rivosinc.com
-Cc: stable@vger.kernel.org
-Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- 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))
index aac3054668e6471a13d95f2dfd6f3907341879e9..24cdde18d7046ce581501d4a48d87685bf2884df 100644 (file)
@@ -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