Re: [PATCH] x86/mpx: Correctly report do_mpx_bt_fault() failures to user-space

2017-04-21 Thread Dave Hansen
On 04/21/2017 05:19 AM, Joerg Roedel wrote: > On Thu, Apr 20, 2017 at 08:45:28AM -0700, Dave Hansen wrote: >> How about doing X86_TRAP_PF? That would at least be consistent with >> SIGBUS, which is probably the closest thing to a generic error code that >> we have. > Correct me if I am wrong, but

Re: [PATCH] x86/mpx: Correctly report do_mpx_bt_fault() failures to user-space

2017-04-21 Thread Dave Hansen
On 04/21/2017 05:19 AM, Joerg Roedel wrote: > On Thu, Apr 20, 2017 at 08:45:28AM -0700, Dave Hansen wrote: >> How about doing X86_TRAP_PF? That would at least be consistent with >> SIGBUS, which is probably the closest thing to a generic error code that >> we have. > Correct me if I am wrong, but

Re: [PATCH] x86/mpx: Correctly report do_mpx_bt_fault() failures to user-space

2017-04-21 Thread Joerg Roedel
On Thu, Apr 20, 2017 at 08:45:28AM -0700, Dave Hansen wrote: > How about doing X86_TRAP_PF? That would at least be consistent with > SIGBUS, which is probably the closest thing to a generic error code that > we have. Correct me if I am wrong, but for SIGBUS this only happens in the page-fault

Re: [PATCH] x86/mpx: Correctly report do_mpx_bt_fault() failures to user-space

2017-04-21 Thread Joerg Roedel
On Thu, Apr 20, 2017 at 08:45:28AM -0700, Dave Hansen wrote: > How about doing X86_TRAP_PF? That would at least be consistent with > SIGBUS, which is probably the closest thing to a generic error code that > we have. Correct me if I am wrong, but for SIGBUS this only happens in the page-fault

Re: [PATCH] x86/mpx: Correctly report do_mpx_bt_fault() failures to user-space

2017-04-20 Thread Dave Hansen
On 04/20/2017 05:08 AM, Joerg Roedel wrote: >> do_mpx_bt_fault() can fail for a bunch of reasons: >> * unexpected or invalid value in BNDCSR >> * out of memory (physical or virtual) >> * unresolvable fault walking/filling bounds tables >> * !valid and non-empty bad entry in the bounds tables

Re: [PATCH] x86/mpx: Correctly report do_mpx_bt_fault() failures to user-space

2017-04-20 Thread Dave Hansen
On 04/20/2017 05:08 AM, Joerg Roedel wrote: >> do_mpx_bt_fault() can fail for a bunch of reasons: >> * unexpected or invalid value in BNDCSR >> * out of memory (physical or virtual) >> * unresolvable fault walking/filling bounds tables >> * !valid and non-empty bad entry in the bounds tables

Re: [PATCH] x86/mpx: Correctly report do_mpx_bt_fault() failures to user-space

2017-04-20 Thread Joerg Roedel
Hi Dave, On Mon, Apr 17, 2017 at 08:38:03AM -0700, Dave Hansen wrote: > Just to be clear, the thing you're calling "correct" is this do_trap(), > right? > > do_trap(X86_TRAP_BR, SIGSEGV, "bounds", regs, error_code, NULL); Yes, because it signals the right trap_nr and error_code to

Re: [PATCH] x86/mpx: Correctly report do_mpx_bt_fault() failures to user-space

2017-04-20 Thread Joerg Roedel
Hi Dave, On Mon, Apr 17, 2017 at 08:38:03AM -0700, Dave Hansen wrote: > Just to be clear, the thing you're calling "correct" is this do_trap(), > right? > > do_trap(X86_TRAP_BR, SIGSEGV, "bounds", regs, error_code, NULL); Yes, because it signals the right trap_nr and error_code to

Re: [PATCH] x86/mpx: Correctly report do_mpx_bt_fault() failures to user-space

2017-04-17 Thread Dave Hansen
Hi Joerg, > When this function fails it just sends a SIGSEGV signal to > user-space using force_sig(). This signal is missing > essential information about the cause, e.g. the trap_nr or > an error code. > > Fix this by propagating the error to the only caller of > mpx_handle_bd_fault(),

Re: [PATCH] x86/mpx: Correctly report do_mpx_bt_fault() failures to user-space

2017-04-17 Thread Dave Hansen
Hi Joerg, > When this function fails it just sends a SIGSEGV signal to > user-space using force_sig(). This signal is missing > essential information about the cause, e.g. the trap_nr or > an error code. > > Fix this by propagating the error to the only caller of > mpx_handle_bd_fault(),

[PATCH] x86/mpx: Correctly report do_mpx_bt_fault() failures to user-space

2017-04-06 Thread Joerg Roedel
From: Joerg Roedel When this function fails it just sends a SIGSEGV signal to user-space using force_sig(). This signal is missing essential information about the cause, e.g. the trap_nr or an error code. Fix this by propagating the error to the only caller of

[PATCH] x86/mpx: Correctly report do_mpx_bt_fault() failures to user-space

2017-04-06 Thread Joerg Roedel
From: Joerg Roedel When this function fails it just sends a SIGSEGV signal to user-space using force_sig(). This signal is missing essential information about the cause, e.g. the trap_nr or an error code. Fix this by propagating the error to the only caller of mpx_handle_bd_fault(),