linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	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: Tue, 28 Sep 2021 05:42:07 +0100	[thread overview]
Message-ID: <YVKdH4G5Alfwjkix@infradead.org> (raw)
In-Reply-To: <f224c661-f8f0-3c4a-bad8-095209412dd4@arm.com>

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:

 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-28  4:43 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 [this message]
2021-09-29  2:57       ` 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=YVKdH4G5Alfwjkix@infradead.org \
    --to=hch@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=anshuman.khandual@arm.com \
    --cc=davem@davemloft.net \
    --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).