From: Shaddy Baddah <shaddy.baddah@shaddybaddah.name>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] and now bus error for i386 guest
Date: Thu, 06 Dec 2007 11:17:29 +1100 [thread overview]
Message-ID: <47573F99.4060001@shaddybaddah.name> (raw)
In-Reply-To: <f43fc5580712051336q610aae74xecdd3a0a68f1ede3@mail.gmail.com>
Hi,
Blue Swirl wrote:
> On 12/5/07, Shaddy Baddah <shaddy.baddah@shaddybaddah.name> wrote:
>> 0x1e958 <main+13992>: ld [ %l6 + 0x8c ], %l1
>> 0x1e95c <main+13996>: call 0xa90b4 <cpu_x86_exec>
>> 0x1e960 <main+14000>: mov %l1, %o0
>
> Maybe you missed the effect of the delay slot. The first argument is
> prepared in %l1 and moved to %o0 in the delay slot of the call
> instruction.
You'll have to forgive me... although I know about the delay slot, I
only slightly dabble in assembly, so I am not so confident at reading
it. Reading this to mean that perhaps the assignment would be effected
after execution of a further instruction, I've redone the debugging, and
include it below:
$ gdb --args ./i386-softmmu/qemu -cdrom
../../KNOPPIX_V5.1.1CD-2007-01-04-EN.iso -L ../qemu/pc-bios
GNU gdb 6.6.90.20070912-debian
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "sparc-linux-gnu"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb)
(gdb) break vl.c:7362
Breakpoint 1 at 0x1e958: file /home/shaddy/qemu-cvs/qemu/vl.c, line 7362.
(gdb) display /i $pc
(gdb) run
Starting program: /home/shaddy/qemu-cvs/qemu-optbuild/i386-softmmu/qemu
-cdrom ../../KNOPPIX_V5.1.1CD-2007-01-04-EN.iso -L ../qemu/pc-bios
[Thread debugging using libthread_db enabled]
[New Thread 0xf7f27550 (LWP 15523)]
[Switching to Thread 0xf7f27550 (LWP 15523)]
Breakpoint 1, main (argc=1430528, argv=0x15d400) at
/home/shaddy/qemu-cvs/qemu/vl.c:7362
7362 env = next_cpu;
1: x/i $pc
0x1e958 <main+13992>: ld [ %l6 + 0x8c ], %l1
(gdb) print /x env
$1 = 0x322e3100
(gdb) print /x next_cpu
$2 = 0x1cd13e8
(gdb) stepi
7366 ret = cpu_exec(env);
1: x/i $pc
0x1e95c <main+13996>: call 0xa90b4 <cpu_x86_exec>
0x1e960 <main+14000>: mov %l1, %o0
(gdb)
0x0001e960 7366 ret = cpu_exec(env);
1: x/i $pc
0x1e960 <main+14000>: mov %l1, %o0
(gdb) print /x next_cpu
$3 = 0x1cd13e8
(gdb) print /x env
$4 = 0x322e3100
(gdb) print /x &env
Address requested for identifier "env" which is in register $g6
(gdb) print $g6
$5 = 841888000
(gdb) print /x $g6
$6 = 0x322e3100
(gdb) stepi
cpu_x86_exec (env1=0x117000) at /home/shaddy/qemu-cvs/qemu/cpu-exec.c:244
244 {
1: x/i $pc
0xa90b4 <cpu_x86_exec>: add %sp, -232, %sp
(gdb) print /x $g6
$7 = 0x322e3100
(gdb) stepi
0x000a90b8 in cpu_x86_exec (env1=0x117000) at
/home/shaddy/qemu-cvs/qemu/cpu-exec.c:244
244 {
1: x/i $pc
0xa90b8 <cpu_x86_exec+4>: st %i7, [ %sp + 0x60 ]
(gdb) print /x $g6
$8 = 0x322e3100
(gdb) stepi
0x000a90bc 244 {
1: x/i $pc
0xa90bc <cpu_x86_exec+8>: sub %sp, -232, %i7
(gdb) print /x $g6
$9 = 0x322e3100
(gdb)
I still read that as failing to assign the value. Given my limited
knowledge, how is gdb so adamantly stating that env1=0x117000 when the
value of env1 (i.e. env in the calling function) is only known after the
delay slot instruction is completed? That's more a rhetorical
question... I've got to do a bit of research to be able to know these
things myself.
>> 0x240a4 <main_loop+152>: sethi %hi(0x258800), %g4
>> 0x240a8 <main_loop+156>: or %g4, 0x4c, %g4 ! 0x25884c
>> 0x240ac <main_loop+160>: ld [ %g4 ], %g4
>> 0x240b0 <main_loop+164>: st %g4, [ %fp + -20 ]
>> 0x240b4 <main_loop+168>: ld [ %fp + -20 ], %o0
>> 0x240b8 <main_loop+172>: call 0x14fa64 <cpu_x86_exec>
>> 0x240bc <main_loop+176>: nop
>
> This looks like equivalent code, only dumber version using an
> intermediate store and not using the delay slot.
Sure. However, what do you read of gdb determining that the value for
env in the parameters to the cpu_exec call being different to its value
in the calling function?
Regards,
Shaddy
next prev parent reply other threads:[~2007-12-06 0:17 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-14 7:04 [Qemu-devel] Alpha build failure: dyngen picking out a nameless symbol Shaddy Baddah
2007-11-14 8:10 ` [Qemu-devel] now ppc build failure: dyngen: empty code for op_splatw_T1_64 Shaddy Baddah
2007-11-14 13:13 ` [Qemu-devel] and now bus error for i386 guest Shaddy Baddah
2007-11-14 20:42 ` Blue Swirl
2007-12-04 4:21 ` Shaddy Baddah
2007-12-04 13:23 ` Shaddy Baddah
2007-12-04 18:54 ` Blue Swirl
2007-12-05 14:33 ` Shaddy Baddah
2007-12-05 21:36 ` Blue Swirl
2007-12-06 0:17 ` Shaddy Baddah [this message]
2007-12-06 9:10 ` Blue Swirl
2007-12-06 15:19 ` Blue Swirl
2007-11-15 20:01 ` [Qemu-devel] Alpha build failure: dyngen picking out a nameless symbol Blue Swirl
2007-11-15 22:50 ` Paul Brook
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=47573F99.4060001@shaddybaddah.name \
--to=shaddy.baddah@shaddybaddah.name \
--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).