qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v14 02/10] accel/tcg: introduce TBStatistics structure


From: Richard Henderson
Subject: Re: [PATCH v14 02/10] accel/tcg: introduce TBStatistics structure
Date: Wed, 31 May 2023 19:48:07 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0

On 5/31/23 18:30, Wu, Fei wrote:
On 6/1/2023 7:59 AM, Richard Henderson wrote:
On 5/30/23 01:35, Fei Wu wrote:
+    /*
+     * We want to fetch the stats structure before we start code
+     * generation so we can count interesting things about this
+     * generation.
+     */
+    if (tb_stats_collection_enabled()) {
+        tb->tb_stats = tb_get_stats(phys_pc, pc, cs_base, flags);

If cflags & CF_PCREL, then 'pc' should not be cached or matched.
Using 'phys_pc' will suffice, so pass 0 in that case.

OK, tb_get_stats(phys_pc, (cflags & CF_PCREL ? 0 : pc), cs_base, flags);

btw, is it possible to drop 'pc' even w/o CF_PCREL setting in cflags?
Two TBs with different 'pc' but same 'phys_pc', are they the same?

For the purpose of statistics, yes, plausibly.

Knowing how many different translations of the same bit of libc.so, for a guest that does not support CF_PCREL, could be revealing. In any case, you can get back to the virtual addresses via tb_stats->tbs[i]->pc, so long as tb_stats->tb[i].cflags & CF_PCREL is not set.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]