]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Drop CPU_DTRACE_NOFAULT manipulation around ustack calls.
authorNick Alcock <nick.alcock@oracle.com>
Mon, 24 Mar 2014 22:50:06 +0000 (22:50 +0000)
committerKris Van Hees <kris.van.hees@oracle.com>
Thu, 24 Apr 2014 09:32:53 +0000 (05:32 -0400)
dtrace_getufpstack() and (as of the last commit) dtrace_getustackdepth() both
manipulate the CPU_DTRACE_NOFAULT flag themselves: clearing it after calling
those functions is redundant, and setting it is actually dangerous, since
other functions dtrace_getustackdepth() calls (such as __get_user_pages() do
not expect to have instructions that incur page faults silently skipped without
faulting.

Orabug: 18412802
Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
dtrace/dtrace_dif.c
dtrace/dtrace_probe.c

index 64e1afc5177e157eb2f0288da5d83ce1e144aab3..772e32e6c2cfe1fc074da5807a19a02ad2cdc440 100644 (file)
@@ -2134,12 +2134,9 @@ static uint64_t dtrace_dif_variable(dtrace_mstate_t *mstate,
                        if (DTRACE_ANCHORED(mstate->dtms_probe) &&
                            in_interrupt())
                                mstate->dtms_ustackdepth = 0;
-                       else {
-                               DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
+                       else
                                mstate->dtms_ustackdepth =
-                                               dtrace_getustackdepth();
-                               DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT);
-                       }
+                                       dtrace_getustackdepth();
 
                        mstate->dtms_present |= DTRACE_MSTATE_USTACKDEPTH;
                }
@@ -2199,9 +2196,8 @@ static uint64_t dtrace_dif_variable(dtrace_mstate_t *mstate,
                         * will contain the caller, which is what we're after.
                         */
                        ustack[3] = 0;
-                       DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
                        dtrace_getupcstack(ustack, 4);
-                       DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT);
+
                        mstate->dtms_ucaller = ustack[3];
                        mstate->dtms_present |= DTRACE_MSTATE_UCALLER;
                }
index b6d69b46838b5a60c0c324d700fc5ab49b96468e..5076765a1f2c15e4d015a4b5715fe765c47d66e0 100644 (file)
@@ -494,9 +494,7 @@ static void dtrace_action_ustack(dtrace_mstate_t *mstate,
        /*
         * Now get a stack with both program counters and frame pointers.
         */
-       DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
        dtrace_getufpstack(buf, fps, nframes + 2);
-       DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT);
 
        /*
         * If that faulted, we're cooked.
@@ -935,12 +933,10 @@ void dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t arg1,
                                        continue;
                                }
 
-                               DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
                                dtrace_getupcstack(
                                        (uint64_t *)(tomax + valoffs),
                                        DTRACE_USTACK_NFRAMES(rec->dtrd_arg) +
                                        2);
-                               DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT);
                                continue;
 
                        default: