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=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 3C195C433B4 for ; Wed, 19 May 2021 15:02:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 146FE6135F for ; Wed, 19 May 2021 15:02:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348628AbhESPDy (ORCPT ); Wed, 19 May 2021 11:03:54 -0400 Received: from mx2.suse.de ([195.135.220.15]:48494 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233345AbhESPDt (ORCPT ); Wed, 19 May 2021 11:03:49 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id B9236AF11; Wed, 19 May 2021 15:02:28 +0000 (UTC) Subject: Re: Linux Plumbers Conf 2021 To: Marco Elver , Mark Rutland Cc: Peter Zijlstra , Nick Desaulniers , Josh Poimboeuf , Will Deacon , "Jose E. Marchesi" , "Paul E. McKenney" , Ard Biesheuvel , Catalin Marinas , linux-toolchains@vger.kernel.org References: <20210518121447.GB7914@willie-the-truck> <20210518124311.r4fwv6lfz3erkqnb@treble> <20210518124819.lkzzgjcrh4cc5a6i@treble> <20210518200306.GE21560@worktop.programming.kicks-ass.net> <20210519093240.GA2797@C02TD0UTHF1T.local> <20210519115654.GC2797@C02TD0UTHF1T.local> From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: Date: Wed, 19 May 2021 17:02:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-toolchains@vger.kernel.org On 5/19/21 4:04 PM, Marco Elver wrote: > +Cc Martin, who helped us last time with no_sanitize issues in GCC. > > Martin, as far as we're aware there's no > __attribute__((no_sanitize_coverage)) for GCC -- is it possible to > implement this? Some context below. Thank you. Yes, I've just implemented the attribute and I'm going to send it to the gcc-patches mailing list tomorrow. Cheers, Martin > > On Wed, 19 May 2021 at 13:57, Mark Rutland wrote: >> On Wed, May 19, 2021 at 12:19:38PM +0200, Marco Elver wrote: >>> On Wed, 19 May 2021 at 11:32, Mark Rutland wrote: >>>> On Tue, May 18, 2021 at 10:03:06PM +0200, Peter Zijlstra wrote: >>>>> On Tue, May 18, 2021 at 09:57:26AM -0700, Nick Desaulniers wrote: >>>>>> On Tue, May 18, 2021 at 6:23 AM Peter Zijlstra wrote: >>>>> >>>>>>> - validates noinstr annotation; *HOWEVER* we rely on objtool to NOP >>>>>>> all __sanitizer_cov_* calls in .noinstr/.entry text sections because >>>>>>> __no_sanitize_cov is 'broken' in all known compilers. >>>>>> >>>>>> ^ Do you have more information on this? >>>>> >>>>> Random link in the middle of a relevant thread: >>>>> >>>>> https://lkml.kernel.org/r/CANpmjNPNa2f=kAF6c199oYVJ0iSyirQRGxeOBLxa9PmakSXRbA@mail.gmail.com >>>>> >>>>> Notable quote: >>>>> >>>>> "It's everywhere. We cannot mark noinstr functions to not be >>>>> instrumented by KCOV/-fsanitize-coverage, because no compiler provides >>>>> an attribute to do so. GCC doesn't have >>>>> __attribute__((no_sanitize_coverage)) and Clang doesn't have >>>>> __attribute__((no_sanitize("coverage")), and therefore we can't have >>>>> __no_sanitize_coverage." > [...] >>>> That *really* needs an attribute, and going forward we shouldn't accept >>>> new compiler instrumentation that we can't opt-out of like this. >>> >>> Strangely enough, in Clang, there's -fsanitize-coverage-blocklist, but >>> that's pretty useless for the kernel. Maintaining a list of functions >>> doesn't scale, and we just need an attribute. I'll ping a few of the >>> people who know Clang's fsanitize-coverage a bit better. >> >> Great, thanks! > > I did the simplest possible thing, so let's see if we can land this: > https://reviews.llvm.org/D102772 > >> I think that kernel-side we should have a policy going forward that for >> new instrumentation it must be possible to opt-out like this (and when >> support is added, `noinstr` gets upsated to opt-out). Correspondingly on >> the compiler-side, it'd be good if that was seen as a general >> requirement for new instrumentation. > > No argument with that! > > Thanks, > -- Marco >