Re: [PATCH v1 01/13] mshv: add SEV-SNP UAPI definitions
[email protected] Fri, 07 Aug 2026 14:03:24 +0000
| Newsgroups | org.kernel.vger.linux-hyperv |
|---|---|
| Message-ID | <[email protected]> |
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] The newly added UAPI structure `struct mshv_complete_isolated_import` embeds `union hv_partition_complete_isolated_import_data` directly by value. However, this union is defined in `include/hyperv/hvhdk_mini.h`, which is a kernel-internal header and not exported to userspace. Because userspace headers cannot access this internal definition, the union evaluates to an undeclared, incomplete type. Any userspace application including `<linux/mshv.h>` will now fail to compile with a hard compiler error, completely breaking the UAPI. -- --- Patch [1]: [PATCH v1 01/13] mshv: add SEV-SNP UAPI definitions --- commit 0c72e15c0e7fd5f724d97fa58e436ee572659cfa Author: Wei Liu <[email protected]> mshv: add SEV-SNP UAPI definitions This adds the MSHV UAPI and Hyper-V ABI definitions needed by the SEV-SNP partition ioctls. It includes structures for SNP isolation type, GPA host-access, isolated-page requests, and SEV control register definitions. > diff --git a/include/uapi/linux/mshv.h b/include/uapi/linux/mshv.h > index 32ff92b6342b2..4e7f3038f0c67 100644 > --- a/include/uapi/linux/mshv.h > +++ b/include/uapi/linux/mshv.h [ ... ] > @@ -219,6 +220,55 @@ struct mshv_gpap_access_bitmap { [ ... ] > +struct mshv_complete_isolated_import { > + union hv_partition_complete_isolated_import_data import_data; > +}; [Severity: High] Will this cause a compilation failure for userspace applications including <linux/mshv.h>? It appears union hv_partition_complete_isolated_import_data is defined in include/hyperv/hvhdk_mini.h, which is a kernel-internal header and not exported to userspace. Because userspace headers cannot access this internal definition, embedding the union directly by value here will evaluate to an undeclared, incomplete type for any userspace application trying to use the UAPI. [ ... ] > @@ -254,6 +304,11 @@ struct mshv_root_hvcall { [ ... ] > +#define MSHV_COMPLETE_ISOLATED_IMPORT _IOW(MSHV_IOCTL, 0xF4, struct mshv_complete_isolated_import) [Severity: High] Does this ioctl macro expansion also fail in userspace for the same reason? The _IOW macro implicitly requires the size of the incomplete type during expansion, which will also break compilation when the underlying struct relies on the kernel-internal union. -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=1