From mboxrd@z Thu Jan 1 00:00:00 1970 From: Don Slutz Subject: Re: [PATCH v9 06/13] xen: Add ring 3 vmware_port support Date: Mon, 23 Feb 2015 12:11:09 -0500 Message-ID: <54EB5F2D.5020500@terremark.com> References: <1424127915-27004-1-git-send-email-dslutz@verizon.com> <1424127915-27004-7-git-send-email-dslutz@verizon.com> <54EB515F0200007800062915@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <54EB515F0200007800062915@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich , Don Slutz Cc: Kevin Tian , Keir Fraser , Ian Campbell , Stefano Stabellini , George Dunlap , Andrew Cooper , Tim Deegan , xen-devel@lists.xen.org, Eddie Dong , Aravind Gopalakrishnan , Jun Nakajima , Suravee Suthikulpanit , Boris Ostrovsky , Ian Jackson List-Id: xen-devel@lists.xenproject.org On 02/23/15 10:12, Jan Beulich wrote: >>>> On 17.02.15 at 00:05, wrote: >> Enable no-fault of pio in x86_emulate for VMware port > > ??? > >> @@ -393,6 +393,11 @@ struct x86_emulate_ops >> enum x86_segment seg, >> unsigned long offset, >> struct x86_emulate_ctxt *ctxt); >> + >> + /* vmport_check */ >> + int (*vmport_check)( >> + unsigned int port, >> + struct x86_emulate_ctxt *ctxt); > > I hope that this will no longer be needed with the adjustments > Andrew suggested. In light of that I only skimmed the patch, > awaiting the next version to be less involved. > My understanding is that it is needed. The code in xen/arch/x86/x86_emulate is not to access code directly in xen/arch/x86/hvm. tools/tests/x86_emulator/test_x86_emulator.c would not build if the routine was access directly. Here is the code that passed my testing: case 0xe4: /* in imm8,%al */ case 0xe5: /* in imm8,%eax */ case 0xe6: /* out %al,imm8 */ case 0xe7: /* out %eax,imm8 */ case 0xec: /* in %dx,%al */ case 0xed: /* in %dx,%eax */ case 0xee: /* out %al,%dx */ case 0xef: /* out %eax,%dx */ { unsigned int port = ((b < 0xe8) ? insn_fetch_type(uint8_t) : (uint16_t)_regs.edx); bool_t vmport = (ops->vmport_check && /* Vmware backdoor? */ (ops->vmport_check(port, ctxt) == 0)); op_bytes = !(b & 1) ? 1 : (op_bytes == 8) ? 4 : op_bytes; if ( !vmport && (rc = ioport_access_check(port, op_bytes, ctxt, ops)) != 0 ) goto done; if ( b & 2 ) { /* out */ fail_if(ops->write_io == NULL); rc = ops->write_io(port, op_bytes, _regs.eax, ctxt); } else { /* in */ dst.type = OP_REG; dst.bytes = op_bytes; dst.reg = (unsigned long *)&_regs.eax; fail_if(ops->read_io == NULL); rc = ops->read_io(port, dst.bytes, &dst.val, ctxt); } if ( rc != 0 ) goto done; if ( vmport ) { _regs._ebx = ctxt->regs->_ebx; _regs._ecx = ctxt->regs->_ecx; _regs._edx = ctxt->regs->_edx; _regs._esi = ctxt->regs->_esi; _regs._edi = ctxt->regs->_edi; } break; } -Don Slutz > Jan > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel >