qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Questions on ARM port
@ 2006-03-14 13:28 Schwarz, Konrad
  2006-03-14 14:21 ` Paul Brook
  0 siblings, 1 reply; 4+ messages in thread
From: Schwarz, Konrad @ 2006-03-14 13:28 UTC (permalink / raw)
  To: qemu-devel


[-- Attachment #1.1: Type: text/plain, Size: 1531 bytes --]

Hello,
 
the Newlib crt0.S file for ARM starts off by initializing the stack
pointers for the different ARM modes (FIQ, IRQ, supervisor, etc.) with
the help of r3.
 
e.g., this is the disassembly as produced by GDB:
 
Dump of assembler code for function start:
0x00008224 <start+0>:   ldr     r3, [pc, #208]  ; 0x82fc <$d+4>
0x00008228 <start+4>:   cmp     r3, #0  ; 0x0
0x0000822c <start+8>:   ldreq   r3, [pc, #196]  ; 0x82f8 <$d>
0x00008230 <start+12>:  msr     CPSR_c, #209    ; 0xd1
0x00008234 <start+16>:  mov     sp, r3
0x00008238 <start+20>:  sub     r10, sp, #4096  ; 0x1000
0x0000823c <start+24>:  mov     r3, r10
0x00008240 <start+28>:  msr     CPSR_c, #215    ; 0xd7
0x00008244 <start+32>:  mov     sp, r3
...
 
Basically, r3 is initialized by <start+8> (to 0x80000, in my case).  The
next instruction (at <start+12>) switches the mode to FIQ.  After single
steping over this in QEMU (via GDB si), r3 no longer contains what it
had before (0x80000), instead, it is set to 0.  If I manually fix this
(via set $r3=0x80000), then at the next mode switch (at <start+28>) r3
is changed incorrectly to zero again.
 
Is this my fault or what is happening?
 
I am invoking qemu as
 
    arm-softmmu/qemu-system-arm -S -s -M altera_excalibur -m 64 -net
none -nographic -kernel
../projekte/L6/node-arm/libsys/test-io/libsys_test_uart -monitor null
-parallel null -serial null
 
(where altera_excalibur is a machine that I have added and would like to
debug).
 
Regards,
 
Konrad Schwarz

[-- Attachment #1.2: Type: text/html, Size: 4059 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Konrad Schwarz.vcf --]
[-- Type: text/x-vcard; name="Konrad Schwarz.vcf", Size: 650 bytes --]

BEGIN:VCARD
VERSION:2.1
N:Schwarz;Konrad
FN:Konrad Schwarz
ORG:Siemens AG;CT SE 2
TITLE:Principal Engineer
TEL;WORK;VOICE:+49 (89) 636-53579
TEL;WORK;FAX:+49 (89) 636-45450
ADR;WORK;ENCODING=QUOTED-PRINTABLE:;53 518;Siemens AG=0D=0ACT SE 2;M=FCnchen;;81730;Germany
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:53 518=0D=0ASiemens AG=0D=0ACT SE 2=0D=0AM=FCnchen 81730=0D=0AGermany
ADR;POSTAL;ENCODING=QUOTED-PRINTABLE:;;Siemens AG=0D=0ACT SE 2;M=FCnchen;;81730;Germany
LABEL;POSTAL;ENCODING=QUOTED-PRINTABLE:Siemens AG=0D=0ACT SE 2=0D=0AM=FCnchen 81730=0D=0AGermany
EMAIL;PREF;INTERNET:konrad.schwarz@siemens.com
REV:20060130T101011Z
END:VCARD

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] Questions on ARM port
  2006-03-14 13:28 [Qemu-devel] Questions on ARM port Schwarz, Konrad
@ 2006-03-14 14:21 ` Paul Brook
  0 siblings, 0 replies; 4+ messages in thread
From: Paul Brook @ 2006-03-14 14:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Schwarz, Konrad

> Basically, r3 is initialized by <start+8> (to 0x80000, in my case).  The
> next instruction (at <start+12>) switches the mode to FIQ.  After single
> steping over this in QEMU (via GDB si), r3 no longer contains what it
> had before (0x80000), instead, it is set to 0.  If I manually fix this
> (via set $r3=0x80000), then at the next mode switch (at <start+28>) r3
> is changed incorrectly to zero again.
>
> Is this my fault or what is happening?

It's a big in the qemu FIQ bank switching code. Fixed now.

Paul

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [Qemu-devel] Questions on ARM port
@ 2006-03-15  8:55 Schwarz, Konrad
  2006-03-15 14:19 ` Paul Brook
  0 siblings, 1 reply; 4+ messages in thread
From: Schwarz, Konrad @ 2006-03-15  8:55 UTC (permalink / raw)
  To: Paul Brook, qemu-devel

> -----Original Message-----
> From: Paul Brook [mailto:paul@codesourcery.com] 
> Sent: Tuesday, March 14, 2006 3:21 PM
> To: qemu-devel@nongnu.org
> Cc: Schwarz, Konrad
> Subject: Re: [Qemu-devel] Questions on ARM port
> 
> > Basically, r3 is initialized by <start+8> (to 0x80000, in 
> my case).  
> > The next instruction (at <start+12>) switches the mode to 
> FIQ.  After 
> > single steping over this in QEMU (via GDB si), r3 no longer 
> contains 
> > what it had before (0x80000), instead, it is set to 0.  If 
> I manually 
> > fix this (via set $r3=0x80000), then at the next mode switch (at 
> > <start+28>) r3 is changed incorrectly to zero again.
> >
> > Is this my fault or what is happening?
> 
> It's a big in the qemu FIQ bank switching code. Fixed now.
> 
> Paul 

Oh, great!

How do I get the patch?

Konrad 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] Questions on ARM port
  2006-03-15  8:55 Schwarz, Konrad
@ 2006-03-15 14:19 ` Paul Brook
  0 siblings, 0 replies; 4+ messages in thread
From: Paul Brook @ 2006-03-15 14:19 UTC (permalink / raw)
  To: Schwarz, Konrad; +Cc: qemu-devel

> > It's a bug in the qemu FIQ bank switching code. Fixed now.
>
> Oh, great!
>
> How do I get the patch?

http://cvs.savannah.nongnu.org/viewcvs/qemu/target-arm/helper.c?root=qemu&r1=1.4&r2=1.5

Paul

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-03-15 14:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-14 13:28 [Qemu-devel] Questions on ARM port Schwarz, Konrad
2006-03-14 14:21 ` Paul Brook
  -- strict thread matches above, loose matches on Subject: below --
2006-03-15  8:55 Schwarz, Konrad
2006-03-15 14:19 ` Paul Brook

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).