Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2445773yba; Mon, 15 Apr 2019 11:47:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxyxGfITHOhP8p4sypdbUaeve1gfR0HXrxah5MEM/hJZkel6lKkTj7sF8k1WI3ZnGSc3yZQ X-Received: by 2002:a65:6201:: with SMTP id d1mr69108712pgv.28.1555354074760; Mon, 15 Apr 2019 11:47:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555354074; cv=none; d=google.com; s=arc-20160816; b=et58zvgpdVDST6pZrTBsm9XrJNU6SyyZAz05qdrwOmQdjohxvXZ4fXCjJy3n1VF+mF 85P8J5+RBtN71/YjjK5dguWvmUeMSTlN6DOkCVtthG1UGG2GCzJtFuXTOH3wKB3xUJda WQlRZA2LBL6DB7/8vKz+vBFEt4Vf1BsgdfsQGZ1Hmu23xm0X9ZyQZeZeqsZYjcoPMDqZ LihJbR0Pxhr5kDOf/mZMphsTtDlk+Dc8n+YwYla1RCFDklD0nwACYuUUyfAnsZ8JLByX Pg+xfsGn5VaU1F4B+4o4Uu+YCjGCLaDdIG6wXfKpaWFYaO4rL0oTaFA+Ggx+cK08b3QB c4mA== 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=jBm+tG33DNXVYF0kl8usWegMgs15czTFNhbYJS9jTik=; b=TG31D6vp4yl65pfAXTlsyCeM7wckIS9TOYnCR1ZtRWLhiPbI4XtP17TNOVjyDABJRI UH1wOmM3bEDEISNMEly8Hd4Bk1p4UepVWE89hztj0Wx4dWLsRJlSkXmvIGc+ENjdr4Hq lvJdoGfkAiR/axUEs2hoagbczGw+fiRbPNtG7Xsdkk7/Z634PkLYqlEvSAOa2C6dTiwD PhxVWDDW+d7BsbA8CYfda/vSqYURAyXEEsO3i2svS/4/vNu66dvwykdKIhEsI/eEDbur kPwyHMRxSmIwGxX8lfUQVH5YkPTubo9d3p8g8QEbCFUCYOj89wYFh4jh/K4esIei+Onu DS0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=x3aHBzkd; 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 w4si43525132pga.39.2019.04.15.11.47.38; Mon, 15 Apr 2019 11:47:54 -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=x3aHBzkd; 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 S1728608AbfDOSq1 (ORCPT + 99 others); Mon, 15 Apr 2019 14:46:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:49144 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728589AbfDOSqZ (ORCPT ); Mon, 15 Apr 2019 14:46:25 -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 7179D2073F; Mon, 15 Apr 2019 18:46:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555353985; bh=Eb4rEwUZ6RXNtzNjbG+XVZsj6T3Gm4TRFGCWKXhEZf4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x3aHBzkdIUyN5Qem/mhT780VhJAHNzBPpsMK+kFSq+G5RJcCy6pUU+w0DyfpXrRYU tn0qlpyE12fPz4LpqOorxsdRIzbFrpaIPe/wn8emiiVgW8zeDxQP0J9fqZja1/MREh fZvb+VlAVEPuhmd1Fgl4WdOZw7KVK7pOPaUu4Pqc= 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 28/76] powerpc/64s: Add new security feature flags for count cache flush Date: Mon, 15 Apr 2019 20:43:52 +0200 Message-Id: <20190415183715.164988720@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 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: Sasha Levin --- arch/powerpc/include/asm/security_features.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/powerpc/include/asm/security_features.h b/arch/powerpc/include/asm/security_features.h index 44989b22383c..a0d47bc18a5c 100644 --- 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(unsigned long feature) // 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(unsigned long feature) // 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 \ -- 2.19.1