Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1744731pxb; Fri, 25 Mar 2022 04:59:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxd5fDAPK+tr4eh/vLdMegGCgD8IV1VYwwof+fyuv22r3WY6P95ooXZvMEtiLYwznmuguZx X-Received: by 2002:a63:f54b:0:b0:384:64d1:fa45 with SMTP id e11-20020a63f54b000000b0038464d1fa45mr7699007pgk.95.1648209577595; Fri, 25 Mar 2022 04:59:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648209577; cv=none; d=google.com; s=arc-20160816; b=yenTDf980dgJiPaiY9yi6tfppdC5wTXaabFOh2ruOn2ogvBiHHwVIqLBCUHnJMN5Eo dR9iquHLX7wDgYu2TXm94p0sTZF7t+wzwuDFlObIVwwY7wCqh+Cep+42kKQ8dg4RozJu /1bWLDb/ETEpMmtZpSHlN1dnaHQTviJ1x3P1NcWLz+51HEObXU11J/kR9/CPZxmaKS0N Sm04YXr1quZC+H72xCU6QcUlAK5WSdgkLWQbWVZ684Q2x4R+Xu9LcMQVE8F8v0VTBaFX G3awpX2TDSMn5kHCd6ZzIqzpTz1OZdexcTCFp90fQELdCrUYZVfprHU7L/fTmhvFzxPZ Ox6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=KUXTHMTfWIu1wn3BkreBYmXavLC1Rvghemz+sjpHJTQ=; b=s3iOh/VKGp2UJZA99bOBG8d8kusDRKOefqiKbJ3UakrmYKcUlsUg7MKG1pDQVKPZxR grW+zDcOvQn45uqf9MM2FYkCcRk7RNCo21GeJROIBLiufJqAv9mLLhcGsJyZ4hMe23bZ mFmSexFVM1YkDRXcWTPArAFwtJQ/fKSH5rb+4yTBSkYFsL+l8Sy1VklW/GJ5TgkIWM44 DX6SUnunpf8pb4xROFmnkP8VSR3OOUnWbTMdOSdlQOwrcn6ud1Oe1cCYjA4tMRa8rHvo KG7rkK2+/fmJCuSNQdP39H57thrFGoTL7SncXZdNFFt4FZB/epL1Sn/zV5vKGL2n1jkZ e1tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="vGOvaG/i"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id me3-20020a17090b17c300b001c6fdf85547si2958241pjb.88.2022.03.25.04.59.25; Fri, 25 Mar 2022 04:59:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="vGOvaG/i"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344032AbiCXPUJ (ORCPT + 99 others); Thu, 24 Mar 2022 11:20:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236651AbiCXPUI (ORCPT ); Thu, 24 Mar 2022 11:20:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4608148322 for ; Thu, 24 Mar 2022 08:18:36 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id D63B0617B4 for ; Thu, 24 Mar 2022 15:18:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0A26C340ED; Thu, 24 Mar 2022 15:18:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648135115; bh=Ml/tHPbe2zU2+0ldVRiam6quUBs/j+WDsFnjNccGLgU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=vGOvaG/iuWm7NfreHvlgk/5oCqJWWQK7rlNntLyOqdbxt6x09bczGQ9A9jWJ1Rbs6 RpyuGdoDdWcmImEHs3lXXUfwACVfLIwlLVdo0CLsJkbYt2BiVGkuYnD4US8ZW/SR+7 ILzTCr8V/I7zBQs8TvypU5CaYXP1XFPd6K6YWCM4H1yFS3TMZbZAmJNnmIUVpRVPV+ AxAFY6J+MfhosCtG4pAs3/E58+krp8AyhTs63UF5h/m4DDLTUbNvpb77Aak8B4OMKM crR9HJPW8sDveivFgJTqve1Ln1koAcUx7QchvO86l5rLJeRzm5CjSpWCnlROA34wPH Wk7LcQI0N5WcQ== Date: Fri, 25 Mar 2022 00:18:31 +0900 From: Masami Hiramatsu To: Ard Biesheuvel Cc: Steven Rostedt , kbuild-all@lists.01.org, Linux Kernel Mailing List , Nick Desaulniers Subject: Re: [PATCH] ARM: kprobes: Make __kretprobe_trampoline as a pure asm function Message-Id: <20220325001831.e363577abe647f99b0714be8@kernel.org> In-Reply-To: References: <20220315182558.1a056d8b3975932f6589b60f@kernel.org> <164733793626.1008610.12121025094280924953.stgit@devnote2> <20220324152108.b6016621dd6b8297eddd6bb5@kernel.org> <20220324222322.9f59df377b01856f2230a4ea@kernel.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ard, On Thu, 24 Mar 2022 14:34:46 +0100 Ard Biesheuvel wrote: > --- a/arch/arm/probes/kprobes/core.c > +++ b/arch/arm/probes/kprobes/core.c > @@ -377,7 +377,7 @@ void __naked __kprobes __kretprobe_trampoline(void) > { > __asm__ __volatile__ ( > #ifdef CONFIG_FRAME_POINTER > - "ldr lr, =__kretprobe_trampoline \n\t" > + "ldr lr, .L__kretprobe_trampoline \n\t" > /* __kretprobe_trampoline makes a framepointer on pt_regs. */ > #ifdef CONFIG_CC_IS_CLANG > "stmdb sp, {sp, lr, pc} \n\t" > @@ -407,6 +407,11 @@ void __naked __kprobes __kretprobe_trampoline(void) > "bx lr \n\t" > #else > "mov pc, lr \n\t" > +#endif > +#ifdef CONFIG_FRAME_POINTER > + ".align 2 \n\t" > + ".L__kretprobe_trampoline: \n\t" > + ".long __kretprobe_trampoline \n\t" > #endif > : : : "memory"); > } Yes, I confirmed this works too :-) Can you send the patch with my Tested-by ? Thank you! > > > On Thu, 24 Mar 2022 at 14:23, Masami Hiramatsu wrote: > > > > On Thu, 24 Mar 2022 15:21:08 +0900 > > Masami Hiramatsu wrote: > > > > > Hi, > > > > > > I found a better solution for this issue from Ard :-) > > > > > > https://lore.kernel.org/all/20220203082204.1176734-6-ardb@kernel.org/T/#u > > > > > > I should use mov_l instead of ldr for loading the symbol address. > > > > Hm, these macros are only for the pure assembly file (.S), so we have to > > split this in a asm file to use that. > > > > > What about the below? -- Masami Hiramatsu