Skip to content

Commit 4d13dc8

Browse files
committed
chore(bindgen): upgrade to linux 6.12 and use single kernel tree
We were using bindgen from 3 different sources: - installed headers in the system - linux-5.10.y branch from amazonlinux repo - linux-next branch from torvalds repo This is overcomplicated and unnecessary as Linux doesn't break the UAPI. This patch updates it to use a single stable branch (6.12), from which the user headers are generated using `make headers_install` and regenerates all the headers, fixing some minor incompatibilities in the syntax. While I was at it I also improved the generation for C enums to use constified-enum-module style which is less verbose. I had to fix an issue with the io_uring auto-generated structs not implementing Copy due to FAM introduced in the latest kernels. I have put a bindgen-patch to drop the FAM and derive Copy and Clone where required to implement ByteValued. If we ever need to use those fields, we'll need to find a different solution. Signed-off-by: Riccardo Mancini <[email protected]>
1 parent aa1c77b commit 4d13dc8

File tree

21 files changed

+936
-215
lines changed

21 files changed

+936
-215
lines changed

src/firecracker/src/generated/prctl.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
clippy::undocumented_unsafe_blocks,
1313
missing_debug_implementations,
1414
clippy::tests_outside_test_module,
15-
unsafe_op_in_unsafe_fn
15+
unsafe_op_in_unsafe_fn,
16+
clippy::redundant_static_lifetimes
1617
)]
1718

1819
pub const PR_SET_PDEATHSIG: u32 = 1;
@@ -179,3 +180,20 @@ pub const PR_RISCV_V_VSTATE_CTRL_INHERIT: u32 = 16;
179180
pub const PR_RISCV_V_VSTATE_CTRL_CUR_MASK: u32 = 3;
180181
pub const PR_RISCV_V_VSTATE_CTRL_NEXT_MASK: u32 = 12;
181182
pub const PR_RISCV_V_VSTATE_CTRL_MASK: u32 = 31;
183+
pub const PR_RISCV_SET_ICACHE_FLUSH_CTX: u32 = 71;
184+
pub const PR_RISCV_CTX_SW_FENCEI_ON: u32 = 0;
185+
pub const PR_RISCV_CTX_SW_FENCEI_OFF: u32 = 1;
186+
pub const PR_RISCV_SCOPE_PER_PROCESS: u32 = 0;
187+
pub const PR_RISCV_SCOPE_PER_THREAD: u32 = 1;
188+
pub const PR_PPC_GET_DEXCR: u32 = 72;
189+
pub const PR_PPC_SET_DEXCR: u32 = 73;
190+
pub const PR_PPC_DEXCR_SBHE: u32 = 0;
191+
pub const PR_PPC_DEXCR_IBRTPD: u32 = 1;
192+
pub const PR_PPC_DEXCR_SRAPD: u32 = 2;
193+
pub const PR_PPC_DEXCR_NPHIE: u32 = 3;
194+
pub const PR_PPC_DEXCR_CTRL_EDITABLE: u32 = 1;
195+
pub const PR_PPC_DEXCR_CTRL_SET: u32 = 2;
196+
pub const PR_PPC_DEXCR_CTRL_CLEAR: u32 = 4;
197+
pub const PR_PPC_DEXCR_CTRL_SET_ONEXEC: u32 = 8;
198+
pub const PR_PPC_DEXCR_CTRL_CLEAR_ONEXEC: u32 = 16;
199+
pub const PR_PPC_DEXCR_CTRL_MASK: u32 = 31;

src/vmm/src/arch/x86_64/generated/arch_prctl.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
clippy::undocumented_unsafe_blocks,
1313
missing_debug_implementations,
1414
clippy::tests_outside_test_module,
15-
unsafe_op_in_unsafe_fn
15+
unsafe_op_in_unsafe_fn,
16+
clippy::redundant_static_lifetimes
1617
)]
1718

1819
pub const ARCH_SET_GS: u32 = 4097;

