Skip to contentSkip to conversation

tcg: add extended MMU helpers to targets

RFC PATCH Superseded YeongKyoon Lee 1 participant 1 message Jul 4, 2012

v1 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

RFC PATCH 2/4 tcg: add extended MMU helpers to targets

Add extended MMU helpers to softmmu targets, where the targets are alpha, arm, cris, i386, lm32, m68k, microblaze, mips, ppc, s390x, sh4, sparc and xtensa.

Signed-off-by Yeongkyoon Lee

---

target-alpha/mem_helper.c     |   22 ++++++++++++++++++++++
target-arm/op_helper.c        |   23 +++++++++++++++++++++++
target-cris/op_helper.c       |   22 ++++++++++++++++++++++
target-i386/mem_helper.c      |   22 ++++++++++++++++++++++
target-lm32/op_helper.c       |   23 ++++++++++++++++++++++-
target-m68k/op_helper.c       |   22 ++++++++++++++++++++++
target-microblaze/op_helper.c |   22 ++++++++++++++++++++++
target-mips/op_helper.c       |   22 ++++++++++++++++++++++
target-ppc/mem_helper.c       |   22 ++++++++++++++++++++++
target-s390x/op_helper.c      |   22 ++++++++++++++++++++++
target-sh4/op_helper.c        |   22 ++++++++++++++++++++++
target-sparc/ldst_helper.c    |   23 +++++++++++++++++++++++
target-xtensa/op_helper.c     |   22 ++++++++++++++++++++++
13 files changed, 288 insertions(+), 1 deletions(-)
target-alpha/mem_helper.c +0 -0
index 87cada4..ef880a7 100644
@@ -132,6 +132,28 @@ void cpu_unassigned_access(CPUAlphaState *env, target_phys_addr_t addr,

#define SHIFT 3
#include "softmmu_template.h"

+#if defined(CONFIG_QEMU_LDST_OPTIMIZATION)
+/* Exteneded MMU helper funtions for qemu_ld/st optimization
+ Note that normal helper functions should be defined above
+ to avoid duplication of common functions, slow_ld/st and io_read/write.
+ */
+#define USE_EXTENDED_HELPER
+
+#define SHIFT 0
+#include "softmmu_template.h"
+
+#define SHIFT 1
+#include "softmmu_template.h"
+
+#define SHIFT 2
+#include "softmmu_template.h"
+
+#define SHIFT 3
+#include "softmmu_template.h"
+
+#undef USE_EXTENDED_HELPER
+#endif /* CONFIG_QEMU_LDST_OPTIMIZATION */
+
/* try to fill the TLB and return an exception if error. If retaddr is
NULL, it means that the function was called in C code (i.e. not from generated code or from helper.c) */

target-arm/op_helper.c +0 -0
index 490111c..8ff1209 100644
@@ -69,6 +69,29 @@ uint32_t HELPER(neon_tbl)(uint32_t ireg, uint32_t def,

#define SHIFT 3
#include "softmmu_template.h"

+
+#if defined(CONFIG_QEMU_LDST_OPTIMIZATION)
+/* Exteneded MMU helper funtions for qemu_ld/st optimization
+ Note that normal helper functions should be defined above
+ to avoid duplication of common functions, slow_ld/st and io_read/write.
+ */
+#define USE_EXTENDED_HELPER
+
+#define SHIFT 0
+#include "softmmu_template.h"
+
+#define SHIFT 1
+#include "softmmu_template.h"
+
+#define SHIFT 2
+#include "softmmu_template.h"
+
+#define SHIFT 3
+#include "softmmu_template.h"
+
+#undef USE_EXTENDED_HELPER
+#endif /* CONFIG_QEMU_LDST_OPTIMIZATION */
+
/* try to fill the TLB and return an exception if error. If retaddr is
NULL, it means that the function was called in C code (i.e. not from generated code or from helper.c) */

target-cris/op_helper.c +0 -0
index ac7c98c..c40cf1d 100644
@@ -52,6 +52,28 @@

#define SHIFT 3
#include "softmmu_template.h"

+#if defined(CONFIG_QEMU_LDST_OPTIMIZATION)
+/* Exteneded MMU helper funtions for qemu_ld/st optimization
+ Note that normal helper functions should be defined above
+ to avoid duplication of common functions, slow_ld/st and io_read/write.
+ */
+#define USE_EXTENDED_HELPER
+
+#define SHIFT 0
+#include "softmmu_template.h"
+
+#define SHIFT 1
+#include "softmmu_template.h"
+
+#define SHIFT 2
+#include "softmmu_template.h"
+
+#define SHIFT 3
+#include "softmmu_template.h"
+
+#undef USE_EXTENDED_HELPER
+#endif /* CONFIG_QEMU_LDST_OPTIMIZATION */
+
/* Try to fill the TLB and return an exception if error. If retaddr is
NULL, it means that the function was called in C code (i.e. not from generated code or from helper.c) */

target-i386/mem_helper.c +0 -0
index 91353c0..59fb03c 100644
@@ -126,6 +126,28 @@ void helper_boundl(target_ulong a0, int v)

#define SHIFT 3
#include "softmmu_template.h"

+#if defined(CONFIG_QEMU_LDST_OPTIMIZATION)
+/* Exteneded MMU helper funtions for qemu_ld/st optimization
+ Note that normal helper functions should be defined above
+ to avoid duplication of common functions, slow_ld/st and io_read/write.
+ */
+#define USE_EXTENDED_HELPER
+
+#define SHIFT 0
+#include "softmmu_template.h"
+
+#define SHIFT 1
+#include "softmmu_template.h"
+
+#define SHIFT 2
+#include "softmmu_template.h"
+
+#define SHIFT 3
+#include "softmmu_template.h"
+
+#undef USE_EXTENDED_HELPER
+#endif /* CONFIG_QEMU_LDST_OPTIMIZATION */
+
#endif

#if !defined(CONFIG_USER_ONLY)

target-lm32/op_helper.c +0 -0
index 51edc1a..bcdddf7 100644
@@ -18,6 +18,28 @@

#define SHIFT 3
#include "softmmu_template.h"

+#if defined(CONFIG_QEMU_LDST_OPTIMIZATION)
+/* Exteneded MMU helper funtions for qemu_ld/st optimization
+ Note that normal helper functions should be defined above
+ to avoid duplication of common functions, slow_ld/st and io_read/write.
+ */
+#define USE_EXTENDED_HELPER
+
+#define SHIFT 0
+#include "softmmu_template.h"
+
+#define SHIFT 1
+#include "softmmu_template.h"
+
+#define SHIFT 2
+#include "softmmu_template.h"
+
+#define SHIFT 3
+#include "softmmu_template.h"
+
+#undef USE_EXTENDED_HELPER
+#endif /* CONFIG_QEMU_LDST_OPTIMIZATION */
+
void helper_raise_exception(uint32_t index)

{
     env->exception_index = index;
@@ -101,4 +123,3 @@ void tlb_fill(CPULM32State *env1, target_ulong addr, int is_write, int mmu_idx,
     env = saved_env;
}

#endif
-

target-m68k/op_helper.c +0 -0
index 1971a57..454fd71 100644
@@ -51,6 +51,28 @@ extern int semihosting_enabled;

#define SHIFT 3
#include "softmmu_template.h"

+#if defined(CONFIG_QEMU_LDST_OPTIMIZATION)
+/* Exteneded MMU helper funtions for qemu_ld/st optimization
+ Note that normal helper functions should be defined above
+ to avoid duplication of common functions, slow_ld/st and io_read/write.
+ */
+#define USE_EXTENDED_HELPER
+
+#define SHIFT 0
+#include "softmmu_template.h"
+
+#define SHIFT 1
+#include "softmmu_template.h"
+
+#define SHIFT 2
+#include "softmmu_template.h"
+
+#define SHIFT 3
+#include "softmmu_template.h"
+
+#undef USE_EXTENDED_HELPER
+#endif /* CONFIG_QEMU_LDST_OPTIMIZATION */
+
/* Try to fill the TLB and return an exception if error. If retaddr is
NULL, it means that the function was called in C code (i.e. not from generated code or from helper.c) */

target-microblaze/op_helper.c +0 -0
index 3b1f072..12be3bd 100644
@@ -39,6 +39,28 @@

#define SHIFT 3
#include "softmmu_template.h"

+#if defined(CONFIG_QEMU_LDST_OPTIMIZATION)
+/* Exteneded MMU helper funtions for qemu_ld/st optimization
+ Note that normal helper functions should be defined above
+ to avoid duplication of common functions, slow_ld/st and io_read/write.
+ */
+#define USE_EXTENDED_HELPER
+
+#define SHIFT 0
+#include "softmmu_template.h"
+
+#define SHIFT 1
+#include "softmmu_template.h"
+
+#define SHIFT 2
+#include "softmmu_template.h"
+
+#define SHIFT 3
+#include "softmmu_template.h"
+
+#undef USE_EXTENDED_HELPER
+#endif /* CONFIG_QEMU_LDST_OPTIMIZATION */
+
/* Try to fill the TLB and return an exception if error. If retaddr is
NULL, it means that the function was called in C code (i.e. not from generated code or from helper.c) */

target-mips/op_helper.c +0 -0
index 66037ac..c2fd2db 100644
@@ -2303,6 +2303,28 @@ static void QEMU_NORETURN do_unaligned_access(target_ulong addr, int is_write,

#define SHIFT 3
#include "softmmu_template.h"

+#if defined(CONFIG_QEMU_LDST_OPTIMIZATION)
+/* Exteneded MMU helper funtions for qemu_ld/st optimization
+ Note that normal helper functions should be defined above
+ to avoid duplication of common functions, slow_ld/st and io_read/write.
+ */
+#define USE_EXTENDED_HELPER
+
+#define SHIFT 0
+#include "softmmu_template.h"
+
+#define SHIFT 1
+#include "softmmu_template.h"
+
+#define SHIFT 2
+#include "softmmu_template.h"
+
+#define SHIFT 3
+#include "softmmu_template.h"
+
+#undef USE_EXTENDED_HELPER
+#endif /* CONFIG_QEMU_LDST_OPTIMIZATION */
+
static void do_unaligned_access(target_ulong addr, int is_write,
int is_user, uintptr_t retaddr)
{

target-ppc/mem_helper.c +0 -0
index 5b5f1bd..01a9ac6 100644
@@ -268,6 +268,28 @@ STVE(stvewx, cpu_stl_data, bswap32, u32)

#define SHIFT 3
#include "softmmu_template.h"

+#if defined(CONFIG_QEMU_LDST_OPTIMIZATION)
+/* Exteneded MMU helper funtions for qemu_ld/st optimization
+ Note that normal helper functions should be defined above
+ to avoid duplication of common functions, slow_ld/st and io_read/write.
+ */
+#define USE_EXTENDED_HELPER
+
+#define SHIFT 0
+#include "softmmu_template.h"
+
+#define SHIFT 1
+#include "softmmu_template.h"
+
+#define SHIFT 2
+#include "softmmu_template.h"
+
+#define SHIFT 3
+#include "softmmu_template.h"
+
+#undef USE_EXTENDED_HELPER
+#endif /* CONFIG_QEMU_LDST_OPTIMIZATION */
+
/* try to fill the TLB and return an exception if error. If retaddr is
NULL, it means that the function was called in C code (i.e. not from generated code or from helper.c) */

target-s390x/op_helper.c +0 -0
index 7b72473..05109c5 100644
@@ -52,6 +52,28 @@

#define SHIFT 3
#include "softmmu_template.h"

+#if defined(CONFIG_QEMU_LDST_OPTIMIZATION)
+/* Exteneded MMU helper funtions for qemu_ld/st optimization
+ Note that normal helper functions should be defined above
+ to avoid duplication of common functions, slow_ld/st and io_read/write.
+ */
+#define USE_EXTENDED_HELPER
+
+#define SHIFT 0
+#include "softmmu_template.h"
+
+#define SHIFT 1
+#include "softmmu_template.h"
+
+#define SHIFT 2
+#include "softmmu_template.h"
+
+#define SHIFT 3
+#include "softmmu_template.h"
+
+#undef USE_EXTENDED_HELPER
+#endif /* CONFIG_QEMU_LDST_OPTIMIZATION */
+
/* try to fill the TLB and return an exception if error. If retaddr is
NULL, it means that the function was called in C code (i.e. not from generated code or from helper.c) */

target-sh4/op_helper.c +0 -0
index 4054791..6309817 100644
@@ -53,6 +53,28 @@ static void cpu_restore_state_from_retaddr(uintptr_t retaddr)

#define SHIFT 3
#include "softmmu_template.h"

+#if defined(CONFIG_QEMU_LDST_OPTIMIZATION)
+/* Exteneded MMU helper funtions for qemu_ld/st optimization
+ Note that normal helper functions should be defined above
+ to avoid duplication of common functions, slow_ld/st and io_read/write.
+ */
+#define USE_EXTENDED_HELPER
+
+#define SHIFT 0
+#include "softmmu_template.h"
+
+#define SHIFT 1
+#include "softmmu_template.h"
+
+#define SHIFT 2
+#include "softmmu_template.h"
+
+#define SHIFT 3
+#include "softmmu_template.h"
+
+#undef USE_EXTENDED_HELPER
+#endif /* CONFIG_QEMU_LDST_OPTIMIZATION */
+
void tlb_fill(CPUSH4State *env1, target_ulong addr, int is_write, int mmu_idx,
uintptr_t retaddr)
{

target-sparc/ldst_helper.c +0 -0
index 9bec7a9..1ceb588 100644
@@ -80,6 +80,29 @@
 

#define SHIFT 3
#include "softmmu_template.h"
+
+#if defined(CONFIG_QEMU_LDST_OPTIMIZATION)
+/* Exteneded MMU helper funtions for qemu_ld/st optimization
+ Note that normal helper functions should be defined above
+ to avoid duplication of common functions, slow_ld/st and io_read/write.
+ */
+#define USE_EXTENDED_HELPER
+
+#define SHIFT 0
+#include "softmmu_template.h"
+
+#define SHIFT 1
+#include "softmmu_template.h"
+
+#define SHIFT 2
+#include "softmmu_template.h"
+
+#define SHIFT 3
+#include "softmmu_template.h"
+
+#undef USE_EXTENDED_HELPER
+#endif /* CONFIG_QEMU_LDST_OPTIMIZATION */
+
#endif

#if defined(TARGET_SPARC64) && !defined(CONFIG_USER_ONLY)

target-xtensa/op_helper.c +0 -0
index 2659c0e..536e1fb 100644
@@ -47,6 +47,28 @@ static void do_unaligned_access(CPUXtensaState *env,

#define SHIFT 3
#include "softmmu_template.h"

+#if defined(CONFIG_QEMU_LDST_OPTIMIZATION)
+/* Exteneded MMU helper funtions for qemu_ld/st optimization
+ Note that normal helper functions should be defined above
+ to avoid duplication of common functions, slow_ld/st and io_read/write.
+ */
+#define USE_EXTENDED_HELPER
+
+#define SHIFT 0
+#include "softmmu_template.h"
+
+#define SHIFT 1
+#include "softmmu_template.h"
+
+#define SHIFT 2
+#include "softmmu_template.h"
+
+#define SHIFT 3
+#include "softmmu_template.h"
+
+#undef USE_EXTENDED_HELPER
+#endif /* CONFIG_QEMU_LDST_OPTIMIZATION */
+
static void do_restore_state(CPUXtensaState *env, uintptr_t pc)

{
     TranslationBlock *tb;

__________________________________
Principal Engineer
VM Team
Yeongkyoon Lee

S-Core Co., Ltd.
D.L.: +82-31-696-7249
M.P.: +82-10-9965-1265
__________________________________