From patchwork Thu Dec 15 14:29:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 13074262 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8A0B5C4332F for ; Thu, 15 Dec 2022 14:30:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=bvzyeTkspymGyW2vHpRGSboeAJWi43pcVK/T4BbT35c=; b=jKg+xfczoCijPG js0rtkzAoQ29lzJPMx8bE1mk/O6fnuMJulowfUZFEdJKHOONI5HN6cqsiCNATq1IvPI++sbhjUBAj F4IVsDqScX8PIiLdko95QB2cR2Qt9lPSLgMQ6FGy2lDhkS0Wijiq3WirVxjMLGhb8DDPGOFO5owfr 62jrxjRe3N89O0+WpEF2JmvFj5K0h04DC2IMp5KgCpDvtQkcGEirEfW9mO19YeX4YbwaDFMbXYy9U 0lGc6FclEfGk7YsnbTa84b/M7af/h16Jq1kyKPdfeL/fESRf4BKga/YbMRhe+HWyslcQE08I1FEJv Fy9H2qDDGtTcaLseWAjg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p5pEr-009oW3-ID; Thu, 15 Dec 2022 14:29:33 +0000 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p5pEo-009oTK-19 for linux-arm-kernel@lists.infradead.org; Thu, 15 Dec 2022 14:29:31 +0000 Received: by mail-pl1-x630.google.com with SMTP id a9so7033034pld.7 for ; Thu, 15 Dec 2022 06:29:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ZY0Xezt8weAxCgCAphw/rTBxuMub8/nuZ/8USOGCrnQ=; b=KbhU4ZeyMh6DMdZAiSfWNy1r5/ncwItDfLQvvRldEl4DTEWhYy/ok0p5ykGyOiwITp rHkkwEEFi4KEk/GNL/UL3ikProFYFIoMegmuXQLpoclzuL3SaKkrYkKMsluttf1Xxe9H 9lrz1B8gqkjlFnI+sORLxXSHreAbyEeTzBI6/aHcLVqlImd2Y/oNWHquRCAWWY1fKeK/ QNESBQvXtU4dwArjMyZdpgYv2T9EET868gtY4NeQQcejWrbDWQZFqWOd/0I4pQ0UktiW tnpfJ1EEfji46g8fRzlopy6fp361zvXpw2+2aZYKxs0RnlNfPb8FoUkCuz81do8BeIAO u0ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZY0Xezt8weAxCgCAphw/rTBxuMub8/nuZ/8USOGCrnQ=; b=sn4shq+oNWyk34u5uECZsViPwPOxswiZCsOCuXHix+jrBIHGEh5ydnyzFdhjr+tmTf YlPw4eJJDMpp+U/rJHV/OXSDWw8IUU2A3NI2gTvT21sO1AmOhIAZ3sAxV0dMzXoPNZXD el2nefiy53ltyOfmAnodmO1u+HXng6AELYYbFhBM0JpnSFmY3VVrr2aQiZb6TOEdkWC4 myomFsu2cTHJAEQ81qg+Q0B7xXYp31uqQvx8hPpJmNbdr3TzPdmdZtaq8OSxd816yC1N 0EkjRj3MF0r5PhqwTiIxUrVNzCPl1vju1CI/GTXLkT2iy6r8u9tt//j+bQwWtRrlfd2f q/tA== X-Gm-Message-State: AFqh2kpD9JIykeaJTsIU483FfLaCBBjBg7hWTu4hOqR5uJWd0MiDvSIt mtBCdo4sLXiYC0YPguBFofg6ZIFtPFp8z8qC X-Google-Smtp-Source: AMrXdXtzaHPD9Hc3eiS4yWeAGkPZVVMYWzvh9WYT8Vza1Xd3bpwbjTJVVRviianjCkuwAHecKYeutA== X-Received: by 2002:a17:902:e54b:b0:190:f536:e4a0 with SMTP id n11-20020a170902e54b00b00190f536e4a0mr3656585plf.20.1671114558216; Thu, 15 Dec 2022 06:29:18 -0800 (PST) Received: from sumit-X1.. ([223.178.208.45]) by smtp.gmail.com with ESMTPSA id z1-20020a170902d54100b0017f5ad327casm3922010plf.103.2022.12.15.06.29.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 06:29:17 -0800 (PST) From: Sumit Garg To: will@kernel.org, catalin.marinas@arm.com, daniel.thompson@linaro.org, dianders@chromium.org Cc: liwei391@huawei.com, mark.rutland@arm.com, mhiramat@kernel.org, maz@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sumit Garg Subject: [PATCH v4 0/2] arm64: Fix pending single-step debugging issues Date: Thu, 15 Dec 2022 19:59:01 +0530 Message-Id: <20221215142903.2624142-1-sumit.garg@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221215_062930_094711_3767FF9D X-CRM114-Status: UNSURE ( 9.26 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patch-set reworks pending fixes from Wei's series [1] to make single-step debugging via kgdb/kdb on arm64 work as expected. There was a prior discussion on ML [2] regarding if we should keep the interrupts enabled during single-stepping. So patch #1 follows suggestion from Will [3] to not disable interrupts during single stepping but rather skip single stepping within interrupt handler. [1] https://lore.kernel.org/all/20200509214159.19680-1-liwei391@huawei.com/ [2] https://lore.kernel.org/all/CAD=FV=Voyfq3Qz0T3RY+aYWYJ0utdH=P_AweB=13rcV8GDBeyQ@mail.gmail.com/ [3] https://lore.kernel.org/all/20200626095551.GA9312@willie-the-truck/ Changes in v4: - Rebased to the tip of mainline. - Picked up Doug's Tested-by tag. Changes in v3: - Reword commit descriptions as per Daniel's suggestions. Changes in v2: - Replace patch #1 to rather follow Will's suggestion. Sumit Garg (2): arm64: entry: Skip single stepping into interrupt handlers arm64: kgdb: Set PSTATE.SS to 1 to re-enable single-step arch/arm64/include/asm/debug-monitors.h | 1 + arch/arm64/kernel/debug-monitors.c | 5 +++++ arch/arm64/kernel/entry-common.c | 18 +++++++++++++++++- arch/arm64/kernel/kgdb.c | 2 ++ 4 files changed, 25 insertions(+), 1 deletion(-)