Received: by 10.223.176.5 with SMTP id f5csp376641wra; Tue, 30 Jan 2018 13:01:05 -0800 (PST) X-Google-Smtp-Source: AH8x224su7RiecyTjGsJ4yoVTj27wVCOhi2+8FL2Ha278ply3d5Yhwb95Hrj964C/KlOBkeCF54g X-Received: by 2002:a17:902:988b:: with SMTP id s11-v6mr25098730plp.99.1517346065630; Tue, 30 Jan 2018 13:01:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517346065; cv=none; d=google.com; s=arc-20160816; b=Vbfr+mrENUz265oH1yds8+x8Jb4leQwEy6Mocm6VFBDxj2ptbcj4VCIsrldaDBkgu5 ChUXdUWOel1UFldZksOYK9IsWotZoQF5Im0o01ycl0TcOw0msF+xEmpavvdeyWV/DKLj bWr3kKncFCxtxTnGjvs5IAvpwoH8q3t2qXPjiupLb65LJOK/b3RNmXho4mRQbkaDRg4g LG1UaXf7mTvpawXrmOABDSYAWlQ1cUg+6bPxGfyKI4DPMDeDAJyH/bO8TqiIcsf0ZVMd PPE6PPGG7cD/rvGKGiCrg/j/UhGJ04N1s8xEUhPEkqShD/+M0snvyFnSGr6eK/9UV7sS kBwg== 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=FVKp4IGjlTpREqStOKKIR9BFGFJQFEqxWKnRSg48xQk=; b=m0HOS6k/UW0KSL3aihbnOKv4Z30BIpdkpyqMC2gbNT2axGpGDsCfQGeGWORxXKcs2u 28jIUvQhq2hM/xh8f7j3QPQi9ocJHN22UM47z/JvOkEM56L9H1vc5sZtFIrOEYd3zBJW fLn0kgCjXyr61K+3nTFAiRtYixRMEzTJlxUwjaXR0omSqf5KSBj0yYoQm2jNq5ztVULf OH09IwNy41j+w/wcKMVOusell7/ulLDDANaxvPQ0Lq304Qp8VTELnvzBUuvsaPu4B0g1 Ko9cjtIP7HGH6UpHyKxKf6BKCF9Zl0B77K14eA2YlX2kHy0nj/uJwqg06SZyobl5IlKi GhRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=ZWMJlVwu; 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 d123si467261pfg.70.2018.01.30.13.00.49; Tue, 30 Jan 2018 13:01:05 -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=ZWMJlVwu; 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 S1752642AbeA3TpH (ORCPT + 99 others); Tue, 30 Jan 2018 14:45:07 -0500 Received: from mail-qk0-f195.google.com ([209.85.220.195]:41659 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751677AbeA3TpE (ORCPT ); Tue, 30 Jan 2018 14:45:04 -0500 Received: by mail-qk0-f195.google.com with SMTP id l29so11692334qkj.8; Tue, 30 Jan 2018 11:45:04 -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=FVKp4IGjlTpREqStOKKIR9BFGFJQFEqxWKnRSg48xQk=; b=ZWMJlVwucD3f2jRVfsKll4ldyYPjiVzBuSiS4Er1gcYvwwGHgHjiDvrvR0+lrKhnRs 3WjL3kr6aPpTAFLRmezl3LJiBwDCdSQ/+zwlv11LwDV3UeFDs098c7EA9kgjTYyciD5U GLSDQ60uJdFW4KjM1WFkbTxH4bIrVqEsueidF9BxVQNRZcjMihtiE7ubcfkwsW7J2sLA UpEBnpYhqdu8WTughcNlQr15pnItjKtE/xKB0fEqrZYpxcZ3ssv+rEVDXBpWWlHL6Gek Kgbxjg955k1iofOjCeEMwVpPd/KBs4IM/A9ofuiwpAV3Z51nOmlH+TQ+05OiODC+x1Rs IKzQ== 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=FVKp4IGjlTpREqStOKKIR9BFGFJQFEqxWKnRSg48xQk=; b=myJfXHxPvD2T17BxkbMyEDhR7I1H3stv9fx4nAxOVU4aQQ59gDyUklsB8sAG6i0/ni 1FLhlCZAVsYd/bGcZttXgEwvWvT0eN5MiFWZDT6UXhDTNjE8jezcQznzPm1EJa7fc0Sq zpsLs0dtokSp7AQ2d8P8fWe0ddFrfayi07F/fVp16gC99Whs73T8YmpXSWOMqZgoI2Ve k0JH8yFs+bb/RM9SvitVCCLw8p9JMIX9lWIee0UWhIcp3e5P6xVua6rsyWxdqQEbZBsk DsSGa5gr5qck3kYqgT+POuCJMwfEaZJe6E6srPzNR3lf6kHFYmxk0C71ZwmW0nFwNHU8 5UAQ== X-Gm-Message-State: AKwxytfnMVnxWeJ3c7xflPiXLe8Tax3yEkDh6cUzzXeLeRcex81Lrl+T OJ1J/WF8QsEFHr9I1OGre0k= X-Received: by 10.55.54.140 with SMTP id d134mr43140843qka.351.1517341503993; Tue, 30 Jan 2018 11:45:03 -0800 (PST) Received: from localhost.localdomain (50-39-100-161.bvtn.or.frontiernet.net. [50.39.100.161]) by smtp.gmail.com with ESMTPSA id i39sm12117017qte.19.2018.01.30.11.45.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Jan 2018 11:45:03 -0800 (PST) From: Ram Pai To: mpe@ellerman.id.au, mingo@redhat.com, akpm@linux-foundation.org Cc: linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, x86@kernel.org, linux-arch@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, corbet@lwn.net, arnd@arndb.de, fweimer@redhat.com, msuchanek@suse.com Subject: [PATCH v11 1/3] mm, powerpc, x86: define VM_PKEY_BITx bits if CONFIG_ARCH_HAS_PKEYS is enabled Date: Tue, 30 Jan 2018 11:44:10 -0800 Message-Id: <1517341452-11924-2-git-send-email-linuxram@us.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1517341452-11924-1-git-send-email-linuxram@us.ibm.com> References: <1517341452-11924-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 339e4c1..b139617 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -674,13 +674,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 ea818ff..01381d3 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -228,15 +228,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