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

Function bootstrap_entry

kernel/integration/bf_vs_op_write.cpp:107–189  ·  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 reg{bf_reg_t::bf_reg_t_rax};
118 bsl::safe_u64 mut_val{};
119
120 constexpr auto hndl{BF_INVALID_HANDLE};
121 bf_status_t const ret{bf_vs_op_write_impl(hndl.get(), {}, reg, mut_val.get())};
122 integration::require(ret != BF_STATUS_SUCCESS);
123 }
124
125 // invalid id
126 {
127 constexpr auto reg{bf_reg_t::bf_reg_t_rax};
128 bsl::safe_u64 mut_val{};
129
130 constexpr auto vsid{BF_INVALID_ID};
131 bf_status_t const ret{bf_vs_op_write_impl({}, vsid.get(), reg, mut_val.get())};
132 integration::require(ret != BF_STATUS_SUCCESS);
133 }
134
135 // id out of range
136 {
137 constexpr auto reg{bf_reg_t::bf_reg_t_rax};
138 bsl::safe_u64 mut_val{};
139
140 constexpr auto vsid{(bsl::to_u16(HYPERVISOR_MAX_VSS) + one).checked()};
141 bf_status_t const ret{bf_vs_op_write_impl({}, vsid.get(), reg, mut_val.get())};
142 integration::require(ret != BF_STATUS_SUCCESS);
143 }
144
145 // id never allocated
146 {
147 constexpr auto reg{bf_reg_t::bf_reg_t_rax};
148 bsl::safe_u64 mut_val{};
149
150 constexpr auto vsid{(bsl::to_u16(HYPERVISOR_MAX_VSS) - one).checked()};
151 bf_status_t const ret{bf_vs_op_write_impl({}, vsid.get(), reg, mut_val.get())};
152 integration::require(ret != BF_STATUS_SUCCESS);
153 }
154
155 auto const vsid{g_mut_sys.bf_vs_op_create_vs(vpid, bsl::to_u16(ppid0))};
156 integration::require(vsid.is_valid());
157
158 // unsupported reg
159 {
160 constexpr auto reg{bf_reg_t::bf_reg_t_unsupported};
161 bsl::safe_u64 mut_val{};
162
163 bf_status_t const ret{bf_vs_op_write_impl({}, vsid.get(), reg, mut_val.get())};
164 integration::require(ret != BF_STATUS_SUCCESS);

Callers

nothing calls this directly

Calls 7

requireFunction · 0.85
bf_vs_op_write_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_writeMethod · 0.45
bf_vs_op_readMethod · 0.45

Tested by

no test coverage detected