diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-22 17:26:18 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-22 17:26:18 -0700 |
commit | cdb7532f7be35c3675b1aed54d10e378014618b6 (patch) | |
tree | 925df597b70c4a1de629fec68f9e4ebd3fd9e803 /arch/sh/mm | |
parent | 7992018d979460af59fbae8a48f9641305aea438 (diff) | |
parent | 31d106c68b1af88835a474556052d6efbfec99c5 (diff) | |
download | blackbird-op-linux-cdb7532f7be35c3675b1aed54d10e378014618b6.tar.gz blackbird-op-linux-cdb7532f7be35c3675b1aed54d10e378014618b6.zip |
Merge master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6:
sh: Fix dreamcast build for IRQ changes.
sh: Fix clock multiplier on SH7722.
sh: Wire up kdump crash kernel exec in die().
sh: sr.bl toggling around idle sleep.
sh: disable genrtc support.
fs: Kill sh dependency for binfmt_flat.
sh: Disable psw support for R7785RP.
sh: Fix page size alignment in __copy_user_page().
sh: Fix up various compile warnings for SE boards.
sh: Wire up signalfd/timerfd/eventfd syscalls.
sh: revert addition of page fault notifiers
spelling fixes: arch/sh/
input: hp680_ts compile fixes.
sh: landisk: Header cleanups.
sh: landisk: rtc-rs5c313 support.
sh: Kill off pmb slab cache destructor.
sh: Fix up psw build rules for r7780rp.
sh: Shut up compiler warnings in __do_page_fault().
Diffstat (limited to 'arch/sh/mm')
-rw-r--r-- | arch/sh/mm/copy_page.S | 1 | ||||
-rw-r--r-- | arch/sh/mm/fault.c | 39 | ||||
-rw-r--r-- | arch/sh/mm/init.c | 3 | ||||
-rw-r--r-- | arch/sh/mm/pmb.c | 79 |
4 files changed, 42 insertions, 80 deletions
diff --git a/arch/sh/mm/copy_page.S b/arch/sh/mm/copy_page.S index 397c94c97315..ae039f2da162 100644 --- a/arch/sh/mm/copy_page.S +++ b/arch/sh/mm/copy_page.S @@ -129,6 +129,7 @@ ENTRY(__copy_user_page) rts nop #endif + .align 2 .Lpsz: .long PAGE_SIZE /* * __kernel_size_t __copy_user(void *to, const void *from, __kernel_size_t n); diff --git a/arch/sh/mm/fault.c b/arch/sh/mm/fault.c index 9207da67ff8a..c878faa4ae46 100644 --- a/arch/sh/mm/fault.c +++ b/arch/sh/mm/fault.c @@ -15,43 +15,11 @@ #include <linux/mm.h> #include <linux/hardirq.h> #include <linux/kprobes.h> -#include <linux/kdebug.h> #include <asm/system.h> #include <asm/mmu_context.h> #include <asm/tlbflush.h> #include <asm/kgdb.h> -#ifdef CONFIG_KPROBES -ATOMIC_NOTIFIER_HEAD(notify_page_fault_chain); - -/* Hook to register for page fault notifications */ -int register_page_fault_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(¬ify_page_fault_chain, nb); -} - -int unregister_page_fault_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(¬ify_page_fault_chain, nb); -} - -static inline int notify_page_fault(enum die_val val, struct pt_regs *regs, - int trap, int sig) -{ - struct die_args args = { - .regs = regs, - .trapnr = trap, - }; - return atomic_notifier_call_chain(¬ify_page_fault_chain, val, &args); -} -#else -static inline int notify_page_fault(enum die_val val, struct pt_regs *regs, - int trap, int sig) -{ - return NOTIFY_DONE; -} -#endif - /* * This routine handles page faults. It determines the address, * and the problem, and then passes it off to one of the appropriate @@ -69,11 +37,6 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, siginfo_t info; trace_hardirqs_on(); - - if (notify_page_fault(DIE_PAGE_FAULT, regs, - writeaccess, SIGSEGV) == NOTIFY_STOP) - return; - local_irq_enable(); #ifdef CONFIG_SH_KGDB @@ -285,7 +248,7 @@ asmlinkage int __kprobes __do_page_fault(struct pt_regs *regs, pte_t *pte; pte_t entry; struct mm_struct *mm = current->mm; - spinlock_t *ptl; + spinlock_t *ptl = NULL; int ret = 1; #ifdef CONFIG_SH_KGDB diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c index 8fe223a890ed..e0e644ff3204 100644 --- a/arch/sh/mm/init.c +++ b/arch/sh/mm/init.c @@ -12,6 +12,7 @@ #include <linux/init.h> #include <linux/bootmem.h> #include <linux/proc_fs.h> +#include <linux/pagemap.h> #include <linux/percpu.h> #include <linux/io.h> #include <asm/mmu_context.h> @@ -112,7 +113,7 @@ static void set_pte_phys(unsigned long addr, unsigned long phys, pgprot_t prot) * As a performance optimization, other platforms preserve the fixmap mapping * across a context switch, we don't presently do this, but this could be done * in a similar fashion as to the wired TLB interface that sh64 uses (by way - * of the memorry mapped UTLB configuration) -- this unfortunately forces us to + * of the memory mapped UTLB configuration) -- this unfortunately forces us to * give up a TLB entry for each mapping we want to preserve. While this may be * viable for a small number of fixmaps, it's not particularly useful for * everything and needs to be carefully evaluated. (ie, we may want this for diff --git a/arch/sh/mm/pmb.c b/arch/sh/mm/pmb.c index 02aae06527dc..b6a5a338145b 100644 --- a/arch/sh/mm/pmb.c +++ b/arch/sh/mm/pmb.c @@ -3,7 +3,7 @@ * * Privileged Space Mapping Buffer (PMB) Support. * - * Copyright (C) 2005, 2006 Paul Mundt + * Copyright (C) 2005, 2006, 2007 Paul Mundt * * P1/P2 Section mapping definitions from map32.h, which was: * @@ -68,6 +68,32 @@ static inline unsigned long mk_pmb_data(unsigned int entry) return mk_pmb_entry(entry) | PMB_DATA; } +static DEFINE_SPINLOCK(pmb_list_lock); +static struct pmb_entry *pmb_list; + +static inline void pmb_list_add(struct pmb_entry *pmbe) +{ + struct pmb_entry **p, *tmp; + + p = &pmb_list; + while ((tmp = *p) != NULL) + p = &tmp->next; + + pmbe->next = tmp; + *p = pmbe; +} + +static inline void pmb_list_del(struct pmb_entry *pmbe) +{ + struct pmb_entry **p, *tmp; + + for (p = &pmb_list; (tmp = *p); p = &tmp->next) + if (tmp == pmbe) { + *p = tmp->next; + return; + } +} + struct pmb_entry *pmb_alloc(unsigned long vpn, unsigned long ppn, unsigned long flags) { @@ -81,11 +107,19 @@ struct pmb_entry *pmb_alloc(unsigned long vpn, unsigned long ppn, pmbe->ppn = ppn; pmbe->flags = flags; + spin_lock_irq(&pmb_list_lock); + pmb_list_add(pmbe); + spin_unlock_irq(&pmb_list_lock); + return pmbe; } void pmb_free(struct pmb_entry *pmbe) { + spin_lock_irq(&pmb_list_lock); + pmb_list_del(pmbe); + spin_unlock_irq(&pmb_list_lock); + kmem_cache_free(pmb_cache, pmbe); } @@ -167,31 +201,6 @@ void clear_pmb_entry(struct pmb_entry *pmbe) clear_bit(entry, &pmb_map); } -static DEFINE_SPINLOCK(pmb_list_lock); -static struct pmb_entry *pmb_list; - -static inline void pmb_list_add(struct pmb_entry *pmbe) -{ - struct pmb_entry **p, *tmp; - - p = &pmb_list; - while ((tmp = *p) != NULL) - p = &tmp->next; - - pmbe->next = tmp; - *p = pmbe; -} - -static inline void pmb_list_del(struct pmb_entry *pmbe) -{ - struct pmb_entry **p, *tmp; - - for (p = &pmb_list; (tmp = *p); p = &tmp->next) - if (tmp == pmbe) { - *p = tmp->next; - return; - } -} static struct { unsigned long size; @@ -283,25 +292,14 @@ void pmb_unmap(unsigned long addr) } while (pmbe); } -static void pmb_cache_ctor(void *pmb, struct kmem_cache *cachep, unsigned long flags) +static void pmb_cache_ctor(void *pmb, struct kmem_cache *cachep, + unsigned long flags) { struct pmb_entry *pmbe = pmb; memset(pmb, 0, sizeof(struct pmb_entry)); - spin_lock_irq(&pmb_list_lock); - pmbe->entry = PMB_NO_ENTRY; - pmb_list_add(pmbe); - - spin_unlock_irq(&pmb_list_lock); -} - -static void pmb_cache_dtor(void *pmb, struct kmem_cache *cachep, unsigned long flags) -{ - spin_lock_irq(&pmb_list_lock); - pmb_list_del(pmb); - spin_unlock_irq(&pmb_list_lock); } static int __init pmb_init(void) @@ -312,8 +310,7 @@ static int __init pmb_init(void) BUG_ON(unlikely(nr_entries >= NR_PMB_ENTRIES)); pmb_cache = kmem_cache_create("pmb", sizeof(struct pmb_entry), 0, - SLAB_PANIC, pmb_cache_ctor, - pmb_cache_dtor); + SLAB_PANIC, pmb_cache_ctor, NULL); jump_to_P2(); |