From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: Clean up the default pgprot setting
Date: Tue, 6 May 2014 15:08:59 +0100 [thread overview]
Message-ID: <20140506140857.GB23957@arm.com> (raw)
In-Reply-To: <20140502170745.GF20642@arm.com>
On Fri, May 02, 2014 at 06:07:45PM +0100, Will Deacon wrote:
> On Fri, May 02, 2014 at 04:51:59PM +0100, Catalin Marinas wrote:
> > The primary aim of this patchset is to remove the pgprot_default and
> > prot_sect_default global variables and rely strictly on predefined
> > values. The original goal was to be able to run SMP kernels on UP
> > hardware by not setting the Shareability bit. However, it is unlikely to
> > see UP ARMv8 hardware and even if we do, the Shareability bit is no
> > longer assumed to disable cacheable accesses.
> >
> > A side effect is that the device mappings now have the Shareability
> > attribute set. The hardware, however, should ignore it since Device
> > accesses are always Outer Shareable.
> >
> > Following the removal of the two global variables, there is some PROT_*
> > macro reshuffling and cleanup, including the __PAGE_* macros (replaced
> > by PAGE_*).
>
> [...]
>
> > +#define PAGE_NONE __pgprot(((_PAGE_DEFAULT) & ~PTE_TYPE_MASK) | PTE_PROT_NONE | PTE_PXN | PTE_UXN)
> > +#define PAGE_SHARED __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_UXN | PTE_WRITE)
> > +#define PAGE_SHARED_EXEC __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_WRITE)
> > +#define PAGE_COPY __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_UXN)
> > +#define PAGE_COPY_EXEC __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN)
> > +#define PAGE_READONLY __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_UXN)
> > +#define PAGE_READONLY_EXEC __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN)
> > +#define PAGE_EXECONLY __pgprot(_PAGE_DEFAULT | PTE_NG | PTE_PXN)
>
> Could you build the non-exec versions in terms of the exec versions? The
> difference is just the addition of PTE_UXN, and it would make this easier to
> read.
I think it still looks nicer this way. If we are writing one in terms of
the other we have to use pgprot_val() to decompose the __pgprot()
returned type.
--
Catalin
prev parent reply other threads:[~2014-05-06 14:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-02 15:51 [PATCH] arm64: Clean up the default pgprot setting Catalin Marinas
2014-05-02 17:07 ` Will Deacon
2014-05-06 14:08 ` Catalin Marinas [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=20140506140857.GB23957@arm.com \
--to=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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).