From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753389AbcANMgD (ORCPT ); Thu, 14 Jan 2016 07:36:03 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35859 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752407AbcANMf7 (ORCPT ); Thu, 14 Jan 2016 07:35:59 -0500 Date: Thu, 14 Jan 2016 14:35:56 +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: <20160114123556.GA28386@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: > On Thu, Jan 14, 2016 at 10:23 AM, Kirill A. Shutemov > wrote: > > On Thu, Jan 14, 2016 at 10:10:39AM +0100, Dmitry Vyukov wrote: > >> On Thu, Jan 14, 2016 at 10:03 AM, Kirill A. Shutemov > >> wrote: > >> > Hi, > >> > > >> > I've tried to build current -next with the patch. It has few reject, but > >> > nothing major. > >> > > >> > Booting the kernel in qemu with CONFIG_KCOV=y has failed. It hangs on > >> > "smpboot: Total of 3 processors activated (9178.27 BogoMIPS)" > >> > > >> > The interesting part is that I have only 2 cpu in this setup! > >> > > >> > Huh? > >> > > >> > CONFIG_KCOV=n works fine. > >> > >> > >> Hi Kirill, > >> > >> Thanks for testing. > >> > >> I will try to reproduce this if you provide: > >> - location of the -next tree > > > > The usual one: > > > > git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git next-20160114 > > > >> - gcc revision > > > > Current gcc-snapshot from Debian: > > > > gcc version 6.0.0 20160105 (experimental) [trunk revision 232093] (Debian 20160105-1) > > > >> - .config > > > > Attached. > > > >> - qemu command line > > > > Nothing fancy: > > > > qemu-system-x86_64 -smp 2 -m 2048 -nographic -kernel bzImage -append "console=ttyS0 earlyprintk=serial" > > > >> 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. > > I've ported this patch to an older 3.13 kernel and I had to disabl all > instrumentation in the following files (with KCOV_INSTRUMENT := n): > > arch/x86/kernel/cpu/Makefile > arch/x86/pci/Makefile > arch/x86/platform/Makefile > arch/x86/platform/**/Makefile > arch/x86/power/Makefile > arch/x86/realmode/Makefile > arch/x86/um/Makefile > > Try these first. I found that disabling instrumentation for whole lib/ helps, but I wasn't able to identify specific object files. I've tried these: KCOV_INSTRUMENT_cpumask.o := n KCOV_INSTRUMENT_smp_processor_id.o := n KCOV_INSTRUMENT_bitmap.o := n KCOV_INSTRUMENT_find_bit.o := n No luck. -- Kirill A. Shutemov