On 07.11.2010, at 23:13, Andreas Färber wrote:
Am 01.11.2010 um 17:36 schrieb Andreas Färber:
Latest state with local patches is that hell breaks loose once the MMU is set up. I get a 0x400 (ISI) exception and when the bctrl to isi_exception() is executed, we end up at trap_error, where it branches to unexpected_excep() and tries to printk() to the serial port that's not yet set up. I'll put a few patches together.
Since r945 everything except for the trampoline issue should be in SVN.
I've made no more progress throughout the week though:
Directly after we set the MSR_IR|MSR_DR bits in the MSR (arch/ppc/qemu/ofmem.c:setup_mmu), we get an ISI exception and end up in arch/ppc/qemu/start.S:vector__0x400 (the 0xfffxxxxx one). We proceed up to the bctrl which should take us to arch/ppc/qemu/ofmem.c:isi_exception, but then get a 0x700 program exception. The value in ctr looks sensible, it's some 0xfffxxxxx address.
i) I read that mtsrin were not allowed in 64-bit mode and its results unpredictable, so I tried switching MSR_SF off before and back on after the loop, without luck.
ii) If I exit the setup_mmu() function without turning the MMU on, we proceed to arch/ppc/qemu/init.c:entry() but are unsuccessful reading the magic fw_cfg signature. Stepping through the code it seemed as if some variable assignments like in drivers/fw_cfg.c:fw_cfg_init() were having no effect - could that be due to OpenBIOS code execution happening in ROM rather than ea_to_phys()-mapped to RAM? (i.e., write-only storage?:)) Or would this be some memory caching issue for the fw_cfg ports?
iii) Before turning on the MMU, I tried implementing the early-mapping of pages by calling hash_page() from ofmem_arch_early_map_pages() and calling ofmem_map() for the ROM-to-RAM translation and for identity-mapping the code. This leads to a hang in libopenbios/ofmem_common.c:ofmem_update_memory_available() in a code path (a printk in ofmem_realloc()) that would normally only be taken if libopenbios/ofmem_common.c:s_phandle_memory were non-zero, at a point where it should still be zero.
Any clue why ppc works but ppc64 doesn't?
You could try to enable the debug code in target-ppc/helper.c :). That maybe tells you more.
Alex