that will enable assert_cpu_is_self when QEMU is configured with
--enable-debug
without need for manual patching DEBUG_TLB_GATE define.
Need to manually path DEBUG_TLB_GATE define to enable assert,
let regression caused by [1] creep in unnoticed.
1) 30933c4fb4f3d ("tcg/cputlb: remove other-cpu capability from TLB flushing")
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Suggested-by: Alex Bennée <alex.bennee@linaro.org>
---
accel/tcg/cputlb.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index b4ccf0cdcb..71207d6dbf 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -61,8 +61,8 @@
# define DEBUG_TLB_LOG_GATE 0
# endif
#else
-# define DEBUG_TLB_GATE 0
-# define DEBUG_TLB_LOG_GATE 0
+# define DEBUG_TLB_GATE 1
+# define DEBUG_TLB_LOG_GATE 1
#endif
#define tlb_debug(fmt, ...) do { \
@@ -74,11 +74,8 @@
} \
} while (0)
-#define assert_cpu_is_self(cpu) do { \
- if (DEBUG_TLB_GATE) { \
- g_assert(!(cpu)->created || qemu_cpu_is_self(cpu)); \
- } \
- } while (0)
+#define assert_cpu_is_self(cpu) \
+ tcg_debug_assert(!(cpu)->created || qemu_cpu_is_self(cpu))
/* run_on_cpu_data.target_ptr should always be big enough for a
* vaddr even on 32 bit builds
--
2.43.0
Igor Mammedov <imammedo@redhat.com> writes:
> that will enable assert_cpu_is_self when QEMU is configured with
> --enable-debug
> without need for manual patching DEBUG_TLB_GATE define.
>
> Need to manually path DEBUG_TLB_GATE define to enable assert,
> let regression caused by [1] creep in unnoticed.
>
> 1) 30933c4fb4f3d ("tcg/cputlb: remove other-cpu capability from TLB flushing")
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> Suggested-by: Alex Bennée <alex.bennee@linaro.org>
> ---
> accel/tcg/cputlb.c | 11 ++++-------
> 1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
> index b4ccf0cdcb..71207d6dbf 100644
> --- a/accel/tcg/cputlb.c
> +++ b/accel/tcg/cputlb.c
> @@ -61,8 +61,8 @@
> # define DEBUG_TLB_LOG_GATE 0
> # endif
> #else
> -# define DEBUG_TLB_GATE 0
> -# define DEBUG_TLB_LOG_GATE 0
> +# define DEBUG_TLB_GATE 1
> +# define DEBUG_TLB_LOG_GATE 1
> #endif
This shouldn't be changed because it still gates the much more expensive
tlb_debug() which hasn't yet been converted to trace points.
>
> #define tlb_debug(fmt, ...) do { \
> @@ -74,11 +74,8 @@
> } \
> } while (0)
>
> -#define assert_cpu_is_self(cpu) do { \
> - if (DEBUG_TLB_GATE) { \
> - g_assert(!(cpu)->created || qemu_cpu_is_self(cpu)); \
> - } \
> - } while (0)
> +#define assert_cpu_is_self(cpu) \
> + tcg_debug_assert(!(cpu)->created || qemu_cpu_is_self(cpu))
>
This is fine.
> /* run_on_cpu_data.target_ptr should always be big enough for a
> * vaddr even on 32 bit builds
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
that will enable assert_cpu_is_self when QEMU is configured with
--enable-debug
without need for manual patching DEBUG_TLB_GATE define.
Need to manually path DEBUG_TLB_GATE define to enable assert,
let regression caused by [1] creep in unnoticed.
1) 30933c4fb4f3d ("tcg/cputlb: remove other-cpu capability from TLB flushing")
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Suggested-by: Alex Bennée <alex.bennee@linaro.org>
---
v2: revert DEBUG_TLB_GATE/DEBUG_TLB_LOG_GATE to 0 as it used to be
---
accel/tcg/cputlb.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index b4ccf0cdcb..7380b29da3 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -74,11 +74,8 @@
} \
} while (0)
-#define assert_cpu_is_self(cpu) do { \
- if (DEBUG_TLB_GATE) { \
- g_assert(!(cpu)->created || qemu_cpu_is_self(cpu)); \
- } \
- } while (0)
+#define assert_cpu_is_self(cpu) \
+ tcg_debug_assert(!(cpu)->created || qemu_cpu_is_self(cpu))
/* run_on_cpu_data.target_ptr should always be big enough for a
* vaddr even on 32 bit builds
--
2.43.0
© 2016 - 2026 Red Hat, Inc.