From 9f6b8fe31ea92570c4e43d35abcadafea9576d89 Mon Sep 17 00:00:00 2001 From: Alex Williamson Date: Fri, 10 Apr 2015 16:45:47 +0200 Subject: [PATCH 11/14] x86: Use common variable range MTRR counts Message-id: <20150410164547.16166.20530.stgit@gimli.home> Patchwork-id: 64797 O-Subject: [RHEL7.2 qemu-kvm PATCH 1/3] x86: Use common variable range MTRR counts Bugzilla: 1210510 RH-Acked-by: Miroslav Rezanina RH-Acked-by: Laszlo Ersek RH-Acked-by: Paolo Bonzini Upstream: d8b5c67b05420d966664664ff287af05b884bdd1 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 Reviewed-by: Laszlo Ersek Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini Signed-off-by: Miroslav Rezanina --- 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 207645c..763fbf2 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -886,7 +886,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 87fd496..4c1ead4 100644 --- a/target-i386/machine.c +++ b/target-i386/machine.c @@ -647,7 +647,7 @@ const 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), -- 1.8.3.1