@@ -50,6 +50,40 @@ pub(crate) fn msrs_to_save_by_cpuid(cpuid: &CpuId) -> HashSet<u32> {
50
50
leaf_0x7:: index0:: ebx:: MPX_BITINDEX ,
51
51
[ MSR_IA32_BNDCFGS ]
52
52
) ;
53
+
54
+ // IA32_MTRR_PHYSBASEn, IA32_MTRR_PHYSMASKn
55
+ cpuid_msr_dep ! ( 0x1 , 0 , edx, leaf_0x1:: edx:: MTRR_BITINDEX , 0x200 ..0x210 ) ;
56
+
57
+ // Other MTRR MSRs
58
+ cpuid_msr_dep ! (
59
+ 0x1 ,
60
+ 0 ,
61
+ edx,
62
+ leaf_0x1:: edx:: MTRR_BITINDEX ,
63
+ [
64
+ 0x250 , // IA32_MTRR_FIX64K_00000
65
+ 0x258 , // IA32_MTRR_FIX16K_80000
66
+ 0x259 , // IA32_MTRR_FIX16K_A0000
67
+ 0x268 , // IA32_MTRR_FIX4K_C0000
68
+ 0x269 , // IA32_MTRR_FIX4K_C8000
69
+ 0x26a , // IA32_MTRR_FIX4K_D0000
70
+ 0x26b , // IA32_MTRR_FIX4K_D8000
71
+ 0x26c , // IA32_MTRR_FIX4K_E0000
72
+ 0x26d , // IA32_MTRR_FIX4K_E8000
73
+ 0x26e , // IA32_MTRR_FIX4K_F0000
74
+ 0x26f , // IA32_MTRR_FIX4K_F8000
75
+ 0x277 , // IA32_PAT
76
+ 0x2ff // IA32_MTRR_DEF_TYPE
77
+ ]
78
+ ) ;
79
+
80
+ // MCE MSRs
81
+ // We are saving 32 MCE banks here as this is the maximum number supported by KVM
82
+ // and configured by default.
83
+ // The physical number of the MCE banks depends on the CPU.
84
+ // The number of emulated MCE banks can be configured via KVM_X86_SETUP_MCE.
85
+ cpuid_msr_dep ! ( 0x1 , 0 , edx, leaf_0x1:: edx:: MCE_BITINDEX , 0x400 ..0x480 ) ;
86
+
53
87
msrs
54
88
}
55
89
0 commit comments