public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [Linux-ia64] Fix request_module from ia32 process
@ 2003-03-27 14:07 Andreas Schwab
  2003-03-27 20:43 ` David Mosberger
  2003-04-16 22:56 ` Bjorn Helgaas
  0 siblings, 2 replies; 3+ messages in thread
From: Andreas Schwab @ 2003-03-27 14:07 UTC (permalink / raw)
  To: linux-ia64

When an ia32 process triggers request_module the kernel cannot execute
modprobe because the kernel thread still has the ia32 address limits in
force.  I think a kernel thread should always have the ia64 address
limits, similar to what sys32_execve is doing.

Andreas.

--- linux-2.4.19/arch/ia64/kernel/process.c.~1~	2002-08-03 02:39:42.000000000 +0200
+++ linux-2.4.19/arch/ia64/kernel/process.c	2003-03-27 11:29:02.000000000 +0100
@@ -476,6 +476,15 @@ kernel_thread (int (*fn)(void *), void *
 
 	tid = clone(flags | CLONE_VM, 0);
 	if (parent != current) {
+#ifdef CONFIG_IA32_SUPPORT
+		if (IS_IA32_PROCESS(ia64_task_regs(current))) {
+			/* A kernel thread is always a 64-bit process. */
+			current->thread.map_base  = DEFAULT_MAP_BASE;
+			current->thread.task_size = DEFAULT_TASK_SIZE;
+			ia64_set_kr(IA64_KR_IO_BASE, current->thread.old_iob);
+			ia64_set_kr(IA64_KR_TSSD, current->thread.old_k1);
+		}
+#endif
 		result = (*fn)(arg);
 		_exit(result);
 	}

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-04-16 22:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-27 14:07 [Linux-ia64] Fix request_module from ia32 process Andreas Schwab
2003-03-27 20:43 ` David Mosberger
2003-04-16 22:56 ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox