Re: [general] harmony launch failed on AMD Geode LX

2008-02-02 Thread Egor Pasko
On the 0x3DE day of Apache Harmony Gregory Shimansky wrote:
> On 2 February 2008 Egor Pasko wrote:
> > On the 0x3DD day of Apache Harmony Gregory Shimansky wrote:
> > > On 1 февраля 2008 Egor Pasko wrote:
> > > > On the 0x3DD day of Apache Harmony Mark Hindess wrote:
> > > > > > > in place of sfence in vm/vmcore/src/thread/linux/atomics.cpp.
> > > > > >
> > > > > > Yes I think this should help on processors with no SSE (not to
> > > > > > mention SSE2) support.
> > > > >
> > > > > It does.  HelloWorld runs okay with -Xint.  (Now I just need to find
> > > > > a way to run the tests on a machine which boots to a small ramdisk
> > > > > from compact flash and doesn't currently support network file
> > > > > systems.)
> > > > >
> > > > > Without -Xint, predictably, it fails with not-immediately-helpful
> > > > > core which reports:
> > > > >
> > > > > (gdb) bt
> > > > > #0  0xa649d24d in ?? ()
> > > > > (gdb) x/1i $eip
> > > > > 0xa649d24d: (bad)
> > > > >
> > > > > It might be worth adding an option to the federation build compile
> > > > > for a more limited processor so that people can do some testing
> > > > > w/-Xint - on OLPC, Geode and VIA based machines?
> > > >
> > > > I tried to say that a build option would be nearly as hard to
> > > > implement as a runtime option, which is more preferrable.
> > >
> > > In class library I saw an interesting approach with code patching in
> > > assembly. It has a special segment with the same name (on windows all
> > > segments of the same name are merged across assembly sources) with labels
> > > for each LOCKed instruction. In case the system is determined to be
> > > uniprocessor, it patches all of the LOCK prefixes with NOP (see
> > > thrhelp.asm, thrspinlock.asm and lock386.c files).
> >
> > cool! but who needs uniprocessors? :)
> 
> I just wanted to describe the approach with patching the code on startup. It 
> doesn't have to be SMP/noSMP choice. It may be SSE/noSSE choice.

well, I think, branching would be enough, since this one is gonnabe
perfectly predicted :)

> > They say some windows drivers on uniprocessor systems just stop thread
> > preemption by flipping a special flag with no lock prefix [1]. That is
> > because windows does not support CPU hotplug :)
> >
> > > In theory it could be possible to gather all of the locations of mfence,
> > > sfence, etc instructions in the code and patch them according to
> > > architecture at the initialization point. But in practice creating such a
> > > table is easy only for assembly.
> >
> > I see the biggest problem in making a complete list of all potential
> > fence places. After that deciding case by case is much easier.
> 
> Yes this is the problem with high level languages.
> 
> -- 
> Gregory
> 

-- 
Egor Pasko



Re: [general] harmony launch failed on AMD Geode LX

2008-02-02 Thread Gregory Shimansky
On 2 February 2008 Egor Pasko wrote:
> On the 0x3DD day of Apache Harmony Gregory Shimansky wrote:
> > On 1 февраля 2008 Egor Pasko wrote:
> > > On the 0x3DD day of Apache Harmony Mark Hindess wrote:
> > > > > > in place of sfence in vm/vmcore/src/thread/linux/atomics.cpp.
> > > > >
> > > > > Yes I think this should help on processors with no SSE (not to
> > > > > mention SSE2) support.
> > > >
> > > > It does.  HelloWorld runs okay with -Xint.  (Now I just need to find
> > > > a way to run the tests on a machine which boots to a small ramdisk
> > > > from compact flash and doesn't currently support network file
> > > > systems.)
> > > >
> > > > Without -Xint, predictably, it fails with not-immediately-helpful
> > > > core which reports:
> > > >
> > > > (gdb) bt
> > > > #0  0xa649d24d in ?? ()
> > > > (gdb) x/1i $eip
> > > > 0xa649d24d: (bad)
> > > >
> > > > It might be worth adding an option to the federation build compile
> > > > for a more limited processor so that people can do some testing
> > > > w/-Xint - on OLPC, Geode and VIA based machines?
> > >
> > > I tried to say that a build option would be nearly as hard to
> > > implement as a runtime option, which is more preferrable.
> >
> > In class library I saw an interesting approach with code patching in
> > assembly. It has a special segment with the same name (on windows all
> > segments of the same name are merged across assembly sources) with labels
> > for each LOCKed instruction. In case the system is determined to be
> > uniprocessor, it patches all of the LOCK prefixes with NOP (see
> > thrhelp.asm, thrspinlock.asm and lock386.c files).
>
> cool! but who needs uniprocessors? :)

I just wanted to describe the approach with patching the code on startup. It 
doesn't have to be SMP/noSMP choice. It may be SSE/noSSE choice.

> They say some windows drivers on uniprocessor systems just stop thread
> preemption by flipping a special flag with no lock prefix [1]. That is
> because windows does not support CPU hotplug :)
>
> > In theory it could be possible to gather all of the locations of mfence,
> > sfence, etc instructions in the code and patch them according to
> > architecture at the initialization point. But in practice creating such a
> > table is easy only for assembly.
>
> I see the biggest problem in making a complete list of all potential
> fence places. After that deciding case by case is much easier.

