From patchwork Sun Jul 16 03:56:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ram Pai X-Patchwork-Id: 789031 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3x9Dsw3R0Xz9s4s for ; Sun, 16 Jul 2017 15:06:28 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pqK3rc1f"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3x9Dsw1sw5zDqmc for ; Sun, 16 Jul 2017 15:06:28 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pqK3rc1f"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-qk0-x241.google.com (mail-qk0-x241.google.com [IPv6:2607:f8b0:400d:c09::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3x9CNh2PP4zDqmB for ; Sun, 16 Jul 2017 13:59:32 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pqK3rc1f"; dkim-atps=neutral Received: by mail-qk0-x241.google.com with SMTP id q66so17064390qki.1 for ; Sat, 15 Jul 2017 20:59:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=7mPrE5GeYOfnVXzt3CyjvVkYDiXe5FZ26yZ/yzZFbX4=; b=pqK3rc1fmM9rXNlVG3vU7RgGXriiOcD8GNWtLneWsahEro2mToai2zktQn80Gp5Suw w+a0/EHmMShVN5wbIetLtJCdwa4GqB02Yoe7grMi+YxiFxW4fYh/Jr/QVJyDVo+vm438 hBp+mmfeXoyv0dbIoYl+nwshiDWrXeu8Rbhg+FxQKAyITuPT5wnPUq7N/hcMdKq8iRIU nsFyGoLebNyaw4LxlgvZYRdZ5zw/sYS8Bp83b8g30Srybho34xO3usl0/XFfSIHpZksz kRiE+YXGrUnAxB/w/w9oBrlqv7dzHxf9AcorwjE9jhbQJcfUAjOAFRTUf//d+b7TXkr+ 2cUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=7mPrE5GeYOfnVXzt3CyjvVkYDiXe5FZ26yZ/yzZFbX4=; b=XT2KBEcZwejCB34yiWmq3R2flyKa3A7X16BCc9lGjmcTB9yV3bOuSUsKeSNmGHS0kZ M87SO8ZAZfBLHFXKq6EV+UGDWY85C2HbRk+kb87i8unHgsE7Ioo79U23URyNTyA+/qv0 YRvmnFLXOxsJ3ydJ8P40N4pVyIGA86tqYXA4IyTE6dWHMiq1A6/Bui0d8oFQJkKUDcfy VYuZWN0NegszqRJ06t729WfZT+W5rAwk+6yRfYkuJXqf6w0jNpfHEwiqwq1hXt/TzBmL qS52ZY5PdBNkzdShBEDoYVKTKVmwu1zf26qX/yJJmtYRnF4ppBExqhOIw1kieZ0NwQ12 7xaQ== X-Gm-Message-State: AIVw110cbYIMZ0+NdWmdyiCrY6KWgcVgfk8dmkNO4yLeuFXOuOQ6J8n/ k7fPxYbACiTswfcOW3U= X-Received: by 10.55.82.3 with SMTP id g3mr949521qkb.23.1500177570379; Sat, 15 Jul 2017 20:59:30 -0700 (PDT) Received: from localhost.localdomain (50-39-103-96.bvtn.or.frontiernet.net. [50.39.103.96]) by smtp.gmail.com with ESMTPSA id q46sm2290345qtc.54.2017.07.15.20.59.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 15 Jul 2017 20:59:29 -0700 (PDT) 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 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> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: arnd@arndb.de, corbet@lwn.net, linuxram@us.ibm.com, mhocko@kernel.org, dave.hansen@intel.com, mingo@redhat.com, paulus@samba.org, aneesh.kumar@linux.vnet.ibm.com, akpm@linux-foundation.org, khandual@linux.vnet.ibm.com Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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) { }