[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 01/15] softmmu: provide tlb_vaddr_to_host function f
From: |
Aurelien Jarno |
Subject: |
[Qemu-devel] [PATCH 01/15] softmmu: provide tlb_vaddr_to_host function for user mode |
Date: |
Sat, 13 Jun 2015 00:45:49 +0200 |
To avoid to many #ifdef in target code, provide a tlb_vaddr_to_host for
both user and softmmu modes. In the first case the function always
succeed and just call the g2h function.
Signed-off-by: Aurelien Jarno <address@hidden>
---
include/exec/cpu_ldst.h | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h
index 0ec398c..1239c60 100644
--- a/include/exec/cpu_ldst.h
+++ b/include/exec/cpu_ldst.h
@@ -399,6 +399,8 @@ uint64_t helper_ldq_cmmu(CPUArchState *env, target_ulong
addr, int mmu_idx);
#undef MEMSUFFIX
#undef SOFTMMU_CODE_ACCESS
+#endif /* defined(CONFIG_USER_ONLY) */
+
/**
* tlb_vaddr_to_host:
* @env: CPUArchState
@@ -417,6 +419,9 @@ uint64_t helper_ldq_cmmu(CPUArchState *env, target_ulong
addr, int mmu_idx);
static inline void *tlb_vaddr_to_host(CPUArchState *env, target_ulong addr,
int access_type, int mmu_idx)
{
+#if defined(CONFIG_USER_ONLY)
+ return g2h(vaddr);
+#else
int index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);
CPUTLBEntry *tlbentry = &env->tlb_table[mmu_idx][index];
target_ulong tlb_addr;
@@ -449,8 +454,7 @@ static inline void *tlb_vaddr_to_host(CPUArchState *env,
target_ulong addr,
haddr = addr + env->tlb_table[mmu_idx][index].addend;
return (void *)haddr;
-}
-
#endif /* defined(CONFIG_USER_ONLY) */
+}
#endif /* CPU_LDST_H */
--
2.1.4
- [Qemu-devel] [PATCH 00/15] target-s390x: add Program-Event Recording feature, Aurelien Jarno, 2015/06/12
- [Qemu-devel] [PATCH 05/15] target-s390x: add PER related constants, Aurelien Jarno, 2015/06/12
- [Qemu-devel] [PATCH 02/15] target-s390x: function to adjust the length wrt page boundary, Aurelien Jarno, 2015/06/12
- [Qemu-devel] [PATCH 01/15] softmmu: provide tlb_vaddr_to_host function for user mode,
Aurelien Jarno <=
- [Qemu-devel] [PATCH 06/15] target-s390x: add get_per_atmid function, Aurelien Jarno, 2015/06/12
- [Qemu-devel] [PATCH 07/15] target-s390x: add get_per_in_range function, Aurelien Jarno, 2015/06/12
- [Qemu-devel] [PATCH 11/15] translate-all: fix watchpoints if retranslation not possible, Aurelien Jarno, 2015/06/12
- [Qemu-devel] [PATCH 04/15] target-s390x: mvc_fast_memmove: access memory through softmmu, Aurelien Jarno, 2015/06/12
- [Qemu-devel] [PATCH 03/15] target-s390x: mvc_fast_memset: access memory through softmmu, Aurelien Jarno, 2015/06/12
- [Qemu-devel] [PATCH 09/15] target-s390x: PER successful-branching event support, Aurelien Jarno, 2015/06/12
- [Qemu-devel] [PATCH 10/15] target-s390x: PER instruction-fetch event support, Aurelien Jarno, 2015/06/12
- [Qemu-devel] [PATCH 08/15] target-s390x: basic PER event handling, Aurelien Jarno, 2015/06/12
- [Qemu-devel] [PATCH 14/15] target-s390x: PER instruction-fetch nullification event support, Aurelien Jarno, 2015/06/12
- [Qemu-devel] [PATCH 13/15] target-s390x: PER store-using-real-address event support, Aurelien Jarno, 2015/06/12