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

[Xen-devel] [PATCH v16 13/13] x86/domctl: Don't pause the whole domain if only getting vcpu state


  • To: xen-devel@xxxxxxxxxxxxx
  • From: Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>
  • Date: Thu, 9 Aug 2018 12:21:01 +0300
  • Cc: wei.liu2@xxxxxxxxxx, andrew.cooper3@xxxxxxxxxx, ian.jackson@xxxxxxxxxxxxx, paul.durrant@xxxxxxxxxx, jbeulich@xxxxxxxx, Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>
  • Comment: DomainKeys? See http://domainkeys.sourceforge.net/
  • Delivery-date: Thu, 09 Aug 2018 09:21:21 +0000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=bitdefender.com; b=pSV91W9GBkQjY8bm2my1k9PfblYU1+kq+sfqlsa6CVyVO3t1RbxAtT3XvCEQjk64jAtNuJ8+Bvh/NSUHQC4lcjcjCN/SSIkBMpOfjaNe/y0kb0bT4QJpW1ywAKPqFG11BltxGpGSoZ10Od6ce0rj4NU/VnkiW2Bg1S6Ns9sIQHLp+sZWTgjUWzCrX+yPtou32Nb+NK/dEQNxk93RaHatnL1tT6IRJMbDNap4mcurVU1dppVpP9NiLfKN2xi40wiiaAMtaO1nV47teBM3zk63tUbpMJj5PasmcR/MD4UJZPI4QSNnD3BqNy7vEz5rjaArVnCCC7tb2IpfiSAoeNCrwg==; h=Received:Received:Received:Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References;
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

This patch is focused on moving changing hvm_save_one() to save one
typecode from one vcpu and now that the save functions get data from a
single vcpu we can pause the specific vcpu instead of the domain.

Signed-off-by: Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>

---
Changes since V15:
        - Moved pause/unpause calls into hvm_save_one()
        - Re-add the loop in hvm_save_one().
---
 xen/arch/x86/domctl.c   |  2 --
 xen/arch/x86/hvm/save.c | 12 ++++++++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 8fbbf3a..cb53980 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -591,12 +591,10 @@ long arch_do_domctl(
              !is_hvm_domain(d) )
             break;
 
-        domain_pause(d);
         ret = hvm_save_one(d, domctl->u.hvmcontext_partial.type,
                            domctl->u.hvmcontext_partial.instance,
                            domctl->u.hvmcontext_partial.buffer,
                            &domctl->u.hvmcontext_partial.bufsz);
-        domain_unpause(d);
 
         if ( !ret )
             copyback = true;
diff --git a/xen/arch/x86/hvm/save.c b/xen/arch/x86/hvm/save.c
index 54abed4..e86430a 100644
--- a/xen/arch/x86/hvm/save.c
+++ b/xen/arch/x86/hvm/save.c
@@ -151,12 +151,15 @@ int hvm_save_one(struct domain *d, unsigned int typecode, 
unsigned int instance,
     if ( hvm_sr_handlers[typecode].kind == HVMSR_PER_DOM )
         instance = 0;
     ctxt.size = hvm_sr_handlers[typecode].size;
-    if ( hvm_sr_handlers[typecode].kind == HVMSR_PER_VCPU )
-        ctxt.size *= d->max_vcpus;
     ctxt.data = xmalloc_bytes(ctxt.size);
     if ( !ctxt.data )
         return -ENOMEM;
 
+    if ( hvm_sr_handlers[typecode].kind == HVMSR_PER_VCPU )
+        vcpu_pause(d->vcpu[instance]);
+    else
+        domain_pause(d);
+
     if ( (rv = hvm_sr_handlers[typecode].save(d->vcpu[instance], &ctxt)) != 0 )
         printk(XENLOG_G_ERR "HVM%d save: failed to save type %"PRIu16" (%d)\n",
                d->domain_id, typecode, rv);
@@ -188,6 +191,11 @@ int hvm_save_one(struct domain *d, unsigned int typecode, 
unsigned int instance,
         }
     }
 
+    if ( hvm_sr_handlers[typecode].kind == HVMSR_PER_VCPU )
+        vcpu_unpause(d->vcpu[instance]);
+    else
+        domain_unpause(d);
+
     xfree(ctxt.data);
     return rv;
 }
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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