From patchwork Thu Feb 2 07:31:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 13125433 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 A0F31C05027 for ; Thu, 2 Feb 2023 07:33:11 +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=ilxweo2McUNYhqlD7621Die5hZdzC+9JThYLUsjW+hY=; b=iXvWuOBJGEhTX1 jv45BP+tlqefa2HH2zHQaX8wyjpvOhOgeDEoz2KsSA7iWjzQ6z8XkdeK8nR7MgUQM6KtH3iwrH2uF K06zNiyKrvcXsfGN46AKGh5Gtt8KPXuc+hmKxcO2D8KyhNSOlmAryyHisL+IEf/i9n4qoKcF+SlsA Z473cIVnBsVxN/QMHbfZATm/QoC/SgQSuVlabTtiuvAmu9dK3iaECeMEl6q1JDd/6tBR5DvE2zUdD ABom3+uSO4Wf4mJydHTfeuNLkynm3/JdOgbfdH+Re9PJVvY+qwzANux9gCn52llTX2/4LXwV0FtE9 Nn2B6VxyOhd3x2hCs2Cg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNU4n-00EeBI-U6; Thu, 02 Feb 2023 07:32:10 +0000 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNU4k-00EeAT-WA for linux-arm-kernel@lists.infradead.org; Thu, 02 Feb 2023 07:32:08 +0000 Received: by mail-pj1-x1036.google.com with SMTP id m11so1148761pji.0 for ; Wed, 01 Feb 2023 23:32:04 -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=Tmb0HvG17lR3HM/pn9ITfJlpLMo0J+0/VmIcQoXEYTo=; b=LCjAFhZjfg5vRuF/JcColBokHhNiC/Gil36UGcekT2zgvnPMp5/y9enM1V+67agyh0 PVlupnnNQlbO8jE+LRXyzYOGbDenj7OWCvWZltA8N+7sahG05JG0KT/NIOtV4rJRsxQQ 5JGFSt04Ty5S8fUxAROkQs6yZFGRBgyHa9FrInO0CQOVSTQ5xaoeLLqXzzO+9nnqgT0k XMfWc96v+FtYTSUilBn9eaHu/9OYMu5671o4Bm8buPijZF1BptXLiTx+armGHyezU4c5 GRuV1LfGj/BbFvzxlYjmDVB5xdp1f+KINEGGO83xGktKBqyahGxmDOlbojHSACWed8e0 aatQ== 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=Tmb0HvG17lR3HM/pn9ITfJlpLMo0J+0/VmIcQoXEYTo=; b=nz7FJllSVSslWZpinbvNJp8/ULyqrQuFkAwctyvCD/y162ZbM9KYAKMuAegnZI7m35 Zr+dihw69IsOampHlfAgx1nAMHKdqYMF0ai/K//BaMyxgox38yUpBAJqnez3HSLo4y8P 30BydG39JLsKyFsgqebI/uSVPIjAHvMYTAX7fmV+dnKFm/VulmCPrmZzgWlQKUBpIiwY wwzVjG96f2VuqmLHdoKa/EP93ZEXO0D2bSjBkt756xBU3KwVikyv4hjPIcxnuE2RxFLV 6CZLyKFrlAdwzdhl0lYMRZ5sa7//wegAh9kvsIJvoK3w9pTIPtwqWKb72SKdHhmHqH2C 2FyA== X-Gm-Message-State: AO0yUKWsFy3twI7xFBDcptj77sk4RF3dqONBpcWTEjgTwy9RPIADC3KS mQiUBV6DksEn5xnzd/IbzG7NZyQBvbR9vsvk X-Google-Smtp-Source: AK7set/PZSRWBrfcMrIphz9zbcCCectwhWEzsmK0x9GFFLGtbHN0aXgwuMF6LUXiG63FL6t7JD4N7A== X-Received: by 2002:a05:6a20:12ce:b0:be:c80b:a8c3 with SMTP id v14-20020a056a2012ce00b000bec80ba8c3mr6997681pzg.42.1675323124311; Wed, 01 Feb 2023 23:32:04 -0800 (PST) Received: from sumit-X1.. ([223.178.209.222]) by smtp.gmail.com with ESMTPSA id o17-20020a170902d4d100b00196077ba463sm12959015plg.123.2023.02.01.23.32.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 23:32:03 -0800 (PST) From: Sumit Garg To: will@kernel.org, catalin.marinas@arm.com Cc: mark.rutland@arm.com, daniel.thompson@linaro.org, dianders@chromium.org, liwei391@huawei.com, mhiramat@kernel.org, maz@kernel.org, ardb@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sumit Garg Subject: [PATCH v6 0/2] arm64: Fix pending single-step debugging issues Date: Thu, 2 Feb 2023 13:01:46 +0530 Message-Id: <20230202073148.657746-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-20230201_233207_099986_EE0BE033 X-CRM114-Status: GOOD ( 10.44 ) 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 v6: - Fix incorrect rescheduling check introduced by rework for v5. - Patch #2: s/kernel_regs_reset_single_step/kernel_rewind_single_step/ - Collected Daniel's tags. Changes in v5: - Incorporated misc. comments from Mark. 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 | 22 ++++++++++++++++++++-- arch/arm64/kernel/kgdb.c | 2 ++ 4 files changed, 28 insertions(+), 2 deletions(-)