[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 03/12] target/arm: Fix aa64 ldp register writeback
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 03/12] target/arm: Fix aa64 ldp register writeback |
Date: |
Tue, 19 Sep 2017 19:45:12 -0500 |
From: Richard Henderson <address@hidden>
For "ldp x0, x1, [x0]", if the second load is on a second page and
the second page is unmapped, the exception would be raised with x0
already modified. This means the instruction couldn't be restarted.
Cc: address@hidden
Cc: address@hidden
Reported-by: Andrew <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
Message-id: address@hidden
Fixes: https://bugs.launchpad.net/qemu/+bug/1713066
Signed-off-by: Richard Henderson <address@hidden>
[PMM: tweaked comment format]
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
(cherry picked from commit 3e4d91b94ce400326fae0850578d9e9f30a71adb)
Signed-off-by: Michael Roth <address@hidden>
---
target/arm/translate-a64.c | 29 +++++++++++++++++------------
1 file changed, 17 insertions(+), 12 deletions(-)
diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index 2200e25be0..cb44632d16 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -2217,29 +2217,34 @@ static void disas_ldst_pair(DisasContext *s, uint32_t
insn)
} else {
do_fp_st(s, rt, tcg_addr, size);
}
- } else {
- TCGv_i64 tcg_rt = cpu_reg(s, rt);
- if (is_load) {
- do_gpr_ld(s, tcg_rt, tcg_addr, size, is_signed, false,
- false, 0, false, false);
- } else {
- do_gpr_st(s, tcg_rt, tcg_addr, size,
- false, 0, false, false);
- }
- }
- tcg_gen_addi_i64(tcg_addr, tcg_addr, 1 << size);
- if (is_vector) {
+ tcg_gen_addi_i64(tcg_addr, tcg_addr, 1 << size);
if (is_load) {
do_fp_ld(s, rt2, tcg_addr, size);
} else {
do_fp_st(s, rt2, tcg_addr, size);
}
} else {
+ TCGv_i64 tcg_rt = cpu_reg(s, rt);
TCGv_i64 tcg_rt2 = cpu_reg(s, rt2);
+
if (is_load) {
+ TCGv_i64 tmp = tcg_temp_new_i64();
+
+ /* Do not modify tcg_rt before recognizing any exception
+ * from the second load.
+ */
+ do_gpr_ld(s, tmp, tcg_addr, size, is_signed, false,
+ false, 0, false, false);
+ tcg_gen_addi_i64(tcg_addr, tcg_addr, 1 << size);
do_gpr_ld(s, tcg_rt2, tcg_addr, size, is_signed, false,
false, 0, false, false);
+
+ tcg_gen_mov_i64(tcg_rt, tmp);
+ tcg_temp_free_i64(tmp);
} else {
+ do_gpr_st(s, tcg_rt, tcg_addr, size,
+ false, 0, false, false);
+ tcg_gen_addi_i64(tcg_addr, tcg_addr, 1 << size);
do_gpr_st(s, tcg_rt2, tcg_addr, size,
false, 0, false, false);
}
--
2.11.0
- [Qemu-stable] [PATCH 00/12] Patch Round-up for stable 2.10.1, freeze on 2017-09-27, Michael Roth, 2017/09/19
- [Qemu-stable] [PATCH 09/12] mps2-an511: Fix wiring of UART overflow interrupt lines, Michael Roth, 2017/09/19
- [Qemu-stable] [PATCH 10/12] scsi-bus: correct responses for INQUIRY and REQUEST SENSE, Michael Roth, 2017/09/19
- [Qemu-stable] [PATCH 03/12] target/arm: Fix aa64 ldp register writeback,
Michael Roth <=
- [Qemu-stable] [PATCH 11/12] libvhost-user: support resuming vq->last_avail_idx based on used_idx, Michael Roth, 2017/09/19
- [Qemu-stable] [PATCH 02/12] s390-ccw: Fix alignment for CCW1, Michael Roth, 2017/09/19
- [Qemu-stable] [PATCH 12/12] vhost-user-bridge: fix resume regression (since 2.9), Michael Roth, 2017/09/19
- [Qemu-stable] [PATCH 07/12] qcow2: move qcow2_store_persistent_dirty_bitmaps() before cache flushing, Michael Roth, 2017/09/19
- [Qemu-stable] [PATCH 06/12] hw/arm/allwinner-a10: Mark the allwinner-a10 device with user_creatable = false, Michael Roth, 2017/09/19
- [Qemu-stable] [PATCH 05/12] arm_gicv3_kvm: Fix compile warning, Michael Roth, 2017/09/19
- [Qemu-stable] [PATCH 01/12] slirp: fix clearing ifq_so from pending packets, Michael Roth, 2017/09/19
- [Qemu-stable] [PATCH 04/12] virtfs: error out gracefully when mandatory suboptions are missing, Michael Roth, 2017/09/19
- [Qemu-stable] [PATCH 08/12] vhost: Release memory references on cleanup, Michael Roth, 2017/09/19
- Re: [Qemu-stable] [Qemu-devel] [PATCH 00/12] Patch Round-up for stable 2.10.1, freeze on 2017-09-27, Thomas Huth, 2017/09/20