Received: by 10.192.165.148 with SMTP id m20csp4405867imm; Tue, 8 May 2018 08:00:28 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp8XMTYAePRdi8dbgDTYt5ivl0xCjxG0ojydom8HerqMluOMpCqKNRjprlYIPUiezY02lFu X-Received: by 2002:a17:902:8bc6:: with SMTP id r6-v6mr42262387plo.66.1525791628315; Tue, 08 May 2018 08:00:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525791628; cv=none; d=google.com; s=arc-20160816; b=cjObd1DBPKxCS42q1w85qHdagAl6D/fCCyIrCCbs0seZBTq98odymkCZbYuuubSLTZ /68ygNOSpI7MiPjFplV81tuVbAPgKSE1zloMS/9g3mhMrifBa8JSxPqqRI2CNj1gG75v 61yj0QFAf9sr2lG87Pv92mQPNI98wNWUnQFWrGEh2ZPvBeX9pQSYGZjMdTAqHddjIg3+ HEQZSAFGpOsZfcaihlvxTW4rLscmE/pHywHDxYvAZ0Y10tv1xdmsQNi2D1f+wXn0uTyR J/PP9LLg18zgoaPlh8p7gAEhh5QVXGyxokdHsHbLErymKiQ0RnrKcG+5J/sUAWBsfght Qu0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=v2MGWf8uxmd5gMJ5mIJYz/xcPhGK5NpO4jGqBrA0qMY=; b=PhXYNa4ZD4PyfIItTTyM87VCnhjXMP00CdUfZf7KROcWQQYACw8H5VJjfGt1yx3X2m RN8dHaupSVYDI3o7pUwlffxwm8587TInShI7by0nC2OMlttOuUxtLe9OC8OjW5k1IvpA hbrkOt7CvWqReTJ7ARtkESZBzaCM3wxFuWpvWWaFNgjcBu6QpcM39OzY3EOi3O054AIs W4AI3bDkqHyplQOa66WQhnd1meuY8yYUFYb5VC9SbTymdfqDLloWHSRQRBFmjLVVYZRw 7B+DAx5KgBbt72rLGxaRsQd8OHJz/xK7RvWpoaDdA5kFPNsL+OW+UzSy0QHRyqFp5HNM LsDA== ARC-Authentication-Results: i=1; mx.google.com; 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 a5-v6si26062055pla.117.2018.05.08.08.00.13; Tue, 08 May 2018 08:00:28 -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; 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 S932944AbeEHPAF (ORCPT + 99 others); Tue, 8 May 2018 11:00:05 -0400 Received: from ozlabs.org ([203.11.71.1]:35025 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932861AbeEHPAB (ORCPT ); Tue, 8 May 2018 11:00:01 -0400 Received: by ozlabs.org (Postfix, from userid 1034) id 40gN284wShz9s35; Wed, 9 May 2018 01:00:00 +1000 (AEST) From: Michael Ellerman To: linuxram@us.ibm.com Cc: mingo@redhat.com, linuxppc-dev@ozlabs.org, linux-mm@kvack.org, x86@kernel.org, linux-kernel@vger.kernel.org, dave.hansen@intel.com Subject: [PATCH 6/8] x86/pkeys: Add arch_pkeys_enabled() Date: Wed, 9 May 2018 00:59:46 +1000 Message-Id: <20180508145948.9492-7-mpe@ellerman.id.au> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180508145948.9492-1-mpe@ellerman.id.au> References: <20180508145948.9492-1-mpe@ellerman.id.au> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This will be used in future patches to check for arch support for pkeys in generic code. Signed-off-by: Michael Ellerman --- arch/x86/include/asm/pkeys.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/x86/include/asm/pkeys.h b/arch/x86/include/asm/pkeys.h index 0e5f749158e4..c1957f8f7c1b 100644 --- a/arch/x86/include/asm/pkeys.h +++ b/arch/x86/include/asm/pkeys.h @@ -7,6 +7,11 @@ extern int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, unsigned long init_val); +static inline bool arch_pkeys_enabled(void) +{ + return boot_cpu_has(X86_FEATURE_OSPKE); +} + /* * Try to dedicate one of the protection keys to be used as an * execute-only protection key. -- 2.14.1