All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] xen-hvm: ignore background I/O sections
@ 2016-05-09 16:31 Paul Durrant
  2016-05-25 15:52 ` [Qemu-devel] " Anthony PERARD
  2016-05-25 15:52 ` Anthony PERARD
  0 siblings, 2 replies; 7+ messages in thread
From: Paul Durrant @ 2016-05-09 16:31 UTC (permalink / raw)
  To: qemu-devel, xen-devel
  Cc: Anthony Perard, Paolo Bonzini, Paul Durrant, Stefano Stabellini

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 <paul.durrant@citrix.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
---

v3:
 - Really add missing braces.

v2:
 - Add missing braces
---
 xen-hvm.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/xen-hvm.c b/xen-hvm.c
index 039680a..e394407 100644
--- a/xen-hvm.c
+++ b/xen-hvm.c
@@ -510,8 +510,13 @@ 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;
+    }
+
+    memory_region_ref(mr);
 
     xen_map_io_section(xen_xc, xen_domid, state->ioservid, section);
 }
@@ -520,10 +525,15 @@ 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,
-- 
2.1.4


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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH v3] xen-hvm: ignore background I/O sections
  2016-05-09 16:31 [PATCH v3] xen-hvm: ignore background I/O sections Paul Durrant
@ 2016-05-25 15:52 ` Anthony PERARD
  2016-05-25 18:04     ` Paolo Bonzini
  2016-05-25 15:52 ` Anthony PERARD
  1 sibling, 1 reply; 7+ messages in thread
From: Anthony PERARD @ 2016-05-25 15:52 UTC (permalink / raw)
  To: Paul Durrant; +Cc: qemu-devel, xen-devel, Stefano Stabellini, Paolo Bonzini

On Mon, May 09, 2016 at 05:31:20PM +0100, 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 <paul.durrant@citrix.com>
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> Cc: Anthony Perard <anthony.perard@citrix.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>

Acked-by: Anthony PERARD <anthony.perard@citrix.com>

-- 
Anthony PERARD

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3] xen-hvm: ignore background I/O sections
  2016-05-09 16:31 [PATCH v3] xen-hvm: ignore background I/O sections Paul Durrant
  2016-05-25 15:52 ` [Qemu-devel] " Anthony PERARD
@ 2016-05-25 15:52 ` Anthony PERARD
  1 sibling, 0 replies; 7+ messages in thread
From: Anthony PERARD @ 2016-05-25 15:52 UTC (permalink / raw)
  To: Paul Durrant; +Cc: xen-devel, Stefano Stabellini, qemu-devel, Paolo Bonzini

On Mon, May 09, 2016 at 05:31:20PM +0100, 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 <paul.durrant@citrix.com>
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> Cc: Anthony Perard <anthony.perard@citrix.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>

Acked-by: Anthony PERARD <anthony.perard@citrix.com>

-- 
Anthony PERARD

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH v3] xen-hvm: ignore background I/O sections
  2016-05-25 15:52 ` [Qemu-devel] " Anthony PERARD
@ 2016-05-25 18:04     ` Paolo Bonzini
  0 siblings, 0 replies; 7+ messages in thread
From: Paolo Bonzini @ 2016-05-25 18:04 UTC (permalink / raw)
  To: Anthony PERARD; +Cc: Paul Durrant, qemu-devel, xen-devel, Stefano Stabellini



----- Original Message -----
> From: "Anthony PERARD" <anthony.perard@citrix.com>
> To: "Paul Durrant" <paul.durrant@citrix.com>
> Cc: qemu-devel@nongnu.org, xen-devel@lists.xenproject.org, "Stefano Stabellini" <sstabellini@kernel.org>, "Paolo
> Bonzini" <pbonzini@redhat.com>
> Sent: Wednesday, May 25, 2016 5:52:32 PM
> Subject: Re: [PATCH v3] xen-hvm: ignore background I/O sections
> 
> On Mon, May 09, 2016 at 05:31:20PM +0100, 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 <paul.durrant@citrix.com>
> > Cc: Stefano Stabellini <sstabellini@kernel.org>
> > Cc: Anthony Perard <anthony.perard@citrix.com>
> > Cc: Paolo Bonzini <pbonzini@redhat.com>
> 
> Acked-by: Anthony PERARD <anthony.perard@citrix.com>

Do you have a signed GPG key or do I need to apply this for you?

Thanks,

Paolo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3] xen-hvm: ignore background I/O sections
@ 2016-05-25 18:04     ` Paolo Bonzini
  0 siblings, 0 replies; 7+ messages in thread
From: Paolo Bonzini @ 2016-05-25 18:04 UTC (permalink / raw)
  To: Anthony PERARD; +Cc: xen-devel, Paul Durrant, Stefano Stabellini, qemu-devel



