From patchwork Fri Jul 7 21:08:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Herrenschmidt X-Patchwork-Id: 785769 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 3x46hC6DJzz9s83 for ; Sat, 8 Jul 2017 07:10:19 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3x46hC5NjtzDr9d for ; Sat, 8 Jul 2017 07:10:19 +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 3x46gF5Df9zDr94 for ; Sat, 8 Jul 2017 07:09:29 +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 v67L8efO002710; Fri, 7 Jul 2017 16:08:44 -0500 From: Benjamin Herrenschmidt To: skiboot@lists.ozlabs.org Date: Fri, 7 Jul 2017 16:08:40 -0500 Message-Id: <20170707210846.24825-3-benh@kernel.crashing.org> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170707210846.24825-1-benh@kernel.crashing.org> References: <20170707210846.24825-1-benh@kernel.crashing.org> Subject: [Skiboot] [PATCH 3/9] cpu: Unconditionally cleanup TLBs on P9 in opal_reinit_cpus() 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" This can work around problems where Linux fails to properly cleanup part or all of the TLB on kexec. Signed-off-by: Benjamin Herrenschmidt --- core/cpu.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/core/cpu.c b/core/cpu.c index a0c395f..6c00bca 100644 --- a/core/cpu.c +++ b/core/cpu.c @@ -1191,12 +1191,21 @@ static int64_t opal_reinit_cpus(uint64_t flags) else req.clr_bits |= SPR_HID0_POWER9_RADIX; - cleanup_global_tlb(); current_radix_mode = radix; } } - /* Apply HID bits changes if any */ + /* Cleanup the TLB. We do that unconditionally, this works + * around issues where OSes fail to invalidate the PWC in Radix + * mode for example. This only works on P9 and later, but we + * also know we don't have a problem with Linux cleanups on + * P8 so this isn't a problem. If we wanted to cleanup the + * TLB on P8 as well, we'd have to use jobs to do it locally + * on each CPU. + */ + cleanup_global_tlb(); + + /* Apply HID bits changes if any */ if (req.set_bits || req.clr_bits) cpu_change_all_hid0(&req);