Yes this is the problem with high level languages.

-- 
Gregory


Re: [general] harmony launch failed on AMD Geode LX

2008-02-02 Thread Egor Pasko
On the 0x3DD day of Apache Harmony Gregory Shimansky wrote:
> On 1 февраля 2008 Egor Pasko wrote:
> > On the 0x3DD day of Apache Harmony Mark Hindess wrote:
> > > > > in place of sfence in vm/vmcore/src/thread/linux/atomics.cpp.
> > > >
> > > > Yes I think this should help on processors with no SSE (not to mention
> > > > SSE2) support.
> > >
> > > It does.  HelloWorld runs okay with -Xint.  (Now I just need to find a
> > > way to run the tests on a machine which boots to a small ramdisk from
> > > compact flash and doesn't currently support network file systems.)
> > >
> > > Without -Xint, predictably, it fails with not-immediately-helpful core
> > > which reports:
> > >
> > > (gdb) bt
> > > #0  0xa649d24d in ?? ()
> > > (gdb) x/1i $eip
> > > 0xa649d24d: (bad)
> > >
> > > It might be worth adding an option to the federation build compile for
> > > a more limited processor so that people can do some testing w/-Xint - on
> > > OLPC, Geode and VIA based machines?
> >
> > I tried to say that a build option would be nearly as hard to
> > implement as a runtime option, which is more preferrable.
> 
> In class library I saw an interesting approach with code patching in 
> assembly. 
> It has a special segment with the same name (on windows all segments of the 
> same name are merged across assembly sources) with labels for each LOCKed 
> instruction. In case the system is determined to be uniprocessor, it patches 
> all of the LOCK prefixes with NOP (see thrhelp.asm, thrspinlock.asm and 
> lock386.c files).

cool! but who needs uniprocessors? :)

They say some windows drivers on uniprocessor systems just stop thread
preemption by flipping a special flag with no lock prefix [1]. That is
because windows does not support CPU hotplug :)

> In theory it could be possible to gather all of the locations of mfence, 
> sfence, etc instructions in the code and patch them according to architecture 
> at the initialization point. But in practice creating such a table is easy 
> only for assembly.

I see the biggest problem in making a complete list of all potential
fence places. After that deciding case by case is much easier.

[1] http://msdn2.microsoft.com/en-us/library/ms810047.aspx

-- 
Egor Pasko



Re: [general] harmony launch failed on AMD Geode LX

