Received: from eggs.gnu.org ([2001:4830:134:3::10]:58790) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfi2p-00018d-5O for qemu-devel@nongnu.org; Fri, 02 Sep 2016 02:33:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bfi2j-0002wD-MQ for qemu-devel@nongnu.org; Fri, 02 Sep 2016 02:33:43 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:59695) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfi2j-0002w3-Dj for qemu-devel@nongnu.org; Fri, 02 Sep 2016 02:33:37 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u826MtNb006416 for ; Fri, 2 Sep 2016 02:33:36 -0400 Received: from e23smtp03.au.ibm.com (e23smtp03.au.ibm.com [202.81.31.145]) by mx0a-001b2d01.pphosted.com with ESMTP id 256arcqan4-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 02 Sep 2016 02:33:36 -0400 Received: from localhost by e23smtp03.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 2 Sep 2016 16:33:34 +1000 From: Nikunj A Dadhania Date: Fri, 2 Sep 2016 12:02:56 +0530 In-Reply-To: <1472797976-24210-1-git-send-email-nikunj@linux.vnet.ibm.com> References: <1472797976-24210-1-git-send-email-nikunj@linux.vnet.ibm.com> Message-Id: <1472797976-24210-5-git-send-email-nikunj@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH RFC 4/4] target-ppc: flush tlb from all the cpu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-ppc@nongnu.org, alex.bennee@linaro.org, david@gibson.dropbear.id.au, rth@twiddle.net Cc: qemu-devel@nongnu.org, nikunj@linux.vnet.ibm.com, benh@kernel.crashing.org Signed-off-by: Nikunj A Dadhania --- cputlb.c | 15 +++++++++++++++ include/exec/exec-all.h | 2 ++ target-ppc/mmu-hash64.c | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/cputlb.c b/cputlb.c index 64faf47..17ff58e 100644 --- a/cputlb.c +++ b/cputlb.c @@ -123,6 +123,21 @@ void tlb_flush(CPUState *cpu, int flush_global) } } +static void tlb_flush_all_async_work(CPUState *cpu, void *opaque) +{ + tlb_flush_nocheck(cpu, GPOINTER_TO_INT(opaque)); +} + +void tlb_flush_all(CPUState *cpu, int flush_global) +{ + CPUState *c; + + CPU_FOREACH(c) { + async_run_on_cpu(c, tlb_flush_all_async_work, + GUINT_TO_POINTER(flush_global)); + } +} + static void tlb_flush_by_mmuidx_async_work(CPUState *cpu, void *mmu_bitmask) { CPUArchState *env = cpu->env_ptr; diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index e9f3bcf..55c344b 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -116,6 +116,8 @@ void tlb_flush_page(CPUState *cpu, target_ulong addr); * TLB entries, and the argument is ignored. */ void tlb_flush(CPUState *cpu, int flush_global); +void tlb_flush_all(CPUState *cpu, int flush_global); + /** * tlb_flush_page_by_mmuidx: * @cpu: CPU whose TLB should be flushed diff --git a/target-ppc/mmu-hash64.c b/target-ppc/mmu-hash64.c index 8118143..d852c21 100644 --- a/target-ppc/mmu-hash64.c +++ b/target-ppc/mmu-hash64.c @@ -912,7 +912,7 @@ void ppc_hash64_tlb_flush_hpte(PowerPCCPU *cpu, * invalidate, and we still don't have a tlb_flush_mask(env, n, * mask) in QEMU, we just invalidate all TLBs */ - tlb_flush(CPU(cpu), 1); + tlb_flush_all(CPU(cpu), 1); } void ppc_hash64_update_rmls(CPUPPCState *env) -- 2.7.4