From patchwork Fri Feb 16 18:38:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 128620 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp868255ljc; Fri, 16 Feb 2018 10:46:26 -0800 (PST) X-Google-Smtp-Source: AH8x224D8oyuOgZcehZcrbHZ/TKLbUo5yR+sYJbxrx6ameeJSg0+QFURqBKxbfpbnsn5rzGy2E/3 X-Received: by 2002:a17:902:6c41:: with SMTP id h1-v6mr6572029pln.25.1518806786027; Fri, 16 Feb 2018 10:46:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518806786; cv=none; d=google.com; s=arc-20160816; b=Z9s5E1MlBUPoJXPEeu9Nf2A9BhxbeS1znmpsBhy7qqyYRTkmeR33VKkgvusGb5lnvr 5p6RIRFiQoNucM1QG10vuKKxaihPtb9E5UEMwoNNGuaZdNBZ311b2zjL3sSgmS/rXgvk Kguunlg9IUFTzkXhix4aWceuJpWPW49j/6SOSifGrvhSvtkmDpCgz85KP2bQ6BIpRnR+ Wh0ivgHitgi6gWjuZdZyRWv1gk9Qavi69FDf8uyAV99NZW8bGFDATKsUK+Oh+csMGYgR KU4g2zifmnWDOvFZ9NzKWB+WrBRHo/2LtivTQ7758EJr+vHp/QD0d/3viLqLpOPrSQfR 5xZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=NNUronc0b0DxbhAtpAXfRP7LuUaytEfPMCerNrVvsRI=; b=TddiPralABl7H8dgN6c28Nl1svXXySzAuRANuJVEdCqyRzZUmQ/lE4lIWNWtBiWvUC wRyqgI4Gn54EsJK9WvwhddKkSTzuAQFhW6fiwNhAGISgYa5EwEtIy9R7MRwPtA/Q1xRC IJD0pYazNMZAQ3CwXS3pXqwav/sleRA3beufXlHrUZGQ7M6E/s3quHORq3S3NKkMBziN B7qyirISULhaZD9HFSN1g3nUhVit2+5QMcIJ3Dx/qDjw/kKKQ6SQK2NQ7w8HeFevHPIP sxJosDWiH3id8tKE+Iay4V/Url7ncyy2qjWnka+AyLqPZVTrkbeIbc4Qz+zn85aGa+ky hlNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=c1puTWxM; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 126si2374670pfd.48.2018.02.16.10.46.25; Fri, 16 Feb 2018 10:46:26 -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=@nifty.com header.s=dec2015msa header.b=c1puTWxM; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753568AbeBPSpP (ORCPT + 28 others); Fri, 16 Feb 2018 13:45:15 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:57779 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752696AbeBPSlT (ORCPT ); Fri, 16 Feb 2018 13:41:19 -0500 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-07.nifty.com with ESMTP id w1GIdBTM013418; Sat, 17 Feb 2018 03:39:30 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com w1GIdBTM013418 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1518806370; bh=NNUronc0b0DxbhAtpAXfRP7LuUaytEfPMCerNrVvsRI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c1puTWxMB8foCOL8AnvAnR43Xew+G3qCSfx3UlFvqoqGb9RTflHT4AB5+KHdhNxDv ShU0lwSrmFF951Zhcnz03u/0u2u9p8duLbCp9YPf7ZxycuCwEeHYyPlzbRP4Zvb2IN cjguVqLP2uZWO8tBn3lUwDiEbAoYvQ/xBBHeZKoYQIu4B+K8Vm0yYjfp+MqsSYJM1h Gj3zjy7n+wNASruivcmIMxqJTkeu/JqeT6Zcu2ZxJzjRb/QJ/BChlcQ94Vj82eyn/3 cJkAw0FzyW9JLfiF9e0x6DeIw/o4G8CNqxXpdgryrmDwpUteH/MhBlgNtj1QEccFTV kWW5oUATERAXw== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org, Linus Torvalds Cc: Greg Kroah-Hartman , Arnd Bergmann , Kees Cook , Randy Dunlap , Ulf Magnusson , Sam Ravnborg , Michal Marek , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 19/23] kcov: imply GCC_PLUGINS and GCC_PLUGIN_SANCOV instead of select'ing them Date: Sat, 17 Feb 2018 03:38:47 +0900 Message-Id: <1518806331-7101-20-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518806331-7101-1-git-send-email-yamada.masahiro@socionext.com> References: <1518806331-7101-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As Documentation/kbuild/kconfig-language.txt notes, 'select' should be used with care - it forces a lower limit of another symbol, ignoring the dependency. In this case, KCOV can select GCC_PLUGINS even if 'depends on HAVE_GCC_PLUGINS' is unmet. 'imply' is modest enough to observe the dependency, and this makes sense. If you enable KCOV, you will probably want to enable GCC_PLUGIN_SANCOV, but it should not break the dependency. I also remove unneeded code, I just happened to notice. Signed-off-by: Masahiro Yamada --- lib/Kconfig.debug | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- 2.7.4 diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 6088408..1216ce6 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -743,8 +743,8 @@ config KCOV bool "Code coverage for fuzzing" depends on ARCH_HAS_KCOV select DEBUG_FS - select GCC_PLUGINS if !COMPILE_TEST - select GCC_PLUGIN_SANCOV if !COMPILE_TEST + imply GCC_PLUGINS + imply GCC_PLUGIN_SANCOV help KCOV exposes kernel code coverage information in a form suitable for coverage-guided fuzzing (randomized testing). @@ -758,7 +758,6 @@ config KCOV config KCOV_ENABLE_COMPARISONS bool "Enable comparison operands collection by KCOV" depends on KCOV - default n help KCOV also exposes operands of every comparison in the instrumented code along with operand sizes and PCs of the comparison instructions. @@ -768,7 +767,7 @@ config KCOV_ENABLE_COMPARISONS config KCOV_INSTRUMENT_ALL bool "Instrument all code by default" depends on KCOV - default y if KCOV + default y help If you are doing generic system call fuzzing (like e.g. syzkaller), then you will want to instrument the whole kernel and you should