Skip to contentSkip to conversation

Unknown symbol __PAGE_KERNEL_EXEC

Qemu-devel Darryl Dixon 4 participants 6 messages Jul 26, 2005

lore
Share & tools
lore
#0 lore raw

Hi All, Fabrice,

Compiling the new kqemu-0.7.1 on Fedora Core 4 with kernel
2.6.12-1.1398_FC4 gives this error:

-------------8<-------------------
[dixond@unixadmindazfc2 kqemu]$ make
make -C /lib/modules/2.6.12-1.1398_FC4/build M=pwd modules
make[1]: Entering directory `/usr/src/kernels/2.6.12-1.1398_FC4-i686'
CC [M] /opt/src/qemu-0.7.1/kqemu/kqemu-linux.o
cp /opt/src/qemu-0.7.1/kqemu/kqemu-mod-i386.o /opt/src/qemu-0.7.1/kqemu/kqemu-mod.o
LD [M] /opt/src/qemu-0.7.1/kqemu/kqemu.o
Building modules, stage 2.
MODPOST
Warning: could not find /opt/src/qemu-0.7.1/kqemu/.kqemu-mod.o.cmd
for /opt/src/qemu-0.7.1/kqemu/kqemu-mod.o
*** Warning: "__PAGE_KERNEL_EXEC" [/opt/src/qemu-0.7.1/kqemu/kqemu.ko] undefined!
CC /opt/src/qemu-0.7.1/kqemu/kqemu.mod.o
LD [M] /opt/src/qemu-0.7.1/kqemu/kqemu.ko
make[1]: Leaving directory `/usr/src/kernels/2.6.12-1.1398_FC4-i686' -------------8<-------------------

And then the module fails to modrobe successfully:

-------------8<------------------- [root@unixadmindazfc2 qemu-0.7.1]# /sbin/modprobe kqemu
FATAL: Error inserting kqemu (/lib/modules/2.6.12-1.1398_FC4/misc/kqemu.ko): Unknown symbol in module, or unknown parameter (see dmesg) [root@unixadmindazfc2 qemu-0.7.1]# dmesg|tail -1
kqemu: Unknown symbol __PAGE_KERNEL_EXEC -------------8<-------------------

Please CC me on any replies as I am no longer subscribed to the list.

Cheers,

Signature · 1 line
Darryl Dixon <[email protected]>
#1 lore raw
Quoted 5 lines · Darryl Dixon

Hi All, Fabrice,

Compiling the new kqemu-0.7.1 on Fedora Core 4 with kernel
2.6.12-1.1398_FC4 gives this error:

Quoted 16 lines

-------------8<-------------------
[dixond@unixadmindazfc2 kqemu]$ make
make -C /lib/modules/2.6.12-1.1398_FC4/build M=pwd modules
make[1]: Entering directory `/usr/src/kernels/2.6.12-1.1398_FC4-i686'
CC [M] /opt/src/qemu-0.7.1/kqemu/kqemu-linux.o
cp /opt/src/qemu-0.7.1/kqemu/kqemu-mod-i386.o /opt/src/qemu-0.7.1/kqemu/kqemu-mod.o
LD [M] /opt/src/qemu-0.7.1/kqemu/kqemu.o
Building modules, stage 2.
MODPOST
Warning: could not find /opt/src/qemu-0.7.1/kqemu/.kqemu-mod.o.cmd
for /opt/src/qemu-0.7.1/kqemu/kqemu-mod.o
*** Warning: "__PAGE_KERNEL_EXEC" [/opt/src/qemu-0.7.1/kqemu/kqemu.ko] undefined!
CC /opt/src/qemu-0.7.1/kqemu/kqemu.mod.o
LD [M] /opt/src/qemu-0.7.1/kqemu/kqemu.ko
make[1]: Leaving directory `/usr/src/kernels/2.6.12-1.1398_FC4-i686'

My understanding of the problem :
on i386, in pgtable.h we have
extern unsigned long long __PAGE_KERNEL, __PAGE_KERNEL_EXEC;
#define PAGE_KERNEL_EXEC __pgprot(__PAGE_KERNEL_EXEC)