----- Original Message -----
> From: "Anthony PERARD" <anthony.perard@citrix.com>
> To: "Paul Durrant" <paul.durrant@citrix.com>
> Cc: qemu-devel@nongnu.org, xen-devel@lists.xenproject.org, "Stefano Stabellini" <sstabellini@kernel.org>, "Paolo
> Bonzini" <pbonzini@redhat.com>
> Sent: Wednesday, May 25, 2016 5:52:32 PM
> Subject: Re: [PATCH v3] xen-hvm: ignore background I/O sections
> 
> On Mon, May 09, 2016 at 05:31:20PM +0100, 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 <paul.durrant@citrix.com>
> > Cc: Stefano Stabellini <sstabellini@kernel.org>
> > Cc: Anthony Perard <anthony.perard@citrix.com>
> > Cc: Paolo Bonzini <pbonzini@redhat.com>
> 
> Acked-by: Anthony PERARD <anthony.perard@citrix.com>

Do you have a signed GPG key or do I need to apply this for you?

Thanks,

Paolo

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH v3] xen-hvm: ignore background I/O sections
  2016-05-25 18:04     ` Paolo Bonzini
  (?)
@ 2016-05-26  9:09     ` Stefano Stabellini
  -1 siblings, 0 replies; 7+ messages in thread
From: Stefano Stabellini @ 2016-05-26  9:09 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Anthony PERARD, Paul Durrant, qemu-devel, xen-devel, Stefano Stabellini

On Wed, 25 May 2016, Paolo Bonzini wrote:
> > From: "Anthony PERARD" <anthony.perard@citrix.com>
> > To: "Paul Durrant" <paul.durrant@citrix.com>
> > Cc: qemu-devel@nongnu.org, xen-devel@lists.xenproject.org, "Stefano Stabellini" <sstabellini@kernel.org>, "Paolo
> > Bonzini" <pbonzini@redhat.com>
> > Sent: Wednesday, May 25, 2016 5:52:32 PM
> > Subject: Re: [PATCH v3] xen-hvm: ignore background I/O sections
> > 
> > On Mon, May 09, 2016 at 05:31:20PM +0100, 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 <paul.durrant@citrix.com>
> > > Cc: Stefano Stabellini <sstabellini@kernel.org>
> > > Cc: Anthony Perard <anthony.perard@citrix.com>
> > > Cc: Paolo Bonzini <pbonzini@redhat.com>
> > 
> > Acked-by: Anthony PERARD <anthony.perard@citrix.com>
> 
> Do you have a signed GPG key or do I need to apply this for you?

I was going to say, I'll just queue this up in my tree, but I don't have
any other commits at this time, so if you are OK with applying this, I
am fine with it too.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3] xen-hvm: ignore background I/O sections
  2016-05-25 18:04     ` Paolo Bonzini
  (?)
  (?)
@ 2016-05-26  9:09     ` Stefano Stabellini
  -1 siblings, 0 replies; 7+ messages in thread
From: Stefano Stabellini @ 2016-05-26  9:09 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Anthony PERARD, xen-devel, Paul Durrant, Stefano Stabellini, qemu-devel

On Wed, 25 May 2016, Paolo Bonzini wrote:
> > From: "Anthony PERARD" <anthony.perard@citrix.com>
> > To: "Paul Durrant" <paul.durrant@citrix.com>
> > Cc: qemu-devel@nongnu.org, xen-devel@lists.xenproject.org, "Stefano Stabellini" <sstabellini@kernel.org>, "Paolo
> > Bonzini" <pbonzini@redhat.com>
> > Sent: Wednesday, May 25, 2016 5:52:32 PM
> > Subject: Re: [PATCH v3] xen-hvm: ignore background I/O sections
> > 
> > On Mon, May 09, 2016 at 05:31:20PM +0100, 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 <paul.durrant@citrix.com>
> > > Cc: Stefano Stabellini <sstabellini@kernel.org>
> > > Cc: Anthony Perard <anthony.perard@citrix.com>
> > > Cc: Paolo Bonzini <pbonzini@redhat.com>
> > 
> > Acked-by: Anthony PERARD <anthony.perard@citrix.com>
> 
> Do you have a signed GPG key or do I need to apply this for you?

I was going to say, I'll just queue this up in my tree, but I don't have
any other commits at this time, so if you are OK with applying this, I
am fine with it too.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-05-26  9:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-09 16:31 [PATCH v3] xen-hvm: ignore background I/O sections Paul Durrant
2016-05-25 15:52 ` [Qemu-devel] " Anthony PERARD
2016-05-25 18:04   ` Paolo Bonzini
2016-05-25 18:04     ` Paolo Bonzini
2016-05-26  9:09     ` [Qemu-devel] " Stefano Stabellini
2016-05-26  9:09     ` Stefano Stabellini
2016-05-25 15:52 ` Anthony PERARD

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.