[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v9 01/11] x86/cpu: Introduce vmce_save_vcpu_ctxt_one() func
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/cpu/mcheck/vmce.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/xen/arch/x86/cpu/mcheck/vmce.c b/xen/arch/x86/cpu/mcheck/vmce.c index e07cd2f..d21433b 100644 --- a/xen/arch/x86/cpu/mcheck/vmce.c +++ b/xen/arch/x86/cpu/mcheck/vmce.c @@ -349,6 +349,20 @@ int vmce_wrmsr(uint32_t msr, uint64_t val) return ret; } +static int vmce_save_vcpu_ctxt_one(struct vcpu *v, hvm_domain_context_t *h) + { + struct hvm_vmce_vcpu ctxt; + + ctxt.caps = v->arch.vmce.mcg_cap; + ctxt.mci_ctl2_bank0 = v->arch.vmce.bank[0].mci_ctl2; + ctxt.mci_ctl2_bank1 = v->arch.vmce.bank[1].mci_ctl2; + ctxt.mcg_ext_ctl = v->arch.vmce.mcg_ext_ctl; + + if ( hvm_save_entry(VMCE_VCPU, v->vcpu_id, h, &ctxt) != 0 ) + return 1; + return 0; + } + static int vmce_save_vcpu_ctxt(struct domain *d, hvm_domain_context_t *h) { struct vcpu *v; @@ -356,14 +370,7 @@ static int vmce_save_vcpu_ctxt(struct domain *d, hvm_domain_context_t *h) for_each_vcpu ( d, v ) { - struct hvm_vmce_vcpu ctxt = { - .caps = v->arch.vmce.mcg_cap, - .mci_ctl2_bank0 = v->arch.vmce.bank[0].mci_ctl2, - .mci_ctl2_bank1 = v->arch.vmce.bank[1].mci_ctl2, - .mcg_ext_ctl = v->arch.vmce.mcg_ext_ctl, - }; - - err = hvm_save_entry(VMCE_VCPU, v->vcpu_id, h, &ctxt); + err = vmce_save_vcpu_ctxt_one(v, h); if ( err ) break; } -- 2.7.4 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |