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=-6.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,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 E7632C00A89 for ; Fri, 30 Oct 2020 16:14:00 +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 67C7920724 for ; Fri, 30 Oct 2020 16:14:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="HFMQ9TUI"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="F8ZCTtUg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 67C7920724 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.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:In-Reply-To:MIME-Version:References: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=mzYAFzGKT2Kfc23U4PPtKzqXVUkqQ0gyHetHXHq02Do=; b=HFMQ9TUIIVju3eTqrGaCVT1dJ NWlhz1IfQr7ry4vSmV2GqBhffA/cdUa+ZrsTi7InSMmM/2SIGzY8bE0070WkUtSE3O+TnNHPeSM+D p83E9upEw6ukA2NJabFZ60aa+WOFFUrxS8h20Wq+5IVX2lo4Dd1XUhNgTfvq0d72GCE7Tic7AIRfm N3e42apf1Q8zBdfZENoaoDc5pbhDcNe0IBbQJ1Bo9avZ1Dm89uDAwkYKxbudnOM1qvTzOYcOOg36X B31GRvLqCDWEybi/hSqVks1F6MP0N028CXxHrekQB1xDu39X2t5JSmCtt9us2OUcfWUdmLrsMUTrv 8jZLa2qNg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kYX1w-0000H5-2m; Fri, 30 Oct 2020 16:13:32 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kYX1t-0000GE-Pm for linux-arm-kernel@lists.infradead.org; Fri, 30 Oct 2020 16:13:31 +0000 Received: by mail-wr1-x441.google.com with SMTP id n18so7069304wrs.5 for ; Fri, 30 Oct 2020 09:13:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=OITRmRrFxRQwp3qy1sV7JiGH9niy9Dj+iWfXA80g44o=; b=F8ZCTtUgAh3vihIiTzeAw60a8nEwLwCi9xoChx5lSXYv39y3o4qY0cG684rHTPm4SJ qnj0FupiVZ4gtciVBSaYNJDI2IyWXhlPF041XfkyVWDPy9IFXWrQ6+R1ck7sHm9mEtrL cstvZ8WC1nDl92vC8Mr8Sy9jGg6sF9d1zWjBTrluEHJSEDq4ec2nwMi/0C8nsnRri4oO aZp7qx1BdjD6Z+cE437skbpR8Jtd/KGHO+D9GYRa+LsPAhz+qdvHxFOKeP7o4U42ZtBG 7j/CIRO6HI7ppBAItShJZgWGFZzt5bXCbUhI2D2MOtQN0q8mDdC7F5kpunQ+khrgUpDY JOMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=OITRmRrFxRQwp3qy1sV7JiGH9niy9Dj+iWfXA80g44o=; b=VaHBHK+rGJ1VzLlfUE0p2mmPLMwuEsTKNAd3aiMrVLtnjj9yklN7IoxVrPXa4f1lDb rN118Hy+0tv5pCSzsaoG2ktF/dax8Ng65tsKQ1Ick0vx2A8WlAO4oR9U3Gzr6NDRwAv6 jJ8xPi9eLmR7VNxOCDZKjloA4eWOL75ZPLK+ziY6/Y49yrw8dSziGAzRE7cKKDmRT1aX ZOMjAG2nDV/EvQVQKwUT/Ud9tFN/r5FqIPqtaVjKns60s3/6Y25zInbFvZG0NZTxP+Ya 7mfqFR1L11klV8A0KGYVhqa3ULfcDQ6AQViMRw4e5Ph0NA/rmaR/US869kl/7sV9wPCy Ua2A== X-Gm-Message-State: AOAM5335QKEEBgpJRC0SXPbOofkWvO+of5Uk20ygVMTy9xwZ2azm2qW6 S0U7VjvWUMq8pIIdF4+aeu2NKhLHBdBx0g== X-Google-Smtp-Source: ABdhPJxb+bS21Yi6PxsHNHesBe/sQsxWC8/mMFhXkYSD9apdKb2dlKRIAbl8EKYwjw3FOp72+1stQg== X-Received: by 2002:adf:818b:: with SMTP id 11mr4048009wra.74.1604074408651; Fri, 30 Oct 2020 09:13:28 -0700 (PDT) Received: from myrica ([2001:1715:4e26:a7e0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id t62sm5224505wmf.22.2020.10.30.09.13.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2020 09:13:27 -0700 (PDT) Date: Fri, 30 Oct 2020 17:13:08 +0100 From: Jean-Philippe Brucker To: Will Deacon Subject: Re: [PATCH] arm64: kprobes: Use BRK instead of single-step when executing instructions out-of-line Message-ID: <20201030161308.GD294997@myrica> References: <20201029173440.117174-1-jean-philippe@linaro.org> <20201030160623.GA32582@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201030160623.GA32582@willie-the-truck> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201030_121329_989280_C95D6A52 X-CRM114-Status: GOOD ( 24.86 ) 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, mhiramat@kernel.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 Fri, Oct 30, 2020 at 04:06:24PM +0000, Will Deacon wrote: > On Thu, Oct 29, 2020 at 06:34:42PM +0100, Jean-Philippe Brucker wrote: > > Commit 36dadef23fcc ("kprobes: Init kprobes in early_initcall") enabled > > using kprobes from early_initcall. Unfortunately at this point the > > hardware debug infrastructure is not operational. The OS lock may still > > be locked, and the hardware watchpoints may have unknown values when > > kprobe enables debug monitors to single-step instructions. > > > > Rather than using hardware single-step, append a BRK instruction after > > the instruction to be executed out-of-line. > > > > Fixes: 36dadef23fcc ("kprobes: Init kprobes in early_initcall") > > Suggested-by: Will Deacon > > Signed-off-by: Jean-Philippe Brucker > > --- > > > > An alternative to fix [1]. I haven't done uprobes yet since they don't > > suffer the same problem, but could add it to the bottom of my list. > > Lightly tested with kprobe smoke test and the BPF selftests. > > Interestingly on Seattle when running the "overhead" BPF selftest, that > > triggers a kprobe a bunch of times, I see a 20-30% improvement with this > > patch. I'm guessing it's the cost of touching the debug sysregs? > > > > [1] https://lore.kernel.org/linux-arm-kernel/20201026172907.1468294-1-jean-philippe@linaro.org/ > > --- > > arch/arm64/include/asm/brk-imm.h | 2 + > > arch/arm64/include/asm/debug-monitors.h | 1 + > > arch/arm64/include/asm/kprobes.h | 2 +- > > arch/arm64/kernel/probes/kprobes.c | 56 +++++++++---------------- > > 4 files changed, 24 insertions(+), 37 deletions(-) > > Thanks! I'm about to send fixes for -rc2, but I'd like this to get a little > bit of time in linux-next, so I aim to queue it next week for -rc3. Just > wanted to make sure you don't think I'm ignored you. No worries, I'm more confortable having this sit in linux-next Thanks, Jean _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel