Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2552571pxk; Mon, 14 Sep 2020 17:15:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6q9OTL+anarW3Qc9q6faIwzL1splRns5ylSoAHvslN+Myb4g24Th+x/iubY3CyLhGSNew X-Received: by 2002:a17:906:3bca:: with SMTP id v10mr16963909ejf.57.1600128951050; Mon, 14 Sep 2020 17:15:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600128951; cv=none; d=google.com; s=arc-20160816; b=RTJSKDRYdmqgOPVyFZ0UczDTT+A2xxWlVM4G6e8RAp1tmVF8p40GMFauw0/iZYLfaY 8SaKOzd5NzvVBfL0YBgMvy0eW013/6vKmlZgawVOWSW+PybasCflK5SzOfGbTHN9Suu4 KLpmRm014G0JLbUIgsh0MSCJQxie1ruZmaOvwW3BGrAN+MTIKyvcdw36OQ+ix/0w02EL EEeQwzuwl1vN+UQ+T28SDgkViT+4IO8SuE3T9/nerlFLgR3wEAqeGP/QrGIqfAv3gkKM 144VUsDoHAe9Gv3d/rAzz7hw60yIgtzdpYmdU21UVMRDHdkTzDGwYQBRkjfIswYPIaeV 9Ftw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=vbe1AqHS58DfWSfiPA4xYQAF16nRd6xvbt+9w/fq7F8=; b=mxUlVuw7pMHIhxeeUBuNUT3VCVLHM9AFAhB/NUsZyI0xa4D4k/kOg+jWoqxmr1t39J Z5O1tmpuSOA5iNNvidSr8TyOMWRd3JlzUBQYwJd6/ZSF52XVT4ycWFtrY4eg7jqdYWlg iJtUGPNoSTKlF195it/UAjrTiNj5FM4JpbTndJ/R+ewgxbhQqyxisZxe8uSkmkUO2h3b oH+yHUqP8Bf4+YIbKTREhJETsC2Z2F8iLyiyPvIoH8iXatA+GYpiqwBcBKz0Irm3v4E+ 5Cm7kP6RMwGHzmnplRMkLxbhVb8WcpteT1ngnuHx+RteLYaxGRXelWEDsklm3cQf2umk zIRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=a9nIWOuB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bf1si8467880edb.565.2020.09.14.17.15.28; Mon, 14 Sep 2020 17:15:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=a9nIWOuB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726130AbgIOANu (ORCPT + 99 others); Mon, 14 Sep 2020 20:13:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726115AbgIOANn (ORCPT ); Mon, 14 Sep 2020 20:13:43 -0400 Received: from mail-ua1-x943.google.com (mail-ua1-x943.google.com [IPv6:2607:f8b0:4864:20::943]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33705C06174A for ; Mon, 14 Sep 2020 17:13:43 -0700 (PDT) Received: by mail-ua1-x943.google.com with SMTP id u48so465238uau.0 for ; Mon, 14 Sep 2020 17:13:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vbe1AqHS58DfWSfiPA4xYQAF16nRd6xvbt+9w/fq7F8=; b=a9nIWOuBsncn5CebByhLCjo54A9sj/xgJrXzTbXB4c+iGvDoxRz2kj+HDFuTlz6FHe ccTCakQhRnSTvbseiPYReW0cS/V95isQRNkbPDnFi3195ZDjjfks6GzN4NKVPvcaGFRA OiJFlEWiuip89VPeG5qgsATN0udSYhMKAY1mk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vbe1AqHS58DfWSfiPA4xYQAF16nRd6xvbt+9w/fq7F8=; b=bX41iOiwEw7ngVUhIYWX9lJPFoNM42c8TJYDLkGtBZir6cOL7QguKS+yWHvmLRqQ1X EYr4rQD/jFELm6bmcSUdI7a092STMwxA+qGKmL16SoxbfbLix1/PXl267A2WsjbTnkeI MMk+iuPZC2oQh7Gm+UaIn7VqYGeNJKUwx8zSP34xesfT3jizfZmV0jtRKYSQgGVuqeQP GKWZP8jMt65fN+mN+RUMiYeDeigtjxE0gL/4hVSvnUWqUGm2KRhY3+JGKui1Sl/fP2SA 81/jkBvunUcOZhoY+D3LJ6VP5Rvkp5Mv6KKU8OavnnJLQxAiVLZhuaPS/F/ZhEz1o1cU CI1A== X-Gm-Message-State: AOAM53243d9lOtFOfNwgOjEa4gz71VcoeQHeRl++yA8xCKl0Uf6hMEm8 83CItnFpYkW9vFwSs5t4bGahUuFlD6//XA== X-Received: by 2002:ab0:130a:: with SMTP id g10mr8869179uae.100.1600128820926; Mon, 14 Sep 2020 17:13:40 -0700 (PDT) Received: from mail-vk1-f175.google.com (mail-vk1-f175.google.com. [209.85.221.175]) by smtp.gmail.com with ESMTPSA id w6sm1723163uan.4.2020.09.14.17.13.40 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Sep 2020 17:13:40 -0700 (PDT) Received: by mail-vk1-f175.google.com with SMTP id n7so393031vkq.5 for ; Mon, 14 Sep 2020 17:13:40 -0700 (PDT) X-Received: by 2002:a1f:1dcf:: with SMTP id d198mr2927179vkd.30.1600128819652; Mon, 14 Sep 2020 17:13:39 -0700 (PDT) MIME-Version: 1.0 References: <20200914130143.1322802-1-daniel.thompson@linaro.org> <20200914130143.1322802-4-daniel.thompson@linaro.org> In-Reply-To: <20200914130143.1322802-4-daniel.thompson@linaro.org> From: Doug Anderson Date: Mon, 14 Sep 2020 17:13:28 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 3/3] kernel: debug: Centralize dbg_[de]activate_sw_breakpoints To: Daniel Thompson Cc: Jason Wessel , Peter Zijlstra , Sumit Garg , Petr Mladek , Sergey Senozhatsky , Will Deacon , Masami Hiramatsu , kgdb-bugreport@lists.sourceforge.net, LKML , Patch Tracking Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Mon, Sep 14, 2020 at 6:02 AM Daniel Thompson wrote: > > During debug trap execution we expect dbg_deactivate_sw_breakpoints() > to be paired with an dbg_activate_sw_breakpoint(). Currently although > the calls are paired correctly they are needlessly smeared across three > different functions. Worse this also results in code to drive polled I/O > being called with breakpoints activated which, in turn, needlessly > increases the set of functions that will recursively trap if breakpointed. > > Fix this by moving the activation of breakpoints into the debug core. > > Signed-off-by: Daniel Thompson > --- > kernel/debug/debug_core.c | 2 ++ > kernel/debug/gdbstub.c | 1 - > kernel/debug/kdb/kdb_debugger.c | 2 -- > 3 files changed, 2 insertions(+), 3 deletions(-) I like the idea, but previously the kgdb_arch_handle_exception() was always called after the SW breakpoints were activated. Are you sure it's OK to swap those two orders across all architectures? -Doug