linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Liu Dave-R63238 <r63238@freescale.com>
Cc: Jin Qing-B24347 <B24347@freescale.com>,
	linuxppc-dev@ozlabs.org, Li Yang-R58472 <R58472@freescale.com>
Subject: RE: [PATCH] pte_fsl_booke: fix instruction TLB error permission check
Date: Fri, 14 May 2010 13:42:34 +1000	[thread overview]
Message-ID: <1273808554.21352.494.camel@pasglop> (raw)
In-Reply-To: <D7CCA83BB0796C49BC0BB53B6AB12089B974F9@zch01exm21.fsl.freescale.net>

On Fri, 2010-05-14 at 08:53 +0800, Liu Dave-R63238 wrote:
> > I've updated the commit message to be a bit more clear on why 
> > we need to do this.
> 
> I'm curious why the _PAGE_EXEC have different definition in pte-book3e.h
> and pte-fsl-booke.h?
> 
> It is UX permission in pte-book3e, but is SX permission in
> pte-fsl-booke.h.

Oh well, there's a whole history here :-)

I'm not 100% sure of the "old" fsl-booke, but pte-book3e uses UX since
that's what _PAGE_EXEC really represents from a kernel standpoint,
user-execute.

On book3e, we need to account for the HW tablewalk, which means that the
PTE can be loaded as-is by the HW. We thus don't get a chance to test
whether we are user or supervisor or change the bits accordingly. We
thus need _PAGE_EXEC to fall right into UX since that's really what the
kernel manipulates it for.

It also means that user pages will not get execute permission in
supervisor mode which is a good thing :-)

For kernel-execute, we have a specific permission, which should be
obtained via PAGE_KERNEL_EXEC in vmalloc_exec().

Cheers,
Ben.

  reply	other threads:[~2010-05-14  3:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-07  8:38 [PATCH] pte_fsl_booke: fix instruction TLB error permission check Li Yang
2010-05-13 19:14 ` Kumar Gala
2010-05-13 21:46   ` Benjamin Herrenschmidt
2010-05-14  2:16     ` Liu Dave-R63238
2010-05-14  9:08       ` Benjamin Herrenschmidt
2010-05-14  9:14         ` Liu Dave-R63238
2010-05-14  9:25           ` Benjamin Herrenschmidt
2010-05-14  0:53   ` Liu Dave-R63238
2010-05-14  3:42     ` Benjamin Herrenschmidt [this message]
2010-05-14  3:36   ` Benjamin Herrenschmidt
2010-05-14  4:19     ` Kumar Gala

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=1273808554.21352.494.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=B24347@freescale.com \
    --cc=R58472@freescale.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=r63238@freescale.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;
as well as URLs for NNTP newsgroup(s).