-
Notifications
You must be signed in to change notification settings - Fork 8
boot-qemu.sh: Support using KVM on arm64 hardware #23
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
Merged
nickdesaulniers
merged 2 commits into
ClangBuiltLinux:master
from
nathanchance:arm64-kvm
Aug 13, 2020
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is there anything we can do to make the host check more consistent with the x86 check?
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.
What kind of consistency were you looking for? The logic for this check was copied from the cpu-checker package on Debian and Ubuntu, which contains kvm-ok. Apparently all AArch64 hardware is KVM compatible, all the script does is check if the KVM module is loaded (i.e.
/dev/kvmexists).I can probably refine the second half of the x86 check to just be "does
/dev/kvmexist" but I would need to test it later.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.
why do we have
unameguards on one and not both? Is there something in cpuinfo that we should check on aarch64?I would expect both or neither to have cpuinfo checks.
I would expect both or neither to have uname checks.
Not different approaches per target.
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.
Not all x86 CPUs have hardware virtualization; we have to check
/proc/cpuinfofor the feature flags (vmxfor Intel,svmfor AMD). We do not need aunamecheck for that as non-x86 processors will not have those flags. All AArch64 CPUs have hardware virtualization so we just need to check if we are running on an AArch64 processor to determine if we have hardware virtualization; I do not see any flags in/proc/cpuinfothat we can use to check.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.
Will
/dev/kvmexist on x86 cpus that don't supportvmx|svm? If not, then it seems better to do auname -mcheck for x86 hosts, rather than checkcpuinfo. What ifsvmappears in an aarch64 host's/dev/cpuinfotrying to boot x86?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.
Ah, I see what you are saying. I do not think that
/dev/kvmcan exist if the CPU does not have hardware virtualization. I highly doubt thatsvmwould appear on an AArch64 device but who knows? I still think the check is consistent with how it is inkvm-okbut I am fine with changing it (although I guess I will need to check for eitherx86_64ori386throughi686right?)