src/vmm/src/arch/x86_64/generated/hyperv.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
clippy::undocumented_unsafe_blocks,
1313
missing_debug_implementations,
1414
clippy::tests_outside_test_module,
15-
unsafe_op_in_unsafe_fn
15+
unsafe_op_in_unsafe_fn,
16+
clippy::redundant_static_lifetimes
1617
)]
1718

1819
pub const HV_X64_MSR_SYNDBG_CONTROL: u32 = 0x400000f1;

src/vmm/src/arch/x86_64/generated/hyperv_tlfs.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
clippy::undocumented_unsafe_blocks,
1313
missing_debug_implementations,
1414
clippy::tests_outside_test_module,
15-
unsafe_op_in_unsafe_fn
15+
unsafe_op_in_unsafe_fn,
16+
clippy::redundant_static_lifetimes
1617
)]
1718

1819
pub const HV_X64_MSR_GUEST_OS_ID: u32 = 0x40000000;
@@ -49,6 +50,12 @@ pub const HV_X64_MSR_SINT12: u32 = 0x4000009c;
4950
pub const HV_X64_MSR_SINT13: u32 = 0x4000009d;
5051
pub const HV_X64_MSR_SINT14: u32 = 0x4000009e;
5152
pub const HV_X64_MSR_SINT15: u32 = 0x4000009f;
53+
pub const HV_X64_MSR_NESTED_SCONTROL: u32 = 0x40001080;
54+
pub const HV_X64_MSR_NESTED_SVERSION: u32 = 0x40001081;
55+
pub const HV_X64_MSR_NESTED_SIEFP: u32 = 0x40001082;
56+
pub const HV_X64_MSR_NESTED_SIMP: u32 = 0x40001083;
57+
pub const HV_X64_MSR_NESTED_EOM: u32 = 0x40001084;
58+
pub const HV_X64_MSR_NESTED_SINT0: u32 = 0x40001090;
5259
pub const HV_X64_MSR_STIMER0_CONFIG: u32 = 0x400000b0;
5360
pub const HV_X64_MSR_STIMER0_COUNT: u32 = 0x400000b1;
5461
pub const HV_X64_MSR_STIMER1_CONFIG: u32 = 0x400000b2;

src/vmm/src/arch/x86_64/generated/mpspec.rs

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
clippy::undocumented_unsafe_blocks,
1313
missing_debug_implementations,
1414
clippy::tests_outside_test_module,
15-
unsafe_op_in_unsafe_fn
15+
unsafe_op_in_unsafe_fn,
16+
clippy::redundant_static_lifetimes
1617
)]
1718

1819
pub const MPC_SIGNATURE: &[u8; 5] = b"PCMP\0";
@@ -205,11 +206,13 @@ const _: () = {
205206
["Offset of field: mpc_intsrc::dstapic"][::std::mem::offset_of!(mpc_intsrc, dstapic) - 6usize];
206207
["Offset of field: mpc_intsrc::dstirq"][::std::mem::offset_of!(mpc_intsrc, dstirq) - 7usize];
207208
};
208-
pub const mp_irq_source_types_mp_INT: mp_irq_source_types = 0;
209-
pub const mp_irq_source_types_mp_NMI: mp_irq_source_types = 1;
210-
pub const mp_irq_source_types_mp_SMI: mp_irq_source_types = 2;
211-
pub const mp_irq_source_types_mp_ExtINT: mp_irq_source_types = 3;
212-
pub type mp_irq_source_types = ::std::os::raw::c_uint;
209+
pub mod mp_irq_source_types {
210+
pub type Type = ::std::os::raw::c_uint;
211+
pub const mp_INT: Type = 0;
212+
pub const mp_NMI: Type = 1;
213+
pub const mp_SMI: Type = 2;
214+
pub const mp_ExtINT: Type = 3;
215+
}
213216
#[repr(C)]
214217
#[derive(Debug, Default, Copy, Clone, PartialEq)]
215218
pub struct mpc_lintsrc {
@@ -261,7 +264,9 @@ const _: () = {
261264
[::std::mem::offset_of!(mpc_oemtable, checksum) - 7usize];
262265
["Offset of field: mpc_oemtable::mpc"][::std::mem::offset_of!(mpc_oemtable, mpc) - 8usize];
263266
};
264-
pub const mp_bustype_MP_BUS_ISA: mp_bustype = 1;
265-
pub const mp_bustype_MP_BUS_EISA: mp_bustype = 2;
266-
pub const mp_bustype_MP_BUS_PCI: mp_bustype = 3;
267-
pub type mp_bustype = ::std::os::raw::c_uint;
267+
pub mod mp_bustype {
268+
pub type Type = ::std::os::raw::c_uint;
269+
pub const MP_BUS_ISA: Type = 1;
270+
pub const MP_BUS_EISA: Type = 2;
271+
pub const MP_BUS_PCI: Type = 3;
272+
}

src/vmm/src/arch/x86_64/generated/msr_index.rs

Lines changed: 98 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
clippy::undocumented_unsafe_blocks,
1313
missing_debug_implementations,
1414
clippy::tests_outside_test_module,
15-
unsafe_op_in_unsafe_fn
15+
unsafe_op_in_unsafe_fn,
16+
clippy::redundant_static_lifetimes
1617
)]
1718