an there is EXPORT_SYMBOL(__PAGE_KERNEL) but not for __PAGE_KERNEL_EXEC

on x86_64 :
#define __PAGE_KERNEL_EXEC \
(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED)
#define MAKE_GLOBAL(x) __pgprot((x) | _PAGE_GLOBAL) #define PAGE_KERNEL_EXEC MAKE_GLOBAL(__PAGE_KERNEL_EXEC)

So, on i386 __PAGE_KERNEL_EXEC is an extern variable wich is not exported and not a macro.

I wrote a patch on
http://www.zarb.org/cgi-bin/viewcvs.cgi/plf/SPECS/non-free/dkms-kqemu/kqemu-0.7.1-PAGE_KERNEL_EXEC.patch?rev=1.1&view=markup
but I don't know much kernel stuff so I have no idea how much it is broken :-)

#2 lore raw
Quoted 36 lines · Pascal Terjan
Quoted 5 lines · Darryl Dixon

Hi All, Fabrice,

Compiling the new kqemu-0.7.1 on Fedora Core 4 with kernel
2.6.12-1.1398_FC4 gives this error:

Quoted 16 lines

-------------8<-------------------
[dixond@unixadmindazfc2 kqemu]$ make
make -C /lib/modules/2.6.12-1.1398_FC4/build M=pwd modules
make[1]: Entering directory `/usr/src/kernels/2.6.12-1.1398_FC4-i686'
CC [M] /opt/src/qemu-0.7.1/kqemu/kqemu-linux.o
cp /opt/src/qemu-0.7.1/kqemu/kqemu-mod-i386.o /opt/src/qemu-0.7.1/kqemu/kqemu-mod.o
LD [M] /opt/src/qemu-0.7.1/kqemu/kqemu.o
Building modules, stage 2.
MODPOST
Warning: could not find /opt/src/qemu-0.7.1/kqemu/.kqemu-mod.o.cmd
for /opt/src/qemu-0.7.1/kqemu/kqemu-mod.o
*** Warning: "__PAGE_KERNEL_EXEC" [/opt/src/qemu-0.7.1/kqemu/kqemu.ko] undefined!
CC /opt/src/qemu-0.7.1/kqemu/kqemu.mod.o
LD [M] /opt/src/qemu-0.7.1/kqemu/kqemu.ko
make[1]: Leaving directory `/usr/src/kernels/2.6.12-1.1398_FC4-i686'

My understanding of the problem :
on i386, in pgtable.h we have
extern unsigned long long __PAGE_KERNEL, __PAGE_KERNEL_EXEC;
#define PAGE_KERNEL_EXEC __pgprot(__PAGE_KERNEL_EXEC)

an there is EXPORT_SYMBOL(__PAGE_KERNEL) but not for __PAGE_KERNEL_EXEC

on x86_64 :
#define __PAGE_KERNEL_EXEC \
(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED)
#define MAKE_GLOBAL(x) __pgprot((x) | _PAGE_GLOBAL) #define PAGE_KERNEL_EXEC MAKE_GLOBAL(__PAGE_KERNEL_EXEC)

Quoted 8 lines

So, on i386 __PAGE_KERNEL_EXEC is an extern variable wich is not exported and not a macro.

I wrote a patch on
http://www.zarb.org/cgi-bin/viewcvs.cgi/plf/SPECS/non-free/dkms-kqemu/kqemu-0.7.1-PAGE_KERNEL_EXEC.patch?rev=1.1&view=markup
but I don't know much kernel stuff so I have no idea how much it is broken :-)

after think to what I wrote, as PAGE_KERNEL is OK, a simpler and better patch may be to use & ~_PAGE_NX

#3 lore raw
In reply to Pascal Terjan

Well, I can confirm that this works OK.

Also, congrats Fabrice, this version of kqemu appears to work OK with Win 9x (I booted my Win98SE machine), and the games that I use QEMU to run (AoE2, Civ3, Baldurs Gate 2) all were noticeably quicker. The speedup didn't seem to be as dramatic as WinXP with/without kqemu, but it was definitely there.

Cheers,
D

Quoted 43 lines · Pascal Terjan
Quoted 5 lines · Darryl Dixon

Hi All, Fabrice,

