From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cornelia Huck Subject: Re: [PATCH v2 1/6] kvm: Pass kvm_irqfd to functions Date: Thu, 28 Jun 2012 11:03:16 +0200 Message-ID: <20120628110316.0f53a1ef@BR9GNB5Z> References: <20120627044758.23698.249.stgit@bling.home> <20120627050858.23698.44118.stgit@bling.home> <20120627162430.3477d0f6@BR9GNB5Z> <20120628083857.GD12447@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Alex Williamson , avi@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, jan.kiszka@siemens.com To: "Michael S. Tsirkin" Return-path: In-Reply-To: <20120628083857.GD12447@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Thu, 28 Jun 2012 11:38:57 +0300 "Michael S. Tsirkin" wrote: > On Wed, Jun 27, 2012 at 04:24:30PM +0200, Cornelia Huck wrote: > > On Tue, 26 Jun 2012 23:09:04 -0600 > > Alex Williamson wrote: > > > > > Prune this down to just the struct kvm_irqfd so we can avoid > > > changing function definition for every flag or field we use. > > > > > > Signed-off-by: Alex Williamson > > > > I'm currently trying to find a way to make irqfd workable for s390 > > which will likely include using a new field in kvm_irqfd, so I'd like > > to have this change (and I also think it makes the code nicer to read). > > So: > > > > Acked-by: Cornelia Huck > > Unfortunately it looks like we are not sanitizing kvm_irqfd > at all so we won't be able to use the padding :( > We'll need a new ioctl instead. > How about something like this as parameter for the new ioctl? struct kvm_irqfd2 { __u32 fd; __u32 flags; /* for things like deassign */ __u64 type; /* determines the payload */ union { /* type traditional */ struct { __u32 gsi; } trad; /* type s390 */ struct { __u32 int_type; __u32 parm; __u64 parm64; } s390; __u8 pad[20]; }; } This could be combined with an arch or a per-kvm callback to keep the generic code clean of architecture dependencies. Cornelia