aboutsummaryrefslogtreecommitdiff
path: root/target-i386/kvm.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2012-12-01 06:18:14 +0100
committerAndreas Färber <afaerber@suse.de>2012-12-19 14:09:32 +0100
commitf7575c96c6058763fe3bd8dd26f3d09473f2df36 (patch)
tree9f9c620c6d38d0440d7517946088123412aa1c31 /target-i386/kvm.c
parenta60f24b56b07f46453424263b276b0879c25c4e6 (diff)
downloadqemu-f7575c96c6058763fe3bd8dd26f3d09473f2df36.zip
qemu-f7575c96c6058763fe3bd8dd26f3d09473f2df36.tar.gz
qemu-f7575c96c6058763fe3bd8dd26f3d09473f2df36.tar.bz2
cpu: Move kvm_run into CPUState
Pass CPUState / {X86,S390}CPU to helper functions. Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-i386/kvm.c')
-rw-r--r--target-i386/kvm.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index ff5c9cd..53096c9 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -1859,9 +1859,11 @@ static int kvm_handle_halt(X86CPU *cpu)
return 0;
}
-static int kvm_handle_tpr_access(CPUX86State *env)
+static int kvm_handle_tpr_access(X86CPU *cpu)
{
- struct kvm_run *run = env->kvm_run;
+ CPUX86State *env = &cpu->env;
+ CPUState *cs = CPU(cpu);
+ struct kvm_run *run = cs->kvm_run;
apic_handle_tpr_access_report(env->apic_state, run->tpr_access.rip,
run->tpr_access.is_write ? TPR_ACCESS_WRITE
@@ -2067,7 +2069,6 @@ static bool host_supports_vmx(void)
int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run)
{
X86CPU *cpu = X86_CPU(cs);
- CPUX86State *env = &cpu->env;
uint64_t code;
int ret;
@@ -2080,7 +2081,7 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run)
ret = 0;
break;
case KVM_EXIT_TPR_ACCESS:
- ret = kvm_handle_tpr_access(env);
+ ret = kvm_handle_tpr_access(cpu);
break;
case KVM_EXIT_FAIL_ENTRY:
code = run->fail_entry.hardware_entry_failure_reason;