On Tue, 2020-03-24 at 14:41 +1100, Michael Ellerman wrote: > Daniel Axtens <dja@xxxxxxxxxx> writes: > > Michael Ellerman <mpe@xxxxxxxxxxxxxx> writes: > >> Daniel Axtens <dja@xxxxxxxxxx> writes: > >>> Haren Myneni <haren@xxxxxxxxxxxxx> writes: > >>>> diff --git a/arch/powerpc/platforms/powernv/vas-api.c b/arch/powerpc/platforms/powernv/vas-api.c > >>>> new file mode 100644 > >>>> index 0000000..7d049af > >>>> --- /dev/null > >>>> +++ b/arch/powerpc/platforms/powernv/vas-api.c > >>>> @@ -0,0 +1,257 @@ > >> ... > >>>> + > >>>> +static int coproc_mmap(struct file *fp, struct vm_area_struct *vma) > >>>> +{ > >>>> + struct vas_window *txwin = fp->private_data; > >>>> + unsigned long pfn; > >>>> + u64 paste_addr; > >>>> + pgprot_t prot; > >>>> + int rc; > >>>> + > >>>> + if ((vma->vm_end - vma->vm_start) > PAGE_SIZE) { > >>> > >>> I think you said this should be 4096 rather than 64k, regardless of what > >>> PAGE_SIZE you are compiled with? > >> > >> You can't mmap less than a page, a page is PAGE_SIZE bytes. > >> > >> So if that checked for 4K explicitly it would prevent mmap on 64K > >> kernels always, which seems like not what you want? > > > > Ah. My bad. Carry on then :) > > Well you were just quoting something from Haren, so I think it's over to > him. Sorry my mistake. I should change in documentation. vas_win_paste_addr() always returns 1 page. Restriction should be PAGE_SIZE. > > cheers