<!-- description --> @brief Dispatches the fail as needed, or returns an error so that the microkernel can halt the PP. <!-- inputs/outputs --> @param gs the gs_t to use @param tls the tls_t to use @param 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 errc the reason for the failure, which is CPU s
| 61 | /// and friends otherwise |
| 62 | /// |
| 63 | [[nodiscard]] static constexpr auto |
| 64 | dispatch_fail( |
| 65 | gs_t const &gs, |
| 66 | tls_t const &tls, |
| 67 | syscall::bf_syscall_t const &sys, |
| 68 | intrinsic_t const &intrinsic, |
| 69 | vp_pool_t const &vp_pool, |
| 70 | vs_pool_t const &vs_pool, |
| 71 | bsl::safe_u64 const &errc, |
| 72 | bsl::safe_u64 const &addr) noexcept -> bsl::errc_type |
| 73 | { |
| 74 | bsl::expects(errc.is_valid_and_checked()); |
| 75 | bsl::expects(addr.is_valid_and_checked()); |
| 76 | |
| 77 | bsl::discard(gs); |
| 78 | bsl::discard(tls); |
| 79 | bsl::discard(sys); |
| 80 | bsl::discard(intrinsic); |
| 81 | bsl::discard(vp_pool); |
| 82 | bsl::discard(vs_pool); |
| 83 | |
| 84 | /// NOTE: |
| 85 | /// - Tells the microkernel that we didn't handle the fast fail. |
| 86 | /// When this occurs, the microkernel will halt this PP. In most |
| 87 | /// cases, there are only two options for how to handle a fail: |
| 88 | /// - Do the following, and report an error and halt. |
| 89 | /// - Return to a parent VS and continue execution from there, |
| 90 | /// which is typically only possible if you are implementing |
| 91 | /// more than one VP/VS per PP (e.g., when implementing guest |
| 92 | /// support, VSM support or nested virtualization support). |
| 93 | /// |
| 94 | /// - Another use case is integration testing. We can also use this |
| 95 | /// to generate faults that we can recover from to ensure the |
| 96 | /// fault system works properly during testing. |
| 97 | /// |
| 98 | |
| 99 | return bsl::errc_failure; |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | #endif |
no outgoing calls
no test coverage detected