[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: high cpu usage in idle state
From: |
Peter Maydell |
Subject: |
Re: high cpu usage in idle state |
Date: |
Sun, 19 Sep 2021 19:06:35 +0100 |
On Sat, 18 Sept 2021 at 09:12, Ali Vatankhah <alivatankhah72@gmail.com> wrote:
> then to check what instructions are executing I run this command:
>
> qemu-system-ppc64 -nographic -M ppce500 -cpu e5500 -kernel uImage -singlestep
> -d in_asm -D target_asm.log
>
> Obviously this results in a Kernel panic, but the point is that after panic
> there is no guest
> instruction running as there is no more log in the file but still CPU usage
> is 100.
The lack of further in_asm logging does not mean that guest instructions
are not running. in_asm logging happens at *translate* time,
which is to say the first time QEMU encounters any particular instruction.
After translation, QEMU can re-execute the translated code for that
instruction many times, and it will not show up in in_asm logs again.
In particular, if the guest CPU is doing either of:
* a tight loop
* an infinite loop of taking exceptions
it will just be re-running code that has been seen before.
Probably the code the kernel runs after it panic()s is just a loop.
If you want to log execution, you need to add 'exec' and/or 'cpu' to
your -d logging. (Warning: this can generate a lot of logging output
and massively slow down execution as a result.)
> also run this command to check generated host assembly code:
>
> qemu-system-ppc64 -nographic -M ppce500 -cpu e5500 -kernel uImage -singlestep
> -d out_asm -D host_asm.log
out_asm also is logged only at translate time, not at execution time.
-- PMM