xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Julien Grall <julien@xen.org>
Cc: iwj@xenproject.org, wl@xen.org, andrew.cooper3@citrix.com,
	george.dunlap@citrix.com, sstabellini@kernel.org,
	jgross@suse.com, christian.lindig@citrix.com, dave@recoil.org,
	xen-devel@lists.xenproject.org,
	Igor Druzhinin <igor.druzhinin@citrix.com>
Subject: Re: [PATCH] tools/libxc: use uint32_t for pirq in xc_domain_irq_permission
Date: Wed, 7 Jul 2021 15:25:55 +0200	[thread overview]
Message-ID: <15e22f1d-33b8-84a0-5074-4f3aa62ef548@suse.com> (raw)
In-Reply-To: <54b5ff4b-09ae-429b-4468-c1b4691079ed@xen.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



  reply	other threads:[~2021-07-07 13:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-07  1:02 [PATCH] tools/libxc: use uint32_t for pirq in xc_domain_irq_permission Igor Druzhinin
2021-07-07  7:46 ` Jan Beulich
2021-07-07  9:19   ` Andrew Cooper
2021-07-08  1:08     ` Igor Druzhinin
2021-07-08  1:11       ` Andrew Cooper
2021-07-08  1:14         ` Igor Druzhinin
2021-07-08  1:26           ` Andrew Cooper
2021-07-08  1:30             ` Igor Druzhinin
2021-07-07  8:48 ` Christian Lindig
2021-07-07 12:51 ` Julien Grall
2021-07-07 12:54   ` Jan Beulich
2021-07-07 12:59     ` Julien Grall
2021-07-07 13:14       ` Jan Beulich
2021-07-07 13:21         ` Julien Grall
2021-07-07 13:25           ` Jan Beulich [this message]
2021-07-08  2:06           ` Igor Druzhinin
2021-07-12  8:59             ` Julien Grall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15e22f1d-33b8-84a0-5074-4f3aa62ef548@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=christian.lindig@citrix.com \
    --cc=dave@recoil.org \
    --cc=george.dunlap@citrix.com \
    --cc=igor.druzhinin@citrix.com \
    --cc=iwj@xenproject.org \
    --cc=jgross@suse.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).