On 25 April 2014 09:13, Dmitry Poletaev <poletaev-q...@yandex.ru> wrote: > There is a set of test, that checks QEMU CPU for similar behavior with real > hardware (http://roberto.greyhats.it/projects/pills.html). Test > reg/pill2579.c can detect, that program is execute in emulated environment. > It is related with behavior of rcl instruction. If the number of shifted bits > more than 1, OF of eflags become undefined. Real CPUs does not change OF, if > it is undefined. QEMU do it anyway.
It would be helpful if you could be more precise with your subject lines. "improve emulation correctness" is so vague it could apply to almost any part of QEMU. We usually have a format of "area or file: change", so in this case perhaps "target-i386: fix handling of OF in rcl instruction". That said, > Emulated program can execute that test and after that > can understand environment not real. It is always going to be possible to determine that you're running on an emulator rather than real hardware, so changing QEMU behaviour just for this is uninteresting. If QEMU behaves differently from the specification (in this case the x86 hardware and architecture manuals) that's an interesting bug. If we just happen to choose a different undefined behaviour from that which hardware does, that is not in my opinion a problem. thanks -- PMM