title: MFENCE/LFENCE/SFENCE Behaviour Inside Function
body: <p>What is the difference in behaviour between the MFENCE/LFENCE/SFENCE instruction as an intrinsic put right before the instruction it's meant to serialize (A) and the instruction inside a function that must be called before the instruction that needs to be serialized (B)?</p>
  <p>So basically the difference between</p>
  <p>(A):</p>
  <pre><code>LFENCE
  RDTSC
  </code></pre>
  <p>(B):</p>
  <pre><code>Fence PROC
  LFENCE
  RET
  Fence ENDP
  
  ...
  
  CALL Fence
  RDTSC
  </code></pre>