qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

target/arm: Rename DISAS_UPDATE to DISAS_UPDATE_EXIT

Emphasize that the is_jmp option exits to the main loop.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20200626033144.790098-6-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

authored by

Richard Henderson and committed by
Peter Maydell
14407ec2 8ddb300b

+20 -18
+4 -4
target/arm/translate-a64.c
··· 1616 1616 gen_helper_msr_i_daifclear(cpu_env, t1); 1617 1617 tcg_temp_free_i32(t1); 1618 1618 /* For DAIFClear, exit the cpu loop to re-evaluate pending IRQs. */ 1619 - s->base.is_jmp = DISAS_UPDATE; 1619 + s->base.is_jmp = DISAS_UPDATE_EXIT; 1620 1620 break; 1621 1621 1622 1622 default: ··· 1795 1795 1796 1796 if ((tb_cflags(s->base.tb) & CF_USE_ICOUNT) && (ri->type & ARM_CP_IO)) { 1797 1797 /* I/O operations must end the TB here (whether read or write) */ 1798 - s->base.is_jmp = DISAS_UPDATE; 1798 + s->base.is_jmp = DISAS_UPDATE_EXIT; 1799 1799 } 1800 1800 if (!isread && !(ri->type & ARM_CP_SUPPRESS_TB_END)) { 1801 1801 /* ··· 1810 1810 * but allow this to be suppressed by the register definition 1811 1811 * (usually only necessary to work around guest bugs). 1812 1812 */ 1813 - s->base.is_jmp = DISAS_UPDATE; 1813 + s->base.is_jmp = DISAS_UPDATE_EXIT; 1814 1814 } 1815 1815 } 1816 1816 ··· 14292 14292 gen_goto_tb(dc, 1, dc->base.pc_next); 14293 14293 break; 14294 14294 default: 14295 - case DISAS_UPDATE: 14295 + case DISAS_UPDATE_EXIT: 14296 14296 gen_a64_set_pc_im(dc->base.pc_next); 14297 14297 /* fall through */ 14298 14298 case DISAS_EXIT:
+2 -2
target/arm/translate-vfp.inc.c
··· 123 123 * this to be the last insn in the TB). 124 124 */ 125 125 if (tb_cflags(s->base.tb) & CF_USE_ICOUNT) { 126 - s->base.is_jmp = DISAS_UPDATE; 126 + s->base.is_jmp = DISAS_UPDATE_EXIT; 127 127 gen_io_start(); 128 128 } 129 129 gen_helper_v7m_preserve_fp_state(cpu_env); ··· 2860 2860 tcg_temp_free_i32(fptr); 2861 2861 2862 2862 /* End the TB, because we have updated FP control bits */ 2863 - s->base.is_jmp = DISAS_UPDATE; 2863 + s->base.is_jmp = DISAS_UPDATE_EXIT; 2864 2864 return true; 2865 2865 }
+6 -6
target/arm/translate.c
··· 2775 2775 tcg_temp_free_i32(tcg_tgtmode); 2776 2776 tcg_temp_free_i32(tcg_regno); 2777 2777 tcg_temp_free_i32(tcg_reg); 2778 - s->base.is_jmp = DISAS_UPDATE; 2778 + s->base.is_jmp = DISAS_UPDATE_EXIT; 2779 2779 } 2780 2780 2781 2781 static void gen_mrs_banked(DisasContext *s, int r, int sysm, int rn) ··· 2797 2797 tcg_temp_free_i32(tcg_tgtmode); 2798 2798 tcg_temp_free_i32(tcg_regno); 2799 2799 store_reg(s, rn, tcg_reg); 2800 - s->base.is_jmp = DISAS_UPDATE; 2800 + s->base.is_jmp = DISAS_UPDATE_EXIT; 2801 2801 } 2802 2802 2803 2803 /* Store value to PC as for an exception return (ie don't ··· 5114 5114 tcg_temp_free_i32(tmp); 5115 5115 } 5116 5116 tcg_temp_free_i32(addr); 5117 - s->base.is_jmp = DISAS_UPDATE; 5117 + s->base.is_jmp = DISAS_UPDATE_EXIT; 5118 5118 } 5119 5119 5120 5120 /* Generate a label used for skipping this instruction */ ··· 8160 8160 } 8161 8161 if (a->E != (s->be_data == MO_BE)) { 8162 8162 gen_helper_setend(cpu_env); 8163 - s->base.is_jmp = DISAS_UPDATE; 8163 + s->base.is_jmp = DISAS_UPDATE_EXIT; 8164 8164 } 8165 8165 return true; 8166 8166 } ··· 8873 8873 break; 8874 8874 case DISAS_NEXT: 8875 8875 case DISAS_TOO_MANY: 8876 - case DISAS_UPDATE: 8876 + case DISAS_UPDATE_EXIT: 8877 8877 gen_set_pc_im(dc, dc->base.pc_next); 8878 8878 /* fall through */ 8879 8879 default: ··· 8900 8900 case DISAS_JUMP: 8901 8901 gen_goto_ptr(); 8902 8902 break; 8903 - case DISAS_UPDATE: 8903 + case DISAS_UPDATE_EXIT: 8904 8904 gen_set_pc_im(dc, dc->base.pc_next); 8905 8905 /* fall through */ 8906 8906 default:
+8 -6
target/arm/translate.h
··· 148 148 149 149 /* is_jmp field values */ 150 150 #define DISAS_JUMP DISAS_TARGET_0 /* only pc was modified dynamically */ 151 - #define DISAS_UPDATE DISAS_TARGET_1 /* cpu state was modified dynamically */ 151 + /* CPU state was modified dynamically; exit to main loop for interrupts. */ 152 + #define DISAS_UPDATE_EXIT DISAS_TARGET_1 152 153 /* These instructions trap after executing, so the A32/T32 decoder must 153 154 * defer them until after the conditional execution state has been updated. 154 155 * WFI also needs special handling when single-stepping. ··· 164 165 * custom end-of-TB code) 165 166 */ 166 167 #define DISAS_BX_EXCRET DISAS_TARGET_8 167 - /* For instructions which want an immediate exit to the main loop, 168 - * as opposed to attempting to use lookup_and_goto_ptr. Unlike 169 - * DISAS_UPDATE this doesn't write the PC on exiting the translation 170 - * loop so you need to ensure something (gen_a64_set_pc_im or runtime 171 - * helper) has done so before we reach return from cpu_tb_exec. 168 + /* 169 + * For instructions which want an immediate exit to the main loop, as opposed 170 + * to attempting to use lookup_and_goto_ptr. Unlike DISAS_UPDATE_EXIT, this 171 + * doesn't write the PC on exiting the translation loop so you need to ensure 172 + * something (gen_a64_set_pc_im or runtime helper) has done so before we reach 173 + * return from cpu_tb_exec. 172 174 */ 173 175 #define DISAS_EXIT DISAS_TARGET_9 174 176