From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: [PATCH] fix "info cpus" halted state display Date: Thu, 13 May 2010 16:17:14 +0300 Message-ID: <20100513131714.GC7757@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: avi@redhat.com, mtosatti@redhat.com Return-path: Received: from mx1.redhat.com ([209.132.183.28]:12626 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752059Ab0EMNRQ (ORCPT ); Thu, 13 May 2010 09:17:16 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o4DDHG8a029960 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 13 May 2010 09:17:16 -0400 Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: When in-kernel irqchip is used env->halted is never used for anything except "info cpus" command. Halted state is synced in kvm_arch_save_mpstate() and showed by do_info_cpus() but otherwise never looked at. Zeroing it here breaks "info cpus" since before do_info_cpus() outputs env->halted in io thread it is zeroed here when vcpu thread reenters kernel. Signed-off-by: Gleb Natapov diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c index 61d9331..0ec2881 100644 --- a/qemu-kvm-x86.c +++ b/qemu-kvm-x86.c @@ -922,10 +922,6 @@ void kvm_arch_load_regs(CPUState *env, int level) if (env->kvm_vcpu_update_vapic) kvm_tpr_enable_vapic(env); } - if (kvm_irqchip_in_kernel()) { - /* Avoid deadlock: no user space IRQ will ever clear it. */ - env->halted = 0; - } kvm_put_vcpu_events(env, level); kvm_put_debugregs(env); -- Gleb.