From: olof@austin.ibm.com (Olof Johansson)
To: Jake Moilanen <moilanen@austin.ibm.com>
Cc: Andrew Morton <akpm@osdl.org>,
linuxppc64-dev@ozlabs.org, paulus@samba.org,
linux-kernel@vger.kernel.org, Anton Blanchard <anton@samba.org>
Subject: Re: [PATCH 1/2] No-exec support for ppc64
Date: Wed, 9 Mar 2005 21:22:13 -0600 [thread overview]
Message-ID: <20050310032213.GB20789@austin.ibm.com> (raw)
In-Reply-To: <20050308170826.13a2299e.moilanen@austin.ibm.com>
On Tue, Mar 08, 2005 at 05:08:26PM -0600, Jake Moilanen wrote:
> No-exec base and user space support for PPC64.
Hi, a couple of comments below.
-Olof
> @@ -786,6 +786,7 @@ int hash_huge_page(struct mm_struct *mm,
> pte_t old_pte, new_pte;
> unsigned long hpteflags, prpn;
> long slot;
> + int is_exec;
> int err = 1;
>
> spin_lock(&mm->page_table_lock);
> @@ -796,6 +797,10 @@ int hash_huge_page(struct mm_struct *mm,
> va = (vsid << 28) | (ea & 0x0fffffff);
> vpn = va >> HPAGE_SHIFT;
>
> + is_exec = access & _PAGE_EXEC;
> + if (unlikely(is_exec && !(pte_val(*ptep) & _PAGE_EXEC)))
> + goto out;
You only use is_exec this one time, you can probably skip it and just
add the mask in the if statement.
> @@ -898,6 +908,7 @@ repeat:
> err = 0;
>
> out:
> +
> spin_unlock(&mm->page_table_lock);
Whitespace change
> diff -puN include/asm-ppc64/pgtable.h~nx-user-ppc64 include/asm-ppc64/pgtable.h
> --- linux-2.6-bk/include/asm-ppc64/pgtable.h~nx-user-ppc64 2005-03-08 16:08:54 -06:00
> +++ linux-2.6-bk-moilanen/include/asm-ppc64/pgtable.h 2005-03-08 16:08:54 -06:00
> @@ -82,14 +82,14 @@
> #define _PAGE_PRESENT 0x0001 /* software: pte contains a translation */
> #define _PAGE_USER 0x0002 /* matches one of the PP bits */
> #define _PAGE_FILE 0x0002 /* (!present only) software: pte holds file offset */
> -#define _PAGE_RW 0x0004 /* software: user write access allowed */
> +#define _PAGE_EXEC 0x0004 /* No execute on POWER4 and newer (we invert) */
Good to see the comment there, I remember we talked about that earlier.
It can be somewhat confusing. :-)
> #define _PAGE_GUARDED 0x0008
> #define _PAGE_COHERENT 0x0010 /* M: enforce memory coherence (SMP systems) */
> #define _PAGE_NO_CACHE 0x0020 /* I: cache inhibit */
> #define _PAGE_WRITETHRU 0x0040 /* W: cache write-through */
> #define _PAGE_DIRTY 0x0080 /* C: page changed */
> #define _PAGE_ACCESSED 0x0100 /* R: page referenced */
> -#define _PAGE_EXEC 0x0200 /* software: i-cache coherence required */
> +#define _PAGE_RW 0x0200 /* software: user write access allowed */
> #define _PAGE_HASHPTE 0x0400 /* software: pte has an associated HPTE */
> #define _PAGE_BUSY 0x0800 /* software: PTE & hash are busy */
> #define _PAGE_SECONDARY 0x8000 /* software: HPTE is in secondary group */
> @@ -100,7 +100,7 @@
> /* PAGE_MASK gives the right answer below, but only by accident */
> /* It should be preserving the high 48 bits and then specifically */
> /* preserving _PAGE_SECONDARY | _PAGE_GROUP_IX */
> -#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_HPTEFLAGS)
> +#define _PAGE_CHG_MASK (_PAGE_GUARDED | _PAGE_COHERENT | _PAGE_NO_CACHE | _PAGE_WRITETHRU | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_HPTEFLAGS | PAGE_MASK)
Can you break it into 80 columns with \ ?
next prev parent reply other threads:[~2005-03-10 3:30 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-08 22:59 [PATCH 0/2] " Jake Moilanen
2005-03-08 23:08 ` [PATCH 1/2] " Jake Moilanen
2005-03-10 3:22 ` Olof Johansson [this message]
2005-03-10 22:25 ` Jake Moilanen
2005-03-14 10:13 ` Paul Mackerras
2005-03-14 21:51 ` Jake Moilanen
2005-03-14 22:18 ` Paul Mackerras
2005-03-15 21:51 ` Jake Moilanen
2005-03-15 22:48 ` Alan Modra
2005-03-15 23:17 ` Jake Moilanen
2005-03-16 6:10 ` Paul Mackerras
2005-03-16 21:45 ` Jake Moilanen
2005-03-08 23:13 ` [PATCH 2/2] " Jake Moilanen
2005-03-09 3:02 ` Benjamin Herrenschmidt
2005-03-10 3:25 ` Olof Johansson
2005-03-10 7:15 ` Benjamin Herrenschmidt
2005-03-10 22:27 ` Jake Moilanen
2005-03-10 22:44 ` Benjamin Herrenschmidt
2005-03-11 14:01 ` Jake Moilanen
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=20050310032213.GB20789@austin.ibm.com \
--to=olof@austin.ibm.com \
--cc=akpm@osdl.org \
--cc=anton@samba.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc64-dev@ozlabs.org \
--cc=moilanen@austin.ibm.com \
--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
all inboxes | Powered by JetHome®