[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 9/9] target/arm: Disable clean_data_tbi for system mode
From: |
Richard Henderson |
Subject: |
[PATCH v2 9/9] target/arm: Disable clean_data_tbi for system mode |
Date: |
Mon, 2 Mar 2020 09:58:29 -0800 |
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.
Signed-off-by: Richard Henderson <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 fefe8af7f5..8fffb52203 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
- [PATCH v2 4/9] target/arm: Apply TBI to ESR_ELx in helper_exception_return, (continued)
- [PATCH v2 4/9] target/arm: Apply TBI to ESR_ELx in helper_exception_return, Richard Henderson, 2020/03/02
- [PATCH v2 8/9] target/arm: Check addresses for disabled regimes, Richard Henderson, 2020/03/02
- [PATCH v2 6/9] target/arm: Use DEF_HELPER_FLAGS for helper_dc_zva, Richard Henderson, 2020/03/02
- [PATCH v2 5/9] target/arm: Move helper_dc_zva to helper-a64.c, Richard Henderson, 2020/03/02
- [PATCH v2 7/9] target/arm: Clean address for DC ZVA, Richard Henderson, 2020/03/02
- [PATCH v2 9/9] target/arm: Disable clean_data_tbi for system mode,
Richard Henderson <=
- Re: [PATCH v2 0/9] target/arm: Misc cleanups surrounding TBI, Peter Maydell, 2020/03/05