<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/haskell.git, branch wip/ghc-8.8-merges</title>
<subtitle>gitlab.haskell.org: ghc/ghc.git
</subtitle>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/haskell.git/'/>
<entry>
<title>Bump parsec submodule to 3.1.14.0</title>
<updated>2019-07-04T14:43:50+00:00</updated>
<author>
<name>Ben Gamari</name>
<email>ben@smart-cactus.org</email>
</author>
<published>2019-07-03T05:45:50+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/haskell.git/commit/?id=9ce7a9452e424a3a9c6bec437a0fda0396f0e8b7'/>
<id>9ce7a9452e424a3a9c6bec437a0fda0396f0e8b7</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Disable fragile test cases: T14697 T5559 T3424</title>
<updated>2019-07-01T20:55:37+00:00</updated>
<author>
<name>Vladislav Zavialov</name>
<email>vlad.z.4096@gmail.com</email>
</author>
<published>2019-02-23T22:03:35+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/haskell.git/commit/?id=c8826ab0a2de2293796b61a360fd5b4e7a6b5edb'/>
<id>c8826ab0a2de2293796b61a360fd5b4e7a6b5edb</id>
<content type='text'>
See Trac #15072, Trac #16349, Trac #16350

(cherry picked from commit 14586f5d737ec5dc828633267b50dcf0d47e1696)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
See Trac #15072, Trac #16349, Trac #16350

(cherry picked from commit 14586f5d737ec5dc828633267b50dcf0d47e1696)
</pre>
</div>
</content>
</entry>
<entry>
<title>Initial commit of dump-interfaces</title>
<updated>2019-07-01T16:05:07+00:00</updated>
<author>
<name>Ben Gamari</name>
<email>ben@smart-cactus.org</email>
</author>
<published>2019-07-01T15:52:47+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/haskell.git/commit/?id=29d297b540486bb4ea0127e7f61c8faf76f60267'/>
<id>29d297b540486bb4ea0127e7f61c8faf76f60267</id>
<content type='text'>
This is the initial commit of a utility that I have been using to
compare the user-facing interfaces exposed by GHC across releases
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is the initial commit of a utility that I have been using to
compare the user-facing interfaces exposed by GHC across releases
</pre>
</div>
</content>
</entry>
<entry>
<title>Correct closure observation, construction, and mutation on weak memory machines.</title>
<updated>2019-06-30T11:41:58+00:00</updated>
<author>
<name>Travis Whitaker</name>
<email>pi.boy.travis@gmail.com</email>
</author>
<published>2019-04-03T22:26:16+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/haskell.git/commit/?id=cc2f96d263e4f35e7d9132db3e6ed9727fb2a45b'/>
<id>cc2f96d263e4f35e7d9132db3e6ed9727fb2a45b</id>
<content type='text'>
Here the following changes are introduced:
    - A read barrier machine op is added to Cmm.
    - The order in which a closure's fields are read and written is changed.
    - Memory barriers are added to RTS code to ensure correctness on
      out-or-order machines with weak memory ordering.

Cmm has a new CallishMachOp called MO_ReadBarrier. On weak memory machines, this
is lowered to an instruction that ensures memory reads that occur after said
instruction in program order are not performed before reads coming before said
instruction in program order. On machines with strong memory ordering properties
(e.g. X86, SPARC in TSO mode) no such instruction is necessary, so
MO_ReadBarrier is simply erased. However, such an instruction is necessary on
weakly ordered machines, e.g. ARM and PowerPC.

Weam memory ordering has consequences for how closures are observed and mutated.
For example, consider a closure that needs to be updated to an indirection. In
order for the indirection to be safe for concurrent observers to enter, said
observers must read the indirection's info table before they read the
indirectee. Furthermore, the entering observer makes assumptions about the
closure based on its info table contents, e.g. an INFO_TYPE of IND imples the
closure has an indirectee pointer that is safe to follow.

When a closure is updated with an indirection, both its info table and its
indirectee must be written. With weak memory ordering, these two writes can be
arbitrarily reordered, and perhaps even interleaved with other threads' reads
and writes (in the absence of memory barrier instructions). Consider this
example of a bad reordering:

