]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86/hvm: assert that we we saved a sane number of MSRs.
authorTim Deegan <tim@xen.org>
Thu, 27 Feb 2014 15:06:33 +0000 (15:06 +0000)
committerTim Deegan <tim@xen.org>
Thu, 6 Mar 2014 10:13:30 +0000 (10:13 +0000)
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 <tim@xen.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/hvm.c

index 9e85c13edba087d524d0ab7e0ca7b1704281a236..ae24211e5384ae3dadbe593e12d9bc9ff2ecf601 100644 (file)
@@ -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;