Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752331AbdGPD7k (ORCPT ); Sat, 15 Jul 2017 23:59:40 -0400 Received: from mail-qk0-f195.google.com ([209.85.220.195]:34447 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752200AbdGPD7b (ORCPT ); Sat, 15 Jul 2017 23:59:31 -0400 From: Ram Pai To: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au, khandual@linux.vnet.ibm.com, aneesh.kumar@linux.vnet.ibm.com, bsingharora@gmail.com, dave.hansen@intel.com, hbabu@us.ibm.com, linuxram@us.ibm.com, arnd@arndb.de, akpm@linux-foundation.org, corbet@lwn.net, mingo@redhat.com, mhocko@kernel.org Subject: [RFC v6 36/62] mm: introduce arch_pkeys_enabled() Date: Sat, 15 Jul 2017 20:56:38 -0700 Message-Id: <1500177424-13695-37-git-send-email-linuxram@us.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1500177424-13695-1-git-send-email-linuxram@us.ibm.com> References: <1500177424-13695-1-git-send-email-linuxram@us.ibm.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 768 Lines: 31 Only the architecture knows if it supports protection keys. Hence introducing arch_pkeys_enabled(). This function is needed by arch neutral code. One use case is -- to determine if the protection key needs to be displayed in smaps. Signed-off-by: Ram Pai --- include/linux/pkeys.h | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/include/linux/pkeys.h b/include/linux/pkeys.h index a1bacf1..d120810 100644 --- a/include/linux/pkeys.h +++ b/include/linux/pkeys.h @@ -34,6 +34,11 @@ static inline int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, return 0; } +static inline bool arch_pkeys_enabled(void) +{ + return false; +} + static inline void copy_init_pkru_to_fpregs(void) { } -- 1.7.1