Skip to content

Commit

Permalink
fix: Update static CPU templates with RFDS_NO bit
Browse files Browse the repository at this point in the history
Passthrough in T2CL template, set to 1 in T2S template.

Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
  • Loading branch information
roypat committed Apr 3, 2024
1 parent b8dacc5 commit 21a3a6d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ and this project adheres to
`--config` parameter of `cpu-template-helper` optional. Users no longer need
to prepare kernel, rootfs and Firecracker configuration files to use
`cpu-template-helper`.
- [#4537](https://github.com/firecracker-microvm/firecracker/pull/4537) Changed
T2CL template to pass through bit 27 of `MSR_IA32_ARCH_CAPABILITIES`
(`RFDS_NO`).
- [#4537](https://github.com/firecracker-microvm/firecracker/pull/4537) Changed
T2S template to set bit 27 of `MSR_IA32_ARCH_CAPABILITIES` (`RFDS_NO`) to 1.

### Deprecated

Expand Down
3 changes: 2 additions & 1 deletion src/vmm/src/cpu_config/x86_64/static_cpu_templates/t2cl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,13 @@ pub fn t2cl() -> CustomCpuTemplate {
// - Bit 19: RRSBA
// - Bit 24: PBRSB_NO
// - Bit 26: GDS_NO
// - Bit 27: RFDS_NO
//
// Note that this MSR is specific to Intel processors.
RegisterModifier {
addr: 0x10a,
bitmap: RegisterValueFilter {
filter: 0b1111_1111_1111_1111_1111_1111_1111_1111_1111_1010_1111_0101_0001_1110_0000_0000,
filter: 0b1111_1111_1111_1111_1111_1111_1111_1111_1111_0010_1111_0101_0001_1110_0000_0000,
value: 0b0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000,
},
},
Expand Down
3 changes: 2 additions & 1 deletion src/vmm/src/cpu_config/x86_64/static_cpu_templates/t2s.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,13 @@ pub fn t2s() -> CustomCpuTemplate {
// - Bit 23: OVERCLOCKING_STATUS
// - Bit 24: PBRSB_NO
// - Bit 26: GDS_NO
// - BIT 27: RFDS_NO
// - Bits 63-25: Reserved
RegisterModifier {
addr: 0x10a,
bitmap: RegisterValueFilter {
filter: 0b1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111,
value: 0b0000_0000_0000_0000_0000_0000_0000_0000_0000_0100_0000_1000_0000_1100_0100_1100,
value: 0b0000_0000_0000_0000_0000_0000_0000_0000_0000_1100_0000_1000_0000_1100_0100_1100,
},
}],
..Default::default()
Expand Down
2 changes: 1 addition & 1 deletion tests/data/static_cpu_templates/t2cl.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"msr_modifiers": [
{
"addr": "0x10a",
"bitmap": "0b0000000000000000000000000000000000000x0x0000x0x0xxx0000xxxxxxxxx"
"bitmap": "0b000000000000000000000000000000000000xx0x0000x0x0xxx0000xxxxxxxxx"
}
]
}
2 changes: 1 addition & 1 deletion tests/data/static_cpu_templates/t2s.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"msr_modifiers": [
{
"addr": "0x10a",
"bitmap": "0b0000000000000000000000000000000000000100000010000000110001001100"
"bitmap": "0b0000000000000000000000000000000000001100000010000000110001001100"
}
]
}

0 comments on commit 21a3a6d

Please sign in to comment.