From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzBv8-0004V7-51 for qemu-devel@nongnu.org; Mon, 23 Jun 2014 17:37:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WzBv0-0007Hi-NL for qemu-devel@nongnu.org; Mon, 23 Jun 2014 17:36:58 -0400 Message-ID: <53A89D29.1070001@ilande.co.uk> Date: Mon, 23 Jun 2014 22:33:29 +0100 From: Mark Cave-Ayland MIME-Version: 1.0 References: <20140602231148.104752F472@mono.eik.bme.hu> <53A00063.6050107@suse.de> <53A00CD3.7000201@suse.de> <53A8556C.4040909@suse.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: BALATON Zoltan , Alexander Graf Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, afaerber@suse.de 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. Longer term I suspect we'll need to teach OpenBIOS about assigning fixed addresses to certain PCI devices based upon architecture, and it's starting to look like I may need to do this for the next part of my work on improving SPARC64 support. ATB, Mark.