| 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()); |
nothing calls this directly
no test coverage detected