From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [RFC][PATCH] KVM: Introduce direct MSI message injection for in-kernel irqchips Date: Fri, 21 Oct 2011 13:51:15 +0200 Message-ID: <4EA15CB3.2080904@siemens.com> References: <4EA13917.7070401@siemens.com> <20111021110608.GB14716@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Avi Kivity , Marcelo Tosatti , kvm To: "Michael S. Tsirkin" Return-path: Received: from david.siemens.de ([192.35.17.14]:26127 "EHLO david.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754451Ab1JULvV (ORCPT ); Fri, 21 Oct 2011 07:51:21 -0400 In-Reply-To: <20111021110608.GB14716@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 2011-10-21 13:06, Michael S. Tsirkin wrote: > On Fri, Oct 21, 2011 at 11:19:19AM +0200, Jan Kiszka wrote: >> Currently, MSI messages can only be injected to in-kernel irqchips by >> defining a corresponding IRQ route for each message. This is not only >> unhandy if the MSI messages are generated "on the fly" by user space, >> IRQ routes are a limited resource that user space as to manage >> carefully. >> >> By providing a direct injection with, we can both avoid using up limited >> resources and simplify the necessary steps for user land. The API >> already provides a channel (flags) to revoke an injected but not yet >> delivered message which will become important for in-kernel MSI-X vector >> masking support. >> >> Signed-off-by: Jan Kiszka > > I would love to see how you envision extending this to add the masking > support at least at the API level, not necessarily the supporting code. > > It would seem hard to use flags field for that since MSIX mask is per > device per vector, not per message. > Which gets us back to resource per vector which userspace has to manage > ... > > interrupt remapping is also per device, so it isn't any easier > with this API. Yes, we will need an additional field to associate the message with its source device. Could be a PCI address or a handle (like the one assigned devices get) returned on MSI-X kernel region setup. We will need a flag to declare that address/handle valid, also to tell apart platform MSI messages (e.g. coming from HPET on x86). I see no obstacles ATM that prevent doing that on top of this API, do you? Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux