Re: [RFC PATCH for 4.21 06/16] cpu_opv: Provide cpu_opv system call (v8)

2018-10-17 Thread Mathieu Desnoyers
- On Oct 17, 2018, at 11:11 AM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > - On Oct 17, 2018, at 3:19 AM, Srikar Dronamraju sri...@linux.vnet.ibm.com > wrote: > >> Hi Mathieu, >> >>> +static int do_cpu_opv(struct cpu_op *cpuop, int cpuopcnt, >>> + struct

Re: [RFC PATCH for 4.21 06/16] cpu_opv: Provide cpu_opv system call (v8)

2018-10-17 Thread Mathieu Desnoyers
- On Oct 17, 2018, at 11:11 AM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > - On Oct 17, 2018, at 3:19 AM, Srikar Dronamraju sri...@linux.vnet.ibm.com > wrote: > >> Hi Mathieu, >> >>> +static int do_cpu_opv(struct cpu_op *cpuop, int cpuopcnt, >>> + struct

Re: [RFC PATCH for 4.21 06/16] cpu_opv: Provide cpu_opv system call (v8)

2018-10-17 Thread Mathieu Desnoyers
- On Oct 17, 2018, at 3:19 AM, Srikar Dronamraju sri...@linux.vnet.ibm.com wrote: > Hi Mathieu, > >> +static int do_cpu_opv(struct cpu_op *cpuop, int cpuopcnt, >> + struct cpu_opv_vaddr *vaddr_ptrs, int cpu) >> +{ >> +struct mm_struct *mm = current->mm; >> +int ret;

Re: [RFC PATCH for 4.21 06/16] cpu_opv: Provide cpu_opv system call (v8)

2018-10-17 Thread Mathieu Desnoyers
- On Oct 17, 2018, at 3:19 AM, Srikar Dronamraju sri...@linux.vnet.ibm.com wrote: > Hi Mathieu, > >> +static int do_cpu_opv(struct cpu_op *cpuop, int cpuopcnt, >> + struct cpu_opv_vaddr *vaddr_ptrs, int cpu) >> +{ >> +struct mm_struct *mm = current->mm; >> +int ret;

Re: [RFC PATCH for 4.21 06/16] cpu_opv: Provide cpu_opv system call (v8)

2018-10-17 Thread Srikar Dronamraju
Hi Mathieu, > +static int do_cpu_opv(struct cpu_op *cpuop, int cpuopcnt, > + struct cpu_opv_vaddr *vaddr_ptrs, int cpu) > +{ > + struct mm_struct *mm = current->mm; > + int ret; > + > +retry: > + if (cpu != raw_smp_processor_id()) { > + ret =

Re: [RFC PATCH for 4.21 06/16] cpu_opv: Provide cpu_opv system call (v8)

2018-10-17 Thread Srikar Dronamraju
Hi Mathieu, > +static int do_cpu_opv(struct cpu_op *cpuop, int cpuopcnt, > + struct cpu_opv_vaddr *vaddr_ptrs, int cpu) > +{ > + struct mm_struct *mm = current->mm; > + int ret; > + > +retry: > + if (cpu != raw_smp_processor_id()) { > + ret =

Re: [RFC PATCH for 4.21 06/16] cpu_opv: Provide cpu_opv system call (v8)

2018-10-16 Thread Sergey Senozhatsky
Hi Mathieu, On (10/16/18 15:17), Mathieu Desnoyers wrote: > > Therefore, only an internal kernel bug between vm_map_user_ram() and > vm_unmap_user_ram() should trigger the BUG_ON(). No user input is passed > to vm_unmap_user_ram(). > > Now, let's look at vm_map_user_ram(). It calls

Re: [RFC PATCH for 4.21 06/16] cpu_opv: Provide cpu_opv system call (v8)

2018-10-16 Thread Sergey Senozhatsky
Hi Mathieu, On (10/16/18 15:17), Mathieu Desnoyers wrote: > > Therefore, only an internal kernel bug between vm_map_user_ram() and > vm_unmap_user_ram() should trigger the BUG_ON(). No user input is passed > to vm_unmap_user_ram(). > > Now, let's look at vm_map_user_ram(). It calls

Re: [RFC PATCH for 4.21 06/16] cpu_opv: Provide cpu_opv system call (v8)

2018-10-16 Thread Mathieu Desnoyers
- On Oct 16, 2018, at 4:10 AM, Sergey Senozhatsky sergey.senozhatsky.w...@gmail.com wrote: > Hi Mathieu, > > On (10/10/18 15:19), Mathieu Desnoyers wrote: > [..] >> +SYSCALL_DEFINE4(cpu_opv, struct cpu_op __user *, ucpuopv, int, cpuopcnt, >> +int, cpu, int, flags) >> +{ > [..]

Re: [RFC PATCH for 4.21 06/16] cpu_opv: Provide cpu_opv system call (v8)

2018-10-16 Thread Mathieu Desnoyers
- On Oct 16, 2018, at 4:10 AM, Sergey Senozhatsky sergey.senozhatsky.w...@gmail.com wrote: > Hi Mathieu, > > On (10/10/18 15:19), Mathieu Desnoyers wrote: > [..] >> +SYSCALL_DEFINE4(cpu_opv, struct cpu_op __user *, ucpuopv, int, cpuopcnt, >> +int, cpu, int, flags) >> +{ > [..]

Re: [RFC PATCH for 4.21 06/16] cpu_opv: Provide cpu_opv system call (v8)

2018-10-16 Thread Sergey Senozhatsky
Hi Mathieu, On (10/10/18 15:19), Mathieu Desnoyers wrote: [..] > +SYSCALL_DEFINE4(cpu_opv, struct cpu_op __user *, ucpuopv, int, cpuopcnt, > + int, cpu, int, flags) > +{ [..] > +again: > + ret = cpu_opv_pin_pages(cpuopv, cpuopcnt, _ptrs); > + if (ret) > + goto end;

Re: [RFC PATCH for 4.21 06/16] cpu_opv: Provide cpu_opv system call (v8)

2018-10-16 Thread Sergey Senozhatsky
Hi Mathieu, On (10/10/18 15:19), Mathieu Desnoyers wrote: [..] > +SYSCALL_DEFINE4(cpu_opv, struct cpu_op __user *, ucpuopv, int, cpuopcnt, > + int, cpu, int, flags) > +{ [..] > +again: > + ret = cpu_opv_pin_pages(cpuopv, cpuopcnt, _ptrs); > + if (ret) > + goto end;