From: Tim Deegan Date: Thu, 27 Feb 2014 15:06:33 +0000 (+0000) Subject: x86/hvm: assert that we we saved a sane number of MSRs. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~5514 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=891219a9d3958860b915021f622f7119b9b880d8;p=xen.git x86/hvm: assert that we we saved a sane number of MSRs. Just as a backstop measure against later changes that add MSRs to the save function without updating the count in the init function. Signed-off-by: Tim Deegan Acked-by: Jan Beulich --- diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 9e85c13edb..ae24211e53 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -1148,6 +1148,8 @@ static int hvm_save_cpu_msrs(struct domain *d, hvm_domain_context_t *h) if ( hvm_funcs.save_msr ) hvm_funcs.save_msr(v, ctxt); + ASSERT(ctxt->count <= msr_count_max); + for ( i = 0; i < ctxt->count; ++i ) ctxt->msr[i]._rsvd = 0;