From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: ACJfBou/EJj1D7ckNONHHTH05AuEwxftErJIrzTorWjD+5hvLJgLCQulRQ/zhUww/lMT6F5kmJRu ARC-Seal: i=1; a=rsa-sha256; t=1516381519; cv=none; d=google.com; s=arc-20160816; b=Jda9TWgTOBet9TPXz08TuvS65CjQs8ZqqEdoVKlIeIbHDr1QsATqxG7V1sfmzwuGAp pFD2pssEUtXCJo3V09zNHdqehYEBgqcW8oYp1WQHLF9/HHCWs9/P0LAb2+Nck4GwKAL5 icAZ1KPDyL9DmqVlS4wYqetIpZK21fPz/f0+wJ/iPcaK+vFFddSti3l7zM8ig+XixF8F xcg6majYofZSPwgpyPp7FDvAaadU5gc4OrlI47Bm3NuA3s6FYtFRvQEbCXG2y4v2xzA6 YrNv6vVRNTEwJzVM+ROyjw/5xWMsyOMV3pkmER3LIyUfKZZ7iqWk4E/9NCbLql+enIJB nrUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:mime-version:user-agent :message-id:in-reply-to:date:references:cc:to:from :arc-authentication-results; bh=ewS5kjf31djc4nVvE/8kK1sGi5c9GxtG5+kkc4pHK/s=; b=RsmK2XZZ+oVFIYpif4XLfyJ0OzJU/a70J4mnNH1UE1gX5LPw+DarZFNk/1/Cz4XEAP l1rOrqLM8ETRn2EY51LtDT+sTVDHrUNKvXEjlhyY1zhZ9LO20Lcza6WGmcCSj5DuGYMv QuEpZBsdxnBIMvhuYX8rV4bkkTSmnM13U8u4e8bhd9Yqsi3mTedkZTqerO7dShKKKtn6 HQPcPX4SPUIuBrFdmR/bGJgzsOZfsP/tW4fF6NP2zynth+uXQTv1rsgIPmFRr6sfACHh sGWr04mf6pfFE2jj9McIh5VFizlZB+KLg/ILyy4VnBQf2JABbBqGrhJZ4ob37f1svYhS SQHQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kselftest-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kselftest-owner@vger.kernel.org Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kselftest-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kselftest-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756024AbeASRFE (ORCPT ); Fri, 19 Jan 2018 12:05:04 -0500 Received: from out02.mta.xmission.com ([166.70.13.232]:33924 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755878AbeASRFD (ORCPT ); Fri, 19 Jan 2018 12:05:03 -0500 From: ebiederm@xmission.com (Eric W. Biederman) To: Ram Pai Cc: mpe@ellerman.id.au, mingo@redhat.com, akpm@linux-foundation.org, corbet@lwn.net, arnd@arndb.de, 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 References: <1516326648-22775-1-git-send-email-linuxram@us.ibm.com> <1516326648-22775-28-git-send-email-linuxram@us.ibm.com> <87shb1de4a.fsf@xmission.com> <20180119165050.GK5612@ram.oc3035372033.ibm.com> Date: Fri, 19 Jan 2018 11:04:02 -0600 In-Reply-To: <20180119165050.GK5612@ram.oc3035372033.ibm.com> (Ram Pai's message of "Fri, 19 Jan 2018 08:50:50 -0800") Message-ID: <87efmldblp.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1eca65-0002jH-UQ;;;mid=<87efmldblp.fsf@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=97.121.73.102;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1+keLcmL4GFuS7i7HSDxgqUi6u7v58yTAk= X-SA-Exim-Connect-IP: 97.121.73.102 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 1.0 XMBody_17 BODY: Spammy words in all caps * 0.7 XMSubLong Long Subject * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa01 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject * 0.0 T_TooManySym_03 6+ unique symbols in subject * 0.0 T_TooManySym_02 5+ unique symbols in subject X-Spam-DCC: XMission; sa01 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: *;Ram Pai X-Spam-Relay-Country: X-Spam-Timing: total 1633 ms - load_scoreonly_sql: 0.05 (0.0%), signal_user_changed: 3.1 (0.2%), b_tie_ro: 2.1 (0.1%), parse: 1.39 (0.1%), extract_message_metadata: 23 (1.4%), get_uri_detail_list: 20 (1.2%), tests_pri_-1000: 23 (1.4%), tests_pri_-950: 16 (1.0%), tests_pri_-900: 1.97 (0.1%), tests_pri_-400: 96 (5.9%), check_bayes: 94 (5.7%), b_tokenize: 33 (2.0%), b_tok_get_all: 27 (1.6%), b_comp_prob: 5 (0.3%), b_tok_touch_all: 11 (0.7%), b_finish: 0.83 (0.1%), tests_pri_0: 1408 (86.2%), check_dkim_signature: 0.86 (0.1%), check_dkim_adsp: 19 (1.1%), tests_pri_500: 8 (0.5%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH v10 27/27] mm: display pkey in smaps if arch_pkeys_enabled() is true X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-kselftest-owner@vger.kernel.org X-Mailing-List: linux-kselftest@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1589983964716042571?= X-GMAIL-MSGID: =?utf-8?q?1590041268188416736?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: Ram Pai writes: > On Fri, Jan 19, 2018 at 10:09:41AM -0600, Eric W. Biederman wrote: >> Ram Pai writes: >> >> > Currently the architecture specific code is expected to >> > display the protection keys in smap for a given vma. >> > This can lead to redundant code and possibly to divergent >> > formats in which the key gets displayed. >> > >> > This patch changes the implementation. It displays the >> > pkey only if the architecture support pkeys. >> > >> > x86 arch_show_smap() function is not needed anymore. >> > Delete it. >> > >> > Signed-off-by: Ram Pai >> > --- >> > arch/x86/kernel/setup.c | 8 -------- >> > fs/proc/task_mmu.c | 11 ++++++----- >> > 2 files changed, 6 insertions(+), 13 deletions(-) >> > >> > diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c >> > index 8af2e8d..ddf945a 100644 >> > --- a/arch/x86/kernel/setup.c >> > +++ b/arch/x86/kernel/setup.c >> > @@ -1326,11 +1326,3 @@ static int __init register_kernel_offset_dumper(void) >> > return 0; >> > } >> > __initcall(register_kernel_offset_dumper); >> > - >> > -void arch_show_smap(struct seq_file *m, struct vm_area_struct *vma) >> > -{ >> > - if (!boot_cpu_has(X86_FEATURE_OSPKE)) >> > - return; >> > - >> > - seq_printf(m, "ProtectionKey: %8u\n", vma_pkey(vma)); >> > -} >> > diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c >> > index 0edd4da..4b39a94 100644 >> > --- a/fs/proc/task_mmu.c >> > +++ b/fs/proc/task_mmu.c >> > @@ -18,6 +18,7 @@ >> > #include >> > #include >> > #include >> > +#include >> > >> > #include >> > #include >> > @@ -728,10 +729,6 @@ static int smaps_hugetlb_range(pte_t *pte, unsigned long hmask, >> > } >> > #endif /* HUGETLB_PAGE */ >> > >> > -void __weak arch_show_smap(struct seq_file *m, struct vm_area_struct *vma) >> > -{ >> > -} >> > - >> > static int show_smap(struct seq_file *m, void *v, int is_pid) >> > { >> > struct proc_maps_private *priv = m->private; >> > @@ -851,9 +848,13 @@ static int show_smap(struct seq_file *m, void *v, int is_pid) >> > (unsigned long)(mss->pss >> (10 + PSS_SHIFT))); >> > >> > if (!rollup_mode) { >> > - arch_show_smap(m, vma); >> > +#ifdef CONFIG_ARCH_HAS_PKEYS >> > + if (arch_pkeys_enabled()) >> > + seq_printf(m, "ProtectionKey: %8u\n", vma_pkey(vma)); >> > +#endif >> >> Would it be worth it making vma_pkey a noop on architectures that don't >> support protection keys so that we don't need the #ifdef here? > > You mean something like this? > #define vma_pkey(vma) > It will lead to compilation error. > > > I can make it > #define vma_pkey(vma) 0 > > and that will work and get rid of the #ifdef Yes the second is what I was thinking. I don't know if it is worth it but #ifdefs can be problematic as the result in code not being compile tested. Eric From mboxrd@z Thu Jan 1 00:00:00 1970 From: ebiederm at xmission.com (Eric W. Biederman) Date: Fri, 19 Jan 2018 11:04:02 -0600 Subject: [Linux-kselftest-mirror] [PATCH v10 27/27] mm: display pkey in smaps if arch_pkeys_enabled() is true In-Reply-To: <20180119165050.GK5612@ram.oc3035372033.ibm.com> (Ram Pai's message of "Fri, 19 Jan 2018 08:50:50 -0800") References: <1516326648-22775-1-git-send-email-linuxram@us.ibm.com> <1516326648-22775-28-git-send-email-linuxram@us.ibm.com> <87shb1de4a.fsf@xmission.com> <20180119165050.GK5612@ram.oc3035372033.ibm.com> Message-ID: <87efmldblp.fsf@xmission.com> Ram Pai writes: > On Fri, Jan 19, 2018 at 10:09:41AM -0600, Eric W. Biederman wrote: >> Ram Pai writes: >> >> > Currently the architecture specific code is expected to >> > display the protection keys in smap for a given vma. >> > This can lead to redundant code and possibly to divergent >> > formats in which the key gets displayed. >> > >> > This patch changes the implementation. It displays the >> > pkey only if the architecture support pkeys. >> > >> > x86 arch_show_smap() function is not needed anymore. >> > Delete it. >> > >> > Signed-off-by: Ram Pai >> > --- >> > arch/x86/kernel/setup.c | 8 -------- >> > fs/proc/task_mmu.c | 11 ++++++----- >> > 2 files changed, 6 insertions(+), 13 deletions(-) >> > >> > diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c >> > index 8af2e8d..ddf945a 100644 >> > --- a/arch/x86/kernel/setup.c >> > +++ b/arch/x86/kernel/setup.c >> > @@ -1326,11 +1326,3 @@ static int __init register_kernel_offset_dumper(void) >> > return 0; >> > } >> > __initcall(register_kernel_offset_dumper); >> > - >> > -void arch_show_smap(struct seq_file *m, struct vm_area_struct *vma) >> > -{ >> > - if (!boot_cpu_has(X86_FEATURE_OSPKE)) >> > - return; >> > - >> > - seq_printf(m, "ProtectionKey: %8u\n", vma_pkey(vma)); >> > -} >> > diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c >> > index 0edd4da..4b39a94 100644 >> > --- a/fs/proc/task_mmu.c >> > +++ b/fs/proc/task_mmu.c >> > @@ -18,6 +18,7 @@ >> > #include >> > #include >> > #include >> > +#include >> > >> > #include >> > #include >> > @@ -728,10 +729,6 @@ static int smaps_hugetlb_range(pte_t *pte, unsigned long hmask, >> > } >> > #endif /* HUGETLB_PAGE */ >> > >> > -void __weak arch_show_smap(struct seq_file *m, struct vm_area_struct *vma) >> > -{ >> > -} >> > - >> > static int show_smap(struct seq_file *m, void *v, int is_pid) >> > { >> > struct proc_maps_private *priv = m->private; >> > @@ -851,9 +848,13 @@ static int show_smap(struct seq_file *m, void *v, int is_pid) >> > (unsigned long)(mss->pss >> (10 + PSS_SHIFT))); >> > >> > if (!rollup_mode) { >> > - arch_show_smap(m, vma); >> > +#ifdef CONFIG_ARCH_HAS_PKEYS >> > + if (arch_pkeys_enabled()) >> > + seq_printf(m, "ProtectionKey: %8u\n", vma_pkey(vma)); >> > +#endif >> >> Would it be worth it making vma_pkey a noop on architectures that don't >> support protection keys so that we don't need the #ifdef here? > > You mean something like this? > #define vma_pkey(vma) > It will lead to compilation error. > > > I can make it > #define vma_pkey(vma) 0 > > and that will work and get rid of the #ifdef Yes the second is what I was thinking. I don't know if it is worth it but #ifdefs can be problematic as the result in code not being compile tested. Eric -- To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: ebiederm@xmission.com (Eric W. Biederman) Date: Fri, 19 Jan 2018 11:04:02 -0600 Subject: [Linux-kselftest-mirror] [PATCH v10 27/27] mm: display pkey in smaps if arch_pkeys_enabled() is true In-Reply-To: <20180119165050.GK5612@ram.oc3035372033.ibm.com> (Ram Pai's message of "Fri, 19 Jan 2018 08:50:50 -0800") References: <1516326648-22775-1-git-send-email-linuxram@us.ibm.com> <1516326648-22775-28-git-send-email-linuxram@us.ibm.com> <87shb1de4a.fsf@xmission.com> <20180119165050.GK5612@ram.oc3035372033.ibm.com> Message-ID: <87efmldblp.fsf@xmission.com> Content-Type: text/plain; charset="UTF-8" Message-ID: <20180119170402.3ubty85wcwhNP0QGLNfJEZjKzjqfxgxVB0D04hJVirE@z> Ram Pai writes: > On Fri, Jan 19, 2018@10:09:41AM -0600, Eric W. Biederman wrote: >> Ram Pai writes: >> >> > Currently the architecture specific code is expected to >> > display the protection keys in smap for a given vma. >> > This can lead to redundant code and possibly to divergent >> > formats in which the key gets displayed. >> > >> > This patch changes the implementation. It displays the >> > pkey only if the architecture support pkeys. >> > >> > x86 arch_show_smap() function is not needed anymore. >> > Delete it. >> > >> > Signed-off-by: Ram Pai >> > --- >> > arch/x86/kernel/setup.c | 8 -------- >> > fs/proc/task_mmu.c | 11 ++++++----- >> > 2 files changed, 6 insertions(+), 13 deletions(-) >> > >> > diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c >> > index 8af2e8d..ddf945a 100644 >> > --- a/arch/x86/kernel/setup.c >> > +++ b/arch/x86/kernel/setup.c >> > @@ -1326,11 +1326,3 @@ static int __init register_kernel_offset_dumper(void) >> > return 0; >> > } >> > __initcall(register_kernel_offset_dumper); >> > - >> > -void arch_show_smap(struct seq_file *m, struct vm_area_struct *vma) >> > -{ >> > - if (!boot_cpu_has(X86_FEATURE_OSPKE)) >> > - return; >> > - >> > - seq_printf(m, "ProtectionKey: %8u\n", vma_pkey(vma)); >> > -} >> > diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c >> > index 0edd4da..4b39a94 100644 >> > --- a/fs/proc/task_mmu.c >> > +++ b/fs/proc/task_mmu.c >> > @@ -18,6 +18,7 @@ >> > #include >> > #include >> > #include >> > +#include >> > >> > #include >> > #include >> > @@ -728,10 +729,6 @@ static int smaps_hugetlb_range(pte_t *pte, unsigned long hmask, >> > } >> > #endif /* HUGETLB_PAGE */ >> > >> > -void __weak arch_show_smap(struct seq_file *m, struct vm_area_struct *vma) >> > -{ >> > -} >> > - >> > static int show_smap(struct seq_file *m, void *v, int is_pid) >> > { >> > struct proc_maps_private *priv = m->private; >> > @@ -851,9 +848,13 @@ static int show_smap(struct seq_file *m, void *v, int is_pid) >> > (unsigned long)(mss->pss >> (10 + PSS_SHIFT))); >> > >> > if (!rollup_mode) { >> > - arch_show_smap(m, vma); >> > +#ifdef CONFIG_ARCH_HAS_PKEYS >> > + if (arch_pkeys_enabled()) >> > + seq_printf(m, "ProtectionKey: %8u\n", vma_pkey(vma)); >> > +#endif >> >> Would it be worth it making vma_pkey a noop on architectures that don't >> support protection keys so that we don't need the #ifdef here? > > You mean something like this? > #define vma_pkey(vma) > It will lead to compilation error. > > > I can make it > #define vma_pkey(vma) 0 > > and that will work and get rid of the #ifdef Yes the second is what I was thinking. I don't know if it is worth it but #ifdefs can be problematic as the result in code not being compile tested. Eric -- To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f70.google.com (mail-pg0-f70.google.com [74.125.83.70]) by kanga.kvack.org (Postfix) with ESMTP id 2DCC16B0253 for ; Fri, 19 Jan 2018 12:05:04 -0500 (EST) Received: by mail-pg0-f70.google.com with SMTP id e26so2240770pgv.16 for ; Fri, 19 Jan 2018 09:05:04 -0800 (PST) Received: from out02.mta.xmission.com (out02.mta.xmission.com. [166.70.13.232]) by mx.google.com with ESMTPS id h7si727009pgv.172.2018.01.19.09.05.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Jan 2018 09:05:02 -0800 (PST) From: ebiederm@xmission.com (Eric W. Biederman) References: <1516326648-22775-1-git-send-email-linuxram@us.ibm.com> <1516326648-22775-28-git-send-email-linuxram@us.ibm.com> <87shb1de4a.fsf@xmission.com> <20180119165050.GK5612@ram.oc3035372033.ibm.com> Date: Fri, 19 Jan 2018 11:04:02 -0600 In-Reply-To: <20180119165050.GK5612@ram.oc3035372033.ibm.com> (Ram Pai's message of "Fri, 19 Jan 2018 08:50:50 -0800") Message-ID: <87efmldblp.fsf@xmission.com> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [PATCH v10 27/27] mm: display pkey in smaps if arch_pkeys_enabled() is true Sender: owner-linux-mm@kvack.org List-ID: To: Ram Pai Cc: mpe@ellerman.id.au, mingo@redhat.com, akpm@linux-foundation.org, corbet@lwn.net, arnd@arndb.de, 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 Ram Pai writes: > On Fri, Jan 19, 2018 at 10:09:41AM -0600, Eric W. Biederman wrote: >> Ram Pai writes: >> >> > Currently the architecture specific code is expected to >> > display the protection keys in smap for a given vma. >> > This can lead to redundant code and possibly to divergent >> > formats in which the key gets displayed. >> > >> > This patch changes the implementation. It displays the >> > pkey only if the architecture support pkeys. >> > >> > x86 arch_show_smap() function is not needed anymore. >> > Delete it. >> > >> > Signed-off-by: Ram Pai >> > --- >> > arch/x86/kernel/setup.c | 8 -------- >> > fs/proc/task_mmu.c | 11 ++++++----- >> > 2 files changed, 6 insertions(+), 13 deletions(-) >> > >> > diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c >> > index 8af2e8d..ddf945a 100644 >> > --- a/arch/x86/kernel/setup.c >> > +++ b/arch/x86/kernel/setup.c >> > @@ -1326,11 +1326,3 @@ static int __init register_kernel_offset_dumper(void) >> > return 0; >> > } >> > __initcall(register_kernel_offset_dumper); >> > - >> > -void arch_show_smap(struct seq_file *m, struct vm_area_struct *vma) >> > -{ >> > - if (!boot_cpu_has(X86_FEATURE_OSPKE)) >> > - return; >> > - >> > - seq_printf(m, "ProtectionKey: %8u\n", vma_pkey(vma)); >> > -} >> > diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c >> > index 0edd4da..4b39a94 100644 >> > --- a/fs/proc/task_mmu.c >> > +++ b/fs/proc/task_mmu.c >> > @@ -18,6 +18,7 @@ >> > #include >> > #include >> > #include >> > +#include >> > >> > #include >> > #include >> > @@ -728,10 +729,6 @@ static int smaps_hugetlb_range(pte_t *pte, unsigned long hmask, >> > } >> > #endif /* HUGETLB_PAGE */ >> > >> > -void __weak arch_show_smap(struct seq_file *m, struct vm_area_struct *vma) >> > -{ >> > -} >> > - >> > static int show_smap(struct seq_file *m, void *v, int is_pid) >> > { >> > struct proc_maps_private *priv = m->private; >> > @@ -851,9 +848,13 @@ static int show_smap(struct seq_file *m, void *v, int is_pid) >> > (unsigned long)(mss->pss >> (10 + PSS_SHIFT))); >> > >> > if (!rollup_mode) { >> > - arch_show_smap(m, vma); >> > +#ifdef CONFIG_ARCH_HAS_PKEYS >> > + if (arch_pkeys_enabled()) >> > + seq_printf(m, "ProtectionKey: %8u\n", vma_pkey(vma)); >> > +#endif >> >> Would it be worth it making vma_pkey a noop on architectures that don't >> support protection keys so that we don't need the #ifdef here? > > You mean something like this? > #define vma_pkey(vma) > It will lead to compilation error. > > > I can make it > #define vma_pkey(vma) 0 > > and that will work and get rid of the #ifdef Yes the second is what I was thinking. I don't know if it is worth it but #ifdefs can be problematic as the result in code not being compile tested. Eric -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org