linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: linux-kernel@vger.kernel.org, Paul Mackerras <paulus@samba.org>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 3/3] powerpc/8xx: Implementation of PAGE_EXEC
Date: Wed, 22 Apr 2015 20:46:27 -0500	[thread overview]
Message-ID: <1429753587.16357.9.camel@freescale.com> (raw)
In-Reply-To: <77ae326f3637ae008e33875b7be792d64b24461f.1429696335.git.christophe.leroy@c-s.fr>

On Wed, 2015-04-22 at 12:06 +0200, Christophe Leroy wrote:
> diff --git a/arch/powerpc/include/asm/mmu-8xx.h b/arch/powerpc/include/asm/mmu-8xx.h
> index d41200c..1407034 100644
> --- a/arch/powerpc/include/asm/mmu-8xx.h
> +++ b/arch/powerpc/include/asm/mmu-8xx.h
> @@ -27,6 +27,19 @@
>  #define MI_Ks		0x80000000	/* Should not be set */
>  #define MI_Kp		0x40000000	/* Should always be set */
>  
> +/*
> + * All pages PP exec bits are set to 000, which means Execute for Supervisor
> + * and no Execute for User.
> + * Then we use the APG to say whether accesses are according to Page rules,
> + * "all Supervisor" rules (Exec for all) and "all User" rules (Exec for noone)
> + * Therefore, we define 4 APG groups. msb is _PAGE_EXEC, lsb is _PAGE_USER
> + * 0 (00) => Not User, no exec => 11 (all accesses performed as user)
> + * 1 (01) => User but no exec => 11 (all accesses performed as user)
> + * 2 (10) => Not User, exec => 01 (rights according to page definition)
> + * 3 (11) => User, exec => 00 (all accesses performed as supervisor)
> + */
> +#define MI_APG_INIT	0xf4ffffff
> +
>  /* The effective page number register.  When read, contains the information
>   * about the last instruction TLB miss.  When MI_RPN is written, bits in
>   * this register are used to create the TLB entry.
> @@ -87,6 +100,19 @@
>  #define MD_Ks		0x80000000	/* Should not be set */
>  #define MD_Kp		0x40000000	/* Should always be set */
>  
> +/*
> + * All pages PP exec bits are set to either 000 or 011, which means respectively
> + * RW for Supervisor and no access for User, or RO for Supervisor and no access
> + * for user.
> + * Then we use the APG to say whether accesses are according to Page rules or
> + * "all Supervisor" rules (Access to all)
> + * Therefore, we define 2 APG groups. lsb is _PAGE_USER
> + * 0 => No user => 01 (all accesses performed according to page definition)
> + * 1 => User => 00 (all accesses performed as supervisor
> + *                                 according to page definition)
> + */
> +#define MD_APG_INIT	0x4fffffff

"exec" bits or data?

-Scott

      reply	other threads:[~2015-04-23  1:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1429696335.git.christophe.leroy@c-s.fr>
2015-04-22 10:06 ` [PATCH 1/3] powerpc/8xx: mark _PAGE_SHARED all types of kernel pages Christophe Leroy
2015-04-22 10:06 ` [PATCH 2/3] powerpc/8xx: Handle PAGE_USER via APG bits Christophe Leroy
2015-04-22 10:06 ` [PATCH 3/3] powerpc/8xx: Implementation of PAGE_EXEC Christophe Leroy
2015-04-23  1:46   ` Scott Wood [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=1429753587.16357.9.camel@freescale.com \
    --to=scottwood@freescale.com \
    --cc=christophe.leroy@c-s.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@samba.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).