On 3/5/24 17:52, lixianglai wrote:
The LDDIR_PS variable is not described in detail in the manual, but is only an
intermediate variable to assist in page size calculation during tcg simulation.
This is exactly why I believe adding this intermediate variable is wrong.
What happens if LDPTE is *not* preceded by LDDIR? It's not the usual way a tlb fill
routine works, but *something* should happen if you construct a valid huge page tlb entry
by hand and pass it directly to LDPTE.
With your implementation, this will not work because lddir_ps will not be initialized.
But I expect that on real hardware it would work.
If this does not work on real hardware, then there *is* some heretofore undocumented
hardware state. If so, then we need a description of this state from the hardware
engineers -- the documentation of LDDIR and LDPTE need updating. Finally, this new
hardware state needs to be added to the migration state.
r~