[PATCH v2 4/6] target/loongarch: Add stub function loongarch_get_addr_from_tlb

Bibo Mao posted 6 patches 7 months ago
There is a newer version of this series
[PATCH v2 4/6] target/loongarch: Add stub function loongarch_get_addr_from_tlb
Posted by Bibo Mao 7 months ago
Stub function loongarch_get_addr_from_tlb() is added if option
CONFIG_TCG is not enabled, so this function can be called in KVM
only mode.

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

diff --git a/target/loongarch/cpu_helper.c b/target/loongarch/cpu_helper.c
index 8e0c1b3764..111a57314f 100644
--- a/target/loongarch/cpu_helper.c
+++ b/target/loongarch/cpu_helper.c
@@ -156,7 +156,16 @@ static int loongarch_get_addr_from_tlb(CPULoongArchState *env, hwaddr *physical,
 
     return TLBRET_NOMATCH;
 }
+#else
+static int loongarch_get_addr_from_tlb(CPULoongArchState *env, hwaddr *physical,
+                                       int *prot, target_ulong address,
+                                       MMUAccessType access_type, int mmu_idx)
+{
+    return TLBRET_NOMATCH;
+}
+#endif
 
+#ifdef CONFIG_TCG
 void get_dir_base_width(CPULoongArchState *env, uint64_t *dir_base,
                         uint64_t *dir_width, target_ulong level)
 {
-- 
2.39.3
Re: [PATCH v2 4/6] target/loongarch: Add stub function loongarch_get_addr_from_tlb
Posted by Philippe Mathieu-Daudé 7 months ago
On 17/4/25 05:51, Bibo Mao wrote:
> Stub function loongarch_get_addr_from_tlb() is added if option
> CONFIG_TCG is not enabled, so this function can be called in KVM
> only mode.
> 
> Signed-off-by: Bibo Mao <maobibo@loongson.cn>
> ---
>   target/loongarch/cpu_helper.c | 9 +++++++++
>   1 file changed, 9 insertions(+)

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