ia64/xen-unstable

changeset 17719:30bf34f5a414

x86_emulate: Check single-step status at instruction start rather than end.

This fixes booting of FreeDOS with HIMEM.SYS enabled.

Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Sat May 24 08:54:59 2008 +0100 (2008-05-24)
parents ef7525e87030
children 6c4cab061af4
files xen/arch/x86/x86_emulate/x86_emulate.c
line diff
     1.1 --- a/xen/arch/x86/x86_emulate/x86_emulate.c	Fri May 23 11:58:08 2008 +0100
     1.2 +++ b/xen/arch/x86/x86_emulate/x86_emulate.c	Sat May 24 08:54:59 2008 +0100
     1.3 @@ -2105,12 +2105,14 @@ x86_emulate(
     1.4          break;
     1.5      }
     1.6  
     1.7 +    /* Inject #DB if single-step tracing was enabled at instruction start. */
     1.8 +    if ( (ctxt->regs->eflags & EFLG_TF) && (rc == X86EMUL_OKAY) &&
     1.9 +         (ops->inject_hw_exception != NULL) )
    1.10 +        rc = ops->inject_hw_exception(EXC_DB, -1, ctxt) ? : X86EMUL_EXCEPTION;
    1.11 +
    1.12      /* Commit shadow register state. */
    1.13      _regs.eflags &= ~EFLG_RF;
    1.14      *ctxt->regs = _regs;
    1.15 -    if ( (_regs.eflags & EFLG_TF) && (rc == X86EMUL_OKAY) &&
    1.16 -         (ops->inject_hw_exception != NULL) )
    1.17 -        rc = ops->inject_hw_exception(EXC_DB, -1, ctxt) ? : X86EMUL_EXCEPTION;
    1.18  
    1.19   done:
    1.20      return rc;