From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [RFC PATCH 0/2] irq destination caching prototype Date: Mon, 13 Aug 2012 12:53:14 +0300 Message-ID: <20120813095313.GR3341@redhat.com> References: <1344849408-2697-1-git-send-email-gleb@redhat.com> <5028CC56.5060809@redhat.com> <20120813095149.GN14081@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , kvm@vger.kernel.org To: "Michael S. Tsirkin" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:52834 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751143Ab2HMJxQ (ORCPT ); Mon, 13 Aug 2012 05:53:16 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7D9rGmI012837 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 13 Aug 2012 05:53:16 -0400 Content-Disposition: inline In-Reply-To: <20120813095149.GN14081@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Aug 13, 2012 at 12:51:49PM +0300, Michael S. Tsirkin wrote: > On Mon, Aug 13, 2012 at 12:43:50PM +0300, Avi Kivity wrote: > > On 08/13/2012 12:16 PM, Gleb Natapov wrote: > > > Here is a quick prototype of what we discussed yesterday. This one > > > caches only MSI interrupts for now. The obvious problem is that not > > > all interrupts (namely IPIs and MSIs using KVM_CAP_SIGNAL_MSI) use irq > > > routing table, so they cannot be cached. > > > > Missing: switch the uncached path to a work queue, so we don't have to > > iterate over all vcpus in interrupt context. > > > > That isn't trivial; for edge-triggered interrupts we need to ignore > > zeros (if polarity=0) but for level-triggered interrupts we need them to > > override the previous setting. But we don't know the trigger mode and > > polarity at this point. > > Instead of doing it like this, can we simply require > callers to use a workqueue? > Add kvm_set_msi_inatomic that returns WOULDBLOCK if cache is NULL. > kvm_set_msi is simple since it is always edge and bails out very early if level is 0. I do not yet understand where is the problem with ioapic though. -- Gleb.