Skip to content

Commit 51427b2

Browse files
committed
bindgen: upgrade to linux 6.13 headers
vmclock is added in Linux 6.13. Upgrade the version we are using to create Rust bindings from to this version so we can get vmclock ABI definitions. Signed-off-by: Babis Chalios <bchalios@amazon.es>
1 parent ceeca6a commit 51427b2

File tree

4 files changed

+142
-11
lines changed

4 files changed

+142
-11
lines changed

src/firecracker/src/generated/prctl.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ pub const PR_MTE_TCF_MASK: u32 = 6;
141141
pub const PR_MTE_TAG_SHIFT: u32 = 3;
142142
pub const PR_MTE_TAG_MASK: u32 = 524280;
143143
pub const PR_MTE_TCF_SHIFT: u32 = 1;
144+
pub const PR_PMLEN_SHIFT: u32 = 24;
145+
pub const PR_PMLEN_MASK: u32 = 2130706432;
144146
pub const PR_SET_IO_FLUSHER: u32 = 57;
145147
pub const PR_GET_IO_FLUSHER: u32 = 58;
146148
pub const PR_SET_SYSCALL_USER_DISPATCH: u32 = 59;
@@ -197,3 +199,9 @@ pub const PR_PPC_DEXCR_CTRL_CLEAR: u32 = 4;
197199
pub const PR_PPC_DEXCR_CTRL_SET_ONEXEC: u32 = 8;
198200
pub const PR_PPC_DEXCR_CTRL_CLEAR_ONEXEC: u32 = 16;
199201
pub const PR_PPC_DEXCR_CTRL_MASK: u32 = 31;
202+
pub const PR_GET_SHADOW_STACK_STATUS: u32 = 74;
203+
pub const PR_SET_SHADOW_STACK_STATUS: u32 = 75;
204+
pub const PR_SHADOW_STACK_ENABLE: u32 = 1;
205+
pub const PR_SHADOW_STACK_WRITE: u32 = 2;
206+
pub const PR_SHADOW_STACK_PUSH: u32 = 4;
207+
pub const PR_LOCK_SHADOW_STACK_STATUS: u32 = 76;

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ pub const MSR_AMD64_OSVW_ID_LENGTH: u32 = 0xc0010140;
237237
pub const MSR_AMD64_OSVW_STATUS: u32 = 0xc0010141;
238238
pub const MSR_AMD_PPIN_CTL: u32 = 0xc00102f0;
239239
pub const MSR_AMD_PPIN: u32 = 0xc00102f1;
240-
pub const MSR_AMD64_CPUID_FN_7: u32 = 0xc0011002;
241240
pub const MSR_AMD64_CPUID_FN_1: u32 = 0xc0011004;
242241
pub const MSR_AMD64_LS_CFG: u32 = 0xc0011020;
243242
pub const MSR_AMD64_DC_CFG: u32 = 0xc0011022;

src/vmm/src/io_uring/generated.rs