2008-02-01 Thread Gregory Shimansky
On 1 февраля 2008 Egor Pasko wrote:
> On the 0x3DD day of Apache Harmony Mark Hindess wrote:
> > > > in place of sfence in vm/vmcore/src/thread/linux/atomics.cpp.
> > >
> > > Yes I think this should help on processors with no SSE (not to mention
> > > SSE2) support.
> >
> > It does.  HelloWorld runs okay with -Xint.  (Now I just need to find a
> > way to run the tests on a machine which boots to a small ramdisk from
> > compact flash and doesn't currently support network file systems.)
> >
> > Without -Xint, predictably, it fails with not-immediately-helpful core
> > which reports:
> >
> > (gdb) bt
> > #0  0xa649d24d in ?? ()
> > (gdb) x/1i $eip
> > 0xa649d24d: (bad)
> >
> > It might be worth adding an option to the federation build compile for
> > a more limited processor so that people can do some testing w/-Xint - on
> > OLPC, Geode and VIA based machines?
>
> I tried to say that a build option would be nearly as hard to
> implement as a runtime option, which is more preferrable.

In class library I saw an interesting approach with code patching in assembly. 
It has a special segment with the same name (on windows all segments of the 
same name are merged across assembly sources) with labels for each LOCKed 
instruction. In case the system is determined to be uniprocessor, it patches 
all of the LOCK prefixes with NOP (see thrhelp.asm, thrspinlock.asm and 
lock386.c files).

In theory it could be possible to gather all of the locations of mfence, 
sfence, etc instructions in the code and patch them according to architecture 
at the initialization point. But in practice creating such a table is easy 
only for assembly.

-- 
Gregory


Re: [general] harmony launch failed on AMD Geode LX

2008-02-01 Thread Egor Pasko
On the 0x3DD day of Apache Harmony Mark Hindess wrote:
> > > in place of sfence in vm/vmcore/src/thread/linux/atomics.cpp.
> > 
> > Yes I think this should help on processors with no SSE (not to mention
> > SSE2) support.
> 
> It does.  HelloWorld runs okay with -Xint.  (Now I just need to find a
> way to run the tests on a machine which boots to a small ramdisk from
> compact flash and doesn't currently support network file systems.)
> 
> Without -Xint, predictably, it fails with not-immediately-helpful core
> which reports:
> 
> (gdb) bt
> #0  0xa649d24d in ?? ()
> (gdb) x/1i $eip
> 0xa649d24d: (bad)  
> 
> It might be worth adding an option to the federation build compile for
> a more limited processor so that people can do some testing w/-Xint - on
> OLPC, Geode and VIA based machines?

I tried to say that a build option would be nearly as hard to
implement as a runtime option, which is more preferrable.

-- 
Egor Pasko



Re: [general] harmony launch failed on AMD Geode LX

2008-02-01 Thread Ilya Berezhniuk
I second the idea with atomics unification.

I suggest to get rid of APR atomics, and use atomics from PORT.
I already made some steps - HARMONY-5395 contains a patch with missed
'cas' for linux and some corrections to current 'cas' functions - but
there are still plenty of work on atomic inc/dec etc.

I'm going to continue this when I have enough time.

Thanks,
Ilya.

2008/2/1, Mark Hindess <[EMAIL PROTECTED]>:
>
> On 1 February 2008 at 1:42, Gregory Shimansky <[EMAIL PROTECTED]> wrote:
> > On 1 Ñ„ÐµÐ²Ñ€Ð°Ð»Ñ  2008 Mark Hindess wrote:
> > > On 31 January 2008 at 22:00, Mark Hindess <[EMAIL PROTECTED]>
> > wrote:
> > > > On 22 January 2008 at 20:37, Gregory Shimansky <[EMAIL PROTECTED]>
> > wrote:
> > > > > SeongCheon, Kang said the following on 22.01.2008 20:29:
> > > > > > I Installed Apache-harmony-jre-603435 on AMD Geode LX based system
> > > > > > board (PC Engines ALIX.1C) that is installed xubuntu 7.10.
> > > > > >
> > > > > > I executed Equinox OSGi service platform and harmony just prints out
> > > > > > 'illegal instruction' after 10 seconds. But, 'hello world' works
> > > > > > well. :-
> > > >
> > > > )
> > > >
> > > > > > And, I installed Sun JRE 5. Equinox OSGi service platform works well
> > > > > > on i
> > > >
> > > > t.
> > > >
> > > > > > What's the problem? Anyone has tested on AMD Geode LX or/and xubuntu
> > > > > > 7?
> > > > >
> > > > > I think it may be because it doesn't support SSE according to
> > > > > wikipedia. To make sure that it is the case you can use gdb to print
> > > > > out the failing instruction like
> > > > >
> > > > > (gdb) x/1i $eip
> > > > >
> > > > > and see what it shows and where this instruction appears (whether it 
> > > > > is
> > > > > in generated code or in Harmony compiled code).
> > > > >
> > > > > Also you can try to run the application in interpreter mode using 
> > > > > -Xint
> > > > > option for VM.
> > > >
> > > > I recompiled classlib with -march=c3 rather than -march=pentium3.  But
> > > > even with -Xint HelloWorld still dies with illegal instruction.  gdb
> > > > says:
> > > >
> > > > (gdb) bt
> > > > #0  0xb76e49f3 in MemoryWriteBarrier ()
> > > >from drlvm/bin/default/libharmonyvm.so
> > > > #1  0xb76e16f0 in String_Pool::lookup ()
> > > >from drlvm/bin/default/libharmonyvm.so
> > > > #2  0xb76e17c4 in String_Pool::lookup ()
> > > >from drlvm/bin/default/libharmonyvm.so
> > > > #3  0xb76d6a08 in Global_Env::Global_Env ()
> > > >from drlvm/bin/default/libharmonyvm.so
> > > > #4  0xb77528a4 in JNI_CreateJavaVM ()
> > > >from drlvm/bin/default/libharmonyvm.so
> > > > #5  0x08049a55 in invocation (portLibrary=0xb918, argc=5,
> > > > argv=0xbd54 ,
> > > > handle=134654592, version=65540, ignoreUnrecognized=1 '\001',
> > > > mainClass=0xbe6a "HelloWorld", classArg=4,
> > > > propertiesFileName=0x806aa00
> > > > "drlvm/bin/default/harmonyvm.properties", is StandaloneJar=0,
> > > > vmdllsubdir=0xb842 "default") at ../shared/main.c:672 #6  0x08049160
> > > > in gpProtectedMain (args=0xb8f8) at ../shared/main.c:393 #7
> > > > 0x0804b4a1 in main (argc=5, argv=0xbd54, envp=0xbd6c) at
> > > > ../shared/cmain.c:146
> > > > (gdb) x/1i $eip
> > > > 0xb76e49f3 <_Z18MemoryWriteBarrierv+3>: sfence
> > > >
> > > > Suggestions welcome.
> > >
> > > Answering my own question... I'm going to try:
> > >
> > >   lock; addl $0,0(%%esp)
> > >
> > > in place of sfence in vm/vmcore/src/thread/linux/atomics.cpp.
> >
> > Yes I think this should help on processors with no SSE (not to mention
> > SSE2) support.
>
> It does.  HelloWorld runs okay with -Xint.  (Now I just need to find a
> way to run the tests on a machine which boots to a small ramdisk from
> compact flash and doesn't currently support network file systems.)
>
> Without -Xint, predictably, it fails with not-immediately-helpful core
> which reports:
>
> (gdb) bt
> #0  0xa649d24d in ?? ()
> (gdb) x/1i $eip
> 0xa649d24d: (bad)
>
> It might be worth adding an option to the federation build compile for
> a more limited processor so that people can do some testing w/-Xint - on
> OLPC, Geode and VIA based machines?
>
> > In fact VM's atomics stuff needs some unification. There are about three
> > write barrier and atomic compare implementations that I know of, and
> > probably several that I don't know of...
>
> Definitely.
>
> -Mark.
>
>
>


Re: [general] harmony launch failed on AMD Geode LX

2008-02-01 Thread Egor Pasko
On the 0x3DD day of Apache Harmony Mark Hindess wrote:
> On 1 February 2008 at 1:42, Gregory Shimansky <[EMAIL PROTECTED]> wrote:
> > On 1 ??



Re: [general] harmony launch failed on AMD Geode LX

2008-02-01 Thread Mark Hindess

On 1 February 2008 at 1:42, Gregory Shimansky <[EMAIL PROTECTED]> wrote:
> On 1 февраля 2008 Mark Hindess wrote:
> > On 31 January 2008 at 22:00, Mark Hindess <[EMAIL PROTECTED]> 
> wrote:
> > > On 22 January 2008 at 20:37, Gregory Shimansky <[EMAIL PROTECTED]> 
> wrote:
> > > > SeongCheon, Kang said the following on 22.01.2008 20:29:
> > > > > I Installed Apache-harmony-jre-603435 on AMD Geode LX based system
> > > > > board (PC Engines ALIX.1C) that is installed xubuntu 7.10.
> > > > >
> > > > > I executed Equinox OSGi service platform and harmony just prints out
> > > > > 'illegal instruction' after 10 seconds. But, 'hello world' works
> > > > > well. :-
> > >
> > > )
> > >
> > > > > And, I installed Sun JRE 5. Equinox OSGi service platform works well
> > > > > on i
> > >
> > > t.
> > >
> > > > > What's the problem? Anyone has tested on AMD Geode LX or/and xubuntu
> > > > > 7?
> > > >
> > > > I think it may be because it doesn't support SSE according to
> > > > wikipedia. To make sure that it is the case you can use gdb to print
> > > > out the failing instruction like
> > > >
> > > > (gdb) x/1i $eip
> > > >
> > > > and see what it shows and where this instruction appears (whether it is
> > > > in generated code or in Harmony compiled code).
> > > >
> > > > Also you can try to run the application in interpreter mode using -Xint
> > > > option for VM.
> > >
> > > I recompiled classlib with -march=c3 rather than -march=pentium3.  But
> > > even with -Xint HelloWorld still dies with illegal instruction.  gdb
> > > says:
> > >
> > > (gdb) bt
> > > #0  0xb76e49f3 in MemoryWriteBarrier ()
> > >from drlvm/bin/default/libharmonyvm.so
> > > #1  0xb76e16f0 in String_Pool::lookup ()
> > >from drlvm/bin/default/libharmonyvm.so
> > > #2  0xb76e17c4 in String_Pool::lookup ()
> > >from drlvm/bin/default/libharmonyvm.so
> > > #3  0xb76d6a08 in Global_Env::Global_Env ()
> > >from drlvm/bin/default/libharmonyvm.so
> > > #4  0xb77528a4 in JNI_CreateJavaVM ()
> > >from drlvm/bin/default/libharmonyvm.so
> > > #5  0x08049a55 in invocation (portLibrary=0xb918, argc=5,
> > > argv=0xbd54 ,
> > > handle=134654592, version=65540, ignoreUnrecognized=1 '\001',
> > > mainClass=0xbe6a "HelloWorld", classArg=4,
> > > propertiesFileName=0x806aa00
> > > "drlvm/bin/default/harmonyvm.properties", is StandaloneJar=0,
> > > vmdllsubdir=0xb842 "default") at ../shared/main.c:672 #6  0x08049160
> > > in gpProtectedMain (args=0xb8f8) at ../shared/main.c:393 #7 
> > > 0x0804b4a1 in main (argc=5, argv=0xbd54, envp=0xbd6c) at
> > > ../shared/cmain.c:146
> > > (gdb) x/1i $eip
> > > 0xb76e49f3 <_Z18MemoryWriteBarrierv+3>: sfence
> > >
> > > Suggestions welcome.
> >
> > Answering my own question... I'm going to try:
> >
> >   lock; addl $0,0(%%esp)
> >
> > in place of sfence in vm/vmcore/src/thread/linux/atomics.cpp.
> 
> Yes I think this should help on processors with no SSE (not to mention
> SSE2) support.

