From patchwork Wed Jul 4 06:00:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: YeongKyoon Lee X-Patchwork-Id: 168903 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8A06C2C01F1 for ; Wed, 4 Jul 2012 16:01:12 +1000 (EST) Received: from localhost ([::1]:48245 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmIeE-0007pA-GA for incoming@patchwork.ozlabs.org; Wed, 04 Jul 2012 02:01:10 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58117) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmIdz-0007p1-G7 for qemu-devel@nongnu.org; Wed, 04 Jul 2012 02:01:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SmIds-0003lW-68 for qemu-devel@nongnu.org; Wed, 04 Jul 2012 02:00:55 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:48824) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmIdr-0003jY-BT for qemu-devel@nongnu.org; Wed, 04 Jul 2012 02:00:48 -0400 Received: from epcpsbge1.samsung.com (mailout3.samsung.com [203.254.224.33]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M6M00506GOUJP40@mailout3.samsung.com> for qemu-devel@nongnu.org; Wed, 04 Jul 2012 15:00:37 +0900 (KST) X-AuditID: cbfee60b-b7f866d00000631c-b4-4ff3dc05eba6 Received: from epextmailer02 ( [203.254.219.152]) by epcpsbge1.samsung.com (EPCPMTA) with SMTP id 89.F1.25372.50CD3FF4; Wed, 04 Jul 2012 15:00:37 +0900 (KST) Date: Wed, 04 Jul 2012 06:00:37 +0000 (GMT) From: YeongKyoon Lee To: qemu-devel MIME-version: 1.0 X-MTR: 20120704060003710@yeongkyoon.lee Msgkey: 20120704060003710@yeongkyoon.lee X-EPLocale: en_US.euc-kr X-Priority: 3 X-EPWebmail-Msg-Type: personal X-EPWebmail-Reply-Demand: 0 X-EPApproval-Locale: X-EPHeader: ML X-EPTrCode: X-EPTrName: X-MLAttribute: X-RootMTR: 20120704060003710@yeongkyoon.lee X-ParentMTR: X-ArchiveUser: X-CPGSPASS: N Content-transfer-encoding: base64 Content-type: text/plain; charset=euc-kr MIME-version: 1.0 Message-id: <30097839.11141341381637705.JavaMail.weblogic@epml28> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrAIsWRmVeSWpSXmKPExsVy+t/tGbqsdz77G5z8ZmBxvHcHiwOjx5Nr m5kCGKO4bFJSczLLUov07RK4Mnb9uc9YcGk6Y8XCLQvYGxjvTGbsYuTkEBLQlHi0pYcdxJYQ MJG4veAolC0mceHeerYuRi6gmvmMEk/nnWYBSbAIqEgs3vcQrIhNwEhi3oUusEHCAv4Sxx9t BrNFBDQkdu5/wwLSzCzQxChxouUaK8Q2FYkv846CFfEKCEqcnPmEBWKbusSFo/eZIeIaElN6 PkHFJSTu3N/PCmHzSsxofwoVl5OY9nUNM4QtLXF+1gZGmKsXf38MFeeXOHZ7B1MXIwdY75P7 wTBjdm/+wgZhC0hMPXMQqlVH4vK3B0wQNp/EmoVvWWDG7Dq1nBmm9/6WuWA1zAKKElO6IeHA LKAl8eXHPjZ0b/EKOEpsvjmTZQKj3CwkqVlI2mchaUdWs4CRZRWjaGpBckFxUnqqoV5xYm5x aV66XnJ+7iZGcLw/497BOKvB4hCjAAejEg/viWOf/YVYE8uKK3MPMUpwMCuJ8N7cDRTiTUms rEotyo8vKs1JLT7EKM3BoiTOO8n6gr+QQHpiSWp2ampBahFMlomDU6qBMfnp1F9sVxg/fmA+ 1JzlouVulRku0Dspe2PyzAibm7Gfv184F/rw4BUnaelO8xeKKdeSNtzLO7RqomITb1XNntTb ij9uV/W0Xy/rmRtoahZ8cK2JwzG9ty2xkemie12n6Eq0yG1RzStj2SmkfyP2f+m3A7vj/ooJ 8ys0/H1VoGj6/Hji/j8BSizFGYmGWsxFxYkAIUoTWvMCAAA= X-TM-AS-MML: No X-detected-operating-system: by eggs.gnu.org: Solaris 10 (1203?) X-Received-From: 203.254.224.33 Cc: Blue Swirl , Evgeny Voevodin , Wei-Ren Chen Subject: [Qemu-devel] [RFC][PATCH 2/4] tcg: add extended MMU helpers to targets X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: yeongkyoon.lee@samsung.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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(-) __________________________________ Principal Engineer VM Team Yeongkyoon Lee S-Core Co., Ltd. D.L.: +82-31-696-7249 M.P.: +82-10-9965-1265 diff --git a/target-alpha/mem_helper.c b/target-alpha/mem_helper.c index 87cada4..ef880a7 100644 --- a/target-alpha/mem_helper.c +++ b/target-alpha/mem_helper.c @@ -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) */ diff --git a/target-arm/op_helper.c b/target-arm/op_helper.c index 490111c..8ff1209 100644 --- a/target-arm/op_helper.c +++ b/target-arm/op_helper.c @@ -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) */ diff --git a/target-cris/op_helper.c b/target-cris/op_helper.c index ac7c98c..c40cf1d 100644 --- a/target-cris/op_helper.c +++ b/target-cris/op_helper.c @@ -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) */ diff --git a/target-i386/mem_helper.c b/target-i386/mem_helper.c index 91353c0..59fb03c 100644 --- a/target-i386/mem_helper.c +++ b/target-i386/mem_helper.c @@ -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) diff --git a/target-lm32/op_helper.c b/target-lm32/op_helper.c index 51edc1a..bcdddf7 100644 --- a/target-lm32/op_helper.c +++ b/target-lm32/op_helper.c @@ -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 - diff --git a/target-m68k/op_helper.c b/target-m68k/op_helper.c index 1971a57..454fd71 100644 --- a/target-m68k/op_helper.c +++ b/target-m68k/op_helper.c @@ -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) */ diff --git a/target-microblaze/op_helper.c b/target-microblaze/op_helper.c index 3b1f072..12be3bd 100644 --- a/target-microblaze/op_helper.c +++ b/target-microblaze/op_helper.c @@ -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) */ diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c index 66037ac..c2fd2db 100644 --- a/target-mips/op_helper.c +++ b/target-mips/op_helper.c @@ -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) { diff --git a/target-ppc/mem_helper.c b/target-ppc/mem_helper.c index 5b5f1bd..01a9ac6 100644 --- a/target-ppc/mem_helper.c +++ b/target-ppc/mem_helper.c @@ -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) */ diff --git a/target-s390x/op_helper.c b/target-s390x/op_helper.c index 7b72473..05109c5 100644 --- a/target-s390x/op_helper.c +++ b/target-s390x/op_helper.c @@ -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) */ diff --git a/target-sh4/op_helper.c b/target-sh4/op_helper.c index 4054791..6309817 100644 --- a/target-sh4/op_helper.c +++ b/target-sh4/op_helper.c @@ -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) { diff --git a/target-sparc/ldst_helper.c b/target-sparc/ldst_helper.c index 9bec7a9..1ceb588 100644 --- a/target-sparc/ldst_helper.c +++ b/target-sparc/ldst_helper.c @@ -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) diff --git a/target-xtensa/op_helper.c b/target-xtensa/op_helper.c index 2659c0e..536e1fb 100644 --- a/target-xtensa/op_helper.c +++ b/target-xtensa/op_helper.c @@ -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;