| 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 | bsl::discard(ppid0); |
| 111 | bf_status_t mut_ret{}; |
| 112 | |
| 113 | auto const vpid{g_mut_sys.bf_vp_op_create_vp({})}; |
| 114 | integration::require(vpid.is_valid()); |
| 115 | |
| 116 | // create with invalid handle |
| 117 | { |
| 118 | bsl::safe_u16 mut_id{}; |
| 119 | constexpr auto hndl{BF_INVALID_HANDLE}; |
| 120 | |
| 121 | mut_ret = bf_vs_op_create_vs_impl(hndl.get(), {}, {}, mut_id.data()); |
| 122 | integration::require(mut_ret != BF_STATUS_SUCCESS); |
| 123 | } |
| 124 | |
| 125 | // create with invalid vpid |
| 126 | { |
| 127 | bsl::safe_u16 mut_id{}; |
| 128 | |
| 129 | // BF_INVALID_ID |
| 130 | mut_ret = bf_vs_op_create_vs_impl({}, BF_INVALID_ID.get(), {}, mut_id.data()); |
| 131 | integration::require(mut_ret != BF_STATUS_SUCCESS); |
| 132 | |
| 133 | // out of range |
| 134 | auto const oor{bsl::to_u16(HYPERVISOR_MAX_VPS + bsl::safe_u64::magic_1()).checked()}; |
| 135 | mut_ret = bf_vs_op_create_vs_impl({}, oor.get(), {}, mut_id.data()); |
| 136 | integration::require(mut_ret != BF_STATUS_SUCCESS); |
| 137 | |
| 138 | // not yet created |
| 139 | auto const nyc{bsl::to_u16(HYPERVISOR_MAX_VPS - bsl::safe_u64::magic_1()).checked()}; |
| 140 | mut_ret = bf_vs_op_create_vs_impl({}, nyc.get(), {}, mut_id.data()); |
| 141 | integration::require(mut_ret != BF_STATUS_SUCCESS); |
| 142 | } |
| 143 | |
| 144 | // create with invalid ppid |
| 145 | { |
| 146 | bsl::safe_u16 mut_id{}; |
| 147 | |
| 148 | // BF_INVALID_ID |
| 149 | mut_ret = bf_vs_op_create_vs_impl({}, {}, BF_INVALID_ID.get(), mut_id.data()); |
| 150 | integration::require(mut_ret != BF_STATUS_SUCCESS); |
| 151 | |
| 152 | // out of range |
| 153 | auto const oor{bsl::to_u16(HYPERVISOR_MAX_PPS + bsl::safe_u64::magic_1()).checked()}; |
| 154 | mut_ret = bf_vs_op_create_vs_impl({}, {}, oor.get(), mut_id.data()); |
| 155 | integration::require(mut_ret != BF_STATUS_SUCCESS); |
| 156 | |
| 157 | // not yet created |
| 158 | auto const nyc{bsl::to_u16(HYPERVISOR_MAX_PPS - bsl::safe_u64::magic_1()).checked()}; |
| 159 | mut_ret = bf_vs_op_create_vs_impl({}, {}, nyc.get(), mut_id.data()); |
| 160 | integration::require(mut_ret != BF_STATUS_SUCCESS); |
| 161 | } |
| 162 | |
| 163 | // create all and prove that creating one more will fail |
| 164 | { |
nothing calls this directly
no test coverage detected