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=unavailable 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 7CE8AC43381 for ; Mon, 1 Apr 2019 17:56:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 447122084B for ; Mon, 1 Apr 2019 17:56:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554141373; bh=jlrBK+Pue9ERHn9s0J/+tQCvb8N+1nBSZTZtba+auKw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=KWmKvcbkUgiJzme46s/48u4BjwbGpQirg6YPQLqCeIKrZAppMYKTR3zICoU52t5P3 VgmzPyFEJV8hOac3JBpapFBg8Dntbvphd38ApbdTjCKaUPxUAcY2rZdkqSWu10tidN cn9zW/Ay0fnwfEubWGaojZSQb2q1e+nO3+9NemKk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731248AbfDARV6 (ORCPT ); Mon, 1 Apr 2019 13:21:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:50908 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731197AbfDARV5 (ORCPT ); Mon, 1 Apr 2019 13:21:57 -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 8193D206C0; Mon, 1 Apr 2019 17:21:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554139317; bh=jlrBK+Pue9ERHn9s0J/+tQCvb8N+1nBSZTZtba+auKw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tzZnziZ4ae2c9A+j8anKecBPpxp3E1c2jwuBl0SbZXIOPjozMhVrk+XP9jPQv9VEJ XLklXcnCubHpyiRlPx8pCEomDLAiwXQv2eSvoo7F7I1sceIphvtFZTfry0qLti/hDE sKQMtbNpq2fg0ArvvmxJjc4zd3EJuFDoiRkQ9NsA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Ellerman Subject: [PATCH 4.14 039/107] powerpc/64s: Add new security feature flags for count cache flush Date: Mon, 1 Apr 2019 19:01:54 +0200 Message-Id: <20190401170049.185070236@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190401170045.246405031@linuxfoundation.org> References: <20190401170045.246405031@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michael Ellerman commit dc8c6cce9a26a51fc19961accb978217a3ba8c75 upstream. Add security feature flags to indicate the need for software to flush the count cache on context switch, and for the presence of a hardware assisted count cache flush. Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/include/asm/security_features.h | 6 ++++++ 1 file changed, 6 insertions(+) --- a/arch/powerpc/include/asm/security_features.h +++ b/arch/powerpc/include/asm/security_features.h @@ -59,6 +59,9 @@ static inline bool security_ftr_enabled( // Indirect branch prediction cache disabled #define SEC_FTR_COUNT_CACHE_DISABLED 0x0000000000000020ull +// bcctr 2,0,0 triggers a hardware assisted count cache flush +#define SEC_FTR_BCCTR_FLUSH_ASSIST 0x0000000000000800ull + // Features indicating need for Spectre/Meltdown mitigations @@ -74,6 +77,9 @@ static inline bool security_ftr_enabled( // Firmware configuration indicates user favours security over performance #define SEC_FTR_FAVOUR_SECURITY 0x0000000000000200ull +// Software required to flush count cache on context switch +#define SEC_FTR_FLUSH_COUNT_CACHE 0x0000000000000400ull + // Features enabled by default #define SEC_FTR_DEFAULT \