From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:60387) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qb5UG-0003y9-Aq for qemu-devel@nongnu.org; Mon, 27 Jun 2011 02:40:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qb5UE-0002TX-O9 for qemu-devel@nongnu.org; Mon, 27 Jun 2011 02:40:00 -0400 Received: from e23smtp06.au.ibm.com ([202.81.31.148]:55802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qb5UD-0002T7-M9 for qemu-devel@nongnu.org; Mon, 27 Jun 2011 02:39:58 -0400 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [202.81.31.245]) by e23smtp06.au.ibm.com (8.14.4/8.13.1) with ESMTP id p5R6d3YM011728 for ; Mon, 27 Jun 2011 16:39:03 +1000 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p5R6dd6l1056842 for ; Mon, 27 Jun 2011 16:39:41 +1000 Received: from d23av02.au.ibm.com (loopback [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p5R6dbYN006380 for ; Mon, 27 Jun 2011 16:39:38 +1000 Message-ID: <4E0825A7.2040703@linux.vnet.ibm.com> Date: Mon, 27 Jun 2011 14:39:35 +0800 From: Wayne Xia MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 12/12] Remove temp_buf, rename CPU_TEMP_BUF_NLONGS List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel@nongnu.org Hi, it seems the patched TCG have some problem, I got a segment fault. Running condition: qemu-system-x86_64 -L /home/xiawenc/WorkDir/Source/bios/pc-bios/ when I invoke it with --kvm-enabled, no segment fault. qemu version: commit f44c99607a46484c52f03aed373e3a3a194af721 Author: Blue Swirl Date: Sat May 14 17:06:56 2011 +0000 > Remove now unused temp_buf from CPUState. Rename CPU_TEMP_BUF_NLONGS > to TCG_TEMP_BUF_NLONGS. > > Signed-off-by: Blue Swirl > --- > cpu-defs.h | 3 --- > tcg/arm/tcg-target.c | 6 +++--- > tcg/hppa/tcg-target.c | 2 +- > tcg/i386/tcg-target.c | 4 ++-- > tcg/ia64/tcg-target.c | 4 ++-- > tcg/mips/tcg-target.c | 6 +++--- > tcg/ppc/tcg-target.c | 6 +++--- > tcg/ppc64/tcg-target.c | 6 +++--- > tcg/s390/tcg-target.c | 4 ++-- > tcg/sparc/tcg-target.c | 4 ++-- > tcg/tcg.h | 3 +++ > 11 files changed, 24 insertions(+), 24 deletions(-) > > diff --git a/cpu-defs.h b/cpu-defs.h > index db48a7a..a76fc31 100644 > --- a/cpu-defs.h > +++ b/cpu-defs.h > @@ -153,7 +153,6 @@ typedef struct CPUWatchpoint { > QTAILQ_ENTRY(CPUWatchpoint) entry; > } CPUWatchpoint; > > -#define CPU_TEMP_BUF_NLONGS 128 > #define CPU_COMMON \ > struct TranslationBlock *current_tb; /* currently executing TB */ \ > /* soft mmu support */ \ > @@ -169,8 +168,6 @@ typedef struct CPUWatchpoint { > volatile sig_atomic_t exit_request; \ > CPU_COMMON_TLB \ > struct TranslationBlock *tb_jmp_cache[TB_JMP_CACHE_SIZE]; \ > - /* buffer for temporaries in the code generator */ \ > - long temp_buf[CPU_TEMP_BUF_NLONGS]; \ > \ > int64_t icount_extra; /* Instructions until next timer event. */ \ > /* Number of cycles left, with interrupt flag in high bit. \ > diff --git a/tcg/arm/tcg-target.c b/tcg/arm/tcg-target.c > index eacda6b..c142eec 100644 > --- a/tcg/arm/tcg-target.c > +++ b/tcg/arm/tcg-target.c > @@ -1847,7 +1847,7 @@ static inline void tcg_out_movi(TCGContext *s, > TCGType type, > static void tcg_target_qemu_prologue(TCGContext *s) > { > tcg_set_frame(s, TCG_REG_CALL_STACK, TCG_STATIC_CALL_ARGS_SIZE, > - CPU_TEMP_BUF_NLONGS * sizeof(long)); > + TCG_TEMP_BUF_NLONGS * sizeof(long)); > > /* Calling convention requires us to save r4-r11 and lr; > * save also r12 to maintain stack 8-alignment. > @@ -1857,7 +1857,7 @@ static void tcg_target_qemu_prologue(TCGContext *s) > tcg_out32(s, (COND_AL<< 28) | 0x092d5ff0); > > tcg_out_addi(s, TCG_REG_CALL_STACK, -TCG_STATIC_CALL_ARGS_SIZE - > - CPU_TEMP_BUF_NLONGS * sizeof(long))); > + TCG_TEMP_BUF_NLONGS * sizeof(long))); > > tcg_out_mov(s, TCG_TYPE_PTR, TCG_AREG0, tcg_target_call_iarg_regs[0]); > > @@ -1865,7 +1865,7 @@ static void tcg_target_qemu_prologue(TCGContext *s) > tb_ret_addr = s->code_ptr; > > tcg_out_addi(s, TCG_REG_CALL_STACK, TCG_STATIC_CALL_ARGS_SIZE + > - CPU_TEMP_BUF_NLONGS * sizeof(long)); > + TCG_TEMP_BUF_NLONGS * sizeof(long)); > > /* ldmia sp!, { r4 - r12, pc } */ > tcg_out32(s, (COND_AL<< 28) | 0x08bd9ff0); > diff --git a/tcg/hppa/tcg-target.c b/tcg/hppa/tcg-target.c > index db33e79..95f3316 100644 > --- a/tcg/hppa/tcg-target.c > +++ b/tcg/hppa/tcg-target.c > @@ -1613,7 +1613,7 @@ static void tcg_target_qemu_prologue(TCGContext *s) > frame_size += ARRAY_SIZE(tcg_target_callee_save_regs) * 4; > > /* Allocate space for the TCG temps. */ > - frame_size += CPU_TEMP_BUF_NLONGS * sizeof(long); > + frame_size += TCG_TEMP_BUF_NLONGS * sizeof(long); > > /* Align the allocated space. */ > frame_size = ((frame_size + TCG_TARGET_STACK_ALIGN - 1) > diff --git a/tcg/i386/tcg-target.c b/tcg/i386/tcg-target.c > index 7529677..3e723f5 100644 > --- a/tcg/i386/tcg-target.c > +++ b/tcg/i386/tcg-target.c > @@ -1923,12 +1923,12 @@ static void tcg_target_qemu_prologue(TCGContext *s) > push_size *= TCG_TARGET_REG_BITS / 8; > > frame_size = push_size + TCG_STATIC_CALL_ARGS_SIZE + > - CPU_TEMP_BUF_NLONGS * sizeof(long); > + TCG_TEMP_BUF_NLONGS * sizeof(long); > frame_size = (frame_size + TCG_TARGET_STACK_ALIGN - 1)& > ~(TCG_TARGET_STACK_ALIGN - 1); > stack_addend = frame_size - push_size; > tcg_set_frame(s, TCG_REG_CALL_STACK, TCG_STATIC_CALL_ARGS_SIZE, > - CPU_TEMP_BUF_NLONGS * sizeof(long)); > + TCG_TEMP_BUF_NLONGS * sizeof(long)); > > /* Save all callee saved registers. */ > for (i = 0; i< ARRAY_SIZE(tcg_target_callee_save_regs); i++) { > diff --git a/tcg/ia64/tcg-target.c b/tcg/ia64/tcg-target.c > index 528ae64..97aad75 100644 > --- a/tcg/ia64/tcg-target.c > +++ b/tcg/ia64/tcg-target.c > @@ -2280,13 +2280,13 @@ static void tcg_target_qemu_prologue(TCGContext *s) > > /* reserve some stack space */ > frame_size = TCG_STATIC_CALL_ARGS_SIZE + > - CPU_TEMP_BUF_NLONGS * sizeof(long); > + TCG_TEMP_BUF_NLONGS * sizeof(long); > > frame_size = (frame_size + TCG_TARGET_STACK_ALIGN - 1)& > ~(TCG_TARGET_STACK_ALIGN - 1); > > tcg_set_frame(s, TCG_REG_CALL_STACK, TCG_STATIC_CALL_ARGS_SIZE, > - CPU_TEMP_BUF_NLONGS * sizeof(long)); > + TCG_TEMP_BUF_NLONGS * sizeof(long)); > > /* First emit adhoc function descriptor */ > *(uint64_t *)(s->code_ptr) = (uint64_t)s->code_ptr + 16; /* entry point */ > diff --git a/tcg/mips/tcg-target.c b/tcg/mips/tcg-target.c > index d536457..7c8e3c8 100644 > --- a/tcg/mips/tcg-target.c > +++ b/tcg/mips/tcg-target.c > @@ -1472,12 +1472,12 @@ static void tcg_target_qemu_prologue(TCGContext *s) > > /* reserve some stack space */ > frame_size = ARRAY_SIZE(tcg_target_callee_save_regs) * 4 > - + TCG_STATIC_CALL_ARGS_SIZE + CPU_TEMP_BUF_NLONGS * sizeof(long); > + + TCG_STATIC_CALL_ARGS_SIZE + TCG_TEMP_BUF_NLONGS * sizeof(long); > frame_size = (frame_size + TCG_TARGET_STACK_ALIGN - 1)& > ~(TCG_TARGET_STACK_ALIGN - 1); > tcg_set_frame(s, TCG_REG_CALL_STACK, frame_size > - - CPU_TEMP_BUF_NLONGS * sizeof(long), > - CPU_TEMP_BUF_NLONGS * sizeof(long)); > + - TCG_TEMP_BUF_NLONGS * sizeof(long), > + TCG_TEMP_BUF_NLONGS * sizeof(long)); > > /* TB prologue */ > tcg_out_addi(s, TCG_REG_CALL_STACK, -frame_size); > diff --git a/tcg/ppc/tcg-target.c b/tcg/ppc/tcg-target.c > index 100ef12..841bc9d 100644 > --- a/tcg/ppc/tcg-target.c > +++ b/tcg/ppc/tcg-target.c > @@ -907,13 +907,13 @@ static void tcg_target_qemu_prologue (TCGContext *s) > + LINKAGE_AREA_SIZE > + TCG_STATIC_CALL_ARGS_SIZE > + ARRAY_SIZE (tcg_target_callee_save_regs) * 4 > - + CPU_TEMP_BUF_NLONGS * sizeof(long) > + + TCG_TEMP_BUF_NLONGS * sizeof(long) > ; > frame_size = (frame_size + 15)& ~15; > > tcg_set_frame(s, TCG_REG_CALL_STACK, frame_size > - - CPU_TEMP_BUF_NLONGS * sizeof(long), > - CPU_TEMP_BUF_NLONGS * sizeof(long)); > + - TCG_TEMP_BUF_NLONGS * sizeof(long), > + TCG_TEMP_BUF_NLONGS * sizeof(long)); > > #ifdef _CALL_AIX > { > diff --git a/tcg/ppc64/tcg-target.c b/tcg/ppc64/tcg-target.c > index 6c92d84..d7bb35b 100644 > --- a/tcg/ppc64/tcg-target.c > +++ b/tcg/ppc64/tcg-target.c > @@ -875,13 +875,13 @@ static void tcg_target_qemu_prologue (TCGContext *s) > + 8 /* TOC save area */ > + TCG_STATIC_CALL_ARGS_SIZE > + ARRAY_SIZE (tcg_target_callee_save_regs) * 8 > - + CPU_TEMP_BUF_NLONGS * sizeof(long) > + + TCG_TEMP_BUF_NLONGS * sizeof(long) > ; > frame_size = (frame_size + 15)& ~15; > > tcg_set_frame(s, TCG_REG_CALL_STACK, frame_size > - - CPU_TEMP_BUF_NLONGS * sizeof(long), > - CPU_TEMP_BUF_NLONGS * sizeof(long)); > + - TCG_TEMP_BUF_NLONGS * sizeof(long), > + TCG_TEMP_BUF_NLONGS * sizeof(long)); > > #ifndef __APPLE__ > /* First emit adhoc function descriptor */ > diff --git a/tcg/s390/tcg-target.c b/tcg/s390/tcg-target.c > index c063509..9f66cfa 100644 > --- a/tcg/s390/tcg-target.c > +++ b/tcg/s390/tcg-target.c > @@ -2301,10 +2301,10 @@ static void tcg_target_qemu_prologue(TCGContext *s) > > /* aghi %r15,-160 (stack frame) */ > tcg_out_insn(s, RI, AGHI, TCG_REG_CALL_STACK, > - -(160 + CPU_TEMP_BUF_NLONGS * sizeof(long))); > + -(160 + TCG_TEMP_BUF_NLONGS * sizeof(long))); > > tcg_set_frame(s, TCG_REG_CALL_STACK, 160, > - CPU_TEMP_BUF_NLONGS * sizeof(long)); > + TCG_TEMP_BUF_NLONGS * sizeof(long)); > if (GUEST_BASE>= 0x80000) { > tcg_out_movi(s, TCG_TYPE_PTR, TCG_GUEST_BASE_REG, GUEST_BASE); > tcg_regset_set_reg(s->reserved_regs, TCG_GUEST_BASE_REG); > diff --git a/tcg/sparc/tcg-target.c b/tcg/sparc/tcg-target.c > index ac76e11..10b9b8c 100644 > --- a/tcg/sparc/tcg-target.c > +++ b/tcg/sparc/tcg-target.c > @@ -694,10 +694,10 @@ static void tcg_out_setcond2_i32(TCGContext *s, > TCGCond cond, TCGArg ret, > static void tcg_target_qemu_prologue(TCGContext *s) > { > tcg_set_frame(s, TCG_REG_I6, TCG_TARGET_CALL_STACK_OFFSET, > - CPU_TEMP_BUF_NLONGS * (int)sizeof(long)); > + TCG_TEMP_BUF_NLONGS * (int)sizeof(long)); > tcg_out32(s, SAVE | INSN_RD(TCG_REG_O6) | INSN_RS1(TCG_REG_O6) | > INSN_IMM13(-(TCG_TARGET_STACK_MINFRAME + > - CPU_TEMP_BUF_NLONGS * (int)sizeof(long)))); > + TCG_TEMP_BUF_NLONGS * (int)sizeof(long)))); > tcg_out32(s, JMPL | INSN_RD(TCG_REG_G0) | INSN_RS1(TCG_REG_I1) | > INSN_RS2(TCG_REG_G0)); > tcg_out_mov(s, TCG_TYPE_PTR, TCG_AREG0, TCG_REG_I0); > diff --git a/tcg/tcg.h b/tcg/tcg.h > index a2dd8b8..39c59ff 100644 > --- a/tcg/tcg.h > +++ b/tcg/tcg.h > @@ -92,6 +92,9 @@ typedef struct TCGPool { > > #define TCG_MAX_TEMPS 512 > > +/* buffer for temporaries */ > +#define TCG_TEMP_BUF_NLONGS 128 > + > /* when the size of the arguments of a called function is smaller than > this value, they are statically allocated in the TB stack frame */ > #define TCG_STATIC_CALL_ARGS_SIZE 128 -- Best Regards Wayne Xia mail:xiawenc@linux.vnet.ibm.com tel:86-010-82450803