On Wed, 6 Apr 2022 at 21:07, Alex Bennée <[email protected]> wrote:
>
>
> Peter Maydell <[email protected]> writes:
> > Guest memory is generally zero at startup. Do we manage to
> > hit the bit of memory at the start of the virt machine's RAM
> > where we store the DTB ? (As you say, initializing the data
> > structures is the right thing anyway.)
>
> I don't know - where is the DTB loaded?
Start of RAM (that's physaddr 0x4000_0000). The thing I'm not sure
about is whether these qtests go through the code in hw/arm/boot.c
that loads the DTB into guest RAM or not.
> Currently we are using the first
> couple of pages in qtest because that where the qtest allocater is
> initialised:
>
> static void *qos_create_machine_arm_virt(QTestState *qts)
> {
> QVirtMachine *machine = g_new0(QVirtMachine, 1);
>
> alloc_init(&machine->alloc, 0,
> ARM_VIRT_RAM_ADDR,
> ARM_VIRT_RAM_ADDR + ARM_VIRT_RAM_SIZE,
> ARM_PAGE_SIZE);
> qvirtio_mmio_init_device(&machine->virtio_mmio, qts,
> VIRTIO_MMIO_BASE_ADDR,
> VIRTIO_MMIO_SIZE);
>
> qos_create_generic_pcihost(&machine->bridge, qts, &machine->alloc);
>
> machine->obj.get_device = virt_get_device;
> machine->obj.get_driver = virt_get_driver;
> machine->obj.destructor = virt_destructor;
> return machine;
> }
>
> I don't know if there is a more sane piece of memory we should be using.
The first part of RAM is fine, it's just you can't assume it's
all zeroes :-)
-- PMM