|
From: | Richard Henderson |
Subject: | Re: [Qemu-devel] [PATCH v3 42/43] tcg: introduce regions to split code_gen_buffer |
Date: | Wed, 19 Jul 2017 22:04:50 -1000 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 |
On 07/19/2017 05:09 PM, Emilio G. Cota wrote:
+ /* We do not yet support multiple TCG contexts, so use one region for now */ + n_regions = 1; + + /* start on a page-aligned address */ + buf = QEMU_ALIGN_PTR_UP(buf, qemu_real_host_page_size); + g_assert(buf < tcg_init_ctx.code_gen_buffer + size); + + /* discard that initial portion */ + size -= buf - tcg_init_ctx.code_gen_buffer;
It seems pointless wasting most of a page after the prologue when n_regions == 1. We don't really need to start on a page boundary in that case.
+ /* make region_size a multiple of page_size */ + region_size = size / n_regions; + region_size = QEMU_ALIGN_DOWN(region_size, qemu_real_host_page_size);
This division can result in a number of pages at the end of the region being unused. Is it worthwhile freeing them? Or marking them mprotect_none along with the last guard page?
r~
[Prev in Thread] | Current Thread | [Next in Thread] |