From patchwork Thu Jun 22 16:22:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Herrenschmidt X-Patchwork-Id: 779612 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wtn6g6Jkmz9s9Y for ; Fri, 23 Jun 2017 02:27:23 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3wtn6g5Tj7zDr7B for ; Fri, 23 Jun 2017 02:27:23 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3wtn5J38TfzDr52 for ; Fri, 23 Jun 2017 02:26:12 +1000 (AEST) Received: from pasglop.austin.ibm.com (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id v5MGMaCf024844; Thu, 22 Jun 2017 11:25:35 -0500 From: Benjamin Herrenschmidt To: skiboot@lists.ozlabs.org Date: Thu, 22 Jun 2017 11:22:22 -0500 Message-Id: <20170622162225.26344-21-benh@kernel.crashing.org> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170622162225.26344-1-benh@kernel.crashing.org> References: <20170622162225.26344-1-benh@kernel.crashing.org> Subject: [Skiboot] [PATCH 21/24] Add "cleanup_global_tlb" for P9 and later X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Uses broadcast TLBIE's to cleanup the TLB on all cores and on the nest MMU Signed-off-by: Benjamin Herrenschmidt --- asm/misc.S | 41 +++++++++++++++++++++++++++++++++++++++++ include/skiboot.h | 1 + 2 files changed, 42 insertions(+) diff --git a/asm/misc.S b/asm/misc.S index 4c9eee9..d8745c8 100644 --- a/asm/misc.S +++ b/asm/misc.S @@ -63,3 +63,44 @@ cleanup_local_tlb: bdnz 1b ptesync blr + + .global cleanup_global_tlb +cleanup_global_tlb: + + /* Only supported on P9 for now */ + mfspr %r3,SPR_PVR + srdi %r3,%r3,16 + cmpwi cr0,%r3,PVR_TYPE_P9 + bnelr + + /* Sync out previous updates */ + ptesync + + .machine "power9" + + /* Lead RB with IS=11 */ + li %r3,3 + sldi %r3,%r3,10 + li %r0,0 + + /* Blow up radix partition scoped translations */ + tlbie %r3, %r0 /* rs */, 2 /* ric */, 1 /* prs */, 1 /* r */ + eieio + tlbsync + ptesync + tlbie %r3, %r0 /* rs */, 2 /* ric */, 0 /* prs */, 1 /* r */ + eieio + tlbsync + ptesync + + /* Blow up hash partition scoped translations */ + tlbie %r3, %r0 /* rs */, 2 /* ric */, 1 /* prs */, 0 /* r */ + eieio + tlbsync + ptesync + tlbie %r3, %r0 /* rs */, 2 /* ric */, 0 /* prs */, 0 /* r */ + eieio + tlbsync + ptesync + + blr diff --git a/include/skiboot.h b/include/skiboot.h index 87d8503..1a153b0 100644 --- a/include/skiboot.h +++ b/include/skiboot.h @@ -204,6 +204,7 @@ extern void fast_reboot(void); extern void __noreturn __secondary_cpu_entry(void); extern void __noreturn load_and_boot_kernel(bool is_reboot); extern void cleanup_local_tlb(void); +extern void cleanup_global_tlb(void); extern void init_shared_sprs(void); extern void init_replicated_sprs(void); extern bool start_preload_kernel(void);