Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1169391pxb; Thu, 24 Mar 2022 14:14:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzG2hXOUTg5wGhqGJAAU4JdB9WXEF6LdxpXI66IzEJTWKThFn5HP26NIAJd6J3z/8x6q/PU X-Received: by 2002:a17:906:69c5:b0:6cf:d164:8b32 with SMTP id g5-20020a17090669c500b006cfd1648b32mr8059933ejs.233.1648156489505; Thu, 24 Mar 2022 14:14:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648156489; cv=none; d=google.com; s=arc-20160816; b=k/KsizoA++JAQSyVD4CXmCc3+2ihDt3QRtrEz6X/3A0ir5GEcava2g++2yhWBDD6Fy fqd3EMk1zUj3448GfqI/rwpwbNGrPDh8vcIngSn5y6HUvZJ8OxzBIpphSQkTnRr8paJg nkNcJ7iuJA7gkBmrxvVHliEAryrMZp9oPv6MQSyBCsYqbvQEGXGEJ2pHG+OQ2+DRPlii F2n5XXz9R40T8Fwj6P3Pn5ykIuNGc3SfgdjWa4Qfd0vQ1/IcHuvqQLDS8wE4dxvcsHIe WX2RRHsoO9LDBaorMLGT66ST6pxn6G6FvZrsB5DXoer785C9Tm0rJeCNhh2AkFyEaaWd Al8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=6KdIzjwpmBh1AHqV9RIW7uYCIBRAKfNxfs9vkV+ETJE=; b=DtDZIZBK/2m1cBaYB08UTQYaCFX2yN4oMQLKTOWMhcQVMtVzZAiK8ugew3NdAECGVb jTUnmUl/65gnJvl79MiwKorAXfHEyTnzsLU0hO0pWo1P7+hp4GaOf65KqbfJ9/d+DpxY eTdQwNtpkKCiBdeEi8BDy+38cdGRqxklXjYfYigbFKSjJTXra5x5AUn1YCG1PUq6UIXI 6U+BE9GxQeLmA6oovoZkZOSCjKqtyhOTTqAijd0eY1jhEpg5OdZt/ALyraJmDCtjD1Of l5pllLUgKnCGxLHdvkKGjHZpTPOffn0Cju35PTioKBc7J1GlSC+mV8/+fEbl/IwCn1Gy sFlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mHJlfujD; 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 ss14-20020a170907038e00b006dfd4233fd1si545972ejb.222.2022.03.24.14.14.23; Thu, 24 Mar 2022 14:14:49 -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=mHJlfujD; 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 S1349856AbiCXNgi (ORCPT + 99 others); Thu, 24 Mar 2022 09:36:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347487AbiCXNge (ORCPT ); Thu, 24 Mar 2022 09:36:34 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F55AA8EEF for ; Thu, 24 Mar 2022 06:35:02 -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 ams.source.kernel.org (Postfix) with ESMTPS id EAD87B823DE for ; Thu, 24 Mar 2022 13:35:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9DC5CC340F4 for ; Thu, 24 Mar 2022 13:34:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648128899; bh=vgO+XlM9BeCgtcvRDqRHD4knyw63jQllRBuby+RwdlI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=mHJlfujDUCwmU7f5lo5U7KWNEfWXz085JS4mn8Vu5/Xy7vPOlrkOP6Y/kxVd1i2rg KIHDxin3cyVZsFrT55iH5hRwv7spQBiH8XSBTqKtpgD3DO5jx/MiySYLQA0ukcEcBS ZzBsM2T75L7uyzmrICjrVGbnNVytmK1NyeJt0LOUZ1abz4y0jiqSRH1XyRc7le+etb 7iITocYn9tkA3jsH5BEpTtaAvgkImr/cM7Bn9vMXTubuskShCvtXYkETku8gdAOXPU 41xmvkOUCWb7I9yg8yXbksHYfMMQlG1xUHL6Fr5sxJHpIn0selj30I72Dd2WGBPYOw 7BvCj0haPDihg== Received: by mail-oi1-f171.google.com with SMTP id w127so4875155oig.10 for ; Thu, 24 Mar 2022 06:34:59 -0700 (PDT) X-Gm-Message-State: AOAM533Fnwxj44raCe6GHIgp3blnyju0rSo9uH2E/K0bL9uzo2dSQfv7 vkQp5EZD2806e88y6KJqtmi3Q9Uv3lOzcULnzJU= X-Received: by 2002:aca:674c:0:b0:2d9:c460:707c with SMTP id b12-20020aca674c000000b002d9c460707cmr2661014oiy.126.1648128898797; Thu, 24 Mar 2022 06:34:58 -0700 (PDT) MIME-Version: 1.0 References: <20220315182558.1a056d8b3975932f6589b60f@kernel.org> <164733793626.1008610.12121025094280924953.stgit@devnote2> <20220324152108.b6016621dd6b8297eddd6bb5@kernel.org> <20220324222322.9f59df377b01856f2230a4ea@kernel.org> In-Reply-To: <20220324222322.9f59df377b01856f2230a4ea@kernel.org> From: Ard Biesheuvel Date: Thu, 24 Mar 2022 14:34:46 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] ARM: kprobes: Make __kretprobe_trampoline as a pure asm function To: Masami Hiramatsu Cc: Steven Rostedt , kbuild-all@lists.01.org, Linux Kernel Mailing List , Nick Desaulniers Content-Type: text/plain; charset="UTF-8" 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,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 --- 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"); } 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?