[PATCH v4 3/9] powerpc/vas: Add VAS user space API

Haren Myneni haren at linux.ibm.com
Wed Mar 25 14:48:23 AEDT 2020


On Tue, 2020-03-24 at 14:41 +1100, Michael Ellerman wrote:
> Daniel Axtens <dja at axtens.net> writes:
> > Michael Ellerman <mpe at ellerman.id.au> writes:
> >> Daniel Axtens <dja at axtens.net> writes:
> >>> Haren Myneni <haren at linux.ibm.com> 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




More information about the Linuxppc-dev mailing list