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

Re: [Xen-devel] [PATCH v5 4/4] xen: introduce XENMEM_exchange_and_pin and XENMEM_unpin



On Tue, 10 Sep 2013, Jan Beulich wrote:
> > +    unsigned long i;
> > +    struct xen_unpin unpin;
> > +    xen_pfn_t gpfn;
> > +    struct domain *d;
> > +
> > +    if ( copy_from_guest(&unpin, arg, 1) )
> > +        return -EFAULT;
> > +
> > +    /* Various sanity checks. */
> > +    if ( /* Extent orders are sensible? */
> > +         (unpin.in.extent_order > MAX_ORDER) ||
> > +         /* Sizes of input list do not overflow a long? */
> > +         ((~0UL >> unpin.in.extent_order) < unpin.in.nr_extents) )
> > +        return -EFAULT;
> > +
> > +    if ( !guest_handle_okay(unpin.in.extent_start, unpin.in.nr_extents) )
> > +        return -EFAULT;
> > +
> > +    d = rcu_lock_domain_by_any_id(unpin.in.domid);
> > +    if ( d == NULL )
> > +    {
> > +        rc = -ESRCH;
> > +        goto fail;
> > +    }
> > +
> > +    for ( i = 0; i < unpin.in.nr_extents; i++ )
> > +    {
> > +        if ( unlikely(__copy_from_guest_offset(
> > +                      &gpfn, unpin.in.extent_start, i, 1)) )
> > +        {
> > +            rc = -EFAULT;
> > +            goto partial;
> > +        }
> > +
> 
> Want/need to make sure gpfn is suitable aligned for the passed in
> extent order? Depends on whether guest_physmap_unpin_range()
> is expected to always cope with a mis-aligned one.

I think it should be able to cope with non order aligned requests.

_______________________________________________
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®.