All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thiemo Seufer <ths@networkno.de>
To: Thomas Petazzoni <thomas.petazzoni@enix.org>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] MIPS kernel hanging when loaded through U-Boot in qemu
Date: Thu, 28 Aug 2008 17:14:57 +0200	[thread overview]
Message-ID: <20080828151456.GA3229@networkno.de> (raw)
In-Reply-To: <20080828110042.1d27e8bb@surf>

Thomas Petazzoni wrote:
> Hi,
> 
> I'm trying to get a MIPS kernel to boot in qemu-system-mips when loaded
> through U-Boot, but the kernel boot hangs at random locations. Let me
> explain the whole thing. I'm running Qemu SVN-5089.
> 
> First, I have a 2.6.24.7 kernel configured for the "qemu" machine of
> the MIPS architecture. The config file is available at
>  http://toulibre.org/~thomas/qemu/config-2.6.24.7
> 
> When I boot this kernel using the -kernel option, it works perfectly,
> as can be seen in
>  http://toulibre.org/~thomas/qemu/qemu-log-kernel
> 
> (well it hangs because it cannot find a root filesystem, but this is
> expected)
> 
> The ELF binary of this kenel is available at
>  http://toulibre.org/~thomas/qemu/vmlinux
> 
> Now, to the problem. I compile U-Boot 1.3.4 for the qemu-mips machine,
> and boot into it using
> ~/local/qemu/mips-softmmu/qemu-system-mips -M mips -pflash u-boot.bin
> -net nic -net tap -serial stdio
> 
> U-Boot boots correctly, I can download the kernel using TFTP, flash it,
> and boot it. I use the exact same kernel, except that I use the
> binary-only arch/mips/boot/vmlinux.bin instead of the ELF file.

If U-boot jumps just to the start of vmlinux.bin then you need to
have CONFIG_BOOT_RAW enabled. Otherwise you get early exceptions,
which the U-Boot routines attempt to handle.

> Of
> course the vmlinux.bin has been prepared using mkimage before being
> downloaded by U-Boot. When I boot this kernel in U-Boot using the
> 'bootm' command, it starts, but then hangs:
>  http://toulibre.org/~thomas/qemu/qemu-log-kernel-from-uboot
> 
> It always hangs around the same place, but not exactly. Sometimes after
> "PID hash table entries", sometimes after "Console: colour dummy
> devices", sometimes one or two messages later, or before.
> 
> Using the qemu monitor, I can see where the kernel hanged:
>  http://toulibre.org/~thomas/qemu/qemu-monitor-showing-hang-location.png
> 
> It hanged at 0x80000180, which if I remember correctly my old MIPS
> knowledge, is an exception vector location. And the address that
> trigerred this exception is 0x80018904, which according to an objdump
> of the kernel, is located in handle_sys().
> 
> Then, when I use gdbserver, put a breakpoint in handle_sys() to get a
> backtrace, the backtrace is different at each boot. Two examples of
> backtraces:
>  http://toulibre.org/~thomas/qemu/qemu-backtrace-1
>  http://toulibre.org/~thomas/qemu/qemu-backtrace-2
> 
> Seing handle_sys() being called at that point of the kernel
> initialization looks strange to me, as userspace isn't running yet.

Try a breakpoint on kernel_entry and check if it triggers.


Thiemo

  reply	other threads:[~2008-08-28 15:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-28  9:00 [Qemu-devel] MIPS kernel hanging when loaded through U-Boot in qemu Thomas Petazzoni
2008-08-28 15:14 ` Thiemo Seufer [this message]
2008-09-03  7:25 ` Thomas Petazzoni
2008-09-03 10:54   ` Thiemo Seufer
2008-09-03 12:03     ` Thomas Petazzoni
2008-09-03 12:20       ` Thomas Petazzoni

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=20080828151456.GA3229@networkno.de \
    --to=ths@networkno.de \
    --cc=qemu-devel@nongnu.org \
    --cc=thomas.petazzoni@enix.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.