[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [PATCH v5 2/2] hw/arm: add Arm SBSA reference machine, de
From: |
Peter Maydell |
Subject: |
Re: [Qemu-arm] [PATCH v5 2/2] hw/arm: add Arm SBSA reference machine, devices part |
Date: |
Tue, 29 Jan 2019 15:26:29 +0000 |
On Mon, 28 Jan 2019 at 09:46, Hongbo Zhang <address@hidden> wrote:
>
> On Tue, 22 Jan 2019 at 19:49, Peter Maydell <address@hidden> wrote:
> >
> > On Fri, 7 Dec 2018 at 09:08, Hongbo Zhang <address@hidden> wrote:
> > > +static void sbsa_ref_machine_done(Notifier *notifier, void *data)
> > > +{
> > > + VirtMachineState *vms = container_of(notifier, VirtMachineState,
> > > + machine_done);
> > > + ARMCPU *cpu = ARM_CPU(first_cpu);
> > > + struct arm_boot_info *info = &vms->bootinfo;
> > > + AddressSpace *as = arm_boot_address_space(cpu, info);
> > > +
> > > + if (arm_load_dtb(info->dtb_start, info, info->dtb_limit, as) < 0) {
> > > + exit(1);
> > > + }
> > > +}
> >
> > I still don't understand why we need this -- it doesn't seem
> > to be doing anything different from the default behaviour that
> > boot.c implements if skip_dtb_autoload is false.
> >
>
> According to the process of arm_load_kernel() in boot.c, If only
> kernel loaded via -kernel but without any firmware, it works fine.
> While in this case, we have have firmware loaded but no kernel (eg
> firmware loads kernel from storage, firmware never come back to qemu
> again), so the arm_load_kernel() returns in the middle before calling
> arm_load_dtb(), because arm_load_dtb() is the final step in
> arm_load_kernel(), so there is no chance for the arm_load_dtb() to be
> called, then we get error message and qemu quits.
Oh, I see now. I think this is a bug in boot.c and we should
fix it by making the "this is a firmware boot" code path also
do the arm_load_dtb() call. I'll send a patch.
thanks
-- PMM