From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azoLC-0008Cn-Hl for qemu-devel@nongnu.org; Mon, 09 May 2016 12:47:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1azoL7-0006mi-9M for qemu-devel@nongnu.org; Mon, 09 May 2016 12:47:29 -0400 Received: from smtp.eu.citrix.com ([185.25.65.24]:57692) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azoL7-0006mb-2z for qemu-devel@nongnu.org; Mon, 09 May 2016 12:47:25 -0400 From: Paul Durrant Date: Mon, 9 May 2016 16:43:35 +0000 Message-ID: <5734344d476449c2839ea2b1feac7e37@AMSPEX02CL03.citrite.net> References: <1462811363-16219-1-git-send-email-paul.durrant@citrix.com> In-Reply-To: <1462811363-16219-1-git-send-email-paul.durrant@citrix.com> Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH v2] xen-hvm: ignore background I/O sections List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Durrant , "qemu-devel@nongnu.org" , "xen-devel@lists.xenproject.org" Cc: Stefano Stabellini , Anthony Perard , Paolo Bonzini > -----Original Message----- > From: Paul Durrant [mailto:paul.durrant@citrix.com] > Sent: 09 May 2016 17:29 > To: qemu-devel@nongnu.org; xen-devel@lists.xenproject.org > Cc: Paul Durrant; Stefano Stabellini; Anthony Perard; Paolo Bonzini > Subject: [PATCH v2] xen-hvm: ignore background I/O sections >=20 > Since Xen will correctly handle accesses to unimplemented I/O ports (by > returning all 1's for reads and ignoring writes) there is no need for > QEMU to register backgroud I/O sections. >=20 > This patch therefore adds checks to xen_io_add/del so that sections with > memory-region ops pointing at 'unassigned_io_ops' are ignored. >=20 > Signed-off-by: Paul Durrant > Cc: Stefano Stabellini > Cc: Anthony Perard > Cc: Paolo Bonzini > --- >=20 > v2: > - Add missing braces Aargh. Forgot to git add. Please ignore. Paul > --- > xen-hvm.c | 12 ++++++++++-- > 1 file changed, 10 insertions(+), 2 deletions(-) >=20 > diff --git a/xen-hvm.c b/xen-hvm.c > index 039680a..8ab44f0 100644 > --- a/xen-hvm.c > +++ b/xen-hvm.c > @@ -510,8 +510,12 @@ static void xen_io_add(MemoryListener *listener, > MemoryRegionSection *section) > { > XenIOState *state =3D container_of(listener, XenIOState, io_listener= ); > + MemoryRegion *mr =3D section->mr; >=20 > - memory_region_ref(section->mr); > + if (mr->ops =3D=3D &unassigned_io_ops) > + return; > + > + memory_region_ref(mr); >=20 > xen_map_io_section(xen_xc, xen_domid, state->ioservid, section); > } > @@ -520,10 +524,14 @@ static void xen_io_del(MemoryListener *listener, > MemoryRegionSection *section) > { > XenIOState *state =3D container_of(listener, XenIOState, io_listener= ); > + MemoryRegion *mr =3D section->mr; > + > + if (mr->ops =3D=3D &unassigned_io_ops) > + return; >=20 > xen_unmap_io_section(xen_xc, xen_domid, state->ioservid, section); >=20 > - memory_region_unref(section->mr); > + memory_region_unref(mr); > } >=20 > static void xen_device_realize(DeviceListener *listener, > -- > 2.1.4