From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60175) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNQFp-0001fO-7L for qemu-devel@nongnu.org; Mon, 16 Feb 2015 13:18:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNQFg-0001Qi-3w for qemu-devel@nongnu.org; Mon, 16 Feb 2015 13:18:45 -0500 Received: from mail-wg0-x236.google.com ([2a00:1450:400c:c00::236]:53642) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNQFf-0001QY-TH for qemu-devel@nongnu.org; Mon, 16 Feb 2015 13:18:36 -0500 Received: by mail-wg0-f54.google.com with SMTP id y19so30745448wgg.13 for ; Mon, 16 Feb 2015 10:18:35 -0800 (PST) Received: from playground.station (net-93-66-73-217.cust.vodafonedsl.it. [93.66.73.217]) by mx.google.com with ESMTPSA id p6sm20746248wia.14.2015.02.16.10.18.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Feb 2015 10:18:34 -0800 (PST) Sender: Paolo Bonzini From: Paolo Bonzini Date: Mon, 16 Feb 2015 19:17:54 +0100 Message-Id: <1424110682-14334-14-git-send-email-pbonzini@redhat.com> In-Reply-To: <1424110682-14334-1-git-send-email-pbonzini@redhat.com> References: <1424110682-14334-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 13/21] exec: introduce cpu_reload_memory_map List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This for now is a simple TLB flush. This can change later for two reasons: 1) an AddressSpaceDispatch will be cached in the CPUState object 2) it will not be possible to do tlb_flush once the TCG-generated code runs outside the BQL. Reviewed-by: Fam Zheng Signed-off-by: Paolo Bonzini --- cpu-exec.c | 6 ++++++ exec.c | 2 +- include/exec/exec-all.h | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cpu-exec.c b/cpu-exec.c index fa506e6..78fe382 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -141,6 +141,12 @@ void cpu_resume_from_signal(CPUState *cpu, void *puc) cpu->exception_index = -1; siglongjmp(cpu->jmp_env, 1); } + +void cpu_reload_memory_map(CPUState *cpu) +{ + /* The TLB is protected by the iothread lock. */ + tlb_flush(cpu, 1); +} #endif /* Execute a TB, and fix up the CPU state afterwards if necessary */ diff --git a/exec.c b/exec.c index 6dff7bc..2bfb4d3 100644 --- a/exec.c +++ b/exec.c @@ -2026,7 +2026,7 @@ static void tcg_commit(MemoryListener *listener) if (cpu->tcg_as_listener != listener) { continue; } - tlb_flush(cpu, 1); + cpu_reload_memory_map(cpu); } } diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 6a15448..1b30813 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -96,6 +96,7 @@ void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t end, void tb_invalidate_phys_range(tb_page_addr_t start, tb_page_addr_t end, int is_cpu_write_access); #if !defined(CONFIG_USER_ONLY) +void cpu_reload_memory_map(CPUState *cpu); void tcg_cpu_address_space_init(CPUState *cpu, AddressSpace *as); /* cputlb.c */ void tlb_flush_page(CPUState *cpu, target_ulong addr); -- 2.3.0