[xen master] x86/pio: allow internal PIO handlers to return RETRY

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen master] x86/pio: allow internal PIO handlers to return RETRY

patchbot
commit 8202ebb1124d90f26f47cee78c813d00c935e77b
Author:     Roger Pau Monné <[hidden email]>
AuthorDate: Mon Dec 4 11:02:16 2017 +0100
Commit:     Jan Beulich <[hidden email]>
CommitDate: Mon Dec 4 11:02:16 2017 +0100

    x86/pio: allow internal PIO handlers to return RETRY
   
    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é <[hidden email]>
    Reviewed-by: Paul Durrant <[hidden email]>
---
 xen/arch/x86/hvm/io.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index 9d9e1b0..7e8b8ac 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -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;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog