Exemple #1
0
/*
** Hardware exec traps are checked before
** insn execution. But hardware data, i/o
** and single-step traps are checked after.
**
** If we emulated an insn, we may loose
** a #DB condition, so take care here.
**
** We do not inject #DB, we use pending db
*/
static int vmx_db_check_pending_any()
{
   if(!__vmexit_on_insn())
   {
#ifdef CONFIG_VMX_DB_DBG
      if(vm_state.rflags.tf)
      {
         vmcs_read(vm_state.activity);
         vmcs_read(vm_state.interrupt);
         debug(VMX_DB,
               "TF is set, pending #DB: be:%d bs:%d sti:%d mss:%d activity:0x%x\n"
               ,vm_state.dbg_excp.be, vm_state.dbg_excp.bs
               ,vm_state.interrupt.sti, vm_state.interrupt.mss
               ,vm_state.activity.raw);
      }
#endif
      return VM_IGNORE;
   }

   if(vmx_db_check_pending_stp() == VM_DONE)
   {
      debug(VMX_DB, "pending #DB: set stp\n");
      vm_state.dbg_excp.bs = 1;
      vmcs_dirty(vm_state.dbg_excp);
   }

   /* XXX: missing data/io */

   return VM_DONE;
}
Exemple #2
0
/*
** Hardware exec traps are checked before
** insn execution. But hardware data, i/o
** and single-step traps are checked after.
**
** If we emulated an insn, we may loose
** a #DB condition, so take care here.
**
** We do not inject #DB, we use pending db
*/
static int vmx_db_check_pending_any()
{
   if(!__vmexit_on_insn())
      return VM_IGNORE;

   /* XXX: missing data/io */
   if(vmx_db_check_pending_stp() == VM_DONE)
   {
      vm_state.dbg_excp.bs = 1;
      vmcs_dirty(vm_state.dbg_excp);
   }

   return VM_DONE;
}