From patchwork Wed May 11 06:05:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 12845825 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 770DAC433F5 for ; Wed, 11 May 2022 06:06:51 +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=SIIqf6BApygsqLRWqt+fKnHsDkPi4/b/ad4uZoGMF3Y=; b=25+gI7iTPUOPKH Sb0hgswuSP2AE35DmZDkZ72Y1dgMItPh/7adoTEBL3bCjPTXOgYhniglCjW8WJecgfHUfr9LAMIoS 9Rsigsajl8oxTbwkCmh8CuL+JHjIlYxv8nb+5gMFhGG78h8XL8BnZsmduzHjUmu201nQZBFlNboJw LBDdfxSCjC8DRss0jj0+DpWpQc0CbE95MkOe5CqtGeTBf50HglI2CF3CIhVAPCK+OTAbGFpk0zWuA 8vPHwSh+finVPoO09nssyjdAKtsi1765PSi/Mf8G4n9oIjW82H7RfYVHkQ/qdaYQJSMA/LRFEyYVA 95Uk9BllcRquVU1LkaUQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nofTh-005N46-6r; Wed, 11 May 2022 06:05:41 +0000 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nofTd-005N3H-WA for linux-arm-kernel@lists.infradead.org; Wed, 11 May 2022 06:05:39 +0000 Received: by mail-pj1-x1035.google.com with SMTP id x88so1288333pjj.1 for ; Tue, 10 May 2022 23:05:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=44YMyg+y7+0XOrlHKgxD4Jgi/RkwoC3Hf7YIVT+pqw8=; b=J2VgpinATzf5U7v3GD/URBVzDrLE/Be+fgR9/cc4aXckH4EM7tgb2TXnBQideVB1k+ kt37Ko+I4WOqarmCcufBO1O1Wotbe6EPBDkjDXFWiTgaOdFLZU+NkhVtODWyoJNXskOW n4l+pwS5eNofuW4QIqnjKg8FnDu/esyPdST57Ed3+FjNGcGJhcbL+d5MHXvOkC7/zxUm PMQ6zMzL0EDqVQj8wWFdXpxIUYzfFWGJiwRow+0K0xV1r53i6iBfVPtWxOuNItoUbBrv UGaP8bF96xlAqwPA5HYtA8Iv83CWh0HY3ElzgSZS00M+EoLBshH/fZamoYPHygSjqMi5 hlLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=44YMyg+y7+0XOrlHKgxD4Jgi/RkwoC3Hf7YIVT+pqw8=; b=NvWMdk/HrdROy6ltZOjcux2swRrPhfZNAd01JtlGdYtgBbsX0sAqaTilEY/7pKq2s+ qyB4qpQxK7GC73K5E0ThjfrMPkzm2S/kxkow63pa1vfgyfGKOqzEo7JSk56/4wMPI9rL qXwdu4SNzYHs2xmrvW2wFvYXRzX3SxyQM+MR/mO69tDAxVl0gBVRSKxJolZG+w3meul8 4cOkoPGU1+oE0XNZJfO1Njew6t34tfxaInt2Me0NNcBBqA53XS09QKDuOS2y0slOdUK/ RrZXVWTIKVsn+prR8pWnGTQm2lgWwVpWKrDxs1WQQoEHOl1gYETw8Giywjg+DNMDfsXq nqew== X-Gm-Message-State: AOAM530MfSMPkVBKIcQ6cSovosnRqb67tnWI2MlIZZA2rVMvk1oYyW0G iGh1prsRcVn3CsarzLu5AaNvRA== X-Google-Smtp-Source: ABdhPJxhsdYmiva7DALqPxo/Vq36UUbL0+6lm95RmyP6zL3xnKYPGyymObuicUB3Y981KfqmgTNXKA== X-Received: by 2002:a17:90a:c908:b0:1dd:1c2e:b1f7 with SMTP id v8-20020a17090ac90800b001dd1c2eb1f7mr3663443pjt.198.1652249134761; Tue, 10 May 2022 23:05:34 -0700 (PDT) Received: from localhost.localdomain ([106.213.2.134]) by smtp.gmail.com with ESMTPSA id j7-20020a17090a31c700b001d960eaed66sm800216pjf.42.2022.05.10.23.05.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 May 2022 23:05:34 -0700 (PDT) From: Sumit Garg To: daniel.thompson@linaro.org, dianders@chromium.org, will@kernel.org, liwei391@huawei.com Cc: catalin.marinas@arm.com, mark.rutland@arm.com, mhiramat@kernel.org, jason.wessel@windriver.com, maz@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sumit Garg Subject: [PATCH v3 0/2] arm64: Fix pending single-step debugging issues Date: Wed, 11 May 2022 11:35:19 +0530 Message-Id: <20220511060521.465744-1-sumit.garg@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220510_230538_072750_6C594616 X-CRM114-Status: UNSURE ( 9.40 ) 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 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(-) Tested-by: Douglas Anderson