On 28.08.2023 23:52, Stefano Stabellini wrote:
> On Mon, 28 Aug 2023, Jan Beulich wrote:
>> On 26.08.2023 00:21, Stefano Stabellini wrote:
>>> Coming to unsigned int, it should be 32-bit on all supported arches,
>>
>> But this isn't a requirement, even if we're using "unsigned int" in the
>> C declarations / definitions: If "unsigned int" was wider, all we'd
>> demand is that hypercall entry code (likely written in assembly anyway)
>> zero-extend incoming values suitably to fit whatever "unsigned int" is.
>> Which is no different to Andrew (aiui) suggesting to use "unsigned
>> long" instead: That'll too require suitable zero-extension up front.
> 
> What you wrote assumes that "unsigned int" can only be 32-bit or wider,
> such as 64-bit. However, I think that by the C standard there is no
> guarantee. For instance, it could be smaller, e.g. 16-bit.

Of course, but in Xen (just like e.g. Linux does) we inherently assume
sizeof(int) >= 4.

Jan

Reply via email to