page_unlock(page);
put_page(page);
- /* More strict than x86_emulate_wrapper(), as this is now true for PV. */
- ASSERT(ptwr_ctxt.ctxt.event_pending == (rc == X86EMUL_EXCEPTION));
-
switch ( rc )
{
case X86EMUL_EXCEPTION:
else
rc = x86_emulate(&ctxt, &mmio_ro_emulate_ops);
- /* More strict than x86_emulate_wrapper(), as this is now true for PV. */
- ASSERT(ctxt.event_pending == (rc == X86EMUL_EXCEPTION));
-
switch ( rc )
{
case X86EMUL_EXCEPTION:
regs->eflags |= X86_EFLAGS_IF;
regs->eflags &= ~X86_EFLAGS_IOPL;
- /* More strict than x86_emulate_wrapper(). */
- ASSERT(ctxt.ctxt.event_pending == (rc == X86EMUL_EXCEPTION));
-
switch ( rc )
{
case X86EMUL_OKAY:
ASSERT(ctxt->regs->r(ip) == orig_ip);
/*
- * TODO: Make this true:
- *
- ASSERT(ctxt->event_pending == (rc == X86EMUL_EXCEPTION));
- *
- * Some codepaths still raise exceptions behind the back of the
- * emulator. (i.e. return X86EMUL_EXCEPTION but without
- * event_pending being set). In the meantime, use a slightly
- * relaxed check...
+ * An event being pending should exactly match returning
+ * X86EMUL_EXCEPTION. (If this trips, the chances are a codepath has
+ * called hvm_inject_hw_exception() rather than using
+ * x86_emul_hw_exception().)
*/
- if ( ctxt->event_pending )
- ASSERT(rc == X86EMUL_EXCEPTION);
+ ASSERT(ctxt->event_pending == (rc == X86EMUL_EXCEPTION));
return rc;
}