[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 08/36] target/arm: Disable clean_data_tbi for system mode
From: |
Peter Maydell |
Subject: |
[PULL 08/36] target/arm: Disable clean_data_tbi for system mode |
Date: |
Thu, 12 Mar 2020 16:44:31 +0000 |
From: Richard Henderson <address@hidden>
We must include the tag in the FAR_ELx register when raising
an addressing exception. Which means that we should not clear
out the tag during translation.
We cannot at present comply with this for user mode, so we
retain the clean_data_tbi function for the moment, though it
no longer does what it says on the tin for system mode. This
function is to be replaced with MTE, so don't worry about the
slight misnaming.
Buglink: https://bugs.launchpad.net/qemu/+bug/1867072
Signed-off-by: Richard Henderson <address@hidden>
Message-id: address@hidden
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
---
target/arm/translate-a64.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index fefe8af7f52..8fffb52203d 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -228,7 +228,18 @@ static void gen_a64_set_pc(DisasContext *s, TCGv_i64 src)
static TCGv_i64 clean_data_tbi(DisasContext *s, TCGv_i64 addr)
{
TCGv_i64 clean = new_tmp_a64(s);
+ /*
+ * In order to get the correct value in the FAR_ELx register,
+ * we must present the memory subsystem with the "dirty" address
+ * including the TBI. In system mode we can make this work via
+ * the TLB, dropping the TBI during translation. But for user-only
+ * mode we don't have that option, and must remove the top byte now.
+ */
+#ifdef CONFIG_USER_ONLY
gen_top_byte_ignore(s, clean, addr, s->tbid);
+#else
+ tcg_gen_mov_i64(clean, addr);
+#endif
return clean;
}
--
2.20.1
- [PULL 00/36] target-arm queue, Peter Maydell, 2020/03/12
- [PULL 01/36] hw/intc/armv7m_nvic: Rebuild hflags on reset, Peter Maydell, 2020/03/12
- [PULL 02/36] target/arm: Update hflags in trans_CPS_v7m(), Peter Maydell, 2020/03/12
- [PULL 03/36] target/arm: Recalculate hflags correctly after writes to CONTROL, Peter Maydell, 2020/03/12
- [PULL 04/36] target/arm: Fix some comment typos, Peter Maydell, 2020/03/12
- [PULL 05/36] aspeed/smc: Add some tracing, Peter Maydell, 2020/03/12
- [PULL 06/36] aspeed/smc: Fix User mode select/unselect scheme, Peter Maydell, 2020/03/12
- [PULL 07/36] target/arm: Check addresses for disabled regimes, Peter Maydell, 2020/03/12
- [PULL 08/36] target/arm: Disable clean_data_tbi for system mode,
Peter Maydell <=
- [PULL 09/36] hw/arm/cubieboard: make sure SOC object isn't leaked, Peter Maydell, 2020/03/12
- [PULL 11/36] hw/arm/fsl-imx25: Wire up USB controllers, Peter Maydell, 2020/03/12
- [PULL 10/36] hw/arm/fsl-imx25: Wire up eSDHC controllers, Peter Maydell, 2020/03/12
- [PULL 13/36] hw/arm: add Xunlong Orange Pi PC machine, Peter Maydell, 2020/03/12
- [PULL 12/36] hw/arm: add Allwinner H3 System-on-Chip, Peter Maydell, 2020/03/12
- [PULL 15/36] hw/arm/allwinner-h3: add USB host controller, Peter Maydell, 2020/03/12
- [PULL 16/36] hw/arm/allwinner-h3: add System Control module, Peter Maydell, 2020/03/12
- [PULL 14/36] hw/arm/allwinner-h3: add Clock Control Unit, Peter Maydell, 2020/03/12
- [PULL 17/36] hw/arm/allwinner: add CPU Configuration module, Peter Maydell, 2020/03/12
- [PULL 18/36] hw/arm/allwinner: add Security Identifier device, Peter Maydell, 2020/03/12