From patchwork Tue Jul 7 12:27:32 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Natapov X-Patchwork-Id: 34415 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 n67CRaeq003293 for ; Tue, 7 Jul 2009 12:27:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755497AbZGGM1b (ORCPT ); Tue, 7 Jul 2009 08:27:31 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755137AbZGGM1a (ORCPT ); Tue, 7 Jul 2009 08:27:30 -0400 Received: from mx2.redhat.com ([66.187.237.31]:33503 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754808AbZGGM1a (ORCPT ); Tue, 7 Jul 2009 08:27:30 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n67CRYBH011052 for ; Tue, 7 Jul 2009 08:27:34 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n67CRXuc023710; Tue, 7 Jul 2009 08:27:33 -0400 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n67CRWHU014920; Tue, 7 Jul 2009 08:27:32 -0400 Received: by dhcp-1-237.tlv.redhat.com (Postfix, from userid 13519) id 5748918D479; Tue, 7 Jul 2009 15:27:32 +0300 (IDT) Date: Tue, 7 Jul 2009 15:27:32 +0300 From: Gleb Natapov To: avi@redhat.com Cc: mtosatti@redhat.com, kvm@vger.kernel.org Subject: [PATCH] No need to kick cpu if not in a guest mode. Message-ID: <20090707122732.GG28046@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org This will save a couple of IPIs. Signed-off-by: Gleb Natapov --- Gleb. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index efb0b68..1e30400 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -3498,6 +3498,7 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) smp_mb__after_clear_bit(); if (vcpu->requests || need_resched() || signal_pending(current)) { + set_bit(KVM_REQ_KICK, &vcpu->requests); local_irq_enable(); preempt_enable(); r = 1;