From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753686AbbGBREH (ORCPT ); Thu, 2 Jul 2015 13:04:07 -0400 Received: from cam-admin0.cambridge.arm.com ([217.140.96.50]:32871 "EHLO cam-admin0.cambridge.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753298AbbGBRED (ORCPT ); Thu, 2 Jul 2015 13:04:03 -0400 Subject: Re: [PATCH 2/7] KVM: kvm_host: add kvm_extended_msi To: Eric Auger , "eric.auger@st.com" , "linux-arm-kernel@lists.infradead.org" , Marc Zyngier , "christoffer.dall@linaro.org" , "kvmarm@lists.cs.columbia.edu" , "kvm@vger.kernel.org" References: <1435592237-17924-1-git-send-email-eric.auger@linaro.org> <1435592237-17924-3-git-send-email-eric.auger@linaro.org> Cc: "linux-kernel@vger.kernel.org" , "p.fedin@samsung.com" , "pbonzini@redhat.com" From: Andre Przywara X-Enigmail-Draft-Status: N1110 Organization: ARM Ltd. Message-ID: <55956EDE.6030300@arm.com> Date: Thu, 2 Jul 2015 18:03:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 In-Reply-To: <1435592237-17924-3-git-send-email-eric.auger@linaro.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Eric, just played a bit with the code and I could make things easier by the following change: On 29/06/15 16:37, Eric Auger wrote: > Add a new kvm_extended_msi struct to store the additional device ID > specific to ARM. kvm_kernel_irq_routing_entry union now encompasses > this new struct. > > Signed-off-by: Eric Auger > > --- > > RFC -> PATCH: > - reword the commit message after change in first patch (uapi) > --- > include/linux/kvm_host.h | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h > index ad45054..e1c1c0d 100644 > --- a/include/linux/kvm_host.h > +++ b/include/linux/kvm_host.h > @@ -304,6 +304,13 @@ struct kvm_s390_adapter_int { > u32 adapter_id; > }; > > +struct kvm_extended_msi { > + u32 address_lo; /* low 32 bits of msi message address */ > + u32 address_hi; /* high 32 bits of msi message address */ > + u32 data; /* 16 bits of msi message data */ > + u32 devid; /* out-of-band device ID */ > +}; > + I got rid of this structure at all, instead using: @@ -317,6 +324,7 @@ struct kvm_kernel_irq_routing_entry { } irqchip; - struct msi_msg msi; + struct { + struct msi_msg msi; + u32 devid; + }; struct kvm_s390_adapter_int adapter; }; struct hlist_node link; }; This re-uses the existing MSI fields in struct msi_msg, so all the extra code you added in the next patches to set address and data could be skipped. If needed we can add a flags field here as well to avoid that extra type. That simplified a lot for me. Cheers, André