It does.  HelloWorld runs okay with -Xint.  (Now I just need to find a
way to run the tests on a machine which boots to a small ramdisk from
compact flash and doesn't currently support network file systems.)

Without -Xint, predictably, it fails with not-immediately-helpful core
which reports:

(gdb) bt
#0  0xa649d24d in ?? ()
(gdb) x/1i $eip
0xa649d24d: (bad)  

It might be worth adding an option to the federation build compile for
a more limited processor so that people can do some testing w/-Xint - on
OLPC, Geode and VIA based machines?

> In fact VM's atomics stuff needs some unification. There are about three
> write barrier and atomic compare implementations that I know of, and
> probably several that I don't know of...

Definitely.

-Mark.




Re: [general] harmony launch failed on AMD Geode LX

2008-01-31 Thread Mark Hindess

Ilya wrote:
>
> BTW, it's odd, but Geode LX databook [1] says that this processor supports
> MMX, and 'sfence' is listed in the list of it's MMX instructions...
>
> [1] http://www.amd.com/files/connectivitysolutions/geode/geode_lx/
> 33234F_LX_databook.pdf

Actually I'm testing on a VIA C3 but it should be pretty similar since it
supports both MMX and 3dNow.

Perhaps the Geode does support sfence but my VIA C3 certainly does not and
according to:

  http://en.wikipedia.org/wiki/X86_instruction_listings

sfence is an SSE instruction.  (There is no "citation needed" so I assume
it is accurate.)

-Mark.




Re: [general] harmony launch failed on AMD Geode LX

2008-01-31 Thread Ilya Berezhniuk
BTW, it's odd, but Geode LX databook [1] says that this processor
supports MMX, and 'sfence' is listed in the list of it's MMX
instructions...

[1] 
http://www.amd.com/files/connectivitysolutions/geode/geode_lx/33234F_LX_databook.pdf

Thanks,
Ilya.

01.02.08, Ilya Berezhniuk<[EMAIL PROTECTED]> написал(а):
> Probably Geode does not need write barriers - I've found the following
> statement:
>
> "Earlier i386 CPUs (pre-Pentium-III) are fully ordered - the
> operations on the bus appear in program order - and so there's no
> requirement for any sort of explicit memory barriers"
>
> Anyway, using some locked instruction is more secure.
>
> Thanks,
> Ilya.
>
> 2008/2/1, Gregory Shimansky <[EMAIL PROTECTED]>:
> > On 1 февраля 2008 Mark Hindess wrote:
> > > On 31 January 2008 at 22:00, Mark Hindess <[EMAIL PROTECTED]>
> > wrote:
> > > > On 22 January 2008 at 20:37, Gregory Shimansky <[EMAIL PROTECTED]>
> > wrote:
> > > > > SeongCheon, Kang said the following on 22.01.2008 20:29:
> > > > > > I Installed Apache-harmony-jre-603435 on AMD Geode LX based system
> > > > > > board (PC Engines ALIX.1C) that is installed xubuntu 7.10.
> > > > > >
> > > > > > I executed Equinox OSGi service platform and harmony just prints out
> > > > > > 'illegal instruction' after 10 seconds. But, 'hello world' works
> > > > > > well. :-
> > > >
> > > > )
> > > >
> > > > > > And, I installed Sun JRE 5. Equinox OSGi service platform works well
> > > > > > on i
> > > >
> > > > t.
> > > >
> > > > > > What's the problem? Anyone has tested on AMD Geode LX or/and xubuntu
> > > > > > 7?
> > > > >
> > > > > I think it may be because it doesn't support SSE according to
> > > > > wikipedia. To make sure that it is the case you can use gdb to print
> > > > > out the failing instruction like
> > > > >
> > > > > (gdb) x/1i $eip
> > > > >
> > > > > and see what it shows and where this instruction appears (whether it 
> > > > > is
> > > > > in generated code or in Harmony compiled code).
> > > > >
> > > > > Also you can try to run the application in interpreter mode using 
> > > > > -Xint
> > > > > option for VM.
> > > >
> > > > I recompiled classlib with -march=c3 rather than -march=pentium3.  But
> > > > even with -Xint HelloWorld still dies with illegal instruction.  gdb
> > > > says:
> > > >
> > > > (gdb) bt
> > > > #0  0xb76e49f3 in MemoryWriteBarrier ()
> > > >from drlvm/bin/default/libharmonyvm.so
> > > > #1  0xb76e16f0 in String_Pool::lookup ()
> > > >from drlvm/bin/default/libharmonyvm.so
> > > > #2  0xb76e17c4 in String_Pool::lookup ()
> > > >from drlvm/bin/default/libharmonyvm.so
> > > > #3  0xb76d6a08 in Global_Env::Global_Env ()
> > > >from drlvm/bin/default/libharmonyvm.so
> > > > #4  0xb77528a4 in JNI_CreateJavaVM ()
> > > >from drlvm/bin/default/libharmonyvm.so
> > > > #5  0x08049a55 in invocation (portLibrary=0xb918, argc=5,
> > > > argv=0xbd54 ,
> > > > handle=134654592, version=65540, ignoreUnrecognized=1 '\001',
> > > > mainClass=0xbe6a "HelloWorld", classArg=4,
> > > > propertiesFileName=0x806aa00
> > > > "drlvm/bin/default/harmonyvm.properties", is StandaloneJar=0,
> > > > vmdllsubdir=0xb842 "default") at ../shared/main.c:672 #6  0x08049160
> > > > in gpProtectedMain (args=0xb8f8) at ../shared/main.c:393 #7
> > > > 0x0804b4a1 in main (argc=5, argv=0xbd54, envp=0xbd6c) at
> > > > ../shared/cmain.c:146
> > > > (gdb) x/1i $eip
> > > > 0xb76e49f3 <_Z18MemoryWriteBarrierv+3>: sfence
> > > >
> > > > Suggestions welcome.
> > >
> > > Answering my own question... I'm going to try:
> > >
> > >   lock; addl $0,0(%%esp)
> > >
> > > in place of sfence in vm/vmcore/src/thread/linux/atomics.cpp.
> >
> > Yes I think this should help on processors with no SSE (not to mention SSE2)
> > support.
> >
> > In fact VM's atomics stuff needs some unification. There are about three 
> > write
> > barrier and atomic compare implementations that I know of, and probably
> > several that I don't know of...
> >
> > --
> > Gregory
> >
>


