From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Mackerras Subject: Re: [RFC PATCH v3 5/6] kvm/ppc/mpic: in-kernel MPIC emulation Date: Mon, 8 Apr 2013 16:30:42 +1000 Message-ID: <20130408063042.GB8932@iris.ozlabs.ibm.com> References: <1364856473-25245-1-git-send-email-scottwood@freescale.com> <1364954273-18196-1-git-send-email-scottwood@freescale.com> <1364954273-18196-6-git-send-email-scottwood@freescale.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Alexander Graf , kvm-ppc@vger.kernel.org, kvm@vger.kernel.org To: Scott Wood Return-path: Received: from ozlabs.org ([203.10.76.45]:43871 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752263Ab3DHGa5 (ORCPT ); Mon, 8 Apr 2013 02:30:57 -0400 Content-Disposition: inline In-Reply-To: <1364954273-18196-6-git-send-email-scottwood@freescale.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Apr 02, 2013 at 08:57:52PM -0500, Scott Wood wrote: > Hook the MPIC code up to the KVM interfaces, add locking, etc. [snip] > @@ -2164,6 +2164,15 @@ static int kvm_ioctl_create_device(struct kvm *kvm, > bool test = cd->flags & KVM_CREATE_DEVICE_TEST; > > switch (cd->type) { > +#ifdef CONFIG_KVM_MPIC > + case KVM_DEV_TYPE_FSL_MPIC_20: > + case KVM_DEV_TYPE_FSL_MPIC_42: { > + if (test) > + return 0; > + > + return kvm_create_mpic(kvm, cd->type); > + } > +#endif I think this needs to be more like: #ifdef CONFIG_KVM_MPIC case KVM_DEV_TYPE_FSL_MPIC_20: case KVM_DEV_TYPE_FSL_MPIC_42: { int fd; if (test) return 0; fd = kvm_create_mpic(kvm, cd->type); if (fd < 0) return fd; cd->fd = fd; return 0; } #endif Paul.