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

Re: [Xen-devel] libxl/xenconsole: vpl011: Fix hex to dec conversion of vuart_gfn in libxl__device_vuart_add



>>> On 16.10.17 at 17:47, <bhupinder.thakur@xxxxxxxxxx> wrote:
> On 16 October 2017 at 15:53, Jan Beulich <JBeulich@xxxxxxxx> wrote:
>>>>> On 16.10.17 at 11:02, <bhupinder.thakur@xxxxxxxxxx> wrote:
>>>  static int console_create_ring(struct console *con)
>>>  {
>>> -     int err, remote_port, ring_ref, rc;
>>> +     int err, remote_port, rc;
>>> +     xen_pfn_t ring_ref;
>>>       char *type, path[PATH_MAX];
>>>       struct domain *dom = con->d;
>>>
>>>       err = xs_gather(xs, con->xspath,
>>> -                     "ring-ref", "%u", &ring_ref,
>>> +                     "ring-ref", "%i", &ring_ref,
>>
>> How would you gather a 64-bit value using %i without any length
>> modifier? With just %i you're even going to use partially initialized
>> data, so unless somewhere else the upper 32 bits got clipped off
>> again the console wouldn't work anymore.
>>
> I should use "%lli" here to read it as a 64-bit value for all
> architectures. Correct?

No, that's break for a 32-bit tool stack on x86. You really need
an abstraction similar to PRIu_xen_pfn, just that I'd rather not
see SCNi_xen_pfn added to the public headers.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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