BUG FIX modules problems

Richard Hirst (richard@sleepie.demon.co.uk)
Tue, 23 Jun 1998 20:58:19 +0100


Hi,
This patch fixes the problems people have been seeing when trying to
load modules in 2.1.1xx kernels. The problem is that the MMU ATC entries
don't get flushed on the switch to modprobe. I don't think this is an
m68k specific problem - there have been similar problems reported on
linux-kernel. I am not sure this patch is in the best place, but it is
effective.

Richard.

--- linuxvme-2.1.106/kernel/kmod.c- Tue Jun 23 18:50:09 1998
+++ linuxvme-2.1.106/kernel/kmod.c Tue Jun 23 19:46:29 1998
@@ -14,8 +14,10 @@
#include <linux/sched.h>
#include <linux/types.h>
#include <linux/unistd.h>
+#include <linux/mm.h>
#include <asm/smp_lock.h>
#include <asm/uaccess.h>
+#include <asm/pgtable.h>

/*
modprobe_path is set via /proc/sys.
@@ -48,6 +50,16 @@
{
char *argv[] = { modprobe_path, "-s", "-k", (char*)module_name, NULL};
int i;
+
+ /*
+ * The MMU ATC entries need flushing somewhere round here. This
+ * thread was created with CLONE_VM, so there was no cause to
+ * flush it there. exec_mmap() called as a result of the
+ * following execve() finds current->mm->count=2, so that doesn't
+ * flush the MMU either.
+ */
+
+ flush_tlb_mm(current->mm);

use_init_file_context();

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu