accel/tcg: Use correct test when looking in victim TLB for code
commitb493ccf1fc82674ef73564b3c61e309105c9336b
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 13 Jul 2018 14:16:35 +0000 (13 15:16 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 16 Jul 2018 16:26:01 +0000 (16 17:26 +0100)
tree4d782c803f7aeab41e4e80520f217651dc823b7f
parent65e9f27f22ba273672a1960cabad0e6aae0fbba2
accel/tcg: Use correct test when looking in victim TLB for code

In get_page_addr_code(), we were incorrectly looking in the victim
TLB for an entry which matched the target address for reads, not
for code accesses. This meant that we could hit on a victim TLB
entry that indicated that the address was readable but not
executable, and incorrectly bypass the call to tlb_fill() which
should generate the guest MMU exception. Fix this bug.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20180713141636.18665-2-peter.maydell@linaro.org
accel/tcg/cputlb.c