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

Re: [PATCH] tools/libxc: use uint32_t for pirq in xc_domain_irq_permission


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • From: Igor Druzhinin <igor.druzhinin@xxxxxxxxxx>
  • Date: Thu, 8 Jul 2021 02:30:50 +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=awJ/myImDWdcz2ZkP3fKf7BwQDQfG4vKXrF1quNLI1A=; b=Ajy8Kb5pCgn/42v7+isiKt58UlZL8zIOfTRph1FEy6szRQA7ETRy5tvgFNmx4VeyOAYxwpjxx3EhvJPc5aH5HSaHPKFe8oBXM3KzW59KDDnnDtyL/s4SIll5wJgRvPPqIvDePaOZHaD4Z02wV0ApKojrSokvqAy4j2XO/3hPpktokr39D/IB04k6qu4ByhzOuqrgGiEtGB/Ye44ej5y/KfkLkNUtFao2Ef56LmSt0fgEP1X4H3H2gVRkf9+1PYnBaMyfwzDKRZF8EophSpnLWJjJnKlPXtHaS1X0bqQB9UUA9X6sXFQTiVEWFunNK+KDYt4hnLwtTQF20wS9F+9anA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=liTwTlWM3+6s6liiTq1lBxytjgdWupmxySGL9HZotL8X9BaLyJ7FcnVxALWJb6avyeStR+WwA3jKK3JIrKAbTu7619T/cMdNgU1QGIhFmBKghFZmwtI3wbfnL925PrVCB/KCNMYRYvrl3b1Yc7BH92Rn08uq4Msn2Vt19g814L8hXjGNgTO2jn9IYb3jb8Fm4Vsqrsejww4uFe7Hho2W7iRjSOX8c6frTsMIL6gW334q/D9krHz/8af5747M77CIHM/lOdsRubdiL6GdVap80+QEHro26prX8wbIxVRQg5IySR4CsLA9SBkZiSmE/HKF6oDviDyDxS5A/7+IjeBBOg==
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: <iwj@xxxxxxxxxxxxxx>, <wl@xxxxxxx>, <george.dunlap@xxxxxxxxxx>, <julien@xxxxxxx>, <sstabellini@xxxxxxxxxx>, <jgross@xxxxxxxx>, <christian.lindig@xxxxxxxxxx>, <dave@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 08 Jul 2021 01:31:03 +0000
  • Ironport-hdrordr: A9a23:rTunlazK53HUsT9BjkopKrPxwOskLtp133Aq2lEZdPULSKOlfp GV8MjziyWYtN9wYhAdcdDpAtjlfZquz+8I3WB3B8bcYOCGghrUEGgG1+XfKlLbalXDH4JmpM Fdmu1FeafN5DtB/LbHCWuDYq8dKbC8mcjC74eurAYecegpUdAG0+4QMHfrLqQcfnglOXNWLu v42iMKnUvaRZxBBf7LeEXtEtKz6+HjpdbDW1orFhQn4A6BgXeB76P7KQGR2lM7XylUybkv3G DZm0ihj5/T/c2T+1v57Sv+/p5WkNzuxp9qA9GNsNEcLnHJhhyzbIpsdrWetHQeof2p6nwtjN 7Qyi1QcPhb2jf0RCWYsBHt0w7v3HIF8Hn502KVhnPlvIjQWC86I9Apv/MbTjLpr24b+P1s2q NC2GyU87BNCwnboSj779/UEzl3i0uPp2Y4m+J7tQ0ebWInUs4VkWUjxjIQLH9ZdxiKr7zPUd MeTf003cwmM29zNBvizy9SKLXGZAVBIv+EKnJy8fB9nQImxUyQYiMjtboid0w7heYAoq9/lq z525RT5cRzp/AtHNVA7cc6MIGK4z/2MF/x2Fz7GyWvKEhAAQOUl6LK
  • Ironport-sdr: d5HWfhS3+FDUdLulU8wMjQ9G8h9LpopIiZ4ogCxJhnySlpCO1nOkkgAP6VmCyPuaCZDZ+ONrgL zmhlL8zYFkLYbJp0IWHrE5Rdp92O043nI0UCW7kLaiUptZxHksos/SWUAMsvKcOpHbS9T3Vl6T cW+RxXmE4P1TqOa6m+0TBIO3xsg41GEcLpk9AaniCK9YVVhh3kLb0swIoieAY+4l8DW5dgA2Hp mTIzgf+qw86yD7DZ7Ztwiz6J/kxtWaK3w4LL7sseKUU1p2e0wpwYv9WGjWffreqcxAv7wnvxzc u5I=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 08/07/2021 02:26, Andrew Cooper wrote:
On 08/07/2021 02:14, Igor Druzhinin wrote:
On 08/07/2021 02:11, Andrew Cooper wrote:
On 08/07/2021 02:08, Igor Druzhinin wrote:
On 07/07/2021 10:19, Andrew Cooper wrote:
On 07/07/2021 08:46, Jan Beulich wrote:
--- a/tools/include/xenctrl.h
+++ b/tools/include/xenctrl.h
@@ -1385,7 +1385,7 @@ int xc_domain_ioport_permission(xc_interface
*xch,
      int xc_domain_irq_permission(xc_interface *xch,
                                 uint32_t domid,
-                             uint8_t pirq,
+                             uint32_t pirq,
                                 uint8_t allow_access);
Take the opportunity and also change "allow_access" to bool? Or is
use of bool prohibited in external interfaces?

We've got bool's in the interface already.

Where exactly? I couldn't find a single "bool".

$ git grep -w bool -- :/tools/include/xen*.h
../tools/include/xenctrl.h:1844:                          uint32_t
domid, bool restore,
../tools/include/xenctrl.h:1846:                          unsigned int
nr_features, bool pae, bool itsc,
../tools/include/xenctrl.h:1847:                          bool
nested_virt, const struct xc_xend_cpuid *xend);
../tools/include/xenctrl.h:1954:int
xc_altp2m_get_domain_state(xc_interface *handle, uint32_t dom, bool
*state);
../tools/include/xenctrl.h:1955:int
xc_altp2m_set_domain_state(xc_interface *handle, uint32_t dom, bool
state);

and loads more.

Are we ok to have different types in ABI interface and in libxc
function prototype then?

Yes.  Again, we've got plenty of examples like this.

Because I was referring to ABI structures.

The hypercall structs can't contain bool.  bool has implementation
defined width in C, just like enum, and there is no requirement for
sizeof(bool) to be 1.

The pre-existing uint8_t here is correct, although the hypercall handler
ideally wants a further adjustment to reject non-boolean values.  This
hypercall clearly predates our more careful review practices...

Sure. Get what you want now. I'm just not a fan of type conversions
for the sake of it - prefer a common type to be used pervasively.
But, of course, happy to follow Xen practises.

Igor



 


Rackspace

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