All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/2] translate-all: remove redundant setting of tcg_ctx.code_gen_buffer_size
@ 2016-04-22  0:01 Emilio G. Cota
  2016-04-22  0:01 ` [Qemu-devel] [PATCH 2/2] translate-all: add missing munmap of the code_gen guard page for MIPS Emilio G. Cota
  2016-04-24 22:55 ` [Qemu-devel] [PATCH 1/2] translate-all: remove redundant setting of tcg_ctx.code_gen_buffer_size Richard Henderson
  0 siblings, 2 replies; 4+ messages in thread
From: Emilio G. Cota @ 2016-04-22  0:01 UTC (permalink / raw)
  To: QEMU Developers; +Cc: Paolo Bonzini, Peter Crosthwaite, Richard Henderson

The setting of tcg_ctx.code_gen_buffer_size is done by the only caller of
size_code_gen_buffer(), which is code_gen_alloc():

  $ git grep size_code_gen_buffer
  translate-all.c:static inline size_t size_code_gen_buffer(size_t tb_size)
  translate-all.c:    tcg_ctx.code_gen_buffer_size = size_code_gen_buffer(tb_size);

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 translate-all.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/translate-all.c b/translate-all.c
index 769bffc..e700399 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -505,7 +505,6 @@ static inline size_t size_code_gen_buffer(size_t tb_size)
     if (tb_size > MAX_CODE_GEN_BUFFER_SIZE) {
         tb_size = MAX_CODE_GEN_BUFFER_SIZE;
     }
-    tcg_ctx.code_gen_buffer_size = tb_size;
     return tb_size;
 }
 
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PATCH 2/2] translate-all: add missing munmap of the code_gen guard page for MIPS
  2016-04-22  0:01 [Qemu-devel] [PATCH 1/2] translate-all: remove redundant setting of tcg_ctx.code_gen_buffer_size Emilio G. Cota
@ 2016-04-22  0:01 ` Emilio G. Cota
  2016-04-24 22:56   ` Richard Henderson
  2016-04-24 22:55 ` [Qemu-devel] [PATCH 1/2] translate-all: remove redundant setting of tcg_ctx.code_gen_buffer_size Richard Henderson
  1 sibling, 1 reply; 4+ messages in thread
From: Emilio G. Cota @ 2016-04-22  0:01 UTC (permalink / raw)
  To: QEMU Developers; +Cc: Paolo Bonzini, Peter Crosthwaite, Richard Henderson

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 translate-all.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/translate-all.c b/translate-all.c
index e700399..bba9b62 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -668,39 +668,39 @@ static inline void *alloc_code_gen_buffer(void)
     buf = mmap((void *)start, size + qemu_real_host_page_size,
                PROT_NONE, flags, -1, 0);
     if (buf == MAP_FAILED) {
         return NULL;
     }
 
 #ifdef __mips__
     if (cross_256mb(buf, size)) {
         /* Try again, with the original still mapped, to avoid re-acquiring
            that 256mb crossing.  This time don't specify an address.  */
         size_t size2;
         void *buf2 = mmap(NULL, size + qemu_real_host_page_size,
                           PROT_NONE, flags, -1, 0);
         switch (buf2 != MAP_FAILED) {
         case 1:
             if (!cross_256mb(buf2, size)) {
                 /* Success!  Use the new buffer.  */
-                munmap(buf, size);
+                munmap(buf, size + qemu_real_host_page_size);
                 break;
             }
             /* Failure.  Work with what we had.  */
-            munmap(buf2, size);
+            munmap(buf2, size + qemu_real_host_page_size);
             /* fallthru */
         default:
             /* Split the original buffer.  Free the smaller half.  */
             buf2 = split_cross_256mb(buf, size);
             size2 = tcg_ctx.code_gen_buffer_size;
             if (buf == buf2) {
                 munmap(buf + size2 + qemu_real_host_page_size, size - size2);
             } else {
                 munmap(buf, size - size2);
             }
             size = size2;
             break;
         }
         buf = buf2;
     }
 #endif
 
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH 1/2] translate-all: remove redundant setting of tcg_ctx.code_gen_buffer_size
  2016-04-22  0:01 [Qemu-devel] [PATCH 1/2] translate-all: remove redundant setting of tcg_ctx.code_gen_buffer_size Emilio G. Cota
  2016-04-22  0:01 ` [Qemu-devel] [PATCH 2/2] translate-all: add missing munmap of the code_gen guard page for MIPS Emilio G. Cota
@ 2016-04-24 22:55 ` Richard Henderson
  1 sibling, 0 replies; 4+ messages in thread
From: Richard Henderson @ 2016-04-24 22:55 UTC (permalink / raw)
  To: Emilio G. Cota, QEMU Developers; +Cc: Paolo Bonzini, Peter Crosthwaite

On 04/21/2016 05:01 PM, Emilio G. Cota wrote:
> The setting of tcg_ctx.code_gen_buffer_size is done by the only caller of
> size_code_gen_buffer(), which is code_gen_alloc():
>
>    $ git grep size_code_gen_buffer
>    translate-all.c:static inline size_t size_code_gen_buffer(size_t tb_size)
>    translate-all.c:    tcg_ctx.code_gen_buffer_size = size_code_gen_buffer(tb_size);
>
> Signed-off-by: Emilio G. Cota<cota@braap.org>
> ---
>   translate-all.c | 1 -
>   1 file changed, 1 deletion(-)

Applied to tcg-next.  Thanks.


r~

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH 2/2] translate-all: add missing munmap of the code_gen guard page for MIPS
  2016-04-22  0:01 ` [Qemu-devel] [PATCH 2/2] translate-all: add missing munmap of the code_gen guard page for MIPS Emilio G. Cota
@ 2016-04-24 22:56   ` Richard Henderson
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Henderson @ 2016-04-24 22:56 UTC (permalink / raw)
  To: Emilio G. Cota, QEMU Developers; +Cc: Paolo Bonzini, Peter Crosthwaite

On 04/21/2016 05:01 PM, Emilio G. Cota wrote:
> Signed-off-by: Emilio G. Cota <cota@braap.org>
> ---
>   translate-all.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)


Applied to tcg-next. Thanks.


r~

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-04-24 22:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-22  0:01 [Qemu-devel] [PATCH 1/2] translate-all: remove redundant setting of tcg_ctx.code_gen_buffer_size Emilio G. Cota
2016-04-22  0:01 ` [Qemu-devel] [PATCH 2/2] translate-all: add missing munmap of the code_gen guard page for MIPS Emilio G. Cota
2016-04-24 22:56   ` Richard Henderson
2016-04-24 22:55 ` [Qemu-devel] [PATCH 1/2] translate-all: remove redundant setting of tcg_ctx.code_gen_buffer_size Richard Henderson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.