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

Function bootstrap_entry

kernel/integration/bf_vs_op_migrate.cpp:107–181  ·  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
112 auto const vpid{g_mut_sys.bf_vp_op_create_vp({})};
113 integration::require(vpid.is_valid());
114
115 // invalid handle
116 {
117 constexpr auto hndl{BF_INVALID_HANDLE};
118 bf_status_t const ret{bf_vs_op_migrate_impl(hndl.get(), {}, {})};
119 integration::require(ret != BF_STATUS_SUCCESS);
120 }
121
122 // invalid vsid
123 {
124 constexpr auto vsid{BF_INVALID_ID};
125 bf_status_t const ret{bf_vs_op_migrate_impl({}, vsid.get(), {})};
126 integration::require(ret != BF_STATUS_SUCCESS);
127 }
128
129 // vsid out of range
130 {
131 constexpr auto vsid{(bsl::to_u16(HYPERVISOR_MAX_VSS) + one).checked()};
132 bf_status_t const ret{bf_vs_op_migrate_impl({}, vsid.get(), {})};
133 integration::require(ret != BF_STATUS_SUCCESS);
134 }
135
136 // vsid never allocated
137 {
138 constexpr auto vsid{(bsl::to_u16(HYPERVISOR_MAX_VSS) - one).checked()};
139 bf_status_t const ret{bf_vs_op_migrate_impl({}, vsid.get(), {})};
140 integration::require(ret != BF_STATUS_SUCCESS);
141 }
142
143 auto const vsid{g_mut_sys.bf_vs_op_create_vs(vpid, bsl::to_u16(ppid0))};
144 integration::require(vsid.is_valid());
145
146 // invalid ppid
147 {
148 constexpr auto ppid{BF_INVALID_ID};
149 bf_status_t const ret{bf_vs_op_migrate_impl({}, vsid.get(), ppid.get())};
150 integration::require(ret != BF_STATUS_SUCCESS);
151 }
152
153 // ppid out of range
154 {
155 constexpr auto ppid{(bsl::to_u16(HYPERVISOR_MAX_PPS) + one).checked()};
156 bf_status_t const ret{bf_vs_op_migrate_impl({}, vsid.get(), ppid.get())};
157 integration::require(ret != BF_STATUS_SUCCESS);
158 }
159
160 // ppid not online
161 {
162 constexpr auto ppid{(bsl::to_u16(HYPERVISOR_MAX_PPS) - one).checked()};
163 bf_status_t const ret{bf_vs_op_migrate_impl({}, vsid.get(), ppid.get())};
164 integration::require(ret != BF_STATUS_SUCCESS);

Callers

nothing calls this directly

Calls 6

requireFunction · 0.85
bf_vs_op_migrate_implFunction · 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_migrateMethod · 0.45

Tested by

no test coverage detected