From: Alexandru Isaila Date: Mon, 10 Sep 2018 14:26:00 +0000 (+0200) Subject: x86/hvm: introduce lapic_save_hidden_one() X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=0dff42ddc903fd25bf08428e666ad76046532e74;p=people%2Froyger%2Fxen.git x86/hvm: introduce lapic_save_hidden_one() This is used to save data from a single instance. Signed-off-by: Alexandru Isaila Reviewed-by: Jan Beulich --- diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c index 04702e96c9..31c7a66d01 100644 --- a/xen/arch/x86/hvm/vlapic.c +++ b/xen/arch/x86/hvm/vlapic.c @@ -1399,23 +1399,27 @@ static void lapic_rearm(struct vlapic *s) s->timer_last_update = s->pt.last_plt_gtime; } +static int lapic_save_hidden_one(struct vcpu *v, hvm_domain_context_t *h) +{ + if ( !has_vlapic(v->domain) ) + return 0; + + return hvm_save_entry(LAPIC, v->vcpu_id, h, &vcpu_vlapic(v)->hw); +} + static int lapic_save_hidden(struct domain *d, hvm_domain_context_t *h) { struct vcpu *v; - struct vlapic *s; - int rc = 0; - - if ( !has_vlapic(d) ) - return 0; + int err = 0; for_each_vcpu ( d, v ) { - s = vcpu_vlapic(v); - if ( (rc = hvm_save_entry(LAPIC, v->vcpu_id, h, &s->hw)) != 0 ) + err = lapic_save_hidden_one(v, h); + if ( err ) break; } - return rc; + return err; } static int lapic_save_regs(struct domain *d, hvm_domain_context_t *h)