Re: Calling syscalls from x86-64 kernel results in a crash on Opteron machines

Arnd Bergmann
2004-09-13T14:47:14Z

[-- Attachment #1: Type: text/plain, Size: 881 bytes --]

On Montag, 13. September 2004 16:04, Constantine Gavrilov wrote:
> We have a piece of kernel code that calls some system calls in kernel
> context (from a process with mm and a daemonized kernel thread that does
> not have mm). This works fine on IA64 and i386 architectures.

You can find the list of system calls that are supposed to work
from kernel space in asm/unistd.h inside #ifdef __KERNEL__SYSCALLS__.
On current kernels, that list only contains execve(), which should
be avoided as well in favor of call_usermodehelper. Other calls
might work on some architectures but that is not a supported
interface any more.

You could call the sys_* functions directly if they are exported,
but it is unlikely that such code gets integrated in the mainline
kernel.

The real answer for your problem highly depends on which syscalls
you want to use.

Arnd <><

[-- Attachment #2: signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]