lkml.org 
[lkml]   [2018]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 2/4] x86/fault: Attempt to fixup unhandled #PF in vDSO before signaling
On Thu, Dec 06, 2018 at 10:17:34AM -0800, Dave Hansen wrote:
> > #define CREATE_TRACE_POINTS
> > #include <asm/trace/exceptions.h>
> > @@ -928,6 +929,9 @@ __bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code,
> > if (address >= TASK_SIZE_MAX)
> > error_code |= X86_PF_PROT;
> >
> > + if (fixup_vdso_exception(regs, X86_TRAP_PF, error_code, address))
> > + return;
> > +
> > if (likely(show_unhandled_signals))
> > show_signal_msg(regs, error_code, address, tsk);
>
> I'd preferably like to get this plugged into the page fault code before
> we get to the "bad_area" handling. This plugs it in near the erratum
> handling which seems really late to me.
>
> > @@ -1045,6 +1049,9 @@ do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address,
> > if (is_prefetch(regs, error_code, address))
> > return;
> >
> > + if (fixup_vdso_exception(regs, X86_TRAP_PF, error_code, address))
> > + return;
> > +
> > set_signal_archinfo(address, error_code);
> >
> > #ifdef CONFIG_MEMORY_FAILURE
>
> This *seems* really late to me. We've already called into the mm fault
> handling code to try and handle the fault and they told us it was
> VM_FAULT_SIGBUS. Shouldn't we have just detected that it was in the
> vDSO first and not even called the handling code?

Not sure if Andy had other use cases in mind, but for SGX we only want
to invoke the fixup in lieu of a signal. E.g. #PFs to fault in an EPC
page need to be handled in the kernel.

\
 
 \ /
  Last update: 2018-12-06 19:21    [W:0.043 / U:4.200 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site