From 5f1f6e840baafa06e0405f2c1d18da3a73709931 Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Thu, 5 Jun 2008 23:36:27 -0300 Subject: Remove env->ready_for_interrupt_injection There's no need to polute the already poluted CPUState with "ready_for_interrupt_injection". We can compute it in the few times we use it, and be fine. Signed-off-by: Glauber Costa Signed-off-by: Avi Kivity --- qemu-kvm-powerpc.c | 4 +--- qemu-kvm-x86.c | 4 +--- qemu-kvm.c | 1 - target-i386/cpu.h | 1 - target-ia64/cpu.h | 2 -- target-ia64/op_helper.c | 1 - target-ppc/cpu.h | 2 -- 7 files changed, 2 insertions(+), 13 deletions(-) diff --git a/qemu-kvm-powerpc.c b/qemu-kvm-powerpc.c index 024b18c94..553c27fd0 100644 --- a/qemu-kvm-powerpc.c +++ b/qemu-kvm-powerpc.c @@ -150,8 +150,6 @@ void kvm_arch_post_kvm_run(void *opaque, int vcpu) { CPUState *env = qemu_kvm_cpu_env(vcpu); cpu_single_env = env; - env->ready_for_interrupt_injection = \ - kvm_is_ready_for_interrupt_injection(kvm_context, vcpu); } int kvm_arch_has_work(CPUState *env) @@ -170,7 +168,7 @@ int kvm_arch_try_push_interrupts(void *opaque) /* PowerPC Qemu tracks the various core input pins (interrupt, critical * interrupt, reset, etc) in PPC-specific env->irq_input_state. */ - if (env->ready_for_interrupt_injection && + if (kvm_is_ready_for_interrupt_injection(kvm_context, env->cpu_index) && (env->irq_input_state & (1<eflags = kvm_get_interrupt_flag(kvm_context, vcpu) ? env->eflags | IF_MASK : env->eflags & ~IF_MASK; - env->ready_for_interrupt_injection - = kvm_is_ready_for_interrupt_injection(kvm_context, vcpu); cpu_set_apic_tpr(env, kvm_get_cr8(kvm_context, vcpu)); cpu_set_apic_base(env, kvm_get_apic_base(kvm_context, vcpu)); @@ -640,7 +638,7 @@ int kvm_arch_try_push_interrupts(void *opaque) CPUState *env = cpu_single_env; int r, irq; - if (env->ready_for_interrupt_injection && + if (kvm_is_ready_for_interrupt_injection(kvm_context, env->cpu_index) && (env->interrupt_request & CPU_INTERRUPT_HARD) && (env->eflags & IF_MASK)) { env->interrupt_request &= ~CPU_INTERRUPT_HARD; diff --git a/qemu-kvm.c b/qemu-kvm.c index 119303e9c..553875be7 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -387,7 +387,6 @@ static int kvm_main_loop_cpu(CPUState *env) env->halted = 0; kvm_qemu_init_env(env); - env->ready_for_interrupt_injection = 1; #ifdef TARGET_I386 kvm_tpr_vcpu_start(env); #endif diff --git a/target-i386/cpu.h b/target-i386/cpu.h index 8efc2f408..0cfe730b2 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -566,7 +566,6 @@ typedef struct CPUX86State { #endif uint64_t tsc; /* time stamp counter */ - uint8_t ready_for_interrupt_injection; uint64_t pat; /* exception/interrupt handling */ diff --git a/target-ia64/cpu.h b/target-ia64/cpu.h index 97358eec9..f8e5e8aaf 100644 --- a/target-ia64/cpu.h +++ b/target-ia64/cpu.h @@ -51,8 +51,6 @@ typedef struct CPUIA64State { int user_mode_only; uint32_t hflags; - uint8_t ready_for_interrupt_injection; - } CPUIA64State; #define CPUState CPUIA64State diff --git a/target-ia64/op_helper.c b/target-ia64/op_helper.c index 4969ef75b..f582023f4 100644 --- a/target-ia64/op_helper.c +++ b/target-ia64/op_helper.c @@ -36,7 +36,6 @@ CPUState *cpu_ia64_init(char *cpu_model){ cpu_reset(env); if (kvm_enabled()) { kvm_qemu_init_env(env); - env->ready_for_interrupt_injection = 1; kvm_init_new_ap(env->cpu_index, env); } return env; diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h index 029d1f3d1..6d9873822 100644 --- a/target-ppc/cpu.h +++ b/target-ppc/cpu.h @@ -574,8 +574,6 @@ struct CPUPPCState { /* temporary general purpose registers */ ppc_gpr_t tgpr[4]; /* Used to speed-up TLB assist handlers */ - uint8_t ready_for_interrupt_injection; - /* Floating point execution context */ /* temporary float registers */ float64 ft0; -- cgit v1.2.3-65-gdbad