qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC 2/7] translate-all: add out_size field to Translat


From: Richard Henderson
Subject: Re: [Qemu-devel] [RFC 2/7] translate-all: add out_size field to TranslationBlock
Date: Thu, 29 Jun 2017 23:31:15 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0

On 06/29/2017 01:28 PM, Emilio G. Cota wrote:
Note that due to the cacheline padding we are using, for
hosts with 64-byte cache lines this will not waste any
additional memory. Using a s16 would be ideal, since that
would plug an existing hole in the struct, but I see no
guarantee that a TB won't overflow it.

Signed-off-by: Emilio G. Cota<address@hidden>
---
  include/exec/exec-all.h   |  1 +
  accel/tcg/translate-all.c | 16 ++++++++--------
  2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index 35a75f1..df12338 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -363,6 +363,7 @@ struct TranslationBlock {
       */
      uintptr_t jmp_list_next[2];
      uintptr_t jmp_list_first;
+    int32_t out_size; /* size of host code for this block */

unsigned probably better.

I do wonder about putting it in the hole after invalid.
Which itself could be shrunk to bool.

I don't believe there's much chance of an overflow of uint16_t. The limit of OPC_BUF_SIZE = 640 fairly well limits the practical size. And, honestly, it doesn't matter if we saturate to 0xffff, so long as you retain the full-size gen_code_size local variable.


r~



reply via email to

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