On Tue, 5 Feb 2019 at 15:16, Igor Mammedov <imamm...@redhat.com> wrote: > > On Thu, 31 Jan 2019 11:22:37 +0000 > Peter Maydell <peter.mayd...@linaro.org> wrote: > > > +void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info) > > +{ > > + CPUState *cs; > > + AddressSpace *as = arm_boot_address_space(cpu, info); > > + > > + /* > > + * CPU objects (unlike devices) are not automatically reset on system > > + * reset, so we must always register a handler to do so. If we're > > + * actually loading a kernel, the handler is also responsible for > > + * arranging that we start it correctly. > > + */ > > + for (cs = first_cpu; cs; cs = CPU_NEXT(cs)) { > > + qemu_register_reset(do_cpu_reset, ARM_CPU(cs)); > > + } > Should we move this hunk to cpu code instead, like it's done for x86?
I don't know how x86 does it, but CPU reset is a mess, so if we can clean it up that would be nice. Most of what do_cpu_reset() is doing here is handling image load though, which doesn't seem to me to fit very well in the CPU code: it's pretty much what hw/arm/boot.c's job is. I'd rather do that in a different patchset, though: this is just a code movement refactoring. thanks -- PMM