Re: [general] harmony launch failed on AMD Geode LX

2008-01-31 Thread Ilya Berezhniuk
Probably Geode does not need write barriers - I've found the following
statement:

"Earlier i386 CPUs (pre-Pentium-III) are fully ordered - the
operations on the bus appear in program order - and so there's no
requirement for any sort of explicit memory barriers"

Anyway, using some locked instruction is more secure.

Thanks,
Ilya.

2008/2/1, Gregory Shimansky <[EMAIL PROTECTED]>:
> On 1 февраля 2008 Mark Hindess wrote:
> > On 31 January 2008 at 22:00, Mark Hindess <[EMAIL PROTECTED]>
> wrote:
> > > On 22 January 2008 at 20:37, Gregory Shimansky <[EMAIL PROTECTED]>
> wrote:
> > > > SeongCheon, Kang said the following on 22.01.2008 20:29:
> > > > > I Installed Apache-harmony-jre-603435 on AMD Geode LX based system
> > > > > board (PC Engines ALIX.1C) that is installed xubuntu 7.10.
> > > > >
> > > > > I executed Equinox OSGi service platform and harmony just prints out
> > > > > 'illegal instruction' after 10 seconds. But, 'hello world' works
> > > > > well. :-
> > >
> > > )
> > >
> > > > > And, I installed Sun JRE 5. Equinox OSGi service platform works well
> > > > > on i
> > >
> > > t.
> > >
> > > > > What's the problem? Anyone has tested on AMD Geode LX or/and xubuntu
> > > > > 7?
> > > >
> > > > I think it may be because it doesn't support SSE according to
> > > > wikipedia. To make sure that it is the case you can use gdb to print
> > > > out the failing instruction like
> > > >
> > > > (gdb) x/1i $eip
> > > >
> > > > and see what it shows and where this instruction appears (whether it is
> > > > in generated code or in Harmony compiled code).
> > > >
> > > > Also you can try to run the application in interpreter mode using -Xint
> > > > option for VM.
> > >
> > > I recompiled classlib with -march=c3 rather than -march=pentium3.  But
> > > even with -Xint HelloWorld still dies with illegal instruction.  gdb
> > > says:
> > >
> > > (gdb) bt
> > > #0  0xb76e49f3 in MemoryWriteBarrier ()
> > >from drlvm/bin/default/libharmonyvm.so
> > > #1  0xb76e16f0 in String_Pool::lookup ()
> > >from drlvm/bin/default/libharmonyvm.so
> > > #2  0xb76e17c4 in String_Pool::lookup ()
> > >from drlvm/bin/default/libharmonyvm.so
> > > #3  0xb76d6a08 in Global_Env::Global_Env ()
> > >from drlvm/bin/default/libharmonyvm.so
> > > #4  0xb77528a4 in JNI_CreateJavaVM ()
> > >from drlvm/bin/default/libharmonyvm.so
> > > #5  0x08049a55 in invocation (portLibrary=0xb918, argc=5,
> > > argv=0xbd54 ,
> > > handle=134654592, version=65540, ignoreUnrecognized=1 '\001',
> > > mainClass=0xbe6a "HelloWorld", classArg=4,
> > > propertiesFileName=0x806aa00
> > > "drlvm/bin/default/harmonyvm.properties", is StandaloneJar=0,
> > > vmdllsubdir=0xb842 "default") at ../shared/main.c:672 #6  0x08049160
> > > in gpProtectedMain (args=0xb8f8) at ../shared/main.c:393 #7
> > > 0x0804b4a1 in main (argc=5, argv=0xbd54, envp=0xbd6c) at
> > > ../shared/cmain.c:146
> > > (gdb) x/1i $eip
> > > 0xb76e49f3 <_Z18MemoryWriteBarrierv+3>: sfence
> > >
> > > Suggestions welcome.
> >
> > Answering my own question... I'm going to try:
> >
> >   lock; addl $0,0(%%esp)
> >
> > in place of sfence in vm/vmcore/src/thread/linux/atomics.cpp.
>
> Yes I think this should help on processors with no SSE (not to mention SSE2)
> support.
>
> In fact VM's atomics stuff needs some unification. There are about three write
> barrier and atomic compare implementations that I know of, and probably
> several that I don't know of...
>
> --
> Gregory
>


