-
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
fix: make aarch64_with_sve_and_pac template example work with >=2 vcpus #4925
Merged
Conversation
This file contains 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
My IDE was complaining about this Signed-off-by: Patrick Roy <[email protected]>
I got an error message saying 'Start microvm error: Internal error while starting microVM: Vm error: Missing KVM capabilities: aa', which just looked like KVM was screaming. Thus, look through where we print hex numbers, and make sure they are prefixed using '0x', and do so uniformly by using Rust's `:#x` format modifier [1] [1]: https://doc.rust-lang.org/std/fmt/#sign0 Signed-off-by: Patrick Roy <[email protected]>
Setting the least significant 4 bits to zero overwrites some configuration that Firecracker sets on secondary CPUs that is needed for them to be able to be booted. With these 4 bits set to 0, the CPUs will never show up as online inside the guest, and KVM will just infinitely spin inside KVM_RUN for them. Fix by using 'x' in the template, which preserves the defaults set by Firecracker. Signed-off-by: Patrick Roy <[email protected]>
roypat
added
the
Status: Awaiting review
Indicates that a pull request is ready to be reviewed
label
Nov 25, 2024
pb8o
approved these changes
Nov 25, 2024
pb8o
added
Type: Bug
Indicates an unexpected problem or unintended behavior
Type: Fix
Indicates a fix to existing code
labels
Nov 25, 2024
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4925 +/- ##
==========================================
+ Coverage 84.07% 84.09% +0.01%
==========================================
Files 251 251
Lines 28067 28061 -6
==========================================
Hits 23597 23597
+ Misses 4470 4464 -6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
Manciukic
approved these changes
Nov 25, 2024
zulinx86
added a commit
to zulinx86/firecracker
that referenced
this pull request
Dec 4, 2024
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]>
zulinx86
added a commit
to zulinx86/firecracker
that referenced
this pull request
Dec 4, 2024
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]>
zulinx86
added a commit
to zulinx86/firecracker
that referenced
this pull request
Dec 4, 2024
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]>
zulinx86
added a commit
to zulinx86/firecracker
that referenced
this pull request
Dec 4, 2024
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]>
5 tasks
zulinx86
added a commit
to zulinx86/firecracker
that referenced
this pull request
Dec 5, 2024
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]>
zulinx86
added a commit
to zulinx86/firecracker
that referenced
this pull request
Dec 5, 2024
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]>
zulinx86
added a commit
to zulinx86/firecracker
that referenced
this pull request
Dec 6, 2024
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]>
zulinx86
added a commit
to zulinx86/firecracker
that referenced
this pull request
Dec 6, 2024
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]>
zulinx86
added a commit
to zulinx86/firecracker
that referenced
this pull request
Dec 6, 2024
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]>
zulinx86
added a commit
to zulinx86/firecracker
that referenced
this pull request
Dec 9, 2024
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]>
zulinx86
added a commit
to zulinx86/firecracker
that referenced
this pull request
Dec 9, 2024
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]>
zulinx86
added a commit
to zulinx86/firecracker
that referenced
this pull request
Dec 9, 2024
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]>
zulinx86
added a commit
to zulinx86/firecracker
that referenced
this pull request
Dec 10, 2024
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]>
roypat
pushed a commit
that referenced
this pull request
Dec 10, 2024
As seen in #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]>
roypat
pushed a commit
that referenced
this pull request
Dec 10, 2024
As seen in #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]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Status: Awaiting review
Indicates that a pull request is ready to be reviewed
Type: Bug
Indicates an unexpected problem or unintended behavior
Type: Fix
Indicates a fix to existing code
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.
Setting the least significant 4 bits to zero overwrites some
configuration that Firecracker sets on secondary CPUs that is needed for
them to be able to be booted. With these 4 bits set to 0, the CPUs will
never show up as online inside the guest, and KVM will just infinitely
spin inside KVM_RUN for them. Fix by using 'x' in the template, which
preserves the defaults set by Firecracker.
Signed-off-by: Patrick Roy [email protected]
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.
in the PR.
CHANGELOG.md
.Runbook for Firecracker API changes.
integration tests.
TODO
.rust-vmm
.