From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45050) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5W44-0004ho-JP for qemu-devel@nongnu.org; Thu, 18 Jun 2015 05:24:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5W41-0000ND-DH for qemu-devel@nongnu.org; Thu, 18 Jun 2015 05:24:52 -0400 Received: from mail.ispras.ru ([83.149.199.45]:60436) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5W41-0000Mw-5L for qemu-devel@nongnu.org; Thu, 18 Jun 2015 05:24:49 -0400 From: "Pavel Dovgaluk" References: <20150617124158.3316.54954.stgit@PASHA-ISP> <20150617124205.3316.81361.stgit@PASHA-ISP> <55816DAE.8090701@redhat.com> In-Reply-To: <55816DAE.8090701@redhat.com> Date: Thu, 18 Jun 2015 12:24:51 +0300 Message-ID: <001401d0a9a8$a0ff9a50$e2fecef0$@Dovgaluk@ispras.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Language: ru Subject: Re: [Qemu-devel] [PATCH v2 1/3] softmmu: add helper function to pass through retaddr List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: 'Paolo Bonzini' , qemu-devel@nongnu.org Cc: rth7680@gmail.com, leon.alrae@imgtec.com, aurelien@aurel32.net > From: Paolo Bonzini [mailto:pbonzini@redhat.com] > On 17/06/2015 14:42, Pavel Dovgalyuk wrote: > > This patch introduces several helpers to pass return address > > which points to the TB. Correct return address allows correct > > restoring of the guest PC and icount. These functions should be used when > > helpers embedded into TB invoke memory operations. > > > > Signed-off-by: Pavel Dovgalyuk > > --- > > include/exec/cpu_ldst_template.h | 42 +++++++++++++++++++++++++++++++------- > > include/exec/exec-all.h | 27 ++++++++++++++++++++++++ > > softmmu_template.h | 18 ++++++++++++++++ > > 3 files changed, 79 insertions(+), 8 deletions(-) > > > > diff --git a/include/exec/cpu_ldst_template.h b/include/exec/cpu_ldst_template.h > > index 95ab750..1847816 100644 > > --- a/include/exec/cpu_ldst_template.h > > +++ b/include/exec/cpu_ldst_template.h > > @@ -62,7 +62,9 @@ > > /* generic load/store macros */ > > > > static inline RES_TYPE > > -glue(glue(cpu_ld, USUFFIX), MEMSUFFIX)(CPUArchState *env, target_ulong ptr) > > +glue(glue(glue(cpu_ld, USUFFIX), MEMSUFFIX), _ra)(CPUArchState *env, > > + target_ulong ptr, > > + uintptr_t retaddr) > > Would it make sense to call these helper_cpu_ld##USUFFIX##MEMSUFFIX? > > > diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h > > index 856e698..b3aefde 100644 > > --- a/include/exec/exec-all.h > > +++ b/include/exec/exec-all.h > > @@ -350,6 +350,33 @@ struct MemoryRegion *iotlb_to_region(CPUState *cpu, > > void tlb_fill(CPUState *cpu, target_ulong addr, int is_write, int mmu_idx, > > uintptr_t retaddr); > > > > +uint8_t helper_call_ldb_cmmu(CPUArchState *env, target_ulong addr, > > + int mmu_idx, uintptr_t retaddr); > > Here we already have helper_ret_ldb_cmmu, so the new function is only > needed if DATA_SIZE != 1. > > > +uint16_t helper_call_ldw_cmmu(CPUArchState *env, target_ulong addr, > > + int mmu_idx, uintptr_t retaddr); > > What about helper_ret_ldw_cmmu for consistency with the DATA_SIZE == 1 case? tcg.h breaks these definitions: /* Temporary aliases until backends are converted. */ #ifdef TARGET_WORDS_BIGENDIAN # define helper_ret_ldsw_mmu helper_be_ldsw_mmu # define helper_ret_lduw_mmu helper_be_lduw_mmu # define helper_ret_ldsl_mmu helper_be_ldsl_mmu # define helper_ret_ldul_mmu helper_be_ldul_mmu # define helper_ret_ldq_mmu helper_be_ldq_mmu # define helper_ret_stw_mmu helper_be_stw_mmu # define helper_ret_stl_mmu helper_be_stl_mmu # define helper_ret_stq_mmu helper_be_stq_mmu #else Pavel Dovgalyuk