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

[qemu-xen staging-4.15] xen-hvm: Allow disabling buffer_io_timer



commit 29d18e3c0713d3b81e7a6fa05c524786969c612b
Author:     Jason Andryuk <jandryuk@xxxxxxxxx>
AuthorDate: Fri Dec 10 14:34:34 2021 -0500
Commit:     Anthony PERARD <anthony.perard@xxxxxxxxxx>
CommitDate: Thu Mar 17 10:51:33 2022 +0000

    xen-hvm: Allow disabling buffer_io_timer
    
    commit f37f29d31488 "xen: slightly simplify bufioreq handling" hard
    coded setting req.count = 1 during initial field setup before the main
    loop.  This missed a subtlety that an early exit from the loop when
    there are no ioreqs to process, would have req.count == 0 for the return
    value.  handle_buffered_io() would then remove state->buffered_io_timer.
    Instead handle_buffered_iopage() is basically always returning true and
    handle_buffered_io() always re-setting the timer.
    
    Restore the disabling of the timer by introducing a new handled_ioreq
    boolean and use as the return value.  The named variable will more
    clearly show the intent of the code.
    
    Signed-off-by: Jason Andryuk <jandryuk@xxxxxxxxx>
    Reviewed-by: Paul Durrant <paul@xxxxxxx>
    Message-Id: <20211210193434.75566-1-jandryuk@xxxxxxxxx>
    Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
    (cherry picked from commit 9288e803e61e8d56d1c6c6aa8beb58596fb84ed9)
    [perard: fix context]
---
 hw/i386/xen/xen-hvm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c
index cde981bad6..cb5140f833 100644
--- a/hw/i386/xen/xen-hvm.c
+++ b/hw/i386/xen/xen-hvm.c
@@ -1084,10 +1084,11 @@ static void handle_ioreq(XenIOState *state, ioreq_t 
*req)
     }
 }
 
-static int handle_buffered_iopage(XenIOState *state)
+static bool handle_buffered_iopage(XenIOState *state)
 {
     buffered_iopage_t *buf_page = state->buffered_io_page;
     buf_ioreq_t *buf_req = NULL;
+    bool handled_ioreq = false;
     ioreq_t req;
     int qw;
 
@@ -1141,9 +1142,10 @@ static int handle_buffered_iopage(XenIOState *state)
         assert(!req.data_is_ptr);
 
         atomic_add(&buf_page->read_pointer, qw + 1);
+        handled_ioreq = true;
     }
 
-    return req.count;
+    return handled_ioreq;
 }
 
 static void handle_buffered_io(void *opaque)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.15



 


Rackspace

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