On Mon, Sep 28, 2015 at 2:54 PM, Chris Metcalf <cmetcalf@xxxxxxxxxx> wrote:
On 09/28/2015 04:51 PM, Andy Lutomirski wrote:It's already like that in Linus' tree.
On Mon, Sep 28, 2015 at 11:17 AM, Chris Metcalf <cmetcalf@xxxxxxxxxx>
@@ -35,8 +36,12 @@ static inline enum ctx_state exception_enter(void)x86 does not promise to call this function. In fact, x86 is rather
return 0;
prev_ctx = this_cpu_read(context_tracking.state);
- if (prev_ctx != CONTEXT_KERNEL)
- context_tracking_exit(prev_ctx);
+ if (prev_ctx != CONTEXT_KERNEL) {
+ if (context_tracking_exit(prev_ctx)) {
+ if (task_isolation_strict())
+ task_isolation_exception();
+ }
+ }
return prev_ctx;
}
likely to stop ever calling this function in the reasonably near
future.
Yes, in which case we'd have to do it the same way we are doing
it for arm64 (see patch 09/11), by calling task_isolation_exception()
explicitly from within the relevant exception handlers. If we start
doing that, it's probably worth wrapping up the logic into a single
inline function to keep the added code short and sweet.
If in fact this might happen in the short term, it might be a good
idea to hook the individual exception handlers in x86 now, and not
hook the exception_enter() mechanism at all.
FWIW, most of those exception handlers send signals, so it might pay
to do it in notify_die or die instead.
For x86, the relevant info might be the actual hw error number
(error_code, which makes it into die) or the signal. If we send a
death signal, then reporting the error number the usual way might make
sense.