aboutsummaryrefslogtreecommitdiff
path: root/target-i386/cpu.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2012-12-01 05:35:08 +0100
committerAndreas Färber <afaerber@suse.de>2012-12-19 14:09:32 +0100
commita60f24b56b07f46453424263b276b0879c25c4e6 (patch)
tree092fd681aab3131e3663d48b10b9c36f20938031 /target-i386/cpu.c
parenta34a92b9ecd8d25bd1de9df601ed31ccd8ebcae7 (diff)
cpu: Move kvm_state field into CPUState
Adapt some functions to take CPUState / {PowerPC,S390}CPU argument. Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-i386/cpu.c')
-rw-r--r--target-i386/cpu.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 7be3ad82cb..04a90c5e21 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1636,6 +1636,9 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
uint32_t *eax, uint32_t *ebx,
uint32_t *ecx, uint32_t *edx)
{
+ X86CPU *cpu = x86_env_get_cpu(env);
+ CPUState *cs = CPU(cpu);
+
/* test if maximum index reached */
if (index & 0x80000000) {
if (index > env->cpuid_xlevel) {
@@ -1752,7 +1755,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
case 0xA:
/* Architectural Performance Monitoring Leaf */
if (kvm_enabled()) {
- KVMState *s = env->kvm_state;
+ KVMState *s = cs->kvm_state;
*eax = kvm_arch_get_supported_cpuid(s, 0xA, count, R_EAX);
*ebx = kvm_arch_get_supported_cpuid(s, 0xA, count, R_EBX);
@@ -1775,7 +1778,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
break;
}
if (kvm_enabled()) {
- KVMState *s = env->kvm_state;
+ KVMState *s = cs->kvm_state;
*eax = kvm_arch_get_supported_cpuid(s, 0xd, count, R_EAX);
*ebx = kvm_arch_get_supported_cpuid(s, 0xd, count, R_EBX);