diff mbox

kvm: fix MSR_COUNT for kvm_arch_save_regs()

Message ID 20091014180227.GQ24126@blackpad.lan.raisama.net (mailing list archive)
State New, archived
Headers show

Commit Message

Eduardo Habkost Oct. 14, 2009, 6:02 p.m. UTC
None
diff mbox

Patch

diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c
index acb1b91..81d2c53 100644
--- a/qemu-kvm-x86.c
+++ b/qemu-kvm-x86.c
@@ -847,9 +847,9 @@  static int get_msr_entry(struct kvm_msr_entry *entry, CPUState *env)
 }
 
 #ifdef TARGET_X86_64
-#define MSR_COUNT 9
+#define MSR_COUNT 10
 #else
-#define MSR_COUNT 5
+#define MSR_COUNT 6
 #endif
 
 static void set_v8086_seg(struct kvm_segment *lhs, const SegmentCache *rhs)
@@ -991,6 +991,7 @@  void kvm_arch_load_regs(CPUState *env)
 
     /* msrs */
     n = 0;
+    /* Remember to increase MSR_COUNT if you add new registers below */
     set_msr_entry(&msrs[n++], MSR_IA32_SYSENTER_CS,  env->sysenter_cs);
     set_msr_entry(&msrs[n++], MSR_IA32_SYSENTER_ESP, env->sysenter_esp);
     set_msr_entry(&msrs[n++], MSR_IA32_SYSENTER_EIP, env->sysenter_eip);
@@ -1168,6 +1169,7 @@  void kvm_arch_save_regs(CPUState *env)
 
     /* msrs */
     n = 0;
+    /* Remember to increase MSR_COUNT if you add new registers below */
     msrs[n++].index = MSR_IA32_SYSENTER_CS;
     msrs[n++].index = MSR_IA32_SYSENTER_ESP;
     msrs[n++].index = MSR_IA32_SYSENTER_EIP;