On 20 February 2014 13:40, Claudio Fontana <hw.clau...@gmail.com> wrote: > Hello, > > I am running kvm controlled qemu using mach virt, > > and I have this glitch where the SP value in "info registers" always > appears as zero to me: > > (qemu) info registers > PC=00000000400b0044 SP=0000000000000000 > X00=0000000040324000 X01=0000000040331000 X02=00000000400b0000 > X03=0000000000000000 > X04=0000000040080000 X05=0000000000000000 X06=0000000000000000 > X07=0000000000000000 > X08=0000000000000000 X09=0000000000000000 X10=0000000000000000 > X11=0000000000000000 > X12=0000000000000000 X13=0000000000000000 X14=0000000000000000 > X15=0000000000000000 > X16=0000000000000000 X17=0000000000000000 X18=0000000000000000 > X19=0000000000000000 > X20=0000000000000000 X21=0000000000000000 X22=0000000000000000 > X23=0000000000000000 > X24=0000000000000000 X25=0000000000000000 X26=0000000000000000 > X27=0000000000000000 > X28=0000000000000000 X29=0000000040324000 X30=00000000400b0014 > PSTATE=600003c5 (flags -ZC-) > > In the guest I am doing > > adrp x0, something > mov sp, x0 > mov x29, sp > > and while I can see the x29 value (seen above), my SP still appears as zero.. > > I am at commit 91abb80b5f66e8387ae1a5ba85083e49b877938c (7th February) > > Any idea about what could be wrong?
The code doesn't look obviously wrong; I suggest you stick some debug printfs/breakpoints/etc in: target-arm/kvm64.c:kvm_arch_get_registers() where we ask the kernel for the value of SP and put it in xregs[31] target-arm/gdbstub64.c:aarch64_cpu_gdb_read_register() where we return xregs[31] when gdb asks for it also enabling gdb's "debug all protocol packets" feature may help. thanks -- PMM