Re: [general] harmony launch failed on AMD Geode LX

2008-01-31 Thread Gregory Shimansky
On 1 февраля 2008 Mark Hindess wrote:
> On 31 January 2008 at 22:00, Mark Hindess <[EMAIL PROTECTED]> 
wrote:
> > On 22 January 2008 at 20:37, Gregory Shimansky <[EMAIL PROTECTED]> 
wrote:
> > > SeongCheon, Kang said the following on 22.01.2008 20:29:
> > > > I Installed Apache-harmony-jre-603435 on AMD Geode LX based system
> > > > board (PC Engines ALIX.1C) that is installed xubuntu 7.10.
> > > >
> > > > I executed Equinox OSGi service platform and harmony just prints out
> > > > 'illegal instruction' after 10 seconds. But, 'hello world' works
> > > > well. :-
> >
> > )
> >
> > > > And, I installed Sun JRE 5. Equinox OSGi service platform works well
> > > > on i
> >
> > t.
> >
> > > > What's the problem? Anyone has tested on AMD Geode LX or/and xubuntu
> > > > 7?
> > >
> > > I think it may be because it doesn't support SSE according to
> > > wikipedia. To make sure that it is the case you can use gdb to print
> > > out the failing instruction like
> > >
> > > (gdb) x/1i $eip
> > >
> > > and see what it shows and where this instruction appears (whether it is
> > > in generated code or in Harmony compiled code).
> > >
> > > Also you can try to run the application in interpreter mode using -Xint
> > > option for VM.
> >
> > I recompiled classlib with -march=c3 rather than -march=pentium3.  But
> > even with -Xint HelloWorld still dies with illegal instruction.  gdb
> > says:
> >
> > (gdb) bt
> > #0  0xb76e49f3 in MemoryWriteBarrier ()
> >from drlvm/bin/default/libharmonyvm.so
> > #1  0xb76e16f0 in String_Pool::lookup ()
> >from drlvm/bin/default/libharmonyvm.so
> > #2  0xb76e17c4 in String_Pool::lookup ()
> >from drlvm/bin/default/libharmonyvm.so
> > #3  0xb76d6a08 in Global_Env::Global_Env ()
> >from drlvm/bin/default/libharmonyvm.so
> > #4  0xb77528a4 in JNI_CreateJavaVM ()
> >from drlvm/bin/default/libharmonyvm.so
> > #5  0x08049a55 in invocation (portLibrary=0xb918, argc=5,
> > argv=0xbd54 ,
> > handle=134654592, version=65540, ignoreUnrecognized=1 '\001',
> > mainClass=0xbe6a "HelloWorld", classArg=4,
> > propertiesFileName=0x806aa00
> > "drlvm/bin/default/harmonyvm.properties", is StandaloneJar=0,
> > vmdllsubdir=0xb842 "default") at ../shared/main.c:672 #6  0x08049160
> > in gpProtectedMain (args=0xb8f8) at ../shared/main.c:393 #7 
> > 0x0804b4a1 in main (argc=5, argv=0xbd54, envp=0xbd6c) at
> > ../shared/cmain.c:146
> > (gdb) x/1i $eip
> > 0xb76e49f3 <_Z18MemoryWriteBarrierv+3>: sfence
> >
> > Suggestions welcome.
>
> Answering my own question... I'm going to try:
>
>   lock; addl $0,0(%%esp)
>
> in place of sfence in vm/vmcore/src/thread/linux/atomics.cpp.

