[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: TARGET_SYS_HEAPINFO and Cortex-A15 memory map
From: |
Peter Maydell |
Subject: |
Re: TARGET_SYS_HEAPINFO and Cortex-A15 memory map |
Date: |
Mon, 25 Jul 2022 17:02:14 +0100 |
On Mon, 25 Jul 2022 at 16:56, Liviu Ionescu <ilg@livius.net> wrote:
>
>
>
> > On 25 Jul 2022, at 18:43, Peter Maydell <peter.maydell@linaro.org> wrote:
> >
> > ... the memory map for the 'virt' board doesn't change for the a72
> > versus the a15. In both cases, the memory from 0x0 to 0x08000000
> > is the flash memory. So QEMU is incorrect to have reported that as
> > the place to put the heap in SYS_HEAPINFO.
>
> Could you also update the documentation pages to reflect the actual memory
> map for the Arm devices? It took me some time and experimentation to find
> this for my tests.
We document what the guest can assume about the virt board
memory layout here:
https://www.qemu.org/docs/master/system/arm/virt.html#hardware-configuration-information-for-bare-metal-programming
Flash at 0, RAM at 0x4000_0000, must look in the DTB blob
for all other information.
> > I suspect the fix to this bug is going to be "make sure that
> > SYS_HEAPINFO doesn't consider memory regions that are rom-devices"
>
> Sounds ok.
>
> > You don't mention which QEMU version you are using.
>
> 7.0.0
>
> > Do you have a test binary I can reproduce this with? That would save
> > me a little time.
>
> I have a template project that can generate several binaries intended to run
> on QEMU:
>
> - https://github.com/micro-os-plus/hello-world-qemu-template-xpack/
>
> The only prerequisite is npm/xpm, the rest of the dependencies are handled
> automatically.
>
> If this does not work for you, please tell me exactly which binary you need,
> and I can try to generate it.
The one where SYS_HEAPINFO produces the bogus result putting the
heap at 0x04000000, that you mentioned in the original report with
the command line
.../qemu-system-arm "--machine" "virt" "--cpu" "cortex-a15"
"--nographic" "-d" "unimp,guest_errors" "--semihosting-config"
"enable=on,target=native,arg=sample-test,arg=one,arg=two" -s -S
thanks
-- PMM