Compiling the new kqemu-0.7.1 on Fedora Core 4 with kernel
2.6.12-1.1398_FC4 gives this error:

Quoted 16 lines

-------------8<-------------------
[dixond@unixadmindazfc2 kqemu]$ make
make -C /lib/modules/2.6.12-1.1398_FC4/build M=pwd modules
make[1]: Entering directory `/usr/src/kernels/2.6.12-1.1398_FC4-i686'
CC [M] /opt/src/qemu-0.7.1/kqemu/kqemu-linux.o
cp /opt/src/qemu-0.7.1/kqemu/kqemu-mod-i386.o /opt/src/qemu-0.7.1/kqemu/kqemu-mod.o
LD [M] /opt/src/qemu-0.7.1/kqemu/kqemu.o
Building modules, stage 2.
MODPOST
Warning: could not find /opt/src/qemu-0.7.1/kqemu/.kqemu-mod.o.cmd
for /opt/src/qemu-0.7.1/kqemu/kqemu-mod.o
*** Warning: "__PAGE_KERNEL_EXEC" [/opt/src/qemu-0.7.1/kqemu/kqemu.ko] undefined!
CC /opt/src/qemu-0.7.1/kqemu/kqemu.mod.o
LD [M] /opt/src/qemu-0.7.1/kqemu/kqemu.ko
make[1]: Leaving directory `/usr/src/kernels/2.6.12-1.1398_FC4-i686'

My understanding of the problem :
on i386, in pgtable.h we have
extern unsigned long long __PAGE_KERNEL, __PAGE_KERNEL_EXEC;
#define PAGE_KERNEL_EXEC __pgprot(__PAGE_KERNEL_EXEC)

an there is EXPORT_SYMBOL(__PAGE_KERNEL) but not for __PAGE_KERNEL_EXEC

on x86_64 :
#define __PAGE_KERNEL_EXEC \
(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED)
#define MAKE_GLOBAL(x) __pgprot((x) | _PAGE_GLOBAL) #define PAGE_KERNEL_EXEC MAKE_GLOBAL(__PAGE_KERNEL_EXEC)

So, on i386 __PAGE_KERNEL_EXEC is an extern variable wich is not exported and not a macro.

I wrote a patch on
http://www.zarb.org/cgi-bin/viewcvs.cgi/plf/SPECS/non-free/dkms-kqemu/kqemu-0.7.1-PAGE_KERNEL_EXEC.patch?rev=1.1&view=markup
but I don't know much kernel stuff so I have no idea how much it is broken :-)

Signature · 1 line
Darryl Dixon <[email protected]>
#4 lore raw

Hello!

Quoted 32 lines · Darryl Dixon

Well, I can confirm that this works OK.

Also, congrats Fabrice, this version of kqemu appears to work OK with Win 9x (I booted my Win98SE machine), and the games that I use QEMU to run (AoE2, Civ3, Baldurs Gate 2) all were noticeably quicker. The speedup didn't seem to be as dramatic as WinXP with/without kqemu, but it was definitely there.

Cheers,
D

Quoted 22 lines · Pascal Terjan
Quoted 21 lines · On 7/26/05, Darryl Dixon <[email protected]…

Hi All, Fabrice,

Compiling the new kqemu-0.7.1 on Fedora Core 4 with kernel
2.6.12-1.1398_FC4 gives this error:

-------------8<-------------------
[dixond@unixadmindazfc2 kqemu]$ make
make -C /lib/modules/2.6.12-1.1398_FC4/build M=pwd modules
make[1]: Entering directory `/usr/src/kernels/2.6.12-1.1398_FC4-i686'
CC [M] /opt/src/qemu-0.7.1/kqemu/kqemu-linux.o
cp /opt/src/qemu-0.7.1/kqemu/kqemu-mod-i386.o /opt/src/qemu-0.7.1/kqemu/kqemu-mod.o
LD [M] /opt/src/qemu-0.7.1/kqemu/kqemu.o
Building modules, stage 2.
MODPOST
Warning: could not find /opt/src/qemu-0.7.1/kqemu/.kqemu-mod.o.cmd
for /opt/src/qemu-0.7.1/kqemu/kqemu-mod.o
*** Warning: "__PAGE_KERNEL_EXEC" [/opt/src/qemu-0.7.1/kqemu/kqemu.ko] undefined!
CC /opt/src/qemu-0.7.1/kqemu/kqemu.mod.o
LD [M] /opt/src/qemu-0.7.1/kqemu/kqemu.ko
make[1]: Leaving directory `/usr/src/kernels/2.6.12-1.1398_FC4-i686'

