lkml.org 
[lkml]   [2011]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 09/11] xen: introduce gnttab_map_refs and gnttab_unmap_refs
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.



\
 
 \ /
  Last update: 2011-01-10 11:33    [W:0.060 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site