[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v9 06/13] xen: Add ring 3 vmware_port support



>>> On 23.02.15 at 18:11, <dslutz@xxxxxxxxxxx> wrote:
> On 02/23/15 10:12, Jan Beulich wrote:
>>>>> On 17.02.15 at 00:05, <dslutz@xxxxxxxxxxx> wrote:
>>> @@ -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;

Hmm, this looks ugly. At the very least - for this to become half
way acceptable - this should not be VMware specific in any way. I.e.
just have a generic (and generically usable) hook here which your
VMware port code then just happens to use.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.