From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42003) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYZWW-0005fi-Ju for qemu-devel@nongnu.org; Mon, 29 Sep 2014 07:53:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XYZWP-0001ea-5N for qemu-devel@nongnu.org; Mon, 29 Sep 2014 07:53:48 -0400 Received: from cantor2.suse.de ([195.135.220.15]:40002 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYZWO-0001e7-Ur for qemu-devel@nongnu.org; Mon, 29 Sep 2014 07:53:41 -0400 Message-ID: <54294832.9060001@suse.de> Date: Mon, 29 Sep 2014 13:53:22 +0200 From: Alexander Graf MIME-Version: 1.0 References: <1411757235-29128-1-git-send-email-dslutz@verizon.com> <1411757235-29128-2-git-send-email-dslutz@verizon.com> <54291463.1080205@suse.de> <54293E24.3080205@redhat.com> In-Reply-To: <54293E24.3080205@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 1/1] xen-hvm.c: Add support for Xen access to vmport List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , Don Slutz , qemu-devel@nongnu.org Cc: xen-devel@lists.xensource.com, Marcel Apfelbaum , "Michael S. Tsirkin" , Markus Armbruster , Anthony Liguori , =?windows-1252?Q?Andreas_F=E4rber?= , Stefano Stabellini On 29.09.14 13:10, Paolo Bonzini wrote: > Il 29/09/2014 10:12, Alexander Graf ha scritto: >> Could you instead plug into the existing cpu_synchronize_registers() >> framework and just implement register synchronization for the Xen side= , >> just like it's been done for KVM? :) >=20 > No, because here it's Xen that sends out the register contents. With > KVM, it's QEMU that requests the register contents. So? We could still reuse the same infrastructure: cpu_handle_ioreq() { ... if (req->type =3D=3D IOPORT_REGISTERS_SYNCHRONIZED) { cpu->xen_vcpu_dirty =3D true; synchronize_xen_to_env(xenptr, cpu); } handle_ioreq(); if (req->type =3D=3D IOPORT_REGISTERS_SYNCHRONIZED) { cpu->xen_vcpu_dirty =3D false; synchronize_env_to_xen(xenptr, cpu); } ... } void xen_cpu_synchronize_state(CPUState *cpu) { assert(cpu->xen_vcpu_dirty); } Then no changes to the vmport code would be necessary and this problems where some code path wants to do direct access to registers automatically tells us that things are broken. Alex From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Graf Subject: Re: [PATCH 1/1] xen-hvm.c: Add support for Xen access to vmport Date: Mon, 29 Sep 2014 13:53:22 +0200 Message-ID: <54294832.9060001@suse.de> References: <1411757235-29128-1-git-send-email-dslutz@verizon.com> <1411757235-29128-2-git-send-email-dslutz@verizon.com> <54291463.1080205@suse.de> <54293E24.3080205@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <54293E24.3080205@redhat.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: Paolo Bonzini , Don Slutz , qemu-devel@nongnu.org Cc: xen-devel@lists.xensource.com, Marcel Apfelbaum , "Michael S. Tsirkin" , Markus Armbruster , Anthony Liguori , =?windows-1252?Q?Andreas_F=E4rber?= , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On 29.09.14 13:10, Paolo Bonzini wrote: > Il 29/09/2014 10:12, Alexander Graf ha scritto: >> Could you instead plug into the existing cpu_synchronize_registers() >> framework and just implement register synchronization for the Xen side, >> just like it's been done for KVM? :) > > No, because here it's Xen that sends out the register contents. With > KVM, it's QEMU that requests the register contents. So? We could still reuse the same infrastructure: cpu_handle_ioreq() { ... if (req->type == IOPORT_REGISTERS_SYNCHRONIZED) { cpu->xen_vcpu_dirty = true; synchronize_xen_to_env(xenptr, cpu); } handle_ioreq(); if (req->type == IOPORT_REGISTERS_SYNCHRONIZED) { cpu->xen_vcpu_dirty = false; synchronize_env_to_xen(xenptr, cpu); } ... } void xen_cpu_synchronize_state(CPUState *cpu) { assert(cpu->xen_vcpu_dirty); } Then no changes to the vmport code would be necessary and this problems where some code path wants to do direct access to registers automatically tells us that things are broken. Alex