From: Anthony PERARD <anthony.perard@vates.tech>
To: Jiqian Chen <Jiqian.Chen@amd.com>
Cc: xen-devel@lists.xenproject.org, "Jan Beulich" <jbeulich@suse.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>,
"George Dunlap" <gwd@xenproject.org>,
"Julien Grall" <julien@xen.org>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Juergen Gross" <jgross@suse.com>,
"Daniel P . Smith" <dpsmith@apertussolutions.com>,
"Stewart Hildebrand" <Stewart.Hildebrand@amd.com>,
"Huang Rui" <ray.huang@amd.com>
Subject: Re: [RFC XEN PATCH v14 4/5] tools: Add new function to get gsi from dev
Date: Tue, 03 Sep 2024 15:51:56 +0000 [thread overview]
Message-ID: <ZtcwmSqeryBVjmlh@l14> (raw)
In-Reply-To: <20240903070424.982218-5-Jiqian.Chen@amd.com>
On Tue, Sep 03, 2024 at 03:04:23PM +0800, Jiqian Chen wrote:
> diff --git a/tools/include/xen-sys/Linux/privcmd.h b/tools/include/xen-sys/Linux/privcmd.h
> index bc60e8fd55eb..607dfa2287bc 100644
> --- a/tools/include/xen-sys/Linux/privcmd.h
> +++ b/tools/include/xen-sys/Linux/privcmd.h
> @@ -95,6 +95,11 @@ typedef struct privcmd_mmap_resource {
> __u64 addr;
> } privcmd_mmap_resource_t;
>
> +typedef struct privcmd_pcidev_get_gsi {
> + __u32 sbdf;
> + __u32 gsi;
> +} privcmd_pcidev_get_gsi_t;
> diff --git a/tools/libs/ctrl/xc_linux.c b/tools/libs/ctrl/xc_linux.c
> index c67c71c08be3..92591e49a1c8 100644
> --- a/tools/libs/ctrl/xc_linux.c
> +++ b/tools/libs/ctrl/xc_linux.c
> @@ -66,6 +66,26 @@ void *xc_memalign(xc_interface *xch, size_t alignment, size_t size)
> return ptr;
> }
>
> +int xc_pcidev_get_gsi(xc_interface *xch, uint32_t sbdf)
> +{
> + int ret;
> + privcmd_pcidev_get_gsi_t dev_gsi = {
> + .sbdf = sbdf,
> + .gsi = 0,
> + };
> +
> + ret = ioctl(xencall_fd(xch->xcall),
> + IOCTL_PRIVCMD_PCIDEV_GET_GSI, &dev_gsi);
> +
> + if (ret < 0) {
> + PERROR("Failed to get gsi from dev");
> + } else {
> + ret = dev_gsi.gsi;
I've just notice that this is mixing signed and unsigned int.
We are storing a "__u32" into an "int" here. This isn't great as we are
throwing way lots of potentially good value. (Even if I have no idea if
they are possible.)
Cheers,
--
Anthony Perard | Vates XCP-ng Developer
XCP-ng & Xen Orchestra - Vates solutions
web: https://vates.tech
next prev parent reply other threads:[~2024-09-03 15:52 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-03 7:04 [XEN PATCH v14 0/5] Support device passthrough when dom0 is PVH on Xen Jiqian Chen
2024-09-03 7:04 ` [XEN PATCH v14 1/5] xen/pci: Add hypercall to support reset of pcidev Jiqian Chen
2024-09-09 9:34 ` Roger Pau Monné
2024-09-03 7:04 ` [XEN PATCH v14 2/5] x86/pvh: Allow (un)map_pirq when dom0 is PVH Jiqian Chen
2024-09-03 7:42 ` Jan Beulich
2024-09-03 7:58 ` Chen, Jiqian
2024-09-03 9:25 ` Jan Beulich
2024-09-03 10:53 ` Chen, Jiqian
2024-09-03 14:14 ` Jan Beulich
2024-09-04 1:43 ` Stefano Stabellini
2024-09-04 6:04 ` Jan Beulich
2024-09-05 6:45 ` Chen, Jiqian
2024-09-05 9:44 ` Jan Beulich
2024-09-05 22:51 ` Stefano Stabellini
2024-09-06 6:26 ` Jan Beulich
2024-09-06 23:34 ` Stefano Stabellini
2024-09-09 8:56 ` Jan Beulich
2024-09-09 10:04 ` Roger Pau Monné
2024-09-09 10:22 ` Jan Beulich
2024-09-09 10:35 ` Chen, Jiqian
2024-09-03 7:04 ` [XEN PATCH v14 3/5] x86/domctl: Add hypercall to set the access of x86 gsi Jiqian Chen
2024-09-09 9:15 ` Roger Pau Monné
2024-09-09 10:30 ` Chen, Jiqian
2024-09-03 7:04 ` [RFC XEN PATCH v14 4/5] tools: Add new function to get gsi from dev Jiqian Chen
2024-09-03 14:12 ` Anthony PERARD
2024-09-03 15:51 ` Anthony PERARD [this message]
2024-09-03 15:57 ` Jan Beulich
2024-09-03 7:04 ` [RFC XEN PATCH v14 5/5] tools: Add new function to do PIRQ (un)map on PVH dom0 Jiqian Chen
2024-09-03 17:16 ` Anthony PERARD
2024-09-04 9:31 ` Chen, Jiqian
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=ZtcwmSqeryBVjmlh@l14 \
--to=anthony.perard@vates.tech \
--cc=Jiqian.Chen@amd.com \
--cc=Stewart.Hildebrand@amd.com \
--cc=andrew.cooper3@citrix.com \
--cc=dpsmith@apertussolutions.com \
--cc=gwd@xenproject.org \
--cc=jbeulich@suse.com \
--cc=jgross@suse.com \
--cc=julien@xen.org \
--cc=ray.huang@amd.com \
--cc=roger.pau@citrix.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.