Re: [PATCH v3 2/4] x86, mpx: hook #BR exception handler to allocate bound tables

2014-01-27 Thread Ren Qiaowei
On 01/28/2014 02:42 PM, Andy Lutomirski wrote: I just read it. do_trap_no_signal presumably calls fixup_exception because #UD uses it and #UD needs that handling. (I'm guessing that there is actually a legitimate use for a kernel fixup on #UD somewhere -- there's probably something that isn't

Re: [PATCH v3 2/4] x86, mpx: hook #BR exception handler to allocate bound tables

2014-01-27 Thread Andy Lutomirski
On Mon, Jan 27, 2014 at 9:39 PM, Ren Qiaowei wrote: > On 01/28/2014 01:21 PM, Andy Lutomirski wrote: >> >> On Mon, Jan 27, 2014 at 7:35 PM, Ren Qiaowei >> wrote: >>> >>> On 01/28/2014 04:36 AM, Andy Lutomirski wrote: > > > + bd_entry = status & MPX_BNDSTA_ADDR_MASK; > +

Re: [PATCH v3 2/4] x86, mpx: hook #BR exception handler to allocate bound tables

2014-01-27 Thread Ren Qiaowei
On 01/28/2014 01:21 PM, Andy Lutomirski wrote: On Mon, Jan 27, 2014 at 7:35 PM, Ren Qiaowei wrote: On 01/28/2014 04:36 AM, Andy Lutomirski wrote: + bd_entry = status & MPX_BNDSTA_ADDR_MASK; + if ((bd_entry >= bd_base) && (bd_entry < bd_base + bd_size)) +

Re: [PATCH v3 2/4] x86, mpx: hook #BR exception handler to allocate bound tables

2014-01-27 Thread Andy Lutomirski
On Mon, Jan 27, 2014 at 7:35 PM, Ren Qiaowei wrote: > On 01/28/2014 04:36 AM, Andy Lutomirski wrote: >>> >>> + bd_entry = status & MPX_BNDSTA_ADDR_MASK; >>> + if ((bd_entry >= bd_base) && (bd_entry < bd_base + bd_size)) >>> + allocate_bt(bd_entry); >> >> >> What happens

Re: [PATCH v3 2/4] x86, mpx: hook #BR exception handler to allocate bound tables

2014-01-27 Thread Ren Qiaowei
On 01/28/2014 04:36 AM, Andy Lutomirski wrote: + bd_entry = status & MPX_BNDSTA_ADDR_MASK; + if ((bd_entry >= bd_base) && (bd_entry < bd_base + bd_size)) + allocate_bt(bd_entry); What happens if this fails? Retrying forever isn't very nice. If allocation of the

Re: [PATCH v3 2/4] x86, mpx: hook #BR exception handler to allocate bound tables

2014-01-27 Thread Andy Lutomirski
On 01/26/2014 01:08 AM, Qiaowei Ren wrote: > An access to an invalid bound directory entry will cause a #BR > exception. This patch hook #BR exception handler to allocate > one bound table and bind it with that buond directory entry. > > This will avoid the need of forwarding the #BR exception >

Re: [PATCH v3 2/4] x86, mpx: hook #BR exception handler to allocate bound tables

2014-01-27 Thread Andy Lutomirski
On 01/26/2014 01:08 AM, Qiaowei Ren wrote: An access to an invalid bound directory entry will cause a #BR exception. This patch hook #BR exception handler to allocate one bound table and bind it with that buond directory entry. This will avoid the need of forwarding the #BR exception to the

Re: [PATCH v3 2/4] x86, mpx: hook #BR exception handler to allocate bound tables

2014-01-27 Thread Ren Qiaowei
On 01/28/2014 04:36 AM, Andy Lutomirski wrote: + bd_entry = status MPX_BNDSTA_ADDR_MASK; + if ((bd_entry = bd_base) (bd_entry bd_base + bd_size)) + allocate_bt(bd_entry); What happens if this fails? Retrying forever isn't very nice. If allocation of the bound

Re: [PATCH v3 2/4] x86, mpx: hook #BR exception handler to allocate bound tables

2014-01-27 Thread Andy Lutomirski
On Mon, Jan 27, 2014 at 7:35 PM, Ren Qiaowei qiaowei@intel.com wrote: On 01/28/2014 04:36 AM, Andy Lutomirski wrote: + bd_entry = status MPX_BNDSTA_ADDR_MASK; + if ((bd_entry = bd_base) (bd_entry bd_base + bd_size)) + allocate_bt(bd_entry); What happens if

Re: [PATCH v3 2/4] x86, mpx: hook #BR exception handler to allocate bound tables

2014-01-27 Thread Ren Qiaowei
On 01/28/2014 01:21 PM, Andy Lutomirski wrote: On Mon, Jan 27, 2014 at 7:35 PM, Ren Qiaowei qiaowei@intel.com wrote: On 01/28/2014 04:36 AM, Andy Lutomirski wrote: + bd_entry = status MPX_BNDSTA_ADDR_MASK; + if ((bd_entry = bd_base) (bd_entry bd_base + bd_size)) +

Re: [PATCH v3 2/4] x86, mpx: hook #BR exception handler to allocate bound tables

2014-01-27 Thread Andy Lutomirski
On Mon, Jan 27, 2014 at 9:39 PM, Ren Qiaowei qiaowei@intel.com wrote: On 01/28/2014 01:21 PM, Andy Lutomirski wrote: On Mon, Jan 27, 2014 at 7:35 PM, Ren Qiaowei qiaowei@intel.com wrote: On 01/28/2014 04:36 AM, Andy Lutomirski wrote: + bd_entry = status

Re: [PATCH v3 2/4] x86, mpx: hook #BR exception handler to allocate bound tables

2014-01-27 Thread Ren Qiaowei
On 01/28/2014 02:42 PM, Andy Lutomirski wrote: I just read it. do_trap_no_signal presumably calls fixup_exception because #UD uses it and #UD needs that handling. (I'm guessing that there is actually a legitimate use for a kernel fixup on #UD somewhere -- there's probably something that isn't

[PATCH v3 2/4] x86, mpx: hook #BR exception handler to allocate bound tables

2014-01-25 Thread Qiaowei Ren
An access to an invalid bound directory entry will cause a #BR exception. This patch hook #BR exception handler to allocate one bound table and bind it with that buond directory entry. This will avoid the need of forwarding the #BR exception to the user space when bound directory has invalid

[PATCH v3 2/4] x86, mpx: hook #BR exception handler to allocate bound tables

2014-01-25 Thread Qiaowei Ren
An access to an invalid bound directory entry will cause a #BR exception. This patch hook #BR exception handler to allocate one bound table and bind it with that buond directory entry. This will avoid the need of forwarding the #BR exception to the user space when bound directory has invalid