diff options
author | 2009-10-15 17:26:31 -0300 | |
---|---|---|
committer | 2009-10-19 16:20:03 -0200 | |
commit | c4b2773a9fbef6b8282f3b7752dfa6ac204756cb (patch) | |
tree | 9af6f5c2f0e608e55d4291153674de81bc1f38f0 /qemu-kvm-x86.c | |
parent | get rid of vcpu structure (diff) | |
download | qemu-kvm-c4b2773a9fbef6b8282f3b7752dfa6ac204756cb.tar.gz qemu-kvm-c4b2773a9fbef6b8282f3b7752dfa6ac204756cb.tar.bz2 qemu-kvm-c4b2773a9fbef6b8282f3b7752dfa6ac204756cb.zip |
get rid of MSR_COUNT
qemu.git uses an array of 100 entries for the msr list, which is arguably large
enough (tm).
I propose we follow the same path, for two reasons:
1) ease future merge.
2) avoid stack overflow problems that had already began to appear
Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'qemu-kvm-x86.c')
-rw-r--r-- | qemu-kvm-x86.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c index 50f6ff2e5..d071d5e47 100644 --- a/qemu-kvm-x86.c +++ b/qemu-kvm-x86.c @@ -841,12 +841,6 @@ static int get_msr_entry(struct kvm_msr_entry *entry, CPUState *env) return 0; } -#ifdef TARGET_X86_64 -#define MSR_COUNT 10 -#else -#define MSR_COUNT 6 -#endif - static void set_v8086_seg(struct kvm_segment *lhs, const SegmentCache *rhs) { lhs->selector = rhs->selector; @@ -901,7 +895,7 @@ void kvm_arch_load_regs(CPUState *env) struct kvm_regs regs; struct kvm_fpu fpu; struct kvm_sregs sregs; - struct kvm_msr_entry msrs[MSR_COUNT]; + struct kvm_msr_entry msrs[100]; int rc, n, i; regs.rax = env->regs[R_EAX]; @@ -986,7 +980,7 @@ void kvm_arch_load_regs(CPUState *env) /* msrs */ n = 0; - /* Remember to increase MSR_COUNT if you add new registers below */ + /* Remember to increase msrs size 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); @@ -1055,7 +1049,7 @@ void kvm_arch_save_regs(CPUState *env) struct kvm_regs regs; struct kvm_fpu fpu; struct kvm_sregs sregs; - struct kvm_msr_entry msrs[MSR_COUNT]; + struct kvm_msr_entry msrs[100]; uint32_t hflags; uint32_t i, n, rc; @@ -1164,7 +1158,7 @@ void kvm_arch_save_regs(CPUState *env) /* msrs */ n = 0; - /* Remember to increase MSR_COUNT if you add new registers below */ + /* Remember to increase msrs size 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; |