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

Function bootstrap_entry

kernel/integration/bf_vm_op_unmap_direct.cpp:108–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106 /// @param ppid0 the physical process to bootstrap
107 ///
108 extern "C" void
109 bootstrap_entry(bsl::safe_u16::value_type const ppid0) noexcept
110 {
111 bsl::discard(ppid0);
112 bf_status_t mut_ret{};
113
114 // create with invalid handle
115 {
116 constexpr auto hndl{BF_INVALID_HANDLE};
117 constexpr auto virt{HYPERVISOR_EXT_DIRECT_MAP_ADDR};
118
119 mut_ret = bf_vm_op_unmap_direct_impl(hndl.get(), {}, virt.get());
120 integration::require(mut_ret != BF_STATUS_SUCCESS);
121 }
122
123 // create with invalid vmid
124 {
125 constexpr auto virt{HYPERVISOR_EXT_DIRECT_MAP_ADDR};
126
127 // BF_INVALID_ID
128 mut_ret = bf_vm_op_unmap_direct_impl({}, BF_INVALID_ID.get(), virt.get());
129 integration::require(mut_ret != BF_STATUS_SUCCESS);
130
131 // out of range
132 auto const oor{bsl::to_u16(HYPERVISOR_MAX_VMS + bsl::safe_u64::magic_1()).checked()};
133 mut_ret = bf_vm_op_unmap_direct_impl({}, oor.get(), virt.get());
134 integration::require(mut_ret != BF_STATUS_SUCCESS);
135
136 // not yet created
137 auto const nyc{bsl::to_u16(HYPERVISOR_MAX_VMS - bsl::safe_u64::magic_1()).checked()};
138 mut_ret = bf_vm_op_unmap_direct_impl({}, nyc.get(), virt.get());
139 integration::require(mut_ret != BF_STATUS_SUCCESS);
140 }
141
142 // create with invalid virt
143 {
144 // nullptr
145 mut_ret = bf_vm_op_unmap_direct_impl({}, {}, {});
146 integration::require(mut_ret != BF_STATUS_SUCCESS);
147
148 // out of range
149 auto const oor{0xFFFFFFFFFFFFF000_u64};
150 mut_ret = bf_vm_op_unmap_direct_impl({}, {}, oor.get());
151 integration::require(mut_ret != BF_STATUS_SUCCESS);
152
153 // unaligned address
154 auto const uaa{0x42_u64};
155 mut_ret = bf_vm_op_unmap_direct_impl({}, {}, uaa.get());
156 integration::require(mut_ret != BF_STATUS_SUCCESS);
157
158 // HYPERVISOR_MK_STACK_ADDR
159 mut_ret = bf_vm_op_unmap_direct_impl({}, {}, HYPERVISOR_MK_STACK_ADDR.get());
160 integration::require(mut_ret != BF_STATUS_SUCCESS);
161
162 // HYPERVISOR_MK_CODE_ADDR
163 mut_ret = bf_vm_op_unmap_direct_impl({}, {}, HYPERVISOR_MK_CODE_ADDR.get());
164 integration::require(mut_ret != BF_STATUS_SUCCESS);
165

Callers

nothing calls this directly

Calls 4

requireFunction · 0.85
bf_control_op_exitFunction · 0.50
bf_vm_op_unmap_directMethod · 0.45

Tested by

no test coverage detected