Re: [PATCH v8 04/10] x86, mpx: hook #BR exception handler to allocate bound tables

2014-09-24 Thread Dave Hansen
On 09/11/2014 01:46 AM, Qiaowei Ren wrote: > +/* > + * When a BNDSTX instruction attempts to save bounds to a BD entry > + * with the lack of the valid bit being set, a #BR is generated. > + * This is an indication that no BT exists for this entry. In this > + * case the fault handler will

Re: [PATCH v8 04/10] x86, mpx: hook #BR exception handler to allocate bound tables

2014-09-24 Thread Dave Hansen
On 09/11/2014 01:46 AM, Qiaowei Ren wrote: +/* + * When a BNDSTX instruction attempts to save bounds to a BD entry + * with the lack of the valid bit being set, a #BR is generated. + * This is an indication that no BT exists for this entry. In this + * case the fault handler will allocate a

RE: [PATCH v8 04/10] x86, mpx: hook #BR exception handler to allocate bound tables

2014-09-13 Thread Ren, Qiaowei
On 2014-09-13, Hansen, Dave wrote: > On 09/11/2014 01:46 AM, Qiaowei Ren wrote: >> +static int allocate_bt(long __user *bd_entry) { >> +unsigned long bt_addr, old_val = 0; >> +int ret = 0; >> + >> +bt_addr = mpx_mmap(MPX_BT_SIZE_BYTES); >> +if (IS_ERR((void *)bt_addr)) >> +

RE: [PATCH v8 04/10] x86, mpx: hook #BR exception handler to allocate bound tables

2014-09-13 Thread Ren, Qiaowei
On 2014-09-13, Hansen, Dave wrote: On 09/11/2014 01:46 AM, Qiaowei Ren wrote: +static int allocate_bt(long __user *bd_entry) { +unsigned long bt_addr, old_val = 0; +int ret = 0; + +bt_addr = mpx_mmap(MPX_BT_SIZE_BYTES); +if (IS_ERR((void *)bt_addr)) +return

Re: [PATCH v8 04/10] x86, mpx: hook #BR exception handler to allocate bound tables

2014-09-12 Thread Dave Hansen
On 09/11/2014 01:46 AM, Qiaowei Ren wrote: > +static int allocate_bt(long __user *bd_entry) > +{ > + unsigned long bt_addr, old_val = 0; > + int ret = 0; > + > + bt_addr = mpx_mmap(MPX_BT_SIZE_BYTES); > + if (IS_ERR((void *)bt_addr)) > + return bt_addr; > + bt_addr

Re: [PATCH v8 04/10] x86, mpx: hook #BR exception handler to allocate bound tables

2014-09-12 Thread Dave Hansen
On 09/11/2014 01:46 AM, Qiaowei Ren wrote: +static int allocate_bt(long __user *bd_entry) +{ + unsigned long bt_addr, old_val = 0; + int ret = 0; + + bt_addr = mpx_mmap(MPX_BT_SIZE_BYTES); + if (IS_ERR((void *)bt_addr)) + return bt_addr; + bt_addr =