From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54125) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2Fp6-00046O-6k for qemu-devel@nongnu.org; Fri, 27 Nov 2015 05:00:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a2Fp0-0007Up-47 for qemu-devel@nongnu.org; Fri, 27 Nov 2015 05:00:12 -0500 References: <1448616740-27332-1-git-send-email-thuth@redhat.com> <1448616740-27332-3-git-send-email-thuth@redhat.com> From: Alexander Graf Message-ID: <565829A3.1020400@suse.de> Date: Fri, 27 Nov 2015 11:00:03 +0100 MIME-Version: 1.0 In-Reply-To: <1448616740-27332-3-git-send-email-thuth@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/2] hw/ppc/spapr: Use XHCI as host controller for new spapr machines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth , qemu-ppc@nongnu.org, David Gibson Cc: Alexey Kardashevskiy , qemu-devel@nongnu.org, Nikunj A Dadhania On 27.11.15 10:32, Thomas Huth wrote: > The OHCI has some bugs and performance issues, so for newer > machines it's preferable to use XHCI instead. > > Signed-off-by: Thomas Huth > --- > hw/ppc/spapr.c | 15 ++++++++++++++- > include/hw/ppc/spapr.h | 3 ++- > 2 files changed, 16 insertions(+), 2 deletions(-) > > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > index 10b7c35..f6e6888 100644 > --- a/hw/ppc/spapr.c > +++ b/hw/ppc/spapr.c > @@ -1914,7 +1914,11 @@ static void ppc_spapr_init(MachineState *machine) > } > > if (machine->usb) { > - pci_create_simple(phb->bus, -1, "pci-ohci"); > + if (smc->use_ohci_by_default) { > + pci_create_simple(phb->bus, -1, "pci-ohci"); > + } else { > + pci_create_simple(phb->bus, -1, "nec-usb-xhci"); > + } > > if (spapr->has_graphics) { > USBBus *usb_bus = usb_bus_find(-1); > @@ -2364,9 +2368,11 @@ static void spapr_machine_2_1_class_init(ObjectClass *oc, void *data) > SPAPR_COMPAT_2_1 > { /* end of list */ } > }; > + sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(oc); > > mc->desc = "pSeries Logical Partition (PAPR compliant) v2.1"; > mc->compat_props = compat_props; > + smc->use_ohci_by_default = true; > } > > static const TypeInfo spapr_machine_2_1_info = { > @@ -2383,9 +2389,11 @@ static void spapr_machine_2_2_class_init(ObjectClass *oc, void *data) > { /* end of list */ } > }; > MachineClass *mc = MACHINE_CLASS(oc); > + sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(oc); > > mc->desc = "pSeries Logical Partition (PAPR compliant) v2.2"; > mc->compat_props = compat_props; > + smc->use_ohci_by_default = true; > } > > static const TypeInfo spapr_machine_2_2_info = { > @@ -2402,9 +2410,11 @@ static void spapr_machine_2_3_class_init(ObjectClass *oc, void *data) > { /* end of list */ } > }; > MachineClass *mc = MACHINE_CLASS(oc); > + sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(oc); > > mc->desc = "pSeries Logical Partition (PAPR compliant) v2.3"; > mc->compat_props = compat_props; > + smc->use_ohci_by_default = true; > } > > static const TypeInfo spapr_machine_2_3_info = { > @@ -2421,9 +2431,11 @@ static void spapr_machine_2_4_class_init(ObjectClass *oc, void *data) > { /* end of list */ } > }; > MachineClass *mc = MACHINE_CLASS(oc); > + sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(oc); > > mc->desc = "pSeries Logical Partition (PAPR compliant) v2.4"; > mc->compat_props = compat_props; > + smc->use_ohci_by_default = true; > } > > static const TypeInfo spapr_machine_2_4_info = { > @@ -2440,6 +2452,7 @@ static void spapr_machine_2_5_class_init(ObjectClass *oc, void *data) > mc->name = "pseries-2.5"; > mc->desc = "pSeries Logical Partition (PAPR compliant) v2.5"; > smc->dr_lmb_enabled = true; > + smc->use_ohci_by_default = true; > } > > static const TypeInfo spapr_machine_2_5_info = { > diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h > index 5baa906..53af76a 100644 > --- a/include/hw/ppc/spapr.h > +++ b/include/hw/ppc/spapr.h > @@ -35,7 +35,8 @@ struct sPAPRMachineClass { > MachineClass parent_class; > > /*< public >*/ > - bool dr_lmb_enabled; /* enable dynamic-reconfig/hotplug of LMBs */ > + bool dr_lmb_enabled; /* enable dynamic-reconfig/hotplug of LMBs */ > + bool use_ohci_by_default; /* use USB-OHCI instead of XHCI */ I think with the x86 scheme of always calling the predecessor quirk functions, we're better off with a flag saying "use_xhci_by_default" that gets set from 2.6 onwards. I also do agree that switching to xhci is the right path forward. I think the main reason we didn't do it from the beginning was lack of support in SLOF ;). Alex