From: Wouter Cloetens <wouter@mind.be>
To: Trevor Woerner <ppc339@vtnet.ca>, linuxppc-dev@lists.linuxppc.org
Subject: [PATCH 2.4.22] Re: PPC405 support in later 2.4.x kernels
Date: Fri, 29 Aug 2003 17:01:15 +0200 [thread overview]
Message-ID: <20030829150115.GD1204@roadkill.intern.mind.be> (raw)
[-- Attachment #1: Type: text/plain, Size: 360 bytes --]
On Thu, 31 Jul 2003 23:32:41 -0400, Trevor Woerner wrote:
> I grabbed 2.4.22-pre8 and found the ppc4xx code back, but the strangest
> thing is now happening: I've lost my user-space.
I had the same problem with 2.4.22. I diffed 2.4.21-pre7 with 2.4.22
and found some 405-specific code to be missing in the fault handler.
The attached patch fixes the problem.
[-- Attachment #2: 405fault.diff --]
[-- Type: text/plain, Size: 1522 bytes --]
--- linux-2.4.22_linuxppc_2_4/arch/ppc/mm/fault.c 2003-08-29 11:13:00.000000000 +0200
+++ linux-2.4.22_linuxppc_2_4_insightv2p/arch/ppc/mm/fault.c 2003-08-29 16:35:26.000000000 +0200
@@ -26,6 +26,7 @@
#include <linux/mman.h>
#include <linux/mm.h>
#include <linux/interrupt.h>
+#include <linux/highmem.h>
#include <asm/page.h>
#include <asm/pgtable.h>
@@ -51,6 +52,7 @@ unsigned int probingmem;
extern void die_if_kernel(char *, struct pt_regs *, long);
void bad_page_fault(struct pt_regs *, unsigned long, int sig);
void do_page_fault(struct pt_regs *, unsigned long, unsigned long);
+extern int get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep);
/*
* Check whether the instruction at regs->nip is a store using
@@ -202,6 +204,28 @@ good_area:
if (is_write) {
if (!(vma->vm_flags & VM_WRITE))
goto bad_area;
+#if defined(CONFIG_4xx)
+ /* an exec - 4xx/BookE allows for per-page execute permission */
+ } else if (regs->trap == 0x400) {
+ pte_t *ptep;
+
+
+ /* Since 4xx supports per-page execute permission,
+ * we lazily flush dcache to icache. */
+ if (get_pteptr(mm, address, &ptep) && pte_present(*ptep)) {
+ struct page *page = pte_page(*ptep);
+
+ if (! test_bit(PG_arch_1, &page->flags)) {
+ __flush_dcache_icache(kmap(page));
+ kunmap(page);
+ set_bit(PG_arch_1, &page->flags);
+ }
+ pte_update(ptep, 0, _PAGE_HWEXEC);
+ _tlbie(address);
+ up_read(&mm->mmap_sem);
+ return;
+ }
+#endif
/* a read */
} else {
/* protection fault */
next reply other threads:[~2003-08-29 15:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-29 15:01 Wouter Cloetens [this message]
2003-08-31 11:59 ` [PATCH 2.4.22] Re: PPC405 support in later 2.4.x kernels Paul Mackerras
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=20030829150115.GD1204@roadkill.intern.mind.be \
--to=wouter@mind.be \
--cc=linuxppc-dev@lists.linuxppc.org \
--cc=ppc339@vtnet.ca \
/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).