mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: torvalds@osdl.org, akpm@osdl.org, aviro@redhat.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 5/17] FRV: Support module exception tables
Date: Fri, 6 Jan 2006 16:29:36 GMT	[thread overview]
Message-ID: <200601061629.k06GTaBT011369@warthog.cambridge.redhat.com> (raw)
In-Reply-To: <dhowells1136564974@warthog.cambridge.redhat.com>

The attached patch fixes the exception table handling so that modules
exceptions are dealt with.

Signed-Off-By: David Howells <dhowells@redhat.com>
---
warthog>diffstat -p1 frv-extab-2615.diff
 arch/frv/mm/extable.c |   34 +++++++++-------------------------
 1 files changed, 9 insertions(+), 25 deletions(-)

diff -uNrp /warthog/kernels/linux-2.6.15/arch/frv/mm/extable.c linux-2.6.15-frv/arch/frv/mm/extable.c
--- /warthog/kernels/linux-2.6.15/arch/frv/mm/extable.c	2005-03-02 12:07:44.000000000 +0000
+++ linux-2.6.15-frv/arch/frv/mm/extable.c	2006-01-06 14:43:43.000000000 +0000
@@ -43,7 +43,7 @@ static inline unsigned long search_one_t
  */
 unsigned long search_exception_table(unsigned long pc)
 {
-	unsigned long ret = 0;
+	const struct exception_table_entry *extab;
 
 	/* determine if the fault lay during a memcpy_user or a memset_user */
 	if (__frame->lr == (unsigned long) &__memset_user_error_lr &&
@@ -55,9 +55,10 @@ unsigned long search_exception_table(uns
 		 */
 		return (unsigned long) &__memset_user_error_handler;
 	}
-	else if (__frame->lr == (unsigned long) &__memcpy_user_error_lr &&
-		 (unsigned long) &memcpy <= pc && pc < (unsigned long) &__memcpy_end
-		 ) {
+
+	if (__frame->lr == (unsigned long) &__memcpy_user_error_lr &&
+	    (unsigned long) &memcpy <= pc && pc < (unsigned long) &__memcpy_end
+	    ) {
 		/* the fault occurred in a protected memset
 		 * - we search for the return address (in LR) instead of the program counter
 		 * - it was probably during a copy_to/from_user()
@@ -65,27 +66,10 @@ unsigned long search_exception_table(uns
 		return (unsigned long) &__memcpy_user_error_handler;
 	}
 
-#ifndef CONFIG_MODULES
-	/* there is only the kernel to search.  */
-	ret = search_one_table(__start___ex_table, __stop___ex_table - 1, pc);
-	return ret;
-
-#else
-	/* the kernel is the last "module" -- no need to treat it special */
-	unsigned long flags;
-	struct module *mp;
+	extab = search_exception_tables(pc);
+	if (extab)
+		return extab->fixup;
 
-	spin_lock_irqsave(&modlist_lock, flags);
-
-	for (mp = module_list; mp != NULL; mp = mp->next) {
-		if (mp->ex_table_start == NULL || !(mp->flags & (MOD_RUNNING | MOD_INITIALIZING)))
-			continue;
-		ret = search_one_table(mp->ex_table_start, mp->ex_table_end - 1, pc);
-		if (ret)
-			break;
-	}
+	return 0;
 
-	spin_unlock_irqrestore(&modlist_lock, flags);
-	return ret;
-#endif
 } /* end search_exception_table() */

  parent reply	other threads:[~2006-01-06 16:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-06 16:29 [PATCH 0/17] FRV: Permit compilation with allmodconfig David Howells
2006-01-06 16:29 ` [PATCH 2/17] FRV: Drop 8/16-bit xchg and cmpxchg David Howells
2006-01-06 16:29 ` [PATCH 3/17] FRV: Drop unsupported debugging features David Howells
2006-01-06 16:29 ` [PATCH 1/17] FRV: Suppress configuration of certain features for FRV David Howells
2006-01-06 16:29 ` [PATCH 4/17] FRV: Implement and export various things required by modules David Howells
2006-01-06 16:29 ` [PATCH 8/17] FRV: Add pci_iomap David Howells
2006-01-06 16:29 ` [PATCH 10/17] FRV: Force serial driver inclusion David Howells
2006-01-06 16:29 ` [PATCH 7/17] FRV: Add module support stubs David Howells
2006-01-06 16:29 ` [PATCH 6/17] FRV: Supply various missing I/O access primitives David Howells
2006-01-06 16:29 ` [PATCH 9/17] FRV: Fix PCMCIA configuration David Howells
2006-01-06 16:29 ` David Howells [this message]
2006-01-06 16:29 ` [PATCH 15/17] FRV: Export __rcuref_hash David Howells
2006-01-06 16:59   ` Eric Dumazet
2006-01-06 16:29 ` [PATCH 14/17] FRV: Stop the IEEE1394 nodemanager from accessing sem count directly David Howells
2006-01-06 16:29 ` [PATCH 11/17] FRV: Make get_user macro cast pointers David Howells
2006-01-06 16:29 ` [PATCH 12/17] FRV: Miscellaneous changes David Howells
2006-01-06 16:29 ` [PATCH 13/17] FRV: Fix uninitialised variable in atm nicstar driver David Howells
2006-01-06 16:29 ` [PATCH 16/17] FRV: Fix uninitialised variable in serverworks driver David Howells
2006-01-06 16:29 ` [PATCH 17/17] FRV: Stop XFS from accessing sem count directly David Howells
2006-01-06 17:18 ` [PATCH 0/17] FRV: Permit compilation with allmodconfig Jan Dittmer

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=200601061629.k06GTaBT011369@warthog.cambridge.redhat.com \
    --to=dhowells@redhat.com \
    --cc=akpm@osdl.org \
    --cc=aviro@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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®