[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aW_-9KO2DrVvmvSs@skinsburskii.localdomain>
Date: Tue, 20 Jan 2026 14:17:24 -0800
From: Stanislav Kinsburskii <skinsburskii@...ux.microsoft.com>
To: Mukesh R <mrathor@...ux.microsoft.com>
Cc: linux-kernel@...r.kernel.org, linux-hyperv@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, iommu@...ts.linux.dev,
linux-pci@...r.kernel.org, linux-arch@...r.kernel.org,
kys@...rosoft.com, haiyangz@...rosoft.com, wei.liu@...nel.org,
decui@...rosoft.com, longli@...rosoft.com, catalin.marinas@....com,
will@...nel.org, tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
dave.hansen@...ux.intel.com, hpa@...or.com, joro@...tes.org,
lpieralisi@...nel.org, kwilczynski@...nel.org, mani@...nel.org,
robh@...nel.org, bhelgaas@...gle.com, arnd@...db.de,
nunodasneves@...ux.microsoft.com, mhklinux@...look.com,
romank@...ux.microsoft.com
Subject: Re: [PATCH v0 09/15] mshv: Import data structs around device domains
and irq remapping
On Mon, Jan 19, 2026 at 10:42:24PM -0800, Mukesh R wrote:
> From: Mukesh Rathor <mrathor@...ux.microsoft.com>
>
> Import/copy from Hyper-V public headers, definitions and declarations that
> are related to attaching and detaching of device domains and interrupt
> remapping, and building device ids for those purposes.
>
> Signed-off-by: Mukesh Rathor <mrathor@...ux.microsoft.com>
> ---
> include/hyperv/hvgdk_mini.h | 11 ++++
> include/hyperv/hvhdk_mini.h | 112 ++++++++++++++++++++++++++++++++++++
> 2 files changed, 123 insertions(+)
>
<snip>
> +/* ID for stage 2 default domain and NULL domain */
> +#define HV_DEVICE_DOMAIN_ID_S2_DEFAULT 0
> +#define HV_DEVICE_DOMAIN_ID_S2_NULL 0xFFFFFFFFULL
> +
> +union hv_device_domain_id {
> + u64 as_uint64;
> + struct {
> + u32 type : 4;
> + u32 reserved : 28;
> + u32 id;
> + };
> +} __packed;
Shouldn't the inner struct be packed instead?
> +
> +struct hv_input_device_domain { /* HV_INPUT_DEVICE_DOMAIN */
> + u64 partition_id;
> + union hv_input_vtl owner_vtl;
> + u8 padding[7];
> + union hv_device_domain_id domain_id;
> +} __packed;
> +
> +union hv_create_device_domain_flags { /* HV_CREATE_DEVICE_DOMAIN_FLAGS */
> + u32 as_uint32;
> + struct {
> + u32 forward_progress_required : 1;
> + u32 inherit_owning_vtl : 1;
> + u32 reserved : 30;
> + } __packed;
> +} __packed;
Why should the union be packed?
Thanks,
Stanislav
> +
> +struct hv_input_create_device_domain { /* HV_INPUT_CREATE_DEVICE_DOMAIN */
> + struct hv_input_device_domain device_domain;
> + union hv_create_device_domain_flags create_device_domain_flags;
> +} __packed;
> +
> +struct hv_input_delete_device_domain { /* HV_INPUT_DELETE_DEVICE_DOMAIN */
> + struct hv_input_device_domain device_domain;
> +} __packed;
> +
> +struct hv_input_attach_device_domain { /* HV_INPUT_ATTACH_DEVICE_DOMAIN */
> + struct hv_input_device_domain device_domain;
> + union hv_device_id device_id;
> +} __packed;
> +
> +struct hv_input_detach_device_domain { /* HV_INPUT_DETACH_DEVICE_DOMAIN */
> + u64 partition_id;
> + union hv_device_id device_id;
> +} __packed;
> +
> +struct hv_input_map_device_gpa_pages { /* HV_INPUT_MAP_DEVICE_GPA_PAGES */
> + struct hv_input_device_domain device_domain;
> + union hv_input_vtl target_vtl;
> + u8 padding[3];
> + u32 map_flags;
> + u64 target_device_va_base;
> + u64 gpa_page_list[];
> +} __packed;
> +
> +struct hv_input_unmap_device_gpa_pages { /* HV_INPUT_UNMAP_DEVICE_GPA_PAGES */
> + struct hv_input_device_domain device_domain;
> + u64 target_device_va_base;
> +} __packed;
> +
> #endif /* _HV_HVHDK_MINI_H */
> --
> 2.51.2.vfs.0.1
>
Powered by blists - more mailing lists