Lines changed: 133 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ pub const IORING_SETUP_DEFER_TASKRUN: u32 = 8192;
107107
pub const IORING_SETUP_NO_MMAP: u32 = 16384;
108108
pub const IORING_SETUP_REGISTERED_FD_ONLY: u32 = 32768;
109109
pub const IORING_SETUP_NO_SQARRAY: u32 = 65536;
110+
pub const IORING_SETUP_HYBRID_IOPOLL: u32 = 131072;
110111
pub const IORING_URING_CMD_FIXED: u32 = 1;
111112
pub const IORING_URING_CMD_MASK: u32 = 1;
112113
pub const IORING_FSYNC_DATASYNC: u32 = 1;
@@ -142,6 +143,9 @@ pub const IORING_MSG_RING_CQE_SKIP: u32 = 1;
142143
pub const IORING_MSG_RING_FLAGS_PASS: u32 = 2;
143144
pub const IORING_FIXED_FD_NO_CLOEXEC: u32 = 1;
144145
pub const IORING_NOP_INJECT_RESULT: u32 = 1;
146+
pub const IORING_NOP_FILE: u32 = 2;
147+
pub const IORING_NOP_FIXED_FILE: u32 = 4;
148+
pub const IORING_NOP_FIXED_BUFFER: u32 = 8;
145149
pub const IORING_CQE_F_BUFFER: u32 = 1;
146150
pub const IORING_CQE_F_MORE: u32 = 2;
147151
pub const IORING_CQE_F_SOCK_NONEMPTY: u32 = 4;
@@ -164,6 +168,7 @@ pub const IORING_ENTER_SQ_WAIT: u32 = 4;
164168
pub const IORING_ENTER_EXT_ARG: u32 = 8;
165169
pub const IORING_ENTER_REGISTERED_RING: u32 = 16;
166170
pub const IORING_ENTER_ABS_TIMER: u32 = 32;
171+
pub const IORING_ENTER_EXT_ARG_REG: u32 = 64;
167172
pub const IORING_FEAT_SINGLE_MMAP: u32 = 1;
168173
pub const IORING_FEAT_NODROP: u32 = 2;
169174
pub const IORING_FEAT_SUBMIT_STABLE: u32 = 4;
@@ -779,7 +784,10 @@ pub mod io_uring_register_op {
779784
pub const IORING_UNREGISTER_NAPI: Type = 28;
780785
pub const IORING_REGISTER_CLOCK: Type = 29;
781786
pub const IORING_REGISTER_CLONE_BUFFERS: Type = 30;
782-
pub const IORING_REGISTER_LAST: Type = 31;
787+
pub const IORING_REGISTER_SEND_MSG_RING: Type = 31;
788+
pub const IORING_REGISTER_RESIZE_RINGS: Type = 33;
789+
pub const IORING_REGISTER_MEM_REGION: Type = 34;
790+
pub const IORING_REGISTER_LAST: Type = 35;
783791
pub const IORING_REGISTER_USE_REGISTERED_RING: Type = 2147483648;
784792
}
785793
#[repr(C)]
@@ -801,6 +809,60 @@ const _: () = {
801809
["Offset of field: io_uring_files_update::fds"]
802810
[::std::mem::offset_of!(io_uring_files_update, fds) - 8usize];
803811
};
812+
pub mod _bindgen_ty_1 {
813+
pub type Type = ::std::os::raw::c_uint;
814+
pub const IORING_MEM_REGION_TYPE_USER: Type = 1;
815+
}
816+
#[repr(C)]
817+
#[derive(Debug, Default, Copy, Clone, PartialEq)]
818+
pub struct io_uring_region_desc {
819+
pub user_addr: __u64,
820+
pub size: __u64,
821+
pub flags: __u32,
822+
pub id: __u32,
823+
pub mmap_offset: __u64,
824+
pub __resv: [__u64; 4usize],
825+
}
826+
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
827+
const _: () = {
828+
["Size of io_uring_region_desc"][::std::mem::size_of::<io_uring_region_desc>() - 64usize];
829+
["Alignment of io_uring_region_desc"][::std::mem::align_of::<io_uring_region_desc>() - 8usize];
830+
["Offset of field: io_uring_region_desc::user_addr"]
831+
[::std::mem::offset_of!(io_uring_region_desc, user_addr) - 0usize];
832+
["Offset of field: io_uring_region_desc::size"]
833+
[::std::mem::offset_of!(io_uring_region_desc, size) - 8usize];
834+
["Offset of field: io_uring_region_desc::flags"]
835+
[::std::mem::offset_of!(io_uring_region_desc, flags) - 16usize];
836+
["Offset of field: io_uring_region_desc::id"]
837+
[::std::mem::offset_of!(io_uring_region_desc, id) - 20usize];
838+
["Offset of field: io_uring_region_desc::mmap_offset"]
839+
[::std::mem::offset_of!(io_uring_region_desc, mmap_offset) - 24usize];
840+
["Offset of field: io_uring_region_desc::__resv"]
841+
[::std::mem::offset_of!(io_uring_region_desc, __resv) - 32usize];
842+
};
843+
pub mod _bindgen_ty_2 {
844+
pub type Type = ::std::os::raw::c_uint;
845+
pub const IORING_MEM_REGION_REG_WAIT_ARG: Type = 1;
846+
}
847+
#[repr(C)]
848+
#[derive(Debug, Default, Copy, Clone, PartialEq)]
849+
pub struct io_uring_mem_region_reg {
850+
pub region_uptr: __u64,
851+
pub flags: __u64,
852+
pub __resv: [__u64; 2usize],
853+
}
854+
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
855+
const _: () = {
856+
["Size of io_uring_mem_region_reg"][::std::mem::size_of::<io_uring_mem_region_reg>() - 32usize];
857+
["Alignment of io_uring_mem_region_reg"]
858+
[::std::mem::align_of::<io_uring_mem_region_reg>() - 8usize];
859+
["Offset of field: io_uring_mem_region_reg::region_uptr"]
860+
[::std::mem::offset_of!(io_uring_mem_region_reg, region_uptr) - 0usize];
861+
["Offset of field: io_uring_mem_region_reg::flags"]
862+
[::std::mem::offset_of!(io_uring_mem_region_reg, flags) - 8usize];
863+
["Offset of field: io_uring_mem_region_reg::__resv"]
864+
[::std::mem::offset_of!(io_uring_mem_region_reg, __resv) - 16usize];
865+
};
804866
#[repr(C)]
805867
#[derive(Debug, Default, Copy, Clone, PartialEq)]
806868
pub struct io_uring_rsrc_register {
@@ -989,16 +1051,20 @@ const _: () = {
9891051
["Offset of field: io_uring_clock_register::__resv"]
9901052
[::std::mem::offset_of!(io_uring_clock_register, __resv) - 4usize];
9911053
};
992-
pub mod _bindgen_ty_1 {
1054+
pub mod _bindgen_ty_3 {
9931055
pub type Type = ::std::os::raw::c_uint;
9941056
pub const IORING_REGISTER_SRC_REGISTERED: Type = 1;
1057+
pub const IORING_REGISTER_DST_REPLACE: Type = 2;
9951058
}
9961059
#[repr(C)]
9971060
#[derive(Debug, Default, Copy, Clone, PartialEq)]
9981061
pub struct io_uring_clone_buffers {
9991062
pub src_fd: __u32,
10001063
pub flags: __u32,
1001-
pub pad: [__u32; 6usize],
1064+
pub src_off: __u32,
1065+
pub dst_off: __u32,
1066+
pub nr: __u32,
1067+
pub pad: [__u32; 3usize],
10021068
}
10031069
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10041070
const _: () = {
@@ -1009,8 +1075,14 @@ const _: () = {
10091075
[::std::mem::offset_of!(io_uring_clone_buffers, src_fd) - 0usize];
10101076
["Offset of field: io_uring_clone_buffers::flags"]
10111077
[::std::mem::offset_of!(io_uring_clone_buffers, flags) - 4usize];
1078+
["Offset of field: io_uring_clone_buffers::src_off"]
1079+
[::std::mem::offset_of!(io_uring_clone_buffers, src_off) - 8usize];
1080+
["Offset of field: io_uring_clone_buffers::dst_off"]
1081+
[::std::mem::offset_of!(io_uring_clone_buffers, dst_off) - 12usize];
1082+
["Offset of field: io_uring_clone_buffers::nr"]
1083+
[::std::mem::offset_of!(io_uring_clone_buffers, nr) - 16usize];
10121084
["Offset of field: io_uring_clone_buffers::pad"]
1013-
[::std::mem::offset_of!(io_uring_clone_buffers, pad) - 8usize];
1085+
[::std::mem::offset_of!(io_uring_clone_buffers, pad) - 20usize];
10141086
};
10151087
#[repr(C)]
10161088
#[derive(Debug, Default, Copy, Clone, PartialEq)]
@@ -1170,24 +1242,42 @@ const _: () = {
11701242
["Offset of field: io_uring_buf_status::resv"]
11711243
[::std::mem::offset_of!(io_uring_buf_status, resv) - 8usize];
11721244
};
1245+
pub mod io_uring_napi_op {
1246+
pub type Type = ::std::os::raw::c_uint;
1247+
pub const IO_URING_NAPI_REGISTER_OP: Type = 0;
1248+
pub const IO_URING_NAPI_STATIC_ADD_ID: Type = 1;
1249+
pub const IO_URING_NAPI_STATIC_DEL_ID: Type = 2;
1250+
}
1251+
pub mod io_uring_napi_tracking_strategy {
1252+
pub type Type = ::std::os::raw::c_uint;
1253+
pub const IO_URING_NAPI_TRACKING_DYNAMIC: Type = 0;
1254+
pub const IO_URING_NAPI_TRACKING_STATIC: Type = 1;
1255+
pub const IO_URING_NAPI_TRACKING_INACTIVE: Type = 255;
1256+
}
11731257
#[repr(C)]
11741258
#[derive(Debug, Default, Copy, Clone, PartialEq)]
11751259
pub struct io_uring_napi {
11761260
pub busy_poll_to: __u32,
11771261
pub prefer_busy_poll: __u8,
1178-
pub pad: [__u8; 3usize],
1179-
pub resv: __u64,
1262+
pub opcode: __u8,
1263+
pub pad: [__u8; 2usize],
1264+
pub op_param: __u32,
1265+
pub resv: __u32,
11801266
}
11811267
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
11821268
const _: () = {
11831269
["Size of io_uring_napi"][::std::mem::size_of::<io_uring_napi>() - 16usize];
1184-
["Alignment of io_uring_napi"][::std::mem::align_of::<io_uring_napi>() - 8usize];
1270+
["Alignment of io_uring_napi"][::std::mem::align_of::<io_uring_napi>() - 4usize];
11851271
["Offset of field: io_uring_napi::busy_poll_to"]
11861272
[::std::mem::offset_of!(io_uring_napi, busy_poll_to) - 0usize];
11871273
["Offset of field: io_uring_napi::prefer_busy_poll"]
11881274
[::std::mem::offset_of!(io_uring_napi, prefer_busy_poll) - 4usize];
1189-
["Offset of field: io_uring_napi::pad"][::std::mem::offset_of!(io_uring_napi, pad) - 5usize];
1190-
["Offset of field: io_uring_napi::resv"][::std::mem::offset_of!(io_uring_napi, resv) - 8usize];
1275+
["Offset of field: io_uring_napi::opcode"]
1276+
[::std::mem::offset_of!(io_uring_napi, opcode) - 5usize];
1277+
["Offset of field: io_uring_napi::pad"][::std::mem::offset_of!(io_uring_napi, pad) - 6usize];
1278+
["Offset of field: io_uring_napi::op_param"]
1279+
[::std::mem::offset_of!(io_uring_napi, op_param) - 8usize];
1280+
["Offset of field: io_uring_napi::resv"][::std::mem::offset_of!(io_uring_napi, resv) - 12usize];
11911281
};
11921282
pub mod io_uring_register_restriction_op {
11931283
pub type Type = ::std::os::raw::c_uint;
@@ -1197,6 +1287,40 @@ pub mod io_uring_register_restriction_op {
11971287
pub const IORING_RESTRICTION_SQE_FLAGS_REQUIRED: Type = 3;
11981288
pub const IORING_RESTRICTION_LAST: Type = 4;
11991289
}
1290+
pub mod _bindgen_ty_4 {
1291+
pub type Type = ::std::os::raw::c_uint;
1292+
pub const IORING_REG_WAIT_TS: Type = 1;
1293+
}
1294+
#[repr(C)]
1295+
#[derive(Debug, Default, Copy, Clone, PartialEq)]
1296+
pub struct io_uring_reg_wait {
1297+
pub ts: __kernel_timespec,
1298+
pub min_wait_usec: __u32,
1299+
pub flags: __u32,
1300+
pub sigmask: __u64,
1301+
pub sigmask_sz: __u32,
1302+
pub pad: [__u32; 3usize],
1303+
pub pad2: [__u64; 2usize],
1304+
}
1305+
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1306+
const _: () = {
1307+
["Size of io_uring_reg_wait"][::std::mem::size_of::<io_uring_reg_wait>() - 64usize];
1308+
["Alignment of io_uring_reg_wait"][::std::mem::align_of::<io_uring_reg_wait>() - 8usize];
1309+
["Offset of field: io_uring_reg_wait::ts"]
1310+
[::std::mem::offset_of!(io_uring_reg_wait, ts) - 0usize];
1311+
["Offset of field: io_uring_reg_wait::min_wait_usec"]
1312+
[::std::mem::offset_of!(io_uring_reg_wait, min_wait_usec) - 16usize];
1313+
["Offset of field: io_uring_reg_wait::flags"]
1314+
[::std::mem::offset_of!(io_uring_reg_wait, flags) - 20usize];
1315+
["Offset of field: io_uring_reg_wait::sigmask"]
1316+
[::std::mem::offset_of!(io_uring_reg_wait, sigmask) - 24usize];
1317+
["Offset of field: io_uring_reg_wait::sigmask_sz"]
1318+
[::std::mem::offset_of!(io_uring_reg_wait, sigmask_sz) - 32usize];
1319+
["Offset of field: io_uring_reg_wait::pad"]
1320+
[::std::mem::offset_of!(io_uring_reg_wait, pad) - 36usize];
1321+
["Offset of field: io_uring_reg_wait::pad2"]
1322+
[::std::mem::offset_of!(io_uring_reg_wait, pad2) - 48usize];
1323+
};
12001324
#[repr(C)]
12011325
#[derive(Debug, Default, Copy, Clone, PartialEq)]
12021326
pub struct io_uring_getevents_arg {

tools/bindgen.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ EOF
4343
bindgen --no-doc-comments --disable-header-comment --constified-enum-module '.*' --with-derive-default --with-derive-partialeq $@
4444
}
4545

46-
KERNEL_BRANCH="linux-6.12.y"
46+
KERNEL_BRANCH="linux-6.13.y"
4747
KERNEL_DIR="./$KERNEL_BRANCH"
4848
HEADERS_DIR=$(realpath "./linux-headers")
4949
# https://www.kernel.org/doc/Documentation/kbuild/headers_install.txt

0 commit comments

Comments
 (0)