Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2092106ybp; Thu, 10 Oct 2019 02:03:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqxWmkrxdWmtAw67yCw9KNvHDA7bDMI3uZHTXuE6DkIBqX4ljp89b9s11rbsxfT++JNWi+y6 X-Received: by 2002:a17:906:46db:: with SMTP id k27mr7008889ejs.308.1570698199149; Thu, 10 Oct 2019 02:03:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570698199; cv=none; d=google.com; s=arc-20160816; b=w6rRYKwPccutPYxp8XYos3mRq+NlC5mrdI05D89oB0q+9PjN6ff8/dpuAoEejy/Y/+ p/4NSQEzSvlYwyr4onC0Q7Zx/cYf/Zh2yWiKGh5+LT64XeKX+FNMX8kR7vGqD6p8FAJS X57X7bW0U4hFHyL8ZvW0eZBBZHCLIbr2pMi9qymRd4nh4R9rw2QDsna7ZOhtoGxZ3fvz bCQu91pyhEtLNqzbsV0WAXp7yFLKZvGnoLcfI34qP50L57nfTzshvO3hFBxiNKxhkQqW iT/j+XmmzAp+zlVG4WwZBhwyRitkuZPGwD7xI96uwXAQZqU5JqBEOO6L8uqb5PyllvsX gjjQ== 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=5DL4brKNT0HBBhkQwMctJ+hKEafhiu5nThA32bQc6xA=; b=Kz+5j0ebb3cDFo1MdkHf6MDOK3qq5Jp95Q9X7rkxrvprb9EDsUrlpnd/879DVDKvKx 0ey/OVYjbbLDjRoi3a4khkXGdi7WSYOjbUMa8pEbMaXM/6aF+TjH1Za1bvwYgMESyS5Y fHy9ThiUexsSSIeBdKAycJytDljnOj4CAFXdz54LTHJucL5N59kSPIGvKUQD3ILK3T1Q mkWPnLojetJci2UIJLYa3ZHGiOXD43LXI/zWwPezphTXnlBkBqffuEQ4h0kIEwN289Vf kJQRnvxZ+DdDTdZB0fpaMt58cf+vJ0VlU2D/+pgKA8/xtTUaSo5fdkTk0JbUDYeEkp5o Ryzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=b2urd2PK; 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 w14si2815093edx.197.2019.10.10.02.02.55; Thu, 10 Oct 2019 02:03:19 -0700 (PDT) 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=b2urd2PK; 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 S2387815AbfJJIjQ (ORCPT + 99 others); Thu, 10 Oct 2019 04:39:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:42486 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387796AbfJJIjM (ORCPT ); Thu, 10 Oct 2019 04:39:12 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 C957C21920; Thu, 10 Oct 2019 08:39:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570696751; bh=1ubGTSIf4g5yWehZPwsLb5vP6YV0ff65tPT/8BFHHbU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b2urd2PKW193lWRyIMegw+4DaABkcFmjg+df6fFMCuqcNPt7swb2ysPbFjVdSMbTD i/A6jpus30hCRU0GftPoAby49BJHG52sriEut4rTL3dyYP7hIkDgb+AcF1AHl/g7BK SuEfBYZ3q6cWRUmtEUa0z1qn8+A//OXOrbjbmzSk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Aneesh Kumar K.V" , Michael Ellerman Subject: [PATCH 5.3 032/148] powerpc/book3s64/mm: Dont do tlbie fixup for some hardware revisions Date: Thu, 10 Oct 2019 10:34:53 +0200 Message-Id: <20191010083613.087192900@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191010083609.660878383@linuxfoundation.org> References: <20191010083609.660878383@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Aneesh Kumar K.V commit 677733e296b5c7a37c47da391fc70a43dc40bd67 upstream. The store ordering vs tlbie issue mentioned in commit a5d4b5891c2f ("powerpc/mm: Fixup tlbie vs store ordering issue on POWER9") is fixed for Nimbus 2.3 and Cumulus 1.3 revisions. We don't need to apply the fixup if we are running on them We can only do this on PowerNV. On pseries guest with KVM we still don't support redoing the feature fixup after migration. So we should be enabling all the workarounds needed, because whe can possibly migrate between DD 2.3 and DD 2.2 Fixes: a5d4b5891c2f ("powerpc/mm: Fixup tlbie vs store ordering issue on POWER9") Cc: stable@vger.kernel.org # v4.16+ Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20190924035254.24612-1-aneesh.kumar@linux.ibm.com Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/kernel/dt_cpu_ftrs.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) --- a/arch/powerpc/kernel/dt_cpu_ftrs.c +++ b/arch/powerpc/kernel/dt_cpu_ftrs.c @@ -691,9 +691,35 @@ static bool __init cpufeatures_process_f return true; } +/* + * Handle POWER9 broadcast tlbie invalidation issue using + * cpu feature flag. + */ +static __init void update_tlbie_feature_flag(unsigned long pvr) +{ + if (PVR_VER(pvr) == PVR_POWER9) { + /* + * Set the tlbie feature flag for anything below + * Nimbus DD 2.3 and Cumulus DD 1.3 + */ + if ((pvr & 0xe000) == 0) { + /* Nimbus */ + if ((pvr & 0xfff) < 0x203) + cur_cpu_spec->cpu_features |= CPU_FTR_P9_TLBIE_BUG; + } else if ((pvr & 0xc000) == 0) { + /* Cumulus */ + if ((pvr & 0xfff) < 0x103) + cur_cpu_spec->cpu_features |= CPU_FTR_P9_TLBIE_BUG; + } else { + WARN_ONCE(1, "Unknown PVR"); + cur_cpu_spec->cpu_features |= CPU_FTR_P9_TLBIE_BUG; + } + } +} + static __init void cpufeatures_cpu_quirks(void) { - int version = mfspr(SPRN_PVR); + unsigned long version = mfspr(SPRN_PVR); /* * Not all quirks can be derived from the cpufeatures device tree. @@ -712,10 +738,10 @@ static __init void cpufeatures_cpu_quirk if ((version & 0xffff0000) == 0x004e0000) { cur_cpu_spec->cpu_features &= ~(CPU_FTR_DAWR); - cur_cpu_spec->cpu_features |= CPU_FTR_P9_TLBIE_BUG; cur_cpu_spec->cpu_features |= CPU_FTR_P9_TIDR; } + update_tlbie_feature_flag(version); /* * PKEY was not in the initial base or feature node * specification, but it should become optional in the next