[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:06:28 +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=e5sO1dSzaUua+udKhamhVhm6K1msGtIfc37nbI2hxgk=; b=QKJWD05+9H6GMKi4kjUXlDT5tze3u0BJJJwIoLcRMr0We/sTm4wgv0YANMKWhWcqE76voPcO4FZ7I+w1gWDkgxupTW4CNf+PRLVAK3g3IEXYjgwl3u5iXunVg64X5U99FYahJYb84ipBBlf9OSOiIbw2GF1i6rc7WufM5UKfr22ZXxSgi4sufxEcxBx0R1M0x46Pfi0Zxf++B3bBQRArAWULx6IA+cpUZ5WLuxRFwW3chqKtOJ3lOWZKtPShK+CCrhZD/rmqDqrMaCa9DjfYWPpaTOOk9vQUXrB6Oi7nnRWpNXPl5k7W2PXeWnxwN7qvvvA2wh5RuJamMrhV1EwI4w==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AqEfkzenuIE1ZxJLrt5PR55ESqCdHKjq15YY/gYa91oKATdRBOiBVyBFrlqIzr5/JeJsI4Q3Y2rrrUG4aw7CQI6X+nMphQf8cTQDi4OQ7rTfSdMmMk59bqpcFT84lGVEH/XwMFCZzWPmREDum5XopanzRqjxMi+DHONS3NV57i+fGNamZlaCk/1quaczLi+JWoetmcQtuWCtiLhOmvTB1UPHGxHp8h3kgfFqLuiUZzCP0z6hI2y9NwUPpCJpNCJidOXRDK4fquB0aLWV/mkMCIQLu5YhfUn/zKSy/232LxRFn2XpVqwV3VbiehvesDxVsQsomcUdPCq+70QSwF3LBQ==
- Authentication-results: esa4.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:06:49 +0000
- Ironport-hdrordr: A9a23:k9gk1qvFXntY024ySoyz2Cv/7skDgNV00zEX/kB9WHVpm6yj+v xGUs566faUskd2ZJhEo7q90ca7Lk80maQa3WBVB8bBYOCEghrOEGgB1/qA/9SIIUSXmtK1l5 0QFpSWYOeaMbEQt7ef3ODXKbcdKNnsytHWuQ/dpU0dMz2DvctbnnZE4gXwKDwHeOFfb6BJba Z1fqB81kedkXJ8VLXCOlA1G9Ltivfsj5zcbRsPF3ccmXWzZWPB0s+AL/CAtC1uKQ9y/Q==
- Ironport-sdr: Ccv9kBffNnDsJTR4D4BIIbBG+3WoJjiqEeQciv9WRkiQdo25v8A+H1dvnSxfnyDFD9q9rGyLhk dT7a0+JRu+KUhIKdSYVo75QDX02+iOKj9dv+OQ6VfwLe85MZ0CIm89wdemka4uRqASfcmQLJDF AyZv80CAX6btDYvlK2nFagxHGpfiPIgHSgqv0vAYcV1I2y6hzQcr/fS+co5T23Vh/TnuGuy1GG nhc5e4gt4P6HwUcLxOSPpBnbMfA4YPN4u1USsv8vWQ/1OTLAIJDqc2a2s5FH06L51CRQghCMEX tPc=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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?
~Andrew
|