[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: Julien Grall <julien@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 7 Jul 2021 15:25:55 +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=oAFFDxJ3LX2tGCe1hgD1zbWpu5jizhMYV8tALOBvuyY=; b=SxaCqcqfLYINgftwLKr/mDIo2uBFtQYTiqM/4N+6pg6WzRuBuJBLdfKa3P49jPWC+1JgK5HtsgVZ4ZFJC/DsDXWKj35fD5mkJdzb5PW1i0h8lmeXZQe/l2kg98toqquUPqzJn8fv73W3t9pGvpARNTFKAAj9Mq0x6Bw2eYVq0tgCOyuDb1iE4HK9yEUCze8ewvQ1QAkfax+ePfz663wnGAllAoqbKvLqZMFawn5KU456W5NXGZ1NoXQTnUAXkljZe2Wya/kd3S4OzkjboR1t/Mv+gue5Vh+66EFObhbC5W5izo0+7kAZtZVAm/3li1k/TnVUIIm0nMLC1N8U5Z/dWQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h/6B57mHukHM47llD2razUf+zD8nQfF+spaehtudMuEit6eTM6vD/KrMacT9fhQpbV9CS4frs+iNlgWj/kWxzCHzIyzBkQbueQAsbJL5arQ1bl2QXcQLAi0lpxn3oXu/Xd9ZNYjYzfVw9j5Fwu636Mc8vrHfZQaZz18avxHao3KVINYrFQUFbIRV/J3iGq0wvKX2jcUTTX+lCdWN71qgOI1dwbb4qqCa91ylepRU4NAYkjqQqPXsf1DBOMKm8nAa49J6eyIA+QABocaJevjP+xkhYQ7CjbJlefg3f1MNyENBxg5nO3bPSu9e50/gZ2dKJiT3Sx1YPeP57wV3G9NT7Q==
  • Authentication-results: citrix.com; dkim=none (message not signed) header.d=none;citrix.com; dmarc=none action=none header.from=suse.com;
  • Cc: iwj@xxxxxxxxxxxxxx, wl@xxxxxxx, andrew.cooper3@xxxxxxxxxx, george.dunlap@xxxxxxxxxx, sstabellini@xxxxxxxxxx, jgross@xxxxxxxx, christian.lindig@xxxxxxxxxx, dave@xxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, Igor Druzhinin <igor.druzhinin@xxxxxxxxxx>
  • Delivery-date: Wed, 07 Jul 2021 13:26:10 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 07.07.2021 15:21, Julien Grall wrote:
> On 07/07/2021 14:14, Jan Beulich wrote:
>> On 07.07.2021 14:59, Julien Grall wrote:
>>> The alternative suggestion is to keep a unsigned type but check the bit
>>> 31 is not set.
>>
>> Why? Why not bit 30 or bit 27? There's nothing special about
>> bit 31 in an unsigned number.
> 
> Bit 31 is the signed bit for signed number. The check would make sure that:
>   1) The value will fit other hypercall (the PIRQ is described as int in 
> a few of the structure)
>   2) Catch potentially caller that would use the number that could 
> potentially be interpreted as negative by other part of the hypervisor.

And getting refused equally as out of range. Plain int uses will
want replacing imo, but perhaps we don't have room to do so in the
public interface (outside of the tools-only part of it at least).

> That said, I can live with the implicit signed -> unsigned convertion, 
> however the commit message should at least be clarified because it is 
> misleading.

You'll have to work this out with Igor. I can't see anything that's
misleading.

Jan




 


Rackspace

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