- An updater writes to a closure's info table (INFO_TYPE is now IND).
- A concurrent observer branches upon reading the closure's INFO_TYPE as IND.
- A concurrent observer reads the closure's indirectee and enters it. (!!!)
- An updater writes the closure's indirectee.

Here the update to the indirectee comes too late and the concurrent observer has
jumped off into the abyss. Speculative execution can also cause us issues,
consider:

- An observer is about to case on a value in closure's info table.
- The observer speculatively reads one or more of closure's fields.
- An updater writes to closure's info table.
- The observer takes a branch based on the new info table value, but with the
  old closure fields!
- The updater writes to the closure's other fields, but its too late.

Because of these effects, reads and writes to a closure's info table must be
ordered carefully with respect to reads and writes to the closure's other
fields, and memory barriers must be placed to ensure that reads and writes occur
in program order. Specifically, updates to a closure must follow the following
pattern:

- Update the closure's (non-info table) fields.
- Write barrier.
- Update the closure's info table.

Observing a closure's fields must follow the following pattern:

- Read the closure's info pointer.
- Read barrier.
- Read the closure's (non-info table) fields.

This patch updates RTS code to obey this pattern. This should fix long-standing
SMP bugs on ARM (specifically newer aarch64 microarchitectures supporting
out-of-order execution) and PowerPC. This fixes issue #15449.

Co-Authored-By: Ben Gamari &lt;ben@well-typed.com&gt;
(cherry picked from commit 11bac11545b19a63f5cec3c5bbd5c3f9a7dae0b2)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Here the following changes are introduced:
    - A read barrier machine op is added to Cmm.
    - The order in which a closure's fields are read and written is changed.
    - Memory barriers are added to RTS code to ensure correctness on
      out-or-order machines with weak memory ordering.

Cmm has a new CallishMachOp called MO_ReadBarrier. On weak memory machines, this
is lowered to an instruction that ensures memory reads that occur after said
instruction in program order are not performed before reads coming before said
instruction in program order. On machines with strong memory ordering properties
(e.g. X86, SPARC in TSO mode) no such instruction is necessary, so
MO_ReadBarrier is simply erased. However, such an instruction is necessary on
weakly ordered machines, e.g. ARM and PowerPC.

Weam memory ordering has consequences for how closures are observed and mutated.
For example, consider a closure that needs to be updated to an indirection. In
order for the indirection to be safe for concurrent observers to enter, said
observers must read the indirection's info table before they read the
indirectee. Furthermore, the entering observer makes assumptions about the
closure based on its info table contents, e.g. an INFO_TYPE of IND imples the
closure has an indirectee pointer that is safe to follow.

When a closure is updated with an indirection, both its info table and its
indirectee must be written. With weak memory ordering, these two writes can be
arbitrarily reordered, and perhaps even interleaved with other threads' reads
and writes (in the absence of memory barrier instructions). Consider this
example of a bad reordering:

- An updater writes to a closure's info table (INFO_TYPE is now IND).
- A concurrent observer branches upon reading the closure's INFO_TYPE as IND.
- A concurrent observer reads the closure's indirectee and enters it. (!!!)
- An updater writes the closure's indirectee.

Here the update to the indirectee comes too late and the concurrent observer has
jumped off into the abyss. Speculative execution can also cause us issues,
consider:

- An observer is about to case on a value in closure's info table.
- The observer speculatively reads one or more of closure's fields.
- An updater writes to closure's info table.
- The observer takes a branch based on the new info table value, but with the
  old closure fields!
- The updater writes to the closure's other fields, but its too late.

Because of these effects, reads and writes to a closure's info table must be
ordered carefully with respect to reads and writes to the closure's other
fields, and memory barriers must be placed to ensure that reads and writes occur
in program order. Specifically, updates to a closure must follow the following
pattern:

- Update the closure's (non-info table) fields.
- Write barrier.
- Update the closure's info table.

Observing a closure's fields must follow the following pattern:

- Read the closure's info pointer.
- Read barrier.
- Read the closure's (non-info table) fields.

This patch updates RTS code to obey this pattern. This should fix long-standing
SMP bugs on ARM (specifically newer aarch64 microarchitectures supporting
out-of-order execution) and PowerPC. This fixes issue #15449.

