|
| From: | Richard Henderson |
| Subject: | Re: [PATCH for-7.2 14/21] accel/tcg: Hoist get_page_addr_code out of tb_lookup |
| Date: | Wed, 17 Aug 2022 08:42:09 -0500 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 |
On 8/17/22 06:08, Ilya Leoshkevich wrote:
+static void cpu_tb_jmp_cache_remove(TranslationBlock *tb)
+{
+ CPUState *cpu;
+ uint32_t h;
+
+ /* remove the TB from the hash list */
+ if (TARGET_TB_PCREL) {
+ /* Any TB may be at any virtual address */
+ CPU_FOREACH(cpu) {
+ cpu_tb_jmp_cache_clear(cpu);
+ }
This comment is not currently true for user-only. Although there's an outstanding bug report about our failure to manage virtual aliasing in user-only...
+ PAGE_FOR_EACH_TB(p, tb, n) {
+ cpu_tb_jmp_cache_remove(tb);
+ }
You wouldn't want to call cpu_tb_jmp_cache_clear() 99 times for the 99 tb's on the page.For user-only, I think mprotect is rare enough that just clearing the whole cache once is sufficient.
r~
| [Prev in Thread] | Current Thread | [Next in Thread] |