Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3470910imu; Sun, 11 Nov 2018 15:51:55 -0800 (PST) X-Google-Smtp-Source: AJdET5eQ+dGOlNEthSxpF7tYDbPGUgDJqUToa+oQwBYSbC3ZhpnFvaD6K7jV8FrnKXNOf1SejsQD X-Received: by 2002:a63:9306:: with SMTP id b6mr14930011pge.36.1541980315348; Sun, 11 Nov 2018 15:51:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541980315; cv=none; d=google.com; s=arc-20160816; b=A23HBqGVR6geFs3zi9KyTJdoVxnJ59Wgm0gL7B+3u+3k9zQhvOZs56w1dntijkTIBM T38TyeY6a5xFncUu8g+iKJXXOBr23DjVT34EH37StAzQmyd5cET6BTLFY/p1Kk9NyoQk pUQRYOGAomUuH22DZOOUUA9moIi+DkQph5dkD21xwA/bG9kRoE1Hec4KassW6AUjHhWY ajMw78TbjQpLqijm3kLJRtA2E/xxWt47/s+JSwPgfan477WdZutinlYrCLlPjLI7cSnB U5cTq7zyrcZIBdXbRAbElwHk5g73bJKujgRoe+bbHmomXXb2FcTGv81Yz07Yddv4amOv 370A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=oUeJDTuffx521fm7ktDX9i2k0vl8ahF6VfubhhosxJ4=; b=RPgCs7pkBDGzecJUBPxFTRAlu8hTZPAZtq5ypc/wDCqxgvs7DH+H9ojF1k3+ufTy7f rqK92aGLAMZqazMoCz/s8ssnrXqGs8cluxtQfluyiDgx8jkZhET1Kwkli6KQETH6jlFi 2fAmf7PGylTLC76Uu6tpg0l0D8aC6Lo/SF+czTauIB16xt406iWrtawt+rXJiPJSQIIS OHThtOfaWF/eWpKycGTuQ4oh9pYC8lWXxAOlz1cgBFip3vd9WQD1Ky4C9knWTXQ1LDE9 GiEkyY8YUQwDRLOisNEVzNLqWQUWAl1WdLQXC9gYZEgMYdzxYfCw91E+3Po+928Je+c1 xqvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aBgphLud; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p189-v6si16065001pfg.235.2018.11.11.15.51.40; Sun, 11 Nov 2018 15:51:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aBgphLud; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732899AbeKLISc (ORCPT + 99 others); Mon, 12 Nov 2018 03:18:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:37584 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732848AbeKLISa (ORCPT ); Mon, 12 Nov 2018 03:18:30 -0500 Received: from localhost (unknown [206.108.79.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9A34C2175B; Sun, 11 Nov 2018 22:28:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975314; bh=sK96i5YP9udCKP0ERLW/GwVrs+XGEA94k1LI65yRJx4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aBgphLud0ufD6W6H1tJAd/jZJakx1vogddbJFpqSURLubA5BAb1sOizhJFGD/eKoy vUFrwe4OzcKZu/Ysz2K4+ijlrSiFiKdTghTfsjQIb6gPb13AGdhBcGsulBRAZ4gx+d mgaKI6eLpHpD2VfqCsQq2Du42aWa1tVZ5H9XCcfw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicholas Piggin , Michael Ellerman Subject: [PATCH 4.19 283/361] powerpc/64s/hash: Do not use PPC_INVALIDATE_ERAT on CPUs before POWER9 Date: Sun, 11 Nov 2018 14:20:30 -0800 Message-Id: <20181111221656.049774374@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Nicholas Piggin commit bc276ecba132caccb1fda5863a652c15def2b8c6 upstream. PPC_INVALIDATE_ERAT is slbia IH=7 which is a new variant introduced with POWER9, and the result is undefined on earlier CPUs. Commits 7b9f71f974 ("powerpc/64s: POWER9 machine check handler") and d4748276ae ("powerpc/64s: Improve local TLB flush for boot and MCE on POWER9") caused POWER7/8 code to use this instruction. Remove it. An ERAT flush can be made by invalidatig the SLB, but before POWER9 that requires a flush and rebolt. Fixes: 7b9f71f974 ("powerpc/64s: POWER9 machine check handler") Fixes: d4748276ae ("powerpc/64s: Improve local TLB flush for boot and MCE on POWER9") Cc: stable@vger.kernel.org # v4.11+ Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/kernel/mce_power.c | 7 +++++++ arch/powerpc/mm/hash_native_64.c | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) --- a/arch/powerpc/kernel/mce_power.c +++ b/arch/powerpc/kernel/mce_power.c @@ -89,6 +89,13 @@ static void flush_and_reload_slb(void) static void flush_erat(void) { +#ifdef CONFIG_PPC_BOOK3S_64 + if (!early_cpu_has_feature(CPU_FTR_ARCH_300)) { + flush_and_reload_slb(); + return; + } +#endif + /* PPC_INVALIDATE_ERAT can only be used on ISA v3 and newer */ asm volatile(PPC_INVALIDATE_ERAT : : :"memory"); } --- a/arch/powerpc/mm/hash_native_64.c +++ b/arch/powerpc/mm/hash_native_64.c @@ -115,6 +115,8 @@ static void tlbiel_all_isa300(unsigned i tlbiel_hash_set_isa300(0, is, 0, 2, 1); asm volatile("ptesync": : :"memory"); + + asm volatile(PPC_INVALIDATE_ERAT "; isync" : : :"memory"); } void hash__tlbiel_all(unsigned int action) @@ -140,8 +142,6 @@ void hash__tlbiel_all(unsigned int actio tlbiel_all_isa206(POWER7_TLB_SETS, is); else WARN(1, "%s called on pre-POWER7 CPU\n", __func__); - - asm volatile(PPC_INVALIDATE_ERAT "; isync" : : :"memory"); } static inline unsigned long ___tlbie(unsigned long vpn, int psize,