Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp381227pxu; Tue, 1 Dec 2020 13:42:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJymwCsYrmbHnLaT9VYWJDqn4wvfw5N+fiRvGdcI1QZ08xPf0U3M+IPFWSFZOmuI9Bdwnr1B X-Received: by 2002:a50:d5c4:: with SMTP id g4mr5043313edj.334.1606858936875; Tue, 01 Dec 2020 13:42:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606858936; cv=none; d=google.com; s=arc-20160816; b=mVATcwwdaA/gk6uKFZxJlOrhQR71QZsBtcr/npBDo8bMfFVu3DbbHIGBxjPGiZbDbi Kw009jF8bYz/9HjvlrWEPVnKI3UguA8a9DLIR0lBqu5C8uBEcomiMK019Nx8ksl3UjzK fiOAxOEQychegiK3rqF+qu5P09RAUULDYUWk074ZowYClwcdzwAPcmgicTvKFSNsGcqj W7MTS5CYyCsX5J7FH7VHciP9XP7Z6HHqcDXbeVhuoKgPlml+Y0KLIGM1qAwml7w/8xZk G4+CHfM3SeGWVSIMJ70ka3M2dJJj8fcsjRx0VIdhdRfQHOcwNoz03tZZ1PatUEpBsJLe Lo0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:sender:dkim-signature; bh=IAko/M6Zt1aSlSrXq3lDXb64GB1qle9I29x8xbslmiM=; b=EED+Ij7DhdzTuj1VBZ4k0ytnmxysKQ0vtNxPQivFmjfcCfJXvwIMFOYAGldEnMBnXn PJm9iY3Pj7JtFIjyoI9b4vRJKVGQgGFk6CwxZm55jYNuRgPc88/B1U57D4Ehwf+EHQaD RSzcFFOknxNARtE2RAcz+rAxQHeaVKUshwcKq2BqhU1nFoXwesp73Z/1eXvyo2HPFC/C Z9dXaay5gPWDd7Dl/I4pnla7o1yxJ8bqyYvxBFJr4pff3eQMDBogJmnRY/AoVVhjkyqj 6w7nlWRb+fIi6a50GYv0LSCcYWarGx64PhmoXk98iMFhiWIbUaewQmsKJdX55LDPd0Zs ZZ8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=lDxihdeJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 30si655673edv.385.2020.12.01.13.41.54; Tue, 01 Dec 2020 13:42:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=lDxihdeJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390282AbgLAVjj (ORCPT + 99 others); Tue, 1 Dec 2020 16:39:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390251AbgLAVji (ORCPT ); Tue, 1 Dec 2020 16:39:38 -0500 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11E4BC094266 for ; Tue, 1 Dec 2020 13:37:48 -0800 (PST) Received: by mail-yb1-xb49.google.com with SMTP id k196so4028854ybf.9 for ; Tue, 01 Dec 2020 13:37:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=IAko/M6Zt1aSlSrXq3lDXb64GB1qle9I29x8xbslmiM=; b=lDxihdeJWmA2e6zRs4TGwE13O3VOmpH1sdyN7CY6HZcKARE8DZM0oCaAv6PGzLBfOm /ZsEq2PPIQPCS7MFloSyMFj7kgAkVbls55naobKLn/H//1ss0itsdOqec9UmTUefWOkZ OevqTXLVnJWnu1+9lA+fUkD3ZpM/Bc/Cp+H1CtYxrDQiJ2zLyi7mQrSw2Tg1RcvR5Pvc MD3SFVwZjAlr2nZrrAuw1JZnaw4C+tIlbEJxCUwAQygLAddc8jWwS1H6U4ZPPTd1zOuh GskRIIGrCvhTFuMt7A9YPnLuQPcn84b4pMM7zxhzZZSJJBkFobXmIeaBIWWVW35FDAmE F+jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=IAko/M6Zt1aSlSrXq3lDXb64GB1qle9I29x8xbslmiM=; b=t9yT6X8dooGmmAAusQdr0hGaXta7rgCFJF7vkmHOqpaaxlPbtmvBQqcW8a+8I1L4sB b+vOrbqiWSE/gkp4iZFFgPwaLRFDROXt1GmfZgiu/C0ZhrXFwZorOBKfyUF+vUtQyFNo R7/Y7UhFgdG30AgsiOxWr9v2aOJz5k0I4eUNHfRsmBbjbMkrUzkFvyiCuh1GZ/LRy67C Qv2PlIZ8ADwdntTjghzluU/g6Pg5LubrKKdz0JtmhfqRKVd4crb0+5sR6Md8hT35PcYG mTigUv1JaWIeELkAvpvL2kh55+J/EhtPZ6+G/VBYdNgatjKZxjjQsn+iJsbWjSH0jIW2 pm1A== X-Gm-Message-State: AOAM533WAijOBmF4nFI6EAvVO6ylHQeF1/qlfkpi843V1Tn3JeBEaOVr w0/FCBGGdvGvNGvAxNsNWiY0AnKfGYvHYN7KcPQ= Sender: "samitolvanen via sendgmr" X-Received: from samitolvanen1.mtv.corp.google.com ([2620:15c:201:2:f693:9fff:fef4:1b6d]) (user=samitolvanen job=sendgmr) by 2002:a5b:846:: with SMTP id v6mr6465998ybq.436.1606858667278; Tue, 01 Dec 2020 13:37:47 -0800 (PST) Date: Tue, 1 Dec 2020 13:37:06 -0800 In-Reply-To: <20201201213707.541432-1-samitolvanen@google.com> Message-Id: <20201201213707.541432-16-samitolvanen@google.com> Mime-Version: 1.0 References: <20201201213707.541432-1-samitolvanen@google.com> X-Mailer: git-send-email 2.29.2.576.ga3fc446d84-goog Subject: [PATCH v8 15/16] arm64: disable recordmcount with DYNAMIC_FTRACE_WITH_REGS From: Sami Tolvanen To: Masahiro Yamada , Steven Rostedt , Will Deacon Cc: Josh Poimboeuf , Peter Zijlstra , Greg Kroah-Hartman , "Paul E. McKenney" , Kees Cook , Nick Desaulniers , clang-built-linux@googlegroups.com, kernel-hardening@lists.openwall.com, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Sami Tolvanen Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org DYNAMIC_FTRACE_WITH_REGS uses -fpatchable-function-entry, which makes running recordmcount unnecessary as there are no mcount calls in object files, and __mcount_loc doesn't need to be generated. While there's normally no harm in running recordmcount even when it's not strictly needed, this won't work with LTO as we have LLVM bitcode instead of ELF objects. This change selects FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY, which disables recordmcount when patchable function entries are used instead. Signed-off-by: Sami Tolvanen Acked-by: Will Deacon --- arch/arm64/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 1515f6f153a0..c7f07978f5b6 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -158,6 +158,8 @@ config ARM64 select HAVE_DYNAMIC_FTRACE select HAVE_DYNAMIC_FTRACE_WITH_REGS \ if $(cc-option,-fpatchable-function-entry=2) + select FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY \ + if DYNAMIC_FTRACE_WITH_REGS select HAVE_EFFICIENT_UNALIGNED_ACCESS select HAVE_FAST_GUP select HAVE_FTRACE_MCOUNT_RECORD -- 2.29.2.576.ga3fc446d84-goog