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

[Xen-devel] [PATCH v3 05/10] ioreq: allow dispatching ioreqs to internal servers



Internal ioreq servers will be processed first due to the implementation
of FOR_EACH_IOREQ_SERVER, and ioreqs are dispatched simply by calling
the handler function.

Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
Reviewed-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
---
Changes since v2:
 - Have a single condition for buffered ioreqs.

Changes since v1:
 - Avoid having to iterate twice over the list of ioreq servers since
   now internal servers are always processed first by
   FOR_EACH_IOREQ_SERVER.
 - Obtain ioreq server id using pointer arithmetic.
---
 xen/arch/x86/hvm/ioreq.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/ioreq.c b/xen/arch/x86/hvm/ioreq.c
index cdbd4244a4..0649b7e02d 100644
--- a/xen/arch/x86/hvm/ioreq.c
+++ b/xen/arch/x86/hvm/ioreq.c
@@ -1482,7 +1482,16 @@ int hvm_send_ioreq(ioservid_t id, ioreq_t *proto_p, bool 
buffered)
     ASSERT(s);
 
     if ( buffered )
-        return hvm_send_buffered_ioreq(s, proto_p);
+    {
+        if ( likely(!hvm_ioreq_is_internal(id)) )
+            return hvm_send_buffered_ioreq(s, proto_p);
+
+        ASSERT_UNREACHABLE();
+        return X86EMUL_UNHANDLEABLE;
+    }
+
+    if ( hvm_ioreq_is_internal(id) )
+        return s->handler(proto_p, s->data);
 
     if ( unlikely(!vcpu_start_shutdown_deferral(curr)) )
         return X86EMUL_RETRY;
-- 
2.23.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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