[GHC] #10244: "memory barriers unimplemented on this architecture" on ARM pre-ARMv7

#10244: "memory barriers unimplemented on this architecture" on ARM pre-ARMv7 -------------------------------------+------------------------------------- Reporter: rwbarton | Owner: simonmar Type: bug | Status: new Priority: normal | Milestone: Component: Runtime | Version: 7.10.1 System | Operating System: Unknown/Multiple Keywords: | Type of failure: Building GHC Architecture: arm | failed Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -------------------------------------+------------------------------------- Phab:D33 broke the build on ARM pre-ARMv7, because there is no definition of `store_load_barrier` or `load_load_barrier` for those platforms. (Granted, the old fall-back behavior of doing nothing was almost certainly incorrect.) I don't know whether we need CPU-level barriers here, or whether they are available. At a minimum, we need a compiler-level barrier. If we need a CPU-level barrier and it isn't provided by the instruction set, then I guess we should disable SMP for these platforms in `mk/config.mk.in`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10244 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10244: "memory barriers unimplemented on this architecture" on ARM pre-ARMv7 -------------------------------------+------------------------------------- Reporter: rwbarton | Owner: simonmar Type: bug | Status: new Priority: normal | Milestone: 7.10.2 Component: Runtime System | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: arm Type of failure: Building GHC | Test Case: failed | Blocking: Blocked By: | Differential Revisions: Related Tickets: | -------------------------------------+------------------------------------- Changes (by nomeata): * cc: eridk, cjwatson (added) * milestone: => 7.10.2 Comment: This obviously affects distributions. If someone finds a fix, can we backport this to 7.10? (Setting milestone to 7.10.2, but 7.10.3 would be fine with me as well.) Adding Erik and Colin to the CC list, they might know more about this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10244#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10244: "memory barriers unimplemented on this architecture" on ARM pre-ARMv7 -------------------------------------+------------------------------------- Reporter: rwbarton | Owner: simonmar Type: bug | Status: new Priority: normal | Milestone: 7.10.2 Component: Runtime System | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: arm Type of failure: Building GHC | Test Case: failed | Blocking: Blocked By: | Differential Revisions: Related Tickets: | -------------------------------------+------------------------------------- Changes (by slyfox): * cc: slyfox (added) Comment: Do you have a particular build error? I wonder what else is visible there. From what I see in the '''includes/stg/SMP.h''' it's just omission in implementation. There is properly-looking '''write_barrier''' {{{ EXTERN_INLINE void write_barrier(void) { ... #elif arm_HOST_ARCH && defined(arm_HOST_ARCH_PRE_ARMv7) __asm__ __volatile__ ("" : : : "memory"); #elif (arm_HOST_ARCH && !defined(arm_HOST_ARCH_PRE_ARMv7)) || aarch64_HOST_ARCH __asm__ __volatile__ ("dmb st" : : : "memory"); ... }}} but not load_load: {{{ EXTERN_INLINE void load_load_barrier(void) { ... #elif arm_HOST_ARCH && !defined(arm_HOST_ARCH_PRE_ARMv7) __asm__ __volatile__ ("dmb" : : : "memory"); ... }}} I think stubbing out with {{{ __asm__ __volatile__ ("" : : : "memory"); }}} is best we can do there. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10244#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10244: "memory barriers unimplemented on this architecture" on ARM pre-ARMv7 -------------------------------------+------------------------------------- Reporter: rwbarton | Owner: simonmar Type: bug | Status: new Priority: normal | Milestone: 7.10.2 Component: Runtime System | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: arm Type of failure: Building GHC | Test Case: failed | Blocking: Blocked By: | Differential Revisions: Related Tickets: | -------------------------------------+------------------------------------- Comment (by slyfox): Can you try this patch on a real host to see if it's the only omission? If it's fine I'll make a proper Phab DR. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10244#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10244: "memory barriers unimplemented on this architecture" on ARM pre-ARMv7 -------------------------------------+------------------------------------- Reporter: rwbarton | Owner: simonmar Type: bug | Status: new Priority: normal | Milestone: 7.10.2 Component: Runtime System | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: arm Type of failure: Building GHC | Test Case: failed | Blocking: Blocked By: | Differential Revisions: Related Tickets: | -------------------------------------+------------------------------------- Comment (by cjwatson): You can do a little better for ARMv6 with mcr p15: the [https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/ar... Linux kernel] has some examples. I don't know if this is worth bothering with in practice though. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10244#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10244: "memory barriers unimplemented on this architecture" on ARM pre-ARMv7 -------------------------------------+------------------------------------- Reporter: rwbarton | Owner: simonmar Type: bug | Status: new Priority: normal | Milestone: 7.10.2 Component: Runtime System | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: arm Type of failure: Building GHC | Test Case: failed | Blocking: Blocked By: | Differential Revisions: Related Tickets: | -------------------------------------+------------------------------------- Comment (by nomeata): I’ll simply apply the patch to the Debian package and upload to Debian experimental. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10244#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10244: "memory barriers unimplemented on this architecture" on ARM pre-ARMv7 -------------------------------------+------------------------------------- Reporter: rwbarton | Owner: simonmar Type: bug | Status: patch Priority: normal | Milestone: 7.10.2 Component: Runtime System | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: arm Type of failure: Building GHC | Test Case: failed | Blocking: Blocked By: | Differential Revisions: Phab:D894 Related Tickets: | -------------------------------------+------------------------------------- Changes (by slyfox): * status: new => patch * differential: => Phab:D894 Comment: Created DR with a more detailed comment https://phabricator.haskell.org/D894 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10244#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10244: "memory barriers unimplemented on this architecture" on ARM pre-ARMv7
-------------------------------------+-------------------------------------
Reporter: rwbarton | Owner: simonmar
Type: bug | Status: patch
Priority: normal | Milestone: 7.10.2
Component: Runtime System | Version: 7.10.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture: arm
Type of failure: Building GHC | Test Case:
failed | Blocking:
Blocked By: | Differential Revisions: Phab:D894
Related Tickets: |
-------------------------------------+-------------------------------------
Comment (by Sergei Trofimovich

#10244: "memory barriers unimplemented on this architecture" on ARM pre-ARMv7 -------------------------------------+------------------------------------- Reporter: rwbarton | Owner: simonmar Type: bug | Status: closed Priority: normal | Milestone: 7.10.2 Component: Runtime System | Version: 7.10.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: arm Type of failure: Building GHC | Test Case: failed | Blocking: Blocked By: | Differential Revisions: Phab:D894 Related Tickets: | -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: patch => closed * resolution: => fixed Comment: I've merged this to `ghc-7.10` - also, Reid, I committed 753b156dc6b0c38b106c390952750fb800bf27e7 copying your comments from Phab:D894 - so we can hopefully fix the problem you pointed out in the future. We should probably open a bug for this, though... -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10244#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10244: "memory barriers unimplemented on this architecture" on ARM pre-ARMv7 -------------------------------------+------------------------------------- Reporter: rwbarton | Owner: simonmar Type: bug | Status: closed Priority: normal | Milestone: 7.10.2 Component: Runtime System | Version: 7.10.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: arm Type of failure: Building GHC | Test Case: failed | Blocking: Blocked By: | Differential Revisions: Phab:D894 Related Tickets: #10433 | -------------------------------------+------------------------------------- Changes (by thoughtpolice): * related: => #10433 Comment: Note: I've filed #10433 as a follow up. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10244#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10244: "memory barriers unimplemented on this architecture" on ARM pre-ARMv7 -------------------------------------+------------------------------------- Reporter: rwbarton | Owner: simonmar Type: bug | Status: closed Priority: normal | Milestone: 7.10.2 Component: Runtime System | Version: 7.10.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: arm Type of failure: Building GHC | Test Case: failed | Blocking: Blocked By: | Differential Revisions: Phab:D894 Related Tickets: #10433 | -------------------------------------+------------------------------------- Comment (by rwbarton): Looks good, thanks! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10244#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC