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

[xen staging-4.19] ioreq: don't wrongly claim "success" in ioreq_send_buffered()



commit d15e9fa3c880d0d2e0a3c19f0fa09ddac01e0ff9
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Oct 29 16:29:47 2024 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Oct 29 16:29:47 2024 +0100

    ioreq: don't wrongly claim "success" in ioreq_send_buffered()
    
    Returning a literal number is a bad idea anyway when all other returns
    use IOREQ_STATUS_* values. The function is dead on Arm, and mapping to
    X86EMUL_OKAY is surely wrong on x86.
    
    Fixes: f6bf39f84f82 ("x86/hvm: add support for broadcast of buffered 
ioreqs...")
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Julien Grall <jgrall@xxxxxxxxxx>
    master commit: 2e0b545b847df7d4feb07308d50bad708bd35a66
    master date: 2024-10-08 14:36:27 +0200
---
 xen/common/ioreq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/ioreq.c b/xen/common/ioreq.c
index 1257a3d972..f5fd30ce12 100644
--- a/xen/common/ioreq.c
+++ b/xen/common/ioreq.c
@@ -1175,7 +1175,7 @@ static int ioreq_send_buffered(struct ioreq_server *s, 
ioreq_t *p)
         return IOREQ_STATUS_UNHANDLED;
 
     /*
-     * Return 0 for the cases we can't deal with:
+     * Return UNHANDLED for the cases we can't deal with:
      *  - 'addr' is only a 20-bit field, so we cannot address beyond 1MB
      *  - we cannot buffer accesses to guest memory buffers, as the guest
      *    may expect the memory buffer to be synchronously accessed
@@ -1183,7 +1183,7 @@ static int ioreq_send_buffered(struct ioreq_server *s, 
ioreq_t *p)
      *    support data_is_ptr we do not waste space for the count field either
      */
     if ( (p->addr > 0xfffffUL) || p->data_is_ptr || (p->count != 1) )
-        return 0;
+        return IOREQ_STATUS_UNHANDLED;
 
     switch ( p->size )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19



 


Rackspace

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