]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
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 e5d94398528e89b6c423e06340ecbfc61dbd6a38..e490f8e5a8a505997351a3687f4c971313ffad48 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 79d1f16a850a8826a1a0b3969f3f4b30b8945b77..f139c7c5bb2dd1d938baf853a72c67feebfe3c74 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 dee3ece28ce58e8b3d738ebb55cbc39923cf358a..7ef5dd67a232677d8a6a0bfc316f5216820d81f4 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,
 };