qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 5/7] tcg/i386: add support for IBT


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH 5/7] tcg/i386: add support for IBT
Date: Wed, 13 Mar 2019 16:46:50 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

On 3/13/19 5:40 AM, Paolo Bonzini wrote:
> Add endbr annotations before indirect branch targets.  This lets QEMU enable
> IBT even for TCG-enabled builds.

> @@ -3514,6 +3526,7 @@ static void tcg_target_qemu_prologue(TCGContext *s)
>                    CPU_TEMP_BUF_NLONGS * sizeof(long));
>  
>      /* Save all callee saved registers.  */
> +    tcg_out_endbr(s);
>      for (i = 0; i < ARRAY_SIZE(tcg_target_callee_save_regs); i++) {
>          tcg_out_push(s, tcg_target_callee_save_regs[i]);
>      }

Nit: Keep the comment with the code to which it applies.

I'll note that there's one latent but currently unused indirect branch:

>         } else {
>             /* indirect jump method */
>             tcg_out_modrm_offset(s, OPC_GRP5, EXT5_JMPN_Ev, -1,
>                                  (intptr_t)(s->tb_jmp_target_addr + a0));
>         }
>         set_jmp_reset_offset(s, a0);

We can probably just delete that condition, and assert it instead.

Otherwise,
Reviewed-by: Richard Henderson <address@hidden>


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]