Received: from eggs.gnu.org ([2001:4830:134:3::10]:44484) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzCn7-0002nN-Gm for qemu-devel@nongnu.org; Mon, 23 Jun 2014 18:32:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WzCn1-0007zR-C1 for qemu-devel@nongnu.org; Mon, 23 Jun 2014 18:32:45 -0400 Date: Tue, 24 Jun 2014 00:32:36 +0200 (CEST) From: BALATON Zoltan In-Reply-To: <53A89D29.1070001@ilande.co.uk> Message-ID: References: <20140602231148.104752F472@mono.eik.bme.hu> <53A00063.6050107@suse.de> <53A00CD3.7000201@suse.de> <53A8556C.4040909@suse.de> <53A89D29.1070001@ilande.co.uk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: Re: [Qemu-devel] [PATCH v2] mac99: Change memory layout to better match PowerMac3, 1 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark Cave-Ayland Cc: qemu-ppc@nongnu.org, Alexander Graf , afaerber@suse.de, qemu-devel@nongnu.org On Mon, 23 Jun 2014, Mark Cave-Ayland wrote: > On 23/06/14 20:25, BALATON Zoltan wrote: > >>>> It's how OpenBIOS assigns MMIO addresses to pci devices. It does it >>>> by going through them in order and map them starting from the base >>>> address (with some allingment). I guess you could look at >>>> drivers/pci.c I think it's in there somewhere. >>> >>> I think it'd make more sense to just bolt the PCI devices to their >>> respective devfns that they also have on real hardware. Depending on >>> ordering magic that happens to give us different BAR maps by firmware >>> doesn't really give me a lot of confidence. >> >> I don't understand what you mean. I don't want to rewrite PCI handling >> code in OpenBIOS as that would have a higher chance of breaking >> something else (OpenBIOS is used by other archs as well). Also it would >> require more knowledge about the emulated hardware in OpenBIOS while it >> aims to be a generic implementation and wants to reduce special cases >> already in it. So I don't see a cleaner and easy way to do this. If I'm >> missing something please tell me. On the other hand you've said before >> that the mac99 machine is mostly a hack to be enough that some OS-es can >> run with it. Why reordering some devices to get the right BAR maps not >> fit in this hack? > > Since the MMIO address is calculated by rounding up to the next start address > based on region size (where size tends to be more static compared to start > address) then I'd be okay with this as a short term hack. Thanks. I've sent the other half of the patch then, that could be taken until a better solution will be available (it does not have to be reverted then either). Regards, BALATON Zoltan