|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] Re: [PATCH 09/11] xen: introduce gnttab_map_refs and gnttab_
On Wed, 5 Jan 2011, Konrad Rzeszutek Wilk wrote:
> > +
> > + ret = HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, map_ops, count);
> > +
> > + for (i = 0; i < count; i++) {
> > + pfn = mfn_to_pfn(map_ops[i].host_addr >> PAGE_SHIFT);
>
> Shouldn't you be checking the flag to see if this a bus address? You could
> also use the PFN_DOWN macro here..
Yes, actually I should be checking for GNTMAP_contains_pte.
> > + pte = (pte_t *) __va((pfn << PAGE_SHIFT) +
> > + (map_ops[i].host_addr & ~PAGE_MASK));
>
> PFN_PHYS(pfn)? Or better You could use the mfn_to_virt macro here:
>
> pte = (pte_t *) mfn_to_virt(PFN_DOWN(map_ops[i].ost_addr));
> pte += (map_ops[i].host_addr & _PAGE_MASK);
>
Good suggestion, I have applied it (plus a small change to the pointer
arithmetic).
> > + val = *pte;
> > + mfn = (native_pte_val(val) & PTE_PFN_MASK) >> PAGE_SHIFT;
>
> mfn = pte_mfn(pte) ?
>
yep, done that.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|