Re: Calling syscalls from x86-64 kernel results in a crash on Opteronmachines
From: Constantine Gavrilov
Date: Mon Sep 13 2004 - 10:59:26 EST
Brian Gerst wrote:
You should never use the unistd.h macros from kernel space. Call
sys_foo() directly. This may mean you have to export it. The reason
it crashes is that the "syscall" opcode used by the x86-64 macros
(unlike the "int $0x80" for i386) causes a fault when already running
in kernel space.
--
Brian Gerst
I can see from the crash report that the fault happens. I want to
understand why.
I can use workarounds. (Calling sys_foo() directly from module can be a
problem -- I would have to know the "versioned" function name or the
address of the function within the kernel space. Calling an entry from
the syscall table is much easier.)
--
----------------------------------------
Constantine Gavrilov
Kernel Developer
Qlusters Software Ltd
1 Azrieli Center, Tel-Aviv
Phone: +972-3-6081977
Fax: +972-3-6081841
----------------------------------------
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/