mshv: Add nested virtualization creation flag
authorMuminul Islam <muislam@microsoft.com>
Wed, 18 Feb 2026 14:47:59 +0000 (14:47 +0000)
committerWei Liu <wei.liu@kernel.org>
Wed, 18 Feb 2026 23:53:22 +0000 (23:53 +0000)
Introduce HV_PARTITION_CREATION_FLAG_NESTED_VIRTUALIZATION_CAPABLE to
indicate support for nested virtualization during partition creation.

This enables clearer configuration and capability checks for nested
virtualization scenarios.

Signed-off-by: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Signed-off-by: Muminul Islam <muislam@microsoft.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
drivers/hv/mshv_root_main.c
include/hyperv/hvhdk.h
include/uapi/linux/mshv.h

index e5d9439..e490f8e 100644 (file)
@@ -1947,6 +1947,8 @@ static long mshv_ioctl_process_pt_flags(void __user *user_arg, u64 *pt_flags,
                *pt_flags |= HV_PARTITION_CREATION_FLAG_X2APIC_CAPABLE;
        if (args.pt_flags & BIT_ULL(MSHV_PT_BIT_GPA_SUPER_PAGES))
                *pt_flags |= HV_PARTITION_CREATION_FLAG_GPA_SUPER_PAGES_ENABLED;
+       if (args.pt_flags & BIT(MSHV_PT_BIT_NESTED_VIRTUALIZATION))
+               *pt_flags |= HV_PARTITION_CREATION_FLAG_NESTED_VIRTUALIZATION_CAPABLE;
 
        isol_props->as_uint64 = 0;
 
index 79d1f16..f139c7c 100644 (file)
@@ -335,6 +335,7 @@ union hv_partition_isolation_properties {
 #define HV_PARTITION_ISOLATION_HOST_TYPE_RESERVED   0x2
 
 /* Note: Exo partition is enabled by default */
+#define HV_PARTITION_CREATION_FLAG_NESTED_VIRTUALIZATION_CAPABLE       BIT(1)
 #define HV_PARTITION_CREATION_FLAG_GPA_SUPER_PAGES_ENABLED             BIT(4)
 #define HV_PARTITION_CREATION_FLAG_EXO_PARTITION                       BIT(8)
 #define HV_PARTITION_CREATION_FLAG_LAPIC_ENABLED                       BIT(13)
index dee3ece..7ef5dd6 100644 (file)
@@ -27,6 +27,7 @@ enum {
        MSHV_PT_BIT_X2APIC,
        MSHV_PT_BIT_GPA_SUPER_PAGES,
        MSHV_PT_BIT_CPU_AND_XSAVE_FEATURES,
+       MSHV_PT_BIT_NESTED_VIRTUALIZATION,
        MSHV_PT_BIT_COUNT,
 };