[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v02 1/7] arm: introduce remoteprocessor iommu module



Hi Julien,

Could you please clarify:

>
> >> +    /* pagetable size can be more than one page */
> >> +    for ( i = 0; i < MMU_PGD_TABLE_SIZE(mmu) / PAGE_SIZE; i++ )
> >> +    {
> >> +        /* lookup address where remoteproc pagetable is stored by kernel
> >> */
> >> +        maddr = p2m_lookup(current->domain, pgt->paddr + i * PAGE_SIZE,
> >> NULL);
> >> +        if ( !maddr )
> >> +        {
> >> +            pr_mmu("failed to translate 0x%08lx to maddr", pgt->paddr + i
> >> * PAGE_SIZE);
> >> +            return -EINVAL;
> >> +        }
> >> +
> >> +        pagetable = ioremap_nocache(maddr, MMU_PGD_TABLE_SIZE(mmu));
> >
> >
> > ioremap_* should only be used to map device memory. For the guest memory you
> > have to use copy_from_guest helper.
> >
>
> OK. Just a small question - if I use copy_from_guest(), can I copy
> from physical pointer ?  Here I have an address, which points to exact
> physical memory.
>

I'm not sure that this works in my case. I see that copy_from_user /
copy_to_user deals with  domain virtual addresses and it is widely
used in hypercalls. Here I need to copy from a pointer to physical
memory - iow from intermediate physical address. Can I use this macro
in this case? Maybe copy_from_user / copy_to_user can be slightly
modified to work with IPAs ?

Regards,
Andrii

>
> --
>
> Andrii Tseglytskyi | Embedded Dev
> GlobalLogic
> www.globallogic.com




-- 

Andrii Tseglytskyi | Embedded Dev
GlobalLogic
www.globallogic.com

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.