From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 17/22] kvm: Move irqchip event processing out of inner loop Date: Mon, 31 Jan 2011 12:08:36 +0200 Message-ID: <4D468A24.4080800@redhat.com> References: <8db93a26b3cbb67e309d05600811dd6a37b34433.1296133797.git.jan.kiszka@siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , kvm@vger.kernel.org, qemu-devel@nongnu.org To: Jan Kiszka Return-path: Received: from mx1.redhat.com ([209.132.183.28]:59128 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751513Ab1AaKIn (ORCPT ); Mon, 31 Jan 2011 05:08:43 -0500 In-Reply-To: <8db93a26b3cbb67e309d05600811dd6a37b34433.1296133797.git.jan.kiszka@siemens.com> Sender: kvm-owner@vger.kernel.org List-ID: On 01/27/2011 03:10 PM, Jan Kiszka wrote: > Align with qemu-kvm and prepare for IO exit fix: There is no need to run > kvm_arch_process_irqchip_events in the inner VCPU loop. Any state change > this service processes will first cause an exit from kvm_cpu_exec > anyway. And we will have to reenter the kernel on IO exits > unconditionally, something that the current logic prevents. > > Signed-off-by: Jan Kiszka > --- > kvm-all.c | 11 ++++++----- > 1 files changed, 6 insertions(+), 5 deletions(-) > > diff --git a/kvm-all.c b/kvm-all.c > index 5bfa8c0..46ecc1c 100644 > --- a/kvm-all.c > +++ b/kvm-all.c > @@ -892,6 +892,12 @@ int kvm_cpu_exec(CPUState *env) > > DPRINTF("kvm_cpu_exec()\n"); > > + if (kvm_arch_process_irqchip_events(env)) { > + env->exit_request = 0; > + env->exception_index = EXCP_HLT; > + return 0; > + } > + > do { > #ifndef CONFIG_IOTHREAD > if (env->exit_request) { > @@ -901,11 +907,6 @@ int kvm_cpu_exec(CPUState *env) > } We check for ->exit_request here > #endif > > - if (kvm_arch_process_irqchip_events(env)) { > - ret = 0; > - break; > - } > - But this checks for ->interrupt_request. What ensures that we exit when ->interrupt_request is set? > if (env->kvm_vcpu_dirty) { > kvm_arch_put_registers(env, KVM_PUT_RUNTIME_STATE); > env->kvm_vcpu_dirty = 0; -- error compiling committee.c: too many arguments to function From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=38427 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pjqgc-0005Qh-PT for qemu-devel@nongnu.org; Mon, 31 Jan 2011 05:08:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pjqgb-0002Uk-GI for qemu-devel@nongnu.org; Mon, 31 Jan 2011 05:08:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50711) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pjqgb-0002Ua-8z for qemu-devel@nongnu.org; Mon, 31 Jan 2011 05:08:41 -0500 Message-ID: <4D468A24.4080800@redhat.com> Date: Mon, 31 Jan 2011 12:08:36 +0200 From: Avi Kivity MIME-Version: 1.0 References: <8db93a26b3cbb67e309d05600811dd6a37b34433.1296133797.git.jan.kiszka@siemens.com> In-Reply-To: <8db93a26b3cbb67e309d05600811dd6a37b34433.1296133797.git.jan.kiszka@siemens.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 17/22] kvm: Move irqchip event processing out of inner loop List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org On 01/27/2011 03:10 PM, Jan Kiszka wrote: > Align with qemu-kvm and prepare for IO exit fix: There is no need to run > kvm_arch_process_irqchip_events in the inner VCPU loop. Any state change > this service processes will first cause an exit from kvm_cpu_exec > anyway. And we will have to reenter the kernel on IO exits > unconditionally, something that the current logic prevents. > > Signed-off-by: Jan Kiszka > --- > kvm-all.c | 11 ++++++----- > 1 files changed, 6 insertions(+), 5 deletions(-) > > diff --git a/kvm-all.c b/kvm-all.c > index 5bfa8c0..46ecc1c 100644 > --- a/kvm-all.c > +++ b/kvm-all.c > @@ -892,6 +892,12 @@ int kvm_cpu_exec(CPUState *env) > > DPRINTF("kvm_cpu_exec()\n"); > > + if (kvm_arch_process_irqchip_events(env)) { > + env->exit_request = 0; > + env->exception_index = EXCP_HLT; > + return 0; > + } > + > do { > #ifndef CONFIG_IOTHREAD > if (env->exit_request) { > @@ -901,11 +907,6 @@ int kvm_cpu_exec(CPUState *env) > } We check for ->exit_request here > #endif > > - if (kvm_arch_process_irqchip_events(env)) { > - ret = 0; > - break; > - } > - But this checks for ->interrupt_request. What ensures that we exit when ->interrupt_request is set? > if (env->kvm_vcpu_dirty) { > kvm_arch_put_registers(env, KVM_PUT_RUNTIME_STATE); > env->kvm_vcpu_dirty = 0; -- error compiling committee.c: too many arguments to function