Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1213278

Re: [PATCH] ARM: probes: Don't stop the machine if we're in the debugger

From Doug Anderson <dianders@chromium.org>
Newsgroups linux.kernel
Subject Re: [PATCH] ARM: probes: Don't stop the machine if we're in the debugger
Date 2015-08-25 21:50 +0200
Message-ID <q1soh-7Tn-11@gated-at.bofh.it> (permalink)
References <q19OF-6lZ-15@gated-at.bofh.it> <q1a81-6XQ-3@gated-at.bofh.it> <q1pJL-3ZR-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Kees,

On Tue, Aug 25, 2015 at 9:50 AM, Kees Cook <keescook@chromium.org> wrote:
> On Mon, Aug 24, 2015 at 5:19 PM, Stephen Boyd <sboyd@codeaurora.org> wrote:
>> On 08/24/2015 04:58 PM, Douglas Anderson wrote:
>>>
>>> If we're in kgdb then the machine is already stopped.  Trying to stop
>>> it again will cause us to try to sleep, which is not allowed while in
>>> kgdb.  To avoid this problem, only stop the machine when we're not in
>>> kgdb.
>>>
>>> Reported-by: Aapo Vienamo <avienamo@nvidia.com>
>>> Suggested-by: Kees Cook <keescook@chromium.org>
>
> I actually suggested using in_atomic_preempt_off() which is I think a
> better catch-all. Could you use that instead, please?

I chose not to use that because (I think) in_atomic_preempt_off()
doesn't guarantee that stop_machine() is not needed.  Said another
way: if in_atomic_preempt_off() returns true then we can't sleep on
the current CPU.  ...but other CPUs may be running.  In this case
technically we need to call stop_machine(), but we'd need to do it in
a way that didn't require sleeping.

In the case of kgdb we know that the machine is stopped and we're
atomic too.  ...so we could certainly fix kgdb by checking for
"atomic", but that would mean there would be other places where we'd
get no warning and (I think) invalid behavior.

Stephen Boyd suggested that I just change this so that we expose a new
function and that makes everything a bit cleaner.  I'll try that.

-Doug
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] ARM: probes: Don't stop the machine if we're in the debugger Douglas Anderson <dianders@chromium.org> - 2015-08-25 02:00 +0200
  Re: [PATCH] ARM: probes: Don't stop the machine if we're in the debugger Stephen Boyd <sboyd@codeaurora.org> - 2015-08-25 02:20 +0200
    Re: [PATCH] ARM: probes: Don't stop the machine if we're in the debugger Kees Cook <keescook@chromium.org> - 2015-08-25 19:00 +0200
      Re: [PATCH] ARM: probes: Don't stop the machine if we're in the debugger Doug Anderson <dianders@chromium.org> - 2015-08-25 21:50 +0200
    Re: [PATCH] ARM: probes: Don't stop the machine if we're in the debugger Doug Anderson <dianders@chromium.org> - 2015-08-26 00:10 +0200

csiph-web