linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anshuman Khandual <anshuman.khandual@arm.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-mm@kvack.org,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	"David S. Miller" <davem@davemloft.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mips@vger.kernel.org, sparclinux@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/mmap: Define index macros for protection_map[]
Date: Wed, 29 Sep 2021 08:27:46 +0530	[thread overview]
Message-ID: <9051a597-0229-aaf2-9aad-42509b4f621d@arm.com> (raw)
In-Reply-To: <YVKdH4G5Alfwjkix@infradead.org>



On 9/28/21 10:12 AM, Christoph Hellwig wrote:
> On Tue, Sep 28, 2021 at 08:24:43AM +0530, Anshuman Khandual wrote:
>>> simple switch statement provided by each architecture.  See the below
>>> WIP which just works for x86 and without pagetable debugging for where I
>>> think we should be going.
>>
>> Sure, this will work as well but all platforms need to be changed at once.
>> Is there any platform that would not subscribe ARCH_HAS_GET_PAGE_PROT and
>> export its own vm_get_page_prot() ? AFAICS all platforms are required to
>> export __PXXX and __SXXX elements currently.
>>
>> This seems to be a better idea than the current proposal. Probably all the
>> vm_flags combinations, which will be used in those switch statements can be
>> converted into macros just to improve readability. Are you planning to send
>> this as a proper patch soon ?
> 
> This was just a quіck WIP patch.  If you have some spare time to tackle
> it for real I'd sugget the following approach:

Sure, will try and get this working.

> 
>  1) Remove the direct references to protection_map in debug_vm_pgtable.c
>  2) add the ARCH_HAS_GET_PAGE_PROT symbol that lets architectures
>     provide vm_get_page_prot itself and not define protection_map at all
>     in this case
>  3) convert all architectures that touch protection_map to provide
>     vm_get_page_prot themselves
>  4) mark protection_map static
>  5) convert all architectures that provide arch_filter_pgprot and/or
>     arch_vm_get_page_prot to provide vm_get_page_prot directly and
>     remove those hooks
>  6) remove the __S???/__P??? macros and the generic vm_get_page_prot
>     after providing an arch implementation for every architecture.
>     This can maybe simplified with a new generic version that directly
>     looks at PAGE_* macros, but that will need further investigation
>     first.
> 

      reply	other threads:[~2021-09-29  2:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-27  3:22 [PATCH] mm/mmap: Define index macros for protection_map[] Anshuman Khandual
2021-09-27 14:58 ` Christoph Hellwig
2021-09-28  2:54   ` Anshuman Khandual
2021-09-28  4:42     ` Christoph Hellwig
2021-09-29  2:57       ` Anshuman Khandual [this message]

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=9051a597-0229-aaf2-9aad-42509b4f621d@arm.com \
    --to=anshuman.khandual@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sparclinux@vger.kernel.org \
    --cc=tsbogend@alpha.franken.de \
    /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;
as well as URLs for NNTP newsgroup(s).