arch-x86: Don't free PTW state with inflight requests
authorMatthew Poremba <matthew.poremba@amd.com>
Fri, 12 Jul 2019 17:29:12 +0000 (10:29 -0700)
committerMatthew Poremba <matthew.poremba@amd.com>
Mon, 22 Jul 2019 14:33:01 +0000 (14:33 +0000)
commit2757368c842e445b7dad79941172e396a14d58d5
treec5ea1d8ac9739668b05bad74d6b5afa0397bfe63
parent16eeee5356585441a49d05c78abc328ef09f7ace
arch-x86: Don't free PTW state with inflight requests

If a page table walk is squashed, the walker state is being deleted
in the squash code. If there are in flight requests, the deleted
walker state values may be clobbered, leading to undefined behavior.
This adds a squashed boolean to the walker state which is set if a
walk is squashed while requests are still in flight. When packets
for the in flight request return, we check if the walk was squashed
and return that the walk is complete once the number of in flight
requests reaches zero. The walker state is then freed by the PTW.

Change-Id: I57a64b1548b83a8a9e8441fc9d6f33e9842df2b3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/19568
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/arch/x86/pagetable_walker.cc
src/arch/x86/pagetable_walker.hh