Yes I think this should help on processors with no SSE (not to mention SSE2) 
support.

In fact VM's atomics stuff needs some unification. There are about three write 
barrier and atomic compare implementations that I know of, and probably 
several that I don't know of...

-- 
Gregory


Re: [general] harmony launch failed on AMD Geode LX

2008-01-31 Thread Mark Hindess

On 31 January 2008 at 22:00, Mark Hindess <[EMAIL PROTECTED]> wrote:
> 
> On 22 January 2008 at 20:37, Gregory Shimansky <[EMAIL PROTECTED]> wrote:
> > SeongCheon, Kang said the following on 22.01.2008 20:29:
> > > I Installed Apache-harmony-jre-603435 on AMD Geode LX based system board
> > > (PC Engines ALIX.1C) that is installed xubuntu 7.10.
> > > 
> > > I executed Equinox OSGi service platform and harmony just prints out
> > > 'illegal instruction' after 10 seconds. But, 'hello world' works well. :-
> )
> > > 
> > > And, I installed Sun JRE 5. Equinox OSGi service platform works well on i
> t.
> > > 
> > > What's the problem? Anyone has tested on AMD Geode LX or/and xubuntu 7?
> > 
> > I think it may be because it doesn't support SSE according to wikipedia.
> > To make sure that it is the case you can use gdb to print out the
> > failing instruction like
> > 
> > (gdb) x/1i $eip
> > 
> > and see what it shows and where this instruction appears (whether it is
> > in generated code or in Harmony compiled code).
> 
> > Also you can try to run the application in interpreter mode using -Xint
> > option for VM.
> 
> I recompiled classlib with -march=c3 rather than -march=pentium3.  But even
> with -Xint HelloWorld still dies with illegal instruction.  gdb says:
> 
> (gdb) bt
> #0  0xb76e49f3 in MemoryWriteBarrier ()
>from drlvm/bin/default/libharmonyvm.so
> #1  0xb76e16f0 in String_Pool::lookup ()
>from drlvm/bin/default/libharmonyvm.so
> #2  0xb76e17c4 in String_Pool::lookup ()
>from drlvm/bin/default/libharmonyvm.so
> #3  0xb76d6a08 in Global_Env::Global_Env ()
>from drlvm/bin/default/libharmonyvm.so
> #4  0xb77528a4 in JNI_CreateJavaVM ()
>from drlvm/bin/default/libharmonyvm.so
> #5  0x08049a55 in invocation (portLibrary=0xb918, argc=5, argv=0xbd54
> , 
> handle=134654592, version=65540, ignoreUnrecognized=1 '\001', 
> mainClass=0xbe6a "HelloWorld", classArg=4, 
> propertiesFileName=0x806aa00 "drlvm/bin/default/harmonyvm.properties", is
> StandaloneJar=0, vmdllsubdir=0xb842 "default") at ../shared/main.c:672
> #6  0x08049160 in gpProtectedMain (args=0xb8f8) at ../shared/main.c:393
> #7  0x0804b4a1 in main (argc=5, argv=0xbd54, envp=0xbd6c)
> at ../shared/cmain.c:146
> (gdb) x/1i $eip
> 0xb76e49f3 <_Z18MemoryWriteBarrierv+3>: sfence 
> 
> Suggestions welcome.

Answering my own question... I'm going to try:

  lock; addl $0,0(%%esp)

in place of sfence in vm/vmcore/src/thread/linux/atomics.cpp.

-Mark.




