qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] xen-hvm: ignore background I/O sections


From: Paul Durrant
Subject: Re: [Qemu-devel] [PATCH] xen-hvm: ignore background I/O sections
Date: Mon, 9 May 2016 16:40:08 +0000

> -----Original Message-----
> From: Paolo Bonzini [mailto:address@hidden
> Sent: 09 May 2016 17:39
> To: Paul Durrant; address@hidden; address@hidden
> Cc: Stefano Stabellini; Anthony Perard
> Subject: Re: [PATCH] xen-hvm: ignore background I/O sections
> 
> 
> 
> On 09/05/2016 18:18, Paul Durrant wrote:
> > 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.
> >
> > This patch therefore adds checks to xen_io_add/del so that sections with
> > memory-region ops pointing at 'unassigned_io_ops' are ignored.
> >
> > Signed-off-by: Paul Durrant <address@hidden>
> > Cc: Stefano Stabellini <address@hidden>
> > Cc: Anthony Perard <address@hidden>
> > Cc: Paolo Bonzini <address@hidden>
> > ---
> >  xen-hvm.c | 12 ++++++++++--
> >  1 file changed, 10 insertions(+), 2 deletions(-)
> >
> > 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 = container_of(listener, XenIOState, io_listener);
> > +    MemoryRegion *mr = section->mr;
> >
> > -    memory_region_ref(section->mr);
> > +    if (mr->ops == &unassigned_io_ops)
> > +        return;
> 
> Missing braces, same in xen_io_del.  Otherwise looks ok.
> 

Ah, sorry. Forgot to style-switch. Will post v2.

> Paolo
> 
> > +    memory_region_ref(mr);
> >
> >      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 = container_of(listener, XenIOState, io_listener);
> > +    MemoryRegion *mr = section->mr;
> > +
> > +    if (mr->ops == &unassigned_io_ops)
> > +        return;
> >
> >      xen_unmap_io_section(xen_xc, xen_domid, state->ioservid, section);
> >
> > -    memory_region_unref(section->mr);
> > +    memory_region_unref(mr);
> >  }
> >
> >  static void xen_device_realize(DeviceListener *listener,
> >

reply via email to

[Prev in Thread] Current Thread [Next in Thread]