Re: qemu aarch64 info registers PC register not changing

2023-07-10 Thread Peter Maydell
On Mon, 10 Jul 2023 at 09:12, Jiatong Shen  wrote:
>
> Hello community experts,
>
> I am trying to learn some arm64 basics using qemu. I would like to 
> retrieve a register value
> through hmp command info register. The output is
>
> virsh # qemu-monitor-command --hmp eefcdf53-2fd5-40ee-91a8-858b3e621fc5 info 
> registers -a

> every time I issue the command, PC register is always the value. My question 
> is should PC value be changed every time an instruction completes? Thank you 
> very much.
>
> The qemu version is 4.2.1. And the virtual machine is accelerated by KVM.

It's worth looking at what that PC is in the guest,
and what the guest is doing. If the guest is not particularly
doing much, then it's very likely that almost all of the time
when you look at it you'll find that the guest PC is pointing
to the WFI in the guest kernel's idle loop.

Other than that, QEMU 4.2.1 is pretty old, especially in
Arm terms (where KVM support has not been so mature for
as long as x86); so you could check whether a newer QEMU
also behaves the same way.

thanks
-- PMM



qemu aarch64 info registers PC register not changing

2023-07-10 Thread Jiatong Shen
Hello community experts,

I am trying to learn some arm64 basics using qemu. I would like to
retrieve a register value
through hmp command info register. The output is

virsh # qemu-monitor-command --hmp eefcdf53-2fd5-40ee-91a8-858b3e621fc5
info registers -a

CPU#0
 PC=48a3f2aa2a30 X00=48a3f4203ed0 X01=48a3f3d30018
X02= X03=a8c1ce2ef988 X04=601e0c1d
X05=001e458eb800 X06=a8c1fff07c00 X07=
X08=48a3f422de10 X09=48a3f4203e70 X10=0970
X11=0001 X12= X13=0298
X14=0400 X15=0400 X16=
X17= X18= X19=48a3f3d30018
X20=0001 X21=48a3f4224200 X22=48a3f3d4ac70
X23=48a3f4224224 X24= X25=48a3f422d440
X26= X27=000138315520 X28=dce8f330
X29=48a3f4203ed0 X30=48a3f2a87288  SP=48a3f4203ed0
PSTATE=60c00085 -ZC- EL1h FPCR= FPSR=
Q00=2525252525252525:2525252525252525 Q01=6568632068746170:0a68
Q02=000a707520747261:7473207372656b63 Q03=:
Q04=ff00: Q05=:401004014010
Q06=4000: Q07=4010040140100401:4010040140100401
Q08=:aaac80fcc388 Q09=:aaac85269150
Q10=: Q11=:
Q12=: Q13=:
Q14=: Q15=:
Q16=40005550:40005550 Q17=0008:00088000
Q18=0800: Q19=:
Q20=: Q21=:
Q22=: Q23=:
Q24=: Q25=:
Q26=: Q27=:
Q28=: Q29=:
Q30=: Q31=:

CPU#1
 PC=48a3f2aa2a30 X00=a8c1c496bf10 X01=48a3f3d30018
X02= X03=199a X04=601e0c20
X05=00ff X06=0002f6633c0c X07=601e0c20
X08=a8c1c48ea8d0 X09=a8c1c496beb0 X10=0970
X11=0001 X12= X13=0381
X14=0400 X15=0400 X16=
X17= X18= X19=48a3f3d30018
X20=0002 X21=48a3f4224200 X22=48a3f3d4ac70
X23=48a3f4224224 X24= X25=a8c1c48e9f00
X26= X27= X28=
X29=a8c1c496bf10 X30=48a3f2a87288  SP=a8c1c496bf10
PSTATE=60c00085 -ZC- EL1h FPCR= FPSR=0010
Q00=: Q01=:aaab83310a33
Q02=3020302032203020:3639332032333531 Q03=:0400
Q04=: Q05=4010040140100401:4010040140100401
Q06=0004:0004 Q07=4010040140100401:4010040140100401
Q08=:0002 Q09=:
Q10=: Q11=:
Q12=: Q13=:
Q14=: Q15=:
Q16=55540010:55540010 Q17=a00aa00aa00aa00a:
Q18=8020080280200802:8020080280200802 Q19=:
Q20=: Q21=:
Q22=: Q23=:
Q24=: Q25=:
Q26=: Q27=:
Q28=: Q29=:
Q30=: Q31=:

every time I issue the command, PC register is always the value. My
question is should PC value be changed every time an instruction completes?
Thank you very much.

The qemu version is 4.2.1. And the virtual machine is accelerated by KVM.
-- 

Best Regards,

Jiatong Shen