Linux C-SKY architecture development
 help / color / mirror / Atom feed
* [PATCH] riscv: mm: abort uaccess retries upon fatal signal
@ 2020-12-30 14:39 guoren
  2020-12-30 16:52 ` Pekka Enberg
  0 siblings, 1 reply; 2+ messages in thread
From: guoren @ 2020-12-30 14:39 UTC (permalink / raw)
  To: palmerdabbelt, paul.walmsley, anup, atish.patra
  Cc: linux-riscv, linux-kernel, linux-csky, guoren, Guo Ren,
	Mark Rutland, Pekka Enberg, Palmer Dabbelt

From: Guo Ren <guoren@linux.alibaba.com>

Pick up the patch from the 'Link' made by Mark Rutland. Keep the
same with x86, arm, arm64, arc, sh, power.

Link: https://lore.kernel.org/linux-arm-kernel/1499782763-31418-1-git-send-email-mark.rutland@arm.com/
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
---
 arch/riscv/mm/fault.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/riscv/mm/fault.c b/arch/riscv/mm/fault.c
index 3c8b9e4..7f5f45b 100644
--- a/arch/riscv/mm/fault.c
+++ b/arch/riscv/mm/fault.c
@@ -280,8 +280,11 @@ asmlinkage void do_page_fault(struct pt_regs *regs)
 	 * signal first. We do not need to release the mmap_lock because it
 	 * would already be released in __lock_page_or_retry in mm/filemap.c.
 	 */
-	if (fault_signal_pending(fault, regs))
+	if (fault_signal_pending(fault, regs)) {
+		if (!user_mode(regs))
+			no_context(regs, addr);
 		return;
+	}
 
 	if (unlikely((fault & VM_FAULT_RETRY) && (flags & FAULT_FLAG_ALLOW_RETRY))) {
 		flags |= FAULT_FLAG_TRIED;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] riscv: mm: abort uaccess retries upon fatal signal
  2020-12-30 14:39 [PATCH] riscv: mm: abort uaccess retries upon fatal signal guoren
@ 2020-12-30 16:52 ` Pekka Enberg
  0 siblings, 0 replies; 2+ messages in thread
From: Pekka Enberg @ 2020-12-30 16:52 UTC (permalink / raw)
  To: Guo Ren
  Cc: Palmer Dabbelt, Paul Walmsley, Anup Patel, Atish Patra,
	Mark Rutland, Guo Ren, LKML, linux-csky, Palmer Dabbelt,
	linux-riscv

On Wed, Dec 30, 2020 at 4:40 PM <guoren@kernel.org> wrote:
> From: Guo Ren <guoren@linux.alibaba.com>
>
> Pick up the patch from the 'Link' made by Mark Rutland. Keep the
> same with x86, arm, arm64, arc, sh, power.
>
> Link: https://lore.kernel.org/linux-arm-kernel/1499782763-31418-1-git-send-email-mark.rutland@arm.com/
> Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Pekka Enberg <penberg@kernel.org>
> Cc: Palmer Dabbelt <palmer@dabbelt.com>

Reviewed-by: Pekka Enberg <penberg@kernel.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-30 16:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-30 14:39 [PATCH] riscv: mm: abort uaccess retries upon fatal signal guoren
2020-12-30 16:52 ` Pekka Enberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox