Re: [Qemu-devel] [PATCH for-2.11 02/23] tcg: Rearrange ldst label tracking

2017-08-04 Thread Paolo Bonzini
On 04/08/2017 07:44, Richard Henderson wrote:
> Dispense with TCGBackendData, as it has never been used for more than
> holding a single pointer.  Use a define in the cpu/tcg-target.h to
> signal requirement for TCGLabelQemuLdst, so that we can drop the no-op
> tcg-be-null.h stubs.  Rename tcg-be-ldst.h to tcg-ldst.inc.c.
> 
> Signed-off-by: Richard Henderson 

Reviewed-by: Paolo Bonzini 

> ---
>  tcg/aarch64/tcg-target.h  |  4 
>  tcg/arm/tcg-target.h  |  4 
>  tcg/i386/tcg-target.h |  4 
>  tcg/ia64/tcg-target.h |  4 
>  tcg/mips/tcg-target.h |  4 
>  tcg/ppc/tcg-target.h  |  4 
>  tcg/s390/tcg-target.h |  4 
>  tcg/tcg-be-null.h | 44 
> ---
>  tcg/tcg.h |  6 +++--
>  tcg/aarch64/tcg-target.inc.c  |  3 ++-
>  tcg/arm/tcg-target.inc.c  |  3 ++-
>  tcg/i386/tcg-target.inc.c |  4 ++--
>  tcg/ia64/tcg-target.inc.c | 19 ---
>  tcg/mips/tcg-target.inc.c |  4 ++--
>  tcg/ppc/tcg-target.inc.c  |  4 ++--
>  tcg/s390/tcg-target.inc.c |  4 ++--
>  tcg/sparc/tcg-target.inc.c|  2 --
>  tcg/{tcg-be-ldst.h => tcg-ldst.inc.c} | 27 -
>  tcg/tcg.c | 17 +++---
>  tcg/tci/tcg-target.inc.c  |  2 --
>  20 files changed, 61 insertions(+), 106 deletions(-)
>  delete mode 100644 tcg/tcg-be-null.h
>  rename tcg/{tcg-be-ldst.h => tcg-ldst.inc.c} (85%)
> 
> diff --git a/tcg/aarch64/tcg-target.h b/tcg/aarch64/tcg-target.h
> index 3c3b1e603d..484cf6236c 100644
> --- a/tcg/aarch64/tcg-target.h
> +++ b/tcg/aarch64/tcg-target.h
> @@ -120,4 +120,8 @@ static inline void flush_icache_range(uintptr_t start, 
> uintptr_t stop)
>  
>  void tb_target_set_jmp_target(uintptr_t, uintptr_t, uintptr_t);
>  
> +#ifdef CONFIG_SOFTMMU
> +#define TCG_TARGET_NEED_LDST_LABELS
> +#endif
> +
>  #endif /* AARCH64_TCG_TARGET_H */
> diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h
> index b836f7f127..55de35a691 100644
> --- a/tcg/arm/tcg-target.h
> +++ b/tcg/arm/tcg-target.h
> @@ -138,4 +138,8 @@ static inline void flush_icache_range(uintptr_t start, 
> uintptr_t stop)
>  /* not defined -- call should be eliminated at compile time */
>  void tb_target_set_jmp_target(uintptr_t, uintptr_t, uintptr_t);
>  
> +#ifdef CONFIG_SOFTMMU
> +#define TCG_TARGET_NEED_LDST_LABELS
> +#endif
> +
>  #endif
> diff --git a/tcg/i386/tcg-target.h b/tcg/i386/tcg-target.h
> index 2fd28fa6a5..11ee7fadd1 100644
> --- a/tcg/i386/tcg-target.h
> +++ b/tcg/i386/tcg-target.h
> @@ -186,4 +186,8 @@ static inline void tb_target_set_jmp_target(uintptr_t 
> tc_ptr,
>  
>  #define TCG_TARGET_DEFAULT_MO (TCG_MO_ALL & ~TCG_MO_ST_LD)
>  
> +#ifdef CONFIG_SOFTMMU
> +#define TCG_TARGET_NEED_LDST_LABELS
> +#endif
> +
>  #endif
> diff --git a/tcg/ia64/tcg-target.h b/tcg/ia64/tcg-target.h
> index 5c9ca8c1ce..83107e1407 100644
> --- a/tcg/ia64/tcg-target.h
> +++ b/tcg/ia64/tcg-target.h
> @@ -199,4 +199,8 @@ static inline void flush_icache_range(uintptr_t start, 
> uintptr_t stop)
>  /* not defined -- call should be eliminated at compile time */
>  void tb_target_set_jmp_target(uintptr_t, uintptr_t, uintptr_t);
>  
> +#ifdef CONFIG_SOFTMMU
> +#define TCG_TARGET_NEED_LDST_LABELS
> +#endif
> +
>  #endif
> diff --git a/tcg/mips/tcg-target.h b/tcg/mips/tcg-target.h
> index 557c8ddc46..bea5290b9f 100644
> --- a/tcg/mips/tcg-target.h
> +++ b/tcg/mips/tcg-target.h
> @@ -209,4 +209,8 @@ static inline void flush_icache_range(uintptr_t start, 
> uintptr_t stop)
>  
>  void tb_target_set_jmp_target(uintptr_t, uintptr_t, uintptr_t);
>  
> +#ifdef CONFIG_SOFTMMU
> +#define TCG_TARGET_NEED_LDST_LABELS
> +#endif
> +
>  #endif
> diff --git a/tcg/ppc/tcg-target.h b/tcg/ppc/tcg-target.h
> index 5bab3387e5..c1226ea5b6 100644
> --- a/tcg/ppc/tcg-target.h
> +++ b/tcg/ppc/tcg-target.h
> @@ -127,4 +127,8 @@ extern bool have_isa_3_00;
>  void flush_icache_range(uintptr_t start, uintptr_t stop);
>  void tb_target_set_jmp_target(uintptr_t, uintptr_t, uintptr_t);
>  
> +#ifdef CONFIG_SOFTMMU
> +#define TCG_TARGET_NEED_LDST_LABELS
> +#endif
> +
>  #endif
> diff --git a/tcg/s390/tcg-target.h b/tcg/s390/tcg-target.h
> index 1398952d6b..8fea9646b4 100644
> --- a/tcg/s390/tcg-target.h
> +++ b/tcg/s390/tcg-target.h
> @@ -153,4 +153,8 @@ static inline void tb_target_set_jmp_target(uintptr_t 
> tc_ptr,
>  /* no need to flush icache explicitly */
>  }
>  
> +#ifdef CONFIG_SOFTMMU
> +#define TCG_TARGET_NEED_LDST_LABELS
> +#endif
> +
>  #endif
> diff --git a/tcg/tcg-be-null.h b/tcg/tcg-be-null.h
> deleted file mode 100644
> index 5222fe29e2..00
> --- a/tcg/tcg-be-null.h
> +++ /dev/null
> @@ -1,44 +0,0 @@
> -/*
> - * TCG Backend Data: No backend data
> - *
> - * Permission is hereby granted, free of 

[Qemu-devel] [PATCH for-2.11 02/23] tcg: Rearrange ldst label tracking

2017-08-03 Thread Richard Henderson
Dispense with TCGBackendData, as it has never been used for more than
holding a single pointer.  Use a define in the cpu/tcg-target.h to
signal requirement for TCGLabelQemuLdst, so that we can drop the no-op
tcg-be-null.h stubs.  Rename tcg-be-ldst.h to tcg-ldst.inc.c.

Signed-off-by: Richard Henderson 
---
 tcg/aarch64/tcg-target.h  |  4 
 tcg/arm/tcg-target.h  |  4 
 tcg/i386/tcg-target.h |  4 
 tcg/ia64/tcg-target.h |  4 
 tcg/mips/tcg-target.h |  4 
 tcg/ppc/tcg-target.h  |  4 
 tcg/s390/tcg-target.h |  4 
 tcg/tcg-be-null.h | 44 ---
 tcg/tcg.h |  6 +++--
 tcg/aarch64/tcg-target.inc.c  |  3 ++-
 tcg/arm/tcg-target.inc.c  |  3 ++-
 tcg/i386/tcg-target.inc.c |  4 ++--
 tcg/ia64/tcg-target.inc.c | 19 ---
 tcg/mips/tcg-target.inc.c |  4 ++--
 tcg/ppc/tcg-target.inc.c  |  4 ++--
 tcg/s390/tcg-target.inc.c |  4 ++--
 tcg/sparc/tcg-target.inc.c|  2 --
 tcg/{tcg-be-ldst.h => tcg-ldst.inc.c} | 27 -
 tcg/tcg.c | 17 +++---
 tcg/tci/tcg-target.inc.c  |  2 --
 20 files changed, 61 insertions(+), 106 deletions(-)
 delete mode 100644 tcg/tcg-be-null.h
 rename tcg/{tcg-be-ldst.h => tcg-ldst.inc.c} (85%)

diff --git a/tcg/aarch64/tcg-target.h b/tcg/aarch64/tcg-target.h
index 3c3b1e603d..484cf6236c 100644
--- a/tcg/aarch64/tcg-target.h
+++ b/tcg/aarch64/tcg-target.h
@@ -120,4 +120,8 @@ static inline void flush_icache_range(uintptr_t start, 
uintptr_t stop)
 
 void tb_target_set_jmp_target(uintptr_t, uintptr_t, uintptr_t);
 
+#ifdef CONFIG_SOFTMMU
+#define TCG_TARGET_NEED_LDST_LABELS
+#endif
+
 #endif /* AARCH64_TCG_TARGET_H */
diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h
index b836f7f127..55de35a691 100644
--- a/tcg/arm/tcg-target.h
+++ b/tcg/arm/tcg-target.h
@@ -138,4 +138,8 @@ static inline void flush_icache_range(uintptr_t start, 
uintptr_t stop)
 /* not defined -- call should be eliminated at compile time */
 void tb_target_set_jmp_target(uintptr_t, uintptr_t, uintptr_t);
 
+#ifdef CONFIG_SOFTMMU
+#define TCG_TARGET_NEED_LDST_LABELS
+#endif
+
 #endif
diff --git a/tcg/i386/tcg-target.h b/tcg/i386/tcg-target.h
index 2fd28fa6a5..11ee7fadd1 100644
--- a/tcg/i386/tcg-target.h
+++ b/tcg/i386/tcg-target.h
@@ -186,4 +186,8 @@ static inline void tb_target_set_jmp_target(uintptr_t 
tc_ptr,
 
 #define TCG_TARGET_DEFAULT_MO (TCG_MO_ALL & ~TCG_MO_ST_LD)
 
+#ifdef CONFIG_SOFTMMU
+#define TCG_TARGET_NEED_LDST_LABELS
+#endif
+
 #endif
diff --git a/tcg/ia64/tcg-target.h b/tcg/ia64/tcg-target.h
index 5c9ca8c1ce..83107e1407 100644
--- a/tcg/ia64/tcg-target.h
+++ b/tcg/ia64/tcg-target.h
@@ -199,4 +199,8 @@ static inline void flush_icache_range(uintptr_t start, 
uintptr_t stop)
 /* not defined -- call should be eliminated at compile time */
 void tb_target_set_jmp_target(uintptr_t, uintptr_t, uintptr_t);
 
+#ifdef CONFIG_SOFTMMU
+#define TCG_TARGET_NEED_LDST_LABELS
+#endif
+
 #endif
diff --git a/tcg/mips/tcg-target.h b/tcg/mips/tcg-target.h
index 557c8ddc46..bea5290b9f 100644
--- a/tcg/mips/tcg-target.h
+++ b/tcg/mips/tcg-target.h
@@ -209,4 +209,8 @@ static inline void flush_icache_range(uintptr_t start, 
uintptr_t stop)
 
 void tb_target_set_jmp_target(uintptr_t, uintptr_t, uintptr_t);
 
+#ifdef CONFIG_SOFTMMU
+#define TCG_TARGET_NEED_LDST_LABELS
+#endif
+
 #endif
diff --git a/tcg/ppc/tcg-target.h b/tcg/ppc/tcg-target.h
index 5bab3387e5..c1226ea5b6 100644
--- a/tcg/ppc/tcg-target.h
+++ b/tcg/ppc/tcg-target.h
@@ -127,4 +127,8 @@ extern bool have_isa_3_00;
 void flush_icache_range(uintptr_t start, uintptr_t stop);
 void tb_target_set_jmp_target(uintptr_t, uintptr_t, uintptr_t);
 
+#ifdef CONFIG_SOFTMMU
+#define TCG_TARGET_NEED_LDST_LABELS
+#endif
+
 #endif
diff --git a/tcg/s390/tcg-target.h b/tcg/s390/tcg-target.h
index 1398952d6b..8fea9646b4 100644
--- a/tcg/s390/tcg-target.h
+++ b/tcg/s390/tcg-target.h
@@ -153,4 +153,8 @@ static inline void tb_target_set_jmp_target(uintptr_t 
tc_ptr,
 /* no need to flush icache explicitly */
 }
 
+#ifdef CONFIG_SOFTMMU
+#define TCG_TARGET_NEED_LDST_LABELS
+#endif
+
 #endif
diff --git a/tcg/tcg-be-null.h b/tcg/tcg-be-null.h
deleted file mode 100644
index 5222fe29e2..00
--- a/tcg/tcg-be-null.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * TCG Backend Data: No backend data
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to 
deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so,