qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Piotr Król" <pietrushnic@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] vexpress-a9: coreboot is unable to push any data on stack
Date: Fri, 15 Aug 2014 12:07:21 +0200	[thread overview]
Message-ID: <20140815100719.GB11560@echad> (raw)

Hi all,
I'm trying to boot latest coreboot on qemu-system-arm (-M vexpress-a9).
I compiled qemu arm-softmmu from source (latest code) and trying to boot
with:

qemu-system-arm -M vexpress-a9 -m 1024M -nographic -bios build/coreboot.rom

First of all mtree looks strange because there are two aliases to one
memory region:

0000000000000000-0000000003ffffff (prio 0, RW): alias  vexpress.flashalias @vexpress.flash0 0000000000000000-0000000003ffffff
0000000000000000-0000000003ffffff (prio 0, RW): alias  vexpress.lowmem @vexpress.highmem 0000000000000000-0000000003ffffff

Is this ok ?

Second, because VE_NORFLASHALIAS was change to 0 here:
http://git.qemu.org/?p=qemu.git;a=commit;h=6ec1588e09770ac7e9c60194faff6101111fc7f0

I was unable to boot coreboot using:
qemu-system-arm -M vexpress-a9 -m 1024M -nographic -kernel build/coreboot.rom

If I change VE_NORFLASHALIAS to -1 like it was before coreboot boots using
'-kernel' parameter, but '-bios' flag even then doesn't work.

Third, (for '-bios' case) thing is that coreboot is unable to push any value on
stack. Instructions related to stack change stack pointer but stack address
memory dump show only 0xffffffff. Coreboot perform stack initialization on its
own.

Disassembled coreboot bootblock with stack initialization is here:
https://gist.github.com/pietrushnic/f83d5d0e5d8d1b75d4c2

The code flow is:
_rom
|-> reset
    |-> init_stack_loop
        |-> call_bootblock
            |-> main
                |-> armv7_invalidate_caches
                    |-> icache_invalidate_all
                    |-> dcache_invalidate_all
                      |-> dcache_foreach

At the begging of dcache_foreach we execute:
stmdb  sp!, {r0, r1, r4, r5, r6, r7, r9, sl, fp, lr}

And at the end there is:
ldmia.w sp!, {r2, r3, r4, r5, r6, r7, r9, r10, r11, pc}

Unfortunately, as I wrote, on stack we have all 0xffffffff that's why
dcache_foreach finish emulation with:

qemu: fatal: Trying to execute code outside RAM or ROM at 0xfffffffe

Any idea how to debug this issue or why it happens in that way ?
What could be the reason of unusable stack memory ?

P.S. Before I started thread here there was a discussion on coreboot mailing list:
http://www.coreboot.org/pipermail/coreboot/2014-August/078378.html

Thanks,
Piotr

             reply	other threads:[~2014-08-15 10:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-15 10:07 Piotr Król [this message]
2014-08-15 16:10 ` [Qemu-devel] vexpress-a9: coreboot is unable to push any data on stack Peter Maydell
2014-08-15 18:02   ` Piotr Król
2014-08-15 22:54     ` Peter Maydell
2014-08-16  9:50       ` Piotr Król
2014-08-16 11:19         ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140815100719.GB11560@echad \
    --to=pietrushnic@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).