All of lore.kernel.org
 help / color / mirror / Atom feed
From: Don Slutz <dslutz@verizon.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Don Slutz <dslutz@verizon.com>,
	xen-devel@lists.xen.org
Cc: Keir Fraser <keir@xen.org>,
	Ian Campbell <ian.campbell@citrix.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: Re: [RFC][PATCH 1/1] Add IOREQ_TYPE_VMWARE_PORT
Date: Thu, 02 Oct 2014 14:31:11 -0400	[thread overview]
Message-ID: <542D99EF.6060604@terremark.com> (raw)
In-Reply-To: <54293EEB.7000401@redhat.com>


On 09/29/14 07:13, Paolo Bonzini wrote:
> Il 26/09/2014 20:51, Don Slutz ha scritto:
>> +    memcpy(&regs->rax, &vio->io_data, vio->io_size);
> Shouldn't this match the code you use below for case
> HVMIO_handle_vmport_awaiting_completion?

Nope.  This path is either:

vio->io_state == HVMIO_completed at entry or the the error path
for "If there is no backing DM".  In both cases what to put in rax
is in vio->io_data with vio->io_size set also.

This code comes from hvmemul_do_io().

    -Don Slutz

> Paolo
>
>> +    return X86EMUL_OKAY;
>> +}
>> +
>>   static int hvmemul_do_io(
>>       int is_mmio, paddr_t addr, unsigned long *reps, int size,
>>       paddr_t ram_gpa, int dir, int df, void *p_data)
>> diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
>> index 9f565d6..96ef3ff 100644
>> --- a/xen/arch/x86/hvm/io.c
>> +++ b/xen/arch/x86/hvm/io.c
>> @@ -206,6 +206,25 @@ void hvm_io_assist(ioreq_t *p)
>>           else
>>               memcpy(&guest_cpu_user_regs()->rax, &p->data, vio->io_size);
>>           break;
>> +    case HVMIO_handle_vmport_awaiting_completion:
>> +    {
>> +        struct cpu_user_regs *regs = guest_cpu_user_regs();
>> +
>> +        /* Always zero extension for eax */
>> +        regs->rax = (uint32_t)(p->addr >> 32);
>> +        /* Only zero extension if 32bit register changed */
>> +        if ( (uint32_t)regs->rbx != (uint32_t)p->addr )
>> +            regs->rbx = (uint32_t)p->addr;
>> +        if ( (uint32_t)regs->rcx != (uint32_t)p->count )
>> +            regs->rcx = (uint32_t)p->count;
>> +        if ( (uint32_t)regs->rdx != (uint32_t)p->size )
>> +            regs->rdx = (uint32_t)p->size;
>> +        if ( (uint32_t)regs->rsi != (uint32_t)(p->data >> 32) )
>> +            regs->rsi = (uint32_t)(p->data >> 32);
>> +        if ( (uint32_t)regs->rdi != (uint32_t)p->data )
>> +            regs->rdi = (uint32_t)p->data;
>> +    }

      reply	other threads:[~2014-10-02 18:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-26 18:51 [RFC][PATCH 0/1] Add support for Xen access to vmport Don Slutz
2014-09-26 18:51 ` [RFC][PATCH 1/1] Add IOREQ_TYPE_VMWARE_PORT Don Slutz
2014-09-29 11:13   ` Paolo Bonzini
2014-10-02 18:31     ` Don Slutz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=542D99EF.6060604@terremark.com \
    --to=dslutz@verizon.com \
    --cc=ian.campbell@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=keir@xen.org \
    --cc=pbonzini@redhat.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.