Received: by 10.223.164.200 with SMTP id h8csp920479wrb; Mon, 6 Nov 2017 00:59:33 -0800 (PST) X-Google-Smtp-Source: ABhQp+QpcDhl+UDErZYIq+RG+cozAyJCEAyr75pSkj6VV0f6YMLDKjMOpTqskzPNuiRB7y7UT/hr X-Received: by 10.84.230.135 with SMTP id e7mr13626841plk.299.1509958772953; Mon, 06 Nov 2017 00:59:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1509958772; cv=none; d=google.com; s=arc-20160816; b=EpB0mp39RFEwCPUE1B42Znmd1/ooGw2+iCZ1z+tud4kGuTF0KvxSmSqkUBizv+Blzw vHA2zypsnEIGiQ95kC0cCi1QW41SkH1bHVZrHsS+gsus1ts+zXYLaxzjMfPpAbnFS24l Bss8DGlZz1SND4QpTwZZ2IgsuTIH212sRwvpDn/PogSWxItzz7doSLJxQ+O5wMIIf/9O 5SyGpZMAQBJgzukPQpNYLsNVd4Z4ik4O1OiR4x6ffbV/yMCCd4QwLMVa+Bb3hwxihawz 9u+ee1f3DMEnJHPO8mVV7zPOMiFjZHqAwKiEcUk2+DWJBI1fGeB6ZJlmR5GywBHyMizO /rmg== 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:dkim-signature:arc-authentication-results; bh=FCpwuck0jBmHoJv18i4RCvnY3/PWQGupiVA283zg7aI=; b=bxupqsBO8J/aO6LWIJg1MlNWZpqmwfHUc7NRVk9rzQko4r7jICJqxgZ8QSItFUE5tf xLRUYfkc3a4xU3OazF6PbAwEHmBK9GnPUbeuapIefs8D9CTg3NP90gzCa0GWtQsyuaWV +kch3MGXvveCAHdMZFSBCMB9LLBuS/D0VkDGms/tygexV6uoQjrfd52yN5/voeJevW/r 5ymCbgCBEWbHfq6autyQlTVOG8FS0I458k8Do8PF/0+ulSvx6aa/6ij2OLxD2l0fegt8 pPFl56FcBx4/l5xtqFrUTgGjtgmhDO5FPD1FHtfwwBZzLgcqTn80fDcBrYkrMWEwZgk1 XnMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=lqkfpTj1; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x6si10933489pgt.77.2017.11.06.00.59.18; Mon, 06 Nov 2017 00:59:32 -0800 (PST) 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=fail header.i=@gmail.com header.s=20161025 header.b=lqkfpTj1; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752085AbdKFI6a (ORCPT + 98 others); Mon, 6 Nov 2017 03:58:30 -0500 Received: from mail-qk0-f194.google.com ([209.85.220.194]:44599 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752001AbdKFI6Y (ORCPT ); Mon, 6 Nov 2017 03:58:24 -0500 Received: by mail-qk0-f194.google.com with SMTP id v137so312160qkb.1; Mon, 06 Nov 2017 00:58:23 -0800 (PST) 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=FCpwuck0jBmHoJv18i4RCvnY3/PWQGupiVA283zg7aI=; b=lqkfpTj1+NFs0Z89uGRfDX9wleFUsfMOJOMklYLc22QZhUpMYYRPpNkwL8HQ+D2W7p 0iVR50EPHQBY20lqSlD3tbr5IHcFfnsVDcL4PHghXGwn1mW57sjcjA2vWx38f/H3F2f5 QLTVp773kbRy7A4GjDF5mGevsWbral4NoQLEQJ1/9FL/oBmPMfgr4nl/XbOETOziTwsD n7evxIr1TPGWpKDwT3DlQAdS1GVCfpMHDhlB/kQeYBN7YL1oKab93RuX7wiphn3T28Y/ 4WRmjv5sXaiDWWGeaCVsFEfRpvOeohZYjX/5rB0pn/Z91oh4eDolGw1l1nZzHAfp/paw LFMA== 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=FCpwuck0jBmHoJv18i4RCvnY3/PWQGupiVA283zg7aI=; b=K/MugCpkDgj+uIQ4MOixGlFb4nms8VmmJGe0bNBZXXREG3RyDiUe2CNLPIdJYwJuIV 7ctaa1YMT06B5cPcZxsJGzz0iG14Iekf4jSHBpJb2GYd95nhVo2BKF5UbRDMyBlQyvgL la6KRS5klWKoiMw6gAZIqJOWqoSYCqexUWNSXGW+SFfW4srbHoKAt++yM3R7ngvELhrn I66Vi0+sKaCJI1WwnCznsVJXQ/gaPQ9eloHrsz2NaqX7U+cEU1WQ7vSo5G8rb1VB8axA LkWJtWm85TLMk3DEUkBp1T+Nj+IYM8tuXgGVeQdF7c49+VbtA3AZojyOyqJ+loS5tt16 ZSeQ== X-Gm-Message-State: AJaThX5yvrZ8B3eCLNIeDPsffRLAqWNYjaMiOreT55oQLOV2200qoRv4 Ke3kdq/IXJbs9WUNoB/Qm8c= X-Received: by 10.55.21.102 with SMTP id f99mr6401612qkh.58.1509958703465; Mon, 06 Nov 2017 00:58:23 -0800 (PST) Received: from localhost.localdomain (50-39-103-96.bvtn.or.frontiernet.net. [50.39.103.96]) by smtp.gmail.com with ESMTPSA id r26sm8001094qki.42.2017.11.06.00.58.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Nov 2017 00:58:23 -0800 (PST) From: Ram Pai To: mpe@ellerman.id.au, mingo@redhat.com, akpm@linux-foundation.org, corbet@lwn.net, arnd@arndb.de Cc: linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, x86@kernel.org, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, dave.hansen@intel.com, benh@kernel.crashing.org, paulus@samba.org, khandual@linux.vnet.ibm.com, aneesh.kumar@linux.vnet.ibm.com, bsingharora@gmail.com, hbabu@us.ibm.com, mhocko@kernel.org, bauerman@linux.vnet.ibm.com, ebiederm@xmission.com, linuxram@us.ibm.com Subject: [PATCH v9 01/51] mm, powerpc, x86: define VM_PKEY_BITx bits if CONFIG_ARCH_HAS_PKEYS is enabled Date: Mon, 6 Nov 2017 00:56:53 -0800 Message-Id: <1509958663-18737-2-git-send-email-linuxram@us.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1509958663-18737-1-git-send-email-linuxram@us.ibm.com> References: <1509958663-18737-1-git-send-email-linuxram@us.ibm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org VM_PKEY_BITx are defined only if CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS is enabled. Powerpc also needs these bits. Hence lets define the VM_PKEY_BITx bits for any architecture that enables CONFIG_ARCH_HAS_PKEYS. Signed-off-by: Ram Pai --- fs/proc/task_mmu.c | 4 ++-- include/linux/mm.h | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 6744bd7..677866e 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -677,13 +677,13 @@ static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma) [ilog2(VM_MERGEABLE)] = "mg", [ilog2(VM_UFFD_MISSING)]= "um", [ilog2(VM_UFFD_WP)] = "uw", -#ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS +#ifdef CONFIG_ARCH_HAS_PKEYS /* These come out via ProtectionKey: */ [ilog2(VM_PKEY_BIT0)] = "", [ilog2(VM_PKEY_BIT1)] = "", [ilog2(VM_PKEY_BIT2)] = "", [ilog2(VM_PKEY_BIT3)] = "", -#endif +#endif /* CONFIG_ARCH_HAS_PKEYS */ }; size_t i; diff --git a/include/linux/mm.h b/include/linux/mm.h index 43edf65..2c5ea48 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -218,15 +218,16 @@ extern int overcommit_kbytes_handler(struct ctl_table *, int, void __user *, #define VM_HIGH_ARCH_4 BIT(VM_HIGH_ARCH_BIT_4) #endif /* CONFIG_ARCH_USES_HIGH_VMA_FLAGS */ -#if defined(CONFIG_X86) -# define VM_PAT VM_ARCH_1 /* PAT reserves whole VMA at once (x86) */ -#if defined (CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS) +#ifdef CONFIG_ARCH_HAS_PKEYS # define VM_PKEY_SHIFT VM_HIGH_ARCH_BIT_0 # define VM_PKEY_BIT0 VM_HIGH_ARCH_0 /* A protection key is a 4-bit value */ # define VM_PKEY_BIT1 VM_HIGH_ARCH_1 # define VM_PKEY_BIT2 VM_HIGH_ARCH_2 # define VM_PKEY_BIT3 VM_HIGH_ARCH_3 -#endif +#endif /* CONFIG_ARCH_HAS_PKEYS */ + +#if defined(CONFIG_X86) +# define VM_PAT VM_ARCH_1 /* PAT reserves whole VMA at once (x86) */ #elif defined(CONFIG_PPC) # define VM_SAO VM_ARCH_1 /* Strong Access Ordering (powerpc) */ #elif defined(CONFIG_PARISC) -- 1.7.1 From 1585503254384630999@xxx Thu Nov 30 14:55:32 +0000 2017 X-GM-THRID: 1585503254384630999 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread