-
Notifications
You must be signed in to change notification settings - Fork 565
arm64: Add support for enabling SVE in vm guests #6691
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
Conversation
bff2602 to
47774b9
Compare
|
Nice! Thanks for working on this @uran0sH. The changes look pretty straight-forward. I believe that the arm CI runner is currently down (we are working on getting a replacement). I will test this out on my machine for now. |
6b70e0a to
4fec8fe
Compare
I submit a newer version. Maybe you can use the latest version to test. Thanks |
|
I did some testing on my own machine and can confirm that this works on a arm machine with sve2 support: Before enabling this feature: After enabling this feature: The net new flags added with this feature are: I also ran some arm sve benchmarks that I found to run to actually use the new instruction set. |
thomasbarrett
left a comment
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.
Thanks for your contribution @uran0sH!
rbradford
left a comment
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.
Thanks for the change - just some one request about rearranging the check logic.
A more general question - is there any cost to always enabling SVE if the host supports it? - that would mean we could do away with all the config side logic. In the CH project we generally aim to have as few controls as possible and aim to to the best by default.
@thomasbarrett Thanks for validating.
rbradford
left a comment
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.
Changes look good - thank you! My question still remains - is there any harm with automatically enabling SVE (and removing the config logic) if the host supports it?
I think that there is no harm with automatically enabling SVE. What do you think about it? @thomasbarrett |
I agree that it makes sense / is safe to automatically enable. |
| && sve_supported | ||
| && vm | ||
| .as_any() | ||
| .downcast_ref::<hypervisor::kvm::KvmVm>() |
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.
@jinankjain I think there is quite a bit of KVM-ism in this aarch64 code path. I don't think we want to block the progress on the KVM front though. We can refactor the code when our support is added.
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.
Yes this is already cleaned up in my tree for ARM support on MSHV. I just need to post those patches.
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.
If SVE is enabled where available by default then this can be moved to the hypervisor crate.
|
@rbradford But if users want to close this feature, how should we do? And it seems that amx also can be enabled automatically. Maybe we can merge this pr first, and discuss it in a new issue? |
Since there is no downsides to always enabling SVE I would like to turn it on by default. I don't think it makes sense to draw parallels with AMX. |
This change enables SVE automatically if the host support SVE/SVE2. Signed-off-by: Wenyu Huang <[email protected]>
This change then adds the first --cpus features option sve that when passed will enable SVE usage for guests (needs a 5.2+ kernel) or exits with failure.
Fix: #6678