Search code examples
x86qemuself-modifying

What TARGET_HAS_PRECISE_SMC means?


I see only x86 define TARGET_HAS_PRECISE_SMC (target-i386/cpu.h), and the comment says,

/* support for self modifying code even if the modified instruction is
   close to the modifying instruction */
#define TARGET_HAS_PRECISE_SMC

I would like to know what it means and want to know more about it, but googling doesn't help. Would you mind to shed some light on that? Thanks.


Solution

  • IIRC, there is some processors that don't maintain cache coherency if the code modified is in the same page or cache block, and would make the processor execute the original instruction instead of the new instruction.

    Processors with this behaviour would have this undefined.