summaryrefslogtreecommitdiffstats
path: root/tcg
diff options
context:
space:
mode:
authorRichard Henderson2018-01-10 08:47:25 +0100
committerRichard Henderson2018-01-16 17:21:56 +0100
commit4a64e0fd6876e45b34cd87b700ee30ef5c10c87a (patch)
treeec8fe6fdef314d7567e5d7d285250fb707dacd14 /tcg
parenttcg/arm: Support tlb offsets larger than 64k (diff)
downloadqemu-4a64e0fd6876e45b34cd87b700ee30ef5c10c87a.tar.gz
qemu-4a64e0fd6876e45b34cd87b700ee30ef5c10c87a.tar.xz
qemu-4a64e0fd6876e45b34cd87b700ee30ef5c10c87a.zip
tcg/ppc: Support tlb offsets larger than 64k
AArch64 with SVE has an offset of 80k to the 8th TLB. Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tcg')
-rw-r--r--tcg/ppc/tcg-target.inc.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/tcg/ppc/tcg-target.inc.c b/tcg/ppc/tcg-target.inc.c
index 879885b68b..74f9b4aa34 100644
--- a/tcg/ppc/tcg-target.inc.c
+++ b/tcg/ppc/tcg-target.inc.c
@@ -1524,16 +1524,15 @@ static TCGReg tcg_out_tlb_read(TCGContext *s, TCGMemOp opc,
/* Compensate for very large offsets. */
if (add_off >= 0x8000) {
- /* Most target env are smaller than 32k; none are larger than 64k.
- Simplify the logic here merely to offset by 0x7ff0, giving us a
- range just shy of 64k. Check this assumption. */
- QEMU_BUILD_BUG_ON(offsetof(CPUArchState,
- tlb_table[NB_MMU_MODES - 1][1])
- > 0x7ff0 + 0x7fff);
- tcg_out32(s, ADDI | TAI(TCG_REG_TMP1, base, 0x7ff0));
+ int low = (int16_t)cmp_off;
+ int high = cmp_off - low;
+ assert((high & 0xffff) == 0);
+ assert(cmp_off - high == (int16_t)(cmp_off - high));
+ assert(add_off - high == (int16_t)(add_off - high));
+ tcg_out32(s, ADDIS | TAI(TCG_REG_TMP1, base, high >> 16));
base = TCG_REG_TMP1;
- cmp_off -= 0x7ff0;
- add_off -= 0x7ff0;
+ cmp_off -= high;
+ add_off -= high;
}
/* Extraction and shifting, part 2. */