JIT: change how we block gc refs from callee saves for inline pinvokes (dotnet/corecl...
authorAndy Ayers <andya@microsoft.com>
Tue, 12 Feb 2019 16:22:47 +0000 (08:22 -0800)
committerGitHub <noreply@github.com>
Tue, 12 Feb 2019 16:22:47 +0000 (08:22 -0800)
commit112d5c173d5ea269d271eaa8924d511acc3d25c0
treef008ce302f64c2500b6ab9528d97bdbcf80b8324
parenta39023edfd886e6ac3a38a2127a73c9aea79a6c1
JIT: change how we block gc refs from callee saves for inline pinvokes (dotnet/coreclr#22477)

Add a new marker instruction that we emit once we've enabled preepmtive gc in
the inline pinvoke method prolog. Use that to kill off callee saves registers
with GC references, instead of waiting until the call.

This closes a window of vulnerability we see in GC stress where if a stress
interrupt happens between the point at which we enable preeemptive GC and
the point at which we make the call, we may report callee saves as GC live
when they're actually dead.

Closes dotnet/coreclr#19211.

Commit migrated from https://github.com/dotnet/coreclr/commit/6cd9e3ab6cae4aaf2a70fe1e59173b998932601d
13 files changed:
src/coreclr/src/jit/codegenarmarch.cpp
src/coreclr/src/jit/codegenxarch.cpp
src/coreclr/src/jit/compiler.cpp
src/coreclr/src/jit/compiler.h
src/coreclr/src/jit/compiler.hpp
src/coreclr/src/jit/gentree.cpp
src/coreclr/src/jit/gtlist.h
src/coreclr/src/jit/liveness.cpp
src/coreclr/src/jit/lower.cpp
src/coreclr/src/jit/lsraarm.cpp
src/coreclr/src/jit/lsraarm64.cpp
src/coreclr/src/jit/lsrabuild.cpp
src/coreclr/src/jit/lsraxarch.cpp