[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [PATCH 2/5] hw/arm/boot: Factor out "direct kernel boot"
From: |
Peter Maydell |
Subject: |
Re: [Qemu-arm] [PATCH 2/5] hw/arm/boot: Factor out "direct kernel boot" code into its own function |
Date: |
Tue, 5 Feb 2019 15:24:06 +0000 |
On Tue, 5 Feb 2019 at 15:16, Igor Mammedov <address@hidden> wrote:
>
> On Thu, 31 Jan 2019 11:22:37 +0000
> Peter Maydell <address@hidden> 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