[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 17/54] cputlb: document get_page_addr_code
From: |
Alex Bennée |
Subject: |
[Qemu-devel] [PATCH v4 17/54] cputlb: document get_page_addr_code |
Date: |
Wed, 31 Jul 2019 17:06:42 +0100 |
From: "Emilio G. Cota" <address@hidden>
Suggested-by: Alex Bennée <address@hidden>
Signed-off-by: Emilio G. Cota <address@hidden>
Signed-off-by: Alex Bennée <address@hidden>
---
accel/tcg/cputlb.c | 5 -----
include/exec/exec-all.h | 24 +++++++++++++++++++++---
2 files changed, 21 insertions(+), 8 deletions(-)
diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index bffdb251580..a01e04c5416 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -1015,11 +1015,6 @@ static bool victim_tlb_hit(CPUArchState *env, size_t
mmu_idx, size_t index,
victim_tlb_hit(env, mmu_idx, index, offsetof(CPUTLBEntry, TY), \
(ADDR) & TARGET_PAGE_MASK)
-/* NOTE: this function can trigger an exception */
-/* NOTE2: the returned address is not exactly the physical address: it
- * is actually a ram_addr_t (in system mode; the user mode emulation
- * version of this function returns a guest virtual address).
- */
tb_page_addr_t get_page_addr_code(CPUArchState *env, target_ulong addr)
{
uintptr_t mmu_idx = cpu_mmu_index(env, true);
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index 16034ee651e..8b1c3d5b9db 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -480,7 +480,15 @@ void mmap_lock(void);
void mmap_unlock(void);
bool have_mmap_lock(void);
-static inline tb_page_addr_t get_page_addr_code(CPUArchState *env1,
target_ulong addr)
+/**
+ * get_page_addr_code() - user-mode version
+ * @env: CPUArchState
+ * @addr: guest virtual address of guest code
+ *
+ * Returns @addr.
+ */
+static inline tb_page_addr_t get_page_addr_code(CPUArchState *env,
+ target_ulong addr)
{
return addr;
}
@@ -488,8 +496,18 @@ static inline tb_page_addr_t
get_page_addr_code(CPUArchState *env1, target_ulong
static inline void mmap_lock(void) {}
static inline void mmap_unlock(void) {}
-/* cputlb.c */
-tb_page_addr_t get_page_addr_code(CPUArchState *env1, target_ulong addr);
+/**
+ * get_page_addr_code() - full-system version
+ * @env: CPUArchState
+ * @addr: guest virtual address of guest code
+ *
+ * If we cannot translate and execute from the entire RAM page, or if
+ * the region is not backed by RAM, returns -1. Otherwise, returns the
+ * ram_addr_t corresponding to the guest code at @addr.
+ *
+ * Note: this function can trigger an exception.
+ */
+tb_page_addr_t get_page_addr_code(CPUArchState *env, target_ulong addr);
void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t length);
void tlb_set_dirty(CPUState *cpu, target_ulong vaddr);
--
2.20.1
- [Qemu-devel] [PATCH v4 30/54] translator: add translator_ld{ub, sw, uw, l, q}, (continued)
- [Qemu-devel] [PATCH v4 30/54] translator: add translator_ld{ub, sw, uw, l, q}, Alex Bennée, 2019/07/31
- [Qemu-devel] [PATCH v4 39/54] target/sparc: fetch code with translator_ld, Alex Bennée, 2019/07/31
- [Qemu-devel] [PATCH v4 18/54] cputlb: introduce get_page_addr_code_hostp, Alex Bennée, 2019/07/31
- [Qemu-devel] [PATCH v4 41/54] target/openrisc: fetch code with translator_ld, Alex Bennée, 2019/07/31
- [Qemu-devel] [PATCH v4 27/54] *-user: plugin syscalls, Alex Bennée, 2019/07/31
- [Qemu-devel] [PATCH v4 51/54] tests/plugin: add hotpages plugin to breakdown memory access patterns, Alex Bennée, 2019/07/31
- [Qemu-devel] [PATCH v4 25/54] translate-all: notify plugin code of tb_flush, Alex Bennée, 2019/07/31
- [Qemu-devel] [PATCH v4 50/54] tests/plugin: add instruction execution breakdown, Alex Bennée, 2019/07/31
- [Qemu-devel] [PATCH v4 23/54] tcg: let plugins instrument virtual memory accesses, Alex Bennée, 2019/07/31
- [Qemu-devel] [PATCH v4 20/54] plugin-gen: add module for TCG-related code, Alex Bennée, 2019/07/31
- [Qemu-devel] [PATCH v4 17/54] cputlb: document get_page_addr_code,
Alex Bennée <=
- [Qemu-devel] [PATCH v4 38/54] target/riscv: fetch code with translator_ld, Alex Bennée, 2019/07/31
- [Qemu-devel] [PATCH v4 36/54] target/m68k: fetch code with translator_ld, Alex Bennée, 2019/07/31
- [Qemu-devel] [PATCH v4 49/54] plugin: add qemu_plugin_insn_disas helper, Alex Bennée, 2019/07/31
- [Qemu-devel] [PATCH v4 52/54] accel/stubs: reduce headers from tcg-stub, Alex Bennée, 2019/07/31
- [Qemu-devel] [PATCH v4 47/54] tests/tcg: enable plugin testing, Alex Bennée, 2019/07/31
- [Qemu-devel] [PATCH v4 34/54] target/i386: fetch code with translator_ld, Alex Bennée, 2019/07/31
- [Qemu-devel] [PATCH v4 24/54] plugins: implement helpers for resolving hwaddr, Alex Bennée, 2019/07/31
- [Qemu-devel] [PATCH v4 48/54] tests/plugin: add a hotblocks plugin, Alex Bennée, 2019/07/31
- [Qemu-devel] [PATCH v4 35/54] target/hppa: fetch code with translator_ld, Alex Bennée, 2019/07/31
- [Qemu-devel] [PATCH v4 46/54] tests/plugin: add sample plugins, Alex Bennée, 2019/07/31