Hi All,
thanks to hard work by Tim Rowledge and Lars Wasserman we now have a functional JIT for the ARM in the simulator. We're still probably some weeks away from a functional ARM JIT VM; issues like instruction cache flushing on real hardware can be tricky to solve. But we're at least ready to start trying to compile the JIT VM for ARM. Doug, see that I added a build directory for build.linux32ARM/squeak.cog.spur. Hopefully a fast VM for Raspberry Pi and Android is only a few weeks away.
On 22 Apr 2015, at 14:42, Eliot Miranda eliot.miranda@gmail.com wrote:
Hi,
thanks to hard work by Tim Rowledge and Lars Wasserman we now have a functional JIT for the ARM in the simulator. We're still probably some weeks away from a functional ARM JIT VM; issues like instruction cache flushing on real hardware can be tricky to solve. But we're at least ready to start trying to compile the JIT VM for ARM. Doug, see that I added a build directory for build.linux32ARM/squeak.cog.spur. Hopefully a fast VM for Raspberry Pi and Android is only a few weeks away.
tricky in which sense? The Linux kernel offers a syscall (cacheflush) where one provides the start page and end page and GCC provides a builtin function for this as well (__clear_cache).
holger
cache flush: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/ar...
Hi Holger,
On Wed, Apr 22, 2015 at 11:52 AM, Holger Freyther holger@freyther.de wrote:
On 22 Apr 2015, at 14:42, Eliot Miranda eliot.miranda@gmail.com wrote:
Hi,
thanks to hard work by Tim Rowledge and Lars Wasserman we now have a
functional JIT for the ARM in the simulator. We're still probably some weeks away from a functional ARM JIT VM; issues like instruction cache flushing on real hardware can be tricky to solve. But we're at least ready to start trying to compile the JIT VM for ARM. Doug, see that I added a build directory for build.linux32ARM/squeak.cog.spur. Hopefully a fast VM for Raspberry Pi and Android is only a few weeks away.
tricky in which sense? The Linux kernel offers a syscall (cacheflush) where one provides the start page and end page and GCC provides a builtin function for this as well (__clear_cache).
that's good news. It wasn't always that easy. When we got the ARM JIT working for VisualWorks we had to use hand-rolled code to flush the cache as linux didn't provide a reliable function at that time. So perhaps we're closer than we think. But it's always wise to lengthen time estimates, not shorten them :-)
holger
cache flush:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/ar...
And this code (pulled from the Pi forum, written by ???) demonstrates - #include <stdio.h> #include <sys/mman.h> #include <stdint.h> #include <stdlib.h>
int inc(int x){ //increments x
uint32_t *ret = mmap(NULL, 2 * sizeof(uint32_t), // Space for 16 instructions. (More than enough.) PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, -1,0); if (ret == MAP_FAILED) { printf("Could not mmap a memory buffer with the proper permissions.\n"); return -1; }
*(ret + 0) = 0xE2800001; //add r0 r0 #1 := r0 += 1 *(ret + 1) = 0xE12FFF1E; //bx lr := jump back to inc()
__clear_cache((char*) ret, (char*) (ret+2));
int(*f)(int) = (int (*)(int)) ret; return (*f)(x); }
int main(){ printf("%d\n",inc(6)); //expect '7' to be printed exit(0);}
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Strange OpCodes: YVR: Branch to Vancouver
On Apr 22, 2015, at 11:42, Eliot Miranda eliot.miranda@gmail.com wrote:
Hi All,
thanks to hard work by Tim Rowledge and Lars Wasserman we now have a functional JIT for the ARM in the simulator. We're still probably some weeks away from a functional ARM JIT VM; issues like instruction cache flushing on real hardware can be tricky to solve. But we're at least ready to start trying to compile the JIT VM for ARM. Doug, see that I added a build directory for build.linux32ARM/squeak.cog.spur. Hopefully a fast VM for Raspberry Pi and Android is only a few weeks away.
-- best, Eliot
+1000 This is terrific news! Thanks to you, Tim, and Lars!
Doug
vm-dev@lists.squeakfoundation.org