From: Jan Beulich <jbeulich@suse.com>
To: Teddy Astie <teddy.astie@vates.tech>,
Julian Vetter <julian.vetter@vates.tech>
Cc: "Anthony PERARD" <anthony.perard@vates.tech>,
"Juergen Gross" <jgross@suse.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Michal Orzel" <michal.orzel@amd.com>,
"Julien Grall" <julien@xen.org>,
"Roger Pau Monné" <roger@xenproject.org>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Bertrand Marquis" <bertrand.marquis@arm.com>,
"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v4 7/9] x86/dmop: Add XEN_DMOP_{bind,unbind}_pt_msi_irq DM ops
Date: Wed, 19 Aug 2026 14:21:49 +0200 [thread overview]
Message-ID: <d4ef5689-4197-499e-97e4-642a6b3bc6b9@suse.com> (raw)
In-Reply-To: <1777392179.8631fc262581453bbf619ec5b2062170.19dd4d45724000f373@vates.tech>
On 28.04.2026 18:02, Teddy Astie wrote:
> Le 27/04/2026 à 15:57, Julian Vetter a écrit :
>> Add two DM ops for MSI passthrough IRQs. These new DM ops take the raw
>> MSI address and data fields rather than pre-decoded gflags values. Xen
>> decodes the destination ID via msi_addr_to_gflags(), including any
>> extended destination bits in address[11:5]. This means the device model
>> does not need to understand the extended destination ID encoding, and
>> simply forwards the MSI address it observes from the guest.
>>
>> With these DM ops in place, redirect xc_domain_update_msi_irq() and
>> xc_domain_unbind_msi_irq() in libxenctrl to use
>> xendevicemodel_bind_pt_msi_irq() / xendevicemodel_unbind_pt_msi_irq()
>> via xch->dmod. The gflags/gvec arguments are translated to the raw MSI
>> address and data words at the libxc level using the standard x86 MSI
>> address format.
>>
>> Reject the PT_IRQ_TYPE_MSI sub-case in XEN_DOMCTL_bind_pt_irq and
>> XEN_DOMCTL_unbind_pt_irq: all callers now go through the DM op path, so
>> the domctl sub-case is fully obsolete.
>
> We probably want to reflect that on XEN_DOMCTL_{un}bind_pt_irq interface
> in domctl.h (e.g through a note saying that PT_IRQ_TYPE_MSI type is now
> deprecated and unsupported).
Which may further want mentioning in ./CHANGELOG.md.
>> --- a/tools/libs/devicemodel/core.c
>> +++ b/tools/libs/devicemodel/core.c
>> @@ -645,6 +645,44 @@ int xendevicemodel_nr_vcpus(
>> return 0;
>> }
>>
>> +int xendevicemodel_bind_pt_msi_irq(
>> + xendevicemodel_handle *dmod, domid_t domid, uint32_t machine_irq,
>> + uint64_t msi_addr, uint32_t msi_data, uint64_t gtable, int unmasked)
>> +{
>> + struct xen_dm_op op;
>> + struct xen_dm_op_bind_pt_msi_irq *data;
>> +
>> + memset(&op, 0, sizeof(op));
>> +
>> + op.op = XEN_DMOP_bind_pt_msi_irq;
>> + data = &op.u.bind_pt_msi_irq;
>> +
>> + data->machine_irq = machine_irq;
>> + data->data = msi_data;
>> + data->addr = msi_addr;
>> + data->gtable = gtable;
>> + if ( unmasked )
>> + data->flags |= XEN_DMOP_MSI_FLAG_UNMASKED;
>> +
>> + return xendevicemodel_op(dmod, domid, 1, &op, sizeof(op));
>> +}
>> +
>> +int xendevicemodel_unbind_pt_msi_irq(
>> + xendevicemodel_handle *dmod, domid_t domid, uint32_t machine_irq)
>> +{
>> + struct xen_dm_op op;
>> + struct xen_dm_op_unbind_pt_msi_irq *data;
>> +
>> + memset(&op, 0, sizeof(op));
>> +
>> + op.op = XEN_DMOP_unbind_pt_msi_irq;
>> + data = &op.u.unbind_pt_msi_irq;
>> +
>> + data->machine_irq = machine_irq;
>> +
>> + return xendevicemodel_op(dmod, domid, 1, &op, sizeof(op));
>> +}
>> +
>
> I think we want to mark
> xc_domain_update_msi_irq/xc_domain_unbind_msi_irq as deprecated since we
> implemented a newer (better) version of it in xendevicemodel; and the
> old one is now a wrapper.
Why mark it deprecated? It can be removed right away when there are no callers
left. libxc doesn't offer a stable API.
Jan
next prev parent reply other threads:[~2026-08-19 12:22 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260427135406.1281424-1-julian.vetter@vates.tech>
2026-04-27 13:53 ` [PATCH v4 1/9] x86/vioapic: Add ioapic_check() to validate IO-APIC state before restore Julian Vetter
2026-04-28 12:06 ` Teddy Astie
2026-06-25 14:46 ` Jan Beulich
2026-04-27 13:53 ` [PATCH v4 2/9] x86/passthrough: Wrap pt_irq_create_bind() restart block in braces Julian Vetter
2026-04-28 12:40 ` Teddy Astie
2026-06-25 15:56 ` Jan Beulich
2026-04-27 13:54 ` [PATCH v4 3/9] x86/passthrough: Extract pt_irq_dpci_setup() from pt_irq_create_bind() Julian Vetter
2026-04-28 12:53 ` Teddy Astie
2026-08-18 14:45 ` Jan Beulich
2026-04-27 13:54 ` [PATCH v4 4/9] x86/passthrough: Extract PT_IRQ_TYPE_MSI body into pt_irq_bind_msi() Julian Vetter
2026-04-28 14:01 ` Teddy Astie
2026-08-18 15:10 ` Jan Beulich
2026-04-27 13:54 ` [PATCH v4 5/9] x86/passthrough: Introduce pt_irq_bind_msi() as canonical MSI bind path Julian Vetter
2026-04-28 15:15 ` Teddy Astie
2026-06-25 15:58 ` Jan Beulich
2026-08-18 16:05 ` Jan Beulich
2026-04-27 13:54 ` [PATCH v4 6/9] x86/hvm: Support extended destination IDs in virtual MSI and IO-APIC Julian Vetter
2026-04-28 15:27 ` Teddy Astie
2026-08-19 12:14 ` Jan Beulich
2026-04-27 13:54 ` [PATCH v4 7/9] x86/dmop: Add XEN_DMOP_{bind,unbind}_pt_msi_irq DM ops Julian Vetter
2026-04-28 16:02 ` Teddy Astie
2026-08-19 12:21 ` Jan Beulich [this message]
2026-08-19 13:37 ` Jan Beulich
2026-04-27 13:54 ` [PATCH v4 8/9] hvm/ioreq: Negotiate extended destination ID support per ioreq server Julian Vetter
2026-04-28 16:35 ` Teddy Astie
2026-05-04 13:35 ` Jan Beulich
2026-08-19 14:38 ` Jan Beulich
2026-04-27 13:54 ` [PATCH v4 9/9] x86/cpuid: Advertise XEN_HVM_CPUID_EXT_DEST_ID when device model opts in Julian Vetter
2026-08-19 15:01 ` Jan Beulich
2026-06-02 12:08 ` [PATCH v4 0/9] x86/hvm: Add Extended MSI destination ID support Julian Vetter
2026-06-02 12:21 ` Jan Beulich
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=d4ef5689-4197-499e-97e4-642a6b3bc6b9@suse.com \
--to=jbeulich@suse.com \
--cc=Volodymyr_Babchuk@epam.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=bertrand.marquis@arm.com \
--cc=jgross@suse.com \
--cc=julian.vetter@vates.tech \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger@xenproject.org \
--cc=sstabellini@kernel.org \
--cc=teddy.astie@vates.tech \
--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.