Skip to content

Commit 8927a10

Browse files
weltlingliuw
authored andcommitted
mshv: Add SMT_ENABLED_GUEST partition creation flag
Add support for HV_PARTITION_CREATION_FLAG_SMT_ENABLED_GUEST to allow userspace VMMs to enable SMT for guest partitions. Expose this via new MSHV_PT_BIT_SMT_ENABLED_GUEST flag in the UAPI. Without this flag, the hypervisor schedules guest VPs incorrectly, causing SMT unusable. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com> Signed-off-by: Wei Liu <wei.liu@kernel.org>
1 parent a284dbc commit 8927a10

3 files changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/hv/mshv_root_main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1949,6 +1949,8 @@ static long mshv_ioctl_process_pt_flags(void __user *user_arg, u64 *pt_flags,
19491949
*pt_flags |= HV_PARTITION_CREATION_FLAG_GPA_SUPER_PAGES_ENABLED;
19501950
if (args.pt_flags & BIT(MSHV_PT_BIT_NESTED_VIRTUALIZATION))
19511951
*pt_flags |= HV_PARTITION_CREATION_FLAG_NESTED_VIRTUALIZATION_CAPABLE;
1952+
if (args.pt_flags & BIT(MSHV_PT_BIT_SMT_ENABLED_GUEST))
1953+
*pt_flags |= HV_PARTITION_CREATION_FLAG_SMT_ENABLED_GUEST;
19521954

19531955
isol_props->as_uint64 = 0;
19541956

include/hyperv/hvhdk.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ union hv_partition_isolation_properties {
335335
#define HV_PARTITION_ISOLATION_HOST_TYPE_RESERVED 0x2
336336

337337
/* Note: Exo partition is enabled by default */
338+
#define HV_PARTITION_CREATION_FLAG_SMT_ENABLED_GUEST BIT(0)
338339
#define HV_PARTITION_CREATION_FLAG_NESTED_VIRTUALIZATION_CAPABLE BIT(1)
339340
#define HV_PARTITION_CREATION_FLAG_GPA_SUPER_PAGES_ENABLED BIT(4)
340341
#define HV_PARTITION_CREATION_FLAG_EXO_PARTITION BIT(8)

include/uapi/linux/mshv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ enum {
2828
MSHV_PT_BIT_GPA_SUPER_PAGES,
2929
MSHV_PT_BIT_CPU_AND_XSAVE_FEATURES,
3030
MSHV_PT_BIT_NESTED_VIRTUALIZATION,
31+
MSHV_PT_BIT_SMT_ENABLED_GUEST,
3132
MSHV_PT_BIT_COUNT,
3233
};
3334

0 commit comments

Comments
 (0)