Add an option to control nested virtualization - #7408
Conversation
3c26210 to
f2847cb
Compare
|
I assume there isn't an option for KVM? We should take into consideration we may want to provide very fine-grained configurations in the medium term. Putting this into PlatformConfig looks wrong. This is a CPU feature, not a platform feature. |
We can directly add to the VM configuration as features or something? |
There is a workstream to expose fine-grained control over the CPU features. I think this belongs there. KVM can benefit from the fine-grained control. |
f2847cb to
1920b79
Compare
|
For the record: with current Cloud Hypervisor on Linux/KVM, nesting works out of the box including state save/resume and live-migration. It should work similar with MSHV. |
|
|
We could add a runtime configuration for kvm similar to MSHV which disables/enables the support explicitly. Then we can have similar behavior for both backends - and disabling nesting is a valid use case in case infrastructure maintainers are concerned about people breaking out of the VMX emulation for example |
| @@ -35,6 +35,7 @@ pub struct CpuFeatures { | |||
| #[cfg(target_arch = "x86_64")] | |||
| #[serde(default)] | |||
| pub amx: bool, | |||
| pub nested: bool, | |||
There was a problem hiding this comment.
How about nested_virt instead of just nested?
|
nit: there are multiple typos in the commit messages. |
1920b79 to
187ce24
Compare
|
@anirudhrb Please take another look. Thx |
rbradford
left a comment
There was a problem hiding this comment.
We don't have a nested option for KVM - it's always enabled. Why do we need to make it an option for MSHV?
If you add the option to --cpu for MSHV then you need to do the same for KVM.
With MSHV we have to pass the flag during VM creations. The customers want to control that flow with CLI, that's why I raised the PR. Do you recommend adding feature guard around the nested feature, or recommend adding an extra argument like --mshv-cpu-feaures? |
You haven't explained why you can't have it turned on all the time. |
Customers does not wnat to turn on by default.
We can turn it on by default with no issue but customer does not want it default rather it wants to control in run-time. Do you also refer to turn it on by default with the CpuFeatures default initialization? Also in future we will have more Cpu features on MSVH that might need to be turned on the CLI. |
|
Okay. If you want to make it controllable then I think you should make it controllable for KVM as well - with a default of on. |
Just curious, If we add some features that is only available for MSHV, How do we do it? |
Probably something like |
|
Why not add a parameter to
For the record: Some operators are concerned about the increased attack surface of the KVM VMX emulator code. |
Exactly what I was getting at!
We've already shipped with a default of on - so we can't change that now. |
e9d670a to
f9107db
Compare
User can now disable nested virtualization for Intel and AMD if configured by the CLI. Signed-off-by: Muminul Islam <[email protected]>
This patch updates the documentation to reflect the newly added nested CPU feature option in the CLI. Signed-off-by: Muminul Islam <[email protected]>
a92eb90 to
a5e7e7b
Compare
rbradford
left a comment
There was a problem hiding this comment.
Thank you for your patience on this PR! We do need to be especially careful with adding APIs and things could affect our defaults.
5fb50ed
Thank you @rbradford for all your effort on this. Your thorough review was very helpful and some learning for me. |
The recently-added nested property is true by default, but is not supported yet on MSHV. See cloud-hypervisor/cloud-hypervisor#7408 for additional information. Signed-off-by: Dan Mihai <[email protected]>
The recently-added nested property is true by default, but is not supported yet on MSHV. See cloud-hypervisor/cloud-hypervisor#7408 for additional information. Signed-off-by: Dan Mihai <[email protected]>
The recently-added nested property is true by default, but is not supported yet on MSHV. See cloud-hypervisor/cloud-hypervisor#7408 for additional information. Signed-off-by: Dan Mihai <[email protected]>
The recently-added nested property is true by default, but is not supported yet on MSHV. See cloud-hypervisor/cloud-hypervisor#7408 for additional information. Signed-off-by: Dan Mihai <[email protected]>
The recently-added nested property is true by default, but is not supported yet on MSHV. See cloud-hypervisor/cloud-hypervisor#7408 for additional information. Signed-off-by: Dan Mihai <[email protected]>
The recently-added nested property is true by default, but is not supported yet on MSHV. See cloud-hypervisor/cloud-hypervisor#7408 for additional information. Signed-off-by: Dan Mihai <[email protected]>
The recently-added nested property is true by default, but is not supported yet on MSHV. See cloud-hypervisor/cloud-hypervisor#7408 for additional information. Signed-off-by: Dan Mihai <[email protected]>
This is a runtime-rs port for kata-containers@7973e4e The recently-added nested property is true by default, but is not supported yet on MSHV. See cloud-hypervisor/cloud-hypervisor#7408 for additional information. Signed-off-by: Saul Paredes <[email protected]>
This is a runtime-rs port for kata-containers@7973e4e The recently-added nested property is true by default, but is not supported yet on MSHV. See cloud-hypervisor/cloud-hypervisor#7408 for additional information. Signed-off-by: Saul Paredes <[email protected]>
This is a runtime-rs port for kata-containers@7973e4e The recently-added nested property is true by default, but is not supported yet on MSHV. See cloud-hypervisor/cloud-hypervisor#7408 for additional information. Signed-off-by: Saul Paredes <[email protected]>
This is a runtime-rs port for kata-containers@7973e4e The recently-added nested property is true by default, but is not supported yet on MSHV. See cloud-hypervisor/cloud-hypervisor#7408 for additional information. Signed-off-by: Saul Paredes <[email protected]>
This is a runtime-rs port for kata-containers@7973e4e The recently-added nested property is true by default, but is not supported yet on MSHV. See cloud-hypervisor/cloud-hypervisor#7408 for additional information. Signed-off-by: Saul Paredes <[email protected]>
This is a runtime-rs port for kata-containers@7973e4e The recently-added nested property is true by default, but is not supported yet on MSHV. See cloud-hypervisor/cloud-hypervisor#7408 for additional information. Signed-off-by: Saul Paredes <[email protected]>
This is a runtime-rs port for kata-containers@7973e4e The recently-added nested property is true by default, but is not supported yet on MSHV. See cloud-hypervisor/cloud-hypervisor#7408 for additional information. Signed-off-by: Saul Paredes <[email protected]>
This is a runtime-rs port for kata-containers@7973e4e The recently-added nested property is true by default, but is not supported yet on MSHV. See cloud-hypervisor/cloud-hypervisor#7408 for additional information. Signed-off-by: Saul Paredes <[email protected]>
This is a runtime-rs port for kata-containers@7973e4e The recently-added nested property is true by default, but is not supported yet on MSHV. See cloud-hypervisor/cloud-hypervisor#7408 for additional information. Signed-off-by: Saul Paredes <[email protected]>
This is a runtime-rs port for kata-containers@7973e4e The recently-added nested property is true by default, but is not supported yet on MSHV. See cloud-hypervisor/cloud-hypervisor#7408 for additional information. Signed-off-by: Saul Paredes <[email protected]>
No description provided.