Received: by 10.223.176.46 with SMTP id f43csp310622wra; Thu, 18 Jan 2018 17:59:15 -0800 (PST) X-Google-Smtp-Source: ACJfBosok4QbbIlq9jYQuPSBuGSMCChD4DaSL6Nf1T59nScoOnOzNOtqKBE+PplnhekunIDCc14p X-Received: by 2002:a17:902:7844:: with SMTP id e4-v6mr758219pln.296.1516327155775; Thu, 18 Jan 2018 17:59:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516327155; cv=none; d=google.com; s=arc-20160816; b=BDadJ5M8qiluUJf3b03UMPIs/u2hx6Ufql6mhScT85n0LyjizzBAzKD5WVAevpJmpO W0nRN2e25WgamUuwkX8fUPMe8KaVpmJo1fIj41At9jvSnzfTzfyP2i9Hz/Ev3TCQ/eR9 5j4fd9sYNh8ILkjPR/7PjwmHCSK6pAf2+e42twp0C/VR9D3Vx+1TX1u0abpqu3VtoNZu Bgt8AluXFqL/+UEeLgFenruyc0RzTJ2OF0zZ7aBkVtTM+8HVsavTqjtZ6CrBdJyfoSku IrAvHcORRCFhcBBrIWoWN9RTwgaxxACB++R/Zi6zVbeElLOTbXkEBMZqOKAHBl7OAHiP Rh2g== 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=YKs8wF3pj22LnJwkXpBl75PK/VjvxY5YwNav9MfW8umwHoLkHeSRzuVWqa3Z1G+VZ1 EuyqtHdtDWHmCeJeXRDNUINZMdye+7eEITsoIlopV3tNoHT2fV5eyZLoAXVZRsk3EPpf 5K74CGbubhQiwc0foHFjcJVnBLqF3gahNNVVrY16T4h2IT07HE9pPr9HfHOwdSQ8Y2GV n9ih+afVgdQl6SdK09XYW822PiAasUOeaRtcnCQeM5Bvlouz37EvGKE/+dq5+u9xXTn5 BgeEFHcaaBGGROo+JCQrhT6rys9qwrwxzjKOd7DOBccFI6E8eirckcpFeWbVQPkBgZH8 YLeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=NsNeONOn; 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 n127si3301966pga.376.2018.01.18.17.59.01; Thu, 18 Jan 2018 17:59:15 -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=NsNeONOn; 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 S1755559AbeASBwN (ORCPT + 99 others); Thu, 18 Jan 2018 20:52:13 -0500 Received: from mail-qt0-f194.google.com ([209.85.216.194]:42128 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755220AbeASBvl (ORCPT ); Thu, 18 Jan 2018 20:51:41 -0500 Received: by mail-qt0-f194.google.com with SMTP id c2so425760qtn.9; Thu, 18 Jan 2018 17:51:40 -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=NsNeONOnGqONyBn88MGt5bVjd2h3B+DUWRJRg07lJ3pV19DtLYdBtHuGACM6zSCt3Y g6XNI7dlrTuTK+76w0a4aOS6PKvZgerg51r74nNbjjx6krawLVpS0nl4Y/yInh2XwZ7r Sz/tThL3OPXbgOi1dFFhBeokbJpa5WOc2NTJDrbZaHxm1PHBSPfGeKcCE3BrP/JaPCVD IStR508k0vnKTqjaylX5nbpFITs4jtU5Kvo2qnPIWiNF4Cw+lHItSm08sDsH2mKZXyMs oFz+6a7k7bM66hhHwH63xSZPW3ZiVEXItcuCpP4ETZ25NobPKe2tbn9UTuHB3VH1WDB6 x8PA== 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=blT6EsQWNapC2i44CDGFQeidMn5eZ6jKbnh55yaaZEMkCv17roZfVlmgLjflopR6VH ddCt3UgK6hYUFH2tMf8L60CLRpd6JuPAbrGmam4Om2azgr7GF51ZXLXmACz/D+LwtjFV 5VNfKUsM/MJRGcM3xVou6Oulg2R8bshmPQQ7RysR7zz9tbbSjIAPhWBLqK+gsp51kCuX VPDuaKJuaog55OWdPPuzmtmaMPtBmaA3W8GIAmojCveHaAOjh7OSunSmTUEba+xe+dNp fK+5O/B5r5Q4MuXxAaIkSeNyPucly1BYB1GIjbFW/w/qTg+6W5RKAJJ0ZBOgCb71PAbV k2sA== X-Gm-Message-State: AKwxytepJZaetvFniMfV9lpUryZr7kH4KP4VzlJBJPGVfXuY4gIe4nHh dnGJrLBdK/of2zYowHfeYZY= X-Received: by 10.200.15.218 with SMTP id f26mr11208958qtk.237.1516326700541; Thu, 18 Jan 2018 17:51:40 -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 c127sm5483161qke.78.2018.01.18.17.51.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2018 17:51:40 -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 v10 01/27] mm, powerpc, x86: define VM_PKEY_BITx bits if CONFIG_ARCH_HAS_PKEYS is enabled Date: Thu, 18 Jan 2018 17:50:22 -0800 Message-Id: <1516326648-22775-2-git-send-email-linuxram@us.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1516326648-22775-1-git-send-email-linuxram@us.ibm.com> References: <1516326648-22775-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