From patchwork Mon Dec 19 10:24:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 13076456 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 7D492C4332F for ; Mon, 19 Dec 2022 10:26:57 +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=iLW+mhesRKQd/E9MEWdmm86zPXszY7ynxlqFRB0hSlU=; b=pdVZTtiWyTvXee VfWW9CjtqFT8y1bod5krfGBTLiHPWpH10e6u7i1xHUj3luau1WAjxa7IGUQO7DjEZ0SHJ6dRjUg6v 2RCDFMvmTm9RAGiYnLpSOKLZ6HfySeAK17LspFTojpXAeu5j5NRQVZmgTnvwBHhdN6np73OEcj0rm Gqcru3QFsDETncihhzav6yyLw+aUXpDlycsYMeEPD8anDdECvLXKeJDwz6DFH3zOYHT//3/nzTh+D RNDPFOOPNvUpHt4a1MJ71G46VKlrZ9I5TNwMKTadTK+pZ2XSRoXA6PbAAb/bQl5xBnAOEMulP2BAN CBnHpdd2vPUFwgx36kyA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7DL4-00BqRq-CD; Mon, 19 Dec 2022 10:25:42 +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 1p7DKU-00Bpwx-O8 for linux-arm-kernel@lists.infradead.org; Mon, 19 Dec 2022 10:25:09 +0000 Received: by mail-pj1-x1036.google.com with SMTP id gt4so8584565pjb.1 for ; Mon, 19 Dec 2022 02:25: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=K37gbY5Dl8sWIrBCYlNI70CebPhvB+1SPLpodhsI8Ls=; b=DcGzl2I7MILyelixxwuz25J4rmnqa0G05scGyE3bfVtF35zCpUdcXHKrHcTbkPtiWj uPESG1PUqJ5wcR/57uEmhY7NnCFerUH6JMg/H6cFqtGuoMb6/cpmtXsW/VgER7a879Ni x2a+GxGWSNfheBBY6goh9bbjNVlsgw8eADhqbtPJuWoO5n2XJHBY0OwhzmQla2/bXL76 Gj7FY+puAIgDNJvZkf9JNFhUFIyIHYMhdo4ldIOOYXQkIJNaM4zJrGf8f0SQtmmynCPC gfDgQYf/qsupgOQIBlO33r10WosIT/5HDtvC/2985dDY446pjpfDDOufQcjr5kGNCHyg 0RTA== 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=K37gbY5Dl8sWIrBCYlNI70CebPhvB+1SPLpodhsI8Ls=; b=R1OpjsQHsB8ANjHMAcg5gyT8+9r03BugxgQYRTexzRB1eUX2Ruf4WHO/B+yGT39GpR uigG80DiCKNCGLvyGRwASGoYdKqkyEHBxRu6GIEfjnFMmUUdTMn4E1YXrdSO+syuHw8W WwfCwSfwcbILot7wd/8kQgvKRCtOQcPsoOwrV8Ja2UmFRy3KingPqG47YuFD7qKIp5o2 f0/v4IsjbBGc8Df/l2BU4nw0gOlkTdJfIQQsjXRZ9JKXaEOqlKw4xtsvQAgXy85lD8j/ b8lGqSpfabePVlqk0/xDiscieoH37wQhM7TUsPNViSUrMhKV6goLJgSsoKZd5dy/h0c+ kpIQ== X-Gm-Message-State: AFqh2koOtyr6mV7UhTWXL3KNin/+RDY/ZmdCuUZHvtUjdwXw8VQbQlxd WUBc7MyWK6HiTDjOcmbwv5wERA== X-Google-Smtp-Source: AMrXdXsdoBzxcvCunzKRloTBXDqSFwctK8CWxZNCjAFdUgSQVoY0Zypl1qwnE7PnzuPNeOviz3osyA== X-Received: by 2002:a17:90a:6acd:b0:221:684a:d05d with SMTP id b13-20020a17090a6acd00b00221684ad05dmr9251001pjm.45.1671445503842; Mon, 19 Dec 2022 02:25:03 -0800 (PST) Received: from sumit-X1.. ([223.178.213.5]) by smtp.gmail.com with ESMTPSA id 89-20020a17090a0fe200b0020087d7e778sm8832731pjz.37.2022.12.19.02.25.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 02:25:03 -0800 (PST) From: Sumit Garg To: will@kernel.org, catalin.marinas@arm.com, mark.rutland@arm.com, daniel.thompson@linaro.org, dianders@chromium.org Cc: liwei391@huawei.com, mhiramat@kernel.org, maz@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sumit Garg Subject: [PATCH v5 0/2] arm64: Fix pending single-step debugging issues Date: Mon, 19 Dec 2022 15:54:50 +0530 Message-Id: <20221219102452.2860088-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-20221219_022507_082061_2C18B561 X-CRM114-Status: UNSURE ( 9.88 ) 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 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(-) Acked-by: Daniel Thompson Tested-by: Daniel Thompson