All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien@xen.org>
To: Jan Beulich <jbeulich@suse.com>
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 13:59:24 +0100	[thread overview]
Message-ID: <927c1c59-734a-4013-9286-137fd7026c26@xen.org> (raw)
In-Reply-To: <5e454ba6-3d3f-9402-140d-f576f9124402@suse.com>



On 07/07/2021 13:54, Jan Beulich wrote:
> On 07.07.2021 14:51, Julien Grall wrote:
>> On 07/07/2021 02:02, Igor Druzhinin wrote:
>>> Current unit8_t for pirq argument in this interface is too restrictive
>>> causing failures on modern hardware with lots of GSIs. That extends down to
>>> XEN_DOMCTL_irq_permission ABI structure where it needs to be fixed up
>>> as well. Internal Xen structures appear to be fine. Existing users of
>>> the interface in tree (libxl, ocaml and python bindings) are already using
>>> int for pirq representation that should be wide enough.
>>
>> By "int", I am assuming you imply "signed int", is that correct?
>>
>> If so, should the function xc_domain_irq_permission() interface take an
>> int in parameter and check it is not negative?
> 
> Please let's not make things worse than they are, the more that

Well, what I am trying to prevent is surprise where the caller 
mistakenly pass a negative value that will be interpreted as a positive 
value...

Such issues are beyong annoying to debug...

 > ./CODING_STYLE is unambiguous in cases like this one.

Hmmm... The coding style mention the fixed size but nothing about the 
signedness of the type...

The alternative suggestion is to keep a unsigned type but check the bit 
31 is not set.

Cheers,

-- 
Julien Grall


  reply	other threads:[~2021-07-07 12:59 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 [this message]
2021-07-07 13:14       ` Jan Beulich
2021-07-07 13:21         ` Julien Grall
2021-07-07 13:25           ` Jan Beulich
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=927c1c59-734a-4013-9286-137fd7026c26@xen.org \
    --to=julien@xen.org \
    --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=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.