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

[Xen-devel] [PATCH v15 09/14] x86/hvm: Introduce lapic_save_regs_one func


  • To: xen-devel@xxxxxxxxxxxxx
  • From: Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>
  • Date: Fri, 3 Aug 2018 16:53:46 +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: Fri, 03 Aug 2018 13:54:30 +0000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=bitdefender.com; b=zOU54GIGXvyG8OlfvuLjxRen1/R4IHgSCKG1OkW3b4gvcdWW4VgQBLSvNMPQUQUrW/vD2oKk3lpp9lQhFxF9s/im9Q8DaBYmeHU5zWhlCzA6zqDAfrL9nIdnvhuJwfDKBuAF8+TGSOcP+FddsNmyryWs0kXLJwqympgZ7ljn+NK6NMbTQ83VAPynm8ZDEQ8+hjABeNAewgIHZeUqfPwQk8MggOwqufpn0T+swXMI2KJUCocMJ/MlEWfhpWiLTJlGwAyQcHBhO05d7mgqrXOWvswvUXmfk1MWxAMb6sjBbTe06npm5jpydIzQJQxcKULhJ4rg3JzzCYmAHkcHCYC6FA==; 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 is used to save data from a single instance.

Signed-off-by: Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>
---
 xen/arch/x86/hvm/vlapic.c | 27 +++++++++++++++++++--------
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 0795161..d35810e 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -1460,26 +1460,37 @@ static int lapic_save_hidden(struct domain *d, 
hvm_domain_context_t *h)
     return err;
 }
 
+static int lapic_save_regs_one(struct vcpu *v, hvm_domain_context_t *h)
+{
+    struct vlapic *s;
+
+    if ( !has_vlapic(v->domain) )
+        return 0;
+
+    if ( hvm_funcs.sync_pir_to_irr )
+        hvm_funcs.sync_pir_to_irr(v);
+
+    s = vcpu_vlapic(v);
+
+    return hvm_save_entry(LAPIC_REGS, v->vcpu_id, h, s->regs);
+}
+
 static int lapic_save_regs(struct domain *d, hvm_domain_context_t *h)
 {
     struct vcpu *v;
-    struct vlapic *s;
-    int rc = 0;
+    int err = 0;
 
     if ( !has_vlapic(d) )
         return 0;
 
     for_each_vcpu ( d, v )
     {
-        if ( hvm_funcs.sync_pir_to_irr )
-            hvm_funcs.sync_pir_to_irr(v);
-
-        s = vcpu_vlapic(v);
-        if ( (rc = hvm_save_entry(LAPIC_REGS, v->vcpu_id, h, s->regs)) != 0 )
+        err = lapic_save_regs_one(v, h);
+        if ( err )
             break;
     }
 
-    return rc;
+    return err;
 }
 
 /*
-- 
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®.