On 8 June 2015 at 20:18, Liviu Ionescu <i...@livius.net> wrote: > >> On 08 Jun 2015, at 22:08, Peter Maydell <peter.mayd...@linaro.org> wrote: >> >> On 8 June 2015 at 19:48, Liviu Ionescu <i...@livius.net> wrote: >>>> On 08 Jun 2015, at 21:36, Peter Maydell <peter.mayd...@linaro.org> wrote: >>>> >>>> OK, so the problem diagnosis is right. I'm playing around with >>>> a patch which postpones PC/SP load until we start execution. >>> >>> but is this really necessary? >>> >>> the configuration at the moment cpu_reset is called is perfectly >>> stable, all memory regions are defined, the image was loaded, etc. >> >> No, the image hasn't been loaded into RAM yet, that's why >> the ldl_phys codepath doesn't work. > > aha, in this case the problem is the two step load, not the reset itself, > or even more accurate, it is a problem of making the reset calls in the > proper order.
That would also fix this problem, yes. It would still leave one use case wrong: * start QEMU * [cpu reset happens here; we load sp/pc] * in the debugger load an image (with a vector table) by writing it to RAM * let CPU run If we've already loaded sp/pc and then the user via the debugger changes the vector table, at the moment I don't think we will get the updated values. (Disclaimer: I haven't tested that, so it's speculation rather than confirmed behaviour.) -- PMM