From mboxrd@z Thu Jan 1 00:00:00 1970 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=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 2FBA2C2B9F4 for ; Tue, 22 Jun 2021 08:11:05 +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 E7B7261353 for ; Tue, 22 Jun 2021 08:11:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E7B7261353 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@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:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VL9eGXFRhfxdotHNI+JzUO804rxgPHXuSoe5XKsMd1g=; b=Lbx3QdrfGUiAH9 mFj7uHXsnJYPafpsIkiDr4C0humowLrZ/YU6YzqWWv1rS5z1ZjtsB36FrmhYtxS++eZ6hjOS85WVL O8hFeNLOtxdRruqL4ZXacZF93H53pdXjxOPLQyqcBPTPrssG/0qsW5qE+rrXwTZPFbtJf26kshDn+ wDTlLFlTzTe0dRJRWu/PeAXu8tp2QSYv/6ZbCoKl+38WSre+EkPRba0bHf5E8TqnxBv/iZHmY9iKA 0jiNHyqnfcW+HthmsQLqx/Q1vA5LDXggVXgSa/A8Qp1oCnyBBxIc2xNxiJOmBPDh2urOqQ6fowKJy HcyfclwQfDZ4krvfThTQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lvbTO-006B1i-45; Tue, 22 Jun 2021 08:09:30 +0000 Received: from mail-ot1-x332.google.com ([2607:f8b0:4864:20::332]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lvbTK-006AzR-0B for linux-arm-kernel@lists.infradead.org; Tue, 22 Jun 2021 08:09:27 +0000 Received: by mail-ot1-x332.google.com with SMTP id v11-20020a9d340b0000b0290455f7b8b1dcso7483643otb.7 for ; Tue, 22 Jun 2021 01:09:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+KIhMHmG9xEoplSTe5YdDdzfi1paJ8XARniBwjTg03k=; b=Ym455ybyRuVNtnqTpdt7P8X+q69idT6SEJDlahlRmKJV8J1gpOx0evM0YjyJjusrTf a8cXrmGrAxJi7wlgusfO0uVUo/9QC971ql1DFoeOSzqCDZzmmHzsiKbu8s3eDfoCSt6G P2swb91IEChiat4UVcQfZ6vzmOk8Glck115Ho3zoNfvpzah8z5QZpvwHE39XDIyAgBuv 5gKW3tUs6lXErSCW6dacjs/ovleLewk67xUMAYNuTPq0/GqpoqUPtJ4oQBzqKf+sfFss /PtP6vNZC9LNRq6pivnr+kGJzasgfAfQuYKy+cVS8XlVMpWthsCQBcaV6ll+O2N9Akmy ksdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+KIhMHmG9xEoplSTe5YdDdzfi1paJ8XARniBwjTg03k=; b=EyFZxszkF3VatBhHWWJeNVMsn/sI8dJIzPUjdikStEYlpedYhrNVkZlmpLZmBPUu/J MCDXKGFkjiRYer6Pr1KOZLieervoFzirYv2Hg/31dJo9qf8A8rdxWXeC9rf17eEFDpjD qDrzpihI+702e//iSTGdJH372OM+o+7EUkr3CVuiId4gtTNuiuZfOJ+uAXANwkPdErpN T/YLymgrgKuHrgeeqTAbhXj/ssY6W+lE/5Q0grPUJIGFOLr2nZz6AOitn8yrJzJAA3MB K53KrCXuH2hxhmveh928jNT71I40E041OXrFpG7mheNjEMr25X8hLgRcqRy/A4TmU/4s 3X0A== X-Gm-Message-State: AOAM532Abyu8QlNJ3dgUd+imRdnjZ1E7iKVD3mCHhZ8CbG6Ky8X1dDY5 PuhO+p0VlaxHcYfY7Zio2trlW1g11gOMaSCwbUq5Sw== X-Google-Smtp-Source: ABdhPJxgFSBmdcbDb55PtEoRgnwSIeaz86uH0dDuE3fvOVYXbp9t15kLoyQklb8X4sv2BZbnmGZBqSmyIw3TqpcW5Eg= X-Received: by 2002:a05:6830:1bcb:: with SMTP id v11mr2131100ota.251.1624349363988; Tue, 22 Jun 2021 01:09:23 -0700 (PDT) MIME-Version: 1.0 References: <20210621231822.2848305-1-ndesaulniers@google.com> <20210621231822.2848305-4-ndesaulniers@google.com> In-Reply-To: From: Marco Elver Date: Tue, 22 Jun 2021 10:09:10 +0200 Message-ID: Subject: Re: [PATCH v2 3/3] Kconfig: add ARCH_WANTS_NO_INSTR+CC_HAS_NO_PROFILE_FN_ATTR, depend on for GCOV and PGO To: Peter Zijlstra Cc: Nick Desaulniers , Kees Cook , Bill Wendling , Sami Tolvanen , Peter Oberparleiter , Masahiro Yamada , Miguel Ojeda , Nathan Chancellor , Luc Van Oostenryck , Ard Biesheuvel , Will Deacon , Arnd Bergmann , Andrew Morton , Rasmus Villemoes , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, x86@kernel.org, Borislav Petkov , Martin Liska , Jonathan Corbet , Fangrui Song , linux-doc@vger.kernel.org, linux-kbuild@vger.kernel.org, Dmitry Vyukov , johannes.berg@intel.com, linux-toolchains@vger.kernel.org, Heiko Carstens , Vasily Gorbik , Christian Borntraeger , linux-s390@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Catalin Marinas X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210622_010926_124757_7CE3BDB6 X-CRM114-Status: GOOD ( 29.18 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 22 Jun 2021 at 09:26, Peter Zijlstra wrote: > > On Mon, Jun 21, 2021 at 04:18:22PM -0700, Nick Desaulniers wrote: > > We don't want compiler instrumentation to touch noinstr functions, which > > are annotated with the no_profile_instrument_function function > > attribute. Add a Kconfig test for this and make PGO and GCOV depend on > > it. > > > > If an architecture is using noinstr, it should denote that via this > > Kconfig value. That makes Kconfigs that depend on noinstr able to > > express dependencies in an architecturally agnostic way. > > > > Cc: Masahiro Yamada > > Cc: Peter Oberparleiter > > Link: https://lore.kernel.org/lkml/YMTn9yjuemKFLbws@hirez.programming.kicks-ass.net/ > > Link: https://lore.kernel.org/lkml/YMcssV%2Fn5IBGv4f0@hirez.programming.kicks-ass.net/ > > Suggested-by: Nathan Chancellor > > Suggested-by: Peter Zijlstra > > Signed-off-by: Nick Desaulniers > > --- > > Changes V1 -> V2: > > * Add ARCH_WANTS_NO_INSTR > > * Change depdendencies to be !ARCH_WANTS_NO_INSTR || CC_HAS_NO_PROFILE_FN_ATTR > > rather than list architectures explicitly, as per Nathan. > > * s/no_profile/no_profile_instrument_function/ > > > > arch/Kconfig | 7 +++++++ > > arch/arm64/Kconfig | 1 + > > arch/s390/Kconfig | 1 + > > arch/x86/Kconfig | 1 + > > init/Kconfig | 3 +++ > > kernel/gcov/Kconfig | 1 + > > kernel/pgo/Kconfig | 3 ++- > > 7 files changed, 16 insertions(+), 1 deletion(-) > > > > diff --git a/arch/Kconfig b/arch/Kconfig > > index 2b4109b0edee..2113c6b3b801 100644 > > --- a/arch/Kconfig > > +++ b/arch/Kconfig > > @@ -285,6 +285,13 @@ config ARCH_THREAD_STACK_ALLOCATOR > > config ARCH_WANTS_DYNAMIC_TASK_STRUCT > > bool > > > > +config ARCH_WANTS_NO_INSTR > > + bool > > + help > > + An architecure should select this if the noinstr macro is being used on > > + functions to denote that the toolchain should avoid instrumenting such > > + functions and is required for correctness. > > + > > config ARCH_32BIT_OFF_T > > bool > > depends on !64BIT > > There's also CC_HAS_WORKING_NOSANITIZE_ADDRESS in lib/Kconfig.kasan that > might want to be hooked into this, but that can be done separately I > suppose. KASAN already depends on this for all compiler instrumentation modes, not just for 'noinstr' but also to avoid false positives. So it's not just for noinstr's benefit, and we should not weaken the requirement there. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel