Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3286037pxk; Mon, 21 Sep 2020 09:42:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwuhwf+Ero+Y3UwuBiqFnAUQLj6MBJW+ERcIQmxf2igLwqFWCZk/kQqLeLtKkYZm+5ce6Zf X-Received: by 2002:a50:dec9:: with SMTP id d9mr523649edl.145.1600706560544; Mon, 21 Sep 2020 09:42:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600706560; cv=none; d=google.com; s=arc-20160816; b=NWgHmlYWLBytk4QHOAMdx5FPBCutetAtRVqsvToh/ddlDcjQZF6o5FeSF8admV5ZKW eSniMUiITyyfXavrTNbXSyb8vAG5j3+Gg4LDe9gGFuintyvtJSxw5ei7jyp2z9uzoql3 cm3y/xILQMXoRMTt44FpzaOdMhI/T/MiQgr0aFo4ZL7uhvz/6qMoO52F8xXBx+WggbtI ohX7v/MmXfB3Ml/+CU7OU5gsYpmufWY2YswHlRwa2E5JL/iYu0acnJyJVHkDCvmn9lHs S/g1tnMJz//VeoqK19NJiS2ozoMj+jw7J6lBfstLZUOSkjnEg5yZyFXDp1hGnbI76jf+ WjZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=L1JbDwAZ9rP54v69Le8h5MVtukjWxgxH9cJ+R//r8/w=; b=dcMEkxECHORtZs5/igak1fhxeDdWPxlkJU91OzMpfJw5AX2iczvYI2aixIZwigAuju 3lVNCChFAgGFbURgoaAy01Sv9wozX8PN0z5kZs7izkXKeS5hRVvzM32+Xyu4vsw8/kQr kMldWiDXWHkafarMCNY+6QCARKZZjogB9gPNI6fHt8Bx09efOjizJbnHYSeiOIu1ViIy BXBgU1yBpDaxjNT3qa7+knhMdR+zXaHM1ZYrYcQzcnsv9ciAr4Hh/2S/20BcDMH4lkE4 A2FUxd4/d8B9o6eTflW64+B5di8bfYRKe3/WvTdrgLH9m+JJNQZmehfkTiVn2XD6clcQ lLIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hXn46izo; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e20si7311659ejm.210.2020.09.21.09.42.15; Mon, 21 Sep 2020 09:42:40 -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=hXn46izo; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728395AbgIUQk0 (ORCPT + 99 others); Mon, 21 Sep 2020 12:40:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:42860 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729324AbgIUQkQ (ORCPT ); Mon, 21 Sep 2020 12:40:16 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 1481C239A1; Mon, 21 Sep 2020 16:40:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706415; bh=1jVWc8PXV097QCVRCLRiczHZVrflp4FAQKnz07ENw9g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hXn46izohant4GzfQSje18+Fj4tkKDDSqvu1Hh4z1AlXcNizhZ9z9GAXi5FpSEuf+ 1cnoSDyKqw5nIWE/LtPBLPqPHyf4WlOdVAlp2qMZmuZwMibKQx8VK8ji5hFMk1Ui37 lG0R2OdtO9I0EmD2aDxzbPFKtmRxsHzb6/6w//2U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Leon Romanovsky , Peter Oberparleiter , Linus Torvalds , Sasha Levin Subject: [PATCH 4.14 60/94] gcov: add support for GCC 10.1 Date: Mon, 21 Sep 2020 18:27:47 +0200 Message-Id: <20200921162038.301152872@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162035.541285330@linuxfoundation.org> References: <20200921162035.541285330@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peter Oberparleiter [ Upstream commit 40249c6962075c040fd071339acae524f18bfac9 ] 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 Tested-by: Leon Romanovsky Tested-and-Acked-by: Colin Ian King Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- 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 1d78ed19a3512..1276aabaab550 100644 --- a/kernel/gcov/Kconfig +++ b/kernel/gcov/Kconfig @@ -3,7 +3,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 ca5e5c0ef8536..5b9e76117ded1 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.25.1