On Sun, Dec 13, 2009 at 11:39 PM, Mark Cave-Ayland mark.cave-ayland@siriusit.co.uk wrote:
Igor Kovalenko wrote:
Generally, OF is placed in high memory, and memory allocations are from low memory.
That is how memory layout looks like now, if we look at 32bits of physical address space. The only difference seems to be with low 16m being used for both pci memory, i/o space and actual memory. It's getting mapped 1:1 into virtual address space used by openbios code.
Ah this is now starting to make sense. I assumed from reading the OpenBIOS code that PCI devices were just mapped directly to virtual addresses, but I can see that this may not necessary be the case. Does that mean OpenBIOS is missing some kind of PCI controller emulation in order to access PCI memory space?
Though I can also see that this wouldn't just affect the Qemu/SPARC combination so I'm quite surprised that this hasn't been noticed before on other guest/host combinations.
Well, sparc64 is a bit unique.
From what I have seen almost any other openbios platform is either 32bit
or has no pci devices, also every other platform has pci configuration mechanism 1 in place. - sparc64 has no configuration mechanism 1 (which has basically a single port to implement configuration protocol) but directly maps configuration space. So for sparc64 pci is also quite different from the rest, and a few clients know about that mapped configuration space. - PCI support is there and useful, but a few places has bar address mapping hardcoded; - getting ucells right on 64bit sparc was *real* fun :) It turns out that linux kernel started to rely more on prom tree data so that required ofmem supporting allocations and range properties; no other openbios platform seem to require implementing ofmem to such extent
But there are several address spaces, which it sounds like are being overlapped here:
Right, that's the issue we have at the moment; both qemu and openbios are to be changed.
- Actual memory
- PCI memory space
- PCI IO space
They are each independent address spaces. Zero in any one of them is independent from zero in all the others.
I've never looked at PCI devices in much detail before, however if there is any C coding I can do to help out, please let me know.
Welcome! But to my mind we need to get qemu part right first, in that we need to remap pci address spaces out of low addresses. If you could invent another workaround it would be a good start, we need get these 3 address spaces right one way or another.