diff --git a/src/firecracker/src/generated/prctl.rs b/src/firecracker/src/generated/prctl.rs index c4c15df92d3..909bf00f822 100644 --- a/src/firecracker/src/generated/prctl.rs +++ b/src/firecracker/src/generated/prctl.rs @@ -12,7 +12,8 @@ clippy::undocumented_unsafe_blocks, missing_debug_implementations, clippy::tests_outside_test_module, - unsafe_op_in_unsafe_fn + unsafe_op_in_unsafe_fn, + clippy::redundant_static_lifetimes )] pub const PR_SET_PDEATHSIG: u32 = 1; @@ -179,3 +180,20 @@ pub const PR_RISCV_V_VSTATE_CTRL_INHERIT: u32 = 16; pub const PR_RISCV_V_VSTATE_CTRL_CUR_MASK: u32 = 3; pub const PR_RISCV_V_VSTATE_CTRL_NEXT_MASK: u32 = 12; pub const PR_RISCV_V_VSTATE_CTRL_MASK: u32 = 31; +pub const PR_RISCV_SET_ICACHE_FLUSH_CTX: u32 = 71; +pub const PR_RISCV_CTX_SW_FENCEI_ON: u32 = 0; +pub const PR_RISCV_CTX_SW_FENCEI_OFF: u32 = 1; +pub const PR_RISCV_SCOPE_PER_PROCESS: u32 = 0; +pub const PR_RISCV_SCOPE_PER_THREAD: u32 = 1; +pub const PR_PPC_GET_DEXCR: u32 = 72; +pub const PR_PPC_SET_DEXCR: u32 = 73; +pub const PR_PPC_DEXCR_SBHE: u32 = 0; +pub const PR_PPC_DEXCR_IBRTPD: u32 = 1; +pub const PR_PPC_DEXCR_SRAPD: u32 = 2; +pub const PR_PPC_DEXCR_NPHIE: u32 = 3; +pub const PR_PPC_DEXCR_CTRL_EDITABLE: u32 = 1; +pub const PR_PPC_DEXCR_CTRL_SET: u32 = 2; +pub const PR_PPC_DEXCR_CTRL_CLEAR: u32 = 4; +pub const PR_PPC_DEXCR_CTRL_SET_ONEXEC: u32 = 8; +pub const PR_PPC_DEXCR_CTRL_CLEAR_ONEXEC: u32 = 16; +pub const PR_PPC_DEXCR_CTRL_MASK: u32 = 31; diff --git a/src/vmm/src/arch/x86_64/generated/arch_prctl.rs b/src/vmm/src/arch/x86_64/generated/arch_prctl.rs index 44f68883141..0d43ed64e7c 100644 --- a/src/vmm/src/arch/x86_64/generated/arch_prctl.rs +++ b/src/vmm/src/arch/x86_64/generated/arch_prctl.rs @@ -12,7 +12,8 @@ clippy::undocumented_unsafe_blocks, missing_debug_implementations, clippy::tests_outside_test_module, - unsafe_op_in_unsafe_fn + unsafe_op_in_unsafe_fn, + clippy::redundant_static_lifetimes )] pub const ARCH_SET_GS: u32 = 4097; diff --git a/src/vmm/src/arch/x86_64/generated/hyperv.rs b/src/vmm/src/arch/x86_64/generated/hyperv.rs index 49dabeaca92..b25473f14c9 100644 --- a/src/vmm/src/arch/x86_64/generated/hyperv.rs +++ b/src/vmm/src/arch/x86_64/generated/hyperv.rs @@ -12,7 +12,8 @@ clippy::undocumented_unsafe_blocks, missing_debug_implementations, clippy::tests_outside_test_module, - unsafe_op_in_unsafe_fn + unsafe_op_in_unsafe_fn, + clippy::redundant_static_lifetimes )] pub const HV_X64_MSR_SYNDBG_CONTROL: u32 = 0x400000f1; diff --git a/src/vmm/src/arch/x86_64/generated/hyperv_tlfs.rs b/src/vmm/src/arch/x86_64/generated/hyperv_tlfs.rs index fae4d497142..cf5aa32c24a 100644 --- a/src/vmm/src/arch/x86_64/generated/hyperv_tlfs.rs +++ b/src/vmm/src/arch/x86_64/generated/hyperv_tlfs.rs @@ -12,7 +12,8 @@ clippy::undocumented_unsafe_blocks, missing_debug_implementations, clippy::tests_outside_test_module, - unsafe_op_in_unsafe_fn + unsafe_op_in_unsafe_fn, + clippy::redundant_static_lifetimes )] pub const HV_X64_MSR_GUEST_OS_ID: u32 = 0x40000000; @@ -49,6 +50,12 @@ pub const HV_X64_MSR_SINT12: u32 = 0x4000009c; pub const HV_X64_MSR_SINT13: u32 = 0x4000009d; pub const HV_X64_MSR_SINT14: u32 = 0x4000009e; pub const HV_X64_MSR_SINT15: u32 = 0x4000009f; +pub const HV_X64_MSR_NESTED_SCONTROL: u32 = 0x40001080; +pub const HV_X64_MSR_NESTED_SVERSION: u32 = 0x40001081; +pub const HV_X64_MSR_NESTED_SIEFP: u32 = 0x40001082; +pub const HV_X64_MSR_NESTED_SIMP: u32 = 0x40001083; +pub const HV_X64_MSR_NESTED_EOM: u32 = 0x40001084; +pub const HV_X64_MSR_NESTED_SINT0: u32 = 0x40001090; pub const HV_X64_MSR_STIMER0_CONFIG: u32 = 0x400000b0; pub const HV_X64_MSR_STIMER0_COUNT: u32 = 0x400000b1; pub const HV_X64_MSR_STIMER1_CONFIG: u32 = 0x400000b2; diff --git a/src/vmm/src/arch/x86_64/generated/mpspec.rs b/src/vmm/src/arch/x86_64/generated/mpspec.rs index 38252548367..80b7b3e5170 100644 --- a/src/vmm/src/arch/x86_64/generated/mpspec.rs +++ b/src/vmm/src/arch/x86_64/generated/mpspec.rs @@ -12,7 +12,8 @@ clippy::undocumented_unsafe_blocks, missing_debug_implementations, clippy::tests_outside_test_module, - unsafe_op_in_unsafe_fn + unsafe_op_in_unsafe_fn, + clippy::redundant_static_lifetimes )] pub const MPC_SIGNATURE: &[u8; 5] = b"PCMP\0"; @@ -205,11 +206,13 @@ const _: () = { ["Offset of field: mpc_intsrc::dstapic"][::std::mem::offset_of!(mpc_intsrc, dstapic) - 6usize]; ["Offset of field: mpc_intsrc::dstirq"][::std::mem::offset_of!(mpc_intsrc, dstirq) - 7usize]; }; -pub const mp_irq_source_types_mp_INT: mp_irq_source_types = 0; -pub const mp_irq_source_types_mp_NMI: mp_irq_source_types = 1; -pub const mp_irq_source_types_mp_SMI: mp_irq_source_types = 2; -pub const mp_irq_source_types_mp_ExtINT: mp_irq_source_types = 3; -pub type mp_irq_source_types = ::std::os::raw::c_uint; +pub mod mp_irq_source_types { + pub type Type = ::std::os::raw::c_uint; + pub const mp_INT: Type = 0; + pub const mp_NMI: Type = 1; + pub const mp_SMI: Type = 2; + pub const mp_ExtINT: Type = 3; +} #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct mpc_lintsrc { @@ -261,7 +264,9 @@ const _: () = { [::std::mem::offset_of!(mpc_oemtable, checksum) - 7usize]; ["Offset of field: mpc_oemtable::mpc"][::std::mem::offset_of!(mpc_oemtable, mpc) - 8usize]; }; -pub const mp_bustype_MP_BUS_ISA: mp_bustype = 1; -pub const mp_bustype_MP_BUS_EISA: mp_bustype = 2; -pub const mp_bustype_MP_BUS_PCI: mp_bustype = 3; -pub type mp_bustype = ::std::os::raw::c_uint; +pub mod mp_bustype { + pub type Type = ::std::os::raw::c_uint; + pub const MP_BUS_ISA: Type = 1; + pub const MP_BUS_EISA: Type = 2; + pub const MP_BUS_PCI: Type = 3; +} diff --git a/src/vmm/src/arch/x86_64/generated/msr_index.rs b/src/vmm/src/arch/x86_64/generated/msr_index.rs index 041bffe7ec3..ccdceeac8d4 100644 --- a/src/vmm/src/arch/x86_64/generated/msr_index.rs +++ b/src/vmm/src/arch/x86_64/generated/msr_index.rs @@ -12,7 +12,8 @@ clippy::undocumented_unsafe_blocks, missing_debug_implementations, clippy::tests_outside_test_module, - unsafe_op_in_unsafe_fn + unsafe_op_in_unsafe_fn, + clippy::redundant_static_lifetimes )] pub const MSR_EFER: u32 = 0xc0000080; @@ -24,6 +25,15 @@ pub const MSR_FS_BASE: u32 = 0xc0000100; pub const MSR_GS_BASE: u32 = 0xc0000101; pub const MSR_KERNEL_GS_BASE: u32 = 0xc0000102; pub const MSR_TSC_AUX: u32 = 0xc0000103; +pub const MSR_IA32_FRED_RSP0: u32 = 0x1cc; +pub const MSR_IA32_FRED_RSP1: u32 = 0x1cd; +pub const MSR_IA32_FRED_RSP2: u32 = 0x1ce; +pub const MSR_IA32_FRED_RSP3: u32 = 0x1cf; +pub const MSR_IA32_FRED_STKLVLS: u32 = 0x1d0; +pub const MSR_IA32_FRED_SSP1: u32 = 0x1d1; +pub const MSR_IA32_FRED_SSP2: u32 = 0x1d2; +pub const MSR_IA32_FRED_SSP3: u32 = 0x1d3; +pub const MSR_IA32_FRED_CONFIG: u32 = 0x1d4; pub const MSR_TEST_CTRL: u32 = 0x33; pub const MSR_TEST_CTRL_SPLIT_LOCK_DETECT_BIT: u32 = 0x1d; pub const MSR_IA32_SPEC_CTRL: u32 = 0x48; @@ -38,6 +48,7 @@ pub const MSR_PLATFORM_INFO_CPUID_FAULT_BIT: u32 = 0x1f; pub const MSR_IA32_UMWAIT_CONTROL: u32 = 0xe1; pub const MSR_IA32_UMWAIT_CONTROL_TIME_MASK: i32 = -4; pub const MSR_IA32_CORE_CAPS: u32 = 0xcf; +pub const MSR_IA32_CORE_CAPS_INTEGRITY_CAPS_BIT: u32 = 0x2; pub const MSR_IA32_CORE_CAPS_SPLIT_LOCK_DETECT_BIT: u32 = 0x5; pub const MSR_PKG_CST_CONFIG_CONTROL: u32 = 0xe2; pub const MSR_MTRRcap: u32 = 0xfe; @@ -53,16 +64,23 @@ pub const MSR_IA32_SYSENTER_EIP: u32 = 0x176; pub const MSR_IA32_MCG_CAP: u32 = 0x179; pub const MSR_IA32_MCG_STATUS: u32 = 0x17a; pub const MSR_IA32_MCG_CTL: u32 = 0x17b; +pub const MSR_ERROR_CONTROL: u32 = 0x17f; pub const MSR_IA32_MCG_EXT_CTL: u32 = 0x4d0; pub const MSR_OFFCORE_RSP_0: u32 = 0x1a6; pub const MSR_OFFCORE_RSP_1: u32 = 0x1a7; pub const MSR_TURBO_RATIO_LIMIT: u32 = 0x1ad; pub const MSR_TURBO_RATIO_LIMIT1: u32 = 0x1ae; pub const MSR_TURBO_RATIO_LIMIT2: u32 = 0x1af; +pub const MSR_SNOOP_RSP_0: u32 = 0x1328; +pub const MSR_SNOOP_RSP_1: u32 = 0x1329; pub const MSR_LBR_SELECT: u32 = 0x1c8; pub const MSR_LBR_TOS: u32 = 0x1c9; pub const MSR_IA32_POWER_CTL: u32 = 0x1fc; pub const MSR_IA32_POWER_CTL_BIT_EE: u32 = 0x13; +pub const MSR_INTEGRITY_CAPS: u32 = 0x2d9; +pub const MSR_INTEGRITY_CAPS_ARRAY_BIST_BIT: u32 = 0x2; +pub const MSR_INTEGRITY_CAPS_PERIODIC_BIST_BIT: u32 = 0x4; +pub const MSR_INTEGRITY_CAPS_SBAF_BIT: u32 = 0x8; pub const MSR_LBR_NHM_FROM: u32 = 0x680; pub const MSR_LBR_NHM_TO: u32 = 0x6c0; pub const MSR_LBR_CORE_FROM: u32 = 0x40; @@ -133,6 +151,7 @@ pub const MSR_PKGC7_IRTL: u32 = 0x60c; pub const MSR_PKGC8_IRTL: u32 = 0x633; pub const MSR_PKGC9_IRTL: u32 = 0x634; pub const MSR_PKGC10_IRTL: u32 = 0x635; +pub const MSR_VR_CURRENT_CONFIG: u32 = 0x601; pub const MSR_RAPL_POWER_UNIT: u32 = 0x606; pub const MSR_PKG_POWER_LIMIT: u32 = 0x610; pub const MSR_PKG_ENERGY_STATUS: u32 = 0x611; @@ -149,14 +168,16 @@ pub const MSR_PP0_PERF_STATUS: u32 = 0x63b; pub const MSR_PP1_POWER_LIMIT: u32 = 0x640; pub const MSR_PP1_ENERGY_STATUS: u32 = 0x641; pub const MSR_PP1_POLICY: u32 = 0x642; -pub const MSR_AMD_PKG_ENERGY_STATUS: u32 = 0xc001029b; pub const MSR_AMD_RAPL_POWER_UNIT: u32 = 0xc0010299; +pub const MSR_AMD_CORE_ENERGY_STATUS: u32 = 0xc001029a; +pub const MSR_AMD_PKG_ENERGY_STATUS: u32 = 0xc001029b; pub const MSR_CONFIG_TDP_NOMINAL: u32 = 0x648; pub const MSR_CONFIG_TDP_LEVEL_1: u32 = 0x649; pub const MSR_CONFIG_TDP_LEVEL_2: u32 = 0x64a; pub const MSR_CONFIG_TDP_CONTROL: u32 = 0x64b; pub const MSR_TURBO_ACTIVATION_RATIO: u32 = 0x64c; pub const MSR_PLATFORM_ENERGY_STATUS: u32 = 0x64d; +pub const MSR_SECONDARY_TURBO_RATIO_LIMIT: u32 = 0x650; pub const MSR_PKG_WEIGHTED_CORE_C0_RES: u32 = 0x658; pub const MSR_PKG_ANY_CORE_C0_RES: u32 = 0x659; pub const MSR_PKG_ANY_GFXE_C0_RES: u32 = 0x65a; @@ -172,6 +193,13 @@ pub const MSR_ATOM_CORE_TURBO_VIDS: u32 = 0x66d; pub const MSR_CORE_PERF_LIMIT_REASONS: u32 = 0x690; pub const MSR_GFX_PERF_LIMIT_REASONS: u32 = 0x6b0; pub const MSR_RING_PERF_LIMIT_REASONS: u32 = 0x6b1; +pub const MSR_IA32_U_CET: u32 = 0x6a0; +pub const MSR_IA32_S_CET: u32 = 0x6a2; +pub const MSR_IA32_PL0_SSP: u32 = 0x6a4; +pub const MSR_IA32_PL1_SSP: u32 = 0x6a5; +pub const MSR_IA32_PL2_SSP: u32 = 0x6a6; +pub const MSR_IA32_PL3_SSP: u32 = 0x6a7; +pub const MSR_IA32_INT_SSP_TAB: u32 = 0x6a8; pub const MSR_PPERF: u32 = 0x64e; pub const MSR_PERF_LIMIT_REASONS: u32 = 0x64f; pub const MSR_PM_ENABLE: u32 = 0x770; @@ -193,6 +221,11 @@ pub const MSR_KNC_EVNTSEL1: u32 = 0x29; pub const MSR_IA32_PMC0: u32 = 0x4c1; pub const MSR_RELOAD_PMC0: u32 = 0x14c1; pub const MSR_RELOAD_FIXED_CTR0: u32 = 0x1309; +pub const MSR_IA32_PMC_V6_GP0_CTR: u32 = 0x1900; +pub const MSR_IA32_PMC_V6_GP0_CFG_A: u32 = 0x1901; +pub const MSR_IA32_PMC_V6_FX0_CTR: u32 = 0x1980; +pub const MSR_IA32_PMC_V6_STEP: u32 = 0x4; +pub const MSR_IA32_MKTME_KEYID_PARTITIONING: u32 = 0x87; pub const MSR_AMD64_PATCH_LEVEL: u32 = 0x8b; pub const MSR_AMD64_TSC_RATIO: u32 = 0xc0000104; pub const MSR_AMD64_NB_CFG: u32 = 0xc001001f; @@ -204,6 +237,7 @@ pub const MSR_AMD64_OSVW_ID_LENGTH: u32 = 0xc0010140; pub const MSR_AMD64_OSVW_STATUS: u32 = 0xc0010141; pub const MSR_AMD_PPIN_CTL: u32 = 0xc00102f0; pub const MSR_AMD_PPIN: u32 = 0xc00102f1; +pub const MSR_AMD64_CPUID_FN_7: u32 = 0xc0011002; pub const MSR_AMD64_CPUID_FN_1: u32 = 0xc0011004; pub const MSR_AMD64_LS_CFG: u32 = 0xc0011020; pub const MSR_AMD64_DC_CFG: u32 = 0xc0011022; @@ -231,14 +265,44 @@ pub const MSR_AMD64_IBSBRTARGET: u32 = 0xc001103b; pub const MSR_AMD64_ICIBSEXTDCTL: u32 = 0xc001103c; pub const MSR_AMD64_IBSOPDATA4: u32 = 0xc001103d; pub const MSR_AMD64_IBS_REG_COUNT_MAX: u32 = 0x8; +pub const MSR_AMD64_SVM_AVIC_DOORBELL: u32 = 0xc001011b; pub const MSR_AMD64_VM_PAGE_FLUSH: u32 = 0xc001011e; pub const MSR_AMD64_SEV_ES_GHCB: u32 = 0xc0010130; pub const MSR_AMD64_SEV: u32 = 0xc0010131; pub const MSR_AMD64_SEV_ENABLED_BIT: u32 = 0x0; pub const MSR_AMD64_SEV_ES_ENABLED_BIT: u32 = 0x1; +pub const MSR_AMD64_SEV_SNP_ENABLED_BIT: u32 = 0x2; +pub const MSR_AMD64_SNP_VTOM_BIT: u32 = 0x3; +pub const MSR_AMD64_SNP_REFLECT_VC_BIT: u32 = 0x4; +pub const MSR_AMD64_SNP_RESTRICTED_INJ_BIT: u32 = 0x5; +pub const MSR_AMD64_SNP_ALT_INJ_BIT: u32 = 0x6; +pub const MSR_AMD64_SNP_DEBUG_SWAP_BIT: u32 = 0x7; +pub const MSR_AMD64_SNP_PREVENT_HOST_IBS_BIT: u32 = 0x8; +pub const MSR_AMD64_SNP_BTB_ISOLATION_BIT: u32 = 0x9; +pub const MSR_AMD64_SNP_VMPL_SSS_BIT: u32 = 0xa; +pub const MSR_AMD64_SNP_SECURE_TSC_BIT: u32 = 0xb; +pub const MSR_AMD64_SNP_VMGEXIT_PARAM_BIT: u32 = 0xc; +pub const MSR_AMD64_SNP_IBS_VIRT_BIT: u32 = 0xe; +pub const MSR_AMD64_SNP_VMSA_REG_PROT_BIT: u32 = 0x10; +pub const MSR_AMD64_SNP_SMT_PROT_BIT: u32 = 0x11; +pub const MSR_AMD64_SNP_RESV_BIT: u32 = 0x12; pub const MSR_AMD64_VIRT_SPEC_CTRL: u32 = 0xc001011f; +pub const MSR_AMD64_RMP_BASE: u32 = 0xc0010132; +pub const MSR_AMD64_RMP_END: u32 = 0xc0010133; +pub const MSR_SVSM_CAA: u32 = 0xc001f000; +pub const MSR_AMD_CPPC_CAP1: u32 = 0xc00102b0; +pub const MSR_AMD_CPPC_ENABLE: u32 = 0xc00102b1; +pub const MSR_AMD_CPPC_CAP2: u32 = 0xc00102b2; +pub const MSR_AMD_CPPC_REQ: u32 = 0xc00102b3; +pub const MSR_AMD_CPPC_STATUS: u32 = 0xc00102b4; +pub const MSR_AMD64_PERF_CNTR_GLOBAL_STATUS: u32 = 0xc0000300; +pub const MSR_AMD64_PERF_CNTR_GLOBAL_CTL: u32 = 0xc0000301; +pub const MSR_AMD64_PERF_CNTR_GLOBAL_STATUS_CLR: u32 = 0xc0000302; +pub const MSR_AMD64_LBR_SELECT: u32 = 0xc000010e; pub const MSR_ZEN4_BP_CFG: u32 = 0xc001102e; pub const MSR_ZEN4_BP_CFG_SHARED_BTB_FIX_BIT: u32 = 0x5; +pub const MSR_F19H_UMC_PERF_CTL: u32 = 0xc0010800; +pub const MSR_F19H_UMC_PERF_CTR: u32 = 0xc0010801; pub const MSR_ZEN2_SPECTRAL_CHICKEN: u32 = 0xc00110e3; pub const MSR_F17H_IRPERF: u32 = 0xc00000e9; pub const MSR_F16H_L2I_PERF_CTL: u32 = 0xc0010230; @@ -272,8 +336,11 @@ pub const MSR_FAM10H_MMIO_CONF_BASE: u32 = 0xc0010058; pub const MSR_FAM10H_NODE_ID: u32 = 0xc001100c; pub const MSR_K8_TOP_MEM1: u32 = 0xc001001a; pub const MSR_K8_TOP_MEM2: u32 = 0xc001001d; -pub const MSR_K8_SYSCFG: u32 = 0xc0010010; -pub const MSR_K8_SYSCFG_MEM_ENCRYPT_BIT: u32 = 0x17; +pub const MSR_AMD64_SYSCFG: u32 = 0xc0010010; +pub const MSR_AMD64_SYSCFG_MEM_ENCRYPT_BIT: u32 = 0x17; +pub const MSR_AMD64_SYSCFG_SNP_EN_BIT: u32 = 0x18; +pub const MSR_AMD64_SYSCFG_SNP_VMPL_EN_BIT: u32 = 0x19; +pub const MSR_AMD64_SYSCFG_MFDM_BIT: u32 = 0x13; pub const MSR_K8_INT_PENDING_MSG: u32 = 0xc0010055; pub const MSR_K8_TSEG_ADDR: u32 = 0xc0010112; pub const MSR_K8_TSEG_MASK: u32 = 0xc0010113; @@ -291,6 +358,7 @@ pub const MSR_K7_HWCR_SMMLOCK_BIT: u32 = 0x0; pub const MSR_K7_HWCR_IRPERF_EN_BIT: u32 = 0x1e; pub const MSR_K7_FID_VID_CTL: u32 = 0xc0010041; pub const MSR_K7_FID_VID_STATUS: u32 = 0xc0010042; +pub const MSR_K7_HWCR_CPB_DIS_BIT: u32 = 0x19; pub const MSR_K6_WHCR: u32 = 0xc0000082; pub const MSR_K6_UWCCR: u32 = 0xc0000085; pub const MSR_K6_EPMR: u32 = 0xc0000086; @@ -328,18 +396,25 @@ pub const MSR_IA32_FEAT_CTL: u32 = 0x3a; pub const MSR_IA32_TSC_ADJUST: u32 = 0x3b; pub const MSR_IA32_BNDCFGS: u32 = 0xd90; pub const MSR_IA32_BNDCFGS_RSVD: u32 = 0xffc; +pub const MSR_IA32_XFD: u32 = 0x1c4; +pub const MSR_IA32_XFD_ERR: u32 = 0x1c5; pub const MSR_IA32_XSS: u32 = 0xda0; pub const MSR_IA32_APICBASE: u32 = 0x1b; pub const MSR_IA32_APICBASE_BSP: u32 = 0x100; pub const MSR_IA32_APICBASE_ENABLE: u32 = 0x800; pub const MSR_IA32_APICBASE_BASE: u32 = 0xfffff000; -pub const MSR_IA32_TSCDEADLINE: u32 = 0x6e0; pub const MSR_IA32_UCODE_WRITE: u32 = 0x79; pub const MSR_IA32_UCODE_REV: u32 = 0x8b; +pub const MSR_IA32_SGXLEPUBKEYHASH0: u32 = 0x8c; +pub const MSR_IA32_SGXLEPUBKEYHASH1: u32 = 0x8d; +pub const MSR_IA32_SGXLEPUBKEYHASH2: u32 = 0x8e; +pub const MSR_IA32_SGXLEPUBKEYHASH3: u32 = 0x8f; pub const MSR_IA32_SMM_MONITOR_CTL: u32 = 0x9b; pub const MSR_IA32_SMBASE: u32 = 0x9e; pub const MSR_IA32_PERF_STATUS: u32 = 0x198; pub const MSR_IA32_PERF_CTL: u32 = 0x199; +pub const MSR_AMD_DBG_EXTN_CFG: u32 = 0xc000010f; +pub const MSR_AMD_SAMP_BR_FROM: u32 = 0xc0010300; pub const MSR_IA32_MPERF: u32 = 0xe7; pub const MSR_IA32_APERF: u32 = 0xe8; pub const MSR_IA32_THERM_CONTROL: u32 = 0x19a; @@ -410,6 +485,8 @@ pub const MSR_MISC_FEATURES_ENABLES_RING3MWAIT_BIT: u32 = 0x1; pub const MSR_IA32_TSC_DEADLINE: u32 = 0x6e0; pub const MSR_TSX_FORCE_ABORT: u32 = 0x10f; pub const MSR_TFA_RTM_FORCE_ABORT_BIT: u32 = 0x0; +pub const MSR_TFA_TSX_CPUID_CLEAR_BIT: u32 = 0x1; +pub const MSR_TFA_SDV_ENABLE_RTM_BIT: u32 = 0x2; pub const MSR_IA32_MCG_EAX: u32 = 0x180; pub const MSR_IA32_MCG_EBX: u32 = 0x181; pub const MSR_IA32_MCG_ECX: u32 = 0x182; @@ -538,9 +615,22 @@ pub const MSR_IA32_VMX_TRUE_PROCBASED_CTLS: u32 = 0x48e; pub const MSR_IA32_VMX_TRUE_EXIT_CTLS: u32 = 0x48f; pub const MSR_IA32_VMX_TRUE_ENTRY_CTLS: u32 = 0x490; pub const MSR_IA32_VMX_VMFUNC: u32 = 0x491; -pub const MSR_IA32_VMX_MISC_INTEL_PT: u32 = 0x4000; -pub const MSR_IA32_VMX_MISC_VMWRITE_SHADOW_RO_FIELDS: u32 = 0x20000000; -pub const MSR_IA32_VMX_MISC_PREEMPTION_TIMER_SCALE: u32 = 0x1f; +pub const MSR_IA32_VMX_PROCBASED_CTLS3: u32 = 0x492; +pub const MSR_IA32_L3_QOS_CFG: u32 = 0xc81; +pub const MSR_IA32_L2_QOS_CFG: u32 = 0xc82; +pub const MSR_IA32_QM_EVTSEL: u32 = 0xc8d; +pub const MSR_IA32_QM_CTR: u32 = 0xc8e; +pub const MSR_IA32_PQR_ASSOC: u32 = 0xc8f; +pub const MSR_IA32_L3_CBM_BASE: u32 = 0xc90; +pub const MSR_RMID_SNC_CONFIG: u32 = 0xca0; +pub const MSR_IA32_L2_CBM_BASE: u32 = 0xd10; +pub const MSR_IA32_MBA_THRTL_BASE: u32 = 0xd50; +pub const MSR_IA32_MBA_BW_BASE: u32 = 0xc0000200; +pub const MSR_IA32_SMBA_BW_BASE: u32 = 0xc0000280; +pub const MSR_IA32_EVT_CFG_BASE: u32 = 0xc0000400; pub const MSR_VM_CR: u32 = 0xc0010114; pub const MSR_VM_IGNNE: u32 = 0xc0010115; pub const MSR_VM_HSAVE_PA: u32 = 0xc0010117; +pub const MSR_IA32_HW_FEEDBACK_PTR: u32 = 0x17d0; +pub const MSR_IA32_HW_FEEDBACK_CONFIG: u32 = 0x17d1; +pub const MSR_IA32_XAPIC_DISABLE_STATUS: u32 = 0xbd; diff --git a/src/vmm/src/arch/x86_64/generated/perf_event.rs b/src/vmm/src/arch/x86_64/generated/perf_event.rs index 66b851e3451..5f776f436c3 100644 --- a/src/vmm/src/arch/x86_64/generated/perf_event.rs +++ b/src/vmm/src/arch/x86_64/generated/perf_event.rs @@ -12,7 +12,8 @@ clippy::undocumented_unsafe_blocks, missing_debug_implementations, clippy::tests_outside_test_module, - unsafe_op_in_unsafe_fn + unsafe_op_in_unsafe_fn, + clippy::redundant_static_lifetimes )] pub const MSR_ARCH_PERFMON_PERFCTR0: u32 = 0xc1; diff --git a/src/vmm/src/arch/x86_64/mptable.rs b/src/vmm/src/arch/x86_64/mptable.rs index 99fb202c8d8..b893bdd1ef1 100644 --- a/src/vmm/src/arch/x86_64/mptable.rs +++ b/src/vmm/src/arch/x86_64/mptable.rs @@ -229,7 +229,7 @@ pub fn setup_mptable( let size = mem::size_of::() as u64; let mpc_intsrc = mpspec::mpc_intsrc { type_: mpspec::MP_INTSRC.try_into().unwrap(), - irqtype: mpspec::mp_irq_source_types_mp_INT.try_into().unwrap(), + irqtype: mpspec::mp_irq_source_types::mp_INT.try_into().unwrap(), irqflag: mpspec::MP_IRQPOL_DEFAULT.try_into().unwrap(), srcbus: 0, srcbusirq: i, @@ -246,7 +246,7 @@ pub fn setup_mptable( let size = mem::size_of::() as u64; let mpc_lintsrc = mpspec::mpc_lintsrc { type_: mpspec::MP_LINTSRC.try_into().unwrap(), - irqtype: mpspec::mp_irq_source_types_mp_ExtINT.try_into().unwrap(), + irqtype: mpspec::mp_irq_source_types::mp_ExtINT.try_into().unwrap(), irqflag: mpspec::MP_IRQPOL_DEFAULT.try_into().unwrap(), srcbusid: 0, srcbusirq: 0, @@ -263,7 +263,7 @@ pub fn setup_mptable( let size = mem::size_of::() as u64; let mpc_lintsrc = mpspec::mpc_lintsrc { type_: mpspec::MP_LINTSRC.try_into().unwrap(), - irqtype: mpspec::mp_irq_source_types_mp_NMI.try_into().unwrap(), + irqtype: mpspec::mp_irq_source_types::mp_NMI.try_into().unwrap(), irqflag: mpspec::MP_IRQPOL_DEFAULT.try_into().unwrap(), srcbusid: 0, srcbusirq: 0, diff --git a/src/vmm/src/devices/virtio/generated/virtio_blk.rs b/src/vmm/src/devices/virtio/generated/virtio_blk.rs index 624ef389ccd..cd31d470a21 100644 --- a/src/vmm/src/devices/virtio/generated/virtio_blk.rs +++ b/src/vmm/src/devices/virtio/generated/virtio_blk.rs @@ -12,7 +12,8 @@ clippy::undocumented_unsafe_blocks, missing_debug_implementations, clippy::tests_outside_test_module, - unsafe_op_in_unsafe_fn + unsafe_op_in_unsafe_fn, + clippy::redundant_static_lifetimes )] pub const VIRTIO_BLK_F_SIZE_MAX: u32 = 1; diff --git a/src/vmm/src/devices/virtio/generated/virtio_config.rs b/src/vmm/src/devices/virtio/generated/virtio_config.rs index e1ecc4fa38b..886bd07ac39 100644 --- a/src/vmm/src/devices/virtio/generated/virtio_config.rs +++ b/src/vmm/src/devices/virtio/generated/virtio_config.rs @@ -12,7 +12,8 @@ clippy::undocumented_unsafe_blocks, missing_debug_implementations, clippy::tests_outside_test_module, - unsafe_op_in_unsafe_fn + unsafe_op_in_unsafe_fn, + clippy::redundant_static_lifetimes )] pub const VIRTIO_F_NOTIFY_ON_EMPTY: u32 = 24; diff --git a/src/vmm/src/devices/virtio/generated/virtio_net.rs b/src/vmm/src/devices/virtio/generated/virtio_net.rs index 6d5adaac8f6..aec3103aa36 100644 --- a/src/vmm/src/devices/virtio/generated/virtio_net.rs +++ b/src/vmm/src/devices/virtio/generated/virtio_net.rs @@ -12,7 +12,8 @@ clippy::undocumented_unsafe_blocks, missing_debug_implementations, clippy::tests_outside_test_module, - unsafe_op_in_unsafe_fn + unsafe_op_in_unsafe_fn, + clippy::redundant_static_lifetimes )] pub const VIRTIO_NET_F_CSUM: u32 = 0; @@ -37,6 +38,7 @@ pub const VIRTIO_NET_F_CTRL_RX_EXTRA: u32 = 20; pub const VIRTIO_NET_F_GUEST_ANNOUNCE: u32 = 21; pub const VIRTIO_NET_F_MQ: u32 = 22; pub const VIRTIO_NET_F_CTRL_MAC_ADDR: u32 = 23; +pub const VIRTIO_NET_F_DEVICE_STATS: u32 = 50; pub const VIRTIO_NET_F_VQ_NOTF_COAL: u32 = 52; pub const VIRTIO_NET_F_NOTF_COAL: u32 = 53; pub const VIRTIO_NET_F_GUEST_USO4: u32 = 54; diff --git a/src/vmm/src/devices/virtio/generated/virtio_ring.rs b/src/vmm/src/devices/virtio/generated/virtio_ring.rs index a0411fcc92b..dc30dff7c33 100644 --- a/src/vmm/src/devices/virtio/generated/virtio_ring.rs +++ b/src/vmm/src/devices/virtio/generated/virtio_ring.rs @@ -12,7 +12,8 @@ clippy::undocumented_unsafe_blocks, missing_debug_implementations, clippy::tests_outside_test_module, - unsafe_op_in_unsafe_fn + unsafe_op_in_unsafe_fn, + clippy::redundant_static_lifetimes )] pub const VIRTIO_RING_F_EVENT_IDX: u32 = 29; diff --git a/src/vmm/src/devices/virtio/net/generated/if_tun.rs b/src/vmm/src/devices/virtio/net/generated/if_tun.rs index d08fe1b1ce7..66765eba11f 100644 --- a/src/vmm/src/devices/virtio/net/generated/if_tun.rs +++ b/src/vmm/src/devices/virtio/net/generated/if_tun.rs @@ -12,7 +12,8 @@ clippy::undocumented_unsafe_blocks, missing_debug_implementations, clippy::tests_outside_test_module, - unsafe_op_in_unsafe_fn + unsafe_op_in_unsafe_fn, + clippy::redundant_static_lifetimes )] pub const ETH_ALEN: u32 = 6; diff --git a/src/vmm/src/devices/virtio/net/generated/iff.rs b/src/vmm/src/devices/virtio/net/generated/iff.rs index c805642a834..bd22d38ba49 100644 --- a/src/vmm/src/devices/virtio/net/generated/iff.rs +++ b/src/vmm/src/devices/virtio/net/generated/iff.rs @@ -12,7 +12,8 @@ clippy::undocumented_unsafe_blocks, missing_debug_implementations, clippy::tests_outside_test_module, - unsafe_op_in_unsafe_fn + unsafe_op_in_unsafe_fn, + clippy::redundant_static_lifetimes )] pub const IFNAMSIZ: u32 = 16; @@ -195,38 +196,44 @@ const _: () = { ["Offset of field: x25_hdlc_proto::t2"][::std::mem::offset_of!(x25_hdlc_proto, t2) - 16usize]; ["Offset of field: x25_hdlc_proto::n2"][::std::mem::offset_of!(x25_hdlc_proto, n2) - 20usize]; }; -pub const net_device_flags_IFF_UP: net_device_flags = 1; -pub const net_device_flags_IFF_BROADCAST: net_device_flags = 2; -pub const net_device_flags_IFF_DEBUG: net_device_flags = 4; -pub const net_device_flags_IFF_LOOPBACK: net_device_flags = 8; -pub const net_device_flags_IFF_POINTOPOINT: net_device_flags = 16; -pub const net_device_flags_IFF_NOTRAILERS: net_device_flags = 32; -pub const net_device_flags_IFF_RUNNING: net_device_flags = 64; -pub const net_device_flags_IFF_NOARP: net_device_flags = 128; -pub const net_device_flags_IFF_PROMISC: net_device_flags = 256; -pub const net_device_flags_IFF_ALLMULTI: net_device_flags = 512; -pub const net_device_flags_IFF_MASTER: net_device_flags = 1024; -pub const net_device_flags_IFF_SLAVE: net_device_flags = 2048; -pub const net_device_flags_IFF_MULTICAST: net_device_flags = 4096; -pub const net_device_flags_IFF_PORTSEL: net_device_flags = 8192; -pub const net_device_flags_IFF_AUTOMEDIA: net_device_flags = 16384; -pub const net_device_flags_IFF_DYNAMIC: net_device_flags = 32768; -pub const net_device_flags_IFF_LOWER_UP: net_device_flags = 65536; -pub const net_device_flags_IFF_DORMANT: net_device_flags = 131072; -pub const net_device_flags_IFF_ECHO: net_device_flags = 262144; -pub type net_device_flags = ::std::os::raw::c_uint; -pub const IF_OPER_UNKNOWN: _bindgen_ty_4 = 0; -pub const IF_OPER_NOTPRESENT: _bindgen_ty_4 = 1; -pub const IF_OPER_DOWN: _bindgen_ty_4 = 2; -pub const IF_OPER_LOWERLAYERDOWN: _bindgen_ty_4 = 3; -pub const IF_OPER_TESTING: _bindgen_ty_4 = 4; -pub const IF_OPER_DORMANT: _bindgen_ty_4 = 5; -pub const IF_OPER_UP: _bindgen_ty_4 = 6; -pub type _bindgen_ty_4 = ::std::os::raw::c_uint; -pub const IF_LINK_MODE_DEFAULT: _bindgen_ty_5 = 0; -pub const IF_LINK_MODE_DORMANT: _bindgen_ty_5 = 1; -pub const IF_LINK_MODE_TESTING: _bindgen_ty_5 = 2; -pub type _bindgen_ty_5 = ::std::os::raw::c_uint; +pub mod net_device_flags { + pub type Type = ::std::os::raw::c_uint; + pub const IFF_UP: Type = 1; + pub const IFF_BROADCAST: Type = 2; + pub const IFF_DEBUG: Type = 4; + pub const IFF_LOOPBACK: Type = 8; + pub const IFF_POINTOPOINT: Type = 16; + pub const IFF_NOTRAILERS: Type = 32; + pub const IFF_RUNNING: Type = 64; + pub const IFF_NOARP: Type = 128; + pub const IFF_PROMISC: Type = 256; + pub const IFF_ALLMULTI: Type = 512; + pub const IFF_MASTER: Type = 1024; + pub const IFF_SLAVE: Type = 2048; + pub const IFF_MULTICAST: Type = 4096; + pub const IFF_PORTSEL: Type = 8192; + pub const IFF_AUTOMEDIA: Type = 16384; + pub const IFF_DYNAMIC: Type = 32768; + pub const IFF_LOWER_UP: Type = 65536; + pub const IFF_DORMANT: Type = 131072; + pub const IFF_ECHO: Type = 262144; +} +pub mod _bindgen_ty_4 { + pub type Type = ::std::os::raw::c_uint; + pub const IF_OPER_UNKNOWN: Type = 0; + pub const IF_OPER_NOTPRESENT: Type = 1; + pub const IF_OPER_DOWN: Type = 2; + pub const IF_OPER_LOWERLAYERDOWN: Type = 3; + pub const IF_OPER_TESTING: Type = 4; + pub const IF_OPER_DORMANT: Type = 5; + pub const IF_OPER_UP: Type = 6; +} +pub mod _bindgen_ty_5 { + pub type Type = ::std::os::raw::c_uint; + pub const IF_LINK_MODE_DEFAULT: Type = 0; + pub const IF_LINK_MODE_DORMANT: Type = 1; + pub const IF_LINK_MODE_TESTING: Type = 2; +} #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct ifmap { diff --git a/src/vmm/src/devices/virtio/net/generated/sockios.rs b/src/vmm/src/devices/virtio/net/generated/sockios.rs index 8973c1cf877..1966a4b36f5 100644 --- a/src/vmm/src/devices/virtio/net/generated/sockios.rs +++ b/src/vmm/src/devices/virtio/net/generated/sockios.rs @@ -12,10 +12,12 @@ clippy::undocumented_unsafe_blocks, missing_debug_implementations, clippy::tests_outside_test_module, - unsafe_op_in_unsafe_fn + unsafe_op_in_unsafe_fn, + clippy::redundant_static_lifetimes )] pub const __BITS_PER_LONG: u32 = 64; +pub const __BITS_PER_LONG_LONG: u32 = 64; pub const FIOSETOWN: u32 = 35073; pub const SIOCSPGRP: u32 = 35074; pub const FIOGETOWN: u32 = 35075; diff --git a/src/vmm/src/devices/virtio/net/test_utils.rs b/src/vmm/src/devices/virtio/net/test_utils.rs index b4fbdf97e3f..6d7bcf15ced 100644 --- a/src/vmm/src/devices/virtio/net/test_utils.rs +++ b/src/vmm/src/devices/virtio/net/test_utils.rs @@ -15,6 +15,7 @@ use std::sync::{Arc, Mutex}; use crate::devices::virtio::net::Net; #[cfg(test)] use crate::devices::virtio::net::device::vnet_hdr_len; +use crate::devices::virtio::net::generated::net_device_flags; use crate::devices::virtio::net::tap::{IfReqBuilder, Tap}; use crate::devices::virtio::queue::Queue; use crate::devices::virtio::test_utils::VirtQueue; @@ -236,9 +237,9 @@ pub fn enable(tap: &Tap) { IfReqBuilder::new() .if_name(&tap.if_name) .flags( - (crate::devices::virtio::net::generated::net_device_flags_IFF_UP - | crate::devices::virtio::net::generated::net_device_flags_IFF_RUNNING - | crate::devices::virtio::net::generated::net_device_flags_IFF_NOARP) + (net_device_flags::IFF_UP + | net_device_flags::IFF_RUNNING + | net_device_flags::IFF_NOARP) .try_into() .unwrap(), ) diff --git a/src/vmm/src/io_uring/generated.rs b/src/vmm/src/io_uring/generated.rs index 445f4a98237..3948a02fb21 100644 --- a/src/vmm/src/io_uring/generated.rs +++ b/src/vmm/src/io_uring/generated.rs @@ -12,7 +12,8 @@ clippy::undocumented_unsafe_blocks, missing_debug_implementations, clippy::tests_outside_test_module, - unsafe_op_in_unsafe_fn + unsafe_op_in_unsafe_fn, + clippy::redundant_static_lifetimes )] #[repr(C)] @@ -45,6 +46,50 @@ impl ::std::fmt::Debug for __IncompleteArrayField { fmt.write_str("__IncompleteArrayField") } } +#[repr(C)] +pub struct __BindgenUnionField(::std::marker::PhantomData); +impl __BindgenUnionField { + #[inline] + pub const fn new() -> Self { + __BindgenUnionField(::std::marker::PhantomData) + } + #[inline] + pub unsafe fn as_ref(&self) -> &T { + ::std::mem::transmute(self) + } + #[inline] + pub unsafe fn as_mut(&mut self) -> &mut T { + ::std::mem::transmute(self) + } +} +impl ::std::default::Default for __BindgenUnionField { + #[inline] + fn default() -> Self { + Self::new() + } +} +impl ::std::clone::Clone for __BindgenUnionField { + #[inline] + fn clone(&self) -> Self { + *self + } +} +impl ::std::marker::Copy for __BindgenUnionField {} +impl ::std::fmt::Debug for __BindgenUnionField { + fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + fmt.write_str("__BindgenUnionField") + } +} +impl ::std::hash::Hash for __BindgenUnionField { + fn hash(&self, _state: &mut H) {} +} +impl ::std::cmp::PartialEq for __BindgenUnionField { + fn eq(&self, _other: &__BindgenUnionField) -> bool { + true + } +} +impl ::std::cmp::Eq for __BindgenUnionField {} +pub const IORING_FILE_INDEX_ALLOC: i32 = -1; pub const IORING_SETUP_IOPOLL: u32 = 1; pub const IORING_SETUP_SQPOLL: u32 = 2; pub const IORING_SETUP_SQ_AFF: u32 = 4; @@ -52,29 +97,73 @@ pub const IORING_SETUP_CQSIZE: u32 = 8; pub const IORING_SETUP_CLAMP: u32 = 16; pub const IORING_SETUP_ATTACH_WQ: u32 = 32; pub const IORING_SETUP_R_DISABLED: u32 = 64; +pub const IORING_SETUP_SUBMIT_ALL: u32 = 128; +pub const IORING_SETUP_COOP_TASKRUN: u32 = 256; +pub const IORING_SETUP_TASKRUN_FLAG: u32 = 512; +pub const IORING_SETUP_SQE128: u32 = 1024; +pub const IORING_SETUP_CQE32: u32 = 2048; +pub const IORING_SETUP_SINGLE_ISSUER: u32 = 4096; +pub const IORING_SETUP_DEFER_TASKRUN: u32 = 8192; +pub const IORING_SETUP_NO_MMAP: u32 = 16384; +pub const IORING_SETUP_REGISTERED_FD_ONLY: u32 = 32768; +pub const IORING_SETUP_NO_SQARRAY: u32 = 65536; +pub const IORING_URING_CMD_FIXED: u32 = 1; +pub const IORING_URING_CMD_MASK: u32 = 1; pub const IORING_FSYNC_DATASYNC: u32 = 1; pub const IORING_TIMEOUT_ABS: u32 = 1; pub const IORING_TIMEOUT_UPDATE: u32 = 2; pub const IORING_TIMEOUT_BOOTTIME: u32 = 4; pub const IORING_TIMEOUT_REALTIME: u32 = 8; pub const IORING_LINK_TIMEOUT_UPDATE: u32 = 16; +pub const IORING_TIMEOUT_ETIME_SUCCESS: u32 = 32; +pub const IORING_TIMEOUT_MULTISHOT: u32 = 64; pub const IORING_TIMEOUT_CLOCK_MASK: u32 = 12; pub const IORING_TIMEOUT_UPDATE_MASK: u32 = 18; pub const IORING_POLL_ADD_MULTI: u32 = 1; pub const IORING_POLL_UPDATE_EVENTS: u32 = 2; pub const IORING_POLL_UPDATE_USER_DATA: u32 = 4; +pub const IORING_POLL_ADD_LEVEL: u32 = 8; +pub const IORING_ASYNC_CANCEL_ALL: u32 = 1; +pub const IORING_ASYNC_CANCEL_FD: u32 = 2; +pub const IORING_ASYNC_CANCEL_ANY: u32 = 4; +pub const IORING_ASYNC_CANCEL_FD_FIXED: u32 = 8; +pub const IORING_ASYNC_CANCEL_USERDATA: u32 = 16; +pub const IORING_ASYNC_CANCEL_OP: u32 = 32; +pub const IORING_RECVSEND_POLL_FIRST: u32 = 1; +pub const IORING_RECV_MULTISHOT: u32 = 2; +pub const IORING_RECVSEND_FIXED_BUF: u32 = 4; +pub const IORING_SEND_ZC_REPORT_USAGE: u32 = 8; +pub const IORING_RECVSEND_BUNDLE: u32 = 16; +pub const IORING_NOTIF_USAGE_ZC_COPIED: u32 = 2147483648; +pub const IORING_ACCEPT_MULTISHOT: u32 = 1; +pub const IORING_ACCEPT_DONTWAIT: u32 = 2; +pub const IORING_ACCEPT_POLL_FIRST: u32 = 4; +pub const IORING_MSG_RING_CQE_SKIP: u32 = 1; +pub const IORING_MSG_RING_FLAGS_PASS: u32 = 2; +pub const IORING_FIXED_FD_NO_CLOEXEC: u32 = 1; +pub const IORING_NOP_INJECT_RESULT: u32 = 1; pub const IORING_CQE_F_BUFFER: u32 = 1; pub const IORING_CQE_F_MORE: u32 = 2; +pub const IORING_CQE_F_SOCK_NONEMPTY: u32 = 4; +pub const IORING_CQE_F_NOTIF: u32 = 8; +pub const IORING_CQE_F_BUF_MORE: u32 = 16; +pub const IORING_CQE_BUFFER_SHIFT: u32 = 16; pub const IORING_OFF_SQ_RING: u32 = 0; pub const IORING_OFF_CQ_RING: u32 = 134217728; pub const IORING_OFF_SQES: u32 = 268435456; +pub const IORING_OFF_PBUF_RING: u32 = 2147483648; +pub const IORING_OFF_PBUF_SHIFT: u32 = 16; +pub const IORING_OFF_MMAP_MASK: u32 = 4160749568; pub const IORING_SQ_NEED_WAKEUP: u32 = 1; pub const IORING_SQ_CQ_OVERFLOW: u32 = 2; +pub const IORING_SQ_TASKRUN: u32 = 4; pub const IORING_CQ_EVENTFD_DISABLED: u32 = 1; pub const IORING_ENTER_GETEVENTS: u32 = 1; pub const IORING_ENTER_SQ_WAKEUP: u32 = 2; pub const IORING_ENTER_SQ_WAIT: u32 = 4; pub const IORING_ENTER_EXT_ARG: u32 = 8; +pub const IORING_ENTER_REGISTERED_RING: u32 = 16; +pub const IORING_ENTER_ABS_TIMER: u32 = 32; pub const IORING_FEAT_SINGLE_MMAP: u32 = 1; pub const IORING_FEAT_NODROP: u32 = 2; pub const IORING_FEAT_SUBMIT_STABLE: u32 = 4; @@ -86,6 +175,12 @@ pub const IORING_FEAT_SQPOLL_NONFIXED: u32 = 128; pub const IORING_FEAT_EXT_ARG: u32 = 256; pub const IORING_FEAT_NATIVE_WORKERS: u32 = 512; pub const IORING_FEAT_RSRC_TAGS: u32 = 1024; +pub const IORING_FEAT_CQE_SKIP: u32 = 2048; +pub const IORING_FEAT_LINKED_FILE: u32 = 4096; +pub const IORING_FEAT_REG_REG_RING: u32 = 8192; +pub const IORING_FEAT_RECVSEND_BUNDLE: u32 = 16384; +pub const IORING_FEAT_MIN_TIMEOUT: u32 = 32768; +pub const IORING_RSRC_REGISTER_SPARSE: u32 = 1; pub const IORING_REGISTER_FILES_SKIP: i32 = -2; pub const IO_URING_OP_SUPPORTED: u32 = 1; pub type __u8 = ::std::os::raw::c_uchar; @@ -93,8 +188,24 @@ pub type __u16 = ::std::os::raw::c_ushort; pub type __s32 = ::std::os::raw::c_int; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; +pub type __kernel_time64_t = ::std::os::raw::c_longlong; pub type __kernel_rwf_t = ::std::os::raw::c_int; #[repr(C)] +#[derive(Debug, Default, Copy, Clone, PartialEq)] +pub struct __kernel_timespec { + pub tv_sec: __kernel_time64_t, + pub tv_nsec: ::std::os::raw::c_longlong, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_timespec"][::std::mem::size_of::<__kernel_timespec>() - 16usize]; + ["Alignment of __kernel_timespec"][::std::mem::align_of::<__kernel_timespec>() - 8usize]; + ["Offset of field: __kernel_timespec::tv_sec"] + [::std::mem::offset_of!(__kernel_timespec, tv_sec) - 0usize]; + ["Offset of field: __kernel_timespec::tv_nsec"] + [::std::mem::offset_of!(__kernel_timespec, tv_nsec) - 8usize]; +}; +#[repr(C)] #[derive(Copy, Clone)] pub struct io_uring_sqe { pub opcode: __u8, @@ -109,15 +220,33 @@ pub struct io_uring_sqe { pub __bindgen_anon_4: io_uring_sqe__bindgen_ty_4, pub personality: __u16, pub __bindgen_anon_5: io_uring_sqe__bindgen_ty_5, - pub __pad2: [__u64; 2usize], + pub __bindgen_anon_6: io_uring_sqe__bindgen_ty_6, } #[repr(C)] #[derive(Copy, Clone)] pub union io_uring_sqe__bindgen_ty_1 { pub off: __u64, pub addr2: __u64, + pub __bindgen_anon_1: io_uring_sqe__bindgen_ty_1__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, PartialEq)] +pub struct io_uring_sqe__bindgen_ty_1__bindgen_ty_1 { + pub cmd_op: __u32, + pub __pad1: __u32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of io_uring_sqe__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of io_uring_sqe__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: io_uring_sqe__bindgen_ty_1__bindgen_ty_1::cmd_op"] + [::std::mem::offset_of!(io_uring_sqe__bindgen_ty_1__bindgen_ty_1, cmd_op) - 0usize]; + ["Offset of field: io_uring_sqe__bindgen_ty_1__bindgen_ty_1::__pad1"] + [::std::mem::offset_of!(io_uring_sqe__bindgen_ty_1__bindgen_ty_1, __pad1) - 4usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of io_uring_sqe__bindgen_ty_1"] [::std::mem::size_of::() - 8usize]; @@ -142,8 +271,26 @@ impl Default for io_uring_sqe__bindgen_ty_1 { pub union io_uring_sqe__bindgen_ty_2 { pub addr: __u64, pub splice_off_in: __u64, + pub __bindgen_anon_1: io_uring_sqe__bindgen_ty_2__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, PartialEq)] +pub struct io_uring_sqe__bindgen_ty_2__bindgen_ty_1 { + pub level: __u32, + pub optname: __u32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of io_uring_sqe__bindgen_ty_2__bindgen_ty_1"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of io_uring_sqe__bindgen_ty_2__bindgen_ty_1"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: io_uring_sqe__bindgen_ty_2__bindgen_ty_1::level"] + [::std::mem::offset_of!(io_uring_sqe__bindgen_ty_2__bindgen_ty_1, level) - 0usize]; + ["Offset of field: io_uring_sqe__bindgen_ty_2__bindgen_ty_1::optname"] + [::std::mem::offset_of!(io_uring_sqe__bindgen_ty_2__bindgen_ty_1, optname) - 4usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of io_uring_sqe__bindgen_ty_2"] [::std::mem::size_of::() - 8usize]; @@ -182,6 +329,13 @@ pub union io_uring_sqe__bindgen_ty_3 { pub rename_flags: __u32, pub unlink_flags: __u32, pub hardlink_flags: __u32, + pub xattr_flags: __u32, + pub msg_ring_flags: __u32, + pub uring_cmd_flags: __u32, + pub waitid_flags: __u32, + pub futex_flags: __u32, + pub install_fd_flags: __u32, + pub nop_flags: __u32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { @@ -221,6 +375,20 @@ const _: () = { [::std::mem::offset_of!(io_uring_sqe__bindgen_ty_3, unlink_flags) - 0usize]; ["Offset of field: io_uring_sqe__bindgen_ty_3::hardlink_flags"] [::std::mem::offset_of!(io_uring_sqe__bindgen_ty_3, hardlink_flags) - 0usize]; + ["Offset of field: io_uring_sqe__bindgen_ty_3::xattr_flags"] + [::std::mem::offset_of!(io_uring_sqe__bindgen_ty_3, xattr_flags) - 0usize]; + ["Offset of field: io_uring_sqe__bindgen_ty_3::msg_ring_flags"] + [::std::mem::offset_of!(io_uring_sqe__bindgen_ty_3, msg_ring_flags) - 0usize]; + ["Offset of field: io_uring_sqe__bindgen_ty_3::uring_cmd_flags"] + [::std::mem::offset_of!(io_uring_sqe__bindgen_ty_3, uring_cmd_flags) - 0usize]; + ["Offset of field: io_uring_sqe__bindgen_ty_3::waitid_flags"] + [::std::mem::offset_of!(io_uring_sqe__bindgen_ty_3, waitid_flags) - 0usize]; + ["Offset of field: io_uring_sqe__bindgen_ty_3::futex_flags"] + [::std::mem::offset_of!(io_uring_sqe__bindgen_ty_3, futex_flags) - 0usize]; + ["Offset of field: io_uring_sqe__bindgen_ty_3::install_fd_flags"] + [::std::mem::offset_of!(io_uring_sqe__bindgen_ty_3, install_fd_flags) - 0usize]; + ["Offset of field: io_uring_sqe__bindgen_ty_3::nop_flags"] + [::std::mem::offset_of!(io_uring_sqe__bindgen_ty_3, nop_flags) - 0usize]; }; impl Default for io_uring_sqe__bindgen_ty_3 { fn default() -> Self { @@ -262,8 +430,27 @@ impl Default for io_uring_sqe__bindgen_ty_4 { pub union io_uring_sqe__bindgen_ty_5 { pub splice_fd_in: __s32, pub file_index: __u32, + pub optlen: __u32, + pub __bindgen_anon_1: io_uring_sqe__bindgen_ty_5__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, PartialEq)] +pub struct io_uring_sqe__bindgen_ty_5__bindgen_ty_1 { + pub addr_len: __u16, + pub __pad3: [__u16; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of io_uring_sqe__bindgen_ty_5__bindgen_ty_1"] + [::std::mem::size_of::() - 4usize]; + ["Alignment of io_uring_sqe__bindgen_ty_5__bindgen_ty_1"] + [::std::mem::align_of::() - 2usize]; + ["Offset of field: io_uring_sqe__bindgen_ty_5__bindgen_ty_1::addr_len"] + [::std::mem::offset_of!(io_uring_sqe__bindgen_ty_5__bindgen_ty_1, addr_len) - 0usize]; + ["Offset of field: io_uring_sqe__bindgen_ty_5__bindgen_ty_1::__pad3"] + [::std::mem::offset_of!(io_uring_sqe__bindgen_ty_5__bindgen_ty_1, __pad3) - 2usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of io_uring_sqe__bindgen_ty_5"] [::std::mem::size_of::() - 4usize]; @@ -273,6 +460,8 @@ const _: () = { [::std::mem::offset_of!(io_uring_sqe__bindgen_ty_5, splice_fd_in) - 0usize]; ["Offset of field: io_uring_sqe__bindgen_ty_5::file_index"] [::std::mem::offset_of!(io_uring_sqe__bindgen_ty_5, file_index) - 0usize]; + ["Offset of field: io_uring_sqe__bindgen_ty_5::optlen"] + [::std::mem::offset_of!(io_uring_sqe__bindgen_ty_5, optlen) - 0usize]; }; impl Default for io_uring_sqe__bindgen_ty_5 { fn default() -> Self { @@ -283,6 +472,51 @@ impl Default for io_uring_sqe__bindgen_ty_5 { } } } +#[repr(C)] +#[derive(Copy, Clone)] +pub struct io_uring_sqe__bindgen_ty_6 { + pub __bindgen_anon_1: __BindgenUnionField, + pub optval: __BindgenUnionField<__u64>, + pub cmd: __BindgenUnionField<[__u8; 0usize]>, + pub bindgen_union_field: [u64; 2usize], +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, PartialEq)] +pub struct io_uring_sqe__bindgen_ty_6__bindgen_ty_1 { + pub addr3: __u64, + pub __pad2: [__u64; 1usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of io_uring_sqe__bindgen_ty_6__bindgen_ty_1"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of io_uring_sqe__bindgen_ty_6__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: io_uring_sqe__bindgen_ty_6__bindgen_ty_1::addr3"] + [::std::mem::offset_of!(io_uring_sqe__bindgen_ty_6__bindgen_ty_1, addr3) - 0usize]; + ["Offset of field: io_uring_sqe__bindgen_ty_6__bindgen_ty_1::__pad2"] + [::std::mem::offset_of!(io_uring_sqe__bindgen_ty_6__bindgen_ty_1, __pad2) - 8usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of io_uring_sqe__bindgen_ty_6"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of io_uring_sqe__bindgen_ty_6"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: io_uring_sqe__bindgen_ty_6::optval"] + [::std::mem::offset_of!(io_uring_sqe__bindgen_ty_6, optval) - 0usize]; + ["Offset of field: io_uring_sqe__bindgen_ty_6::cmd"] + [::std::mem::offset_of!(io_uring_sqe__bindgen_ty_6, cmd) - 0usize]; +}; +impl Default for io_uring_sqe__bindgen_ty_6 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of io_uring_sqe"][::std::mem::size_of::() - 64usize]; @@ -298,8 +532,6 @@ const _: () = { [::std::mem::offset_of!(io_uring_sqe, user_data) - 32usize]; ["Offset of field: io_uring_sqe::personality"] [::std::mem::offset_of!(io_uring_sqe, personality) - 42usize]; - ["Offset of field: io_uring_sqe::__pad2"] - [::std::mem::offset_of!(io_uring_sqe, __pad2) - 48usize]; }; impl Default for io_uring_sqe { fn default() -> Self { @@ -310,54 +542,85 @@ impl Default for io_uring_sqe { } } } -pub const IOSQE_FIXED_FILE_BIT: _bindgen_ty_1 = 0; -pub const IOSQE_IO_DRAIN_BIT: _bindgen_ty_1 = 1; -pub const IOSQE_IO_LINK_BIT: _bindgen_ty_1 = 2; -pub const IOSQE_IO_HARDLINK_BIT: _bindgen_ty_1 = 3; -pub const IOSQE_ASYNC_BIT: _bindgen_ty_1 = 4; -pub const IOSQE_BUFFER_SELECT_BIT: _bindgen_ty_1 = 5; -pub type _bindgen_ty_1 = ::std::os::raw::c_uint; -pub const IORING_OP_NOP: _bindgen_ty_2 = 0; -pub const IORING_OP_READV: _bindgen_ty_2 = 1; -pub const IORING_OP_WRITEV: _bindgen_ty_2 = 2; -pub const IORING_OP_FSYNC: _bindgen_ty_2 = 3; -pub const IORING_OP_READ_FIXED: _bindgen_ty_2 = 4; -pub const IORING_OP_WRITE_FIXED: _bindgen_ty_2 = 5; -pub const IORING_OP_POLL_ADD: _bindgen_ty_2 = 6; -pub const IORING_OP_POLL_REMOVE: _bindgen_ty_2 = 7; -pub const IORING_OP_SYNC_FILE_RANGE: _bindgen_ty_2 = 8; -pub const IORING_OP_SENDMSG: _bindgen_ty_2 = 9; -pub const IORING_OP_RECVMSG: _bindgen_ty_2 = 10; -pub const IORING_OP_TIMEOUT: _bindgen_ty_2 = 11; -pub const IORING_OP_TIMEOUT_REMOVE: _bindgen_ty_2 = 12; -pub const IORING_OP_ACCEPT: _bindgen_ty_2 = 13; -pub const IORING_OP_ASYNC_CANCEL: _bindgen_ty_2 = 14; -pub const IORING_OP_LINK_TIMEOUT: _bindgen_ty_2 = 15; -pub const IORING_OP_CONNECT: _bindgen_ty_2 = 16; -pub const IORING_OP_FALLOCATE: _bindgen_ty_2 = 17; -pub const IORING_OP_OPENAT: _bindgen_ty_2 = 18; -pub const IORING_OP_CLOSE: _bindgen_ty_2 = 19; -pub const IORING_OP_FILES_UPDATE: _bindgen_ty_2 = 20; -pub const IORING_OP_STATX: _bindgen_ty_2 = 21; -pub const IORING_OP_READ: _bindgen_ty_2 = 22; -pub const IORING_OP_WRITE: _bindgen_ty_2 = 23; -pub const IORING_OP_FADVISE: _bindgen_ty_2 = 24; -pub const IORING_OP_MADVISE: _bindgen_ty_2 = 25; -pub const IORING_OP_SEND: _bindgen_ty_2 = 26; -pub const IORING_OP_RECV: _bindgen_ty_2 = 27; -pub const IORING_OP_OPENAT2: _bindgen_ty_2 = 28; -pub const IORING_OP_EPOLL_CTL: _bindgen_ty_2 = 29; -pub const IORING_OP_SPLICE: _bindgen_ty_2 = 30; -pub const IORING_OP_PROVIDE_BUFFERS: _bindgen_ty_2 = 31; -pub const IORING_OP_REMOVE_BUFFERS: _bindgen_ty_2 = 32; -pub const IORING_OP_TEE: _bindgen_ty_2 = 33; -pub const IORING_OP_SHUTDOWN: _bindgen_ty_2 = 34; -pub const IORING_OP_RENAMEAT: _bindgen_ty_2 = 35; -pub const IORING_OP_UNLINKAT: _bindgen_ty_2 = 36; -pub const IORING_OP_LAST: _bindgen_ty_2 = 37; -pub type _bindgen_ty_2 = ::std::os::raw::c_uint; +pub mod io_uring_sqe_flags_bit { + pub type Type = ::std::os::raw::c_uint; + pub const IOSQE_FIXED_FILE_BIT: Type = 0; + pub const IOSQE_IO_DRAIN_BIT: Type = 1; + pub const IOSQE_IO_LINK_BIT: Type = 2; + pub const IOSQE_IO_HARDLINK_BIT: Type = 3; + pub const IOSQE_ASYNC_BIT: Type = 4; + pub const IOSQE_BUFFER_SELECT_BIT: Type = 5; + pub const IOSQE_CQE_SKIP_SUCCESS_BIT: Type = 6; +} +pub mod io_uring_op { + pub type Type = ::std::os::raw::c_uint; + pub const IORING_OP_NOP: Type = 0; + pub const IORING_OP_READV: Type = 1; + pub const IORING_OP_WRITEV: Type = 2; + pub const IORING_OP_FSYNC: Type = 3; + pub const IORING_OP_READ_FIXED: Type = 4; + pub const IORING_OP_WRITE_FIXED: Type = 5; + pub const IORING_OP_POLL_ADD: Type = 6; + pub const IORING_OP_POLL_REMOVE: Type = 7; + pub const IORING_OP_SYNC_FILE_RANGE: Type = 8; + pub const IORING_OP_SENDMSG: Type = 9; + pub const IORING_OP_RECVMSG: Type = 10; + pub const IORING_OP_TIMEOUT: Type = 11; + pub const IORING_OP_TIMEOUT_REMOVE: Type = 12; + pub const IORING_OP_ACCEPT: Type = 13; + pub const IORING_OP_ASYNC_CANCEL: Type = 14; + pub const IORING_OP_LINK_TIMEOUT: Type = 15; + pub const IORING_OP_CONNECT: Type = 16; + pub const IORING_OP_FALLOCATE: Type = 17; + pub const IORING_OP_OPENAT: Type = 18; + pub const IORING_OP_CLOSE: Type = 19; + pub const IORING_OP_FILES_UPDATE: Type = 20; + pub const IORING_OP_STATX: Type = 21; + pub const IORING_OP_READ: Type = 22; + pub const IORING_OP_WRITE: Type = 23; + pub const IORING_OP_FADVISE: Type = 24; + pub const IORING_OP_MADVISE: Type = 25; + pub const IORING_OP_SEND: Type = 26; + pub const IORING_OP_RECV: Type = 27; + pub const IORING_OP_OPENAT2: Type = 28; + pub const IORING_OP_EPOLL_CTL: Type = 29; + pub const IORING_OP_SPLICE: Type = 30; + pub const IORING_OP_PROVIDE_BUFFERS: Type = 31; + pub const IORING_OP_REMOVE_BUFFERS: Type = 32; + pub const IORING_OP_TEE: Type = 33; + pub const IORING_OP_SHUTDOWN: Type = 34; + pub const IORING_OP_RENAMEAT: Type = 35; + pub const IORING_OP_UNLINKAT: Type = 36; + pub const IORING_OP_MKDIRAT: Type = 37; + pub const IORING_OP_SYMLINKAT: Type = 38; + pub const IORING_OP_LINKAT: Type = 39; + pub const IORING_OP_MSG_RING: Type = 40; + pub const IORING_OP_FSETXATTR: Type = 41; + pub const IORING_OP_SETXATTR: Type = 42; + pub const IORING_OP_FGETXATTR: Type = 43; + pub const IORING_OP_GETXATTR: Type = 44; + pub const IORING_OP_SOCKET: Type = 45; + pub const IORING_OP_URING_CMD: Type = 46; + pub const IORING_OP_SEND_ZC: Type = 47; + pub const IORING_OP_SENDMSG_ZC: Type = 48; + pub const IORING_OP_READ_MULTISHOT: Type = 49; + pub const IORING_OP_WAITID: Type = 50; + pub const IORING_OP_FUTEX_WAIT: Type = 51; + pub const IORING_OP_FUTEX_WAKE: Type = 52; + pub const IORING_OP_FUTEX_WAITV: Type = 53; + pub const IORING_OP_FIXED_FD_INSTALL: Type = 54; + pub const IORING_OP_FTRUNCATE: Type = 55; + pub const IORING_OP_BIND: Type = 56; + pub const IORING_OP_LISTEN: Type = 57; + pub const IORING_OP_LAST: Type = 58; +} +pub mod io_uring_msg_ring_flags { + pub type Type = ::std::os::raw::c_uint; + pub const IORING_MSG_DATA: Type = 0; + pub const IORING_MSG_SEND_FD: Type = 1; +} #[repr(C)] -#[derive(Debug, Default, Copy, Clone, PartialEq)] +#[derive(Clone, Copy, Debug, Default)] pub struct io_uring_cqe { pub user_data: __u64, pub res: __s32, @@ -372,8 +635,6 @@ const _: () = { ["Offset of field: io_uring_cqe::res"][::std::mem::offset_of!(io_uring_cqe, res) - 8usize]; ["Offset of field: io_uring_cqe::flags"][::std::mem::offset_of!(io_uring_cqe, flags) - 12usize]; }; -pub const IORING_CQE_BUFFER_SHIFT: _bindgen_ty_3 = 16; -pub type _bindgen_ty_3 = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct io_sqring_offsets { @@ -385,7 +646,7 @@ pub struct io_sqring_offsets { pub dropped: __u32, pub array: __u32, pub resv1: __u32, - pub resv2: __u64, + pub user_addr: __u64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { @@ -407,8 +668,8 @@ const _: () = { [::std::mem::offset_of!(io_sqring_offsets, array) - 24usize]; ["Offset of field: io_sqring_offsets::resv1"] [::std::mem::offset_of!(io_sqring_offsets, resv1) - 28usize]; - ["Offset of field: io_sqring_offsets::resv2"] - [::std::mem::offset_of!(io_sqring_offsets, resv2) - 32usize]; + ["Offset of field: io_sqring_offsets::user_addr"] + [::std::mem::offset_of!(io_sqring_offsets, user_addr) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] @@ -421,7 +682,7 @@ pub struct io_cqring_offsets { pub cqes: __u32, pub flags: __u32, pub resv1: __u32, - pub resv2: __u64, + pub user_addr: __u64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { @@ -443,8 +704,8 @@ const _: () = { [::std::mem::offset_of!(io_cqring_offsets, flags) - 24usize]; ["Offset of field: io_cqring_offsets::resv1"] [::std::mem::offset_of!(io_cqring_offsets, resv1) - 28usize]; - ["Offset of field: io_cqring_offsets::resv2"] - [::std::mem::offset_of!(io_cqring_offsets, resv2) - 32usize]; + ["Offset of field: io_cqring_offsets::user_addr"] + [::std::mem::offset_of!(io_cqring_offsets, user_addr) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] @@ -485,28 +746,42 @@ const _: () = { ["Offset of field: io_uring_params::cq_off"] [::std::mem::offset_of!(io_uring_params, cq_off) - 80usize]; }; -pub const IORING_REGISTER_BUFFERS: _bindgen_ty_4 = 0; -pub const IORING_UNREGISTER_BUFFERS: _bindgen_ty_4 = 1; -pub const IORING_REGISTER_FILES: _bindgen_ty_4 = 2; -pub const IORING_UNREGISTER_FILES: _bindgen_ty_4 = 3; -pub const IORING_REGISTER_EVENTFD: _bindgen_ty_4 = 4; -pub const IORING_UNREGISTER_EVENTFD: _bindgen_ty_4 = 5; -pub const IORING_REGISTER_FILES_UPDATE: _bindgen_ty_4 = 6; -pub const IORING_REGISTER_EVENTFD_ASYNC: _bindgen_ty_4 = 7; -pub const IORING_REGISTER_PROBE: _bindgen_ty_4 = 8; -pub const IORING_REGISTER_PERSONALITY: _bindgen_ty_4 = 9; -pub const IORING_UNREGISTER_PERSONALITY: _bindgen_ty_4 = 10; -pub const IORING_REGISTER_RESTRICTIONS: _bindgen_ty_4 = 11; -pub const IORING_REGISTER_ENABLE_RINGS: _bindgen_ty_4 = 12; -pub const IORING_REGISTER_FILES2: _bindgen_ty_4 = 13; -pub const IORING_REGISTER_FILES_UPDATE2: _bindgen_ty_4 = 14; -pub const IORING_REGISTER_BUFFERS2: _bindgen_ty_4 = 15; -pub const IORING_REGISTER_BUFFERS_UPDATE: _bindgen_ty_4 = 16; -pub const IORING_REGISTER_IOWQ_AFF: _bindgen_ty_4 = 17; -pub const IORING_UNREGISTER_IOWQ_AFF: _bindgen_ty_4 = 18; -pub const IORING_REGISTER_IOWQ_MAX_WORKERS: _bindgen_ty_4 = 19; -pub const IORING_REGISTER_LAST: _bindgen_ty_4 = 20; -pub type _bindgen_ty_4 = ::std::os::raw::c_uint; +pub mod io_uring_register_op { + pub type Type = ::std::os::raw::c_uint; + pub const IORING_REGISTER_BUFFERS: Type = 0; + pub const IORING_UNREGISTER_BUFFERS: Type = 1; + pub const IORING_REGISTER_FILES: Type = 2; + pub const IORING_UNREGISTER_FILES: Type = 3; + pub const IORING_REGISTER_EVENTFD: Type = 4; + pub const IORING_UNREGISTER_EVENTFD: Type = 5; + pub const IORING_REGISTER_FILES_UPDATE: Type = 6; + pub const IORING_REGISTER_EVENTFD_ASYNC: Type = 7; + pub const IORING_REGISTER_PROBE: Type = 8; + pub const IORING_REGISTER_PERSONALITY: Type = 9; + pub const IORING_UNREGISTER_PERSONALITY: Type = 10; + pub const IORING_REGISTER_RESTRICTIONS: Type = 11; + pub const IORING_REGISTER_ENABLE_RINGS: Type = 12; + pub const IORING_REGISTER_FILES2: Type = 13; + pub const IORING_REGISTER_FILES_UPDATE2: Type = 14; + pub const IORING_REGISTER_BUFFERS2: Type = 15; + pub const IORING_REGISTER_BUFFERS_UPDATE: Type = 16; + pub const IORING_REGISTER_IOWQ_AFF: Type = 17; + pub const IORING_UNREGISTER_IOWQ_AFF: Type = 18; + pub const IORING_REGISTER_IOWQ_MAX_WORKERS: Type = 19; + pub const IORING_REGISTER_RING_FDS: Type = 20; + pub const IORING_UNREGISTER_RING_FDS: Type = 21; + pub const IORING_REGISTER_PBUF_RING: Type = 22; + pub const IORING_UNREGISTER_PBUF_RING: Type = 23; + pub const IORING_REGISTER_SYNC_CANCEL: Type = 24; + pub const IORING_REGISTER_FILE_ALLOC_RANGE: Type = 25; + pub const IORING_REGISTER_PBUF_STATUS: Type = 26; + pub const IORING_REGISTER_NAPI: Type = 27; + pub const IORING_UNREGISTER_NAPI: Type = 28; + pub const IORING_REGISTER_CLOCK: Type = 29; + pub const IORING_REGISTER_CLONE_BUFFERS: Type = 30; + pub const IORING_REGISTER_LAST: Type = 31; + pub const IORING_REGISTER_USE_REGISTERED_RING: Type = 2147483648; +} #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct io_uring_files_update { @@ -530,7 +805,7 @@ const _: () = { #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct io_uring_rsrc_register { pub nr: __u32, - pub resv: __u32, + pub flags: __u32, pub resv2: __u64, pub data: __u64, pub tags: __u64, @@ -542,8 +817,8 @@ const _: () = { [::std::mem::align_of::() - 8usize]; ["Offset of field: io_uring_rsrc_register::nr"] [::std::mem::offset_of!(io_uring_rsrc_register, nr) - 0usize]; - ["Offset of field: io_uring_rsrc_register::resv"] - [::std::mem::offset_of!(io_uring_rsrc_register, resv) - 4usize]; + ["Offset of field: io_uring_rsrc_register::flags"] + [::std::mem::offset_of!(io_uring_rsrc_register, flags) - 4usize]; ["Offset of field: io_uring_rsrc_register::resv2"] [::std::mem::offset_of!(io_uring_rsrc_register, resv2) - 8usize]; ["Offset of field: io_uring_rsrc_register::data"] @@ -698,18 +973,236 @@ impl Default for io_uring_restriction { } } } -pub const IORING_RESTRICTION_REGISTER_OP: _bindgen_ty_6 = 0; -pub const IORING_RESTRICTION_SQE_OP: _bindgen_ty_6 = 1; -pub const IORING_RESTRICTION_SQE_FLAGS_ALLOWED: _bindgen_ty_6 = 2; -pub const IORING_RESTRICTION_SQE_FLAGS_REQUIRED: _bindgen_ty_6 = 3; -pub const IORING_RESTRICTION_LAST: _bindgen_ty_6 = 4; -pub type _bindgen_ty_6 = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, PartialEq)] +pub struct io_uring_clock_register { + pub clockid: __u32, + pub __resv: [__u32; 3usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of io_uring_clock_register"][::std::mem::size_of::() - 16usize]; + ["Alignment of io_uring_clock_register"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: io_uring_clock_register::clockid"] + [::std::mem::offset_of!(io_uring_clock_register, clockid) - 0usize]; + ["Offset of field: io_uring_clock_register::__resv"] + [::std::mem::offset_of!(io_uring_clock_register, __resv) - 4usize]; +}; +pub mod _bindgen_ty_1 { + pub type Type = ::std::os::raw::c_uint; + pub const IORING_REGISTER_SRC_REGISTERED: Type = 1; +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, PartialEq)] +pub struct io_uring_clone_buffers { + pub src_fd: __u32, + pub flags: __u32, + pub pad: [__u32; 6usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of io_uring_clone_buffers"][::std::mem::size_of::() - 32usize]; + ["Alignment of io_uring_clone_buffers"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: io_uring_clone_buffers::src_fd"] + [::std::mem::offset_of!(io_uring_clone_buffers, src_fd) - 0usize]; + ["Offset of field: io_uring_clone_buffers::flags"] + [::std::mem::offset_of!(io_uring_clone_buffers, flags) - 4usize]; + ["Offset of field: io_uring_clone_buffers::pad"] + [::std::mem::offset_of!(io_uring_clone_buffers, pad) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, PartialEq)] +pub struct io_uring_buf { + pub addr: __u64, + pub len: __u32, + pub bid: __u16, + pub resv: __u16, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of io_uring_buf"][::std::mem::size_of::() - 16usize]; + ["Alignment of io_uring_buf"][::std::mem::align_of::() - 8usize]; + ["Offset of field: io_uring_buf::addr"][::std::mem::offset_of!(io_uring_buf, addr) - 0usize]; + ["Offset of field: io_uring_buf::len"][::std::mem::offset_of!(io_uring_buf, len) - 8usize]; + ["Offset of field: io_uring_buf::bid"][::std::mem::offset_of!(io_uring_buf, bid) - 12usize]; + ["Offset of field: io_uring_buf::resv"][::std::mem::offset_of!(io_uring_buf, resv) - 14usize]; +}; +#[repr(C)] +pub struct io_uring_buf_ring { + pub __bindgen_anon_1: io_uring_buf_ring__bindgen_ty_1, +} +#[repr(C)] +pub struct io_uring_buf_ring__bindgen_ty_1 { + pub __bindgen_anon_1: __BindgenUnionField, + pub __bindgen_anon_2: __BindgenUnionField, + pub bindgen_union_field: [u64; 2usize], +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, PartialEq)] +pub struct io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1 { + pub resv1: __u64, + pub resv2: __u32, + pub resv3: __u16, + pub tail: __u16, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1::resv1"] + [::std::mem::offset_of!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1, resv1) - 0usize]; + ["Offset of field: io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1::resv2"] + [::std::mem::offset_of!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1, resv2) - 8usize]; + ["Offset of field: io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1::resv3"] + [::std::mem::offset_of!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1, resv3) - 12usize]; + ["Offset of field: io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1::tail"] + [::std::mem::offset_of!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1, tail) - 14usize]; +}; +#[repr(C)] +#[derive(Debug, Default)] +pub struct io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2 { + pub __empty_bufs: io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1, + pub bufs: __IncompleteArrayField, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, PartialEq)] +pub struct io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1 {} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1"][::std::mem::size_of::< + io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1, + >() - 0usize]; + ["Alignment of io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1"] + [::std::mem::align_of::() + - 1usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2"] + [::std::mem::size_of::() - 0usize]; + ["Alignment of io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2::__empty_bufs"][::std::mem::offset_of!( + io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2, + __empty_bufs + ) - 0usize]; + ["Offset of field: io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2::bufs"] + [::std::mem::offset_of!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2, bufs) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of io_uring_buf_ring__bindgen_ty_1"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of io_uring_buf_ring__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; +}; +impl Default for io_uring_buf_ring__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of io_uring_buf_ring"][::std::mem::size_of::() - 16usize]; + ["Alignment of io_uring_buf_ring"][::std::mem::align_of::() - 8usize]; +}; +impl Default for io_uring_buf_ring { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub mod io_uring_register_pbuf_ring_flags { + pub type Type = ::std::os::raw::c_uint; + pub const IOU_PBUF_RING_MMAP: Type = 1; + pub const IOU_PBUF_RING_INC: Type = 2; +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, PartialEq)] +pub struct io_uring_buf_reg { + pub ring_addr: __u64, + pub ring_entries: __u32, + pub bgid: __u16, + pub flags: __u16, + pub resv: [__u64; 3usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of io_uring_buf_reg"][::std::mem::size_of::() - 40usize]; + ["Alignment of io_uring_buf_reg"][::std::mem::align_of::() - 8usize]; + ["Offset of field: io_uring_buf_reg::ring_addr"] + [::std::mem::offset_of!(io_uring_buf_reg, ring_addr) - 0usize]; + ["Offset of field: io_uring_buf_reg::ring_entries"] + [::std::mem::offset_of!(io_uring_buf_reg, ring_entries) - 8usize]; + ["Offset of field: io_uring_buf_reg::bgid"] + [::std::mem::offset_of!(io_uring_buf_reg, bgid) - 12usize]; + ["Offset of field: io_uring_buf_reg::flags"] + [::std::mem::offset_of!(io_uring_buf_reg, flags) - 14usize]; + ["Offset of field: io_uring_buf_reg::resv"] + [::std::mem::offset_of!(io_uring_buf_reg, resv) - 16usize]; +}; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, PartialEq)] +pub struct io_uring_buf_status { + pub buf_group: __u32, + pub head: __u32, + pub resv: [__u32; 8usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of io_uring_buf_status"][::std::mem::size_of::() - 40usize]; + ["Alignment of io_uring_buf_status"][::std::mem::align_of::() - 4usize]; + ["Offset of field: io_uring_buf_status::buf_group"] + [::std::mem::offset_of!(io_uring_buf_status, buf_group) - 0usize]; + ["Offset of field: io_uring_buf_status::head"] + [::std::mem::offset_of!(io_uring_buf_status, head) - 4usize]; + ["Offset of field: io_uring_buf_status::resv"] + [::std::mem::offset_of!(io_uring_buf_status, resv) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, PartialEq)] +pub struct io_uring_napi { + pub busy_poll_to: __u32, + pub prefer_busy_poll: __u8, + pub pad: [__u8; 3usize], + pub resv: __u64, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of io_uring_napi"][::std::mem::size_of::() - 16usize]; + ["Alignment of io_uring_napi"][::std::mem::align_of::() - 8usize]; + ["Offset of field: io_uring_napi::busy_poll_to"] + [::std::mem::offset_of!(io_uring_napi, busy_poll_to) - 0usize]; + ["Offset of field: io_uring_napi::prefer_busy_poll"] + [::std::mem::offset_of!(io_uring_napi, prefer_busy_poll) - 4usize]; + ["Offset of field: io_uring_napi::pad"][::std::mem::offset_of!(io_uring_napi, pad) - 5usize]; + ["Offset of field: io_uring_napi::resv"][::std::mem::offset_of!(io_uring_napi, resv) - 8usize]; +}; +pub mod io_uring_register_restriction_op { + pub type Type = ::std::os::raw::c_uint; + pub const IORING_RESTRICTION_REGISTER_OP: Type = 0; + pub const IORING_RESTRICTION_SQE_OP: Type = 1; + pub const IORING_RESTRICTION_SQE_FLAGS_ALLOWED: Type = 2; + pub const IORING_RESTRICTION_SQE_FLAGS_REQUIRED: Type = 3; + pub const IORING_RESTRICTION_LAST: Type = 4; +} #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct io_uring_getevents_arg { pub sigmask: __u64, pub sigmask_sz: __u32, - pub pad: __u32, + pub min_wait_usec: __u32, pub ts: __u64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] @@ -721,8 +1214,88 @@ const _: () = { [::std::mem::offset_of!(io_uring_getevents_arg, sigmask) - 0usize]; ["Offset of field: io_uring_getevents_arg::sigmask_sz"] [::std::mem::offset_of!(io_uring_getevents_arg, sigmask_sz) - 8usize]; - ["Offset of field: io_uring_getevents_arg::pad"] - [::std::mem::offset_of!(io_uring_getevents_arg, pad) - 12usize]; + ["Offset of field: io_uring_getevents_arg::min_wait_usec"] + [::std::mem::offset_of!(io_uring_getevents_arg, min_wait_usec) - 12usize]; ["Offset of field: io_uring_getevents_arg::ts"] [::std::mem::offset_of!(io_uring_getevents_arg, ts) - 16usize]; }; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, PartialEq)] +pub struct io_uring_sync_cancel_reg { + pub addr: __u64, + pub fd: __s32, + pub flags: __u32, + pub timeout: __kernel_timespec, + pub opcode: __u8, + pub pad: [__u8; 7usize], + pub pad2: [__u64; 3usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of io_uring_sync_cancel_reg"] + [::std::mem::size_of::() - 64usize]; + ["Alignment of io_uring_sync_cancel_reg"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: io_uring_sync_cancel_reg::addr"] + [::std::mem::offset_of!(io_uring_sync_cancel_reg, addr) - 0usize]; + ["Offset of field: io_uring_sync_cancel_reg::fd"] + [::std::mem::offset_of!(io_uring_sync_cancel_reg, fd) - 8usize]; + ["Offset of field: io_uring_sync_cancel_reg::flags"] + [::std::mem::offset_of!(io_uring_sync_cancel_reg, flags) - 12usize]; + ["Offset of field: io_uring_sync_cancel_reg::timeout"] + [::std::mem::offset_of!(io_uring_sync_cancel_reg, timeout) - 16usize]; + ["Offset of field: io_uring_sync_cancel_reg::opcode"] + [::std::mem::offset_of!(io_uring_sync_cancel_reg, opcode) - 32usize]; + ["Offset of field: io_uring_sync_cancel_reg::pad"] + [::std::mem::offset_of!(io_uring_sync_cancel_reg, pad) - 33usize]; + ["Offset of field: io_uring_sync_cancel_reg::pad2"] + [::std::mem::offset_of!(io_uring_sync_cancel_reg, pad2) - 40usize]; +}; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, PartialEq)] +pub struct io_uring_file_index_range { + pub off: __u32, + pub len: __u32, + pub resv: __u64, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of io_uring_file_index_range"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of io_uring_file_index_range"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: io_uring_file_index_range::off"] + [::std::mem::offset_of!(io_uring_file_index_range, off) - 0usize]; + ["Offset of field: io_uring_file_index_range::len"] + [::std::mem::offset_of!(io_uring_file_index_range, len) - 4usize]; + ["Offset of field: io_uring_file_index_range::resv"] + [::std::mem::offset_of!(io_uring_file_index_range, resv) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, PartialEq)] +pub struct io_uring_recvmsg_out { + pub namelen: __u32, + pub controllen: __u32, + pub payloadlen: __u32, + pub flags: __u32, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of io_uring_recvmsg_out"][::std::mem::size_of::() - 16usize]; + ["Alignment of io_uring_recvmsg_out"][::std::mem::align_of::() - 4usize]; + ["Offset of field: io_uring_recvmsg_out::namelen"] + [::std::mem::offset_of!(io_uring_recvmsg_out, namelen) - 0usize]; + ["Offset of field: io_uring_recvmsg_out::controllen"] + [::std::mem::offset_of!(io_uring_recvmsg_out, controllen) - 4usize]; + ["Offset of field: io_uring_recvmsg_out::payloadlen"] + [::std::mem::offset_of!(io_uring_recvmsg_out, payloadlen) - 8usize]; + ["Offset of field: io_uring_recvmsg_out::flags"] + [::std::mem::offset_of!(io_uring_recvmsg_out, flags) - 12usize]; +}; +pub mod io_uring_socket_op { + pub type Type = ::std::os::raw::c_uint; + pub const SOCKET_URING_OP_SIOCINQ: Type = 0; + pub const SOCKET_URING_OP_SIOCOUTQ: Type = 1; + pub const SOCKET_URING_OP_GETSOCKOPT: Type = 2; + pub const SOCKET_URING_OP_SETSOCKOPT: Type = 3; +} diff --git a/src/vmm/src/io_uring/mod.rs b/src/vmm/src/io_uring/mod.rs index 1c2ca1bfc6e..3d8ec441028 100644 --- a/src/vmm/src/io_uring/mod.rs +++ b/src/vmm/src/io_uring/mod.rs @@ -23,6 +23,8 @@ use queue::submission::SubmissionQueue; use restriction::Restriction; use vmm_sys_util::syscall::SyscallReturnCode; +use crate::io_uring::generated::io_uring_register_op; + // IO_uring operations that we require to be supported by the host kernel. const REQUIRED_OPS: [OpCode; 2] = [OpCode::Read, OpCode::Write]; // Taken from linux/fs/io_uring.c @@ -247,7 +249,7 @@ impl IoUring { libc::syscall( libc::SYS_io_uring_register, self.fd.as_raw_fd(), - generated::IORING_REGISTER_ENABLE_RINGS, + io_uring_register_op::IORING_REGISTER_ENABLE_RINGS, std::ptr::null::(), 0, ) @@ -272,7 +274,7 @@ impl IoUring { libc::syscall( libc::SYS_io_uring_register, self.fd.as_raw_fd(), - generated::IORING_REGISTER_FILES, + io_uring_register_op::IORING_REGISTER_FILES, files .iter() .map(|f| f.as_raw_fd()) @@ -296,7 +298,7 @@ impl IoUring { libc::syscall( libc::SYS_io_uring_register, self.fd.as_raw_fd(), - generated::IORING_REGISTER_EVENTFD, + io_uring_register_op::IORING_REGISTER_EVENTFD, (&fd) as *const _, 1, ) @@ -315,7 +317,7 @@ impl IoUring { libc::syscall( libc::SYS_io_uring_register, self.fd.as_raw_fd(), - generated::IORING_REGISTER_RESTRICTIONS, + io_uring_register_op::IORING_REGISTER_RESTRICTIONS, restrictions .iter() .map(generated::io_uring_restriction::from) @@ -351,7 +353,7 @@ impl IoUring { libc::syscall( libc::SYS_io_uring_register, self.fd.as_raw_fd(), - generated::IORING_REGISTER_PROBE, + io_uring_register_op::IORING_REGISTER_PROBE, probes.as_mut_fam_struct_ptr(), PROBE_LEN, ) diff --git a/src/vmm/src/io_uring/operation/mod.rs b/src/vmm/src/io_uring/operation/mod.rs index 6307d1413c0..ead96df5ba5 100644 --- a/src/vmm/src/io_uring/operation/mod.rs +++ b/src/vmm/src/io_uring/operation/mod.rs @@ -12,7 +12,7 @@ use std::fmt::{self, Debug}; pub use cqe::Cqe; pub(crate) use sqe::Sqe; -use crate::io_uring::generated::{self, IOSQE_FIXED_FILE_BIT, io_uring_sqe}; +use crate::io_uring::generated::{io_uring_op, io_uring_sqe, io_uring_sqe_flags_bit}; /// The index of a registered fd. pub type FixedFd = u32; @@ -24,11 +24,11 @@ pub type FixedFd = u32; /// Supported operation types. pub enum OpCode { /// Read operation. - Read = generated::IORING_OP_READ as u8, + Read = io_uring_op::IORING_OP_READ as u8, /// Write operation. - Write = generated::IORING_OP_WRITE as u8, + Write = io_uring_op::IORING_OP_WRITE as u8, /// Fsync operation. - Fsync = generated::IORING_OP_FSYNC as u8, + Fsync = io_uring_op::IORING_OP_FSYNC as u8, } // Useful for outputting errors. @@ -120,7 +120,7 @@ impl Operation { // Needed for proptesting. #[cfg(test)] pub(crate) fn set_linked(&mut self) { - self.flags |= 1 << generated::IOSQE_IO_LINK_BIT; + self.flags |= 1 << io_uring_sqe_flags_bit::IOSQE_IO_LINK_BIT; } /// Transform the operation into an `Sqe`. @@ -133,7 +133,7 @@ impl Operation { inner.opcode = self.opcode as u8; inner.fd = i32::try_from(self.fd).unwrap(); // Simplifying assumption that we only used pre-registered FDs. - inner.flags = self.flags | (1 << IOSQE_FIXED_FILE_BIT); + inner.flags = self.flags | (1 << io_uring_sqe_flags_bit::IOSQE_FIXED_FILE_BIT); if let Some(addr) = self.addr { inner.__bindgen_anon_2.addr = addr as u64; diff --git a/src/vmm/src/io_uring/restriction.rs b/src/vmm/src/io_uring/restriction.rs index 54b8f5eefc8..071cccc3907 100644 --- a/src/vmm/src/io_uring/restriction.rs +++ b/src/vmm/src/io_uring/restriction.rs @@ -12,7 +12,9 @@ use std::convert::From; -use crate::io_uring::generated; +use crate::io_uring::generated::{ + io_uring_register_restriction_op, io_uring_restriction, io_uring_sqe_flags_bit, +}; use crate::io_uring::operation::OpCode; /// Adds support for restricting the operations allowed by io_uring. @@ -24,7 +26,7 @@ pub enum Restriction { RequireFixedFds, } -impl From<&Restriction> for generated::io_uring_restriction { +impl From<&Restriction> for io_uring_restriction { fn from(restriction: &Restriction) -> Self { use Restriction::*; @@ -33,13 +35,18 @@ impl From<&Restriction> for generated::io_uring_restriction { match restriction { AllowOpCode(opcode) => { - instance.opcode = u16::try_from(generated::IORING_RESTRICTION_SQE_OP).unwrap(); + instance.opcode = + u16::try_from(io_uring_register_restriction_op::IORING_RESTRICTION_SQE_OP) + .unwrap(); instance.__bindgen_anon_1.sqe_op = *opcode as u8; } RequireFixedFds => { - instance.opcode = - u16::try_from(generated::IORING_RESTRICTION_SQE_FLAGS_REQUIRED).unwrap(); - instance.__bindgen_anon_1.sqe_flags = 1 << generated::IOSQE_FIXED_FILE_BIT; + instance.opcode = u16::try_from( + io_uring_register_restriction_op::IORING_RESTRICTION_SQE_FLAGS_REQUIRED, + ) + .unwrap(); + instance.__bindgen_anon_1.sqe_flags = + 1 << io_uring_sqe_flags_bit::IOSQE_FIXED_FILE_BIT; } }; diff --git a/tools/bindgen-patches/0002-derive-clone-copy-in-io-uring.patch b/tools/bindgen-patches/0002-derive-clone-copy-in-io-uring.patch new file mode 100644 index 00000000000..92d7d1a3ade --- /dev/null +++ b/tools/bindgen-patches/0002-derive-clone-copy-in-io-uring.patch @@ -0,0 +1,42 @@ +diff --git a/src/vmm/src/io_uring/generated.rs b/src/vmm/src/io_uring/generated.rs +--- a/src/vmm/src/io_uring/generated.rs ++++ b/src/vmm/src/io_uring/generated.rs +@@ -206,6 +206,7 @@ + [::std::mem::offset_of!(__kernel_timespec, tv_nsec) - 8usize]; + }; + #[repr(C)] ++#[derive(Copy, Clone)] + pub struct io_uring_sqe { + pub opcode: __u8, + pub flags: __u8, +@@ -472,6 +473,7 @@ + } + } + #[repr(C)] ++#[derive(Copy, Clone)] + pub struct io_uring_sqe__bindgen_ty_6 { + pub __bindgen_anon_1: __BindgenUnionField, + pub optval: __BindgenUnionField<__u64>, +@@ -618,12 +620,11 @@ + pub const IORING_MSG_SEND_FD: Type = 1; + } + #[repr(C)] +-#[derive(Debug, Default)] ++#[derive(Clone, Copy, Debug, Default)] + pub struct io_uring_cqe { + pub user_data: __u64, + pub res: __s32, + pub flags: __u32, +- pub big_cqe: __IncompleteArrayField<__u64>, + } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] + const _: () = { +@@ -633,8 +634,6 @@ + [::std::mem::offset_of!(io_uring_cqe, user_data) - 0usize]; + ["Offset of field: io_uring_cqe::res"][::std::mem::offset_of!(io_uring_cqe, res) - 8usize]; + ["Offset of field: io_uring_cqe::flags"][::std::mem::offset_of!(io_uring_cqe, flags) - 12usize]; +- ["Offset of field: io_uring_cqe::big_cqe"] +- [::std::mem::offset_of!(io_uring_cqe, big_cqe) - 16usize]; + }; + #[repr(C)] + #[derive(Debug, Default, Copy, Clone, PartialEq)] diff --git a/tools/bindgen.sh b/tools/bindgen.sh index 86817a0561f..fdf55caff7e 100755 --- a/tools/bindgen.sh +++ b/tools/bindgen.sh @@ -35,20 +35,33 @@ function fc-bindgen { clippy::undocumented_unsafe_blocks, missing_debug_implementations, clippy::tests_outside_test_module, - unsafe_op_in_unsafe_fn + unsafe_op_in_unsafe_fn, + clippy::redundant_static_lifetimes )] EOF - bindgen --no-doc-comments --disable-header-comment --constified-enum '*' --with-derive-default --with-derive-partialeq $@ + bindgen --no-doc-comments --disable-header-comment --constified-enum-module '.*' --with-derive-default --with-derive-partialeq $@ } -KERNEL_HEADERS_HOME="/usr" +KERNEL_BRANCH="linux-6.12.y" +KERNEL_DIR="./$KERNEL_BRANCH" +HEADERS_DIR=$(realpath "./linux-headers") +# https://www.kernel.org/doc/Documentation/kbuild/headers_install.txt +# The Linux repo is huge. Just copy what we need. +[ -d $KERNEL_DIR ] || git clone --branch $KERNEL_BRANCH --depth 1 https://github.com/amazonlinux/linux $KERNEL_DIR + +(rm -rf $HEADERS_DIR && cd $KERNEL_DIR && make headers_install ARCH=x86_64 INSTALL_HDR_PATH=$HEADERS_DIR) + +INCLUDE="$HEADERS_DIR/include/" +ARCH_X86_INCLUDE="$KERNEL_DIR/arch/x86/include" + +export BINDGEN_EXTRA_CLANG_ARGS="-I$INCLUDE -I$ARCH_X86_INCLUDE" info "BINDGEN sockios.h" -fc-bindgen "$KERNEL_HEADERS_HOME/include/linux/sockios.h" |replace_linux_int_types >src/vmm/src/devices/virtio/net/generated/sockios.rs +fc-bindgen "$INCLUDE/linux/sockios.h" |replace_linux_int_types >src/vmm/src/devices/virtio/net/generated/sockios.rs info "BINDGEN if.h" -fc-bindgen "$KERNEL_HEADERS_HOME/include/linux/if.h" \ +fc-bindgen "$INCLUDE/linux/if.h" \ --allowlist-var='IF.*' \ --allowlist-type='if.*' \ --allowlist-type="net_device.*" \ @@ -64,79 +77,70 @@ fc-bindgen \ --allowlist-var='IFF_VNET_HDR' \ --allowlist-var='ETH_.*' \ --allowlist-type='ifreq' \ - "$KERNEL_HEADERS_HOME/include/linux/if_tun.h" >src/vmm/src/devices/virtio/net/generated/if_tun.rs + "$INCLUDE/linux/if_tun.h" >src/vmm/src/devices/virtio/net/generated/if_tun.rs info "BINDGEN virtio_ring.h" fc-bindgen \ --allowlist-var "VIRTIO_RING_F_EVENT_IDX" \ - "$KERNEL_HEADERS_HOME/include/linux/virtio_ring.h" >src/vmm/src/devices/virtio/generated/virtio_ring.rs + "$INCLUDE/linux/virtio_ring.h" >src/vmm/src/devices/virtio/generated/virtio_ring.rs info "BINDGEN virtio_config.h" fc-bindgen \ --allowlist-var "VIRTIO_F_.*" \ - "$KERNEL_HEADERS_HOME/include/linux/virtio_config.h" >src/vmm/src/devices/virtio/generated/virtio_config.rs + "$INCLUDE/linux/virtio_config.h" >src/vmm/src/devices/virtio/generated/virtio_config.rs info "BINDGEN virtio_blk.h" fc-bindgen \ --allowlist-var "VIRTIO_BLK_.*" \ - "$KERNEL_HEADERS_HOME/include/linux/virtio_blk.h" >src/vmm/src/devices/virtio/generated/virtio_blk.rs + "$INCLUDE/linux/virtio_blk.h" >src/vmm/src/devices/virtio/generated/virtio_blk.rs info "BINDGEN virtio_net.h" fc-bindgen \ --allowlist-var "VIRTIO_NET_F_.*" \ --allowlist-type "virtio_net_hdr_v1" \ - "$KERNEL_HEADERS_HOME/include/linux/virtio_net.h" >src/vmm/src/devices/virtio/generated/virtio_net.rs + "$INCLUDE/linux/virtio_net.h" >src/vmm/src/devices/virtio/generated/virtio_net.rs info "BINDGEN prctl.h" fc-bindgen \ --allowlist-var "PR_.*" \ - "$KERNEL_HEADERS_HOME/include/linux/prctl.h" >src/firecracker/src/generated/prctl.rs + "$INCLUDE/linux/prctl.h" >src/firecracker/src/generated/prctl.rs sed -i '/PR_SET_SPECULATION_CTRL/s/u32/i32/g' src/firecracker/src/generated/prctl.rs -# https://www.kernel.org/doc/Documentation/kbuild/headers_install.txt -# The Linux repo is huge. Just copy what we need. -# git clone --branch v5.10 --depth 1 https://github.com/torvalds/linux.git linux -git clone --branch linux-5.10.y --depth 1 https://github.com/amazonlinux/linux amazonlinux-v5.10.y - info "BINDGEN mpspec_def.h" -fc-bindgen amazonlinux-v5.10.y/arch/x86/include/asm/mpspec_def.h \ +fc-bindgen $ARCH_X86_INCLUDE/asm/mpspec_def.h \ >src/vmm/src/arch/x86_64/generated/mpspec.rs # https://github.com/rust-lang/rust-bindgen/issues/1274 info "BINDGEN msr-index.h" -cp -r amazonlinux-v5.10.y/include/asm-generic amazonlinux-v5.10.y/include/asm -sed -i -E 's/__no_(sanitize|kasan)_or_inline//g' amazonlinux-v5.10.y/include/asm/rwonce.h -fc-bindgen amazonlinux-v5.10.y/arch/x86/include/asm/msr-index.h \ +fc-bindgen $ARCH_X86_INCLUDE/asm/msr-index.h \ --allowlist-var "^MSR_.*$" \ -- \ - -Iamazonlinux-v5.10.y/include/ \ - -Iamazonlinux-v5.10.y/arch/x86/include/ \ -Wno-macro-redefined \ >src/vmm/src/arch/x86_64/generated/msr_index.rs perl -i -pe 's/= (\d+);/sprintf("= 0x%x;",$1)/eg' src/vmm/src/arch/x86_64/generated/msr_index.rs info "BINDGEN perf_event.h" -grep "MSR_ARCH_PERFMON_" amazonlinux-v5.10.y/arch/x86/include/asm/perf_event.h \ - >amazonlinux-v5.10.y/arch/x86/include/asm/perf_event_msr.h -fc-bindgen amazonlinux-v5.10.y/arch/x86/include/asm/perf_event_msr.h \ +grep "MSR_ARCH_PERFMON_" $ARCH_X86_INCLUDE/asm/perf_event.h \ + >$ARCH_X86_INCLUDE/asm/perf_event_msr.h +fc-bindgen $ARCH_X86_INCLUDE/asm/perf_event_msr.h \ --allowlist-var "^MSR_ARCH_PERFMON_.*$" \ -- \ >src/vmm/src/arch/x86_64/generated/perf_event.rs perl -i -pe 's/= (\d+);/sprintf("= 0x%x;",$1)/eg' src/vmm/src/arch/x86_64/generated/perf_event.rs info "BINDGEN hyperv.h" -grep "HV_X64_MSR_" amazonlinux-v5.10.y/arch/x86/kvm/hyperv.h \ - >amazonlinux-v5.10.y/arch/x86/kvm/hyperv_msr.h -fc-bindgen amazonlinux-v5.10.y/arch/x86/kvm/hyperv_msr.h \ +grep "#define HV_X64_MSR_" $KERNEL_DIR/arch/x86/kvm/hyperv.h \ + >$KERNEL_DIR/arch/x86/kvm/hyperv_msr.h +fc-bindgen $KERNEL_DIR/arch/x86/kvm/hyperv_msr.h \ --allowlist-var "^HV_X64_MSR_.*$" \ -- \ >src/vmm/src/arch/x86_64/generated/hyperv.rs perl -i -pe 's/= (\d+);/sprintf("= 0x%x;",$1)/eg' src/vmm/src/arch/x86_64/generated/hyperv.rs info "BINDGEN hyperv-tlfs.h" -grep "HV_X64_MSR_" amazonlinux-v5.10.y/arch/x86/include/asm/hyperv-tlfs.h \ - >amazonlinux-v5.10.y/arch/x86/include/asm/hyperv-tlfs_msr.h -fc-bindgen amazonlinux-v5.10.y/arch/x86/include/asm/hyperv-tlfs_msr.h \ +grep "HV_X64_MSR_" $ARCH_X86_INCLUDE/asm/hyperv-tlfs.h \ + >$ARCH_X86_INCLUDE/asm/hyperv-tlfs_msr.h +fc-bindgen $ARCH_X86_INCLUDE/asm/hyperv-tlfs_msr.h \ --allowlist-var "^HV_X64_MSR_.*$" \ -- \ >src/vmm/src/arch/x86_64/generated/hyperv_tlfs.rs @@ -149,17 +153,13 @@ fc-bindgen \ --allowlist-var "IOSQE_.+" \ --allowlist-type "io_uring_.+" \ --allowlist-type "io_.qring_offsets" \ - "amazonlinux-v5.10.y/include/uapi/linux/io_uring.h" \ + "$INCLUDE/linux/io_uring.h" \ >src/vmm/src/io_uring/generated.rs -# Latest upstream kernel -KERNEL_SRC_DIR="linux" -[ -d ${KERNEL_SRC_DIR} ] || git clone --depth 1 https://github.com/amazonlinux/linux ${KERNEL_SRC_DIR} - info "BINDGEN asm/prctl.h" fc-bindgen \ --allowlist-var "ARCH_.*" \ - "${KERNEL_SRC_DIR}/arch/x86/include/uapi/asm/prctl.h" >src/vmm/src/arch/x86_64/generated/arch_prctl.rs + "$ARCH_X86_INCLUDE/uapi/asm/prctl.h" >src/vmm/src/arch/x86_64/generated/arch_prctl.rs # Apply any patches info "Apply patches"