Skip to content

Commit

Permalink
doc: Use a valid bitmap for vcpu_features
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
zulinx86 committed Dec 4, 2024
1 parent ae90872 commit c181b69
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/cpu_templates/cpu-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ curl --unix-socket /tmp/firecracker.socket -i \
-H 'Content-Type: application/json' \
-d '{
"kvm_capabilities": ["171", "172"],
"vcpu_features": [{ "index": 0, "bitmap": "0b1100000" }]
"vcpu_features": [{ "index": 0, "bitmap": "0b11xxxxx" }]
"reg_modifiers": [
{
"addr": "0x603000000013c020",
Expand Down
2 changes: 1 addition & 1 deletion docs/cpu_templates/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"bitmap": {
"description": "Bitmap for modifying the 32 bit field in kvm_vcpu_init::features. Must be in the format `0b[01x]{1,32}`. Corresponding bits will be cleared (`0`), set (`1`) or left intact (`x`). (`_`) can be used as a separator.",
"type": "string",
"examples": ["0b1100000"]
"examples": ["0b11xxxxx"]
}
}
}
Expand Down

0 comments on commit c181b69

Please sign in to comment.