From patchwork Wed Oct 14 18:02:27 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 53769 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9EI4YIF013293 for ; Wed, 14 Oct 2009 18:04:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755253AbZJNSC4 (ORCPT ); Wed, 14 Oct 2009 14:02:56 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755389AbZJNSC4 (ORCPT ); Wed, 14 Oct 2009 14:02:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51274 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753748AbZJNSCz (ORCPT ); Wed, 14 Oct 2009 14:02:55 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9EI2TuH029044 for ; Wed, 14 Oct 2009 14:02:29 -0400 Received: from blackpad.lan.raisama.net (vpn-13-55.rdu.redhat.com [10.11.13.55]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n9EI2S4s008873; Wed, 14 Oct 2009 14:02:29 -0400 Received: by blackpad.lan.raisama.net (Postfix, from userid 500) id 9EE5F17F9AD; Wed, 14 Oct 2009 15:02:27 -0300 (BRT) Date: Wed, 14 Oct 2009 15:02:27 -0300 From: Eduardo Habkost To: Avi Kivity Cc: kvm@vger.kernel.org, Ulrich Obergfell Subject: [PATCH] kvm: fix MSR_COUNT for kvm_arch_save_regs() Message-ID: <20091014180227.GQ24126@blackpad.lan.raisama.net> MIME-Version: 1.0 Content-Disposition: inline X-Fnord: you can see the fnord User-Agent: Mutt/1.5.19 (2009-01-05) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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;