From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753071AbcANMuD (ORCPT ); Thu, 14 Jan 2016 07:50:03 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35065 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751870AbcANMuA (ORCPT ); Thu, 14 Jan 2016 07:50:00 -0500 Date: Thu, 14 Jan 2016 14:49:57 +0200 From: "Kirill A. Shutemov" To: Dmitry Vyukov Cc: Andrew Morton , David Drysdale , Kees Cook , Quentin Casasnovas , Sasha Levin , Vegard Nossum , LKML , Eric Dumazet , Tavis Ormandy , Bjorn Helgaas , syzkaller , Kostya Serebryany , Alexander Potapenko , Andrey Ryabinin Subject: Re: [PATCH v2] kernel: add kcov code coverage Message-ID: <20160114124957.GB28386@node.shutemov.name> References: <1452689318-107172-1-git-send-email-dvyukov@google.com> <20160114090302.GA27083@node.shutemov.name> <20160114092320.GB27083@node.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 14, 2016 at 01:21:27PM +0100, Dmitry Vyukov wrote: > >> Alternatively, you can try to bulk disable instrumentation of > >> everything related to boot process (by adding KCOV_INSTRUMENT := n to > >> the Makefile). Most likely it is due to instrumentation. If it helps, > >> try to bisect the the guilty files. > > > > Okay, I'll try. > > > I've tried with exactly your gcc revision and your config and VM boots fine... > > For me it prints 4 CPUs: > [ 0.193348] smpboot: Total of 4 processors activated > so it is probably fine :) > > I am almost sure that the root cause is kcov instrumentation is some > inappropriate place. I've fixed such symptoms several times by > disabling instrumentation in various places. Okay, I found it. The patch below helps. But I wounder how safe this thing is. :-/ Looks like -fsanitize-coverage=trace-pc doesn't play well when we change calling convention for the compilation unit, as we do for hweight.o. See CONFIG_ARCH_HWEIGHT_CFLAGS. What else should we expect from GCC in this mode? diff --git a/lib/Makefile b/lib/Makefile index 58043870dbd2..56171482f99f 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -15,6 +15,7 @@ KCOV_INSTRUMENT_rbtree.o := n KCOV_INSTRUMENT_list_debug.o := n KCOV_INSTRUMENT_debugobjects.o := n KCOV_INSTRUMENT_dynamic_debug.o := n +KCOV_INSTRUMENT_hweight.o := n lib-y := ctype.o string.o vsprintf.o cmdline.o \ rbtree.o radix-tree.o dump_stack.o timerqueue.o\ -- Kirill A. Shutemov