-
Notifications
You must be signed in to change notification settings - Fork 946
qemu: support nestedVirtualization with HVF (QEMU 11.1 or later)
#5443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -126,6 +126,18 @@ func validateConfig(cfg *limatype.LimaYAML) error { | |
| } | ||
| } | ||
|
|
||
| if cfg.NestedVirtualization != nil && *cfg.NestedVirtualization { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we support Linux hosts?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. For aarch64 the same code path applies on Linux/KVM, the macOS version check is darwin-only, and virtualization=on works with KVM given QEMU ≥ 10.1 and a ≥ 6.16 host kernel booted with kvm-arm.mode=nested (FEAT_NV hardware); otherwise QEMU fails with a clear "host kernel KVM does not support providing Virtualization extensions" error. I don't have such hardware, so this part is untested. |
||
| if runtime.GOOS == "darwin" { | ||
| macOSProductVersion, err := osutil.ProductVersion() | ||
| if err != nil { | ||
| return err | ||
| } | ||
| if macOSProductVersion.LessThan(*semver.New("15.0.0")) { | ||
| return errors.New("nested virtualization requires macOS 15 or newer") | ||
| } | ||
| } | ||
| } | ||
|
|
||
| return nil | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How did you test this configuration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't test it. I added it because the virt machine accepts virtualization=on for 32-bit too. But armv7l guests are
tcg-only in Lima and Linux droppedkvmon 32-bit ARM hosts in 5.7, so a guest couldn't use it anyway. I'll remove the armv7l case and keep this PR to aarch64.