[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v11 06/29] target/i386: [tcg] Refactor init_disa
From: |
Emilio G. Cota |
Subject: |
Re: [Qemu-devel] [PATCH v11 06/29] target/i386: [tcg] Refactor init_disas_context |
Date: |
Thu, 29 Jun 2017 19:51:33 -0400 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
On Wed, Jun 28, 2017 at 15:40:52 +0300, Lluís Vilanova wrote:
> Incrementally paves the way towards using the generic instruction translation
> loop.
>
> Signed-off-by: Lluís Vilanova <address@hidden>
> ---
> target/i386/translate.c | 43 ++++++++++++++++++++++++-------------------
> 1 file changed, 24 insertions(+), 19 deletions(-)
>
> diff --git a/target/i386/translate.c b/target/i386/translate.c
> index 8cf2485e2c..04453ce48a 100644
> --- a/target/i386/translate.c
> +++ b/target/i386/translate.c
> @@ -8379,20 +8379,12 @@ void tcg_x86_init(void)
> }
> }
>
> -/* generate intermediate code for basic block 'tb'. */
> -void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb)
> +static void i386_trblock_init_disas_context(DisasContextBase *dcbase,
> CPUState *cpu)
Or just i386_tr_init_(..) -- this brings the line under 80 characters.
> {
> + DisasContext *dc = container_of(dcbase, DisasContext, base);
> CPUX86State *env = cpu->env_ptr;
> - DisasContext dc1, *dc = &dc1;
> - uint32_t flags;
> - target_ulong cs_base;
> - int num_insns;
> - int max_insns;
> -
> - /* generate intermediate code */
> - dc->base.pc_first = tb->pc;
> - cs_base = tb->cs_base;
> - flags = tb->flags;
> + uint32_t flags = dc->base.tb->flags;
> + target_ulong cs_base = dc->base.tb->cs_base;
>
> dc->pe = (flags >> HF_PE_SHIFT) & 1;
> dc->code32 = (flags >> HF_CS32_SHIFT) & 1;
> @@ -8403,11 +8395,9 @@ void gen_intermediate_code(CPUState *cpu,
> TranslationBlock *tb)
> dc->cpl = (flags >> HF_CPL_SHIFT) & 3;
> dc->iopl = (flags >> IOPL_SHIFT) & 3;
> dc->tf = (flags >> TF_SHIFT) & 1;
> - dc->base.singlestep_enabled = cpu->singlestep_enabled;
> dc->cc_op = CC_OP_DYNAMIC;
> dc->cc_op_dirty = false;
> dc->cs_base = cs_base;
> - dc->base.tb = tb;
> dc->popl_esp_hack = 0;
> /* select memory access functions */
> dc->mem_index = 0;
> @@ -8425,7 +8415,7 @@ void gen_intermediate_code(CPUState *cpu,
> TranslationBlock *tb)
> dc->code64 = (flags >> HF_CS64_SHIFT) & 1;
> #endif
> dc->flags = flags;
> - dc->jmp_opt = !(dc->tf || cpu->singlestep_enabled ||
> + dc->jmp_opt = !(dc->tf || dc->base.singlestep_enabled ||
Why this change and not leaving cpu->singlestep_enabled?
E.
- Re: [Qemu-devel] [PATCH v11 01/29] Pass generic CPUState to gen_intermediate_code(), (continued)
- [Qemu-devel] [PATCH v11 02/29] cpu-exec: Avoid global variables in icount-related functions, Lluís Vilanova, 2017/06/28
- [Qemu-devel] [PATCH v11 03/29] target: [tcg] Use a generic enum for DISAS_ values, Lluís Vilanova, 2017/06/28
- [Qemu-devel] [PATCH v11 04/29] target: [tcg] Add generic translation framework, Lluís Vilanova, 2017/06/28
- [Qemu-devel] [PATCH v11 05/29] target/i386: [tcg] Port to DisasContextBase, Lluís Vilanova, 2017/06/28
- [Qemu-devel] [PATCH v11 06/29] target/i386: [tcg] Refactor init_disas_context, Lluís Vilanova, 2017/06/28
- Re: [Qemu-devel] [PATCH v11 06/29] target/i386: [tcg] Refactor init_disas_context,
Emilio G. Cota <=
- [Qemu-devel] [PATCH v11 07/29] target/i386: [tcg] Refactor init_globals, Lluís Vilanova, 2017/06/28
- [Qemu-devel] [PATCH v11 08/29] target/i386: [tcg] Refactor insn_start, Lluís Vilanova, 2017/06/28
- [Qemu-devel] [PATCH v11 09/29] target/i386: [tcg] Refactor breakpoint_check, Lluís Vilanova, 2017/06/28
- [Qemu-devel] [PATCH v11 10/29] target/i386: [tcg] Refactor translate_insn, Lluís Vilanova, 2017/06/28
- [Qemu-devel] [PATCH v11 11/29] target/i386: [tcg] Refactor tb_stop, Lluís Vilanova, 2017/06/28