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

[Xen-changelog] [xen master] Restore HVM_OP hypercall continuation (partial revert of ae20ccf)



commit 7cc806d7f1d91dd4c4656f11226f043c749eb0ed
Author:     George Dunlap <george.dunlap@xxxxxxxxxx>
AuthorDate: Mon May 22 11:38:31 2017 +0100
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Wed May 24 17:15:34 2017 +0100

    Restore HVM_OP hypercall continuation (partial revert of ae20ccf)
    
    Commit ae20ccf removed the hypercall continuation logic from the end
    of do_hvm_op(), claiming:
    
    "This patch removes the need for handling HVMOP restarts, so that
    infrastructure is removed."
    
    That turns out to be false.  The removal of HVMOP_set_mem_type removed
    the need to store a start iteration value in the hypercall
    continuation, but a grep through hvm.c for ERESTART turns up at least
    two places where do_hvm_op() may still need a hypercall continuation:
    
     * HVMOP_set_hvm_param can return -ERESTART when setting
    HVM_PARAM_IDENT_PT in the event that it fails to acquire the domctl
    lock
    
     * HVMOP_flush_tlbs can return -ERESTART if several vcpus call it at
       the same time
    
    In both cases, a simple restart (with no stored iteration information)
    is necessary.
    
    Add a check for -ERESTART again, along with a comment at the top of
    the function regarding the lack of decoding any information from the
    op value.
    
    Reported-by: Xudong Hao <xudong.hao@xxxxxxxxx>
    Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Release-acked-by: Julien Grall <julien.grall@xxxxxxx>
    Tested-by: Xudong Hao <xudong.hao@xxxxxxxxx>
---
 xen/arch/x86/hvm/hvm.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 81691e2..273bcff 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -4544,6 +4544,13 @@ long do_hvm_op(unsigned long op, 
XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     long rc = 0;
 
+    /*
+     * NB: hvm_op can be part of a restarted hypercall; but at the
+     * moment the only hypercalls which do continuations don't need to
+     * store any iteration information (since they're just re-trying
+     * the acquisition of a lock).
+     */
+
     switch ( op )
     {
     case HVMOP_set_evtchn_upcall_vector:
@@ -4636,6 +4643,10 @@ long do_hvm_op(unsigned long op, 
XEN_GUEST_HANDLE_PARAM(void) arg)
     }
     }
 
+    if ( rc == -ERESTART )
+        rc = hypercall_create_continuation(__HYPERVISOR_hvm_op, "lh",
+                                           op, arg);
+
     return rc;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

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