From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [Qemu-devel] [PATCH 4/4] kvm: i386: Add classic PCI device assignment Date: Tue, 28 Aug 2012 07:57:53 -0500 Message-ID: <87k3wjyy0e.fsf@codemonkey.ws> References: <825e653c9cfe9d8e26185917cbe1f1dd7ae299e2.1346048917.git.jan.kiszka@web.de> <503B62F4.9070500@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Avi Kivity , Marcelo Tosatti , Alex Williamson , qemu-devel@nongnu.org, kvm@vger.kernel.org, "Michael S. Tsirkin" , qemu-ppc , Alexey Kardashevskiy To: Andreas =?utf-8?Q?F=C3=A4rber?= , Jan Kiszka Return-path: Received: from mail-ob0-f174.google.com ([209.85.214.174]:61506 "EHLO mail-ob0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751610Ab2H1M57 convert rfc822-to-8bit (ORCPT ); Tue, 28 Aug 2012 08:57:59 -0400 Received: by obbuo13 with SMTP id uo13so10294701obb.19 for ; Tue, 28 Aug 2012 05:57:58 -0700 (PDT) In-Reply-To: <503B62F4.9070500@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: Andreas F=C3=A4rber writes: > Hi, > > Am 27.08.2012 08:28, schrieb Jan Kiszka: >> From: Jan Kiszka >>=20 >> This adds PCI device assignment for i386 targets using the classic K= VM >> interfaces. This version is 100% identical to what is being maintain= ed >> in qemu-kvm for several years and is supported by libvirt as well. I= t is >> expected to remain relevant for another couple of years until kernel= s >> without full-features and performance-wise equivalent VFIO support a= re >> obsolete. >>=20 >> A refactoring to-do that should be done in-tree is to model MSI and >> MSI-X support via the generic PCI layer, similar to what VFIO is alr= eady >> doing for MSI-X. This should improve the correctness and clean up th= e >> code from duplicate logic. >>=20 >> Signed-off-by: Jan Kiszka >> --- >> hw/kvm/Makefile.objs | 2 +- >> hw/kvm/pci-assign.c | 1929 +++++++++++++++++++++++++++++++++++++++= +++++++++++ >> 2 files changed, 1930 insertions(+), 1 deletions(-) >> create mode 100644 hw/kvm/pci-assign.c > [...] >> diff --git a/hw/kvm/pci-assign.c b/hw/kvm/pci-assign.c >> new file mode 100644 >> index 0000000..9cce02c >> --- /dev/null >> +++ b/hw/kvm/pci-assign.c >> @@ -0,0 +1,1929 @@ >> +/* >> + * Copyright (c) 2007, Neocleus Corporation. >> + * >> + * This program is free software; you can redistribute it and/or mo= dify it >> + * under the terms and conditions of the GNU General Public License= , >> + * version 2, as published by the Free Software Foundation. > > The downside of accepting this into qemu.git is that it gets us a hug= e > blob of GPLv2-only code without history of contributors for GPLv2+ > relicensing... That is 100% okay. Regards, Anthony Liguori > >> + * >> + * This program is distributed in the hope it will be useful, but W= ITHOUT >> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILI= TY or >> + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public Li= cense for >> + * more details. >> + * >> + * You should have received a copy of the GNU General Public Licens= e along with >> + * this program; if not, write to the Free Software Foundation, Inc= =2E, 59 Temple >> + * Place - Suite 330, Boston, MA 02111-1307 USA. > > (Expect the usual GNU address reminder here.) > >> + * >> + * >> + * Assign a PCI device from the host to a guest VM. >> + * >> + * Adapted for KVM by Qumranet. >> + * >> + * Copyright (c) 2007, Neocleus, Alex Novik (alex@neocleus.com) >> + * Copyright (c) 2007, Neocleus, Guy Zana (guy@neocleus.com) >> + * Copyright (C) 2008, Qumranet, Amit Shah (amit.shah@qumranet.com= ) >> + * Copyright (C) 2008, Red Hat, Amit Shah (amit.shah@redhat.com) >> + * Copyright (C) 2008, IBM, Muli Ben-Yehuda (muli@il.ibm.com) >> + */ >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include "hw/hw.h" >> +#include "hw/pc.h" >> +#include "qemu-error.h" >> +#include "console.h" >> +#include "hw/loader.h" >> +#include "monitor.h" >> +#include "range.h" >> +#include "sysemu.h" >> +#include "hw/pci.h" >> +#include "hw/msi.h" > >> +#include "kvm_i386.h" > > Am I correct to understand we compile this only for i386 / x86_64? > (apic.o in kvm/Makefile.objs hints in that direction) You may want to > update the description in the comment above accordingly, also mention= ing > that this is some deprecated backwards-compatibility thing. > > Regards, > Andreas > > --=20 > SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany > GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N= =C3=BCrnberg > -- > 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6LMp-0004cu-Kv for qemu-devel@nongnu.org; Tue, 28 Aug 2012 08:58:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T6LMl-0001Cw-8U for qemu-devel@nongnu.org; Tue, 28 Aug 2012 08:58:03 -0400 Received: from mail-ob0-f173.google.com ([209.85.214.173]:44035) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6LMl-0001Cm-1U for qemu-devel@nongnu.org; Tue, 28 Aug 2012 08:57:59 -0400 Received: by obbta14 with SMTP id ta14so9679113obb.4 for ; Tue, 28 Aug 2012 05:57:58 -0700 (PDT) From: Anthony Liguori In-Reply-To: <503B62F4.9070500@suse.de> References: <825e653c9cfe9d8e26185917cbe1f1dd7ae299e2.1346048917.git.jan.kiszka@web.de> <503B62F4.9070500@suse.de> Date: Tue, 28 Aug 2012 07:57:53 -0500 Message-ID: <87k3wjyy0e.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 4/4] kvm: i386: Add classic PCI device assignment List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?utf-8?Q?F=C3=A4rber?= , Jan Kiszka Cc: kvm@vger.kernel.org, "Michael S. Tsirkin" , Alexey Kardashevskiy , Marcelo Tosatti , qemu-devel@nongnu.org, Alex Williamson , qemu-ppc , Avi Kivity Andreas F=C3=A4rber writes: > Hi, > > Am 27.08.2012 08:28, schrieb Jan Kiszka: >> From: Jan Kiszka >>=20 >> This adds PCI device assignment for i386 targets using the classic KVM >> interfaces. This version is 100% identical to what is being maintained >> in qemu-kvm for several years and is supported by libvirt as well. It is >> expected to remain relevant for another couple of years until kernels >> without full-features and performance-wise equivalent VFIO support are >> obsolete. >>=20 >> A refactoring to-do that should be done in-tree is to model MSI and >> MSI-X support via the generic PCI layer, similar to what VFIO is already >> doing for MSI-X. This should improve the correctness and clean up the >> code from duplicate logic. >>=20 >> Signed-off-by: Jan Kiszka >> --- >> hw/kvm/Makefile.objs | 2 +- >> hw/kvm/pci-assign.c | 1929 +++++++++++++++++++++++++++++++++++++++++++= +++++++ >> 2 files changed, 1930 insertions(+), 1 deletions(-) >> create mode 100644 hw/kvm/pci-assign.c > [...] >> diff --git a/hw/kvm/pci-assign.c b/hw/kvm/pci-assign.c >> new file mode 100644 >> index 0000000..9cce02c >> --- /dev/null >> +++ b/hw/kvm/pci-assign.c >> @@ -0,0 +1,1929 @@ >> +/* >> + * Copyright (c) 2007, Neocleus Corporation. >> + * >> + * This program is free software; you can redistribute it and/or modify= it >> + * under the terms and conditions of the GNU General Public License, >> + * version 2, as published by the Free Software Foundation. > > The downside of accepting this into qemu.git is that it gets us a huge > blob of GPLv2-only code without history of contributors for GPLv2+ > relicensing... That is 100% okay. Regards, Anthony Liguori > >> + * >> + * This program is distributed in the hope it will be useful, but WITHO= UT >> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or >> + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public Licens= e for >> + * more details. >> + * >> + * You should have received a copy of the GNU General Public License al= ong with >> + * this program; if not, write to the Free Software Foundation, Inc., 5= 9 Temple >> + * Place - Suite 330, Boston, MA 02111-1307 USA. > > (Expect the usual GNU address reminder here.) > >> + * >> + * >> + * Assign a PCI device from the host to a guest VM. >> + * >> + * Adapted for KVM by Qumranet. >> + * >> + * Copyright (c) 2007, Neocleus, Alex Novik (alex@neocleus.com) >> + * Copyright (c) 2007, Neocleus, Guy Zana (guy@neocleus.com) >> + * Copyright (C) 2008, Qumranet, Amit Shah (amit.shah@qumranet.com) >> + * Copyright (C) 2008, Red Hat, Amit Shah (amit.shah@redhat.com) >> + * Copyright (C) 2008, IBM, Muli Ben-Yehuda (muli@il.ibm.com) >> + */ >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include "hw/hw.h" >> +#include "hw/pc.h" >> +#include "qemu-error.h" >> +#include "console.h" >> +#include "hw/loader.h" >> +#include "monitor.h" >> +#include "range.h" >> +#include "sysemu.h" >> +#include "hw/pci.h" >> +#include "hw/msi.h" > >> +#include "kvm_i386.h" > > Am I correct to understand we compile this only for i386 / x86_64? > (apic.o in kvm/Makefile.objs hints in that direction) You may want to > update the description in the comment above accordingly, also mentioning > that this is some deprecated backwards-compatibility thing. > > Regards, > Andreas > > --=20 > SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany > GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3= =BCrnberg > -- > 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