[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] x86/hvm: assert that we we saved a sane number of MSRs.



commit 891219a9d3958860b915021f622f7119b9b880d8
Author:     Tim Deegan <tim@xxxxxxx>
AuthorDate: Thu Feb 27 15:06:33 2014 +0000
Commit:     Tim Deegan <tim@xxxxxxx>
CommitDate: Thu Mar 6 10:13:30 2014 +0000

    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 <tim@xxxxxxx>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/arch/x86/hvm/hvm.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 9e85c13..ae24211 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;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.