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 X-Spam-Level: X-Spam-Status: No, score=-4.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43076C4363A for ; Wed, 28 Oct 2020 12:22:24 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B0716246A4 for ; Wed, 28 Oct 2020 12:22:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YjoxMEfX"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="FGO3uzbD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B0716246A4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Mime-Version:References:In-Reply-To:Message-Id: Subject: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=U/ABrruaf0qB/PpUPjDFsndwhx7SW9Y25zHA59jD3vs=; b=YjoxMEfXks2YdLEIbbVvq6dRd 4uKxlvUzlhqEYbfXYu8VV05XyPVPxS82dl7JctQZsSRclG2JyAB74E7JOBiPBs4PpYqsXN3rCzRyG CfV9fLg1Z+4HUseMkparigiYmIQn/l9lHlJNGpth+kCz2DT53hS+3yclQ/3ykjRChD90WGBhn5EuG QwZdmnjdUPOPkaWm3OYimHaau7r/xiq9ba9rHMjXP+Mm1CE+YYhQsp/3UXCzNTNTnWA+SewTAS/jF ZckwAV7kQq6vlCgIr2mXpQF0WEX6dwE/0xnxdl7yYZnFZNpH2gpdq2CU+fk/Cmqg9p8U9IemuerhT vH5b6qkjA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXkSd-0007s7-Tm; Wed, 28 Oct 2020 12:21:52 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXkSb-0007rd-QT for linux-arm-kernel@lists.infradead.org; Wed, 28 Oct 2020 12:21:50 +0000 Received: from devnote2 (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B67DE2470C; Wed, 28 Oct 2020 12:21:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603887708; bh=7bPjmoMK0EJffqBAaqojMsM7m7dcD2NnZfi7HhcnMu4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=FGO3uzbDFcP0jt2EKkG6eaqo7AwohaLwUvzMDfK/wzH4owJaQqnGxexfWg4oA+/2c LbMS6Vr9k/HBi7iVqIvWemVOM7+PSTCK9/c9y74j4l7iDRC/3ArmsgjyPgAebOEAZn olxF4pDnsZ7GTTxU/W0E5RVEBL1iSRma5/NAYaYY= Date: Wed, 28 Oct 2020 21:21:45 +0900 From: Masami Hiramatsu To: Jean-Philippe Brucker Subject: Re: [PATCH] arm64: Fix early single-stepping Message-Id: <20201028212145.e8fc44671c3193da076351e5@kernel.org> In-Reply-To: <20201028094827.GC2328726@myrica> References: <20201026172907.1468294-1-jean-philippe@linaro.org> <20201027191318.aba935f7ccf00af9acd89388@kernel.org> <20201027194258.43b157ac0bbccd918fc8756a@kernel.org> <20201027115909.GB1514990@myrica> <20201027123317.GA26351@willie-the-truck> <20201027224922.7b032857d53bbfdc4484f768@kernel.org> <20201028082820.GA2328726@myrica> <20201028083643.GA27678@willie-the-truck> <20201028180731.13d770167b521dc28c189bbb@kernel.org> <20201028094827.GC2328726@myrica> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201028_082150_009482_0FF41390 X-CRM114-Status: GOOD ( 21.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: catalin.marinas@arm.com, Will Deacon , dianders@chromium.org, linux-arm-kernel@lists.infradead.org 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 Wed, 28 Oct 2020 10:48:27 +0100 Jean-Philippe Brucker wrote: > On Wed, Oct 28, 2020 at 06:07:31PM +0900, Masami Hiramatsu wrote: > > > > Yes, I think so. Same order problem as the OS lock, they need to be reset > > > > before enable_debug_monitors(). On CPU0 that would be before > > > > early_initcall and for secondaries the hotplug notifier needs to be > > > > installed earlier as well. I'll send a v2. > > > > > > Cheers. An alternative (which I think would be better in the long run > > > anyway) would be to avoid using hardware step in kprobes and instead rely > > > on a BRK instruction to trap after running the trampoline. > > > > But how we trap the instruction which can change pc? (like br?) > > Are all those instruction emulated now? > > According to aarch64_insn_is_steppable() anything that changes the PC is > emulated. OK, that sounds good. Then we can put the BRK right after the copied instruction. > I'm also checking whether there is a change of behavior with > synchronous exceptions taken while single-stepping (page faults). Thanks! From the kprobe_fault_handler(), it seems the page faults handled before the single-stepping exception and the fault handler disables single steping explicitly. So if we use BRK, that code will not be needed. Thank you, -- Masami Hiramatsu _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel