aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2022-10-04 15:40:22 -0700
committerRichard Henderson <richard.henderson@linaro.org>2022-10-26 11:11:28 +1000
commit8269c01417a3e0bdb444b1bdac1d9b6c8bc9e667 (patch)
tree2b4f78b28762cc3939822cd6c4ac0b3af724b12e /include
parent0fe6108432ebbabbe12e53fba462770acb858a87 (diff)
downloadqemu-8269c01417a3e0bdb444b1bdac1d9b6c8bc9e667.zip
qemu-8269c01417a3e0bdb444b1bdac1d9b6c8bc9e667.tar.gz
qemu-8269c01417a3e0bdb444b1bdac1d9b6c8bc9e667.tar.bz2
accel/tcg: Simplify page_get/alloc_target_data
Since the only user, Arm MTE, always requires allocation, merge the get and alloc functions to always produce a non-null result. Also assume that the user has already checked page validity. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/exec/cpu-all.h21
1 files changed, 6 insertions, 15 deletions
diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h
index 854adc4..2eb1176 100644
--- a/include/exec/cpu-all.h
+++ b/include/exec/cpu-all.h
@@ -281,27 +281,18 @@ void page_reset_target_data(target_ulong start, target_ulong end);
int page_check_range(target_ulong start, target_ulong len, int flags);
/**
- * page_alloc_target_data(address)
+ * page_get_target_data(address)
* @address: guest virtual address
*
- * Allocate TARGET_PAGE_DATA_SIZE bytes of out-of-band data to associate
- * with the guest page at @address. If the page is not mapped, NULL will
- * be returned. If there is existing data associated with @address,
- * no new memory will be allocated.
+ * Return TARGET_PAGE_DATA_SIZE bytes of out-of-band data to associate
+ * with the guest page at @address, allocating it if necessary. The
+ * caller should already have verified that the address is valid.
*
* The memory will be freed when the guest page is deallocated,
* e.g. with the munmap system call.
*/
-void *page_alloc_target_data(target_ulong address);
-
-/**
- * page_get_target_data(address)
- * @address: guest virtual address
- *
- * Return any out-of-bound memory assocated with the guest page
- * at @address, as per page_alloc_target_data.
- */
-void *page_get_target_data(target_ulong address);
+void *page_get_target_data(target_ulong address)
+ __attribute__((returns_nonnull));
#endif
CPUArchState *cpu_copy(CPUArchState *env);