From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [RFC PATCH v3 5/6] kvm/ppc/mpic: in-kernel MPIC emulation Date: Wed, 3 Apr 2013 18:55:27 +0300 Message-ID: <20130403155527.GJ3889@redhat.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, paulus@samba.org To: Scott Wood Return-path: Content-Disposition: inline In-Reply-To: <1364954273-18196-6-git-send-email-scottwood@freescale.com> Sender: kvm-ppc-owner@vger.kernel.org List-Id: kvm.vger.kernel.org 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. > > TODO: irqfd support, split up into multiple patches, KVM_IRQ_LINE > support > > Signed-off-by: Scott Wood > --- [skip] > diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h > index 20ce2d2..d8f44ef 100644 > --- a/include/uapi/linux/kvm.h > +++ b/include/uapi/linux/kvm.h > @@ -927,6 +927,15 @@ struct kvm_device_attr { > __u64 addr; /* userspace address of attr data */ > }; > > +#define KVM_DEV_TYPE_FSL_MPIC_20 1 > +#define KVM_DEV_TYPE_FSL_MPIC_42 2 > + > +#define KVM_DEV_MPIC_GRP_MISC 1 > +#define KVM_DEV_MPIC_BASE_ADDR 0 /* 64-bit */ > + > +#define KVM_DEV_MPIC_GRP_REGISTER 2 /* 32-bit */ > +#define KVM_DEV_MPIC_GRP_IRQ_ACTIVE 3 /* 32-bit */ Why not put them in arch specific header? > + > /* ioctl for vm fd */ > #define KVM_CREATE_DEVICE _IOWR(KVMIO, 0xe0, struct kvm_create_device) > > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > index ed033c0..e325f5d 100644 > --- a/virt/kvm/kvm_main.c > +++ b/virt/kvm/kvm_main.c > @@ -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 > default: > return -ENODEV; > } > -- > 1.7.9.5 > > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Gleb.