From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45527) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDTZ8-0004x8-UC for qemu-devel@nongnu.org; Fri, 10 Jul 2015 04:21:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZDTZ4-0001Rl-J6 for qemu-devel@nongnu.org; Fri, 10 Jul 2015 04:21:50 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:34503) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDTZ4-0001Rf-Di for qemu-devel@nongnu.org; Fri, 10 Jul 2015 04:21:46 -0400 Received: by wifm2 with SMTP id m2so39493395wif.1 for ; Fri, 10 Jul 2015 01:21:46 -0700 (PDT) From: Alvise Rigo Date: Fri, 10 Jul 2015 10:23:43 +0200 Message-Id: <1436516626-8322-11-git-send-email-a.rigo@virtualopensystems.com> In-Reply-To: <1436516626-8322-1-git-send-email-a.rigo@virtualopensystems.com> References: <1436516626-8322-1-git-send-email-a.rigo@virtualopensystems.com> Subject: [Qemu-devel] [RFC v3 10/13] Simple TLB flush wrap to use as exit callback List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, mttcg@listserver.greensocs.com Cc: alex.bennee@linaro.org, jani.kokkonen@huawei.com, tech@virtualopensystems.com, claudio.fontana@huawei.com, pbonzini@redhat.com Add a new way to query a TLB flush request for a given vCPU using the new callback support. Suggested-by: Jani Kokkonen Suggested-by: Claudio Fontana Signed-off-by: Alvise Rigo --- cputlb.c | 6 ++++++ include/qom/cpu.h | 1 + 2 files changed, 7 insertions(+) diff --git a/cputlb.c b/cputlb.c index fa38714..9794e6b 100644 --- a/cputlb.c +++ b/cputlb.c @@ -85,6 +85,12 @@ static void tlb_flush_async_work(void *opaque) g_free(params); } +static void cpu_exit_tlb_flush_all_cb(CPUState *cpu, void *opaque) +{ + tlb_flush(cpu, 1); + cpu->pending_tlb_flush = 0; +} + void tlb_flush_all(int flush_global) { CPUState *cpu; diff --git a/include/qom/cpu.h b/include/qom/cpu.h index 0ec020b..c5b93c9 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -326,6 +326,7 @@ struct CPUState { /* One-shot callbacks for stopping requests. */ struct CPUExitCBs exit_cbs; volatile int pending_rdv; + volatile int pending_tlb_flush; /* In order to avoid passing too many arguments to the MMIO helpers, * we store some rarely used information in the CPU context. -- 2.4.5