From patchwork Tue Sep 22 14:51:51 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Natapov X-Patchwork-Id: 49322 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8MEq1kV031878 for ; Tue, 22 Sep 2009 14:52:01 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756655AbZIVOvv (ORCPT ); Tue, 22 Sep 2009 10:51:51 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756611AbZIVOvu (ORCPT ); Tue, 22 Sep 2009 10:51:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54517 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755226AbZIVOvu (ORCPT ); Tue, 22 Sep 2009 10:51:50 -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 n8MEpsMO026778 for ; Tue, 22 Sep 2009 10:51:54 -0400 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8MEpqSO028473; Tue, 22 Sep 2009 10:51:53 -0400 Received: by dhcp-1-237.tlv.redhat.com (Postfix, from userid 13519) id 524BC1336CB; Tue, 22 Sep 2009 17:51:52 +0300 (IDT) From: Gleb Natapov To: avi@redhat.com Cc: kvm@vger.kernel.org Subject: [PATCH] Don't call kvm_cpu_synchronize_state() if there is no irqchip events to process. Date: Tue, 22 Sep 2009 17:51:51 +0300 Message-Id: <1253631112-26124-2-git-send-email-gleb@redhat.com> In-Reply-To: <1253631112-26124-1-git-send-email-gleb@redhat.com> References: <1253631112-26124-1-git-send-email-gleb@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Signed-off-by: Gleb Natapov --- qemu-kvm-x86.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c index 32561f0..acb1b91 100644 --- a/qemu-kvm-x86.c +++ b/qemu-kvm-x86.c @@ -1673,9 +1673,12 @@ uint32_t kvm_arch_get_supported_cpuid(CPUState *env, uint32_t function, void kvm_arch_process_irqchip_events(CPUState *env) { - kvm_cpu_synchronize_state(env); - if (env->interrupt_request & CPU_INTERRUPT_INIT) + if (env->interrupt_request & CPU_INTERRUPT_INIT) { + kvm_cpu_synchronize_state(env); do_cpu_init(env); - if (env->interrupt_request & CPU_INTERRUPT_SIPI) + } + if (env->interrupt_request & CPU_INTERRUPT_SIPI) { + kvm_cpu_synchronize_state(env); do_cpu_sipi(env); + } }