Skip to contentSkip to conversation

xen-hvm: ignore background I/O sections

PATCH In review Paul Durrant 4 participants 6 messages May 9, 2016 – May 26, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 xen-hvm: ignore background I/O sections

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.

Cc Stefano Stabellini <[email protected]>
Cc Anthony Perard <[email protected]>
Cc Paolo Bonzini <[email protected]>

---

v3:
- Really add missing braces.

v2:
- Add missing braces

---
 xen-hvm.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
xen-hvm.c +12 -2
index 039680a..e394407 100644
@@ -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,
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Acked-by on v3 1/1
#1 lore raw
Quoted 11 lines · Paul Durrant

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.

Cc Stefano Stabellini <[email protected]>
Cc Anthony Perard <[email protected]>
Cc Paolo Bonzini <[email protected]>
Signature · 6 lines
Anthony PERARD

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Acked-by on v3 1/1
#2 lore raw
In reply to Paul Durrant
Quoted 11 lines · Paul Durrant

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.

Cc Stefano Stabellini <[email protected]>
Cc Anthony Perard <[email protected]>
Cc Paolo Bonzini <[email protected]>
Signature · 1 line
Anthony PERARD
#3 lore raw

----- Original Message -----

Quoted 15 lines

From: "Anthony PERARD" <[email protected]>
To: "Paul Durrant" <[email protected]>
Cc: [email protected], [email protected], "Stefano Stabellini" <[email protected]>, "Paolo Bonzini" <[email protected]>
Sent: Wednesday, May 25, 2016 5:52:32 PM
Subject: Re: [PATCH v3] xen-hvm: ignore background I/O sections

Quoted 7 lines · Paul Durrant

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.

Quoted 6 lines
Quoted 4 lines
Cc Stefano Stabellini <[email protected]>
Cc Anthony Perard <[email protected]>
Cc Paolo Bonzini <[email protected]>

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

Thanks,

Paolo

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#4 lore raw
Quoted 15 lines · Paolo Bonzini
Quoted 15 lines

From: "Anthony PERARD" <[email protected]>
To: "Paul Durrant" <[email protected]>
Cc: [email protected], [email protected], "Stefano Stabellini" <[email protected]>, "Paolo Bonzini" <[email protected]>
Sent: Wednesday, May 25, 2016 5:52:32 PM
Subject: Re: [PATCH v3] xen-hvm: ignore background I/O sections

Quoted 7 lines · Paul Durrant

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.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Cc Stefano Stabellini <[email protected]>
Cc Anthony Perard <[email protected]>
Cc Paolo Bonzini <[email protected]>

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
[email protected]
http://lists.xen.org/xen-devel

#5 lore raw
In reply to Paolo Bonzini
Quoted 15 lines · Paolo Bonzini
Quoted 15 lines

From: "Anthony PERARD" <[email protected]>
To: "Paul Durrant" <[email protected]>
Cc: [email protected], [email protected], "Stefano Stabellini" <[email protected]>, "Paolo Bonzini" <[email protected]>
Sent: Wednesday, May 25, 2016 5:52:32 PM
Subject: Re: [PATCH v3] xen-hvm: ignore background I/O sections

Quoted 7 lines · Paul Durrant

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.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Cc Stefano Stabellini <[email protected]>
Cc Anthony Perard <[email protected]>
Cc Paolo Bonzini <[email protected]>

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.