Qemu 5.1 loads Windows XP in TCG mode 5-6 times slower (~2 minutes) than 4.2 (25 seconds), I git bisected it, and it appears that commit b55f54bc causes this issue. Probably similar to an older fixed bug https://bugs.launchpad.net/qemu/+bug/1672383
Command line is trivial: qemu-system-x86_64 -nodefaults -vga std -m 4096M -hda WinXP.qcow2 -monitor stdio -snapshot
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
On my Mac I was able to use the Instruments application to profile what qemu-system-i386 was doing when Windows XP was starting up. Here is a picture of the results. Hope it gives us some idea what is going on.
In the file accel/tcg/translate-all.c, I added code to the tb_flush() function to tell us how many times it is called. It looks like this:
void tb_flush(CPUState *cpu){ // count how many times this function is called static int counter = 0; if (counter % 10 == 0) { printf("tb_flush count: %d\n", counter); } counter++; if (tcg_enabled()) { unsigned tb_flush_count = qatomic_mb_read(&tb_ctx.tb_flush_count); if (cpu_in_exclusive_context(cpu)) { do_tb_flush(cpu, RUN_ON_CPU_HOST_INT(tb_flush_count)); } else { async_safe_run_on_cpu(cpu, do_tb_flush, RUN_ON_CPU_HOST_INT(tb_flush_count)); } }}
After compiling the changes I saw that Windows XP calls this function over 263,830 times!
I tried Windows 7 and it didn't call the function.
Hi Максим, you say debugging is broken. Could you send us a test someone could use to reproduce the problem? I'm thinking some x86 assembly program that test debugging by writing to the debug registers is what we need to see.