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

[Xen-devel] [PATCH v9 02/11] x86/hvm: Introduce hvm_save_tsc_adjust_one() func


  • To: xen-devel@xxxxxxxxxxxxx
  • From: Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>
  • Date: Thu, 28 Jun 2018 12:25:27 +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, 28 Jun 2018 09:26:00 +0000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=bitdefender.com; b=OvGz5V+R7nG01BB5fiiLvqShpZrNlIB3t4XJgTURS/qtA6KEAwpOms5I6i/DKKFzMD1cSCZU4ZCDzaUCtcVHFr72HRCkAlKKrsLBDs62EwK1SQ5dxbNXcqi+t6ruPQRM90vokNF0bVvML8qjGJhBrsEGA0X3Qt6bN3e3q7r59aPqu2LafCCPjhOtG7lCfM+K9g8l8DHrhTIZ8UDpwwSsgroqsNaUpfpzfrNzBC0lP7tQ+pk1lkgFOxF/kkg+NW5xvA2jVJ6VPzHaNQFI62kIRQ+UDSTHEkcw2v6Sc7UPbgmEik+SInYqsilzi7T7snqvKyNyiAtRYWne+Vm07+yAuA==; 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>

---
Changes since V8:
        - Move return check to the one function.
---
 xen/arch/x86/hvm/hvm.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 93092d2..f51da00 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -740,20 +740,28 @@ void hvm_domain_destroy(struct domain *d)
     destroy_vpci_mmcfg(d);
 }
 
+static int hvm_save_tsc_adjust_one(struct vcpu *v, hvm_domain_context_t *h)
+ {
+    struct hvm_tsc_adjust ctxt;
+
+    ctxt.tsc_adjust = v->arch.hvm_vcpu.msr_tsc_adjust;
+
+    if ( hvm_save_entry(TSC_ADJUST, v->vcpu_id, h, &ctxt) != 0 )
+        return 1;
+    return 0;
+ }
+
 static int hvm_save_tsc_adjust(struct domain *d, hvm_domain_context_t *h)
 {
     struct vcpu *v;
-    struct hvm_tsc_adjust ctxt;
     int err = 0;
 
     for_each_vcpu ( d, v )
     {
-        ctxt.tsc_adjust = v->arch.hvm_vcpu.msr_tsc_adjust;
-        err = hvm_save_entry(TSC_ADJUST, v->vcpu_id, h, &ctxt);
+        err = hvm_save_tsc_adjust_one(v, h);
         if ( err )
             break;
     }
-
     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®.