Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1076887ybl; Thu, 12 Dec 2019 09:16:33 -0800 (PST) X-Google-Smtp-Source: APXvYqwHRDdcg17SxwFd88ABb0RAMtNzQGAjV3a4KdHG6n7lVrge4PRaD0Odw+uK/CPi5oWfW3pM X-Received: by 2002:a05:6808:1c6:: with SMTP id x6mr5737993oic.49.1576170993180; Thu, 12 Dec 2019 09:16:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576170993; cv=none; d=google.com; s=arc-20160816; b=bKP1gLYT3YIUJMKYbBcRbCP59uxxV1PH9Ut19vRO74jqBziZUNA7CJNNVcDNhMvyVQ CZ81uq752cnyOQ+bEffaDvBDX5VgEAXfxscfdTo2FpH1CEfv86DNz9zmnhwtZsr1Fi9t 3YV6jxV0Ps5pQbjmlx8tX8fyM0XWmrOAs4sgG99vYeW+Bj9VrU1siWf6mk28NSFItS5j EQN1qTs5ZgufoLQidrQw5zUwb7glOx0m8Ub8dg6gyDLF2+BbpqLFfGOh+q+CT3Dd5JSF qAnWaDYPSexILIe/Ubb2j/SzU6PVf3lgDc/OAnI8JElvXMOb8jMdrTVN7yndDJtj3PdG Azug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=v2c9ZfhsjHl5yHeRsOkptCzwopqKyi8H+GjnL6ViNEI=; b=0p/eya7c8jV1WJOFpbd24srA45cxv/YRQNzvBsZIJy48Fnzd35AqKfaNMRxxTaB9O5 nHFpXOue9GQtdYT1FfPJcX3WNKV/NnUHMRfw7Nfir5GQzCcLevhnMexQxTty9e8Eg9J2 vqZMd91DAn239HJbvV1k6WDaBmOIHHXF4rFsx7AXLWdKKqVrk6c2STEVjDxx5rYjmrQo HPd70mKJ6moDIMjm2dwBTUrrIombrifGGoSzQ9Qj9+nOd+xNiDPICf0Md0H1BYjsTx8K ERs36bbr8+/tpO7AVfrHGa1em/aNNeKLnf0oty0VeAUdAii3JHw04jD4t8VRoLzlqGmB dxyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=vrj3NH1S; 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 v1si3410327otq.141.2019.12.12.09.16.17; Thu, 12 Dec 2019 09:16:33 -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=vrj3NH1S; 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 S1730123AbfLLRPs (ORCPT + 99 others); Thu, 12 Dec 2019 12:15:48 -0500 Received: from mail-qk1-f202.google.com ([209.85.222.202]:45343 "EHLO mail-qk1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730019AbfLLRPs (ORCPT ); Thu, 12 Dec 2019 12:15:48 -0500 Received: by mail-qk1-f202.google.com with SMTP id 143so1811491qkg.12 for ; Thu, 12 Dec 2019 09:15:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=v2c9ZfhsjHl5yHeRsOkptCzwopqKyi8H+GjnL6ViNEI=; b=vrj3NH1ShlxM4YyYe0HqMM/dwIJ/fbhT+APeMTYtYoOG+CRXgaspmBasE4ErJdIIKi jKDBAG0QKul7viwQpYW6XAA0Zjs/OwBkQtBf1K05wZYbMMI0opQwGyzT+YsfLr3OMqla lDjR73vpeODB04Fr5k9u1dyE32YCXQ30LDRoDe1gHq4pwTdmfL8rUSdCJbvdFP3l45dg SR5r6aA/6DzNNbzAod12aErBMfwYaNEoTYiQcLyDBmiLButXvXObMUCU5tGqskbDvrJ2 qfdxvJXSBSxcvZeWKiOarc8KAVx2GSe2x7sH+SPYxcSWpwQcQCSL3928o15KVRmxBP0Q KJDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=v2c9ZfhsjHl5yHeRsOkptCzwopqKyi8H+GjnL6ViNEI=; b=EXWdK/OMc03htZm7sPwnZXwqeqUkFRdBhRj0FdZFU76urb7B9F85ew6hT+k1DHBKNZ t0cyPb64U7gGLxm0UCzJHBoGWQhHvb1TNsQoinRK+voyEll8n1/obJ4dbQUMtYOuxOVS 7LX1UHy4zrITjPgoMU+2UYnKxRDf9XZ6+d2+e0tiWdXEC2o5RPLmgsKNSLCEb/mjGRnq pqREMEVKqK+OEdj7deRstXIePaqtiHELijf4oVo6r8mbQcrSBYEfuZf7FTbytkh+VHx+ xMafxzO/8LvOm4kCpgsnfJgHmCAQ4ho5TH8Tb3D4qCXS9yYcZcxvxUr91t762GbVGe0R QABw== X-Gm-Message-State: APjAAAWwZSuMDHfnFfSvPnOc0wKxhem9Rcb1kwX42tVMwzolJdb+9OcT +QA4m6dfGoGVgMgtvwleLsg5xWHEvnmNxH6J X-Received: by 2002:ac8:6f2d:: with SMTP id i13mr4821925qtv.133.1576170946867; Thu, 12 Dec 2019 09:15:46 -0800 (PST) Date: Thu, 12 Dec 2019 18:15:37 +0100 Message-Id: Mime-Version: 1.0 X-Mailer: git-send-email 2.24.1.735.g03f4e72817-goog Subject: [PATCH RFC 0/2] kcov: collect coverage from usbhid interrupts From: Andrey Konovalov To: Dmitry Vyukov , Greg Kroah-Hartman , Alan Stern , Jiri Kosina , Benjamin Tissoires Cc: Andrew Morton , linux-usb@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Alexander Potapenko , Marco Elver , Andrey Konovalov Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset extends kcov to allow collecting coverage from interrupts and then uses the new functionality to collect coverage from usbhid code. What I'm not sure yet about this change is if we actually want to selectively annotate some parts of the USB stack that are executed in interrupt context, or maybe we can do this with some common approach. For example patch #2 in this patchset annotates all functions that are passed as completion callbacks to usb_fill_*() in drivers/hid/usbhid. Maybe instead we could redefine usb_fill_*() in a way that would handle all such cases without manual annotations. Any suggestions are welcome. This has allowed to find at least one new HID bug [1], which was recently fixed by Alan [2]. [1] https://syzkaller.appspot.com/bug?extid=09ef48aa58261464b621 [2] https://patchwork.kernel.org/patch/11283319/ This patchset has been pushed to the public Linux kernel Gerrit instance: https://linux-review.googlesource.com/c/linux/kernel/git/torvalds/linux/+/2225 Signed-off-by: Andrey Konovalov Andrey Konovalov (2): kcov: collect coverage from interrupts HID: usbhid: kcov: add annotations for coverage collection Documentation/dev-tools/kcov.rst | 16 +-- drivers/hid/usbhid/hid-core.c | 25 +++- drivers/hid/usbhid/usbkbd.c | 15 ++- drivers/hid/usbhid/usbmouse.c | 7 +- drivers/usb/gadget/udc/dummy_hcd.c | 1 + include/linux/sched.h | 3 + kernel/kcov.c | 196 +++++++++++++++++++---------- lib/Kconfig.debug | 9 ++ 8 files changed, 192 insertions(+), 80 deletions(-) -- 2.24.1.735.g03f4e72817-goog