If xc_hvm_inject_trap() is called on a software (user defined)
interrupt, it causes the guest to crash with a vmentry failure. The
following patch fixes this issue.
Signed-off-by: Aravindh Puthiyaparambil <aravindh@virtuata.com>
Committed-by: Keir Fraser <keir@xen.org>
}
if ( cpu_has_monitor_trap_flag )
break;
+ /* fall through */
+
case TRAP_int3:
if ( curr->domain->debugger_attached )
{
type = X86_EVENTTYPE_SW_EXCEPTION;
__vmwrite(VM_ENTRY_INSTRUCTION_LEN, 1); /* int3 */
+ break;
+
+ default:
+ if ( trap > TRAP_last_reserved )
+ {
+ type = X86_EVENTTYPE_SW_EXCEPTION;
+ __vmwrite(VM_ENTRY_INSTRUCTION_LEN, 2); /* int imm8 */
+ }
+ break;
}
if ( unlikely(intr_info & INTR_INFO_VALID_MASK) &&
#define TRAP_alignment_check 17
#define TRAP_machine_check 18
#define TRAP_simd_error 19
+#define TRAP_last_reserved 31
/* Set for entry via SYSCALL. Informs return code to use SYSRETQ not IRETQ. */
/* NB. Same as VGCF_in_syscall. No bits in common with any other TRAP_ defn. */