Bug#722248: [Pkg-haskell-maintainers] Bug#722248: ghci not provided on arm

2013-09-11 Thread Thomas Preud'homme
Le mardi 10 septembre 2013 18:23:42 Colin Watson a écrit :
 
 Thanks for looking into this further.
 
 I think that inlining the cache flush will mean that every chunk of
 bytecode assembled by the interpreter will flush the instruction cache
 every time it's called.  It will be even slower than it's necessary for
 it to be.  That in itself would probably be tolerable.
 
 Much more importantly, though, this patch misses the point of flushing
 the instruction cache.  The point is that we need to flush the cache in
 order for the processor to reliably read back the code that we just
 wrote out; flushing the cache in that very code is not a viable approach
 to that, because the cache-flushing code itself might not be read.  So
 I'm afraid I don't think this is going to work properly.  It might work
 some of the time, of course, depending on cache locality, but I can't
 see how it would work reliably.

My apologize, I didn't realize this was the generated code. I don't know if 
it's because of the language but I can't make much sense of what the code is 
doing. I assumed this code was some jit compiler and that the jump was 
executed when a function has just been compiled in order to actually call that 
function. If it's part of the generated function indeed it's very suboptimal 
and won't work as you very well explained.

My apologize but I don't think I can bring this further without investing 
quite some time to understand the code.

 
 I would suggest testing whether some reasonable stack actually builds
 with this; I don't know how much testing you did but it e.g. isn't
 enough to just start ghci.  Perhaps see if haskell-conduit runs its
 doctests successfully during build.

You're right, I should have done so. I don't know anything about ghc and I 
didn't know how to test it. I should have searched a bit on google, probably I 
would have found some code sample easily but I guess I lacked motivation.

Thanks for being so quick in looking at the patch.

Best regards,

Thomas

signature.asc
Description: This is a digitally signed message part.


Bug#722248: [Pkg-haskell-maintainers] Bug#722248: ghci not provided on arm

2013-09-10 Thread Colin Watson
On Tue, Sep 10, 2013 at 06:35:56PM +0200, Joachim Breitner wrote:
 Am Montag, den 09.09.2013, 14:37 +0200 schrieb Thomas Preud'homme:
  please reenable ghci on arm as it prevents many package from building. I
  improved on the patch proposed upstream and it works on porterbox. Maybe
  you could give it a try in experimental. See the patch in the attached
  file.
 
 you looked into that issue last. Can you evaluate that patch?

Thanks for looking into this further.

I think that inlining the cache flush will mean that every chunk of
bytecode assembled by the interpreter will flush the instruction cache
every time it's called.  It will be even slower than it's necessary for
it to be.  That in itself would probably be tolerable.

Much more importantly, though, this patch misses the point of flushing
the instruction cache.  The point is that we need to flush the cache in
order for the processor to reliably read back the code that we just
wrote out; flushing the cache in that very code is not a viable approach
to that, because the cache-flushing code itself might not be read.  So
I'm afraid I don't think this is going to work properly.  It might work
some of the time, of course, depending on cache locality, but I can't
see how it would work reliably.


Other things we need to do after this is fixed:

We should include my R_ARM_V4BX relocation patch too in order to support
armel.  See:

  http://lists.debian.org/debian-haskell/2013/05/msg00054.html

I would suggest testing whether some reasonable stack actually builds
with this; I don't know how much testing you did but it e.g. isn't
enough to just start ghci.  Perhaps see if haskell-conduit runs its
doctests successfully during build.

Sorry,

-- 
Colin Watson   [cjwat...@debian.org]


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#722248: [Pkg-haskell-maintainers] Bug#722248: ghci not provided on arm

2013-09-10 Thread Joachim Breitner
Dear Colin,

Am Montag, den 09.09.2013, 14:37 +0200 schrieb Thomas Preud'homme:
 Dear Maintainer,
 
 please reenable ghci on arm as it prevents many package from building. I
 improved on the patch proposed upstream and it works on porterbox. Maybe
 you could give it a try in experimental. See the patch in the attached
 file.

you looked into that issue last. Can you evaluate that patch?

Greetings,
Joachim

-- 
Joachim nomeata Breitner
Debian Developer
  nome...@debian.org | ICQ# 74513189 | GPG-Keyid: 4743206C
  JID: nome...@joachim-breitner.de | http://people.debian.org/~nomeata




signature.asc
Description: This is a digitally signed message part


Bug#722248: ghci not provided on arm

2013-09-09 Thread Thomas Preud'homme
Source: ghc
Version: 7.6.3-4
Severity: wishlist
Tags: patch upstream

Dear Maintainer,

please reenable ghci on arm as it prevents many package from building. I
improved on the patch proposed upstream and it works on porterbox. Maybe
you could give it a try in experimental. See the patch in the attached
file.

Best regards.


-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'oldstable-updates'), (500, 'testing'), 
(500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.10-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Description: Add ARM implementation for mkJumpToAddr
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 ghc (7.6.3-4) unstable; urgency=low
 .
   [ Colin Watson ]
   * Enable verbose build output (see
 http://lists.debian.org/debian-devel/2013/06/msg00539.html).
 .
   [ Gianfranco Costamagna ]
 .
   * Switch to llvm (Closes: #711948)
   * removed deprecated DM-Upload-Allowed
   * removed some version checks, higher versions are already in oldstable.
   * Added dpkg-buildflags as build-dep, fixing lintian warning.
Author: Joachim Breitner nome...@debian.org
Bug-Debian: http://bugs.debian.org/711948

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: vendor|upstream|other, url of original patch
Bug: url in upstream bugtracker
Bug-Debian: http://bugs.debian.org/bugnumber
Bug-Ubuntu: https://launchpad.net/bugs/bugnumber
Forwarded: no|not-needed|url proving that it has been forwarded
Reviewed-By: name and email of someone who approved the patch
Last-Update: -MM-DD

--- ghc-7.6.3.orig/compiler/ghci/ByteCodeItbls.lhs
+++ ghc-7.6.3/compiler/ghci/ByteCodeItbls.lhs
@@ -242,6 +242,18 @@ mkJumpToAddr a
   , fromIntegral ((w64 `shiftR` 32) .. 0x) ]
 where w64 = fromIntegral (ptrToInt a) :: Word64
 
+#elif arm_TARGET_ARCH
+type ItblCode = Word32
+mkJumpToAddr a
+= [ 0xe92d0080  -- push{r7}
+  , 0xe3a0780f  -- mov r7, #983040 ; 0xf
+  , 0xe2877002  -- add r7, r7, #2
+  , 0xe3a02000  -- mov r2, #0
+  , 0xef00  -- swi 0x0
+  , 0xe8bd0080  -- pop {r7}
+  , 0xe51ff004  -- ldr pc, [pc, #-4]# pc reads as current insn+8
+  , fromIntegral (ptrToInt a) ]
+
 #else
 type ItblCode = Word32
 mkJumpToAddr a