Remove the CPL and IOPL check in the I/O handling code in x86_emulate(). - For Realmode I/O emulation, this check is not needed because any I/O operation should be permitted in this mode. For I/O emulation in vmx_vmexit_handler() code path, this check is also not needed because processor has already checked the I/O permission before vmx_vmexit_handler() is called. Signed-off-by: Xu Dongxiao diff -r 59b8768d0d0d xen/arch/x86/x86_emulate.c --- a/xen/arch/x86/x86_emulate.c Wed Mar 05 11:18:25 2008 +0000 +++ b/xen/arch/x86/x86_emulate.c Tue Mar 18 09:42:20 2008 +0800 @@ -2255,7 +2255,6 @@ x86_emulate( case 0x6c ... 0x6d: /* ins %dx,%es:%edi */ { unsigned long nr_reps = get_rep_prefix(); - generate_exception_if(!mode_iopl(), EXC_GP, 0); dst.bytes = !(b & 1) ? 1 : (op_bytes == 8) ? 4 : op_bytes; dst.mem.seg = x86_seg_es; dst.mem.off = truncate_ea(_regs.edi); @@ -2285,7 +2284,6 @@ x86_emulate( case 0x6e ... 0x6f: /* outs %esi,%dx */ { unsigned long nr_reps = get_rep_prefix(); - generate_exception_if(!mode_iopl(), EXC_GP, 0); dst.bytes = !(b & 1) ? 1 : (op_bytes == 8) ? 4 : op_bytes; if ( (nr_reps > 1) && (ops->rep_outs != NULL) && ((rc = ops->rep_outs(ea.mem.seg, truncate_ea(_regs.esi), @@ -2818,7 +2816,6 @@ x86_emulate( unsigned int port = ((b < 0xe8) ? insn_fetch_type(uint8_t) : (uint16_t)_regs.edx); - generate_exception_if(!mode_iopl(), EXC_GP, 0); op_bytes = !(b & 1) ? 1 : (op_bytes == 8) ? 4 : op_bytes; if ( b & 2 ) {