aboutsummaryrefslogtreecommitdiff
path: root/target/arm
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2022-09-17 14:25:12 +0200
committerRichard Henderson <richard.henderson@linaro.org>2022-10-26 11:11:28 +1000
commit50d4c8c1d433ae843a6b86a65467c507095f65f1 (patch)
tree6c5fe4a6b10dc82d545a62523d5620c4b72b7adc /target/arm
parent7ed9e721cce2ccf6a1da22cd0e713c2a0d187457 (diff)
downloadqemu-50d4c8c1d433ae843a6b86a65467c507095f65f1.zip
qemu-50d4c8c1d433ae843a6b86a65467c507095f65f1.tar.gz
qemu-50d4c8c1d433ae843a6b86a65467c507095f65f1.tar.bz2
accel/tcg: Make page_alloc_target_data allocation constant
Use a constant target data allocation size for all pages. This will be necessary to reduce overhead of page tracking. Since TARGET_PAGE_DATA_SIZE is now required, we can use this to omit data tracking for targets that don't require it. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/arm')
-rw-r--r--target/arm/cpu.h8
-rw-r--r--target/arm/internals.h4
-rw-r--r--target/arm/mte_helper.c3
3 files changed, 9 insertions, 6 deletions
diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index 64fc032..db9ec6a 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -3410,6 +3410,14 @@ extern const uint64_t pred_esz_masks[5];
#define PAGE_MTE PAGE_TARGET_2
#define PAGE_TARGET_STICKY PAGE_MTE
+/* We associate one allocation tag per 16 bytes, the minimum. */
+#define LOG2_TAG_GRANULE 4
+#define TAG_GRANULE (1 << LOG2_TAG_GRANULE)
+
+#ifdef CONFIG_USER_ONLY
+#define TARGET_PAGE_DATA_SIZE (TARGET_PAGE_SIZE >> (LOG2_TAG_GRANULE + 1))
+#endif
+
#ifdef TARGET_TAGGED_ADDRESSES
/**
* cpu_untagged_addr:
diff --git a/target/arm/internals.h b/target/arm/internals.h
index c3c3920..b26c9ca 100644
--- a/target/arm/internals.h
+++ b/target/arm/internals.h
@@ -1164,10 +1164,6 @@ void arm_log_exception(CPUState *cs);
*/
#define GMID_EL1_BS 6
-/* We associate one allocation tag per 16 bytes, the minimum. */
-#define LOG2_TAG_GRANULE 4
-#define TAG_GRANULE (1 << LOG2_TAG_GRANULE)
-
/*
* SVE predicates are 1/8 the size of SVE vectors, and cannot use
* the same simd_desc() encoding due to restrictions on size.
diff --git a/target/arm/mte_helper.c b/target/arm/mte_helper.c
index e852083..a9c5fc2 100644
--- a/target/arm/mte_helper.c
+++ b/target/arm/mte_helper.c
@@ -96,8 +96,7 @@ static uint8_t *allocation_tag_mem(CPUARMState *env, int ptr_mmu_idx,
tags = page_get_target_data(clean_ptr);
if (tags == NULL) {
- size_t alloc_size = TARGET_PAGE_SIZE >> (LOG2_TAG_GRANULE + 1);
- tags = page_alloc_target_data(clean_ptr, alloc_size);
+ tags = page_alloc_target_data(clean_ptr);
assert(tags != NULL);
}