From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Anshuman Khandual <anshuman.khandual@arm.com>,
"hch@infradead.org" <hch@infradead.org>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
kernel test robot <lkp@intel.com>, Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH V3 2/2] mm/mmap: Drop generic protection_map[] array
Date: Fri, 17 Jun 2022 05:48:11 +0000 [thread overview]
Message-ID: <43205917-0517-4e45-6fbf-4fc849fb0325@csgroup.eu> (raw)
In-Reply-To: <7c72a97f-d7d4-db27-faa5-fec01673cca7@arm.com>
Le 17/06/2022 à 05:29, Anshuman Khandual a écrit :
>
>
> On 6/16/22 11:42, hch@infradead.org wrote:
>> On Thu, Jun 16, 2022 at 05:45:39AM +0000, Christophe Leroy wrote:
>>>> +/* Note due to the way vm flags are laid out, the bits are XWR */
>>>> +pgprot_t protection_map[16] = {
>>>
>>> Was const previously, now back to non const ? Maybe due to a conflict
>>> with linux/mm.h ? At least it should be __ro_after_init.
>>
>> Maybe we just need to duplicate vm_get_page_prot in all the
>> architectures and thus avoid making protection_map global in a
>> common header entirely. That certainly seems like the cleaner
>> interface.
>
> Agreed, also it does free up the platforms to provide any appropriate
> qualifiers for the protection_map[] array i.e __ro_after_init, const
> etc without impacting generic declaration used in a generic function.
Maybe all we need is to keep protection_map[] declaration architecture
specific.
Is it a good idea to duplicate vm_get_page_prot() in each architecture ?
Maybe it is, but it will also mean changing common code like
mm/debug_vm_pgtable.c which accesses protection_map[] directly as of today.
On the other hand it means we can then drop
CONFIG_ARCH_HAS_VM_GET_PAGE_PROT completely at the end. In a way that's
a way back into your first version of the series, but without the uggly
switch/case, maybe that's the best solution after all.
next prev parent reply other threads:[~2022-06-17 5:48 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-16 4:09 [PATCH V3 0/2] mm/mmap: Drop __SXXX/__PXXX macros from across platforms Anshuman Khandual
2022-06-16 4:09 ` [PATCH V3 1/2] mm/mmap: Restrict generic protection_map[] array visibility Anshuman Khandual
2022-06-16 5:35 ` Christophe Leroy
2022-06-20 5:16 ` Anshuman Khandual
2022-06-20 6:41 ` Christophe Leroy
2022-06-21 9:44 ` Anshuman Khandual
2022-06-16 12:44 ` kernel test robot
2022-06-20 4:45 ` Anshuman Khandual
2022-06-20 5:55 ` Christoph Hellwig
2022-06-20 6:43 ` Christophe Leroy
2022-06-16 4:09 ` [PATCH V3 2/2] mm/mmap: Drop generic protection_map[] array Anshuman Khandual
2022-06-16 5:27 ` Christophe Leroy
2022-06-16 6:10 ` hch
2022-06-17 3:46 ` Anshuman Khandual
2022-06-16 5:45 ` Christophe Leroy
2022-06-16 6:12 ` hch
2022-06-17 3:29 ` Anshuman Khandual
2022-06-17 5:48 ` Christophe Leroy [this message]
2022-06-17 8:00 ` hch
2022-06-20 4:14 ` Anshuman Khandual
2022-06-17 3:43 ` Anshuman Khandual
2022-06-17 5:40 ` Christophe Leroy
2022-06-16 5:22 ` [PATCH V3 0/2] mm/mmap: Drop __SXXX/__PXXX macros from across platforms Christophe Leroy
2022-06-16 6:13 ` hch
2022-06-17 3:07 ` Anshuman Khandual
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43205917-0517-4e45-6fbf-4fc849fb0325@csgroup.eu \
--to=christophe.leroy@csgroup.eu \
--cc=akpm@linux-foundation.org \
--cc=anshuman.khandual@arm.com \
--cc=hch@infradead.org \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox