]> xenbits.xensource.com Git - xen.git/commitdiff
x86/pio: allow internal PIO handlers to return RETRY
authorRoger Pau Monné <roger.pau@citrix.com>
Mon, 4 Dec 2017 10:02:16 +0000 (11:02 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 4 Dec 2017 10:02:16 +0000 (11:02 +0100)
Fix handle_pio so internal PIO handlers can return X86EMUL_RETRY and
it is properly handled by not advancing the IP.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
xen/arch/x86/hvm/io.c

index 9d9e1b0e4083e671d80a727423eef231040b524c..7e8b8ac61cdfc961d180d258350df5ec351c8aa9 100644 (file)
@@ -157,8 +157,11 @@ bool handle_pio(uint16_t port, unsigned int size, int dir)
         break;
 
     case X86EMUL_RETRY:
-        /* We should not advance RIP/EIP if the domain is shutting down */
-        if ( curr->domain->is_shutting_down )
+        /*
+         * We should not advance RIP/EIP if the domain is shutting down or
+         * if X86EMUL_RETRY has been returned by an internal handler.
+         */
+        if ( curr->domain->is_shutting_down || !hvm_io_pending(curr) )
             return false;
         break;