From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Scott Wood <scottwood@freescale.com>
Cc: linuxppc-dev@ozlabs.org, paulus@samba.org
Subject: Re: [PATCH] update_mmu_cache: Don't dcbst non-readable pages.
Date: Wed, 06 Feb 2008 07:52:38 +1100 [thread overview]
Message-ID: <1202244758.7079.72.camel@pasglop> (raw)
In-Reply-To: <20080205194326.GA13047@loki.buserror.net>
On Tue, 2008-02-05 at 13:43 -0600, Scott Wood wrote:
> Currently, update_mmu_cache will crash if given a no-access PTE. There's no
> need to synchronize dcache/icache unless it's an exec mapping -- however,
> due to the existence of older glibc versions that execute out of a
> read-but-no-exec page, readability is tested instead.
>
> This assumes no exec-only mappings; if such mappings become supported, they
> will need to go through the kmap_atomic() version of dcache/icache
> synchronization.
>
> Signed-off-by: Scott Wood <scottwood@freescale.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
> This fixes the following bug:
> http://ozlabs.org/pipermail/linuxppc-dev/2008-February/051080.html
>
> arch/powerpc/mm/mem.c | 7 ++++++-
> 1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
> index e812244..c7d7bd4 100644
> --- a/arch/powerpc/mm/mem.c
> +++ b/arch/powerpc/mm/mem.c
> @@ -483,7 +483,12 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
> */
> _tlbie(address, 0 /* 8xx doesn't care about PID */);
> #endif
> - if (!PageReserved(page)
> + /* The _PAGE_USER test should really be _PAGE_EXEC, but
> + * older glibc versions execute some code from no-exec
> + * pages, which for now we are supporting. If exec-only
> + * pages are ever implemented, this will have to change.
> + */
> + if (!PageReserved(page) && (pte_val(pte) & _PAGE_USER)
> && !test_bit(PG_arch_1, &page->flags)) {
> if (vma->vm_mm == current->active_mm) {
> __flush_dcache_icache((void *) address);
prev parent reply other threads:[~2008-02-05 20:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-05 19:43 [PATCH] update_mmu_cache: Don't dcbst non-readable pages Scott Wood
2008-02-05 20:52 ` Benjamin Herrenschmidt [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=1202244758.7079.72.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
--cc=scottwood@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).