Had exactly the same problem the proposed patch seems to fix it.

rgds
Sebastian

#5 lore raw
In reply to Pascal Terjan

Hi,

I propose this patch:

kqemu-linux.c 25 Jul 2005 22:17:34 -0000 renamed from kqemu-linux.c 25 Apr 2005 22:14:39 -0000 1.4 +7 -1
@@ -28,7 +28,13 @@
 #define pfn_to_page(pfn) (mem_map + (pfn))
 #endif
 
-#ifndef PAGE_KERNEL_EXEC
+#ifdef PAGE_KERNEL_EXEC
+#if defined(__i386__)
+/* problem : i386 kernels usually don't export __PAGE_KERNEL_EXEC */
+#undef PAGE_KERNEL_EXEC
+#define PAGE_KERNEL_EXEC __pgprot(__PAGE_KERNEL & ~_PAGE_NX)
+#endif
+#else
 #define PAGE_KERNEL_EXEC PAGE_KERNEL
 #endif
 

Is it working with all kernels and x86/x86_64 ?

Fabrice.

Quoted 53 lines · Pascal Terjan
Quoted 5 lines · Darryl Dixon

Hi All, Fabrice,

Compiling the new kqemu-0.7.1 on Fedora Core 4 with kernel
2.6.12-1.1398_FC4 gives this error:

Quoted 16 lines

-------------8<-------------------
[dixond@unixadmindazfc2 kqemu]$ make
make -C /lib/modules/2.6.12-1.1398_FC4/build M=pwd modules
make[1]: Entering directory `/usr/src/kernels/2.6.12-1.1398_FC4-i686'
CC [M] /opt/src/qemu-0.7.1/kqemu/kqemu-linux.o
cp /opt/src/qemu-0.7.1/kqemu/kqemu-mod-i386.o /opt/src/qemu-0.7.1/kqemu/kqemu-mod.o
LD [M] /opt/src/qemu-0.7.1/kqemu/kqemu.o
Building modules, stage 2.
MODPOST
Warning: could not find /opt/src/qemu-0.7.1/kqemu/.kqemu-mod.o.cmd
for /opt/src/qemu-0.7.1/kqemu/kqemu-mod.o
*** Warning: "__PAGE_KERNEL_EXEC" [/opt/src/qemu-0.7.1/kqemu/kqemu.ko] undefined!
CC /opt/src/qemu-0.7.1/kqemu/kqemu.mod.o
LD [M] /opt/src/qemu-0.7.1/kqemu/kqemu.ko
make[1]: Leaving directory `/usr/src/kernels/2.6.12-1.1398_FC4-i686'

My understanding of the problem :
on i386, in pgtable.h we have
extern unsigned long long __PAGE_KERNEL, __PAGE_KERNEL_EXEC;
#define PAGE_KERNEL_EXEC __pgprot(__PAGE_KERNEL_EXEC)

an there is EXPORT_SYMBOL(__PAGE_KERNEL) but not for __PAGE_KERNEL_EXEC

on x86_64 :
#define __PAGE_KERNEL_EXEC \
(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED)
#define MAKE_GLOBAL(x) __pgprot((x) | _PAGE_GLOBAL) #define PAGE_KERNEL_EXEC MAKE_GLOBAL(__PAGE_KERNEL_EXEC)

So, on i386 __PAGE_KERNEL_EXEC is an extern variable wich is not exported and not a macro.

I wrote a patch on
http://www.zarb.org/cgi-bin/viewcvs.cgi/plf/SPECS/non-free/dkms-kqemu/kqemu-0.7.1-PAGE_KERNEL_EXEC.patch?rev=1.1&view=markup
but I don't know much kernel stuff so I have no idea how much it is broken :-)

_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel