From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 1/6] KVM: Check for pending events before attempting injection Date: Thu, 29 Jul 2010 11:56:42 +0300 Message-ID: <4C51424A.8080904@redhat.com> References: <1280236780-5847-1-git-send-email-avi@redhat.com> <1280236780-5847-2-git-send-email-avi@redhat.com> <20100729065127.GL31711@redhat.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 To: Gleb Natapov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:45750 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754267Ab0G2I4o (ORCPT ); Thu, 29 Jul 2010 04:56:44 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6T8uiAc015520 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 29 Jul 2010 04:56:44 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6T8uhno023619 for ; Thu, 29 Jul 2010 04:56:43 -0400 In-Reply-To: <20100729065127.GL31711@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 07/29/2010 09:51 AM, Gleb Natapov wrote: > On Tue, Jul 27, 2010 at 04:19:35PM +0300, Avi Kivity wrote: >> Instead of blindly attempting to inject an event before each guest entry, >> check for a possible event first in vcpu->requests. Sites that can trigger >> event injection are modified to set KVM_REQ_EVENT: >> >> - interrupt, nmi window opening >> - ppr updates >> - i8259 output changes >> - local apic irr changes >> - rflags updates >> - gif flag set >> - event set on exit >> > What about userspace irq chip? Does it work with this patch? I don't see > that you set KVM_REQ_EVENT on ioctl(KVM_INTERRUPT) for instance and > vcpu->run->request_interrupt_window should be probably checked out of > if (KVM_REQ_EVEN). Right. > It looks like with this approach we scatter irq > injection logic all over the code instead of having it in one place. One place is better, but it means we have to poll all event types on every entry. We can go back to one place by having a mini-API for events (extending the kvm_queue_exception family) that would take care of the details. -- error compiling committee.c: too many arguments to function