]> git.proxmox.com Git - mirror_qemu.git/commit
target-mips: fix corner case in TLBWR causing QEMU to hang
authorLeon Alrae <leon.alrae@imgtec.com>
Thu, 10 Sep 2015 09:15:28 +0000 (10:15 +0100)
committerLeon Alrae <leon.alrae@imgtec.com>
Fri, 18 Sep 2015 08:20:48 +0000 (09:20 +0100)
commit3adafef2f35d9061b56a09071b2589b9e0b36f76
tree8e60b28acd33c2ac4ae59c6dab962bcfcdaa187b
parentceb0ee147df35adc7b705da1c84a4624c9cabb21
target-mips: fix corner case in TLBWR causing QEMU to hang

cpu_mips_get_random() function is used to generate a random index from
CP0.Wired to TLBSize-1 range. Current implementation avoids generating
the same as before value, hence the while loop. If the guest sets
CP0.Wired to TLBSize-1 (which actually does not sound to be very
practical) QEMU will get stuck in the loop infinitely as we always
generate the same index.

Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
hw/mips/cputimer.c