linux-stable/arch/riscv
Alexandre Ghiti 1de195dd0e riscv: fix set_huge_pte_at() for NAPOT mappings when a swap entry is set
We used to determine the number of page table entries to set for a NAPOT
hugepage by using the pte value which actually fails when the pte to set
is a swap entry.

So take advantage of a recent fix for arm64 reported in [1] which
introduces the size of the mapping as an argument of set_huge_pte_at(): we
can then use this size to compute the number of page table entries to set
for a NAPOT region.

Link: https://lkml.kernel.org/r/20230928151846.8229-3-alexghiti@rivosinc.com
Fixes: 82a1a1f3bf ("riscv: mm: support Svnapot in hugetlb page")
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Reported-by: Ryan Roberts <ryan.roberts@arm.com>
Closes: https://lore.kernel.org/linux-arm-kernel/20230922115804.2043771-1-ryan.roberts@arm.com/ [1]
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Qinglin Pan <panqinglin2020@iscas.ac.cn>
Cc: Conor Dooley <conor@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-10-06 14:11:38 -07:00
..
boot riscv: dts: starfive: visionfive 2: Fix uart0 pins sort order 2023-09-13 14:24:56 +01:00
configs Kbuild updates for v6.6 2023-09-05 11:01:47 -07:00
errata Merge patch series "Add non-coherent DMA support for AX45MP" 2023-09-08 11:24:34 -07:00
include mm: hugetlb: add huge page size param to set_huge_pte_at() 2023-09-29 17:20:47 -07:00
kernel riscv: kexec: Align the kexeced kernel entry 2023-09-12 13:58:39 -07:00
kvm RISC-V: KVM: Fix riscv_vcpu_get_isa_ext_single() for missing extensions 2023-09-21 15:04:01 +05:30
lib riscv: uaccess: Return the number of bytes effectively not copied 2023-08-16 07:30:06 -07:00
mm riscv: fix set_huge_pte_at() for NAPOT mappings when a swap entry is set 2023-10-06 14:11:38 -07:00
net bpf, riscv: use prog pack allocator in the BPF JIT 2023-09-06 06:26:07 -07:00
purgatory riscv/purgatory: Disable CFI 2023-08-23 14:16:40 -07:00
tools
Kbuild kexec: rename ARCH_HAS_KEXEC_PURGATORY 2023-08-18 10:18:54 -07:00
Kconfig riscv: Kconfig: Select DMA_DIRECT_REMAP only if MMU is enabled 2023-09-08 11:25:26 -07:00
Kconfig.debug
Kconfig.errata riscv: Kconfig.errata: Add dependency for RISCV_SBI in ERRATA_ANDES config 2023-09-08 11:25:28 -07:00
Kconfig.socs RISC-V: make ARCH_THEAD preclude XIP_KERNEL 2023-07-05 22:21:23 +02:00
Makefile riscv: Require FRAME_POINTER for some configurations 2023-08-23 09:07:26 -07:00
Makefile.postlink riscv: Use --emit-relocs in order to move .rela.dyn in init 2023-04-19 07:46:33 -07:00