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=-13.2 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL 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 B3CB3C433B4 for ; Wed, 19 May 2021 14:04:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 874136108D for ; Wed, 19 May 2021 14:04:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242073AbhESOFt (ORCPT ); Wed, 19 May 2021 10:05:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240179AbhESOFt (ORCPT ); Wed, 19 May 2021 10:05:49 -0400 Received: from mail-oo1-xc32.google.com (mail-oo1-xc32.google.com [IPv6:2607:f8b0:4864:20::c32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 871B7C06175F for ; Wed, 19 May 2021 07:04:28 -0700 (PDT) Received: by mail-oo1-xc32.google.com with SMTP id t22-20020a4ad0b60000b029020fe239e804so221347oor.4 for ; Wed, 19 May 2021 07:04:28 -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=aZwzY8yn5ciH+fff8OrjN0rTTTNPAkQFORYbVHRTXHE=; b=blrvImaR6Vjcyecy9e6dirJwq+GiUcyjLiDq1gBN/1AHnR9he8biMAy8CVTnOASPKF 8Vw3Dd2f+lLm4DllYGvvppoXM10HsARYvafMyrl1eHTh2hSHkibBJ8v0C+N3Fz5prbQL U3N8sAxNrc+sktawVNJJ4MRq8SD4ZuofL0BVjoz1YiuhbF4MUzlG1kHchfKwi0n2CWb3 HDTDte0+wCqyhVHRHTUpIW5dC4wgc29voYhaPqg9PCJ+o4Bya6U5EeIqF45ysobVtyVa a0ioDGxdVUDZ0Zw/d9YGgBXK1WK66t6peXTQLNpj7eEarZBDLxloEKgZK+dyuORz93ZE MM/g== 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=aZwzY8yn5ciH+fff8OrjN0rTTTNPAkQFORYbVHRTXHE=; b=Tn6z4lP2+l9K8+JkgIwlMIqJ4EKbPCxPVKVJUGSZiSHMzTfsaM0Y1gpiYYUXTD0gB/ ZW02q22pfy6dANcRENiQZiC/9HBasMBTxUdsKXX9yHc8zfXnoW5XF3OsRk6fz6WGnu10 bNeMi5rLAq5oKEGnlHbdr+aVpln8cap8btnPjXqviH+twi4kNmNKi9AEQJUspE5Tj4tv F7DZo/yiG78eWEFj3qXIQlDjUxuhCWhjWw3TIkbceOZBVSZA4qUhre4sRGWxtCgpZ7j1 U7/pe25B0bOy1M9uG47pZOMv0Xc6JjaKhg8w+dlVaWiw8Ww6eZQObzMocSwUzjRnn6wB 7o3A== X-Gm-Message-State: AOAM5310DXJcYPpdzAnCgaXlIwnPPa8V22Jc7R8WXHUytfOx26rQMjFJ qKX240yq4I6FPXyJ/bmwUiZFLVad0NRmezp25HQ8LA== X-Google-Smtp-Source: ABdhPJyYGeUFneDl05PlOSQSx00QMil4yppeCvaah+MgvzFWoSUKZUOfnQjZODDx8ctUUI41LucvBgPcbTxMRHCUMlg= X-Received: by 2002:a4a:6202:: with SMTP id x2mr9250166ooc.36.1621433067613; Wed, 19 May 2021 07:04:27 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <20210519115654.GC2797@C02TD0UTHF1T.local> From: Marco Elver Date: Wed, 19 May 2021 16:04:15 +0200 Message-ID: Subject: Re: Linux Plumbers Conf 2021 To: Mark Rutland , =?UTF-8?Q?Martin_Li=C5=A1ka?= Cc: Peter Zijlstra , Nick Desaulniers , Josh Poimboeuf , Will Deacon , "Jose E. Marchesi" , "Paul E. McKenney" , Ard Biesheuvel , Catalin Marinas , linux-toolchains@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-toolchains@vger.kernel.org +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. 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