Re: [general] harmony launch failed on AMD Geode LX

2008-01-31 Thread Mark Hindess

On 22 January 2008 at 20:37, Gregory Shimansky <[EMAIL PROTECTED]> wrote:
> SeongCheon, Kang said the following on 22.01.2008 20:29:
> > I Installed Apache-harmony-jre-603435 on AMD Geode LX based system board
> > (PC Engines ALIX.1C) that is installed xubuntu 7.10.
> > 
> > I executed Equinox OSGi service platform and harmony just prints out
> > 'illegal instruction' after 10 seconds. But, 'hello world' works well. :-)
> > 
> > And, I installed Sun JRE 5. Equinox OSGi service platform works well on it.
> > 
> > What's the problem? Anyone has tested on AMD Geode LX or/and xubuntu 7?
> 
> I think it may be because it doesn't support SSE according to wikipedia.
> To make sure that it is the case you can use gdb to print out the
> failing instruction like
> 
> (gdb) x/1i $eip
> 
> and see what it shows and where this instruction appears (whether it is
> in generated code or in Harmony compiled code).

> Also you can try to run the application in interpreter mode using -Xint
> option for VM.

I recompiled classlib with -march=c3 rather than -march=pentium3.  But even
with -Xint HelloWorld still dies with illegal instruction.  gdb says:

(gdb) bt
#0  0xb76e49f3 in MemoryWriteBarrier ()
   from drlvm/bin/default/libharmonyvm.so
#1  0xb76e16f0 in String_Pool::lookup ()
   from drlvm/bin/default/libharmonyvm.so
#2  0xb76e17c4 in String_Pool::lookup ()
   from drlvm/bin/default/libharmonyvm.so
#3  0xb76d6a08 in Global_Env::Global_Env ()
   from drlvm/bin/default/libharmonyvm.so
#4  0xb77528a4 in JNI_CreateJavaVM ()
   from drlvm/bin/default/libharmonyvm.so
#5  0x08049a55 in invocation (portLibrary=0xb918, argc=5, argv=0xbd54, 
handle=134654592, version=65540, ignoreUnrecognized=1 '\001', 
mainClass=0xbe6a "HelloWorld", classArg=4, 
propertiesFileName=0x806aa00 "drlvm/bin/default/harmonyvm.properties", 
isStandaloneJar=0, vmdllsubdir=0xb842 "default") at ../shared/main.c:672
#6  0x08049160 in gpProtectedMain (args=0xb8f8) at ../shared/main.c:393
#7  0x0804b4a1 in main (argc=5, argv=0xbd54, envp=0xbd6c)
at ../shared/cmain.c:146
(gdb) x/1i $eip
0xb76e49f3 <_Z18MemoryWriteBarrierv+3>: sfence 

Suggestions welcome.
  
-Mark.




Re: [general] harmony launch failed on AMD Geode LX

2008-01-22 Thread Mark Hindess

I think you'll also need to recompile the classlib natives.  By default
it compiles for -march=pentium3 which includes SSE.

Try editing:

  depends/build/platform/linux.x86.mk

The closest option is probably -march=c3 but maybe just try -march=i586 to
begin with.

I might take a look at DRLVM on a machine with a similar processor (VIA
Samuel 2) later.

Regards,
 Mark.

On 22 January 2008 at 20:37, Gregory Shimansky <[EMAIL PROTECTED]> wrote:
> SeongCheon, Kang said the following on 22.01.2008 20:29:
> > I Installed Apache-harmony-jre-603435 on AMD Geode LX based system board
> > (PC Engines ALIX.1C) that is installed xubuntu 7.10.
> > 
> > I executed Equinox OSGi service platform and harmony just prints out
> > 'illegal instruction' after 10 seconds. But, 'hello world' works well. :-)
> > 
> > And, I installed Sun JRE 5. Equinox OSGi service platform works well on it.
> > 
> > What's the problem? Anyone has tested on AMD Geode LX or/and xubuntu 7?
> 
> I think it may be because it doesn't support SSE according to wikipedia.
> To make sure that it is the case you can use gdb to print out the
> failing instruction like
> 
> (gdb) x/1i $eip
> 
> and see what it shows and where this instruction appears (whether it is
> in generated code or in Harmony compiled code).
> 
> Also you can try to run the application in interpreter mode using -Xint
> option for VM.
> 
> -- 
> Gregory
> 




Re: [general] harmony launch failed on AMD Geode LX

2008-01-22 Thread Gregory Shimansky
SeongCheon, Kang said the following on 22.01.2008 20:29:
> I Installed Apache-harmony-jre-603435 on AMD Geode LX based system board
> (PC Engines ALIX.1C) that is installed xubuntu 7.10.
> 
> I executed Equinox OSGi service platform and harmony just prints out
> 'illegal instruction' after 10 seconds. But, 'hello world' works well. :-)
> 
> And, I installed Sun JRE 5. Equinox OSGi service platform works well on it.
> 
> What's the problem? Anyone has tested on AMD Geode LX or/and xubuntu 7?

I think it may be because it doesn't support SSE according to wikipedia.
To make sure that it is the case you can use gdb to print out the
failing instruction like

(gdb) x/1i $eip

and see what it shows and where this instruction appears (whether it is
in generated code or in Harmony compiled code).

Also you can try to run the application in interpreter mode using -Xint
option for VM.

-- 
Gregory