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

Function dispatch_fail

example/default/mocks/dispatch_fail.hpp:63–99  ·  view source on GitHub ↗

<!-- 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

Source from the content-addressed store, hash-verified

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(sys);
79 bsl::discard(intrinsic);
80 bsl::discard(vp_pool);
81 bsl::discard(vs_pool);
82
83 /// NOTE:
84 /// - Tells the microkernel that we didn't handle the fast fail.
85 /// When this occurs, the microkernel will halt this PP. In most
86 /// cases, there are only two options for how to handle a fail:
87 /// - Do the following, and report an error and halt.
88 /// - Return to a parent VS and continue execution from there,
89 /// which is typically only possible if you are implementing
90 /// more than one VP/VS per PP (e.g., when implementing guest
91 /// support, VSM support or nested virtualization support).
92 ///
93 /// - Another use case is integration testing. We can also use this
94 /// to generate faults that we can recover from to ensure the
95 /// fault system works properly during testing.
96 ///
97
98 return tls.test_ret;
99 }
100}
101
102#endif

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected