--- /dev/null
+From aca7c13d3bee81a968337a5515411409ae9d095d Mon Sep 17 00:00:00 2001
+From: Helge Deller <deller@gmx.de>
+Date: Fri, 14 Oct 2022 10:13:55 +0200
+Subject: parisc: fbdev/stifb: Align graphics memory size to 4MB
+
+From: Helge Deller <deller@gmx.de>
+
+commit aca7c13d3bee81a968337a5515411409ae9d095d upstream.
+
+Independend of the current graphics resolution, adjust the reported
+graphics card memory size to the next 4MB boundary.
+This fixes the fbtest program which expects a naturally aligned size.
+
+Signed-off-by: Helge Deller <deller@gmx.de>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/video/fbdev/stifb.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/video/fbdev/stifb.c
++++ b/drivers/video/fbdev/stifb.c
+@@ -1257,7 +1257,7 @@ static int __init stifb_init_fb(struct s
+
+ /* limit fbsize to max visible screen size */
+ if (fix->smem_len > yres*fix->line_length)
+- fix->smem_len = yres*fix->line_length;
++ fix->smem_len = ALIGN(yres*fix->line_length, 4*1024*1024);
+
+ fix->accel = FB_ACCEL_NONE;
+
Reported-by: Saeed Mirzamohammadi <saeed.mirzamohammadi@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
- fs/splice.c | 10 ++++++----
+ fs/splice.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
-diff --git a/fs/splice.c b/fs/splice.c
-index ef1604e307f1..fd28c7da3c83 100644
--- a/fs/splice.c
+++ b/fs/splice.c
-@@ -899,15 +899,17 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd,
+@@ -899,15 +899,17 @@ ssize_t splice_direct_to_actor(struct fi
{
struct pipe_inode_info *pipe;
long ret, bytes;
return -EINVAL;
/*
---
-2.35.1
-
--- /dev/null
+From 9e2e6042a7ec6504fe8e366717afa2f40cf16488 Mon Sep 17 00:00:00 2001
+From: Andrew Bresticker <abrestic@rivosinc.com>
+Date: Thu, 15 Sep 2022 15:37:02 -0400
+Subject: riscv: Allow PROT_WRITE-only mmap()
+
+From: Andrew Bresticker <abrestic@rivosinc.com>
+
+commit 9e2e6042a7ec6504fe8e366717afa2f40cf16488 upstream.
+
+Commit 2139619bcad7 ("riscv: mmap with PROT_WRITE but no PROT_READ is
+invalid") made mmap() return EINVAL if PROT_WRITE was set wihtout
+PROT_READ with the justification that a write-only PTE is considered a
+reserved PTE permission bit pattern in the privileged spec. This check
+is unnecessary since we let VM_WRITE imply VM_READ on RISC-V, and it is
+inconsistent with other architectures that don't support write-only PTEs,
+creating a potential software portability issue. Just remove the check
+altogether and let PROT_WRITE imply PROT_READ as is the case on other
+architectures.
+
+Note that this also allows PROT_WRITE|PROT_EXEC mappings which were
+disallowed prior to the aforementioned commit; PROT_READ is implied in
+such mappings as well.
+
+Fixes: 2139619bcad7 ("riscv: mmap with PROT_WRITE but no PROT_READ is invalid")
+Reviewed-by: Atish Patra <atishp@rivosinc.com>
+Signed-off-by: Andrew Bresticker <abrestic@rivosinc.com>
+Cc: stable@vger.kernel.org
+Link: https://lore.kernel.org/r/20220915193702.2201018-3-abrestic@rivosinc.com/
+Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/riscv/kernel/sys_riscv.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+--- a/arch/riscv/kernel/sys_riscv.c
++++ b/arch/riscv/kernel/sys_riscv.c
+@@ -26,9 +26,6 @@ static long riscv_sys_mmap(unsigned long
+ if (unlikely(offset & (~PAGE_MASK >> page_shift_offset)))
+ return -EINVAL;
+
+- if (unlikely((prot & PROT_WRITE) && !(prot & PROT_READ)))
+- return -EINVAL;
+-
+ return ksys_mmap_pgoff(addr, len, prot, flags, fd,
+ offset >> (PAGE_SHIFT - page_shift_offset));
+ }
quota-check-next-prev-free-block-number-after-reading-from-quota-file.patch
regulator-qcom_rpm-fix-circular-deferral-regression.patch
revert-fs-check-fmode_lseek-to-control-internal-pipe.patch
+parisc-fbdev-stifb-align-graphics-memory-size-to-4mb.patch
+riscv-allow-prot_write-only-mmap.patch