MCPcopy Create free account
hub / github.com/Bareflank/hypervisor / bootstrap_entry

Function bootstrap_entry

kernel/integration/bf_vs_op_set_active.cpp:107–330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105 /// @param ppid0 the physical process to bootstrap
106 ///
107 extern "C" void
108 bootstrap_entry(bsl::safe_u16::value_type const ppid0) noexcept
109 {
110 constexpr auto one{bsl::safe_u16::magic_1()};
111 constexpr auto vmid0{bsl::safe_u16::magic_0()};
112 constexpr auto ppid1{bsl::safe_u16::magic_1()};
113
114 // invalid handle
115 {
116 constexpr auto hndl{BF_INVALID_HANDLE};
117 bf_status_t const ret{bf_vs_op_set_active_impl(hndl.get(), {}, {}, {})};
118 integration::require(ret != BF_STATUS_SUCCESS);
119 }
120
121 // invalid vmid
122 {
123 constexpr auto vmid{BF_INVALID_ID};
124 bf_status_t const ret{bf_vs_op_set_active_impl({}, vmid.get(), {}, {})};
125 integration::require(ret != BF_STATUS_SUCCESS);
126 }
127
128 // vmid out of range
129 {
130 constexpr auto vmid{(bsl::to_u16(HYPERVISOR_MAX_VSS) + one).checked()};
131 bf_status_t const ret{bf_vs_op_set_active_impl({}, vmid.get(), {}, {})};
132 integration::require(ret != BF_STATUS_SUCCESS);
133 }
134
135 // vmid never allocated
136 {
137 constexpr auto vmid{(bsl::to_u16(HYPERVISOR_MAX_VSS) - one).checked()};
138 bf_status_t const ret{bf_vs_op_set_active_impl({}, vmid.get(), {}, {})};
139 integration::require(ret != BF_STATUS_SUCCESS);
140 }
141
142 // invalid vpid
143 {
144 constexpr auto vpid{BF_INVALID_ID};
145 bf_status_t const ret{bf_vs_op_set_active_impl({}, {}, vpid.get(), {})};
146 integration::require(ret != BF_STATUS_SUCCESS);
147 }
148
149 // vpid out of range
150 {
151 constexpr auto vpid{(bsl::to_u16(HYPERVISOR_MAX_VSS) + one).checked()};
152 bf_status_t const ret{bf_vs_op_set_active_impl({}, {}, vpid.get(), {})};
153 integration::require(ret != BF_STATUS_SUCCESS);
154 }
155
156 // vpid never allocated
157 {
158 constexpr auto vpid{(bsl::to_u16(HYPERVISOR_MAX_VSS) - one).checked()};
159 bf_status_t const ret{bf_vs_op_set_active_impl({}, {}, vpid.get(), {})};
160 integration::require(ret != BF_STATUS_SUCCESS);
161 }
162
163 auto const vpid0{g_mut_sys.bf_vp_op_create_vp({})};
164 integration::require(vpid0.is_valid());

Callers

nothing calls this directly

Calls 15

bf_vs_op_set_active_implFunction · 0.85
requireFunction · 0.85
bf_control_op_exitFunction · 0.50
bf_vp_op_create_vpMethod · 0.45
bf_vs_op_create_vsMethod · 0.45
bf_vs_op_set_activeMethod · 0.45
bf_vm_op_create_vmMethod · 0.45
bf_tls_set_raxMethod · 0.45
bf_tls_set_rbxMethod · 0.45
bf_tls_set_rcxMethod · 0.45
bf_tls_set_rdxMethod · 0.45
bf_tls_set_rbpMethod · 0.45

Tested by

no test coverage detected