From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:51998) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rhsde-0003JQ-Ss for qemu-devel@nongnu.org; Mon, 02 Jan 2012 19:54:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rhsdd-0000C5-PH for qemu-devel@nongnu.org; Mon, 02 Jan 2012 19:54:02 -0500 Received: from mail-iy0-f173.google.com ([209.85.210.173]:58506) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rhsdd-0000By-MG for qemu-devel@nongnu.org; Mon, 02 Jan 2012 19:54:01 -0500 Received: by iagj37 with SMTP id j37so34852022iag.4 for ; Mon, 02 Jan 2012 16:54:00 -0800 (PST) Message-ID: <4F0251A2.4080102@codemonkey.ws> Date: Mon, 02 Jan 2012 18:53:54 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1324399916-21315-1-git-send-email-aliguori@us.ibm.com> <1324399916-21315-25-git-send-email-aliguori@us.ibm.com> <4F023295.3030409@suse.de> In-Reply-To: <4F023295.3030409@suse.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 24/27] grackle: remove broken pci device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-15?Q?Andreas_F=E4rber?= Cc: Anthony Liguori , "Michael S. Tsirkin" , Markus Armbruster , qemu-devel@nongnu.org, Alexander Graf , Paolo Bonzini On 01/02/2012 04:41 PM, Andreas Färber wrote: > Am 20.12.2011 17:51, schrieb Anthony Liguori: >> I have no idea what's going on here, but this is broken and cannot possibly >> work because: >> >> 1) It's qdev name conflicts with a device that sits on SysBus >> >> 2) The PCI constructor expects a SysBus device... but's it's a PCIDevice >> >> If you do qdev_create("grackle"), the code expects to get the SysBus version >> so drop the mystery PCI version. > > Nack. That's most definitely wrong! The qdev_create("grackle") SysBus > device instantiates the PCI host via pci_create_simple(..., "grackle"), > which does work, whether intentionally or by accent. (cc'ing mst) > > For PReP we have the same situation in the patch I'm rebasing, two named > "prep-pci". I'll just change the name then. Guess that's what we should > do for grackle and uni-north as well. (cc'ing Alex) > > Anthony, please cc us next time you have doubts about ppc emulation! Yes, qemu-test now tests powerpc targets and I've caught that this patch breaks it. I'll look into what the right fix should be next week. From what I recall from the code, I think it's pure luck that this works at all. Regards, Anthony Liguori > > Andreas > >> >> Signed-off-by: Anthony Liguori >> --- >> hw/grackle_pci.c | 17 ----------------- >> 1 files changed, 0 insertions(+), 17 deletions(-) >> >> diff --git a/hw/grackle_pci.c b/hw/grackle_pci.c >> index 1e529fb..84f1a47 100644 >> --- a/hw/grackle_pci.c >> +++ b/hw/grackle_pci.c >> @@ -115,27 +115,10 @@ static int pci_grackle_init_device(SysBusDevice *dev) >> return 0; >> } >> >> -static int grackle_pci_host_init(PCIDevice *d) >> -{ >> - d->config[0x09] = 0x01; >> - return 0; >> -} >> - >> -static PCIDeviceInfo grackle_pci_host_info = { >> - .qdev.name = "grackle", >> - .qdev.size = sizeof(PCIDevice), >> - .init = grackle_pci_host_init, >> - .vendor_id = PCI_VENDOR_ID_MOTOROLA, >> - .device_id = PCI_DEVICE_ID_MOTOROLA_MPC106, >> - .revision = 0x00, >> - .class_id = PCI_CLASS_BRIDGE_HOST, >> -}; >> - >> static void grackle_register_devices(void) >> { >> sysbus_register_dev("grackle", sizeof(GrackleState), >> pci_grackle_init_device); >> - pci_qdev_register(&grackle_pci_host_info); >> } >> >> device_init(grackle_register_devices) >