From: "Emilio G. Cota" <cota@braap.org>
To: "Lluís Vilanova" <vilanova@ac.upc.edu>
Cc: qemu-devel@nongnu.org, Eric Blake <eblake@redhat.com>,
Eduardo Habkost <ehabkost@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Peter Crosthwaite <crosthwaite.peter@gmail.com>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH v10 4/7] exec: [tcg] Use different TBs according to the vCPU's dynamic tracing state
Date: Thu, 29 Jun 2017 18:35:05 -0400 [thread overview]
Message-ID: <20170629223505.GD9797@flamenco> (raw)
In-Reply-To: <149873937840.9180.2571251407615859104.stgit@frigg.lan>
On Thu, Jun 29, 2017 at 15:29:38 +0300, Lluís Vilanova wrote:
> Every vCPU now uses a separate set of TBs for each set of dynamic
> tracing event state values. Each set of TBs can be used by any number of
> vCPUs to maximize TB reuse when vCPUs have the same tracing state.
>
> This feature is later used by tracetool to optimize tracing of guest
> code events.
(snip)
> diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
> index 03820e3aeb..71badaaa6b 100644
> --- a/accel/tcg/translate-all.c
> +++ b/accel/tcg/translate-all.c
(snip)
> @@ -112,6 +113,11 @@ typedef struct PageDesc {
> #define V_L2_BITS 10
> #define V_L2_SIZE (1 << V_L2_BITS)
>
> +/* Make sure all possible CPU event bits fit in tb->trace_ds */
> +QEMU_BUILD_BUG_ON(CPU_TRACE_DSTATE_MAX_EVENTS >
> + sizeof(((TranslationBlock *)0)->trace_vcpu_dstate)
> + * BITS_PER_BYTE);
The above comment still uses tb->trace_ds instead of tb->trace_vcpu_dstate.
FWIW I still prefer the much shorter trace_ds field name =)
(snip)
> diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
> index b0281b000f..d918410944 100644
> --- a/include/exec/exec-all.h
> +++ b/include/exec/exec-all.h
> @@ -310,6 +310,10 @@ static inline void tlb_flush_by_mmuidx_all_cpus_synced(CPUState *cpu,
> #define USE_DIRECT_JUMP
> #endif
>
> +/**
> + * TranslationBlock:
> + * @trace_vcpu_dstate: Per-vCPU dynamic tracing state used to generate this TB.
> + */
> struct TranslationBlock {
> target_ulong pc; /* simulated PC corresponding to this block (EIP + CS base) */
> target_ulong cs_base; /* CS base for this block */
> @@ -324,6 +328,8 @@ struct TranslationBlock {
> #define CF_USE_ICOUNT 0x20000
> #define CF_IGNORE_ICOUNT 0x40000 /* Do not generate icount code */
>
> + uint32_t trace_vcpu_dstate;
> +
> uint16_t invalid;
I'd just add the comment above the field, instead of partially
kernel-doc'ing the struct.
(snip)
> diff --git a/trace/control-target.c b/trace/control-target.c
> index d30fa5df75..bc4308021a 100644
> --- a/trace/control-target.c
> +++ b/trace/control-target.c
> @@ -62,6 +62,7 @@ static void trace_event_synchronize_vcpu_state_dynamic(
> {
> bitmap_copy(vcpu->trace_dstate, vcpu->trace_dstate_delayed,
> CPU_TRACE_DSTATE_MAX_EVENTS);
> + tb_flush_jmp_cache_all(vcpu);
Remember to update this as I mentioned re: patch 1.
Other than that,
Reviewed-by: Emilio G. Cota <cota@braap.org>
E.
next prev parent reply other threads:[~2017-06-29 22:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-29 12:13 [Qemu-devel] [PATCH v10 0/7] trace: [tcg] Optimize per-vCPU tracing states with separate TB caches Lluís Vilanova
2017-06-29 12:17 ` [Qemu-devel] [PATCH v10 1/7] exec: [tcg] Refactor flush of per-CPU virtual TB cache Lluís Vilanova
2017-06-29 22:22 ` Emilio G. Cota
2017-06-29 12:21 ` [Qemu-devel] [PATCH v10 2/7] trace: Allocate cpu->trace_dstate in place Lluís Vilanova
2017-06-29 12:25 ` [Qemu-devel] [PATCH v10 3/7] trace: [tcg] Delay changes to dynamic state when translating Lluís Vilanova
2017-06-29 22:25 ` Emilio G. Cota
2017-06-29 12:29 ` [Qemu-devel] [PATCH v10 4/7] exec: [tcg] Use different TBs according to the vCPU's dynamic tracing state Lluís Vilanova
2017-06-29 22:35 ` Emilio G. Cota [this message]
2017-06-29 12:33 ` [Qemu-devel] [PATCH v10 5/7] trace: [tcg] Do not generate TCG code to trace dynamically-disabled events Lluís Vilanova
2017-06-29 12:37 ` [Qemu-devel] [PATCH v10 6/7] trace: [tcg, trivial] Re-align generated code Lluís Vilanova
2017-06-29 12:41 ` [Qemu-devel] [PATCH v10 7/7] trace: [trivial] Statically enable all guest events Lluís Vilanova
2017-06-29 22:36 ` Emilio G. Cota
2017-07-11 8:34 ` [Qemu-devel] [PATCH v10 0/7] trace: [tcg] Optimize per-vCPU tracing states with separate TB caches Stefan Hajnoczi
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=20170629223505.GD9797@flamenco \
--to=cota@braap.org \
--cc=crosthwaite.peter@gmail.com \
--cc=eblake@redhat.com \
--cc=ehabkost@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--cc=stefanha@redhat.com \
--cc=vilanova@ac.upc.edu \
/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).