<!-- description --> @brief Dispatches the VMExit. <!-- inputs/outputs --> @param gs the gs_t to use @param tls the tls_t to use @param mut_sys the bf_syscall_t to use @param intrinsic the intrinsic_t to use @param vp_pool the vp_pool_t to use @param vs_pool the vs_pool_t to use @param vsid the ID of the VS that generated the VMExit @param exit_reason the exit reason associated with the VMExit @r
| 60 | /// and friends otherwise |
| 61 | /// |
| 62 | [[nodiscard]] static constexpr auto |
| 63 | dispatch_vmexit( |
| 64 | gs_t const &gs, |
| 65 | tls_t const &tls, |
| 66 | syscall::bf_syscall_t &mut_sys, |
| 67 | intrinsic_t const &intrinsic, |
| 68 | vp_pool_t const &vp_pool, |
| 69 | vs_pool_t const &vs_pool, |
| 70 | bsl::safe_u16 const &vsid, |
| 71 | bsl::safe_u64 const &exit_reason) noexcept -> bsl::errc_type |
| 72 | { |
| 73 | constexpr auto exit_reason_nmi{0x0_u64}; |
| 74 | constexpr auto exit_reason_nmi_window{0x8_u64}; |
| 75 | constexpr auto exit_reason_cpuid{0xA_u64}; |
| 76 | |
| 77 | bsl::discard(vp_pool); |
| 78 | bsl::discard(vs_pool); |
| 79 | |
| 80 | switch (exit_reason.get()) { |
| 81 | case exit_reason_nmi.get(): { |
| 82 | return dispatch_vmexit_nmi(gs, tls, mut_sys, vsid); |
| 83 | } |
| 84 | |
| 85 | case exit_reason_nmi_window.get(): { |
| 86 | return dispatch_vmexit_nmi_window(gs, tls, mut_sys, vsid); |
| 87 | } |
| 88 | |
| 89 | case exit_reason_cpuid.get(): { |
| 90 | return dispatch_vmexit_cpuid(gs, tls, mut_sys, intrinsic, vsid); |
| 91 | } |
| 92 | |
| 93 | default: { |
| 94 | break; |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | bsl::error() << "unsupported vmexit: " << bsl::hex(exit_reason) << bsl::endl; |
| 99 | syscall::bf_debug_op_dump_vs(vsid); |
| 100 | bsl::print() << bsl::here(); |
| 101 | |
| 102 | return bsl::errc_failure; |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | #endif |
nothing calls this directly
no test coverage detected