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

Re: [Xen-devel] Xen hypercall API/ABI problems



>>> On 25.06.13 at 15:10, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
> On 20/06/13 10:01, Jan Beulich wrote:
>>>>> On 19.06.13 at 17:43, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
>>> In memory.c, there is a possible unsigned->signed conversion error from
>>> max_pages to rc.
>> That's of no concern as long as the maximum possible value can't
>> result in the value being negative. Plus it's problematic only when
>> the hypervisor is 32-bit (as otherwise it's a conversion from
>> "unsigned int" to "signed long".
>>
>> And for the list of items to be complete - there's a similar conversion
>> for d->tot_pages.
> 
> In this case, 64bit domain on 64bit Xen is fine.  This hypercall is ok
> as it really shouldn't be returning more than ((~0ULL)>>PAGE_SHIFT)
> 
> I guess the question boils down this:
> 
> Is it ok to retroactively apply -error semantics to hypercalls which
> were previously defined to never return an error?  Already for the
> compat layer a wrong value is being returned. All we would be doing is
> changing from INT_MAX to -ERANGE which is differently wrong but more
> consistent.

I think it is okay if the change is, like here, from a de facto random
value (due to having got truncated) to a predictable error indicator.
The capping to INT_MAX was trying to do almost the same (with
the goal of not converting a success return to an error one).

Jan


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