I am working on an application which requires me to make some changes with the part of the QEMU source code which deals with RDTSC calls. However, I am not able to locate the same in the huge source code.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Key portion is here:
target-i386/translate.c
6850 case 0x131: /* rdtsc */
6851 if (s->cc_op != CC_OP_DYNAMIC)
6852 gen_op_set_cc_op(s->cc_op);
6853 gen_jmp_im(pc_start - s->cs_base);
6854 if (use_icount)
6855 gen_io_start();
6856 gen_helper_rdtsc();
6857 if (use_icount) {
6858 gen_io_end();
6859 gen_jmp(s, s->pc - s->cs_base);
6860 }
6861 break;
For general understanding of qemu code related to code translation, this answer is good:
Qemu code translation main execution loop