target/ppc: Integrate icount to purr, vtb, and tbu40
commita72c71b77d73f9888cbe8da8be09d7097ebca64f
authorGustavo Romero <gromero@linux.ibm.com>
Tue, 11 Aug 2020 15:32:35 +0000 (11 12:32 -0300)
committerDavid Gibson <david@gibson.dropbear.id.au>
Thu, 13 Aug 2020 00:03:01 +0000 (13 10:03 +1000)
tree25cff686d63488db3bef684f89a8bc24be5dd95a
parente781139539f3d73ac00f2aea17f5a154b10e4302
target/ppc: Integrate icount to purr, vtb, and tbu40

Currently if option '-icount auto' is passed to the QEMU TCG to enable
counting instructions the VM crashes with the following error report when
Linux runs on it:

qemu-system-ppc64: Bad icount read

This happens because read/write access to the SPRs PURR, VTB, and TBU40
is not integrated to the icount framework.

This commit fixes that issue by making the read/write access of these
SPRs aware of icount framework, adding the proper gen_io_start() calls
before calling the helpers to load/store these SPRs in TCG and ensuring
that the associated TBs end immediately after, accordingly to what's in
docs/devel/tcg-icount.rst.

Signed-off-by: Gustavo Romero <gromero@linux.ibm.com>
Message-Id: <20200811153235.4527-1-gromero@linux.ibm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
target/ppc/translate_init.inc.c