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

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


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 18 Jun 2021 12:25:42 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=sxI3txB9v2hvNDBVrrSYN+2xPMzrpPdCoOLA7Q3nSfU=; b=CGG/seglcFKuM2fBoPNImN3t/XAqA4xyKzNxMtIu4DdQZkOh9Pf5veiEkXUMxWzq7+w1kPr7ZCirnU3/ut7ELrBAxZpRItxYhXqVI8rM7p35YsvmbAGDmPmatlEXqxkHj4vFnZ4pezzPR92OQLVG1dF8eFBJNV20vv9U0h28nVg0XEj0ky0won8/0cWDQuFBR0DefwfQyr8zuKNMODPJPBlzwdiS+fj0Qz1W1pdh4rxXS8jtzST0EhPo9tFpKUz6tcd/UW43sikfByCGVZomrlckMe1knr7P1Eca6VohEfGvEJJ6W6n4XoqLnEqqvuigwZSqajUNi/nK3xC+opN3gQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fhkRG7zbee8Kj75ldtu1o6tukLGmW2++sTFaFKwApk/5w5Xf7I68+rigAhnFKA5EBShX6NbgnscVZPav150H5iUTo+Gj9M+YuOCdqO6reOg07M9ZZHa2HlDlakHM6vIix6LS7sj9IZw4FobmO1LZ8PKk8eVAp79XXQt2ataMMEYV2zhiROkJLTtH31OnACTimPbfE2zbC1ZOxczGyARa60OIAPQeMv6xIoDjvorNwDIzWmCf7racapKGADqarOw0Ma37Ayn/qq7Y5/9kv/grKLQsiTQiHFMXYSSn3scSOytV1TG/KCaWZAsFM1qBTjfc5DkFvawiaKqvmYFylvYX/g==
  • Authentication-results: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=suse.com;
  • Cc: Wei Liu <wl@xxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Fri, 18 Jun 2021 10:25:52 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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));
 
     if ( rc >= 0 )
     {




 


Rackspace

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