From mboxrd@z Thu Jan 1 00:00:00 1970 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 7FC5EC6FD1D for ; Fri, 17 Mar 2023 16:03:25 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RF8PcpdfvWAsFGgVZLu/N8Qh6IBjdBIna6lIBxc26dg=; b=4rNnO95KsMmpO8 oTiPazD15jSTG0ll4VDQJecSrRVwRg0Sb9GAvY6iaIwHkIf6+yRJRqwhKYhONDy6ieyszlj8bMyJM fXFcDjjsS2V/TupAXBeAytRyiKRir7ajyC7mRVtm3QaowjpR7NIXm+Kk9eQdpae6PcXq7waU2VV9n l6kHXSbvNxg3avEZTV6cA52MtUCxvqIr7s1F3HiFiVSdHyKrxguxQEearJI/MqGvOnVKwnZOx9GAX P3/12GBAJU03J6glcnUKy95Z4ohRzoG4gyy85uzGJN0Y4FibufrLFJBW1c3dmBvOiKgKNw+MHKUmj JOk9LduN7Rm7esdYr8Pw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pdCX3-002hCP-0v; Fri, 17 Mar 2023 16:02:17 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pdCX0-002hBU-2Z for linux-arm-kernel@lists.infradead.org; Fri, 17 Mar 2023 16:02:16 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2C6E5B8262F; Fri, 17 Mar 2023 16:02:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C151C433EF; Fri, 17 Mar 2023 16:02:09 +0000 (UTC) Date: Fri, 17 Mar 2023 16:02:06 +0000 From: Catalin Marinas To: Kristina Martsenko Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, Will Deacon , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Mark Rutland , Mark Brown , Luis Machado , Vladimir Murzin , linux-kernel@vger.kernel.org Subject: Re: [PATCH 08/10] arm64: mops: handle single stepping after MOPS exception Message-ID: References: <20230216160012.272345-1-kristina.martsenko@arm.com> <20230216160012.272345-9-kristina.martsenko@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230216160012.272345-9-kristina.martsenko@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230317_090215_004165_CE0B255F X-CRM114-Status: GOOD ( 16.57 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Feb 16, 2023 at 04:00:10PM +0000, Kristina Martsenko wrote: > When a MOPS main or epilogue instruction is being executed, the task may > get scheduled on a different CPU and restart execution from the prologue > instruction. If the main or epilogue instruction is being single stepped > then it makes sense to finish the step and take the step exception > before starting to execute the next (prologue) instruction. So > fast-forward the single step state machine when taking a MOPS exception. > > This means that if a main or epilogue instruction is single stepped with > ptrace, the debugger will sometimes observe the PC moving back to the > prologue instruction. (As already mentioned, this should be rare as it > only happens when the task is scheduled to another CPU during the step.) > > This also ensures that perf breakpoints count prologue instructions > consistently (i.e. every time they are executed), rather than skipping > them when there also happens to be a breakpoint on a main or epilogue > instruction. > > Signed-off-by: Kristina Martsenko Acked-by: Catalin Marinas _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel