From 6cd9e3ab6cae4aaf2a70fe1e59173b998932601d Mon Sep 17 00:00:00 2001 From: Andy Ayers Date: Tue, 12 Feb 2019 08:22:47 -0800 Subject: JIT: change how we block gc refs from callee saves for inline pinvokes (#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 #19211. --- src/jit/gtlist.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/jit/gtlist.h') diff --git a/src/jit/gtlist.h b/src/jit/gtlist.h index eb8b0a883a..dd23db486b 100644 --- a/src/jit/gtlist.h +++ b/src/jit/gtlist.h @@ -255,6 +255,8 @@ GTNODE(NO_OP , GenTree ,0,GTK_LEAF|GTK_NOVALUE) // nop! GTNODE(START_NONGC , GenTree ,0,GTK_LEAF|GTK_NOVALUE) // starts a new instruction group that will be non-gc interruptible +GTNODE(START_PREEMPTGC , GenTree ,0,GTK_LEAF|GTK_NOVALUE) // starts a new instruction group where preemptive GC is enabled + GTNODE(PROF_HOOK , GenTree ,0,GTK_LEAF|GTK_NOVALUE) // profiler Enter/Leave/TailCall hook GTNODE(RETFILT , GenTreeOp ,0,GTK_UNOP|GTK_NOVALUE) // end filter with TYP_I_IMPL return value -- cgit v1.2.3