mshv: Enable SMT for guests with threads_per_core > 1#7668
mshv: Enable SMT for guests with threads_per_core > 1#7668rbradford merged 2 commits intocloud-hypervisor:mainfrom
Conversation
5617fe2 to
03ba4e8
Compare
There was a problem hiding this comment.
since it is no longer unused, please rename _config to config
There was a problem hiding this comment.
Indeed. There are some other struct members hanging on it, too. I made a dedicated commit, it doesn't seem to deserve a dedicated PR.
Thanks
| linux-loader = "0.13.1" | ||
| mshv-bindings = "0.6.6" | ||
| mshv-ioctls = "0.6.6" | ||
| mshv-bindings = "0.6.7" |
There was a problem hiding this comment.
Nice to see 👍 but you need to check in the Cargo.lock with it.
There was a problem hiding this comment.
Fixed, thanks for the hint.
Release notes: rust-vmm/mshv#307 Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
03ba4e8 to
712665c
Compare
712665c to
0fd3e09
Compare
Head branch was pushed to by a user without write access
0fd3e09 to
e058a96
Compare
| /// let vm = hypervisor.create_vm(config).unwrap(); | ||
| /// ``` | ||
| fn create_vm(&self, _config: HypervisorVmConfig) -> hypervisor::Result<Arc<dyn vm::Vm>> { | ||
| fn create_vm(&self, config: HypervisorVmConfig) -> hypervisor::Result<Arc<dyn vm::Vm>> { |
There was a problem hiding this comment.
ah shoot, clippy is failing as with some cargo feature configurations, this variable is unused 🙄
Hm..... yes, than maybe sticking to _config might be the pragmatic solution, although it isn't very nice
There was a problem hiding this comment.
@weltling Do you want to just drop the the last commit then?
There was a problem hiding this comment.
I went with this, but otherwise seems no ideal solution to this.
#[cfg(any(feature = "sev_snp", target_arch = "x86_64"))] config: HypervisorVmConfig,
#[cfg(not(any(feature = "sev_snp", target_arch = "x86_64")))] _config: HypervisorVmConfig,
If this doesn't work out, I'll drop the last commit then.
Thanks
There was a problem hiding this comment.
Looks like clippy is happy with that :)
There was a problem hiding this comment.
Thanks for investigating! I think keeping _config is the lesser evil here
There was a problem hiding this comment.
Gotcha, I dropped that. The compiler seems also to handle it correctly disreganding _. Thanks
e058a96 to
a11eed7
Compare
|
Hmm, looks like the MSHV CI runner might not have an updated host kernel version. Looking at what it says: this likely means tests Thanks! |
a11eed7 to
34565ab
Compare
34565ab to
134480a
Compare
Set HV_PARTITION_CREATION_FLAG_SMT_ENABLED_GUEST when the guest topology has more than one thread per core. This allows the hypervisor to schedule guest VPs correctly on SMT-enabled hosts. Without this flag, the hypervisor schedules guest VPs incorrectly, causing SMT unusable. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
134480a to
1d5d8fd
Compare

Set
HV_PARTITION_CREATION_FLAG_SMT_ENABLED_GUESTwhen the guest topologyhas more than one thread per core. This allows the hypervisor to schedule
guest VPs correctly on SMT-enabled hosts.
Without this flag, the hypervisor schedules guest VPs incorrectly,
causing SMT unusable.
Includes also the updated MSHV crates as a dependency.
This complements #7576 by ensuring SMT is enabled when the topology configured accordingly.