@@ -16,13 +16,17 @@ guest. A real world use case for this is representing a heterogeneous fleet (a
1616fleet consisting of multiple CPU models) as a homogeneous fleet, so the guests
1717will experience a consistent feature set supported by the host.
1818
19- > ** Note** Representing one CPU vendor as another CPU vendor is not supported.
20-
21- > ** Note** CPU templates shall not be used as a security protection against
22- > malicious guests. Disabling a feature in a CPU template does not generally
23- > make it completely unavailable to the guest. For example, disabling a feature
24- > related to an instruction set will indicate to the guest that the feature is
25- > not supported, but the guest may still be able to execute corresponding
19+ > [ !NOTE]
20+ >
21+ > Representing one CPU vendor as another CPU vendor is not supported.
22+
23+ > [ !NOTE]
24+ >
25+ > CPU templates shall not be used as a security protection against malicious
26+ > guests. Disabling a feature in a CPU template does not generally make it
27+ > completely unavailable to the guest. For example, disabling a feature related
28+ > to an instruction set will indicate to the guest that the feature is not
29+ > supported, but the guest may still be able to execute corresponding
2630> instructions if it does not obey the feature bit.
2731
2832Firecracker supports two types of CPU templates:
@@ -32,15 +36,19 @@ Firecracker supports two types of CPU templates:
3236- Custom CPU templates - users can create their own CPU templates in json format
3337 and pass them to Firecracker
3438
35- > ** Note** Static CPU templates are deprecated starting from v1.5.0 and will be
36- > removed in accordance with our deprecation policy. Even after the removal,
37- > custom CPU templates are available as an improved iteration of static CPU
38- > templates. For more information about the transition from static CPU templates
39- > to custom CPU templates, please refer to
39+ > [ !NOTE]
40+ >
41+ > Static CPU templates are deprecated starting from v1.5.0 and will be removed
42+ > in accordance with our deprecation policy. Even after the removal, custom CPU
43+ > templates are available as an improved iteration of static CPU templates. For
44+ > more information about the transition from static CPU templates to custom CPU
45+ > templates, please refer to
4046> [ this GitHub discussion] ( https://github.com/firecracker-microvm/firecracker/discussions/4135 ) .
4147
42- > ** Note** CPU templates for ARM (both static and custom) require the following
43- > patch to be available in the host kernel:
48+ > [ !NOTE]
49+ >
50+ > CPU templates for ARM (both static and custom) require the following patch to
51+ > be available in the host kernel:
4452> [ Support writable CPU ID registers from userspace] ( https://lore.kernel.org/kvm/[email protected] /#t ) .4553> Otherwise KVM will fail to write to the ARM registers.
4654
@@ -104,21 +112,27 @@ curl --unix-socket /tmp/firecracker.socket -i \
104112Users can create their own CPU templates by creating a json file containing
105113modifiers for CPUID, MSRs or ARM registers.
106114
107- > ** Note** Creating custom CPU templates requires expert knowledge of CPU
108- > architectures. Custom CPU templates must be tested thoroughly before use in
109- > production. An inappropriate configuration may lead to guest crashes or making
110- > guests vulnerable to security attacks. For example, if a CPU template signals
111- > a hardware vulnerability mitigation to the guest while the mitigation is in
112- > fact not supported by the hardware, the guest may decide to disable
113- > corresponding software mitigations which will make the guest vulnerable.
114-
115- > ** Note** Having MSRs or ARM registers in the custom CPU template does not
116- > affect access permissions that guests will have to those registers. The access
117- > control is handled by KVM and is not influenced by CPU templates.
118-
119- > ** Note** When setting guest configuration, KVM may reject setting some bits
120- > quietly. This is user's responsibility to make sure that their custom CPU
121- > template is applied as expected even if Firecracker does not report an error.
115+ > [ !NOTE]
116+ >
117+ > Creating custom CPU templates requires expert knowledge of CPU architectures.
118+ > Custom CPU templates must be tested thoroughly before use in production. An
119+ > inappropriate configuration may lead to guest crashes or making guests
120+ > vulnerable to security attacks. For example, if a CPU template signals a
121+ > hardware vulnerability mitigation to the guest while the mitigation is in fact
122+ > not supported by the hardware, the guest may decide to disable corresponding
123+ > software mitigations which will make the guest vulnerable.
124+
125+ > [ !NOTE]
126+ >
127+ > Having MSRs or ARM registers in the custom CPU template does not affect access
128+ > permissions that guests will have to those registers. The access control is
129+ > handled by KVM and is not influenced by CPU templates.
130+
131+ > [ !NOTE]
132+ >
133+ > When setting guest configuration, KVM may reject setting some bits quietly.
134+ > This is user's responsibility to make sure that their custom CPU template is
135+ > applied as expected even if Firecracker does not report an error.
122136
123137In order to assist with creation and usage of CPU templates, there exists a CPU
124138template helper tool. More details can be found [ here] ( cpu-template-helper.md ) .
216230The full description of the custom CPU templates language can be found
217231[ here] ( schema.json ) .
218232
219- > ** Note** You can also use ` _ ` to visually separate parts of a bitmap. So
220- > instead of writing: ` 0b0000xxxx ` , it can be ` 0b0000_xxxx ` .
233+ > [ !NOTE]
234+ >
235+ > You can also use ` _ ` to visually separate parts of a bitmap. So instead of
236+ > writing: ` 0b0000xxxx ` , it can be ` 0b0000_xxxx ` .
221237
222238#### Expansion of contracted bitmaps
223239
0 commit comments