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

Function dispatch_fail

example/default/src/dispatch_fail.hpp:64–102  ·  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

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

Callers 5

fail_entryFunction · 0.70
behavior.cppFile · 0.50
requirements.cppFile · 0.50
behavior.cppFile · 0.50
requirements.cppFile · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected