Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1112413pxk; Thu, 10 Sep 2020 07:23:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMoILbIjQRZfFKoZ9+gRalqfMjEmW2hkzktnIEjId5RHSJooRA5sKRpn1ygWbL++Eg1C8c X-Received: by 2002:a05:6402:1694:: with SMTP id a20mr9333804edv.286.1599747784446; Thu, 10 Sep 2020 07:23:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599747784; cv=none; d=google.com; s=arc-20160816; b=zz1dSUsIW3e7BJ5C+oQrz/4Urg1/hxahvLbRM81k22lT/7BW5YePuD6tCZ2hYPuiYq Oiisqq9XiTQW9cWb9CGlqOpx0UsjIvL/VGPLlIXjs0TdKYHm28QjsANJ0QNQ/9ZqOKjr uAoOB2dDBNbxkkA4qIjJ7Zenco6Rfmq/a/N0DhJ551Oe2dlk5ZxOK2OMKLJLc6HBjhuu RSOSL7gNHbCZteIavpbColAnbsYDvhRXbpqUsQag5o+khQCqQLQIUoyPMuBc+E4bnxAQ fR/Ow5Vlr9DHhGMVJBq45hZHg4WjEGbUTcCcBPFLGEAwxB8h4kqVuuICjsh131NLv/+f 7SMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=PBa8A2r3dyAEq2RBU4h3Tr11KDD1snj1ndwK5iw7Kog=; b=iVudn9OZybEFXW2C+j6kjnA2mJti1OmKOF2qiqiu5VgEJdUjx458A/aFtl5t7oOw7t MMLoqzvFd50BcwTfGgUsnurf7jIx1GB5H2g+aOk6twEzlqeSi1N1nvKYtqnkpvwrtRkj 0nrFMlk952ojjVyYg9v3iR2kVZgbMW00bN/CxdryU9GrL6IN8QIa2Xnnyu0Uzthc5pgQ M7EfaJKFOzXEQmXNtu1RhGaqOVf9hCNCAAHNjqlVC11rytSG1hFzocXu2DKH1Qtz2xTG wpo0B/8BkOVbEe/DsfShF1Y1obvdbRePLEJvUus051ud5gTsnjWdhIbwhP6eZyWqDNDP kWUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bFaQIQNd; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nr20si3559893ejb.483.2020.09.10.07.22.39; Thu, 10 Sep 2020 07:23:04 -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=@kernel.org header.s=default header.b=bFaQIQNd; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730260AbgIJOSu (ORCPT + 99 others); Thu, 10 Sep 2020 10:18:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:42950 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731114AbgIJOKb (ORCPT ); Thu, 10 Sep 2020 10:10:31 -0400 Received: from localhost (unknown [213.57.247.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7E99121D79; Thu, 10 Sep 2020 13:44:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599745479; bh=2rpnh2RBD5R8RyuJb8iyA1MzLro0dvc3KgNjFzIDVuE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bFaQIQNda2L/zgJFisbB6HcjzJzEwgktRzodCLDh5GSC2QkY63lALnClSCNIfic78 i9E4FbbSJu2aO8gccL/lgqJaVZrlPVgFwRVvIs5cwAiu9h/Gjc66jHBx3d6Ka4ayE8 u5PlTvF3xUplHGXeFQ5FPcP6mYpaS7ctOEayPkFw= Date: Thu, 10 Sep 2020 16:44:35 +0300 From: Leon Romanovsky To: Peter Oberparleiter Cc: Linus Torvalds , Linux Kernel Mailing List , Colin Ian King , Andrew Morton Subject: Re: [PATCH -rc v1] gcov: Disable gcov build with GCC 10 Message-ID: <20200910134435.GK421756@unreal> References: <20200904155808.4997-1-leon@kernel.org> <6fac3754-f8db-85f5-bdb1-b4c8e7ccc046@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6fac3754-f8db-85f5-bdb1-b4c8e7ccc046@linux.ibm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 10, 2020 at 02:52:01PM +0200, Peter Oberparleiter wrote: > On 04.09.2020 17:58, Leon Romanovsky wrote: > > GCOV built with GCC 10 doesn't initialize n_function variable. > > This produces different kernel panics as was seen by Colin in > > Ubuntu [1] and me in FC 32 [2]. > > > > As a workaround, let's disable GCOV build for broken GCC 10 version. > > > > [1] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1891288 > > [2] https://lore.kernel.org/lkml/20200827133932.3338519-1-leon@kernel.org > > Cc: Colin Ian King > > Signed-off-by: Leon Romanovsky > > The following patch should fix the problem with gcov and GCC 10. > I successfully tested it with kernel 5.9-rc4 on s390 using GCC 10.1.1 > and also with GCC 9.1.1 to see that it didn't break support for previous > GCC versions. In both cases there were no kernel panics and gcov worked > fine. > > Could you try this patch to see if it also fixes the problem in your > environment? It worked for me, Thanks Tested-by: Leon Romanovsky > > ---8<--- > From: Peter Oberparleiter > Subject: [PATCH] gcov: add support for GCC 10.1 > > Using gcov to collect coverage data for kernels compiled with GCC 10.1 > causes random malfunctions and kernel crashes. This is the result of a > changed GCOV_COUNTERS value in GCC 10.1 that causes a mismatch between > the layout of the gcov_info structure created by GCC profiling code and > the related structure used by the kernel. > > Fix this by updating the in-kernel GCOV_COUNTERS value. Also re-enable > config GCOV_KERNEL for use with GCC 10. > > Reported-by: Colin Ian King > Reported-by: Leon Romanovsky > Signed-off-by: Peter Oberparleiter > --- > kernel/gcov/Kconfig | 1 - > kernel/gcov/gcc_4_7.c | 4 +++- > 2 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/kernel/gcov/Kconfig b/kernel/gcov/Kconfig > index bb4b680e8455..3110c77230c7 100644 > --- a/kernel/gcov/Kconfig > +++ b/kernel/gcov/Kconfig > @@ -4,7 +4,6 @@ menu "GCOV-based kernel profiling" > config GCOV_KERNEL > bool "Enable gcov-based kernel profiling" > depends on DEBUG_FS > - depends on !CC_IS_GCC || GCC_VERSION < 100000 > select CONSTRUCTORS if !UML > default n > help > diff --git a/kernel/gcov/gcc_4_7.c b/kernel/gcov/gcc_4_7.c > index 908fdf5098c3..53c67c87f141 100644 > --- a/kernel/gcov/gcc_4_7.c > +++ b/kernel/gcov/gcc_4_7.c > @@ -19,7 +19,9 @@ > #include > #include "gcov.h" > > -#if (__GNUC__ >= 7) > +#if (__GNUC__ >= 10) > +#define GCOV_COUNTERS 8 > +#elif (__GNUC__ >= 7) > #define GCOV_COUNTERS 9 > #elif (__GNUC__ > 5) || (__GNUC__ == 5 && __GNUC_MINOR__ >= 1) > #define GCOV_COUNTERS 10 > -- > 2.21.0 >