Hi all:
Please correct me if I have any misunderstanding for the following descriptions. Thanks in advance.
I've been trying to dump ARM's execution trace, including guest PC, guest instruction binary, guest virtual/guest physical address for load/store instruction. But I encountered some troubles, and I hope you can help me out.
I used a helper function to dump PC & binary for every instruction while the "disas_arm_insn" generating the TCG IR, and indeed, it can print out the information I want.
And for the guest virtual/physical address for load/store instructions, as far as I've understood, EVERY guest load/store instructions would natively be translated into "qemu_ld/st" IR which would be translated into call function to softmmu's helper function.
So for those address translation information I want to get, in my opinion, I just have to print out the virtual address and corresponding physical address inside the softmmu helper function, that's say like in the end of "get_phys_addr_v6()" function in target-arm/helper.c.
And those information should consequently follow the PC & binary I printed out previously.
BUT, things didn't work out as I expected. I couldn't get the address information for guest ld/st indtruction.
I used "-qemu -d in_asm, op, out_asm" command line options to watch the translation procedure, and found that there are "qemu_ld/st" IRs being translated for every guest ld/st instruction, also in host(x86) binary, I saw "callq" that should be jump into softmmu helper function.
But there are no address translation information being printed out. Then I was wondering if it really went inside the softmmu, I tried to move to upper level.
I added 'printf("Hello World")' in the beginning of "glue(glue(__ld, SUFFIX), MMUSUFFIX)(target_ulong addr, int mmu_idx)" function, while it still didn't print it out when encountered qemu_ld/st IR, and I really don't know why.
Shouldn't every guest ld/st step into that function?
Please tell me where did I go wrong. Thanks again.
Hao-Lun Wei