Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp952616ybc; Tue, 19 Nov 2019 11:58:17 -0800 (PST) X-Google-Smtp-Source: APXvYqxfLxLg1rFMGFwJtR8L3htZCssRKRmEe9g0Hb/RPtSZuhRHA8Dpv5rCtgyYqoS6CjxmEOhT X-Received: by 2002:a17:906:278a:: with SMTP id j10mr37523008ejc.125.1574193497749; Tue, 19 Nov 2019 11:58:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574193497; cv=none; d=google.com; s=arc-20160816; b=Z1tRyrQJULhQPvVT5ewNtSQH0wFb9P2mTFY/USr/Q/JkxZvJpvKNJ1Q+YWH72zo+8P brfOwJZPsV1s+NUfcAHycZT7e+9ES7bhs8Jio2zgKMdB2AfRvAIB/SamEPvydw/YH/M/ 4n5lk477A0u98f/h9h1vaR2uMjkQbvnnBbI3rxgDx7hQbMxSB7dI7ifdiSK62F0g+jwe Wl612Tu5xE1ZfyctL9nNnP54ecSM0asMwdEcAmDCDPRLdTBXWLmFzObWrekxjf7BQKCa 3FglG9Aw49s2PPdW30b8v8+pSMCAcjifZsRBT1Odz/HKAO6wqiYXsO7Tg72dWHTYEg8Q isRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=EhLUhFf+dWrZRS+as37pEKZIEswUZkBGb2xI++P3+j8=; b=l5FLfVgoLa1jDJ4NGR08hnDn4uWsun182418MVDBESwV5sGTw0+TAIuoECRwFCGM27 jN3YxMSTuZTJn5gfF5KufNQCh5rtlhorIlvqTMl487JChIOchGSROB14kqE+XSe4ui/C nwsNrggsJUFChdHZyFimoyV/9zbOezX+hDiX0EIYrhESH/P1GO3+HLcC8rVF0ICyvKMw y0Ul83QwWCVQgHX4dF0T0USQwiqT/oGuHVbgSzqo68ueFLJRh9DhjIzSlvqTGRaikxqH A5K8A11uvO8rtHSEBxmaiP3zqyS2gLkaqhBhiu/zlyyEmQTL7vtl0N7O7OfW+94znXV8 Eqaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=oURkgRgG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id a25si14725368ejb.285.2019.11.19.11.57.51; Tue, 19 Nov 2019 11:58:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=oURkgRgG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727262AbfKSTy1 (ORCPT + 99 others); Tue, 19 Nov 2019 14:54:27 -0500 Received: from mail-ot1-f65.google.com ([209.85.210.65]:39627 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726892AbfKSTy1 (ORCPT ); Tue, 19 Nov 2019 14:54:27 -0500 Received: by mail-ot1-f65.google.com with SMTP id w24so18570598otk.6 for ; Tue, 19 Nov 2019 11:54:26 -0800 (PST) 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:content-transfer-encoding; bh=EhLUhFf+dWrZRS+as37pEKZIEswUZkBGb2xI++P3+j8=; b=oURkgRgGWUkSxDSZ1GZcf9JKZThTVFiPnKTPYV6+NAQo4qwintbC2XWKkuqirZuVFU bTYZKRscOUCeu16ZKaeZ3gXmUectwJqraAkzc8IBVgzlI8PbblowyxH6P3Ln12UZk9iO Pl0kfXxMBXKjXj6d8JggILhmHIA8f4ZCcFz6nGlkz7lVmiWjRLK+0aGRrkffeyuCuNkI 0zslGM9F/hSRR4n8JF2dvLzZiZ64O/OcPnSgVvg+FuFKwOq/W9YtVItB909hWO3GwyqT +0ZUwJKbggzqgLthIVoIszbE1Prv8ek/hgwno+wjPrrY7IKe9Gu3nZy0IvutjK5EGayQ o9iA== 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:content-transfer-encoding; bh=EhLUhFf+dWrZRS+as37pEKZIEswUZkBGb2xI++P3+j8=; b=ao7IzcCYn+BLe82gv3gtDL/3O8S62YhtFgQ9AWSB+Puh859cxqYFTJG7PJz9dVgtbe WvUjsDv+1Wc5jdtzx4X6+wkjfgDEsPUpcfMtH+cVA6+XbYma715ipmRf9fQDKZBmxPVn kgFw9H1HenNt8ROo0nivLuIR2BIyko3MAfwybKbbWTBPViOze99HkkmfzSklSL3B5l/F WgHg27Zty4I1+QD8Id0YUpzcScxmEn11zDpPFICG+Dd4S1z4UZiSt7LBuL4UvwQsVhtY xBQpLnHvdjEwZ8yJ2mLRpHrlfSTu61ImcYzxh4mOh9d4l2QhetWpDoMo1AaXepi6H7WN DiVg== X-Gm-Message-State: APjAAAUZjIhJ0QhgXns9rukcZjwqLxjw98h5h2Pw/wnyVPg7H6Jq90Ni B1cR/lSmDsi73FOJdC3mpTGkrQXACu9tHa4poN3fkQ== X-Received: by 2002:a05:6830:2308:: with SMTP id u8mr5018538ote.2.1574193265740; Tue, 19 Nov 2019 11:54:25 -0800 (PST) MIME-Version: 1.0 References: <20191114180303.66955-1-elver@google.com> <20191114180303.66955-2-elver@google.com> <1574191653.9585.6.camel@lca.pw> In-Reply-To: <1574191653.9585.6.camel@lca.pw> From: Marco Elver Date: Tue, 19 Nov 2019 20:54:14 +0100 Message-ID: Subject: Re: [PATCH v4 01/10] kcsan: Add Kernel Concurrency Sanitizer infrastructure To: Qian Cai Cc: LKMM Maintainers -- Akira Yokosawa , Alan Stern , Alexander Potapenko , Andrea Parri , Andrey Konovalov , Andy Lutomirski , Ard Biesheuvel , Arnd Bergmann , Boqun Feng , Borislav Petkov , Daniel Axtens , Daniel Lustig , Dave Hansen , David Howells , Dmitry Vyukov , "H. Peter Anvin" , Ingo Molnar , Jade Alglave , Joel Fernandes , Jonathan Corbet , Josh Poimboeuf , Luc Maranget , Mark Rutland , Nicholas Piggin , "Paul E. McKenney" , Peter Zijlstra , Thomas Gleixner , Will Deacon , Eric Dumazet , kasan-dev , linux-arch , "open list:DOCUMENTATION" , linux-efi@vger.kernel.org, Linux Kbuild mailing list , LKML , Linux Memory Management List , "the arch/x86 maintainers" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 19 Nov 2019 at 20:27, Qian Cai wrote: > > On Thu, 2019-11-14 at 19:02 +0100, 'Marco Elver' via kasan-dev wrote: > > > +menuconfig KCSAN > > + bool "KCSAN: watchpoint-based dynamic data race detector" > > + depends on HAVE_ARCH_KCSAN && !KASAN && STACKTRACE > > "!KASAN" makes me sorrow. What's problem of those two? Both of them instrument memory accesses, and gcc doesn't let us combine '-fsanitize=3D{kernel-,}address' and '-fsanitize=3Dthread'. > cc1: error: =E2=80=98-fsanitize=3Daddress=E2=80=99 and =E2=80=98-fsanitiz= e=3Dkernel-address=E2=80=99 are incompatible with =E2=80=98-fsanitize=3Dthr= ead=E2=80=99 In principle, it may be possible: - either by updating the compiler, which we want to avoid because we'd have to convince gcc and clang to do this; I can see this being infeasible because the compiler needs to become aware (somehow propagate in the IR) of what is ASAN inline-instrumentation and what is TSAN instrumentation and not emit recursive instrumentation. - or somehow merging the instrumentation, but, IMHO this is probably a really bad idea for various other reasons (complexity, performance, stability, etc.). Regardless of approach, my guess is that the complexity outweighs any benefits this may provide in the end. Not only would a hypothetical kernel that combines these be extremely slow, it'd also diminish the practical value because testing and finding bugs would also be impaired due to performance. Thanks, -- Marco