[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v2 09/11] xen/memory: Fix mapping grant tables with XENMEM_acquire_resource
On 11/01/2021 20:05, Andrew Cooper wrote: >>> --- a/xen/common/memory.c >>> +++ b/xen/common/memory.c >>> @@ -1027,17 +1027,31 @@ static unsigned int resource_max_frames(struct >>> domain *d, >>> } >>> } >>> >>> +/* >>> + * Returns -errno on error, or positive in the range [1, nr_frames] on >>> + * success. Returning less than nr_frames contitutes a request for a >>> + * continuation. >>> + */ >>> +static int _acquire_resource( >>> + struct domain *d, unsigned int type, unsigned int id, unsigned long >>> frame, >>> + unsigned int nr_frames, xen_pfn_t mfn_list[]) >> As per the comment the return type may again want to be "long" here. >> Albeit I realize the restriction to (UINT_MAX >> MEMOP_EXTENT_SHIFT) >> makes this (and the other place above) only a latent issue for now, >> so it may well be fine to be left as is. > Hmm yes - it should be long, because per the ABI we still should be able > to return 0xffffffff to a caller in the success case. > > I'll update. Actually, no. Wrong half the hypercall. For _acquire_resource(), the return value is bound by nr_frames which is a maximum of 32, and is unlikely to grow substantially from this. ~Andrew
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |