diff options
Diffstat (limited to 'kvm-all.c')
-rw-r--r-- | kvm-all.c | 18 |
1 files changed, 4 insertions, 14 deletions
@@ -75,7 +75,6 @@ struct KVMState #ifdef KVM_CAP_SET_GUEST_DEBUG struct kvm_sw_breakpoint_head kvm_sw_breakpoints; #endif - int irqchip_in_kernel; int pit_in_kernel; int xsave, xcrs; int many_ioeventfds; @@ -89,6 +88,7 @@ struct KVMState }; KVMState *kvm_state; +bool kvm_kernel_irqchip; static const KVMCapabilityInfo kvm_required_capabilites[] = { KVM_CAP_INFO(USER_MEMORY), @@ -194,11 +194,6 @@ static void kvm_reset_vcpu(void *opaque) kvm_arch_reset_vcpu(env); } -int kvm_irqchip_in_kernel(void) -{ - return kvm_state->irqchip_in_kernel; -} - int kvm_pit_in_kernel(void) { return kvm_state->pit_in_kernel; @@ -837,7 +832,7 @@ int kvm_irqchip_set_irq(KVMState *s, int irq, int level) struct kvm_irq_level event; int ret; - assert(s->irqchip_in_kernel); + assert(kvm_irqchip_in_kernel()); event.level = level; event.irq = irq; @@ -957,7 +952,7 @@ static int kvm_irqchip_create(KVMState *s) if (kvm_check_extension(s, KVM_CAP_IRQ_INJECT_STATUS)) { s->irqchip_inject_ioctl = KVM_IRQ_LINE_STATUS; } - s->irqchip_in_kernel = 1; + kvm_kernel_irqchip = true; kvm_init_irq_routing(s); @@ -1218,8 +1213,6 @@ int kvm_cpu_exec(CPUState *env) return EXCP_HLT; } - cpu_single_env = env; - do { if (env->kvm_vcpu_dirty) { kvm_arch_put_registers(env, KVM_PUT_RUNTIME_STATE); @@ -1236,13 +1229,11 @@ int kvm_cpu_exec(CPUState *env) */ qemu_cpu_kick_self(); } - cpu_single_env = NULL; qemu_mutex_unlock_iothread(); run_ret = kvm_vcpu_ioctl(env, KVM_RUN, 0); qemu_mutex_lock_iothread(); - cpu_single_env = env; kvm_arch_post_run(env, run); kvm_flush_coalesced_mmio_buffer(); @@ -1306,7 +1297,6 @@ int kvm_cpu_exec(CPUState *env) } env->exit_request = 0; - cpu_single_env = NULL; return ret; } @@ -1410,7 +1400,7 @@ int kvm_has_gsi_routing(void) int kvm_allows_irq0_override(void) { - return !kvm_enabled() || !kvm_irqchip_in_kernel() || kvm_has_gsi_routing(); + return !kvm_irqchip_in_kernel() || kvm_has_gsi_routing(); } void kvm_setup_guest_memory(void *start, size_t size) |