diff mbox series

[v3,1/6] include/exec/exec-all: document common exit conditions

Message ID 20170711175937.23140-2-alex.bennee@linaro.org
State Superseded
Headers show
Series arm: fixes for eret, isb and DISAS_UPDATE handling | expand

Commit Message

Alex Bennée July 11, 2017, 5:59 p.m. UTC
As a precursor to later patches attempt to come up with a more
concrete wording for what each of the common exit cases would be.

CC: Emilio G. Cota <cota@braap.org>
CC: Richard Henderson <rth@twiddle.net>
CC: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
 include/exec/exec-all.h | 29 ++++++++++++++++++++++++++---
 1 file changed, 26 insertions(+), 3 deletions(-)

-- 
2.13.0

Comments

Richard Henderson July 11, 2017, 6:17 p.m. UTC | #1
On 07/11/2017 07:59 AM, Alex Bennée wrote:
> As a precursor to later patches attempt to come up with a more

> concrete wording for what each of the common exit cases would be.

> 

> CC: Emilio G. Cota<cota@braap.org>

> CC: Richard Henderson<rth@twiddle.net>

> CC: Lluís Vilanova<vilanova@ac.upc.edu>

> Signed-off-by: Alex Bennée<alex.bennee@linaro.org>

> ---

>   include/exec/exec-all.h | 29 ++++++++++++++++++++++++++---

>   1 file changed, 26 insertions(+), 3 deletions(-)


Reviewed-by: Richard Henderson <rth@twiddle.net>



r~
Emilio Cota July 18, 2017, 12:02 a.m. UTC | #2
On Tue, Jul 11, 2017 at 18:59:32 +0100, Alex Bennée wrote:
> As a precursor to later patches attempt to come up with a more

> concrete wording for what each of the common exit cases would be.

(snip)
> + * In these cases as long as the PC is updated we can chain to the

> + * next TB either by exiting the loop or looking up the next TB via

> + * the loookup helper.


'o' x 3

> + *

> + *   DISAS_UPDATE  - CPU State was modified dynamically

> + *

> + * This covers any other CPU state which necessities us exiting the

> + * TCG code to the main run-loop.


s/necessities/necessitates/

Reviewed-by: Emilio G. Cota <cota@braap.org>


		E.
diff mbox series

Patch

diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index 8096d64a1d..a23894f687 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -35,11 +35,34 @@  typedef abi_ulong tb_page_addr_t;
 typedef ram_addr_t tb_page_addr_t;
 #endif
 
-/* is_jmp field values */
+/* DisasContext is_jmp field values
+ *
+ * is_jmp starts as DISAS_NEXT. The translator will keep processing
+ * instructions until an exit condition is reached. If we reach the
+ * exit condition and is_jmp is still DISAS_NEXT (because of some
+ * other condition) we simply "jump" to the next address.
+ * The remaining exit cases are:
+ *
+ *   DISAS_JUMP    - Only the PC was modified dynamically (e.g computed)
+ *   DISAS_TB_JUMP - Only the PC was modified statically (e.g. branch)
+ *
+ * In these cases as long as the PC is updated we can chain to the
+ * next TB either by exiting the loop or looking up the next TB via
+ * the loookup helper.
+ *
+ *   DISAS_UPDATE  - CPU State was modified dynamically
+ *
+ * This covers any other CPU state which necessities us exiting the
+ * TCG code to the main run-loop. Typically this includes anything
+ * that might change the interrupt state.
+ *
+ * Individual translators may define additional exit cases to deal
+ * with per-target special conditions.
+ */
 #define DISAS_NEXT    0 /* next instruction can be analyzed */
 #define DISAS_JUMP    1 /* only pc was modified dynamically */
-#define DISAS_UPDATE  2 /* cpu state was modified dynamically */
-#define DISAS_TB_JUMP 3 /* only pc was modified statically */
+#define DISAS_TB_JUMP 2 /* only pc was modified statically */
+#define DISAS_UPDATE  3 /* cpu state was modified dynamically */
 
 #include "qemu/log.h"