-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
test: Add tests for multi-vCPU setup #4942
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4942 +/- ##
=======================================
Coverage 84.07% 84.07%
=======================================
Files 251 251
Lines 28059 28059
=======================================
Hits 23592 23592
Misses 4467 4467
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
rebased onto the latest state of #4934 |
rebased on top of latest main |
[deleted] |
As seen in firecracker-microvm#4925, setting the least significant bits of vcpu_features field to 0 make secondary CPUs not work. There is no reason to use such an invalid example in doc. The sample in doc intended to enable PAC (Pointer Authentication) since it checks capabilities 171 and 172 [2]. Thus, not set the other bits than bits 5 and 6. [1]: https://elixir.bootlin.com/linux/v6.12.1/source/include/uapi/linux/kvm.h#L868-L869 [2]: https://elixir.bootlin.com/linux/v6.12.1/source/arch/arm64/include/uapi/asm/kvm.h#L108-L109 Signed-off-by: Takahiro Itazuri <[email protected]>
b134c0c
to
0841f0f
Compare
As seen in firecracker-microvm#4925, a bad CPU template made secondary CPUs not come up. To catch similar bugs of CPU templates, check all the vCPUs are online from guests' perspective. Signed-off-by: Takahiro Itazuri <[email protected]>
0841f0f
to
b8bd579
Compare
The test ensures Firecracker or CPU templates don't configure CPU features differently between vCPUs. Note that whether the printed CPU features are expected or not should be tested in (arch-specific) test_cpu_features_*.py only for vCPU 0. Thus, we only test the equivalence of all CPUs in the same guest. Signed-off-by: Takahiro Itazuri <[email protected]>
test_max_cpus.py tests vCPUs are online only on a microVM without CPU templates, which is now covered as part of test_all_vcpus_online(). Remove the test and use the maximum number of vCPUs in the new tests. Signed-off-by: Takahiro Itazuri <[email protected]>
b8bd579
to
58cfbde
Compare
Merge #4934 first, since this PR is based on it. Only the last three commits are for this PRNow unblocked!Changes
Add the following tests for multi-vCPU setup:
Note that whether the presented CPU features are expected or not should be tested in (arch-specific) test_cpu_features_*.py only for vCPU 0.
Reason
To prevent a similar type of bugs fixed in #4925 where a bad CPU template made secondary CPUs not work.
Testing
It is confirmed that the bug of the bad CPU template is correctly caught.
License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md
.PR Checklist
tools/devtool checkstyle
to verify that the PR passes theautomated style checks.
how they are solving the problem in a clear and encompassing way.
[ ] I have updated any relevant documentation (both in code and in the docs)in the PR.
[ ] I have mentioned all user-facing changes inCHANGELOG.md
.[ ] If a specific issue led to this PR, this PR closes the issue.[ ] When making API changes, I have followed theRunbook for Firecracker API changes.
integration tests.
[ ] I have linked an issue to every newTODO
.rust-vmm
.