Re: [PATCH v4 7/9] x86/dmop: Add XEN_DMOP_{bind,unbind}_pt_msi_irq DM ops

Jan Beulich <[email protected]>
Newsgroups org.xenproject.lists.xen-devel
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.