Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KzZ6l-0006Xw-11 for qemu-devel@nongnu.org; Mon, 10 Nov 2008 10:55:19 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KzZ6k-0006XT-CX for qemu-devel@nongnu.org; Mon, 10 Nov 2008 10:55:18 -0500 Received: from [199.232.76.173] (port=58261 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KzZ6k-0006XN-1S for qemu-devel@nongnu.org; Mon, 10 Nov 2008 10:55:18 -0500 Received: from savannah.gnu.org ([199.232.41.3]:52939 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KzZ6j-0006qY-Rp for qemu-devel@nongnu.org; Mon, 10 Nov 2008 10:55:18 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KzZ6i-0001f6-E8 for qemu-devel@nongnu.org; Mon, 10 Nov 2008 15:55:16 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KzZ6h-0001ez-Lb for qemu-devel@nongnu.org; Mon, 10 Nov 2008 15:55:15 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Mon, 10 Nov 2008 15:55:15 +0000 Subject: [Qemu-devel] [5669] KVM: simplify kvm_cpu_exec hook Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 5669 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5669 Author: aliguori Date: 2008-11-10 15:55:14 +0000 (Mon, 10 Nov 2008) Log Message: ----------- KVM: simplify kvm_cpu_exec hook We don't need to use cpu_loop_exit() because we never use the condition codes so everything can be folded into a single case. Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/cpu-exec.c trunk/kvm-all.c Modified: trunk/cpu-exec.c =================================================================== --- trunk/cpu-exec.c 2008-11-10 11:10:23 UTC (rev 5668) +++ trunk/cpu-exec.c 2008-11-10 15:55:14 UTC (rev 5669) @@ -369,16 +369,8 @@ #endif if (kvm_enabled()) { - int ret; - ret = kvm_cpu_exec(env); - if ((env->interrupt_request & CPU_INTERRUPT_EXIT)) { - env->interrupt_request &= ~CPU_INTERRUPT_EXIT; - env->exception_index = EXCP_INTERRUPT; - cpu_loop_exit(); - } else if (env->halted) { - cpu_loop_exit(); - } else - longjmp(env->jmp_env, 1); + kvm_cpu_exec(env); + longjmp(env->jmp_env, 1); } next_tb = 0; /* force lookup of first TB */ Modified: trunk/kvm-all.c =================================================================== --- trunk/kvm-all.c 2008-11-10 11:10:23 UTC (rev 5668) +++ trunk/kvm-all.c 2008-11-10 15:55:14 UTC (rev 5669) @@ -298,6 +298,11 @@ } } while (ret > 0); + if ((env->interrupt_request & CPU_INTERRUPT_EXIT)) { + env->interrupt_request &= ~CPU_INTERRUPT_EXIT; + env->exception_index = EXCP_INTERRUPT; + } + return ret; }