Skip to content

Commit fa1e2ab

Browse files
committed
fix(vmm): Change T2A to set EferLmsleUnsupported to 1
CPUID.0x80000008:EBX[20] (EferLmsleUnsupported) indicates that EFER[LMSLE] is not supported. As described in AMD64 APM vol.2, EFER[LMSLE] has already been deprecated and is not suported by all processor implementations (including m6a.metal). KVM allows nested virtualization guests to write EFER[LMSLE] only for very specific software (SLES11 version of Xen 4.0 to boot nested SVM). On non-nested virtualized guests, writing to EFER[LMSLE] generates #GP which is identical to behavior on CPUs where the EferLmsleUnsupported bit is set to 1. As T2A template disables SVM, it is safer and better to let guests know that writing to EFER[LMSLE] is not supported. As a side note, to revert the upstream commit allowing it on nested virtualized guests, some discussions were made but was cut off in the middle. Signed-off-by: Takahiro Itazuri <itazur@amazon.com>
1 parent 4975ec0 commit fa1e2ab

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
update.
4040
- Fixed passing through cache information from host in CPUID leaf 0x80000005.
4141
- Fixed the T2A CPU template to disable SVM (nested virtualization).
42+
- Fixed the T2A CPU template to set EferLmsleUnsupported bit
43+
(CPUID.80000008h:EBX[20]), which indicates that EFER[LMSLE] is not supported.
4244

4345
## [1.3.0]
4446

resources/tests/static_cpu_templates/t2a.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
"modifiers": [
8383
{
8484
"register": "ebx",
85-
"bitmap": "0bxxxxxxxxxxxx11xxxxxxxx0xxxxxx0x0"
85+
"bitmap": "0bxxxxxxxxxxx111xxxxxxxx0xxxxxx0x0"
8686
}
8787
]
8888
}

src/vmm/src/cpu_config/x86_64/static_cpu_templates/t2a.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,12 @@ pub fn t2a() -> CustomCpuTemplate {
232232
// - Bit 09: WBNOINVD (AMD APM) / WBNOINVD (Intel SDM)
233233
// - Bit 18: IbrsPreferred (ADM APM) / Reserved (Intel SDm)
234234
// - Bit 19: IbrsSameMode (AMD APM) / Reserved (Intel SDM)
235+
// - Bit 20: EferLmsleUnsupported (AMD APM) / Reserved (Intel SDM)
235236
CpuidRegisterModifier {
236237
register: CpuidRegister::Ebx,
237238
bitmap: RegisterValueFilter {
238-
filter: 0b0000_0000_0000_1100_0000_0010_0000_0101,
239-
value: 0b0000_0000_0000_1100_0000_0000_0000_0000,
239+
filter: 0b0000_0000_0001_1100_0000_0010_0000_0101,
240+
value: 0b0000_0000_0001_1100_0000_0000_0000_0000,
240241
},
241242
},
242243
],

0 commit comments

Comments
 (0)