Patch "riscv: Fix build error on rv32 + XIP" has been added to the 6.7-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    riscv: Fix build error on rv32 + XIP

to the 6.7-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     riscv-fix-build-error-on-rv32-xip.patch
and it can be found in the queue-6.7 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 4e8b7173d9402cc94d678ff79d14a5ee040ddd3c
Author: Alexandre Ghiti <alexghiti@xxxxxxxxxxxx>
Date:   Thu Jan 18 22:21:20 2024 +0100

    riscv: Fix build error on rv32 + XIP
    
    [ Upstream commit 66f962d8939fd2ac74de901d30d30310c8ddca79 ]
    
    commit 66f1e6809397 ("riscv: Make XIP bootable again") restricted page
    offset to the sv39 page offset instead of the default sv57, which makes
    sense since probably the platforms that target XIP kernels do not
    support anything else than sv39 and we do not try to find out the
    largest address space supported on XIP kernels (ie set_satp_mode()).
    
    But PAGE_OFFSET_L3 is not defined for rv32, so fix the build error by
    restoring the previous behaviour which picks CONFIG_PAGE_OFFSET for rv32.
    
    Fixes: 66f1e6809397 ("riscv: Make XIP bootable again")
    Reported-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
    Closes: https://lore.kernel.org/linux-riscv/344dca85-5c48-44e1-bc64-4fa7973edd12@xxxxxxxxxxxxx/T/#u
    Signed-off-by: Alexandre Ghiti <alexghiti@xxxxxxxxxxxx>
    Acked-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
    Tested-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx> # build-tested
    Link: https://lore.kernel.org/r/20240118212120.2087803-1-alexghiti@xxxxxxxxxxxx
    Signed-off-by: Palmer Dabbelt <palmer@xxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index a65937336cdc..ad77ed410d4d 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -1060,7 +1060,11 @@ asmlinkage void __init setup_vm(uintptr_t dtb_pa)
 	kernel_map.virt_addr = KERNEL_LINK_ADDR + kernel_map.virt_offset;
 
 #ifdef CONFIG_XIP_KERNEL
+#ifdef CONFIG_64BIT
 	kernel_map.page_offset = PAGE_OFFSET_L3;
+#else
+	kernel_map.page_offset = _AC(CONFIG_PAGE_OFFSET, UL);
+#endif
 	kernel_map.xiprom = (uintptr_t)CONFIG_XIP_PHYS_ADDR;
 	kernel_map.xiprom_sz = (uintptr_t)(&_exiprom) - (uintptr_t)(&_xiprom);
 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux