Henry Nestler wrote:
>Hello,
>
>Henry Nestler wrote:
>
>
>>Error was reported from Intel Pentium, not from AMD Athlon.
>>Xeon 3.2GHz CPU with hyper-threading, 2GB RAM
>>
>>Is that only an Problem on Intel CPU?
>>
>>http://wiki.colinux.org/cgi-bin/NoExecuteDEP
>>
>>
>
>is this hardware prefetching the condition for crashing on such
>Intel CPU?
>
>Anybody, please run a native linux with kernel >= 2.6.8 on Xeon CPU and
>check for the message "Errata 037". If this was printed, the coLinux
>switching code should also handle this special case?
>
>What is the "Errata 037"?
>
>Kernel Source linux-2.6.8/arch/i386/kernel/cpu/intel.c:117
>Kernel Source linux-2.6.12/arch/i386/kernel/cpu/intel.c:64
>/*
> * P4 Xeon errata 037 workaround.
> * Hardware prefetcher may cause stale data to be loaded into the cache.
> */
>
>static void __devinit Intel_errata_workarounds(struct cpuinfo_x86 *c)
>{
> unsigned long lo, hi;
>
> if ((c->x86 == 15) && (c->x86_model == 1) && (c->x86_mask == 1)) {
> rdmsr (MSR_IA32_MISC_ENABLE, lo, hi);
> if ((lo & (1<<9)) == 0) {
> printk (KERN_INFO "CPU: C0 stepping P4 Xeon detected.\n");
> printk (KERN_INFO "CPU: Disabling hardware prefetching (Errata
>037)\n");
> lo |= (1<<9); /* Disable hw prefetching */
> wrmsr (MSR_IA32_MISC_ENABLE, lo, hi);
> }
> }
>}
>
>__
>Henry
>
>
>
>-------------------------------------------------------------------------
>Using Tomcat but need to do more? Need to support web services, security?
>Get stuff done quickly with pre-integrated technology to make your job easier
>Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>_______________________________________________
>coLinux-devel mailing list
>coLinux-devel@...
>https://lists.sourceforge.net/lists/listinfo/colinux-devel
>
>
Hi All,
Could the problem be that the Intel processor is doing something
different from the AMD processor WRT the NX bit? I have used the debug
daemon and found that CoLinux crashes the system when it executes the
psuedo context switch into the guest vm. I'm wondering if we just need
to mark the passage page as executable in the page table of both the
host and the guest. This would need to be done in the
void *co_os_alloc_pages(unsigned long pages) function as the passage
page isn't allocated with malloc(). There is a Windows API call --
VirtualProtect() -- that can change the NX bit on pages. I'm just
having trouble getting the file to compile and link. The
./src/colinux/os/current/kernel/lowlevel/alloc.c file compiles ok but
when CoMake tries to execute the following lines, the linker can't find
__VirtualProtect@....
----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----
[src/colinux/os/winnt/kernel/lowlevel/alloc.o]
Building: target is older than dependencies
i686-pc-mingw32-gcc -Isrc
-I/home/dschulz/build/linux-2.6.12-build/include
-I/home/dschulz/build/linux-2.6.12-build/include2
-I/home/dschulz/build/linux-2.6.12-source/include -Wno-trigraphs
-fno-strict-aliasing -Wall -mpush-args -mno-accumulate-outgoing-args
-O2 -DCOLINUX -DCOLINUX_ARCH=winnt -DCOLINUX_DEBUG -DCOLINUX_FILE_ID=90
-DCO_HOST_API -DCO_HOST_KERNEL -DCO_KERNEL -DWINVER=0x0500 -D__KERNEL__
-c src/colinux/os/winnt/kernel/lowlevel/alloc.c -o
src/colinux/os/winnt/kernel/lowlevel/alloc.o && i686-pc-mingw32-strip
--strip-debug src/colinux/os/winnt/kernel/lowlevel/alloc.o
src/colinux/os/winnt/kernel/lowlevel/alloc.c: In function
`co_os_alloc_pages':
src/colinux/os/winnt/kernel/lowlevel/alloc.c:35: warning: 'temp' might
be used uninitialized in this function
[src/colinux/os/winnt/kernel/lowlevel/build.o]
Building: target is older than dependencies
i686-pc-mingw32-ld -r
src/colinux/os/winnt/kernel/lowlevel/time.o
src/colinux/os/winnt/kernel/lowlevel/alloc.o
src/colinux/os/winnt/kernel/lowlevel/wait.o
src/colinux/os/winnt/kernel/lowlevel/timer.o
src/colinux/os/winnt/kernel/lowlevel/debug.o
src/colinux/os/winnt/kernel/lowlevel/misc.o
src/colinux/os/winnt/kernel/lowlevel/user.o
src/colinux/os/winnt/kernel/lowlevel/mutex.o -o
src/colinux/os/winnt/kernel/lowlevel/build.o
[src/colinux/os/winnt/kernel/build.o]
Building: target is older than dependencies
i686-pc-mingw32-ld -r src/colinux/os/winnt/kernel/fileio.o
src/colinux/os/winnt/kernel/time.o src/colinux/os/winnt/kernel/alloc.o
src/colinux/os/winnt/kernel/manager.o src/colinux/os/winnt/kernel/core.o
src/colinux/os/winnt/kernel/block.o
src/colinux/os/winnt/kernel/filesystem.o
src/colinux/os/winnt/kernel/interface.o
src/colinux/os/winnt/kernel/lowlevel/build.o -o
src/colinux/os/winnt/kernel/build.o
[src/colinux/os/winnt/build/driver.o]
Building: target is older than dependencies
i686-pc-mingw32-ld -r src/colinux/kernel/build.o
src/colinux/os/winnt/kernel/build.o src/colinux/arch/build.o
src/colinux/common/common.a -o src/colinux/os/winnt/build/driver.o
[src/colinux/os/winnt/build/driver.base.exp]
[src/colinux/os/winnt/build/driver.base.tmp]
Building: target is older than dependencies
i686-pc-mingw32-gcc
-Wl,--base-file,src/colinux/os/winnt/build/driver.base.tmp
-Wl,--entry,_DriverEntry@... -nostartfiles -nostdlib -o junk.tmp
src/colinux/os/winnt/build/driver.o -lntoskrnl -lhal -lgcc ; rm -f junk.tmp
src/colinux/os/winnt/build/driver.o: undefined reference to
`_VirtualProtect@...'
collect2: ld returned 1 exit status
[src/colinux/os/winnt/build/driver.base.exp]
Building: target is older than dependencies
i686-pc-mingw32-dlltool --dllname linux.sys --base-file
src/colinux/os/winnt/build/driver.base.tmp --output-exp
src/colinux/os/winnt/build/driver.base.exp
[src/colinux/os/winnt/build/linux.sys]
Building: target requires creation
i686-pc-mingw32-gcc -Wl,--subsystem,native
-Wl,--image-base,0x10000 -Wl,--file-alignment,0x1000
-Wl,--section-alignment,0x1000 -Wl,--entry,_DriverEntry@...
-Wl,src/colinux/os/winnt/build/driver.base.exp -mdll -nostartfiles
-nostdlib -o src/colinux/os/winnt/build/linux.sys
src/colinux/os/winnt/build/driver.o -lntoskrnl -lhal -lgcc
src/colinux/os/winnt/build/driver.o: undefined reference to
`_VirtualProtect@...'
collect2: ld returned 1 exit status
Error: Target not build (TargetNotBuildError)
make[1]: *** [colinux] Error 1
----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----
The sourcecode:
NOTE:I've tried about a hundred different variations of the includes,
this is just one of them.
----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----
#include <asm/page.h>
#include <colinux/os/alloc.h>
#include <colinux/os/kernel/alloc.h>
#include <windows.h>
#include <winbase.h>
#include "../ddk.h"
#ifdef DEBUG_CO_OS_ALLOC
static int allocs;
#endif
void *co_os_alloc_pages(unsigned long pages)
{
void *ret;
PDWORD temp;
if (pages == 0)
KeBugCheck(0x11117777);
ret = MmAllocateNonCachedMemory(pages * PAGE_SIZE);
VirtualProtect((LPVOID)ret, pages * PAGE_SIZE, 0x40, temp);
#ifdef DEBUG_CO_OS_ALLOC
if (ret) {
allocs++;
co_debug("%s:%d(%d)->%x\n", __FUNCTION__, allocs, pages,
ret);
}
#endif
return ret;
}
----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----
I hope this helps. I know it isn't the stuff of an assembly guru :)
OH, I should probably mention that the processor is a P4 630 with
HyperThreading and 1Gig of RAM. causing the IRQL_NOT_LESS_OR_EQUAL BSOD.
-Dave
--
===============================
Dave Schulz
High Performance Computing
University of Calgary
dschulz@...
|