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

[Xen-devel] [QEMU][RFC PATCH 5/6] xen-io: Handle the new ioreq type IOREQ_TYPE_PCI_CONFIG



This ioreq type is introduced to handle easily the access
to the PCI config space. Indeed, all PCI config spaces are access
by the same IO ports (cf8 -> cff).

Signed-off-by: Julien Grall <julien.grall@xxxxxxxxxx>
---
 xen-all.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/xen-all.c b/xen-all.c
index 2f5405c..2d001b8 100644
--- a/xen-all.c
+++ b/xen-all.c
@@ -853,6 +853,17 @@ static void cpu_ioreq_move(ioreq_t *req)
     }
 }
 
+static void cpu_ioreq_config_space(ioreq_t *req)
+{
+    uint64_t addr = req->addr;
+    uint64_t cf8 = req->addr & (~0x3);
+
+    req->addr = 0xcfc + (addr & 0x3);
+    do_outp(0xcf8, 4, cf8);
+    cpu_ioreq_pio(req);
+    req->addr = addr;
+}
+
 static void handle_ioreq(ioreq_t *req)
 {
     if (!req->data_is_ptr && (req->dir == IOREQ_WRITE) &&
@@ -872,6 +883,9 @@ static void handle_ioreq(ioreq_t *req)
         case IOREQ_TYPE_INVALIDATE:
             xen_invalidate_map_cache();
             break;
+        case IOREQ_TYPE_PCI_CONFIG:
+            cpu_ioreq_config_space(req);
+            break;
         default:
             hw_error("Invalid ioreq type 0x%x\n", req->type);
     }
-- 
Julien Grall


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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.