From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751783AbcISWaW (ORCPT ); Mon, 19 Sep 2016 18:30:22 -0400 Received: from mail1.windriver.com ([147.11.146.13]:46424 "EHLO mail1.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750730AbcISWaV (ORCPT ); Mon, 19 Sep 2016 18:30:21 -0400 Subject: Re: [RESEND PATCH] arm64: kgdb: fix single stepping To: AKASHI Takahiro , , , , , , , , , References: <1429578793-3971-1-git-send-email-takahiro.akashi@linaro.org> <0ea7dfad-e25d-2919-2d03-17b850d7ba91@windriver.com> <20160916043218.GA30248@linaro.org> From: Jason Wessel Message-ID: Date: Mon, 19 Sep 2016 17:29:36 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160916043218.GA30248@linaro.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/15/2016 11:32 PM, AKASHI Takahiro wrote: > @@ -176,18 +183,14 @@ int kgdb_arch_handle_exception(int exception_vector, int signo, >>> * over and over again. >>> */ >>> kgdb_arch_update_addr(linux_regs, remcom_in_buffer); >>> - atomic_set(&kgdb_cpu_doing_single_step, -1); >>> - kgdb_single_step = 0; >> >> This is a subtle change, but I assume it is what you intended? All the CPUs will get released into the run state when exiting the kgdb exception handler. > You are talking about "- kgdb_single_step = 0." Right? Correct. > Do you think that there is any (negative) side effect of this change? Not at all. The kernel debugger always skids to a stop, and it is more reliable from a locking perspective if the other CPU threads are released while a single CPU is asked to single step until the next "skid" for all the other CPUs. When you do not release the other CPUs you can end up single stepping a CPU which dead locks or never exits a lock elsewhere due to what ever it was blocking on never getting freed from another CPU. Cheers, Jason.