Running FreeBSD X86(_64) under gem5 we have seen
"vm_fault: fault on nofault entry, addr: ..."
panics regularly (and over time in different places).
Analysing what happened we found that with the out-of-order CPU
model we would kick off the page table walker and cache a zero pte
entry in the walker cache.
The page table walker had no insight into the updated pte value in
the register file of the CPU at that time and this would happen
before the store from pmap_qenter changing the pte was committed
and hence visible on the memory side of the CPU.
The reason we do not seem to see this problem on (most) hardware
is that according to [1] mos CPUs seem to implement a stronger
coherence guarantees than the specifications demand.
Intel's SDM [2] states (the end of 4.10.3.1 Caches for Paging Structures):
"The processor may create entries in paging-structure caches for
translations required for prefetches and for accesses that are a
result of speculative execution that would never actually occur
in the executed code path.
..
Because the processor may create the cache entries at the time of
translation and not update them following subsequent modifications
to the paging structures in memory, software should take care to
invalidate the cache entries appropriately when causing such modifications."
AMD's ArchPM Vol 2: System Programming [3] describes this case in:
7.3.1 Special Coherency Considerations.
In order to not rely on non-guaranteed behaviour, remove the
optimization to only invalidate the range if any of the previous
pte-s was a valid mapping. With this FreeBSD runs properly on
gem5 and likely also better on certain (AMD) CPUs.
[1] http://blog.stuffedcow.net/2015/08/pagewalk-coherence/#coherence
[2] https://software.intel.com/sites/default/files/managed/a4/60/325384-sdm-vol-3abcd.pdf
[3] http://support.amd.com/TechDocs/24593.pdf