diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 1661e663d0..7bc951dc1b 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -5420,9 +5420,6 @@ int ptwr_do_page_fault(struct vcpu *v, unsigned long addr, 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: @@ -5574,9 +5571,6 @@ int mmio_ro_do_page_fault(struct vcpu *v, unsigned long addr, 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: diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 13a609b3b4..08b00708be 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -3004,9 +3004,6 @@ static int emulate_privileged_op(struct cpu_user_regs *regs) 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: diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c index 667049df2f..ad62420579 100644 --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -6307,17 +6307,12 @@ int x86_emulate_wrapper( 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; }