qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Igor Mammedov <imammedo@redhat.com>
Cc: qemu-devel@nongnu.org,  richard.henderson@linaro.org,
	pbonzini@redhat.com,  imp@bsdimp.com,  kevans@freebsd.org,
	gaosong@loongson.cn,  laurent@vivier.eu
Subject: Re: [PATCH 4/6] tcg:tlb: use tcg_debug_assert() in assert_cpu_is_self()
Date: Fri, 31 Jan 2025 12:19:22 +0000	[thread overview]
Message-ID: <8734gz2n1x.fsf@draig.linaro.org> (raw)
In-Reply-To: <20250129134436.1240740-5-imammedo@redhat.com> (Igor Mammedov's message of "Wed, 29 Jan 2025 14:44:34 +0100")

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


  reply	other threads:[~2025-01-31 12:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-29 13:44 [PATCH 0/6] tcg: fix qemu crash when add assert_cpu_is_self() is enabled and cleanups related to cpu->created check Igor Mammedov
2025-01-29 13:44 ` [PATCH 1/6] bsd-user: drop not longer used target_reset_cpu() Igor Mammedov
2025-01-29 13:44 ` [PATCH 2/6] loongarch: reset vcpu after it's created Igor Mammedov
2025-01-29 13:44 ` [PATCH 3/6] m68k: " Igor Mammedov
2025-01-29 13:44 ` [PATCH 4/6] tcg:tlb: use tcg_debug_assert() in assert_cpu_is_self() Igor Mammedov
2025-01-31 12:19   ` Alex Bennée [this message]
2025-01-31 13:47   ` [PATCH v2 " Igor Mammedov
2025-01-29 13:44 ` [PATCH 5/6] Revert "tcg/cputlb: remove other-cpu capability from TLB flushing" Igor Mammedov
2025-01-29 18:33   ` BALATON Zoltan
2025-01-30  8:06     ` Igor Mammedov
2025-01-29 13:44 ` [PATCH 6/6] tcg: drop cpu->created check Igor Mammedov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8734gz2n1x.fsf@draig.linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=gaosong@loongson.cn \
    --cc=imammedo@redhat.com \
    --cc=imp@bsdimp.com \
    --cc=kevans@freebsd.org \
    --cc=laurent@vivier.eu \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).