Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2446650yba; Mon, 15 Apr 2019 11:49:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNfPA+r6ZcQ8NRQbA8jpmFhH5iY2jb3+DmkFrIHt4mKpuHibOR0xkr7BvUmigo1unLFKO9 X-Received: by 2002:a63:b811:: with SMTP id p17mr71894295pge.219.1555354148563; Mon, 15 Apr 2019 11:49:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555354148; cv=none; d=google.com; s=arc-20160816; b=HN3HXt7VnhKETbp+DdswzUgwXE3Go8fPXECI1oP9fshZIG395+hb01pB6sVj9GC0SR SFPZYtxVOib0J2mXBcteNr8fhFerN4ybDM3E2fUkRCZ2MQ7qLRS8nPGbqikYutrSbVmN XKLZMqW44KepcWc4CTA8rU33DfZNTSXA6n72F70pibvNnA8iGSuaPoiggDdMwAcFsVMq l+EZAyJ9UQXGgXAaLYpdkLPfEEMGHUYRtZeMZI2iC29AwJuRZbvJhThVbz2zNZNtiSTq GjoLXOlYVvonJ8qMgXsBOEdT6yFLbJSDGnQCKbxf0RLH0mYfcBl+LcK3q6HhiLUv/1Ta WunQ== 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=Ry45+1egyJUt9V/T5WLX5aeKRcYrFrGF9j9UTnYA1g4=; b=yg5ZUEZG+33L85gx+0No2qVjH80g25Oa6Wv0qQPzPaNNQ4HL8DJ6jaIbpvKG9LsjrG zN6G7CxDYyIYSY89shd3iK7VlmkDsPCkBj6LPsDIIEP3BeWhLs5FQ+4kjJAvugHpehg3 m472QDHxVeeKkLOfA4VpA6sF21ZSn87W0wdZjenbtbZEV7bNsFQ+/fvk/cBBnbSrp3Mh cY6uQ9RgAEBer98AnABIHPEPLmEfdZ+XSUDtEEcI8Q5igNhvFMvOdWZ1QQF+pRXqGiBt 15y/0E7gDLQmi9f7qu4zRtizj0AOYP8elZUUMXG+JS3uvBbTKRoEV5yn74CDUsZDAxHH st0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=itTw4g2B; 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 i9si35264785pgk.207.2019.04.15.11.48.52; Mon, 15 Apr 2019 11:49:08 -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=itTw4g2B; 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 S1728646AbfDOSqe (ORCPT + 99 others); Mon, 15 Apr 2019 14:46:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:49256 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728637AbfDOSqd (ORCPT ); Mon, 15 Apr 2019 14:46:33 -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 5C9492073F; Mon, 15 Apr 2019 18:46:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555353992; bh=svgbZyd4KKPtAEu+HzB0yfh9kV61lpOF209ffXUf9Tk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=itTw4g2Bk+xQSb3eqJyqq3+HouVYYia5GqLrU6ybs1IuRsiOZUdZT66IBEtg9xolZ AlIRisyehBPSEmhQOkOejM7prO2Dg+HczWKfTwcvebsQ6grsgERa/uCAXxRcdTjOY9 N3ZYw44Af5d8+kt4UNvRaJ5fFD0XNmEd8Y3mt3ZI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Ellerman , Sasha Levin Subject: [PATCH 4.9 31/76] powerpc/powernv: Query firmware for count cache flush settings Date: Mon, 15 Apr 2019 20:43:55 +0200 Message-Id: <20190415183715.823452676@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190415183707.712011689@linuxfoundation.org> References: <20190415183707.712011689@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 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: Sasha Levin --- arch/powerpc/platforms/powernv/setup.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c index 17203abf38e8..365e2b620201 100644 --- 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 device_node *np) 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) -- 2.19.1