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

Re: [PATCH 5/5] libxc: make xc_domain_maximum_gpfn() endianness-agnostic


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Fri, 18 Jun 2021 16:22:30 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mwPVoAeXftCSkffDPD5M//2M5vcxyR7OAnF18VnIdPU=; b=n53NsvaoM8Ht6A8Cc9U+4NQ0oKW/JxEdWKQauPBrCQRqDuKnzJFz9r7+3k/dGFKRWId/jN08fABFeSygnLscEWGGuUMWXdZpFNXUU317icr8XdlLL5yzMIgVGNsOr2Ci6YPP7XQ6G5U7yU/1TjvRIidZrNXurwZ7tDMVjySV0FLyAuAvDbJErwUv6zAWvTht8lY4Miw82HNlRCvWN6aRXBLUwJCwqv+iE7XObvF4JmCV3QksyHM6Gi+GTiWK/8v40wiY+BgiU7GSZQedneKun3bYgX9qlWneConULzzhrOTKnennBjs0GOZ0OZaaFBgyj6Bls9B5oP5Qt9u6rv4/ew==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B8MUVguJGEuKcqDUm0cxq5jEaD7vblilR1t3jH7qo1LYRZIQKv4LlA6VzIbt+duZ7/w6u8LZxpA2ObYJGTuT9dc4Y3kNUtJV06CKk9ot5zG/WNWin36Vs3xk7hEZKINrpUuPByspHxrAVefovvjKVcoV8AhOAfnc21/47Qu2x1fo0yebCqsmEf6eRHWnLc2+hbaUufw6CUMM03snYAF6kOtTHUXV0s54eI8TOo7zV5hyv0ZX3ZssBa9QkR/mW/pXHbY8hAsTezfj5Mc4Th44BT48OebZIOSYjZ+kroPIe+rFjtEN39aV8y9G9z8EKuWbd1e2Dd7K86l0U32iiimxmQ==
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Wei Liu <wl@xxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Fri, 18 Jun 2021 15:22:48 +0000
  • Ironport-hdrordr: A9a23:876Reasa/iZAxT1AE5bD0Jeb7skCm4Mji2hC6mlwRA09TyXGra 6TdaUguiMc1gx8ZJhBo7C90KnpewK7yXcH2/huAV7EZniYhILIFvAf0WKG+Vzd8kLFh5VgPM tbAsxD4ZjLfCVHZKXBkXuF+rQbsaG6GcmT7I+0pRodLnAJGtVdBkVCe3+m+yVNNXp77PECZf +hD6R81l2dkDgsH76G7i5vZZmymzSHruOoXTc2QzocrCWehzKh77D3VzCewxclSjtKhZMv63 LMnQDV7riq96jT8G6c60bjq7Bt3PfxwNpKA8KBzuATNzXXkw6tIKBsQaeLsjwZqPymrHwqjN 7PiRE9ONkb0QKeQkiF5T/WnyXw2jcn7HHvjXWCh2H4nMD/TDUmT+JcmINwaHLimggdleA59J gO83OStpJRAx+Ftj/6/cL0WxZjkVfxiWY+kNQUk2dUXeIlGfxsRLQkjQdo+ao7bWXHANhNKp gpMCic3ocXTbqiVQGdgoE1q+bcB0jad3y9Mz0/Us/86UkdoJk29TpB+CUlpAZ3yHsKcegO2w 31CNUeqFhwdL5eUUtcPpZNfSLlMB2AffrzWFjiaWgPQ5t3Sk4l7aSHu4kI2A==
  • Ironport-sdr: rnjsZHzgBt0AhxagX259s57lBhI8pxs9qXIi2ANNXwCbGd4k1ULHf0ZM6GMK1yuFm7ML1rD0wr pNyEW8yHWSp0rztKHbHOdyccDnYPEzscjywiXHEvZcV8zdbd9NK0SdQeTfHfJa5IbgAqtTT08e RMItxKxKI+zsP2lvKbTRJcrirlU60rLg0J2coUctQcDVZLmKJJlOTbdJD+14qSscMtVY3oD0XY tCv+ygIeuir48Zqz+2S2kNKfpMRGCdJyAC605tKQMgYxRqVNniE7dkwAJAOxBhjXHsZ3B6FvNH K9o=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 18/06/2021 16:06, Andrew Cooper wrote:
> On 18/06/2021 11:25, Jan Beulich wrote:
>> libxc generally uses uint32_t to represent domain IDs. This is fine as
>> long as addresses of such variables aren't taken, to then pass into
>> hypercalls: To the hypervisor, a domain ID is a 16-bit value. Use an
>> intermediate variable to deal with the issue. (On architectures with
>> arguments passed in registers, such an intermediate variable would have
>> been created by the compiler already anyway, just one of the wrong
>> type.)
>>
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>>
>> --- a/tools/libs/ctrl/xc_domain.c
>> +++ b/tools/libs/ctrl/xc_domain.c
>> @@ -856,7 +856,9 @@ int xc_domain_get_tsc_info(xc_interface
>>  
>>  int xc_domain_maximum_gpfn(xc_interface *xch, uint32_t domid, xen_pfn_t 
>> *gpfns)
>>  {
>> -    long rc = do_memory_op(xch, XENMEM_maximum_gpfn, &domid, sizeof(domid));
>> +    domid_t xen_domid = domid;
>> +    long rc = do_memory_op(xch, XENMEM_maximum_gpfn, &xen_domid,
>> +                           sizeof(xen_domid));
> Why on earth do we pass the domid in by pointer and not value?

This is horrible.

What we're logically doing is passing a  pointer to struct
xen_memory_$FOO { domid_t domid; }, except its all done by void
pointers, and even the public header files don't provide a suitable
structure.

I think we really do want to retrofit a suitable structure in the public
interface and use that, rather than to continue games like this.

~Andrew



 


Rackspace

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