a64_emit_x64: Clear exclusive state in EmitA64CallSupervisor

The kernel would have to execute an ERET instruction to return to
userland; this clears exclusive state.
This commit is contained in:
MerryMage 2018-06-05 13:05:41 +01:00
parent 57f7c7e1b0
commit 2a8de5f733

View file

@ -486,6 +486,8 @@ void A64EmitX64::EmitA64CallSupervisor(A64EmitContext& ctx, IR::Inst* inst) {
DEVIRT(conf.callbacks, &A64::UserCallbacks::CallSVC).EmitCall(code, [&](RegList param) {
code.mov(param[0], imm);
});
// The kernel would have to execute ERET to get here, which would clear exclusive state.
code.mov(code.byte[r15 + offsetof(A64JitState, exclusive_state)], u8(0));
}
void A64EmitX64::EmitA64ExceptionRaised(A64EmitContext& ctx, IR::Inst* inst) {