From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 193C0C04E53 for ; Wed, 15 May 2019 11:03:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DDD0E216FD for ; Wed, 15 May 2019 11:03:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557918236; bh=oiUT5ZS6U27FNqqPrSA9h65ukXY1C9Ch3R1ybQhtPHk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=x7KMDFby5hH6/nZR8IbEAJhgkxffDQU1Rf6UEQRmfdksy/J3N0gjPgmxHliaJsXaw m1/Obd+36VlpyUBrOzFz3gE7w1/NxrJKHgkk8iz6MhTDEPMeV0tUvcSCgSern2Ht1I rsG7xPGv1OspJr/Ff5rpCDGyIw7DqaQ5mbHTBuec= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728291AbfEOLDz (ORCPT ); Wed, 15 May 2019 07:03:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:33322 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728286AbfEOLDz (ORCPT ); Wed, 15 May 2019 07:03:55 -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 0EB3C21773; Wed, 15 May 2019 11:03:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557918234; bh=oiUT5ZS6U27FNqqPrSA9h65ukXY1C9Ch3R1ybQhtPHk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Res+wUftU4HILrSmfm2i0q8RyNi0MOdxMcKr4nQQLocjkLoYcrQ4f3WKoN5GoSENO 0MXF7b31reZg7ocyl5tV32i9Ek602BkYj4P+LlyJs66QXAm94oaWHJRToHrpNZk60h EREck41KHlCCyTgHqGnJx1kLEmBBjjLAQ8FAN/WU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Ellerman Subject: [PATCH 4.4 055/266] powerpc/powernv: Query firmware for count cache flush settings Date: Wed, 15 May 2019 12:52:42 +0200 Message-Id: <20190515090724.304702616@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090722.696531131@linuxfoundation.org> References: <20190515090722.696531131@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Michael Ellerman commit 99d54754d3d5f896a8f616b0b6520662bc99d66b upstream. Look for fw-features properties to determine the appropriate settings for the count cache flush, and then call the generic powerpc code to set it up based on the security feature flags. Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/platforms/powernv/setup.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/arch/powerpc/platforms/powernv/setup.c +++ b/arch/powerpc/platforms/powernv/setup.c @@ -77,6 +77,12 @@ static void init_fw_feat_flags(struct de if (fw_feature_is("enabled", "fw-count-cache-disabled", np)) security_ftr_set(SEC_FTR_COUNT_CACHE_DISABLED); + if (fw_feature_is("enabled", "fw-count-cache-flush-bcctr2,0,0", np)) + security_ftr_set(SEC_FTR_BCCTR_FLUSH_ASSIST); + + if (fw_feature_is("enabled", "needs-count-cache-flush-on-context-switch", np)) + security_ftr_set(SEC_FTR_FLUSH_COUNT_CACHE); + /* * The features below are enabled by default, so we instead look to see * if firmware has *disabled* them, and clear them if so. @@ -123,6 +129,7 @@ static void pnv_setup_rfi_flush(void) security_ftr_enabled(SEC_FTR_L1D_FLUSH_HV)); setup_rfi_flush(type, enable); + setup_count_cache_flush(); } static void __init pnv_setup_arch(void)