1819
pub const MSR_EFER: u32 = 0xc0000080;
@@ -24,6 +25,15 @@ pub const MSR_FS_BASE: u32 = 0xc0000100;
2425
pub const MSR_GS_BASE: u32 = 0xc0000101;
2526
pub const MSR_KERNEL_GS_BASE: u32 = 0xc0000102;
2627
pub const MSR_TSC_AUX: u32 = 0xc0000103;
28+
pub const MSR_IA32_FRED_RSP0: u32 = 0x1cc;
29+
pub const MSR_IA32_FRED_RSP1: u32 = 0x1cd;
30+
pub const MSR_IA32_FRED_RSP2: u32 = 0x1ce;
31+
pub const MSR_IA32_FRED_RSP3: u32 = 0x1cf;
32+
pub const MSR_IA32_FRED_STKLVLS: u32 = 0x1d0;
33+
pub const MSR_IA32_FRED_SSP1: u32 = 0x1d1;
34+
pub const MSR_IA32_FRED_SSP2: u32 = 0x1d2;
35+
pub const MSR_IA32_FRED_SSP3: u32 = 0x1d3;
36+
pub const MSR_IA32_FRED_CONFIG: u32 = 0x1d4;
2737
pub const MSR_TEST_CTRL: u32 = 0x33;
2838
pub const MSR_TEST_CTRL_SPLIT_LOCK_DETECT_BIT: u32 = 0x1d;
2939
pub const MSR_IA32_SPEC_CTRL: u32 = 0x48;
@@ -38,6 +48,7 @@ pub const MSR_PLATFORM_INFO_CPUID_FAULT_BIT: u32 = 0x1f;
3848
pub const MSR_IA32_UMWAIT_CONTROL: u32 = 0xe1;
3949
pub const MSR_IA32_UMWAIT_CONTROL_TIME_MASK: i32 = -4;
4050
pub const MSR_IA32_CORE_CAPS: u32 = 0xcf;
51+
pub const MSR_IA32_CORE_CAPS_INTEGRITY_CAPS_BIT: u32 = 0x2;
4152
pub const MSR_IA32_CORE_CAPS_SPLIT_LOCK_DETECT_BIT: u32 = 0x5;
4253
pub const MSR_PKG_CST_CONFIG_CONTROL: u32 = 0xe2;
4354
pub const MSR_MTRRcap: u32 = 0xfe;
@@ -53,16 +64,23 @@ pub const MSR_IA32_SYSENTER_EIP: u32 = 0x176;
5364
pub const MSR_IA32_MCG_CAP: u32 = 0x179;
5465
pub const MSR_IA32_MCG_STATUS: u32 = 0x17a;
5566
pub const MSR_IA32_MCG_CTL: u32 = 0x17b;
67+
pub const MSR_ERROR_CONTROL: u32 = 0x17f;
5668
pub const MSR_IA32_MCG_EXT_CTL: u32 = 0x4d0;
5769
pub const MSR_OFFCORE_RSP_0: u32 = 0x1a6;
5870
pub const MSR_OFFCORE_RSP_1: u32 = 0x1a7;
5971
pub const MSR_TURBO_RATIO_LIMIT: u32 = 0x1ad;
6072
pub const MSR_TURBO_RATIO_LIMIT1: u32 = 0x1ae;
6173
pub const MSR_TURBO_RATIO_LIMIT2: u32 = 0x1af;
74+
pub const MSR_SNOOP_RSP_0: u32 = 0x1328;
75+
pub const MSR_SNOOP_RSP_1: u32 = 0x1329;
6276
pub const MSR_LBR_SELECT: u32 = 0x1c8;
6377
pub const MSR_LBR_TOS: u32 = 0x1c9;
6478
pub const MSR_IA32_POWER_CTL: u32 = 0x1fc;
6579
pub const MSR_IA32_POWER_CTL_BIT_EE: u32 = 0x13;
80+
pub const MSR_INTEGRITY_CAPS: u32 = 0x2d9;
81+
pub const MSR_INTEGRITY_CAPS_ARRAY_BIST_BIT: u32 = 0x2;
82+
pub const MSR_INTEGRITY_CAPS_PERIODIC_BIST_BIT: u32 = 0x4;
83+
pub const MSR_INTEGRITY_CAPS_SBAF_BIT: u32 = 0x8;
6684
pub const MSR_LBR_NHM_FROM: u32 = 0x680;
6785
pub const MSR_LBR_NHM_TO: u32 = 0x6c0;
6886
pub const MSR_LBR_CORE_FROM: u32 = 0x40;
@@ -133,6 +151,7 @@ pub const MSR_PKGC7_IRTL: u32 = 0x60c;
133151
pub const MSR_PKGC8_IRTL: u32 = 0x633;
134152
pub const MSR_PKGC9_IRTL: u32 = 0x634;
135153
pub const MSR_PKGC10_IRTL: u32 = 0x635;
154+
pub const MSR_VR_CURRENT_CONFIG: u32 = 0x601;
136155
pub const MSR_RAPL_POWER_UNIT: u32 = 0x606;
137156
pub const MSR_PKG_POWER_LIMIT: u32 = 0x610;
138157
pub const MSR_PKG_ENERGY_STATUS: u32 = 0x611;
@@ -149,14 +168,16 @@ pub const MSR_PP0_PERF_STATUS: u32 = 0x63b;
149168
pub const MSR_PP1_POWER_LIMIT: u32 = 0x640;
150169
pub const MSR_PP1_ENERGY_STATUS: u32 = 0x641;
151170
pub const MSR_PP1_POLICY: u32 = 0x642;
152-
pub const MSR_AMD_PKG_ENERGY_STATUS: u32 = 0xc001029b;
153171
pub const MSR_AMD_RAPL_POWER_UNIT: u32 = 0xc0010299;
172+
pub const MSR_AMD_CORE_ENERGY_STATUS: u32 = 0xc001029a;
173+
pub const MSR_AMD_PKG_ENERGY_STATUS: u32 = 0xc001029b;
154174
pub const MSR_CONFIG_TDP_NOMINAL: u32 = 0x648;
155175
pub const MSR_CONFIG_TDP_LEVEL_1: u32 = 0x649;
156176
pub const MSR_CONFIG_TDP_LEVEL_2: u32 = 0x64a;
157177
pub const MSR_CONFIG_TDP_CONTROL: u32 = 0x64b;
158178
pub const MSR_TURBO_ACTIVATION_RATIO: u32 = 0x64c;
159179
pub const MSR_PLATFORM_ENERGY_STATUS: u32 = 0x64d;
180+
pub const MSR_SECONDARY_TURBO_RATIO_LIMIT: u32 = 0x650;
160181
pub const MSR_PKG_WEIGHTED_CORE_C0_RES: u32 = 0x658;
161182
pub const MSR_PKG_ANY_CORE_C0_RES: u32 = 0x659;
162183
pub const MSR_PKG_ANY_GFXE_C0_RES: u32 = 0x65a;
@@ -172,6 +193,13 @@ pub const MSR_ATOM_CORE_TURBO_VIDS: u32 = 0x66d;
172193
pub const MSR_CORE_PERF_LIMIT_REASONS: u32 = 0x690;
173194
pub const MSR_GFX_PERF_LIMIT_REASONS: u32 = 0x6b0;
174195
pub const MSR_RING_PERF_LIMIT_REASONS: u32 = 0x6b1;
196+
pub const MSR_IA32_U_CET: u32 = 0x6a0;
197+
pub const MSR_IA32_S_CET: u32 = 0x6a2;
198+
pub const MSR_IA32_PL0_SSP: u32 = 0x6a4;
199+
pub const MSR_IA32_PL1_SSP: u32 = 0x6a5;
200+
pub const MSR_IA32_PL2_SSP: u32 = 0x6a6;
201+
pub const MSR_IA32_PL3_SSP: u32 = 0x6a7;
202+
pub const MSR_IA32_INT_SSP_TAB: u32 = 0x6a8;
175203
pub const MSR_PPERF: u32 = 0x64e;
176204
pub const MSR_PERF_LIMIT_REASONS: u32 = 0x64f;
177205
pub const MSR_PM_ENABLE: u32 = 0x770;
@@ -193,6 +221,11 @@ pub const MSR_KNC_EVNTSEL1: u32 = 0x29;
193221
pub const MSR_IA32_PMC0: u32 = 0x4c1;
194222
pub const MSR_RELOAD_PMC0: u32 = 0x14c1;
195223
pub const MSR_RELOAD_FIXED_CTR0: u32 = 0x1309;
224+
pub const MSR_IA32_PMC_V6_GP0_CTR: u32 = 0x1900;
225+
pub const MSR_IA32_PMC_V6_GP0_CFG_A: u32 = 0x1901;
226+
pub const MSR_IA32_PMC_V6_FX0_CTR: u32 = 0x1980;
227+
pub const MSR_IA32_PMC_V6_STEP: u32 = 0x4;
228+
pub const MSR_IA32_MKTME_KEYID_PARTITIONING: u32 = 0x87;
196229
pub const MSR_AMD64_PATCH_LEVEL: u32 = 0x8b;
197230
pub const MSR_AMD64_TSC_RATIO: u32 = 0xc0000104;
198231
pub const MSR_AMD64_NB_CFG: u32 = 0xc001001f;
@@ -204,6 +237,7 @@ pub const MSR_AMD64_OSVW_ID_LENGTH: u32 = 0xc0010140;
204237
pub const MSR_AMD64_OSVW_STATUS: u32 = 0xc0010141;
205238
pub const MSR_AMD_PPIN_CTL: u32 = 0xc00102f0;
206239
pub const MSR_AMD_PPIN: u32 = 0xc00102f1;
240+
pub const MSR_AMD64_CPUID_FN_7: u32 = 0xc0011002;
207241
pub const MSR_AMD64_CPUID_FN_1: u32 = 0xc0011004;
208242
pub const MSR_AMD64_LS_CFG: u32 = 0xc0011020;
209243
pub const MSR_AMD64_DC_CFG: u32 = 0xc0011022;
@@ -231,14 +265,44 @@ pub const MSR_AMD64_IBSBRTARGET: u32 = 0xc001103b;
231265
pub const MSR_AMD64_ICIBSEXTDCTL: u32 = 0xc001103c;
232266
pub const MSR_AMD64_IBSOPDATA4: u32 = 0xc001103d;
233267
pub const MSR_AMD64_IBS_REG_COUNT_MAX: u32 = 0x8;
268+
pub const MSR_AMD64_SVM_AVIC_DOORBELL: u32 = 0xc001011b;
234269
pub const MSR_AMD64_VM_PAGE_FLUSH: u32 = 0xc001011e;
235270
pub const MSR_AMD64_SEV_ES_GHCB: u32 = 0xc0010130;
236271
pub const MSR_AMD64_SEV: u32 = 0xc0010131;
237272
pub const MSR_AMD64_SEV_ENABLED_BIT: u32 = 0x0;
238273
pub const MSR_AMD64_SEV_ES_ENABLED_BIT: u32 = 0x1;
274+
pub const MSR_AMD64_SEV_SNP_ENABLED_BIT: u32 = 0x2;
275+
pub const MSR_AMD64_SNP_VTOM_BIT: u32 = 0x3;
276+
pub const MSR_AMD64_SNP_REFLECT_VC_BIT: u32 = 0x4;
277+
pub const MSR_AMD64_SNP_RESTRICTED_INJ_BIT: u32 = 0x5;
278+
pub const MSR_AMD64_SNP_ALT_INJ_BIT: u32 = 0x6;
279+
pub const MSR_AMD64_SNP_DEBUG_SWAP_BIT: u32 = 0x7;
280+
pub const MSR_AMD64_SNP_PREVENT_HOST_IBS_BIT: u32 = 0x8;
281+
pub const MSR_AMD64_SNP_BTB_ISOLATION_BIT: u32 = 0x9;
282+
pub const MSR_AMD64_SNP_VMPL_SSS_BIT: u32 = 0xa;
283+
pub const MSR_AMD64_SNP_SECURE_TSC_BIT: u32 = 0xb;
284+
pub const MSR_AMD64_SNP_VMGEXIT_PARAM_BIT: u32 = 0xc;
285+
pub const MSR_AMD64_SNP_IBS_VIRT_BIT: u32 = 0xe;
286+
pub const MSR_AMD64_SNP_VMSA_REG_PROT_BIT: u32 = 0x10;
287+
pub const MSR_AMD64_SNP_SMT_PROT_BIT: u32 = 0x11;
288+
pub const MSR_AMD64_SNP_RESV_BIT: u32 = 0x12;
239289
pub const MSR_AMD64_VIRT_SPEC_CTRL: u32 = 0xc001011f;
290+
pub const MSR_AMD64_RMP_BASE: u32 = 0xc0010132;
291+
pub const MSR_AMD64_RMP_END: u32 = 0xc0010133;
292+
pub const MSR_SVSM_CAA: u32 = 0xc001f000;
293+
pub const MSR_AMD_CPPC_CAP1: u32 = 0xc00102b0;
294+
pub const MSR_AMD_CPPC_ENABLE: u32 = 0xc00102b1;
295+
pub const MSR_AMD_CPPC_CAP2: u32 = 0xc00102b2;
296+
pub const MSR_AMD_CPPC_REQ: u32 = 0xc00102b3;
297+
pub const MSR_AMD_CPPC_STATUS: u32 = 0xc00102b4;
298+
pub const MSR_AMD64_PERF_CNTR_GLOBAL_STATUS: u32 = 0xc0000300;
299+
pub const MSR_AMD64_PERF_CNTR_GLOBAL_CTL: u32 = 0xc0000301;
300+
pub const MSR_AMD64_PERF_CNTR_GLOBAL_STATUS_CLR: u32 = 0xc0000302;
301+
pub const MSR_AMD64_LBR_SELECT: u32 = 0xc000010e;
240302
pub const MSR_ZEN4_BP_CFG: u32 = 0xc001102e;
241303
pub const MSR_ZEN4_BP_CFG_SHARED_BTB_FIX_BIT: u32 = 0x5;
304+
pub const MSR_F19H_UMC_PERF_CTL: u32 = 0xc0010800;
305+
pub const MSR_F19H_UMC_PERF_CTR: u32 = 0xc0010801;
242306
pub const MSR_ZEN2_SPECTRAL_CHICKEN: u32 = 0xc00110e3;
243307
pub const MSR_F17H_IRPERF: u32 = 0xc00000e9;
244308
pub const MSR_F16H_L2I_PERF_CTL: u32 = 0xc0010230;
@@ -272,8 +336,11 @@ pub const MSR_FAM10H_MMIO_CONF_BASE: u32 = 0xc0010058;
272336
pub const MSR_FAM10H_NODE_ID: u32 = 0xc001100c;
273337
pub const MSR_K8_TOP_MEM1: u32 = 0xc001001a;
274338
pub const MSR_K8_TOP_MEM2: u32 = 0xc001001d;
275-
pub const MSR_K8_SYSCFG: u32 = 0xc0010010;
276-
pub const MSR_K8_SYSCFG_MEM_ENCRYPT_BIT: u32 = 0x17;
339+
pub const MSR_AMD64_SYSCFG: u32 = 0xc0010010;
340+
pub const MSR_AMD64_SYSCFG_MEM_ENCRYPT_BIT: u32 = 0x17;
341+
pub const MSR_AMD64_SYSCFG_SNP_EN_BIT: u32 = 0x18;
342+
pub const MSR_AMD64_SYSCFG_SNP_VMPL_EN_BIT: u32 = 0x19;
343+
pub const MSR_AMD64_SYSCFG_MFDM_BIT: u32 = 0x13;
277344
pub const MSR_K8_INT_PENDING_MSG: u32 = 0xc0010055;
278345
pub const MSR_K8_TSEG_ADDR: u32 = 0xc0010112;
279346
pub const MSR_K8_TSEG_MASK: u32 = 0xc0010113;
@@ -291,6 +358,7 @@ pub const MSR_K7_HWCR_SMMLOCK_BIT: u32 = 0x0;
291358
pub const MSR_K7_HWCR_IRPERF_EN_BIT: u32 = 0x1e;
292359
pub const MSR_K7_FID_VID_CTL: u32 = 0xc0010041;
293360
pub const MSR_K7_FID_VID_STATUS: u32 = 0xc0010042;
361+
pub const MSR_K7_HWCR_CPB_DIS_BIT: u32 = 0x19;
294362
pub const MSR_K6_WHCR: u32 = 0xc0000082;
295363
pub const MSR_K6_UWCCR: u32 = 0xc0000085;
296364
pub const MSR_K6_EPMR: u32 = 0xc0000086;
@@ -328,18 +396,25 @@ pub const MSR_IA32_FEAT_CTL: u32 = 0x3a;
328396
pub const MSR_IA32_TSC_ADJUST: u32 = 0x3b;
329397
pub const MSR_IA32_BNDCFGS: u32 = 0xd90;
330398
pub const MSR_IA32_BNDCFGS_RSVD: u32 = 0xffc;
399+
pub const MSR_IA32_XFD: u32 = 0x1c4;
400+
pub const MSR_IA32_XFD_ERR: u32 = 0x1c5;
331401
pub const MSR_IA32_XSS: u32 = 0xda0;
332402
pub const MSR_IA32_APICBASE: u32 = 0x1b;
333403
pub const MSR_IA32_APICBASE_BSP: u32 = 0x100;
334404
pub const MSR_IA32_APICBASE_ENABLE: u32 = 0x800;
335405
pub const MSR_IA32_APICBASE_BASE: u32 = 0xfffff000;
336-
pub const MSR_IA32_TSCDEADLINE: u32 = 0x6e0;
337406
pub const MSR_IA32_UCODE_WRITE: u32 = 0x79;
338407
pub const MSR_IA32_UCODE_REV: u32 = 0x8b;
408+
pub const MSR_IA32_SGXLEPUBKEYHASH0: u32 = 0x8c;
409+
pub const MSR_IA32_SGXLEPUBKEYHASH1: u32 = 0x8d;
410+
pub const MSR_IA32_SGXLEPUBKEYHASH2: u32 = 0x8e;
411+
pub const MSR_IA32_SGXLEPUBKEYHASH3: u32 = 0x8f;
339412
pub const MSR_IA32_SMM_MONITOR_CTL: u32 = 0x9b;
340413
pub const MSR_IA32_SMBASE: u32 = 0x9e;
341414
pub const MSR_IA32_PERF_STATUS: u32 = 0x198;
342415
pub const MSR_IA32_PERF_CTL: u32 = 0x199;
416+
pub const MSR_AMD_DBG_EXTN_CFG: u32 = 0xc000010f;
417+
pub const MSR_AMD_SAMP_BR_FROM: u32 = 0xc0010300;
343418
pub const MSR_IA32_MPERF: u32 = 0xe7;
344419
pub const MSR_IA32_APERF: u32 = 0xe8;
345420
pub const MSR_IA32_THERM_CONTROL: u32 = 0x19a;
@@ -410,6 +485,8 @@ pub const MSR_MISC_FEATURES_ENABLES_RING3MWAIT_BIT: u32 = 0x1;
410485
pub const MSR_IA32_TSC_DEADLINE: u32 = 0x6e0;
411486
pub const MSR_TSX_FORCE_ABORT: u32 = 0x10f;
412487
pub const MSR_TFA_RTM_FORCE_ABORT_BIT: u32 = 0x0;
488+
pub const MSR_TFA_TSX_CPUID_CLEAR_BIT: u32 = 0x1;
489+
pub const MSR_TFA_SDV_ENABLE_RTM_BIT: u32 = 0x2;
413490
pub const MSR_IA32_MCG_EAX: u32 = 0x180;
414491
pub const MSR_IA32_MCG_EBX: u32 = 0x181;
415492
pub const MSR_IA32_MCG_ECX: u32 = 0x182;
@@ -538,9 +615,22 @@ pub const MSR_IA32_VMX_TRUE_PROCBASED_CTLS: u32 = 0x48e;
538615
pub const MSR_IA32_VMX_TRUE_EXIT_CTLS: u32 = 0x48f;
539616
pub const MSR_IA32_VMX_TRUE_ENTRY_CTLS: u32 = 0x490;
540617
pub const MSR_IA32_VMX_VMFUNC: u32 = 0x491;
541-
pub const MSR_IA32_VMX_MISC_INTEL_PT: u32 = 0x4000;
542-
pub const MSR_IA32_VMX_MISC_VMWRITE_SHADOW_RO_FIELDS: u32 = 0x20000000;
543-
pub const MSR_IA32_VMX_MISC_PREEMPTION_TIMER_SCALE: u32 = 0x1f;
618+
pub const MSR_IA32_VMX_PROCBASED_CTLS3: u32 = 0x492;
619+
pub const MSR_IA32_L3_QOS_CFG: u32 = 0xc81;
620+
pub const MSR_IA32_L2_QOS_CFG: u32 = 0xc82;
621+
pub const MSR_IA32_QM_EVTSEL: u32 = 0xc8d;
622+
pub const MSR_IA32_QM_CTR: u32 = 0xc8e;
623+
pub const MSR_IA32_PQR_ASSOC: u32 = 0xc8f;
624+
pub const MSR_IA32_L3_CBM_BASE: u32 = 0xc90;
625+
pub const MSR_RMID_SNC_CONFIG: u32 = 0xca0;
626+
pub const MSR_IA32_L2_CBM_BASE: u32 = 0xd10;
627+
pub const MSR_IA32_MBA_THRTL_BASE: u32 = 0xd50;
628+
pub const MSR_IA32_MBA_BW_BASE: u32 = 0xc0000200;
629+
pub const MSR_IA32_SMBA_BW_BASE: u32 = 0xc0000280;
630+
pub const MSR_IA32_EVT_CFG_BASE: u32 = 0xc0000400;
544631
pub const MSR_VM_CR: u32 = 0xc0010114;
545632
pub const MSR_VM_IGNNE: u32 = 0xc0010115;
546633
pub const MSR_VM_HSAVE_PA: u32 = 0xc0010117;
634+
pub const MSR_IA32_HW_FEEDBACK_PTR: u32 = 0x17d0;
635+
pub const MSR_IA32_HW_FEEDBACK_CONFIG: u32 = 0x17d1;
636+
pub const MSR_IA32_XAPIC_DISABLE_STATUS: u32 = 0xbd;

src/vmm/src/arch/x86_64/generated/perf_event.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
clippy::undocumented_unsafe_blocks,
1313
missing_debug_implementations,
1414
clippy::tests_outside_test_module,
15-
unsafe_op_in_unsafe_fn
15+
unsafe_op_in_unsafe_fn,
16+
clippy::redundant_static_lifetimes
1617
)]
1718

1819
pub const MSR_ARCH_PERFMON_PERFCTR0: u32 = 0xc1;

0 commit comments

Comments
 (0)