From patchwork Wed Sep 22 17:00:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 12511041 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 E403AC433EF for ; Wed, 22 Sep 2021 17:04:36 +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 A9B956120F for ; Wed, 22 Sep 2021 17:04:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A9B956120F 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=wMdQL/I73t4BuygMrWj8TKtr6KFdS7xEcVzgnOpL+vE=; b=HbxYFw9/MUkrwr JlOseK9eT9YCfzcrwGwaejXL27p7TRo9YD6sjUOiJ8/gUti/A3dmMPbMybjtS94w6Q4HiVvbDVhEL yVOITg+PftGI7vly7TDS4B3d53Ltj0bwCJakwA0cxDwMWj+wQDn/oAY2Bt5pgFr0S3R1aqKQPMI7p YvhWMBIUZj5Bhv65swvUGGwsjHEnlYCTeCJbW7lCmre5+agZaXhV2IjnlXaTw7j5M9iiyvHCc1KUi PQrvq3tIna5XYUBAB2cdCiSGCkYrcXwK6kth8xn0gQfJSiIe1G6QvWaWywdIAGwTesgjot5jvaqsU 9NPqXtEqAJjAJjG8HnKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mT5dg-009Cb1-TU; Wed, 22 Sep 2021 17:02:33 +0000 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mT5cN-009C2p-5a for linux-arm-kernel@lists.infradead.org; Wed, 22 Sep 2021 17:01:13 +0000 Received: by mail-pg1-x52e.google.com with SMTP id u18so3426621pgf.0 for ; Wed, 22 Sep 2021 10:01:11 -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=vWRcCpDBCE+vzsQtuqngj9goI5v+Yy84JYj8ZdWoLcc=; b=qhAhQXsWxKoZI6SsJA792fI7EuNZxblUI4fBuB0ALX2oNGGUOcv9yX26JTDamU+tgs 2jmQ4Kl96+PQ6Qam2u6HUrZVPJZYTfnuhE9XfSQhRIYS49g1PKrUv/kQu+zCXPv8lzhs MfS0L7hFJvfdnp2talH/oeXgo34dq6iwReZfQqTliGB+ZvmTAqdBWr/scoGtFygScDtv 1UTsA/Qhj8g6s3dyYufnoszHAgDIgAg7wMM++UH6VGLBG4U5LpWvBbnhF/ShHQi8UbZ8 7WmPeqOBpMQ+onmVyTNxKjwzeJdOEirT58ZBHkv0/MoEFOFRV0PWMQqIe2L6DUTLTELA tyMQ== 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=vWRcCpDBCE+vzsQtuqngj9goI5v+Yy84JYj8ZdWoLcc=; b=6CVzciogdpcFiC5XViSIcnH9dDD7IE28VxAmA3RfnBEwgKu5dhLu5qlyJzuxkKFw5G Xw7hx3Dz/wm7xxy2ucRDZd6/wMUts5gyu7V514BsSwOtj4KQfl35n8waW6VY8FNrY9Gc Quqv5oSgPdg/fFF299sWWYEjorowZvJO1VV6YA61XvzPOSp96sYLZNfGaCtpM8K5W4LT o4JqUjXr1jgI0T4wq7rJRM/H66xy51LWM4SBrCPDPQFit1sjgRPPhrm3aek6x2BYYu0S a1losYws5uZPOlmnfeBbutbHXrDOBYn5513w/RzJOidRL5kUYQqqahcRUjO24QtM1tkX VcQQ== X-Gm-Message-State: AOAM532McSau4R0U0RAxxyzDuc90x9E288ObPlgWmQPvFPZ0fEyR70oO jsWAS72KQ9qMnvb7yEczeUc= X-Google-Smtp-Source: ABdhPJzXto/l2ks4tTQkP196214igtnpqDMIWeS2ZEKZOKBbTzPVmoNAajwkaJn7hp99pHegKQuZeA== X-Received: by 2002:a63:1656:: with SMTP id 22mr667810pgw.20.1632330070640; Wed, 22 Sep 2021 10:01:10 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id i27sm3041404pfq.184.2021.09.22.10.01.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Sep 2021 10:01:10 -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 5.4 v2 1/4] ARM: 9077/1: PLT: Move struct plt_entries definition to header Date: Wed, 22 Sep 2021 10:00:31 -0700 Message-Id: <20210922170034.190023-2-f.fainelli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210922170034.190023-1-f.fainelli@gmail.com> References: <20210922170034.190023-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_100111_272413_D0EE26A9 X-CRM114-Status: GOOD ( 13.41 ) 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 182163b55546..78e4c1644628 100644 --- a/arch/arm/include/asm/module.h +++ b/arch/arm/include/asm/module.h @@ -19,6 +19,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 b647741c0ab0..d1b76f3f3df9 100644 --- a/arch/arm/kernel/module-plts.c +++ b/arch/arm/kernel/module-plts.c @@ -11,10 +11,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)) @@ -23,11 +19,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:00:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 12511043 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 7F6F6C433EF for ; Wed, 22 Sep 2021 17:05:14 +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 536956120E for ; Wed, 22 Sep 2021 17:05:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 536956120E 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=fQIk1ARvfk8905dvhzaT30d6XPBeh0P0jzjIx43/J+I=; b=3aXfC/iz+X6lzL rbznAj4/FD82d6dz3T1SD08ZxkSbfy6b6DcnY824442JmT/CtBrLQbCVwcGao7NNYhoCugB0URYrg /ClprNLg/jZHclcUFs/27lJDfKwwI7DQcv7XW2xgDG1AqhYYtx4wSt1pxrvC+JXfQiCFBHpDPkdTW CosPvaq2YPZCmEMHZgYFGidPi17Nd0H9C/TQv7bmDWz1D02q2hkPsSuDIjVkqhahYhsaMdezbEB/u C0DjJulkO+L4AqTEG9gQCyC3aFmM/hQXS9B3NpZWa/rFtwarUUdrpl5Nrzf8xbvu8hdq4pqYF1cUx hv8mItTKMqT4Su1OEWow==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mT5ea-009D3c-1O; Wed, 22 Sep 2021 17:03:28 +0000 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mT5cT-009C4o-7L for linux-arm-kernel@lists.infradead.org; Wed, 22 Sep 2021 17:01:19 +0000 Received: by mail-pg1-x536.google.com with SMTP id w8so3368493pgf.5 for ; Wed, 22 Sep 2021 10:01:16 -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=MOhptkmv9edXrdiqH8+39RmWkP/z/b8cujzYFZjvDes=; b=pRveiJE6+GlxFGqLrBzhDKFMNX5sz+mbMWSxVNFvPgfMwJBTIK/rJr/hwTFSfgjKgX DYL9EMUSGVh1mEBTrV12XztrrWthkClPA93oJzR5i72Wt5q8DuN5Qf94TJnEcKWVRhoA Wdca4/wqbwDh3vTpB9D28mOPE5NyphgP8LmTBGytmJoY3pBHdV/MZJzQSl8ZXiCbSspL JaPGPeNWnHaVm8h8n7fvmYr4ChwNpFmCH+QVq9j3DOEq4kkmGsFP+zJzpBy1gRrNXx/o 4eSXnUZU4rAjB5ZkpAsgB66c2aQPW1vB9UQ8pgutTR8Z0GwkwaMeQ4scZDVAcMF9vn+/ Y5kQ== 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=MOhptkmv9edXrdiqH8+39RmWkP/z/b8cujzYFZjvDes=; b=Smzqz59bH36iiulK76s3F4Z/OGiWoz4MmABxnHnN8/11tgSjfQeOt2jPLjkKtB1U57 g1fqbR9Mjr0rBtNHNdpdM3rBeVbzANTuUC0lCoh28iW/Z0EbtYgzTpiLIJqNfFdKZQf8 qNiJVtwuP98RGEcRHXARda+Swb8BOSQ7Z0Ao97Bu4aw8Jccco3uEMDw2JTJOFodqgTxM R1Kkt/lxpAPsn7xXtFF04QvY/HdXArLn0BzebMddniJq5FdmXoBfKlEQTq9j7D7eMLGM YaFY7neiOVnvKduzlQGLjR6F9OUlsa8Q3ooAI2sAuSy1E69AfU1bqtiwkr5EyEvyY3yd l5Lw== X-Gm-Message-State: AOAM532lXz8/VZgRS4IxQgj4SZhNEUM0x5N8zJDN8PUYpXpex9DhkIpD nyTO+9Z9parV/uIzsoDNoSM2cZub0uA= X-Google-Smtp-Source: ABdhPJy32RDbVZqoIviKU57hmX8WtQFtqQ2sU2bAwUY+mYMWKBAh1LVEoDJl7KOyYNaYjRGXfYhJZw== X-Received: by 2002:a63:1902:: with SMTP id z2mr643615pgl.312.1632330076033; Wed, 22 Sep 2021 10:01:16 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id i27sm3041404pfq.184.2021.09.22.10.01.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Sep 2021 10:01:15 -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 5.4 v2 2/4] ARM: 9078/1: Add warn suppress parameter to arm_gen_branch_link() Date: Wed, 22 Sep 2021 10:00:32 -0700 Message-Id: <20210922170034.190023-3-f.fainelli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210922170034.190023-1-f.fainelli@gmail.com> References: <20210922170034.190023-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_100117_365582_C7999038 X-CRM114-Status: GOOD ( 14.86 ) 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 f20e08ac85ae..5475cbf9fb6b 100644 --- a/arch/arm/include/asm/insn.h +++ b/arch/arm/include/asm/insn.h @@ -13,18 +13,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 bda949fd84e8..f2073cee4102 100644 --- a/arch/arm/kernel/ftrace.c +++ b/arch/arm/kernel/ftrace.c @@ -73,7 +73,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 2e844b70386b..db0acbb7d7a0 100644 --- a/arch/arm/kernel/insn.c +++ b/arch/arm/kernel/insn.c @@ -3,8 +3,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; @@ -12,7 +13,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; } @@ -33,8 +34,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; @@ -44,7 +45,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; } @@ -54,10 +55,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:00:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 12511045 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 E4D31C433F5 for ; Wed, 22 Sep 2021 17:06:06 +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 AA69A611CA for ; Wed, 22 Sep 2021 17:06:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AA69A611CA 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=E9Hxh1o6Numqa0DrjxC4vCTTKk92yKZqGrzDH9EDGqw=; b=JHj6wzb6TEf8w/ gakoE2wG60zG9aWZV7FA7qxz/Re9nZ9AzEz9HU2dbVFAwH2m688akiBdKBakFUqNK6ipc65SGf+Ee d9KKyAD7msc0ry4N7NJr9f3QMP3T73MB+s/fwmAgLwJof4yRVcAB50jAY78ZcCZu/tR373NQ4cqpW OMOvRpq1xjMyHKqMtHsB+QFQ5xGWNo4FZt+p5QExaeX6Scv70KIa5FXTE04PbHQ/2yYrhDf1sMnDk PhDGzW7MotRwPNGgOyFHIHi2KWs9Si7zET9FhVcIIGfrx7rOS1p6BQL+o/uX3raIzC3kFifS8+RsH 7AEp8CroRsyOypXcuLpg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mT5fL-009DQl-8Q; Wed, 22 Sep 2021 17:04:15 +0000 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mT5cY-009C7T-SW for linux-arm-kernel@lists.infradead.org; Wed, 22 Sep 2021 17:01:24 +0000 Received: by mail-pf1-x434.google.com with SMTP id w19so3211221pfn.12 for ; Wed, 22 Sep 2021 10:01:22 -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=OSqVRNJJQSNBTfpzFaC+ZHhc384CpmlWun+/9OZsWig=; b=pKbclVQ3TWvossHhK7JhLeoT/2dhuFg0gisW/g52TsOrgAqLyaDN5foZwkfZjO+5/s M3bSUuh+yA5f1Ic4iTg/ddVJFmPjG7dUllAXKay4C6FIxe+guLvIyMMNKxF8HYu8XECB qpmgjEQ2kmt9OgNPIAxXuetVIa/HSHnVUBopbt2IKM33EQh+gvmX3riktw/e3Q0e9etI L797sMICRS2aALxSqzUjZbdvlxm+vn1cu8kR9a20Io2rSMRulhmtDIUCpevXK12ZpBc6 IO+ajhK/0Y3cGN6TzO0RYaV+johi/eUPUtv42YGswjiu7EPYxTTGTJu7lFYQrlyzu0JY 62WA== 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=OSqVRNJJQSNBTfpzFaC+ZHhc384CpmlWun+/9OZsWig=; b=Ja21meZ821HSStHGyvw5BfkPF1WZHucAiyuyrZWBLkJQzWm8Zqct7e2pWnPcr8YX6f 9OFXy1KJZ5L7Ui/P1tT1A8SFqesHzFDXQRzBJWXsgqg0srU2Uru/ZQuOfIKCoi72bMxn URfjlUnQh6bn8C+O9GwMdJApftjYf8RMdnN3hrgHvYyVY0qcV4MA0CND53w7+WGXimcD Fsdj82NYTss00xBbQzBKoOa6h2MnIm63vfdRrCFVllmEnB1xEzxeH6TEdzttRo1lPoCl hwQ1TbJsYlLQsBTL2vP+e7DfqL23PM8dpamluq9UwFO5cNv+lPmc5VEx9xwxValt3Ezu pnBg== X-Gm-Message-State: AOAM532/UZ64HuYhfn2FfHtb5mJEICcq9hXLMqV43g4Zj9rJeeVKxs8X Fst/Cq/iKlG2MIhUxznhoF4= X-Google-Smtp-Source: ABdhPJx9FaJxCMPaFlI4/J2AsAR6SVEM8iugjVx1gaRDE1keJw+IcGx6rfG2P7qAJPQyJR3k5pBctQ== X-Received: by 2002:a63:7405:: with SMTP id p5mr627860pgc.426.1632330081614; Wed, 22 Sep 2021 10:01:21 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id i27sm3041404pfq.184.2021.09.22.10.01.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Sep 2021 10:01:21 -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 5.4 v2 3/4] ARM: 9079/1: ftrace: Add MODULE_PLTS support Date: Wed, 22 Sep 2021 10:00:33 -0700 Message-Id: <20210922170034.190023-4-f.fainelli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210922170034.190023-1-f.fainelli@gmail.com> References: <20210922170034.190023-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_100123_014714_18A75BB3 X-CRM114-Status: GOOD ( 25.60 ) 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 | 46 +++++++++++++++++++++++++++++------ arch/arm/kernel/module-plts.c | 44 ++++++++++++++++++++++++++++++--- 4 files changed, 82 insertions(+), 12 deletions(-) diff --git a/arch/arm/include/asm/ftrace.h b/arch/arm/include/asm/ftrace.h index 18b0197f2384..15bd9af13497 100644 --- a/arch/arm/include/asm/ftrace.h +++ b/arch/arm/include/asm/ftrace.h @@ -16,6 +16,9 @@ extern void __gnu_mcount_nc(void); #ifdef CONFIG_DYNAMIC_FTRACE struct dyn_arch_ftrace { +#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 78e4c1644628..961fedbd810e 100644 --- a/arch/arm/include/asm/module.h +++ b/arch/arm/include/asm/module.h @@ -30,6 +30,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 f2073cee4102..12b6da56f88d 100644 --- a/arch/arm/kernel/ftrace.c +++ b/arch/arm/kernel/ftrace.c @@ -71,9 +71,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, @@ -112,14 +113,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_DYNAMIC_FTRACE_WITH_REGS if (!ret) { pc = (unsigned long)&ftrace_regs_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); } @@ -132,10 +133,22 @@ 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); } @@ -148,9 +161,9 @@ int ftrace_modify_call(struct dyn_ftrace *rec, unsigned long old_addr, unsigned long new, old; unsigned long ip = rec->ip; - old = ftrace_call_replace(ip, adjust_address(rec, old_addr)); + old = ftrace_call_replace(ip, adjust_address(rec, old_addr), true); - new = ftrace_call_replace(ip, adjust_address(rec, addr)); + new = ftrace_call_replace(ip, adjust_address(rec, addr), true); return ftrace_modify_code(rec->ip, old, new, true); } @@ -160,12 +173,29 @@ int ftrace_modify_call(struct dyn_ftrace *rec, unsigned long old_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); diff --git a/arch/arm/kernel/module-plts.c b/arch/arm/kernel/module-plts.c index d1b76f3f3df9..1285d6770fdf 100644 --- a/arch/arm/kernel/module-plts.c +++ b/arch/arm/kernel/module-plts.c @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,19 +20,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. @@ -179,8 +213,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; @@ -235,6 +269,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; @@ -242,6 +277,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:00:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 12511047 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 23134C433F5 for ; Wed, 22 Sep 2021 17:06:36 +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 E646F60240 for ; Wed, 22 Sep 2021 17:06:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E646F60240 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=XXEEXeMXaVG3O52TKps+UtFrUNpKZB7i1eccfWiBl0s=; b=x2vwg6yptE8ZKP rNA9/QGTeX2t24IsGANzBv8ixHGYOzmiD8o9Z3GXcSVI9xE3FeG4YdMruMnjlUsJqquxnBToVtFyY cq1TEhaufFb0/QmVYv13IYvKeALOLUEgYt8VFBKpHPRZyjeDvZu4btZUhdn/hxPG5jMVKbvaGOMxJ iiL1BIXNdFXMBEi5954qGx6n45hhbIx6VHX/0rayZH+DPULvLWQbQM6SKmZQ8LKK6e8QsVDiN2irm 8HTFz4TW5BT6aFif/VrXNXXu5hwAEkueDfO/pk07Vp7IgLLMvgQHkJhXXac18KW2ZS9/NaouG84Xm IRphozC1f/F0Mqg0ie2A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mT5fz-009Dl5-Ia; Wed, 22 Sep 2021 17:04:56 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mT5cd-009C9Z-Qv for linux-arm-kernel@lists.infradead.org; Wed, 22 Sep 2021 17:01:29 +0000 Received: by mail-pj1-x1034.google.com with SMTP id k23-20020a17090a591700b001976d2db364so2811862pji.2 for ; Wed, 22 Sep 2021 10:01:27 -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=a/ftcT1Si5LLqrGRd7+ykyLXm/kzJfgC1iySzpAzFqo=; b=j7q6p/LWwo6ESmjJq+GhqTt1eYjOuU8ON1WGKI2/KgW2x96nfl8wlo4D+uQo1aRV90 Z901/KLZfoVHE4ha3BzFrbj6ikMcZnMLfO1mZhNsQdsQO96Wj0sNipFg2/msKIefqoNg bfdhKOidZ+9x4zVuw7Z0I5pR0DfVW2OIUj5wdmNOGYEmkty70Mgli1/1nilO/+JvEDJC l6xKy8Ao8vpa4BUL21ZH0LFcZnPxCi0AJX42T2UmUIY6DHIQjKNgxaaUCCkexvLshQUG BlFs/gKJ6JIllQHtB6V+wVOBZmPQZumZM8gwT0CDh6kY5BhROsyGAA2XfDGqWevmbuuE ZP9Q== 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=a/ftcT1Si5LLqrGRd7+ykyLXm/kzJfgC1iySzpAzFqo=; b=Oh+L5xXqMu4D4as65reGkTHHbIq5UNrRd0bz5fssmAguimoC4q+S70dyILrVn+aucq +nBlcAJeNaiSuuSJu7iiyMnH+XtdVJRIzkI56I+ZHGvfpMjoCseRGs0gYMbjly7tPWLb WMbZnOzQ/msps7Dkz6reLdDJvjhc1k2gmGBPldGx0oDeGLZZO3ab4+e05ZkZr+pWuFRA s0YQRwikukF9C9S4Zsst3UFjw4mlIxlJE4voAVylug/04LUuJxzyUptnfY6rSy9jN3Zw s1F/evMUrhFIf7eluTGBT6S/Gl3e0Ym8aJyYjNaUObjxxNPpimkoYPcVr84mMtHcpbz6 RBFw== X-Gm-Message-State: AOAM5319YbMcfMOjmzDwIZ3kakTAoWFuHRe1jh1TDMX+jjo4efzPe1YJ SvbjhAhL40VxdtfLfJnZHoA= X-Google-Smtp-Source: ABdhPJwinukf6bX92dmwbAt6lE1DpGM7e8DM4Z7pbtvT8NkWppTtDNGyuWn9wq2aJLCuVhZIjbGpiw== X-Received: by 2002:a17:90a:1912:: with SMTP id 18mr8578402pjg.24.1632330087349; Wed, 22 Sep 2021 10:01:27 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id i27sm3041404pfq.184.2021.09.22.10.01.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Sep 2021 10:01:26 -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 5.4 v2 4/4] ARM: 9098/1: ftrace: MODULE_PLT: Fix build problem without DYNAMIC_FTRACE Date: Wed, 22 Sep 2021 10:00:34 -0700 Message-Id: <20210922170034.190023-5-f.fainelli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210922170034.190023-1-f.fainelli@gmail.com> References: <20210922170034.190023-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_100127_922596_CB1A47F6 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 1285d6770fdf..d1c2d3bd55b6 100644 --- a/arch/arm/kernel/module-plts.c +++ b/arch/arm/kernel/module-plts.c @@ -21,7 +21,7 @@ #endif static const u32 fixed_plts[] = { -#ifdef CONFIG_FUNCTION_TRACER +#ifdef CONFIG_DYNAMIC_FTRACE FTRACE_ADDR, MCOUNT_ADDR, #endif