+++ /dev/null
-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))
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
+++ /dev/null
-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))
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
/*
* 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);
#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))
#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)
#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.
*/
#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 */
/*
* 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 */
+++ /dev/null
-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))
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