• Austin Clements's avatar
    runtime: check alignment of 8-byte atomic loads and stores on 386 · 7a71726b
    Austin Clements authored
    Currently, if we do an atomic{load,store}64 of an unaligned address on
    386, we'll simply get a non-atomic load/store.  This has been the
    source of myriad bugs, so add alignment checks to these two
    operations.  These checks parallel the equivalent checks in
    sync/atomic.
    
    The alignment check is not necessary in cas64 because it uses a locked
    instruction.  The CPU will either execute this atomically or raise an
    alignment fault (#AC)---depending on the alignment check flag---either
    of which is fine.
    
    This also fixes the two places in the runtime that trip the new
    checks.  One is in the runtime self-test and shouldn't have caused
    real problems.  The other is in tickspersecond and could, in
    principle, have caused a misread of the ticks per second during
    initialization.
    
    Change-Id: If1796667012a6154f64f5e71d043c7f5fb3dd050
    Reviewed-on: https://go-review.googlesource.com/3521Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
    7a71726b
Name
Last commit
Last update
api Loading commit data...
doc Loading commit data...
include Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...