From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Subject: Re: [PATCH] KVM: Add KVM_CAP_IRQ_ARCH capability Date: Thu, 14 Mar 2013 17:41:23 -0500 Message-ID: <1363300883.28440.19@snotra> References: <20130314012044.GA12273@drongo> <1363285238.28440.9@snotra> <20130314221917.GI9841@iris.ozlabs.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; delsp=Yes; format=Flowed Content-Transfer-Encoding: 8BIT Cc: Alexander Graf , , To: Paul Mackerras Return-path: In-Reply-To: <20130314221917.GI9841@iris.ozlabs.ibm.com> (from paulus@samba.org on Thu Mar 14 17:19:17 2013) Content-Disposition: inline Sender: kvm-ppc-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 03/14/2013 05:19:17 PM, Paul Mackerras wrote: > On Thu, Mar 14, 2013 at 01:20:38PM -0500, Scott Wood wrote: > > On 03/13/2013 08:20:44 PM, Paul Mackerras wrote: > > > >--- a/arch/powerpc/include/asm/kvm_host.h > > >+++ b/arch/powerpc/include/asm/kvm_host.h > > >@@ -373,6 +373,9 @@ struct kvmppc_booke_debug_reg { > > > struct kvm_vcpu_arch { > > > ulong host_stack; > > > u32 host_pid; > > >+ > > >+ u32 intr_ctrler; > > >+ > > > > That abbreviation seems a bit awkward, and we should also have a > > private-data pointer. > > > > How about: > > > > u32 irq_arch; > > void *irq_priv; > > Regarding the irq_priv - in my patchset the XICS code adds its own > private data pointer. That has the advantage that it can be strongly > typed, and if it is non-NULL then I know it points to XICS data, not > the data for some other type of controller. As long as we are only > going to have a small number of IRQ architectures then it's feasible > to allow each to have its own data pointer, and we get the advantages > of strong typing. OK. > > >+ switch (cap->args[0]) { > > >+ case 0: /* no interrupt controller */ > > >+ break; > > > > s/0/KVM_IRQ_ARCH_NONE/ > > > > ...at least so that this patch makes it clear where other type ids > > should > > be defined. > > OK, whatever. Well, it wouldn't be good for MPIC to end up defined in one place and XICS in another, especially if adding a definition is how new IDs are allocated... -Scott