From ceae547201171e1bf658cb42a1a4696d8b94d10d Mon Sep 17 00:00:00 2001 From: mio Date: Sun, 13 Apr 2025 23:48:42 +0800 Subject: [PATCH] avoid inlining memory read/write on s390x --- qemu/tcg/s390/tcg-target.inc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/qemu/tcg/s390/tcg-target.inc.c b/qemu/tcg/s390/tcg-target.inc.c index c8fa2004..b82e5e84 100644 --- a/qemu/tcg/s390/tcg-target.inc.c +++ b/qemu/tcg/s390/tcg-target.inc.c @@ -1705,7 +1705,10 @@ static void tcg_out_qemu_ld(TCGContext* s, TCGReg data_reg, TCGReg addr_reg, base_reg = tcg_out_tlb_read(s, addr_reg, opc, mem_index, 1); - tcg_out16(s, RI_BRC | (S390_CC_NE << 4)); + if (!tcg_uc_has_hookmem(s)) + tcg_out16(s, RI_BRC | (S390_CC_NE << 4)); + else + tcg_out16(s, RI_BRC | (S390_CC_ALWAYS << 4)); label_ptr = s->code_ptr; s->code_ptr += 1; @@ -1732,7 +1735,10 @@ static void tcg_out_qemu_st(TCGContext* s, TCGReg data_reg, TCGReg addr_reg, base_reg = tcg_out_tlb_read(s, addr_reg, opc, mem_index, 0); - tcg_out16(s, RI_BRC | (S390_CC_NE << 4)); + if (!tcg_uc_has_hookmem(s)) + tcg_out16(s, RI_BRC | (S390_CC_NE << 4)); + else + tcg_out16(s, RI_BRC | (S390_CC_ALWAYS << 4)); label_ptr = s->code_ptr; s->code_ptr += 1;