diff mbox series

[v2,5/6] target/loongarch: Set function loongarch_map_address() with common code

Message ID 20250417035143.268248-6-maobibo@loongson.cn (mailing list archive)
State New
Headers show
Series target/loongarch: Code cleanup with function loongarch_map_address | expand

Commit Message

bibo mao April 17, 2025, 3:51 a.m. UTC
Function loongarch_map_address is to get physical address from virtual
address, it is used by qmp commands to dump memory from virtual
address.

It is used by kvm mode also, here move function loongarch_map_address()
out of macro CONFIG_TCG. And it is common code, the similar with
function loongarch_page_table_walker().

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
---
 target/loongarch/cpu_helper.c | 10 ----------
 1 file changed, 10 deletions(-)

Comments

Philippe Mathieu-Daudé April 17, 2025, 9:59 a.m. UTC | #1
On 17/4/25 05:51, Bibo Mao wrote:
> Function loongarch_map_address is to get physical address from virtual
> address, it is used by qmp commands to dump memory from virtual
> address.
> 
> It is used by kvm mode also, here move function loongarch_map_address()
> out of macro CONFIG_TCG. And it is common code, the similar with
> function loongarch_page_table_walker().
> 
> Signed-off-by: Bibo Mao <maobibo@loongson.cn>
> ---
>   target/loongarch/cpu_helper.c | 10 ----------
>   1 file changed, 10 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
diff mbox series

Patch

diff --git a/target/loongarch/cpu_helper.c b/target/loongarch/cpu_helper.c
index 111a57314f..5db64a45cc 100644
--- a/target/loongarch/cpu_helper.c
+++ b/target/loongarch/cpu_helper.c
@@ -165,7 +165,6 @@  static int loongarch_get_addr_from_tlb(CPULoongArchState *env, hwaddr *physical,
 }
 #endif
 
-#ifdef CONFIG_TCG
 void get_dir_base_width(CPULoongArchState *env, uint64_t *dir_base,
                         uint64_t *dir_width, target_ulong level)
 {
@@ -295,15 +294,6 @@  static int loongarch_map_address(CPULoongArchState *env, hwaddr *physical,
 
     return TLBRET_NOMATCH;
 }
-#else
-static int loongarch_map_address(CPULoongArchState *env, hwaddr *physical,
-                                 int *prot, target_ulong address,
-                                 MMUAccessType access_type, int mmu_idx,
-                                 int is_debug)
-{
-    return TLBRET_NOMATCH;
-}
-#endif
 
 static hwaddr dmw_va2pa(CPULoongArchState *env, target_ulong va,
                         target_ulong dmw)