From patchwork Thu Aug 14 19:24:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 379983 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3F25B1400E0 for ; Fri, 15 Aug 2014 05:25:50 +1000 (EST) Received: from localhost ([::1]:55797 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XI0ei-0007j9-5c for incoming@patchwork.ozlabs.org; Thu, 14 Aug 2014 15:25:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XI0d8-0005Gz-TQ for qemu-devel@nongnu.org; Thu, 14 Aug 2014 15:24:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XI0d3-0005S3-R8 for qemu-devel@nongnu.org; Thu, 14 Aug 2014 15:24:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10152) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XI0d3-0005Rv-FS; Thu, 14 Aug 2014 15:24:05 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7EJO4Y0030709 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Aug 2014 15:24:04 -0400 Received: from gimli.home (ovpn-113-173.phx2.redhat.com [10.3.113.173]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s7EJO3HB025821; Thu, 14 Aug 2014 15:24:03 -0400 From: Alex Williamson To: qemu-devel@nongnu.org, kvm@vger.kernel.org Date: Thu, 14 Aug 2014 13:24:03 -0600 Message-ID: <20140814192403.13303.69084.stgit@gimli.home> In-Reply-To: <20140814191147.13303.61655.stgit@gimli.home> References: <20140814191147.13303.61655.stgit@gimli.home> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: lersek@redhat.com, qemu-stable@nongnu.org Subject: [Qemu-devel] [PATCH v2 1/3] x86: Use common variable range MTRR counts X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org We currently define the number of variable range MTRR registers as 8 in the CPUX86State structure and vmstate, but use MSR_MTRRcap_VCNT (also 8) to report to guests the number available. Change this to use MSR_MTRRcap_VCNT consistently. Signed-off-by: Alex Williamson Cc: Laszlo Ersek Cc: qemu-stable@nongnu.org Reviewed-by: Laszlo Ersek --- target-i386/cpu.h | 2 +- target-i386/machine.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target-i386/cpu.h b/target-i386/cpu.h index e634d83..d37d857 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -930,7 +930,7 @@ typedef struct CPUX86State { /* MTRRs */ uint64_t mtrr_fixed[11]; uint64_t mtrr_deftype; - MTRRVar mtrr_var[8]; + MTRRVar mtrr_var[MSR_MTRRcap_VCNT]; /* For KVM */ uint32_t mp_state; diff --git a/target-i386/machine.c b/target-i386/machine.c index 16d2f6a..fb89065 100644 --- a/target-i386/machine.c +++ b/target-i386/machine.c @@ -677,7 +677,7 @@ VMStateDescription vmstate_x86_cpu = { /* MTRRs */ VMSTATE_UINT64_ARRAY_V(env.mtrr_fixed, X86CPU, 11, 8), VMSTATE_UINT64_V(env.mtrr_deftype, X86CPU, 8), - VMSTATE_MTRR_VARS(env.mtrr_var, X86CPU, 8, 8), + VMSTATE_MTRR_VARS(env.mtrr_var, X86CPU, MSR_MTRRcap_VCNT, 8), /* KVM-related states */ VMSTATE_INT32_V(env.interrupt_injected, X86CPU, 9), VMSTATE_UINT32_V(env.mp_state, X86CPU, 9),