Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp2970563pxb; Mon, 6 Sep 2021 09:16:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAZNU97UXxnCa+WL3gO5b9DVevlek9+OVOcVBvu0Qypdr8MGZMHsSpDnr8j4sPAlxRyyTd X-Received: by 2002:aa7:dd57:: with SMTP id o23mr14119042edw.385.1630945018767; Mon, 06 Sep 2021 09:16:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630945018; cv=none; d=google.com; s=arc-20160816; b=wbOg7ZFXqOaFza2/iK8DbulfgI4AlPjn4CSX/CCv+37VjQ2K3evCHXFyFwMH4/16PC WV2OLM7yrC0cYBvdApbR0Lvr478GP39T1KK2ZZVzxH7+bwz2OhjchSnnL5wtDLgO5kXm wHjQGiSu4UlLkdJvkiB336owvx6rHpvUgYdqh4Km0t7OePqtZQPRX6PqK/jpoz+0ifZt 9L/9NdRsdOoIx/pB79c5kBEXnd9w3D4sLgnBDAq1o1LXg7WIRYYMqXmAOnBh+aeVovIJ czYn4I0zfcNgVUw0ycB10WUt3KINfDTNSlrWy9LNvCjod3LUNQy9YYJkFdHGJtBhGh89 ZbVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=sSHWLdRniClMLbNX/vMWN1xbfEPKJ8OMc5qP3DmQu0A=; b=yGwVtdmcoKIGZ4Rh5Mu5rrdefq0KNSaz/5UkKY/Gaj4lP2IJI16EHGJKVAjsLExM7f 4Ne3bQUVdOXjN/eZlWIxLUkDH6f30DkNNqpzH+eba6FAl191MCIE7gS7JNylN9FUPgB9 wvqm1+fBv/KawLkWHpueAVbSiUYMoXfBenu20ZLdXiCL0qH3SzJVsoMkMtkmZngCUPal d1CczEkpOT8yBAUeAhI9oSnYd9zuboxsFGX8iRjBBc7+b08O5oTSU8DMIOCpYBYuGNGR 86VZMAICc39gzm/lLGzawAN+VFr+UFas9TqvpuEHXV9MQFDR+/66caVKIe8uXQTT4J0u 3Qhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=IxYvyvZz; 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 e10si8821720edz.580.2021.09.06.09.16.34; Mon, 06 Sep 2021 09:16:58 -0700 (PDT) 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=20210112 header.b=IxYvyvZz; 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 S243510AbhIFQO3 (ORCPT + 99 others); Mon, 6 Sep 2021 12:14:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234132AbhIFQO2 (ORCPT ); Mon, 6 Sep 2021 12:14:28 -0400 Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A878DC061575 for ; Mon, 6 Sep 2021 09:13:23 -0700 (PDT) Received: by mail-oi1-x232.google.com with SMTP id v2so9365383oie.6 for ; Mon, 06 Sep 2021 09:13:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=sSHWLdRniClMLbNX/vMWN1xbfEPKJ8OMc5qP3DmQu0A=; b=IxYvyvZzricv+JQAlndessS8MQviEWJRmtsZpVl63E1YrMf+RcCzdvsT1+QVskKZOH Vem7F8yfI9FU2jGcEK12Mz+yuCui2fTbo041O1chTetSesNYOyRBLhh+dTtMd0Ebchtw Iz+5pS+byB+JbwjwD3AzC38hfkKvCMIQSaTYt5ZugaJ3DSOtz6yn6XdkqXHVqmif9ugW a2192wEDiY7rpzyfQ2ppI/kmeAfjbGDLQYCQOECAUmaCvkxAvUPrgoV5Nvo9Pt59cxU8 wQ07aucV39UJeop9dTDvnIMJrh8aF4TVwlBtSg84eijSKM1I05+kiQYDu95uFLc9pvSI j7lQ== 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=sSHWLdRniClMLbNX/vMWN1xbfEPKJ8OMc5qP3DmQu0A=; b=a9HPy99tqWwPQ9VyK6f7ybSCqx9WvTtt0GN21GhMcONoDzMmS5pDhSN4YE+uM1/82A NzSJ6PQQQM4XgxRrrEFEELDtbtvhca2zeF2m0r+rGYgd3UkrNHiNSvhLPu8Ldlh1b+xL 0GaDY6jl7X7OupHiRQcmfXYueRp65FPHC/0S/fbqEfrGgqrjD11ytTaAP6+/Y4OObfuv i/fo0Op2ZeWmMpoBqzECYfPXiX9sHq4J+abaP9JGPFn/9AgVycQboteWAo18BXTSQ21I RxXyAhBngoh/AcgTMyR96okJr+c869rFqPvObKBVGRpQxXAAXXSihU+TFqF8A9pBYHby 6V+Q== X-Gm-Message-State: AOAM531SKQDkUpQd0JsMC9jW8TynublyHlsm44bKL3uknM2E9cXHkrxh aoTfbUCoBv+pokSVqdmMh+wND0pWJ0cHCwmglpwQSXV1nI4zZw== X-Received: by 2002:aca:4344:: with SMTP id q65mr9355069oia.70.1630944802829; Mon, 06 Sep 2021 09:13:22 -0700 (PDT) MIME-Version: 1.0 References: <20210830172627.267989-1-bigeasy@linutronix.de> In-Reply-To: <20210830172627.267989-1-bigeasy@linutronix.de> From: Marco Elver Date: Mon, 6 Sep 2021 18:13:11 +0200 Message-ID: Subject: Re: [PATCH 0/5] kcov: PREEMPT_RT fixup + misc To: Sebastian Andrzej Siewior Cc: kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, Dmitry Vyukov , Andrey Konovalov , Thomas Gleixner , Steven Rostedt , Clark Williams , Andrew Morton Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 30 Aug 2021 at 19:26, Sebastian Andrzej Siewior wrote: > The last patch in series is follow-up to address the PREEMPT_RT issue > within in kcov reported by Clark [0]. > Patches 1-3 are smaller things that I noticed while staring at it. > Patch 4 is small change which makes replacement in #5 simpler / more > obvious. > I tested this with the three examples in the documentation folder and I > didn't notice higher latency with kcov enabled. Debug or not, I don't > see a reason to make the lock a raw_spin_lock_t annd it would complicate > memory allocation as mentioned in #5. Thanks for sorting this out. Given syzkaller is exercising all of KCOV's feature, I let syzkaller run for a few hours with PROVE_LOCKING (and PROVE_RAW_LOCK_NESTING) on, and looks fine: Acked-by: Marco Elver Tested-by: Marco Elver > One thing I noticed and have no idea if this is right or not: > The code seems to mix long and uint64_t for the reported instruction > pointer / position in the buffer. For instance > __sanitizer_cov_trace_pc() refers to a 64bit pointer (in the comment) > while the area pointer itself is (long *). The problematic part is that > a 32bit application on a 64bit pointer will expect a four byte pointer > while kernel uses an eight byte pointer. I think the code is consistent in using 'unsigned long' for writing regular pos/IP (except write_comp_data(), which has a comment about it). The mentions of 64-bit in comments might be inaccurate though. But I think it's working as expected: - on 64-bit kernels, pos/IP can be up to 64-bit; - on 32-bit kernels, pos/IP can only be up to 32-bit. User space necessarily has to know about the bit-ness of its kernel, because the coverage information is entirely dependent on the kernel image. I think the examples in documentation weren't exhaustive in this regard. At least that's my take -- Dmitry or Andrey would know for sure (Dmitry is currently on vacation, but hopefully can clarify next week). Thanks, -- Marco