linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Kumar Gala <kumar.gala@freescale.com>
Cc: linuxppc-dev list <linuxppc-dev@ozlabs.org>
Subject: Re: [RFC/PATCH] powerpc: rework 4xx PTE access and TLB miss
Date: Wed, 11 Jun 2008 12:43:09 +1000	[thread overview]
Message-ID: <1213152189.25745.55.camel@pasglop> (raw)
In-Reply-To: <7B3D2AD1-DBC4-41DB-91EE-D070CA4B47AD@freescale.com>


> > #define _PAGE_PRESENT	0x00000001		/* S: PTE valid */
> > -#define	_PAGE_RW	0x00000002		/* S: Write permission */
> > +#define _PAGE_RW	0x00000002		/* S: Write permission */
> > #define _PAGE_FILE	0x00000004		/* S: nonlinear file mapping */
> > +#define _PAGE_HWEXEC	0x00000004		/* H: Execute permission */
> 
> I'm sure this is ok, but why can we overlay _PAGE_HWEXEC and _PAGE_FILE?

_PAGE_FILE is only meaningful for non present PTEs.

> > #define _PAGE_ACCESSED	0x00000008		/* S: Page referenced */
> > -#define _PAGE_HWWRITE	0x00000010		/* H: Dirty & RW */
> > -#define _PAGE_HWEXEC	0x00000020		/* H: Execute permission */
> > -#define	_PAGE_USER	0x00000040		/* S: User page */
> > -#define	_PAGE_ENDIAN	0x00000080		/* H: E bit */
> > -#define	_PAGE_GUARDED	0x00000100		/* H: G bit */
> > -#define	_PAGE_DIRTY	0x00000200		/* S: Page dirty */
> > -#define	_PAGE_NO_CACHE	0x00000400		/* H: I bit */
> > -#define	_PAGE_WRITETHRU	0x00000800		/* H: W bit */
> > +#define _PAGE_DIRTY	0x00000010		/* S: Page dirty */
> 
> why the gap?

There are tricks to simplify the TLB miss handlers here. WIMGE are in
the natural position of the final tlbwe, _PAGE_PRESENT is in SR
position, _PAGE_RW in SW and _PAGE_HWEXEC in SX. I then conditionally
copy them down to the "U" bits when _PAGE_USER is set. This trick
isn't as useful on FSL though as your MAS layout mixes up the
protection bits in a less useful way.

As to why _PAGE_USER is appended to WIMGE rather than _PAGE_DIRTY,
well, it was one or the other, either way there would be a gap,
which we can later use for _PAGE_EXEC. I'm also thinking about
finding a bit for _PAGE_SPECIAL for fast_gup.

Cheers,
Ben.

  reply	other threads:[~2008-06-11  2:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-11  0:50 [RFC/PATCH] powerpc: rework 4xx PTE access and TLB miss Benjamin Herrenschmidt
2008-06-11  2:18 ` Kumar Gala
2008-06-11  2:43   ` Benjamin Herrenschmidt [this message]
2008-06-11  6:20 ` Kumar Gala
2008-06-11  6:29   ` Benjamin Herrenschmidt
2008-06-19 14:04 ` Josh Boyer

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=1213152189.25745.55.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=kumar.gala@freescale.com \
    --cc=linuxppc-dev@ozlabs.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).