]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86/hvm: introduce hvm_save_tsc_adjust_one()
authorAlexandru Isaila <aisaila@bitdefender.com>
Mon, 10 Sep 2018 14:26:00 +0000 (16:26 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 12 Sep 2018 14:37:47 +0000 (16:37 +0200)
This is used to save data from a single instance.

Signed-off-by: Alexandru Isaila <aisaila@bitdefender.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/hvm.c

index 062872cb717aad82310efd54541ab6c496b496e7..c99387f704fd60dfdf6c1dcc3ce059fb95810910 100644 (file)
@@ -731,16 +731,23 @@ 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 = {
+        .tsc_adjust = v->arch.hvm.msr_tsc_adjust,
+    };
+
+    return hvm_save_entry(TSC_ADJUST, v->vcpu_id, h, &ctxt);
+}
+
 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.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;
     }