Re: [PATCH V3 1/2] xen: Update dm_op.h from Xen public header

From: Jan Beulich
Date: Tue Jul 25 2023 - 03:20:46 EST


On 25.07.2023 09:09, Viresh Kumar wrote:
> On 25-07-23, 09:04, Jan Beulich wrote:
>> On 25.07.2023 08:47, Viresh Kumar wrote:
>>> +struct xen_dm_op {
>>> + uint32_t op;
>>> + uint32_t pad;
>>> + union {
>>> + struct xen_dm_op_create_ioreq_server create_ioreq_server;
>>> + struct xen_dm_op_get_ioreq_server_info get_ioreq_server_info;
>>> + struct xen_dm_op_ioreq_server_range map_io_range_to_ioreq_server;
>>> + struct xen_dm_op_ioreq_server_range unmap_io_range_from_ioreq_server;
>>> + struct xen_dm_op_set_ioreq_server_state set_ioreq_server_state;
>>> + struct xen_dm_op_destroy_ioreq_server destroy_ioreq_server;
>>> + struct xen_dm_op_track_dirty_vram track_dirty_vram;
>>> + struct xen_dm_op_set_pci_intx_level set_pci_intx_level;
>>> + struct xen_dm_op_set_isa_irq_level set_isa_irq_level;
>>> + struct xen_dm_op_set_irq_level set_irq_level;
>>> + struct xen_dm_op_set_pci_link_route set_pci_link_route;
>>> + struct xen_dm_op_modified_memory modified_memory;
>>> + struct xen_dm_op_set_mem_type set_mem_type;
>>> + struct xen_dm_op_inject_event inject_event;
>>> + struct xen_dm_op_inject_msi inject_msi;
>>> + struct xen_dm_op_map_mem_type_to_ioreq_server map_mem_type_to_ioreq_server;
>>> + struct xen_dm_op_remote_shutdown remote_shutdown;
>>> + struct xen_dm_op_relocate_memory relocate_memory;
>>> + struct xen_dm_op_pin_memory_cacheattr pin_memory_cacheattr;
>>> + struct xen_dm_op_nr_vcpus nr_vcpus;
>>> + } u;
>>> +};
>>
>> Is sync-ing for the sake of sync-ing really useful? For example, are any
>> of the ioreq server elements halfway likely to ever be used in the kernel?
>
> The only field, out of the union, I am using for now is:
>
> struct xen_dm_op_set_irq_level set_irq_level;
>
> I am not sure if some of the others are going to be used or not in the
> future.

I question that use, btw, but it is not up to me to decide whether to
accept such a layering violation in Linux. dm-op is, as its name says,
for device models to use. Your intended use doesn't fall in that
category, aiui. Imo the present contents of dm_op.h in Linux is indeed
all a kernel is supposed to know about, unless it was to gain in-kernel
device models.

Jan