Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp673976pxb; Wed, 18 Nov 2020 14:12:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJw5UkQkE8nL2LARqHNVkxXCVJfbfWdtnz5Q5rW+qD6gVegwgEM8k7MfOz50m0NVOAV4wLWk X-Received: by 2002:a17:906:4551:: with SMTP id s17mr7664103ejq.545.1605737540057; Wed, 18 Nov 2020 14:12:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605737540; cv=none; d=google.com; s=arc-20160816; b=BjfP17k9b6RAZ0EkX63cxQT8Tsfz8jYgVAXcXEFRXWvJ83/OlS+AjxE+6PO9bj+o7y Lz2/nmGMQry+9YbhnG5C5AusV/l8pye1Oe3Q21VyPJnP7oDKlefiDQ/teFhrkYveleXb Kje/XmUkFgdEQz2R+cRsEtthrPGzDLwzM6UTIHkZglu1spGY1WAKbPb0JyQzGN9lg5As hJPuwNqM+4QOT1AOo99C2nhrf6wfIdUOgYKOP3qWRQ6rLf7+wgl9yZx5z8QVKjfEsUbc ECpsOmzcvXmkEeiqgFAwpF3XqIXW6Xg/6bZ7f8xfpHT0weNlM4wTbuhLpzJG6rirtFBn VmAA== 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=C9kRHDqVxMS9meVJm6Hst0wtaqe3NZ38y9krJFbUxhM=; b=dCC26DNgB6nyqqhfVJXFFuC36Iz8wI+RJqvBwXwe6C1eY6RQEeXlVCxlhtbN9E+8op b77Ncn07Fbck0+8QulInlEorlSO1wcXgs4PfNqiAeRIslagD/Ed/Ry2IBSDUKNm1vajJ rsSgEo8U3uNvV9uT/3FEU6Wlvyi08xbSKf2lRr2NMrJXYfgdrjBpLqCWPddmfbpYgJ5+ ItiF92+YGl7tO20HmBJDjN+htRu9bKVuXrcN3zEt4m/fxaLz8L7KikjU041G7v7Kyjc3 QJcfqm3XUnfU4T8MMnyVGco7rj/28Rc+u8k/JGs2COnS8ae0R3r1GyU7+KsYtLnzJQ97 SflA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="Hl0/5xWu"; 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 qt13si16412003ejb.358.2020.11.18.14.11.57; Wed, 18 Nov 2020 14:12:20 -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="Hl0/5xWu"; 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 S1727554AbgKRWIW (ORCPT + 99 others); Wed, 18 Nov 2020 17:08:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727553AbgKRWIL (ORCPT ); Wed, 18 Nov 2020 17:08:11 -0500 Received: from mail-qv1-xf4a.google.com (mail-qv1-xf4a.google.com [IPv6:2607:f8b0:4864:20::f4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67A22C061A51 for ; Wed, 18 Nov 2020 14:08:11 -0800 (PST) Received: by mail-qv1-xf4a.google.com with SMTP id v1so2511232qvf.11 for ; Wed, 18 Nov 2020 14:08:11 -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=C9kRHDqVxMS9meVJm6Hst0wtaqe3NZ38y9krJFbUxhM=; b=Hl0/5xWucUPJ643/PIYI+sdYOG9Js6rvOiCoWjAxZvuk5n0EKu2IQNyuMBh6yuGcq9 GKmyN/Fjv1jDACb/r2eyKCWMiRaP+4jFOJ6W4iVlTT1s5IuE0w5eW1wzTr9z3qGyZB+c 1+Ac3lgon9jRiCkfkxGCRfVfPCkQ6vCnGvL8X0mU+VnbyrvK/6C28dCzTrjfsSmgp5BY 2Jbefx7UjiqpuevCvMPBNA4WlnqB56ySe/GRWbZuQ3g+Xtr0BahoHUIbgF6ovQ/Jl0Ng P8wwQ6WGRG+ElcWU389UI3hoPAsl5dsytrkZXsVBF/3XKPHdZFVmlJ7BHjNcimLrN72n o+Fg== 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=C9kRHDqVxMS9meVJm6Hst0wtaqe3NZ38y9krJFbUxhM=; b=HrhzJVgDBKuZmVXpqJDj8Je6GSyzY3GbI/ZWgEseSCj++WVyEV7sQ5EGovTBjRD0X4 tEBVdboS3iRmodv1FhFyrsWQ6mTN6gqU0i7TqGmOH4MMXtOQmdsDLDF0+2sAamcmimIC MpDVLgW6EOHUqG3mX5lZ6sjSJQqxeNDQRxvYWsfV0b+a0HTiw0ZAwOrXCD8DE5p/VbB+ x8QgytX8a2Rxe2o+lEcamnfMt1PHGRpVmja8L31s2aVZz9oDPgVmsAuYaLbDNVNCBJER HQWXsOax3MG8PSqIsi5VxIa5SIOvwazHhQRKt+qrwVNs0mXOgR+7PNI3+3LRZtfmCtBE 8XjA== X-Gm-Message-State: AOAM533JzIdmtn2qtv2MmsS5SObK6uLK/vq5cSdZFyIy7SVLobAUH/JH 2p+uyx8sRUF/LsJQaq+uXlRBbYRRwrGJ92zjsMQ= 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:ad4:4e0d:: with SMTP id dl13mr7176727qvb.54.1605737290528; Wed, 18 Nov 2020 14:08:10 -0800 (PST) Date: Wed, 18 Nov 2020 14:07:30 -0800 In-Reply-To: <20201118220731.925424-1-samitolvanen@google.com> Message-Id: <20201118220731.925424-17-samitolvanen@google.com> Mime-Version: 1.0 References: <20201118220731.925424-1-samitolvanen@google.com> X-Mailer: git-send-email 2.29.2.454.gaff20da3a2-goog Subject: [PATCH v7 16/17] 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 --- 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.299.gdc1121823c-goog