Co-Authored-By: Ben Gamari &lt;ben@well-typed.com&gt;
(cherry picked from commit 11bac11545b19a63f5cec3c5bbd5c3f9a7dae0b2)
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix GCC warnings with __clear_cache builtin (#16867)</title>
<updated>2019-06-30T11:40:34+00:00</updated>
<author>
<name>Sylvain Henry</name>
<email>sylvain@haskus.fr</email>
</author>
<published>2019-06-25T16:53:22+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/haskell.git/commit/?id=8706cebc4b97a161c2005af788174e26f7881a73'/>
<id>8706cebc4b97a161c2005af788174e26f7881a73</id>
<content type='text'>
(cherry picked from commit 4ec233ecfc7f061c19d0c5ef98ad05719b1161e7)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(cherry picked from commit 4ec233ecfc7f061c19d0c5ef98ad05719b1161e7)
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix Happy deps for Stack (#16825)</title>
<updated>2019-06-30T11:40:28+00:00</updated>
<author>
<name>Sylvain Henry</name>
<email>sylvain@haskus.fr</email>
</author>
<published>2019-06-24T16:36:07+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/haskell.git/commit/?id=6e255b62a998632f83cd1ae73b6673b9088694c2'/>
<id>6e255b62a998632f83cd1ae73b6673b9088694c2</id>
<content type='text'>
(cherry picked from commit 90e0ab7d80d88463df97bc3514fc89d2ab9fcfca)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(cherry picked from commit 90e0ab7d80d88463df97bc3514fc89d2ab9fcfca)
</pre>
</div>
</content>
</entry>
<entry>
<title>getExecutablePath: get path from sysctl on FreeBSD</title>
<updated>2019-06-30T11:40:21+00:00</updated>
<author>
<name>Fraser Tweedale</name>
<email>frase@frase.id.au</email>
</author>
<published>2019-06-25T02:17:30+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/haskell.git/commit/?id=59fdb0f50c65f612530f8a06a1014aa810a03489'/>
<id>59fdb0f50c65f612530f8a06a1014aa810a03489</id>
<content type='text'>
(cherry picked from commit d35cec7a9c07a0fc3b40e45d64e5794c3567a523)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(cherry picked from commit d35cec7a9c07a0fc3b40e45d64e5794c3567a523)
</pre>
</div>
</content>
</entry>
<entry>
<title>typo in the docs for DynFlags.hs</title>
<updated>2019-06-30T11:39:49+00:00</updated>
<author>
<name>Artem Pelenitsyn</name>
<email>a.pelenitsyn@gmail.com</email>
</author>
<published>2019-06-26T08:33:17+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/haskell.git/commit/?id=406a13830e82dab45a599c92199e82853af8108c'/>
<id>406a13830e82dab45a599c92199e82853af8108c</id>
<content type='text'>
(cherry picked from commit ef6d9a50db115e296d2d9bec3e94c7369f1d504c)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(cherry picked from commit ef6d9a50db115e296d2d9bec3e94c7369f1d504c)
</pre>
</div>
</content>
</entry>
<entry>
<title>Disable automatic use of -fobject-code due to #16876</title>
<updated>2019-06-27T17:59:52+00:00</updated>
<author>
<name>Ben Gamari</name>
<email>ben@smart-cactus.org</email>
</author>
<published>2019-06-27T03:14:32+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/haskell.git/commit/?id=e20fe447e1930fcb8d019904d1b26b4312a83522'/>
<id>e20fe447e1930fcb8d019904d1b26b4312a83522</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>testsuite: Unbreak T16608 tests</title>
<updated>2019-06-27T03:09:52+00:00</updated>
<author>
<name>Ben Gamari</name>
<email>ben@smart-cactus.org</email>
</author>
<published>2019-06-25T03:31:44+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/haskell.git/commit/?id=d15861a57003e0fbef1ce30e2944bef50763b5a2'/>
<id>d15861a57003e0fbef1ce30e2944bef50763b5a2</id>
<content type='text'>
Sleep to avoid non-determinism due to Darwin's poor mtime resolution.
Fixes #16855.

(cherry picked from commit b90437d8b5c2727450cf45b12fd65cc87a8ab80e)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Sleep to avoid non-determinism due to Darwin's poor mtime resolution.
Fixes #16855.

(cherry picked from commit b90437d8b5c2727450cf45b12fd65cc87a8ab80e)
</pre>
</div>
</content>
</entry>
</feed>
