From patchwork Wed Sep 22 17:02:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 12511087 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=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 4CF19C433F5 for ; Wed, 22 Sep 2021 17:21:20 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 1686960FE6 for ; Wed, 22 Sep 2021 17:21:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1686960FE6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ktR4E0NPfNULgp/Ke7Bq6U0kqyIhDWjhLZqHf/mUsAw=; b=KB3FJMNL0NnhNn gZp3BLi9OTqtUNbjCcVxjzGypFPk2EKWq8ex9Hb7kNPkv4VA/vluRwm1pzuycBaf2wiUlt+2zV5qo 3hWdC0eqgulWcv31u42u89d6tc4mToLwOJ3++JyVb22GX3b/1uievdVPpp8VFYa0g8KbXqZ58jvRY dGA99FR0JR/dq2zyfUxvktmDPl3xuDn3dsFLVMXToYhnOTsKcjqpXqoCFQ9j3HMq6HCRosNloGHpz dRWQAyPgXNGK9J4W9CKjpHLotr50frf5dhuBs0BqOq3hr9lJ1tq4hKBRCAHK6niltBgveeOzm9iQc BUTsQrpc7Q8Lk+MDegTQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mT5st-009IYp-Tw; Wed, 22 Sep 2021 17:18:16 +0000 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mT5e1-009Cnu-Bo for linux-arm-kernel@lists.infradead.org; Wed, 22 Sep 2021 17:02:56 +0000 Received: by mail-pg1-x52a.google.com with SMTP id h3so3362972pgb.7 for ; Wed, 22 Sep 2021 10:02:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fkhLdmrHmkgMMt1LbOtoU8XmiMwNfTKIfISAPG6mWV4=; b=AWLGCnuYxvuHY/eWdFDPkxcQLv7jJZh8vwJ7d8A6cIa3eww6dqaGbOnRFMNnTO0R/V RF3kvi571krgpjhGf29g5i9m8OOQsee1GkHzR9MgjeeQL8LvOnlLqpqAqUoAq5qjnCtl AoqY9UKJJpuevK+UaFl2RVLNMBzbw2zxeDuLK7YIwbW5t9+N+w01gl0LLO5IeLj9JALm OFOLia3GjbBJUoSvomNY8TnzS+0Gytyt/s8KiqqHJWNYfeqczxqK+7UyrlkzgZ42Xsl4 mtOLrscUz/uzg6Sgw8ckqzGlcoinHeon8chJZ0I1Y2wY7lialFu5bo/kPWvn45y1+yd7 iCRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fkhLdmrHmkgMMt1LbOtoU8XmiMwNfTKIfISAPG6mWV4=; b=vc7UFlJShZP9Yw45x2A8tiBqe81aCZNH9XfSqva1vB700nbQc2x+gRxHMHkI0+mpIp W94ARxwSFQnECB/FsX+YBEOyxKI87uyuV5Q7x4GRqW6UdGDzsV7IHLGtWjyR5HcjbUpH BHZkDf/0NDZCzJN56ygxXAGfw/ebtSaBgKIA77lerPCblBx1eMkPwDK+Ylh47V2A2SRr XKtneeGPQe12Dc1yW3a01gz8DXx6LkDqbSQzW173FbrSc7m8ugPD01Ph8JlDlJFpGA83 8UVFD5KQCXWBOFUIEdWVs141FpRVOqvYDlrt6a7OZYA2kwD81umvP2W/R1LqWA7DfBVB UPNA== X-Gm-Message-State: AOAM531KFKonhkv/iPgqMHLpVmt+HMFzqxZTb4AeolXkodTaGDEnk+XR X0sjn7Akkdn+vKHSJ3ok9wYywihb6OM= X-Google-Smtp-Source: ABdhPJyq1J1vpE3mVxEq0jyvGL3dsAj/ovf2W3NVRIDnonFLCptD7fJ0s4Opf9VFyO8EYgfQ7iV0OA== X-Received: by 2002:a05:6a00:1ad0:b0:448:3f3a:5ad with SMTP id f16-20020a056a001ad000b004483f3a05admr161170pfv.63.1632330172243; Wed, 22 Sep 2021 10:02:52 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id x128sm3061885pfd.203.2021.09.22.10.02.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Sep 2021 10:02:51 -0700 (PDT) From: Florian Fainelli To: linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org, Greg Kroah-Hartman , Sasha Levin , Alex Sverdlin , Russell King , Florian Fainelli , Steven Rostedt , Ingo Molnar , Russell King , linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT) Subject: [PATCH stable 4.9 v2 1/4] ARM: 9077/1: PLT: Move struct plt_entries definition to header Date: Wed, 22 Sep 2021 10:02:43 -0700 Message-Id: <20210922170246.190499-2-f.fainelli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210922170246.190499-1-f.fainelli@gmail.com> References: <20210922170246.190499-1-f.fainelli@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210922_100253_501637_C3D67F9A X-CRM114-Status: GOOD ( 13.20 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Alex Sverdlin commit 4e271701c17dee70c6e1351c4d7d42e70405c6a9 upstream No functional change, later it will be re-used in several files. Signed-off-by: Alexander Sverdlin Signed-off-by: Russell King Signed-off-by: Florian Fainelli --- arch/arm/include/asm/module.h | 9 +++++++++ arch/arm/kernel/module-plts.c | 9 --------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/arm/include/asm/module.h b/arch/arm/include/asm/module.h index ed2319663a1e..2e9872a22359 100644 --- a/arch/arm/include/asm/module.h +++ b/arch/arm/include/asm/module.h @@ -18,6 +18,15 @@ enum { }; #endif +#define PLT_ENT_STRIDE L1_CACHE_BYTES +#define PLT_ENT_COUNT (PLT_ENT_STRIDE / sizeof(u32)) +#define PLT_ENT_SIZE (sizeof(struct plt_entries) / PLT_ENT_COUNT) + +struct plt_entries { + u32 ldr[PLT_ENT_COUNT]; + u32 lit[PLT_ENT_COUNT]; +}; + struct mod_plt_sec { struct elf32_shdr *plt; int plt_count; diff --git a/arch/arm/kernel/module-plts.c b/arch/arm/kernel/module-plts.c index 3d0c2e4dda1d..f272711c411f 100644 --- a/arch/arm/kernel/module-plts.c +++ b/arch/arm/kernel/module-plts.c @@ -14,10 +14,6 @@ #include #include -#define PLT_ENT_STRIDE L1_CACHE_BYTES -#define PLT_ENT_COUNT (PLT_ENT_STRIDE / sizeof(u32)) -#define PLT_ENT_SIZE (sizeof(struct plt_entries) / PLT_ENT_COUNT) - #ifdef CONFIG_THUMB2_KERNEL #define PLT_ENT_LDR __opcode_to_mem_thumb32(0xf8dff000 | \ (PLT_ENT_STRIDE - 4)) @@ -26,11 +22,6 @@ (PLT_ENT_STRIDE - 8)) #endif -struct plt_entries { - u32 ldr[PLT_ENT_COUNT]; - u32 lit[PLT_ENT_COUNT]; -}; - static bool in_init(const struct module *mod, unsigned long loc) { return loc - (u32)mod->init_layout.base < mod->init_layout.size; From patchwork Wed Sep 22 17:02:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 12511085 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=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 A901BC433EF for ; Wed, 22 Sep 2021 17:20:25 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 6F86460FE6 for ; Wed, 22 Sep 2021 17:20:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6F86460FE6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LJbEqKxD1a8E3U8SYl7oOi+fYHOQHLImor2Hc30hoD0=; b=KscmKzdJfO4jFj 9Vz57uiJixkgSCtsRg02gn+n0OzvgIxVUQJ9eCZRr5MOuY/J1yMfQW/cyvs7ii/4SQ5r5zMM+nMvC 8bfZsLfr2cudIjAffhzefspqDKkZWuPhGgtqYgCdLGGh0F8PdXw3h9q7jbmqglQl+K+c45aNZiBuP ukEjeUxZweVsq+Ljqpc7M+0tUl9M/Eo/1HRaO5WluehMIuK2IDLQWUGlbCaR1iLOzWBaGQ+64KoK3 H3xdnFaDrOfU8JFGNrs/tREkMb6gPtoUW6yG2BNKQe4dQjPtBq/pS0pSoJ/o/ZbqLNNZ7b6up64uw fTloS+SrPJha893gaiSA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mT5s4-009II7-CD; Wed, 22 Sep 2021 17:17:25 +0000 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mT5e3-009Coc-5j for linux-arm-kernel@lists.infradead.org; Wed, 22 Sep 2021 17:02:57 +0000 Received: by mail-pj1-x1036.google.com with SMTP id f3-20020a17090a638300b00199097ddf1aso4992033pjj.0 for ; Wed, 22 Sep 2021 10:02:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Fx3CrEPWbTBsdv7Fz/Y72SC7soyMpdM/flXeUOHk7Co=; b=TwM+747v2LFKhy4Rih8uHUePT0+8XwD2hHYYfx8p/1TRUtVOdLjRFtSHbpWXfx89Xn LY1MVnSNQNWs4pu3Qkkr+CBP4K9iaKM8D8Tdo3LYpozMDK+l168Q39O2fAa3j2XD4/3m W0RSrLW5ss8TFa/9TLLTAzN9zhlrIlt27bxOGT3KjPgQasSohY7ZJfqqnwtzMcEr25TB +I9SLXezgpvOyVZD6F0QxvkcUSM8XmtQN+UUFCWnDuqfNrrOXbhUnjeqzC8bKd8TW19m XOpRw5KJ7CePkuleCbITw0lvBCytwaChfyT0waL0NQof73QFkm0jlTaJI8ZJdD+TvqmN DQhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Fx3CrEPWbTBsdv7Fz/Y72SC7soyMpdM/flXeUOHk7Co=; b=KeAlPXWJ+yGHEClHL4IGDLWXHV1R1a+DMaLFXfPPFK33PHGM3q1heyQC/YZWvRPdYY C3/nekcO/xY0qRd61fJqqvOEDonqQP58vr7QhfJ9Zwb16U0Yf/JgDSBszMpNaIdWtCnA mUdvUSMbVlCSc4Khfj0ZPRlUOfLOaw4FfGG6GRf3UJOcq6Azxpm2RjoCTCzdNjGobpGH in/ppKnIr1p3lq0cFLAVmsJzMgbzNtzSIuKYTLI9UYkKcYNeWHxSkiNE/0YCfF4qtetl Z/MAn5gS3gInbrprpX2lqDUL0yUFife1uUX7pPSyqLvftrece4vzzd2QlbNrXWIc7Of8 MJkg== X-Gm-Message-State: AOAM5323tvX630khtGbm90QMgdWTYIpa6ppee7JRQp9e0dGNhyLSUmg4 ZoCYOdQj2B+9dHId0XBESqI= X-Google-Smtp-Source: ABdhPJy8qdF3eNVCEKfipaUk/X14L4qjdseCSvBzodl54NLLOhw/4VV6bGK8Sc2UhF3hT1Wi2yGVEA== X-Received: by 2002:a17:90a:4d4e:: with SMTP id l14mr88932pjh.4.1632330173664; Wed, 22 Sep 2021 10:02:53 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id x128sm3061885pfd.203.2021.09.22.10.02.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Sep 2021 10:02:53 -0700 (PDT) From: Florian Fainelli To: linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org, Greg Kroah-Hartman , Sasha Levin , Alex Sverdlin , Russell King , Florian Fainelli , Steven Rostedt , Ingo Molnar , Russell King , linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT) Subject: [PATCH stable 4.9 v2 2/4] ARM: 9078/1: Add warn suppress parameter to arm_gen_branch_link() Date: Wed, 22 Sep 2021 10:02:44 -0700 Message-Id: <20210922170246.190499-3-f.fainelli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210922170246.190499-1-f.fainelli@gmail.com> References: <20210922170246.190499-1-f.fainelli@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210922_100255_282008_5C810A60 X-CRM114-Status: GOOD ( 14.96 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Alex Sverdlin commit 890cb057a46d323fd8c77ebecb6485476614cd21 upstream Will be used in the following patch. No functional change. Signed-off-by: Alexander Sverdlin Signed-off-by: Russell King Signed-off-by: Florian Fainelli --- arch/arm/include/asm/insn.h | 8 ++++---- arch/arm/kernel/ftrace.c | 2 +- arch/arm/kernel/insn.c | 19 ++++++++++--------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/arch/arm/include/asm/insn.h b/arch/arm/include/asm/insn.h index e96065da4dae..0043bf609f27 100644 --- a/arch/arm/include/asm/insn.h +++ b/arch/arm/include/asm/insn.h @@ -12,18 +12,18 @@ arm_gen_nop(void) } unsigned long -__arm_gen_branch(unsigned long pc, unsigned long addr, bool link); +__arm_gen_branch(unsigned long pc, unsigned long addr, bool link, bool warn); static inline unsigned long arm_gen_branch(unsigned long pc, unsigned long addr) { - return __arm_gen_branch(pc, addr, false); + return __arm_gen_branch(pc, addr, false, true); } static inline unsigned long -arm_gen_branch_link(unsigned long pc, unsigned long addr) +arm_gen_branch_link(unsigned long pc, unsigned long addr, bool warn) { - return __arm_gen_branch(pc, addr, true); + return __arm_gen_branch(pc, addr, true, warn); } #endif diff --git a/arch/arm/kernel/ftrace.c b/arch/arm/kernel/ftrace.c index 414e60ed0257..a95bc0a02fd8 100644 --- a/arch/arm/kernel/ftrace.c +++ b/arch/arm/kernel/ftrace.c @@ -97,7 +97,7 @@ int ftrace_arch_code_modify_post_process(void) static unsigned long ftrace_call_replace(unsigned long pc, unsigned long addr) { - return arm_gen_branch_link(pc, addr); + return arm_gen_branch_link(pc, addr, true); } static int ftrace_modify_code(unsigned long pc, unsigned long old, diff --git a/arch/arm/kernel/insn.c b/arch/arm/kernel/insn.c index b760340b7014..eaded01b7edf 100644 --- a/arch/arm/kernel/insn.c +++ b/arch/arm/kernel/insn.c @@ -2,8 +2,9 @@ #include #include -static unsigned long -__arm_gen_branch_thumb2(unsigned long pc, unsigned long addr, bool link) +static unsigned long __arm_gen_branch_thumb2(unsigned long pc, + unsigned long addr, bool link, + bool warn) { unsigned long s, j1, j2, i1, i2, imm10, imm11; unsigned long first, second; @@ -11,7 +12,7 @@ __arm_gen_branch_thumb2(unsigned long pc, unsigned long addr, bool link) offset = (long)addr - (long)(pc + 4); if (offset < -16777216 || offset > 16777214) { - WARN_ON_ONCE(1); + WARN_ON_ONCE(warn); return 0; } @@ -32,8 +33,8 @@ __arm_gen_branch_thumb2(unsigned long pc, unsigned long addr, bool link) return __opcode_thumb32_compose(first, second); } -static unsigned long -__arm_gen_branch_arm(unsigned long pc, unsigned long addr, bool link) +static unsigned long __arm_gen_branch_arm(unsigned long pc, unsigned long addr, + bool link, bool warn) { unsigned long opcode = 0xea000000; long offset; @@ -43,7 +44,7 @@ __arm_gen_branch_arm(unsigned long pc, unsigned long addr, bool link) offset = (long)addr - (long)(pc + 8); if (unlikely(offset < -33554432 || offset > 33554428)) { - WARN_ON_ONCE(1); + WARN_ON_ONCE(warn); return 0; } @@ -53,10 +54,10 @@ __arm_gen_branch_arm(unsigned long pc, unsigned long addr, bool link) } unsigned long -__arm_gen_branch(unsigned long pc, unsigned long addr, bool link) +__arm_gen_branch(unsigned long pc, unsigned long addr, bool link, bool warn) { if (IS_ENABLED(CONFIG_THUMB2_KERNEL)) - return __arm_gen_branch_thumb2(pc, addr, link); + return __arm_gen_branch_thumb2(pc, addr, link, warn); else - return __arm_gen_branch_arm(pc, addr, link); + return __arm_gen_branch_arm(pc, addr, link, warn); } From patchwork Wed Sep 22 17:02:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 12511089 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=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 E1D26C433EF for ; Wed, 22 Sep 2021 17:22:39 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id AAEE7610D1 for ; Wed, 22 Sep 2021 17:22:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AAEE7610D1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QEYZQgB+83Ebi0kTe42IGDHLtMahjqHPkFFz++836bg=; b=UrQc/yVT0+2Khi zXsGoUlJkbhZ9iOv/kvD1eShEmdq8UfzGBy04QNGFUV6xuCx5JsN/pS3ghXriLgLPycDVaxs/3Zdy OZ4McRq8lBEqN1tbidrXVMBTk0w+aIgFZLFy66YBfsH9MsyZcikgGjc4V6q+QAc1CiyUp6iGEkagC 9ZUbuBwNu6Jg8HLUxmlLlxcr4FyqUzztkekiKMkyxGnZy9iQMeRhKcZHlEPsvbhFDA/TvIWYcOFq9 l1COQbrfV6B4XnJvictYyiUu1TBgGZ5yC48lAzp1uK82rggX5F/AzdbNCTEMGqxvDDl0LV8TqpIfK xhiB7eQuIVjLFzZUDFsg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mT5u3-009J0f-DU; Wed, 22 Sep 2021 17:19:28 +0000 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mT5e4-009CpK-Pw for linux-arm-kernel@lists.infradead.org; Wed, 22 Sep 2021 17:03:00 +0000 Received: by mail-pj1-x1031.google.com with SMTP id me1so2510068pjb.4 for ; Wed, 22 Sep 2021 10:02:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=knw8EOYFiroirhuQGxEq+gTuK2fL65BldUtmqeBQkzI=; b=N7x5IfdIrft8v0MvXcTwMbv5HoDnZlq2S4ze9xGKhi2ClWoWbSpmVWAfPxZH1Ja/Vt Gian4Gn5MoayKYCdGQdhV3Az3yjs0n78qzBX5Ftc+AvkI2b2qenrZM+lGpdayS43axgp /c4biW8ON1fY8dTLSLRB8vGIlYsu/SoYfMQqHkok2+W95XphtVdtg7eT8r5sXBGqipzx WoTzV6v1moITJ20AVkxiM4hPDuD8Zd5NJa8I+BhuWPJcF3aBJo3EtoHQLB63BDARpw7t q2PjzCX2Dcj3QrbPstSS/iHQWUX+8afP0j6qf5QMDBEkV82nutIhmCzQ47KPKoe65HL/ t33Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=knw8EOYFiroirhuQGxEq+gTuK2fL65BldUtmqeBQkzI=; b=1ZW7c0wWOUf1sMqYbdlEmfYuXri+d9AuCVCFfqfloOamcAHa3zLM37xuDhgc9GWaPQ hZGfex3JjMfuNvJBei96UiFXHTNCinXxd2L39KoiQsYdGLheSR/YEnkTE3qh2dzSV2en MaSSdKi9r+f4jPrRxU0FP3ifFCWtZDLAIC73cVakh9sX8+sa0rwof37neMASMiIKiXCa BHtqYin+nwKPzsVNRuct+MKwg5+mUpetTfLtyrkXSTBtHdaIwwCE7lD69FZQxXODb2nH eLuvkkWC1BamX6X0dyBZ0tbyQgssC8y8E+TXgFLi3G2kmW7cR50qqQLlIm6MaCE1LIdR 339w== X-Gm-Message-State: AOAM532hAosSBYLEuoxNlSCplJnjJ/KYbktj/maYJTu0mlUsLZ5hbBmH MTKcw5T9PElbU7xXLeoMP2E= X-Google-Smtp-Source: ABdhPJyQ/Z2M0XSXUwu6Tt+iAajPiw2Ix0PAxyqZpboTdXImBcE/+i9I7CSRP0hUc2rc59UeiB+q1w== X-Received: by 2002:a17:90a:c982:: with SMTP id w2mr90240pjt.30.1632330175257; Wed, 22 Sep 2021 10:02:55 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id x128sm3061885pfd.203.2021.09.22.10.02.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Sep 2021 10:02:54 -0700 (PDT) From: Florian Fainelli To: linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org, Greg Kroah-Hartman , Sasha Levin , Alex Sverdlin , Russell King , Florian Fainelli , Steven Rostedt , Ingo Molnar , Russell King , linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT) Subject: [PATCH stable 4.9 v2 3/4] ARM: 9079/1: ftrace: Add MODULE_PLTS support Date: Wed, 22 Sep 2021 10:02:45 -0700 Message-Id: <20210922170246.190499-4-f.fainelli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210922170246.190499-1-f.fainelli@gmail.com> References: <20210922170246.190499-1-f.fainelli@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210922_100256_925025_7ECD98D3 X-CRM114-Status: GOOD ( 25.74 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Alex Sverdlin commit 79f32b221b18c15a98507b101ef4beb52444cc6f upstream Teach ftrace_make_call() and ftrace_make_nop() about PLTs. Teach PLT code about FTRACE and all its callbacks. Otherwise the following might happen: ------------[ cut here ]------------ WARNING: CPU: 14 PID: 2265 at .../arch/arm/kernel/insn.c:14 __arm_gen_branch+0x83/0x8c() ... Hardware name: LSI Axxia AXM55XX [] (unwind_backtrace) from [] (show_stack+0x11/0x14) [] (show_stack) from [] (dump_stack+0x81/0xa8) [] (dump_stack) from [] (warn_slowpath_common+0x69/0x90) [] (warn_slowpath_common) from [] (warn_slowpath_null+0x17/0x1c) [] (warn_slowpath_null) from [] (__arm_gen_branch+0x83/0x8c) [] (__arm_gen_branch) from [] (ftrace_make_nop+0xf/0x24) [] (ftrace_make_nop) from [] (ftrace_process_locs+0x27b/0x3e8) [] (ftrace_process_locs) from [] (load_module+0x11e9/0x1a44) [] (load_module) from [] (SyS_finit_module+0x59/0x84) [] (SyS_finit_module) from [] (ret_fast_syscall+0x1/0x18) ---[ end trace e1b64ced7a89adcc ]--- ------------[ cut here ]------------ WARNING: CPU: 14 PID: 2265 at .../kernel/trace/ftrace.c:1979 ftrace_bug+0x1b1/0x234() ... Hardware name: LSI Axxia AXM55XX [] (unwind_backtrace) from [] (show_stack+0x11/0x14) [] (show_stack) from [] (dump_stack+0x81/0xa8) [] (dump_stack) from [] (warn_slowpath_common+0x69/0x90) [] (warn_slowpath_common) from [] (warn_slowpath_null+0x17/0x1c) [] (warn_slowpath_null) from [] (ftrace_bug+0x1b1/0x234) [] (ftrace_bug) from [] (ftrace_process_locs+0x285/0x3e8) [] (ftrace_process_locs) from [] (load_module+0x11e9/0x1a44) [] (load_module) from [] (SyS_finit_module+0x59/0x84) [] (SyS_finit_module) from [] (ret_fast_syscall+0x1/0x18) ---[ end trace e1b64ced7a89adcd ]--- ftrace failed to modify [] 0xe9ef7006 actual: 02:f0:3b:fa ftrace record flags: 0 (0) expected tramp: c0314265 Signed-off-by: Alexander Sverdlin Signed-off-by: Russell King Signed-off-by: Florian Fainelli --- arch/arm/include/asm/ftrace.h | 3 +++ arch/arm/include/asm/module.h | 1 + arch/arm/kernel/ftrace.c | 45 +++++++++++++++++++++++++++++------ arch/arm/kernel/module-plts.c | 44 ++++++++++++++++++++++++++++++---- 4 files changed, 82 insertions(+), 11 deletions(-) diff --git a/arch/arm/include/asm/ftrace.h b/arch/arm/include/asm/ftrace.h index 22b73112b75f..1c30be0f5dd0 100644 --- a/arch/arm/include/asm/ftrace.h +++ b/arch/arm/include/asm/ftrace.h @@ -14,6 +14,9 @@ struct dyn_arch_ftrace { #ifdef CONFIG_OLD_MCOUNT bool old_mcount; #endif +#ifdef CONFIG_ARM_MODULE_PLTS + struct module *mod; +#endif }; static inline unsigned long ftrace_call_adjust(unsigned long addr) diff --git a/arch/arm/include/asm/module.h b/arch/arm/include/asm/module.h index 2e9872a22359..3cfbe8181224 100644 --- a/arch/arm/include/asm/module.h +++ b/arch/arm/include/asm/module.h @@ -29,6 +29,7 @@ struct plt_entries { struct mod_plt_sec { struct elf32_shdr *plt; + struct plt_entries *plt_ent; int plt_count; }; diff --git a/arch/arm/kernel/ftrace.c b/arch/arm/kernel/ftrace.c index a95bc0a02fd8..b1cf37fec354 100644 --- a/arch/arm/kernel/ftrace.c +++ b/arch/arm/kernel/ftrace.c @@ -95,9 +95,10 @@ int ftrace_arch_code_modify_post_process(void) return 0; } -static unsigned long ftrace_call_replace(unsigned long pc, unsigned long addr) +static unsigned long ftrace_call_replace(unsigned long pc, unsigned long addr, + bool warn) { - return arm_gen_branch_link(pc, addr, true); + return arm_gen_branch_link(pc, addr, warn); } static int ftrace_modify_code(unsigned long pc, unsigned long old, @@ -136,14 +137,14 @@ int ftrace_update_ftrace_func(ftrace_func_t func) int ret; pc = (unsigned long)&ftrace_call; - new = ftrace_call_replace(pc, (unsigned long)func); + new = ftrace_call_replace(pc, (unsigned long)func, true); ret = ftrace_modify_code(pc, 0, new, false); #ifdef CONFIG_OLD_MCOUNT if (!ret) { pc = (unsigned long)&ftrace_call_old; - new = ftrace_call_replace(pc, (unsigned long)func); + new = ftrace_call_replace(pc, (unsigned long)func, true); ret = ftrace_modify_code(pc, 0, new, false); } @@ -156,9 +157,21 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) { unsigned long new, old; unsigned long ip = rec->ip; + unsigned long aaddr = adjust_address(rec, addr); + struct module *mod = NULL; + +#ifdef CONFIG_ARM_MODULE_PLTS + mod = rec->arch.mod; +#endif old = ftrace_nop_replace(rec); - new = ftrace_call_replace(ip, adjust_address(rec, addr)); + new = ftrace_call_replace(ip, aaddr, !mod); +#ifdef CONFIG_ARM_MODULE_PLTS + if (!new && mod) { + aaddr = get_module_plt(mod, ip, aaddr); + new = ftrace_call_replace(ip, aaddr, true); + } +#endif return ftrace_modify_code(rec->ip, old, new, true); } @@ -166,12 +179,29 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) int ftrace_make_nop(struct module *mod, struct dyn_ftrace *rec, unsigned long addr) { + unsigned long aaddr = adjust_address(rec, addr); unsigned long ip = rec->ip; unsigned long old; unsigned long new; int ret; - old = ftrace_call_replace(ip, adjust_address(rec, addr)); +#ifdef CONFIG_ARM_MODULE_PLTS + /* mod is only supplied during module loading */ + if (!mod) + mod = rec->arch.mod; + else + rec->arch.mod = mod; +#endif + + old = ftrace_call_replace(ip, aaddr, + !IS_ENABLED(CONFIG_ARM_MODULE_PLTS) || !mod); +#ifdef CONFIG_ARM_MODULE_PLTS + if (!old && mod) { + aaddr = get_module_plt(mod, ip, aaddr); + old = ftrace_call_replace(ip, aaddr, true); + } +#endif + new = ftrace_nop_replace(rec); ret = ftrace_modify_code(ip, old, new, true); @@ -179,7 +209,8 @@ int ftrace_make_nop(struct module *mod, if (ret == -EINVAL && addr == MCOUNT_ADDR) { rec->arch.old_mcount = true; - old = ftrace_call_replace(ip, adjust_address(rec, addr)); + old = ftrace_call_replace(ip, adjust_address(rec, addr), + !IS_ENABLED(CONFIG_ARM_MODULE_PLTS) || !mod); new = ftrace_nop_replace(rec); ret = ftrace_modify_code(ip, old, new, true); } diff --git a/arch/arm/kernel/module-plts.c b/arch/arm/kernel/module-plts.c index f272711c411f..6804a145be11 100644 --- a/arch/arm/kernel/module-plts.c +++ b/arch/arm/kernel/module-plts.c @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -22,19 +23,52 @@ (PLT_ENT_STRIDE - 8)) #endif +static const u32 fixed_plts[] = { +#ifdef CONFIG_FUNCTION_TRACER + FTRACE_ADDR, + MCOUNT_ADDR, +#endif +}; + static bool in_init(const struct module *mod, unsigned long loc) { return loc - (u32)mod->init_layout.base < mod->init_layout.size; } +static void prealloc_fixed(struct mod_plt_sec *pltsec, struct plt_entries *plt) +{ + int i; + + if (!ARRAY_SIZE(fixed_plts) || pltsec->plt_count) + return; + pltsec->plt_count = ARRAY_SIZE(fixed_plts); + + for (i = 0; i < ARRAY_SIZE(plt->ldr); ++i) + plt->ldr[i] = PLT_ENT_LDR; + + BUILD_BUG_ON(sizeof(fixed_plts) > sizeof(plt->lit)); + memcpy(plt->lit, fixed_plts, sizeof(fixed_plts)); +} + u32 get_module_plt(struct module *mod, unsigned long loc, Elf32_Addr val) { struct mod_plt_sec *pltsec = !in_init(mod, loc) ? &mod->arch.core : &mod->arch.init; + struct plt_entries *plt; + int idx; + + /* cache the address, ELF header is available only during module load */ + if (!pltsec->plt_ent) + pltsec->plt_ent = (struct plt_entries *)pltsec->plt->sh_addr; + plt = pltsec->plt_ent; - struct plt_entries *plt = (struct plt_entries *)pltsec->plt->sh_addr; - int idx = 0; + prealloc_fixed(pltsec, plt); + + for (idx = 0; idx < ARRAY_SIZE(fixed_plts); ++idx) + if (plt->lit[idx] == val) + return (u32)&plt->ldr[idx]; + idx = 0; /* * Look for an existing entry pointing to 'val'. Given that the * relocations are sorted, this will be the last entry we allocated. @@ -182,8 +216,8 @@ static unsigned int count_plts(const Elf32_Sym *syms, Elf32_Addr base, int module_frob_arch_sections(Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, char *secstrings, struct module *mod) { - unsigned long core_plts = 0; - unsigned long init_plts = 0; + unsigned long core_plts = ARRAY_SIZE(fixed_plts); + unsigned long init_plts = ARRAY_SIZE(fixed_plts); Elf32_Shdr *s, *sechdrs_end = sechdrs + ehdr->e_shnum; Elf32_Sym *syms = NULL; @@ -238,6 +272,7 @@ int module_frob_arch_sections(Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, mod->arch.core.plt->sh_size = round_up(core_plts * PLT_ENT_SIZE, sizeof(struct plt_entries)); mod->arch.core.plt_count = 0; + mod->arch.core.plt_ent = NULL; mod->arch.init.plt->sh_type = SHT_NOBITS; mod->arch.init.plt->sh_flags = SHF_EXECINSTR | SHF_ALLOC; @@ -245,6 +280,7 @@ int module_frob_arch_sections(Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, mod->arch.init.plt->sh_size = round_up(init_plts * PLT_ENT_SIZE, sizeof(struct plt_entries)); mod->arch.init.plt_count = 0; + mod->arch.init.plt_ent = NULL; pr_debug("%s: plt=%x, init.plt=%x\n", __func__, mod->arch.core.plt->sh_size, mod->arch.init.plt->sh_size); From patchwork Wed Sep 22 17:02:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 12511091 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=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 42709C433F5 for ; Wed, 22 Sep 2021 17:23:15 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 0A2C1610D1 for ; Wed, 22 Sep 2021 17:23:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0A2C1610D1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7h4Vqzh5BR1KqIuaHMIiv2uOaiFPeAx08UGk4dTQYhc=; b=3NscRyUypA5fwU tZVbYVTn1ufsJaxsZMYZ+8YCBOzBI8L4ozm7zfQJOUixrRB+vYjSG+vIBwah1/LBklZA32gnB070v I/djkFlXwoXqnwcg2yc2nYJigLX9OhibVnsWm8qYAMwZEcc2Mk54bK0v/rKT+4qcyw/aTZ562/rfD Gv2VV9Eb8k2emPDvqteEYK6cqAQnCjGIKBsryx13ZT+FYJNXkFQbrWEOTSt65HXbRGkdFZ2NZ9366 pRWE48/MRVbT4ai6MHas74YiCUV2df9PUuwMewZHTdv18riYvRHfwAdW842jU9zSOvPAZrca6f97j +DzN4Ad8WN0GUFZt1iOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mT5v2-009JN5-4O; Wed, 22 Sep 2021 17:20:29 +0000 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mT5e6-009Cpn-4j for linux-arm-kernel@lists.infradead.org; Wed, 22 Sep 2021 17:03:00 +0000 Received: by mail-pj1-x1036.google.com with SMTP id mv7-20020a17090b198700b0019c843e7233so2794470pjb.4 for ; Wed, 22 Sep 2021 10:02:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ETleUGqj8okouLW+8qnjHS0760cK4CL53iB0k0eC4GY=; b=Dprf5xWzJ9KPg3xS9vOEKpHkriRgiOvViVnv+zMjKPVwOOHn/yR8y46EtYYp7I9I5M Oq1jwvqUycvK3kiLKpf7irjLxhFTMv6SGPTemN267XAbndpFW26qcceDD96wh5SDh6+U ulqQaZa8Qk70xIKqjwqE1T1szjjLlpocojYL80kArIwdq5/FztXBcgue95ol7l9EMeNv t4vlkA9t584fPr40FAPsET5xSvH5drMkr3wmBjesZCsH3GWihYW+AD93HAxBAZTmqI/7 zENWeqZReuG/Qcdy/QWhTh4hbz7RzNrIKdictFBn+Fmkk+FnAP9iF31VK0pbt4+Zyiwk efHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ETleUGqj8okouLW+8qnjHS0760cK4CL53iB0k0eC4GY=; b=dtBTx3i2267Ucg+/jJMsG8E1nqMuf3L6sypAnFrUCoct43t626t4SqX52r2IMGnet/ G2mJGBiVGE/t8X9GkqmXm7OWoBdkhGvOozEDC26y6u/A7UGMxBaiPrk+++0JpZzL1bGz Nqs/G5AZL00oC4BARdsMYk2wjWoUYq4eMNi1TrFwV1dNvTzIOy79nI5e8GR75jdWHjiF 2RZt5fa9IVRqqXI+fNNDQl3nEv9HIRl0/b9wF0Xr3ViHmHLQmoU5iqQE5b/0gPfszrz4 DHd71zJTCA/tKfQ+MHQY11kmcSbmwuchDS2Fonwmbz9iOpLs2OWzNhy3DtYA5znkBjsl anWw== X-Gm-Message-State: AOAM532KBwkGlIZS6BKedoWPG1adaOME3rpbWAIdYcszVM4NBld8xi+W 6CN+f5xzQRLy9H4kNSflSM+PoXBGbyU= X-Google-Smtp-Source: ABdhPJxIRGttokXOiwMnk+mLwRFxpSFSzxwc6uPdqvzruvSa4OJ01GDEtk166KRDrXZ4Yhp7boYjbg== X-Received: by 2002:a17:90a:de0b:: with SMTP id m11mr78704pjv.90.1632330176614; Wed, 22 Sep 2021 10:02:56 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id x128sm3061885pfd.203.2021.09.22.10.02.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Sep 2021 10:02:56 -0700 (PDT) From: Florian Fainelli To: linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org, Greg Kroah-Hartman , Sasha Levin , Alex Sverdlin , kernel test robot , Russell King , Florian Fainelli , Steven Rostedt , Ingo Molnar , Russell King , linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT) Subject: [PATCH stable 4.9 v2 4/4] ARM: 9098/1: ftrace: MODULE_PLT: Fix build problem without DYNAMIC_FTRACE Date: Wed, 22 Sep 2021 10:02:46 -0700 Message-Id: <20210922170246.190499-5-f.fainelli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210922170246.190499-1-f.fainelli@gmail.com> References: <20210922170246.190499-1-f.fainelli@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210922_100258_326317_48373DDA X-CRM114-Status: GOOD ( 14.53 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Alex Sverdlin commit 6fa630bf473827aee48cbf0efbbdf6f03134e890 upstream FTRACE_ADDR is only defined when CONFIG_DYNAMIC_FTRACE is defined, the latter is even stronger requirement than CONFIG_FUNCTION_TRACER (which is enough for MCOUNT_ADDR). Link: https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org/thread/ZUVCQBHDMFVR7CCB7JPESLJEWERZDJ3T/ Fixes: 1f12fb25c5c5d22f ("ARM: 9079/1: ftrace: Add MODULE_PLTS support") Reported-by: kernel test robot Signed-off-by: Alexander Sverdlin Signed-off-by: Russell King Signed-off-by: Florian Fainelli --- arch/arm/kernel/module-plts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/kernel/module-plts.c b/arch/arm/kernel/module-plts.c index 6804a145be11..ed0e09cc735f 100644 --- a/arch/arm/kernel/module-plts.c +++ b/arch/arm/kernel/module-plts.c @@ -24,7 +24,7 @@ #endif static const u32 fixed_plts[] = { -#ifdef CONFIG_FUNCTION_TRACER +#ifdef CONFIG_DYNAMIC_FTRACE FTRACE_ADDR, MCOUNT_ADDR, #endif