diff --git a/mshv-bindings/src/arm64/bindings.rs b/mshv-bindings/src/arm64/bindings.rs index 14ec969..c1344bc 100644 --- a/mshv-bindings/src/arm64/bindings.rs +++ b/mshv-bindings/src/arm64/bindings.rs @@ -14171,7 +14171,8 @@ fn bindgen_test_layout_hv_input_set_partition_property() { } pub const hv_vp_state_page_type_HV_VP_STATE_PAGE_REGISTERS: hv_vp_state_page_type = 0; pub const hv_vp_state_page_type_HV_VP_STATE_PAGE_INTERCEPT_MESSAGE: hv_vp_state_page_type = 1; -pub const hv_vp_state_page_type_HV_VP_STATE_PAGE_COUNT: hv_vp_state_page_type = 2; +pub const hv_vp_state_page_type_HV_VP_STATE_PAGE_GHCB: hv_vp_state_page_type = 2; +pub const hv_vp_state_page_type_HV_VP_STATE_PAGE_COUNT: hv_vp_state_page_type = 3; pub type hv_vp_state_page_type = ::std::os::raw::c_uint; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] @@ -20803,6 +20804,11 @@ fn bindgen_test_layout_mshv_root_hvcall() { ) ); } +pub const MSHV_VP_MMAP_OFFSET_REGISTERS: _bindgen_ty_12 = 0; +pub const MSHV_VP_MMAP_OFFSET_INTERCEPT_MESSAGE: _bindgen_ty_12 = 1; +pub const MSHV_VP_MMAP_OFFSET_GHCB: _bindgen_ty_12 = 2; +pub const MSHV_VP_MMAP_OFFSET_COUNT: _bindgen_ty_12 = 3; +pub type _bindgen_ty_12 = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] pub struct mshv_run_vp { diff --git a/mshv-bindings/src/x86_64/bindings.rs b/mshv-bindings/src/x86_64/bindings.rs index 05d7648..e51c82e 100644 --- a/mshv-bindings/src/x86_64/bindings.rs +++ b/mshv-bindings/src/x86_64/bindings.rs @@ -325,6 +325,7 @@ pub const HV_X64_HYPERV_NESTED: u32 = 4096; pub const HV_X64_ENLIGHTENED_VMCS_RECOMMENDED: u32 = 16384; pub const HV_SHARED_GPA_BOUNDARY_ACTIVE: u32 = 32; pub const HV_VP_DISPATCH_INTERRUPT_INJECTION_AVAILABLE: u32 = 512; +pub const HV_VP_GHCB_ROOT_MAPPING_AVAILABLE: u32 = 1024; pub const HV_MAXIMUM_PROCESSORS: u32 = 2048; pub const HV_MAX_VP_INDEX: u32 = 2047; pub const HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE: u32 = 2; @@ -16705,7 +16706,8 @@ fn bindgen_test_layout_hv_input_set_partition_property() { } pub const hv_vp_state_page_type_HV_VP_STATE_PAGE_REGISTERS: hv_vp_state_page_type = 0; pub const hv_vp_state_page_type_HV_VP_STATE_PAGE_INTERCEPT_MESSAGE: hv_vp_state_page_type = 1; -pub const hv_vp_state_page_type_HV_VP_STATE_PAGE_COUNT: hv_vp_state_page_type = 2; +pub const hv_vp_state_page_type_HV_VP_STATE_PAGE_GHCB: hv_vp_state_page_type = 2; +pub const hv_vp_state_page_type_HV_VP_STATE_PAGE_COUNT: hv_vp_state_page_type = 3; pub type hv_vp_state_page_type = ::std::os::raw::c_uint; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] @@ -27373,6 +27375,11 @@ fn bindgen_test_layout_mshv_root_hvcall() { ) ); } +pub const MSHV_VP_MMAP_OFFSET_REGISTERS: _bindgen_ty_12 = 0; +pub const MSHV_VP_MMAP_OFFSET_INTERCEPT_MESSAGE: _bindgen_ty_12 = 1; +pub const MSHV_VP_MMAP_OFFSET_GHCB: _bindgen_ty_12 = 2; +pub const MSHV_VP_MMAP_OFFSET_COUNT: _bindgen_ty_12 = 3; +pub type _bindgen_ty_12 = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] pub struct mshv_run_vp { @@ -27412,13 +27419,13 @@ impl Default for mshv_run_vp { } } } -pub const MSHV_VP_STATE_LAPIC: _bindgen_ty_12 = 0; -pub const MSHV_VP_STATE_XSAVE: _bindgen_ty_12 = 1; -pub const MSHV_VP_STATE_SIMP: _bindgen_ty_12 = 2; -pub const MSHV_VP_STATE_SIEFP: _bindgen_ty_12 = 3; -pub const MSHV_VP_STATE_SYNTHETIC_TIMERS: _bindgen_ty_12 = 4; -pub const MSHV_VP_STATE_COUNT: _bindgen_ty_12 = 5; -pub type _bindgen_ty_12 = ::std::os::raw::c_uint; +pub const MSHV_VP_STATE_LAPIC: _bindgen_ty_13 = 0; +pub const MSHV_VP_STATE_XSAVE: _bindgen_ty_13 = 1; +pub const MSHV_VP_STATE_SIMP: _bindgen_ty_13 = 2; +pub const MSHV_VP_STATE_SIEFP: _bindgen_ty_13 = 3; +pub const MSHV_VP_STATE_SYNTHETIC_TIMERS: _bindgen_ty_13 = 4; +pub const MSHV_VP_STATE_COUNT: _bindgen_ty_13 = 5; +pub type _bindgen_ty_13 = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] pub struct mshv_get_set_vp_state { diff --git a/scripts/generate_binding.py b/scripts/generate_binding.py index fc48a9c..af8d564 100755 --- a/scripts/generate_binding.py +++ b/scripts/generate_binding.py @@ -129,7 +129,12 @@ def main(args): if __name__ == "__main__": parser = argparse.ArgumentParser( - description="Generate Rust bindings from Hyper-V headers from Linux kernel" + description="Generate Rust bindings from Hyper-V headers from Linux kernel", + epilog="example:\n" + "./generate_binding.py -k /opt/linux-dom0\n" + "./generate_binding.py -k /opt/linux-dom0 --arch x86\n" + "./generate_binding.py --bindgen=\"--with-derive-eq --with-derive-partialeq --with-derive-ord\" -k /opt/linux-dom0", + formatter_class=argparse.RawTextHelpFormatter ) parser.add_argument(