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

Re: [Xen-devel] [PATCH 11/20] xen/domctl: Merge set_gnttab_limits into createdomain



On 19/03/2018 21:43, Christian Lindig wrote:
>
>> On 19. Mar 2018, at 19:13, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
>>
>> +    max_grant_frames: int32;
>> +    max_maptrack_frames: int32;
> As part of:
>
>> +type domctl_create_config =
>> +{
>> +       ssidref: int32;
>> +       handle: string;
>> +       flags: domain_create_flag list;
>> +       max_vcpus: int32;
>> +       max_evtchn_port: int32;
>> +       max_grant_frames: int32;
>> +       max_maptrack_frames: int32;
>> +       arch: arch_domainconfig;
>> +}
> This is a minor point: in OCaml, values of type int32 and int64 are 
> represented as pointers to a memory block containing the value. This is 
> unlike an int, which is represented simply as part of a memory block that 
> represents the record value. Because OCaml uses one bit as a tag, the range 
> of int and int32 (on a 32-bit system) is different. Most of the time the 
> range is large enough and people use int rather than int32 or int64 for that 
> reason. I would expect that an int is large enough, especially on a 64-bit 
> system. However, if int32 makes it easier to align this with the C code, this 
> is fine, especially because there are not many values of omctl_create_config 
> to be expected.

I'm aware of of in32/64 being properly tagged objects, and did consider
whether they were the sensible value to use here.  I sided with the
ssidref type for simplicity.

That said, while ssidref might plausibly need a full 32 bits of range
(and even then, I'm not entirely sure, but it is an opaque handle at the
end of the day), none of the max_* fields do.  vcpus is currently capped
at 128, grant frames at 64, maptrack frames at 1024 (both configurable
on the Xen command line).  evtchn_port is effectively capped at the ABI
limit which is 1024/4096 or 2^27 depending on the guests setup.

I'll swap all the max_* fields to being a plain int.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.