From: Fabrice Bellard <fabrice@bellard.org>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Unknown symbol __PAGE_KERNEL_EXEC
Date: Tue, 26 Jul 2005 23:34:48 +0200 [thread overview]
Message-ID: <42E6AC78.3070403@bellard.org> (raw)
In-Reply-To: <e8ca353705072522566bca5f5d@mail.gmail.com>
Hi,
I propose this patch:
--- kqemu-linux.c 25 Apr 2005 22:14:39 -0000 1.4
+++ kqemu-linux.c 25 Jul 2005 22:17:34 -0000
@@ -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.
Pascal Terjan wrote:
> On 7/26/05, Darryl Dixon <esrever_otua@pythonhacker.is-a-geek.net> wrote:
>
>>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'
>
>
> 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
> Qemu-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/qemu-devel
>
>
prev parent reply other threads:[~2005-07-26 21:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-26 4:28 [Qemu-devel] Unknown symbol __PAGE_KERNEL_EXEC Darryl Dixon
2005-07-26 5:56 ` Pascal Terjan
2005-07-26 6:06 ` Pascal Terjan
2005-07-26 11:10 ` Darryl Dixon
2005-07-26 15:53 ` Sebastian Kaliszewski
2005-07-26 21:34 ` Fabrice Bellard [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=42E6AC78.3070403@bellard.org \
--to=fabrice@bellard.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).