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 <[email protected]>
r~