From patchwork Tue Apr 1 01:17:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Babchuk X-Patchwork-Id: 14034282 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E713AC36010 for ; Tue, 1 Apr 2025 01:18:16 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.933347.1335322 (Exim 4.92) (envelope-from ) id 1tzQGL-0006qk-7l; Tue, 01 Apr 2025 01:17:57 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 933347.1335322; Tue, 01 Apr 2025 01:17:57 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tzQGL-0006qA-2l; Tue, 01 Apr 2025 01:17:57 +0000 Received: by outflank-mailman (input) for mailman id 933347; Tue, 01 Apr 2025 01:17:56 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tzQGK-0006nG-CK for xen-devel@lists.xenproject.org; Tue, 01 Apr 2025 01:17:56 +0000 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on20630.outbound.protection.outlook.com [2a01:111:f403:2607::630]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 23d7f4c8-0e97-11f0-9ea7-5ba50f476ded; Tue, 01 Apr 2025 03:17:55 +0200 (CEST) Received: from GV1PR03MB10456.eurprd03.prod.outlook.com (2603:10a6:150:16a::21) by PA4PR03MB6703.eurprd03.prod.outlook.com (2603:10a6:102:ec::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8534.46; Tue, 1 Apr 2025 01:17:51 +0000 Received: from GV1PR03MB10456.eurprd03.prod.outlook.com ([fe80::a41e:5aa8:e298:757e]) by GV1PR03MB10456.eurprd03.prod.outlook.com ([fe80::a41e:5aa8:e298:757e%4]) with mapi id 15.20.8534.043; Tue, 1 Apr 2025 01:17:51 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 23d7f4c8-0e97-11f0-9ea7-5ba50f476ded ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HmUDlfz14M7RkPqJu/JFHDVAAYvGPh4RaVloRgwAOKkbkph6qXig4Wp3X4YezopFdCPoo9hb1UECQvI2auy01Jx3GeIJrftjqtU8n3qqixoplFQnDrzWbbYjCoifNPlqpycZMbUqv8BhheRdxH1IgJIgsDXfhUExZnP8E/48In2A8h7gPdLik2qlctZAQTep4nQHE6Mf7y4jdN8cUN/vQzwf2W8kk9kU1ORUNr8C9473rUlJ2ghSniWU+g99QyAxjJcsOeLMFULrBOyQDuYy1iGHqiB4f/TvYifrTptz+6UdQz1n6s0w7Nq5lZjzLPzAbLob0KiL9pAlNL/JXxw9RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6eauTMPP1KriVl2OZ/pYML5XrBsfISutp4e5CHq9zXk=; b=Rh1f0J1sQOCnONn2lZ6au3YLNRcjqiRDG0f4Ftu96rrHLysqw1b30TOm2VXCB5K7v09QQp5IYUhO3nENG5UzK1xPNO82s7iL3FH3u0dN8ZQz+4J3oX8V/yD4ZkXQ2nIeqnIS4uah10sxsIda0fFrYKg/SJbTq7qvosZ4Qaok7HkiuzasglBpYug57edEURqtKgI569QUJrHH2osEjpsshiSFcoC7DrS71K63nv+kr9LZ6GRVD2M+LdxFUkD1KpLS2cN6ecPRpOIS0vk3O8CxcTmC4vJcBHwE4CajG2FShMn/qDquMljgEcDY2YJogkDhCfLuLYYS6Y9erzT5OQDR2A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6eauTMPP1KriVl2OZ/pYML5XrBsfISutp4e5CHq9zXk=; b=OLGhuDc4wXoAJeI68NticqjH+ss5QthC7Slg6xxqIHOotpW2p5Pormm550Dn139xxrnUTXckOZSNcSF01m9HVlFkq/X10WNHf4cGbc0ZvqbuJmqEjo8llVPHFTcYeb4eHUyZTV87ZqYvwPdxOLKD7tM1+uhUZyqufwq22NKirTIUci6O/EZxrdfE2C9l4HCJQOPRddJkBc8KTSZc5OCHsQygaqr4lXrmyaextNJFtxc6KyvyhJ0pGZNysy8SAD8dg3P5ykXJfBQQNICp9Yve65xy0gg2KjKS09OsrWtgIGuvxkWhY5KQ399jEDH2YtouZoNsyCMCEZjYFci07afxEg== From: Volodymyr Babchuk To: "xen-devel@lists.xenproject.org" CC: Volodymyr Babchuk , Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , Julien Grall , =?iso-8859-1?q?Roger_Pau_Monn=E9?= , Stefano Stabellini Subject: [PATCH v3 1/3] xen: gcov: add support for gcc 14 Thread-Topic: [PATCH v3 1/3] xen: gcov: add support for gcc 14 Thread-Index: AQHboqPjoKv09jK/Dk2C7qcEL02CdA== Date: Tue, 1 Apr 2025 01:17:51 +0000 Message-ID: <20250401011744.2267367-2-volodymyr_babchuk@epam.com> References: <20250401011744.2267367-1-volodymyr_babchuk@epam.com> In-Reply-To: <20250401011744.2267367-1-volodymyr_babchuk@epam.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.48.1 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: GV1PR03MB10456:EE_|PA4PR03MB6703:EE_ x-ms-office365-filtering-correlation-id: 20e60f01-19eb-45c7-a7ff-08dd70bb05fb x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|366016|376014|1800799024|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?Pp8//HL1rigYOceyxaJPEO2Uab?= =?iso-8859-1?q?6ZrCi2NKfRDTrmHZMBheTrORYoI7ptoA7qwyMMUbK7O/lXNH6TeTTQTB8k+N?= =?iso-8859-1?q?oWCPqo6qlp/lBl7Q0+elEN+4LBxuryJHWFgw0h+lfO2R/YwEUUgLtmGCVILU?= =?iso-8859-1?q?OzDhSn80/Wqnwgxb0YF5/28+GQf4j0tBDaeXwqlK46m5XPA2cSjLvky3b2tv?= =?iso-8859-1?q?lzmledTeSFQ/tnxNV90OHIeq9+Y+ee1z4CDWRlTPeXE/VccgBVbAbIkd5Lcz?= =?iso-8859-1?q?Rxmvh4CmbgUW55ucfzPJrIq9DUq6FMSuvPlMdQpYa1rRybr30dSd31fRFDuW?= =?iso-8859-1?q?L6Mn9ahTBNaF/KilOhmz41AiL8i1bZS6k/MliQQHUTTienyLyl0k8GQRsmcO?= =?iso-8859-1?q?qRUHcVPaBy7AYRPb20HejYO5UJi21b6H4GdGGg6ZjSY4u505o1T9UBUU5VBJ?= =?iso-8859-1?q?hj9YO78yq3P4AAVm13/zznHF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AkYpcUJDS3Ih?= =?iso-8859-1?q?k/J15yuvvKaAQYxMrAXhxXtKCCNvUILMXPhklEPiVz4PR4rBcxCWUm5F6ePU?= =?iso-8859-1?q?AyrlWEk8SekglPU4qN+rODSYH+ArguweY5+kVUqVCcecDWgiHzz+6Gq+rk+b?= =?iso-8859-1?q?0QEyrx?= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV1PR03MB10456.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(1800799024)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?XjC+f851RNrbupabmBI99y8?= =?iso-8859-1?q?vEzHz22snNgVbiXwbLxqX4ff4UbHWyuMuKgVluMYmwO+cUIJjj6Mi3EkPHZo?= =?iso-8859-1?q?jgElqyw+NSta8H3TRsulRTIw934kWHevQRDadOuK+Dr+1oPUdeiPfOjuzTnr?= =?iso-8859-1?q?QBR0/KILPKFAbApa4BtlAIvOab3daqhjWuiL1Xzo0BF7r6rL29lVUSh/ZT79?= =?iso-8859-1?q?FPBlNvtKNtN5Zu+Df5dYu1Ym6QsswAwocYaHyWey2M8XgFK7AYyHs4/pQlr6?= =?iso-8859-1?q?7KZMu3VMOjcOA3bNrby2mWXOUdhbdicNDButkI0kjeDH9lXKcuEGDnAdrLog?= =?iso-8859-1?q?7s1WPOnpqsDySXE7lgjEEb2YMfqK8TLdcvc7ZW+gJQminO0odqssHZzglv1E?= =?iso-8859-1?q?dFTC8aafHmsVSE+/T0HN6doRNIPF+9nyxDSOjLCFooI43H4d488njHpuZfL+?= =?iso-8859-1?q?LLgKeRXDDDZttFpbgBJQghMoM0aqEaRRw4t2vIt0Mu9wkDRPFll1zD4mmFFi?= =?iso-8859-1?q?rqTj/gD52QDDGwyYrJMM7GcbWwaRu8vSEArzXjZ4Q598pomALgrVsk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xK06g9pUphiRqFVbrcs+NskXNTOXcowwheyUJZMCs6MbIKFbY8cS3?= =?iso-8859-1?q?NrbJNMLTBjPSGNjqvJeAOg7lvKzHBrtA8+diMZOYVq46wmzDqPvGb9P/Z1vf?= =?iso-8859-1?q?K+7vb43dMS+QVqFh3ofAIGjnJpP9LZ6f+uD20kH45PQtH0Dlwd8NY0/MeJsO?= =?iso-8859-1?q?B7hjgjxmnReRU7NT3aoDeD1rr6E0Ye59qvlUjZQ=3D=3D?= MIME-Version: 1.0 X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: GV1PR03MB10456.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 20e60f01-19eb-45c7-a7ff-08dd70bb05fb X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Apr 2025 01:17:51.3584 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: gG6QQC3pAHoXU74YI2PAH+aXxp7SoU478Ny1RiL4L+4ww0mvZiTuwQ81UqivtU1ZaWQ4TapRktT2FULl2PbHsvgq0/lIQs2oQmix0+dz11c= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR03MB6703 gcc 14 (with patch "Add condition coverage (MC/DC)") introduced 9th gcov counter. Also this version can call new merge function __gcov_merge_ior(), so we need a new stub for it. Signed-off-by: Volodymyr Babchuk Reviewed-by: Jan Beulich --- Changes in v3: - Added Jan's R-b tag Changes is v2: - Check for gcc 14, not gcc 14.1 --- xen/common/coverage/gcc_4_7.c | 4 +++- xen/common/coverage/gcov_base.c | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/xen/common/coverage/gcc_4_7.c b/xen/common/coverage/gcc_4_7.c index 1c20e35ee5..f4c1802303 100644 --- a/xen/common/coverage/gcc_4_7.c +++ b/xen/common/coverage/gcc_4_7.c @@ -28,8 +28,10 @@ #define GCOV_COUNTERS 10 #elif GCC_VERSION < 100000 #define GCOV_COUNTERS 9 -#else +#elif GCC_VERSION < 140000 #define GCOV_COUNTERS 8 +#else +#define GCOV_COUNTERS 9 #endif #define GCOV_TAG_FUNCTION_LENGTH 3 diff --git a/xen/common/coverage/gcov_base.c b/xen/common/coverage/gcov_base.c index d0c6d0a3f9..742034e039 100644 --- a/xen/common/coverage/gcov_base.c +++ b/xen/common/coverage/gcov_base.c @@ -56,6 +56,11 @@ void __gcov_merge_delta(gcov_type *counters, unsigned int n_counters) /* Unused. */ } +void __gcov_merge_ior(gcov_type *counters, unsigned int n_counters) +{ + /* Unused. */ +} + /* * Local variables: * mode: C From patchwork Tue Apr 1 01:17:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Volodymyr Babchuk X-Patchwork-Id: 14034281 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 19852C3600C for ; Tue, 1 Apr 2025 01:18:09 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.933348.1335336 (Exim 4.92) (envelope-from ) id 1tzQGM-0007FT-HG; Tue, 01 Apr 2025 01:17:58 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 933348.1335336; Tue, 01 Apr 2025 01:17:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tzQGM-0007FI-Ck; Tue, 01 Apr 2025 01:17:58 +0000 Received: by outflank-mailman (input) for mailman id 933348; Tue, 01 Apr 2025 01:17:57 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tzQGL-0006nG-Cb for xen-devel@lists.xenproject.org; Tue, 01 Apr 2025 01:17:57 +0000 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on20630.outbound.protection.outlook.com [2a01:111:f403:2607::630]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 241708ab-0e97-11f0-9ea7-5ba50f476ded; Tue, 01 Apr 2025 03:17:55 +0200 (CEST) Received: from GV1PR03MB10456.eurprd03.prod.outlook.com (2603:10a6:150:16a::21) by PA4PR03MB6703.eurprd03.prod.outlook.com (2603:10a6:102:ec::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8534.46; Tue, 1 Apr 2025 01:17:52 +0000 Received: from GV1PR03MB10456.eurprd03.prod.outlook.com ([fe80::a41e:5aa8:e298:757e]) by GV1PR03MB10456.eurprd03.prod.outlook.com ([fe80::a41e:5aa8:e298:757e%4]) with mapi id 15.20.8534.043; Tue, 1 Apr 2025 01:17:52 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 241708ab-0e97-11f0-9ea7-5ba50f476ded ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nAwatLDyaajIHjiL/s5mfEpHBsbwKLOAGOTkfgtUeIMilYYDcjsWvQOs6G0zozNkMC7qGx/DG6UkH03NzM3BYapxhhiTPipH4KUXC9xU5vnqsUlhX7W1SakJEX6028VqLaZSuqoVlC8rotawfVCSEFeFyJYzi52HsyWcFyl4kJo2nZ6eVQ3l/3q4lU6czc4MKroajrfmOUGvdSBKz9xIYJtX4MOPSGsTI6Lq7vlkTr3qKJwdPjDmPBCbIBYoFxURWNycYsM7nTuAH8GO6mkWLTLQRKFdC38nQZQnEQIIklKL+6b2OJJfl8HTwBipacyiQgDBK6yOwdnf4HUKLtst/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pYY5TMzKZzk8Pg6xp60F/cK2FtqsNx/Afg43r5Pf3JM=; b=mOrbLM/vuq9wFjCobJL4h6WgP0EUf0bCNJfkVFrgQZmE/ykKUs7zmwAtf4iqjZUscF2GeZ1iPcj0TP2MXkXY1TMChrszNIuMUr3uF+Qpc8vVHAXJKsRgqVPQIQPfIimGulLsV1c7FEM7z4+zMh4guMbygkJ/PwffjnEnfbB+oNUvvMz4rrcKJ/gjxDlihybtySNigmA2kl+RrxzallUaVk9PyEGkpS93e7nHMDE6M10aS7w3GFMkGFayI7P1N3prdYrMfoLQJl3A0iiR7MU8pcfgCzRTkOkKannmsVL0cePRoVG8n88uOrBAGocyzh2w1pWnbocVbfGq9Kp7xaHNpg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pYY5TMzKZzk8Pg6xp60F/cK2FtqsNx/Afg43r5Pf3JM=; b=J1h9Xh5r2iq8Gw4JEDG1f4qW7TX3eYASmChHMjhGirR4LOhMPEYBNowFLAsU+FHvWV8pUQiSiD5xTnwFAab56SY4Oyj/Oo/+38VIrihCab9C3QO42Kn+EkH3iipNM9CfyTArz9cTtaXBtNiFrKApfapXPdfUPLZHNwWt78DAw26LHbPS8Vhu1HquOv0uA0mOCo7Jw024gyXmemitf9c9Etysf8lZF1S3BN6shBpAdZKiA/0+KG29aOVOax8FjtcJJWPeOwq23jiPhT3vGyNjhZZSN6aHJq/jLeRRABYNUlFRPHmBnlvaxoTzbOqni4wfSAYfzpJVYpf3f7i/0N/qhA== From: Volodymyr Babchuk To: "xen-devel@lists.xenproject.org" CC: Volodymyr Babchuk , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Subject: [PATCH v3 2/3] xen: x86: irq: use do-while loop in create_irq() Thread-Topic: [PATCH v3 2/3] xen: x86: irq: use do-while loop in create_irq() Thread-Index: AQHboqPjgHkUwEzR90uZDjrf8rDceQ== Date: Tue, 1 Apr 2025 01:17:51 +0000 Message-ID: <20250401011744.2267367-3-volodymyr_babchuk@epam.com> References: <20250401011744.2267367-1-volodymyr_babchuk@epam.com> In-Reply-To: <20250401011744.2267367-1-volodymyr_babchuk@epam.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.48.1 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: GV1PR03MB10456:EE_|PA4PR03MB6703:EE_ x-ms-office365-filtering-correlation-id: 9100af57-b86e-46f7-630e-08dd70bb061f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|366016|376014|1800799024|38070700018; x-microsoft-antispam-message-info: =?utf-8?q?Ic+grm+7vHjpOWYGpKZwF68XIXKuRkZ?= =?utf-8?q?zNh6uNUmKyQ7HlmM4eD/VNClbVTHgRZ1zn/f+Xpxipf6hS16xIGgO0vjPIjPC0uv2?= =?utf-8?q?IzWBch3Awap/NzK78Y1doiTKw2fwHrJetA9qC1X7SQw1ffmgnzW20ux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N?= =?utf-8?q?FDzQpV6zBf2cITdJzyjIJeCaxPz9IsvANdXocti/mCbfpOyZoQVVmsnafYip390h3?= =?utf-8?q?2lvV6K2Znj0geUhe3pHsWM3gb2kAtXGveCHcjhFaK4xiBB5Xz/E32VHnucCBfzKeP?= =?utf-8?q?ePkStswdJmWXvAnWANEbWpY2wLNqUYTFX+B+dl8hvnQwkNgAzUB1KNZC5S+2vhGha?= =?utf-8?q?PPseRh2R1GD14TciwqFqh25mVVRQ1CvKZyR0VMeLEl4TDxWvS/M5miia/p07iXaT5?= =?utf-8?q?7TmnWy3zncEjHHMcjpaoo3F3udKfOyBJyxKOeaLwBWuRxW+5taxOafkFOaLGd2ihs?= =?utf-8?q?wKTEMxDNzKrdIpkG47gqVVXoapNgGcYjsz0hWuS15GvXns7eJ6HRCQX4FlVbfmlKu?= =?utf-8?q?7GdBZfK2Pq2?= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV1PR03MB10456.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(1800799024)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?x29dAg0Px+IdZ/7JaXc0jUSwr7n3?= =?utf-8?q?CNJ1QPV5YZWSA0Y/abmLM6/849vQQBUtQ2jSxTJo1T/k0vJJtWPBXhJGGbyS1TlNn?= =?utf-8?q?cSEuRRmqWTzWqC27C722rsVctm95ZccnwS8XqBl5wuWOSQwHf6F4OYnRRDD1zk9uf?= =?utf-8?q?Y375hje+ji9aCQ0n1ADEIIj3Uij3hi/FvOr8BU8fYDzKVdhKqiKP1oSJqft/4L42R?= =?utf-8?q?ShwbI1pMk7oCqsAw8ZTpDBl7zZt8SizTEHjicZofcvNpHl45HIuXIcsIpZvCEiTgq?= =?utf-8?q?4E3xiJnrCkO8KhlTnN+497S3ibXwyZ0yNY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guU6RiOVlVFHTmUKCgZCSjE?= =?utf-8?q?vdTD1EatkLCwS2TmjmL4XfymI2a9oOG/i78Cp6BpN5YBRF2mfmrUiitg35pNXsjIQ?= =?utf-8?q?UIEF3vOyYXWRfC35/k5tryxgp6XPSz9qy8BYqkNajBUy9szLDK+CIXZgeAsrUrupI?= =?utf-8?q?vyod3zlVBSZINftC836G/IdM+U/PGHboryiEsQwsD2JHZ/OnkVa7BC4Jh5JJzb9NS?= =?utf-8?q?wFS/j0IHBqaylr6P/Xqs7AFp8HBAXRVhpx+N6FXc50mOCULQLlvtiOhPr/12UkGT0?= =?utf-8?q?ZzQuAKDQ/CbOmi3Ur7XcWKmT0WDZncKjC5C9uenBOhnhsA7nHVxhpvNSyWRLzGhxL?= =?utf-8?q?jWuzXlqo8BPM5OgYOPY/npvOHCKi9zq4PA=3D=3D?= Content-ID: <6EE89C3D6CF6004F9DD0A0D8CB2A0C39@eurprd03.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: GV1PR03MB10456.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9100af57-b86e-46f7-630e-08dd70bb061f X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Apr 2025 01:17:51.6593 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Zsh/WTgvIvAxew5xeHXv1ZP/H3Z2PgHGa+1dOypOV9a0W3/WEpsEwP1+Vwbl1W8NknLMUk9Ef0Co+5/VBPsZGB5FbnIhnRo/WyfFmUTlXk4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR03MB6703 While building xen with GCC 14.2.1 with "-fcondition-coverage" option, the compiler produces a false positive warning: arch/x86/irq.c: In function ‘create_irq’: arch/x86/irq.c:281:11: error: ‘desc’ may be used uninitialized [-Werror=maybe-uninitialized] 281 | ret = init_one_irq_desc(desc); | ^~~~~~~~~~~~~~~~~~~~~~~ arch/x86/irq.c:269:22: note: ‘desc’ was declared here 269 | struct irq_desc *desc; | ^~~~ cc1: all warnings being treated as errors make[2]: *** [Rules.mk:252: arch/x86/irq.o] Error 1 The same behavior can be observed when building Xen with "-Og" optimization level. Fix this by using "do { } while" loop instead of "for" loop. Signed-off-by: Volodymyr Babchuk --- Changes in v3: - Correct code style ("do {") - Add comment describing why we need do { } while loop. I prefer to leave do {} while because Nicola Vetrini said that this approach might help with MISRA Rule 9.1 without needing an explicit initializer. Changes in v2: - Use do { } while loop instead of initializing desc with NULL --- xen/arch/x86/irq.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c index dd8d921f18..2f288704b5 100644 --- a/xen/arch/x86/irq.c +++ b/xen/arch/x86/irq.c @@ -264,15 +264,24 @@ void __init clear_irq_vector(int irq) int create_irq(nodeid_t node, bool grant_access) { - int irq, ret; + int ret; + int irq = nr_irqs_gsi; struct irq_desc *desc; - for (irq = nr_irqs_gsi; irq < nr_irqs; irq++) - { + if ( irq >= nr_irqs ) + return -ENOSPC; + + /* + * do { } while loop is used here to convince gcc14 that 'desc' is + * really assigned. Otherwise with -Og or -fcondition-coverage it + * may throw an false error stating that 'desc' may be used before + * initialization. + */ + do { desc = irq_to_desc(irq); if (cmpxchg(&desc->arch.used, IRQ_UNUSED, IRQ_RESERVED) == IRQ_UNUSED) break; - } + } while ( ++irq < nr_irqs ); if (irq >= nr_irqs) return -ENOSPC; From patchwork Tue Apr 1 01:17:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Babchuk X-Patchwork-Id: 14034283 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 06591C3600C for ; Tue, 1 Apr 2025 01:18:18 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.933349.1335346 (Exim 4.92) (envelope-from ) id 1tzQGN-0007To-Nz; Tue, 01 Apr 2025 01:17:59 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 933349.1335346; Tue, 01 Apr 2025 01:17:59 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tzQGN-0007Tb-LD; Tue, 01 Apr 2025 01:17:59 +0000 Received: by outflank-mailman (input) for mailman id 933349; Tue, 01 Apr 2025 01:17:58 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tzQGM-0006nG-Ce for xen-devel@lists.xenproject.org; Tue, 01 Apr 2025 01:17:58 +0000 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on20630.outbound.protection.outlook.com [2a01:111:f403:2607::630]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 245813c6-0e97-11f0-9ea7-5ba50f476ded; Tue, 01 Apr 2025 03:17:56 +0200 (CEST) Received: from GV1PR03MB10456.eurprd03.prod.outlook.com (2603:10a6:150:16a::21) by PA4PR03MB6703.eurprd03.prod.outlook.com (2603:10a6:102:ec::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8534.46; Tue, 1 Apr 2025 01:17:52 +0000 Received: from GV1PR03MB10456.eurprd03.prod.outlook.com ([fe80::a41e:5aa8:e298:757e]) by GV1PR03MB10456.eurprd03.prod.outlook.com ([fe80::a41e:5aa8:e298:757e%4]) with mapi id 15.20.8534.043; Tue, 1 Apr 2025 01:17:52 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 245813c6-0e97-11f0-9ea7-5ba50f476ded ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Oj+tm7K88H1MPomCItq+65O8sldxVITws5ECAYwPaFuFd8OMpYF6sTrLRHxaBQzcwoRO6o01Bep1Dd9K+PLR2DsjXewyw/JT2DO88KbfTHr9uNvBHmxjssO4Wmg6odxAjRFKbZuFDm4BEeFF4EB2w8o7eBc3uljOCSwGTERvURgjePz/whmkrLIMQ5UNUrh7dd5fxp4WGh4Nzn82dbzI5U5jQn5q8C8cfKQs7+Ru32RLt3UKFNonNzu9sAx+v42VPA7r/QWKyez2TOaxSLiB9a1hp+cFEpw8cMR5boi6iF2AMPjjMezK+Pe9iWWrOxF9SS2QfvHY2iujJpcf1i6cVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HGPtfu1XySmVw/zK9unEnF48Uef93WdT2NZnuvi0GjM=; b=e8K2eMp3aRnoPoUtuAnQxa2oI+MtKt7CQW9vMI5/JdBXLSKw3MFvmrLn/TZk7nmczmKK45rElcmtP/vIXVlc9wHnyWGk6Dak1KmcAwQYbhKNwpIwYRqeQTFkeb2DCMFUnUCuqLSokXnIqSvcOI8UamgdhSb/zZMkHrKJ9KMRMYq4IKsNSvrpLxqbvLpnz0EodwIKorx1tXoxvFAt28rBak4dk9DdNJAy6gqsOCv7QNJ26ucgh0zQY5mWsV9Dvr5WU9IK74jlc2WpcQjsls3rqFxRyUR2XafV6M0A2d9i0aUHImxVQzUCnxdCKn/xC6qh8HuK9hqych/VFEOktOrvWA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HGPtfu1XySmVw/zK9unEnF48Uef93WdT2NZnuvi0GjM=; b=QIyQF/3BBmLCCUbx7fSOsupVbRyKEukdcYmFNy7RLNSoxvgoRWNH+F8NnF0h1K6kJV8qXNmiwKt6EdGo1cbKUsyFV/yfT60k2BsYhCnTY6rpncpRr5MPDblFEl+WJKA+xT2l+k9Usvb2VWcoTgI0R6f0oG3g4u5wajGx5VqlGQVM5ksxtUQkBZbCP/qQBI6sDcgJw6TsG0JIu/49Q9O+ZtluurKxQdp6jn1BPNBjhv7ksITzBmigEE4kaddErnA43oyPK+1/OP3oVMnNyfkn5WJLzX5gu5KJsMOgg61+IBD5L10OjyZQPiGrx8JDEaeU6c1qFtRup9o8e1Dwrjnjgg== From: Volodymyr Babchuk To: "xen-devel@lists.xenproject.org" CC: Volodymyr Babchuk , Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , Julien Grall , =?iso-8859-1?q?Roger_Pau_Monn=E9?= , Stefano Stabellini Subject: [PATCH v3 3/3] xen: debug: gcov: add condition coverage support Thread-Topic: [PATCH v3 3/3] xen: debug: gcov: add condition coverage support Thread-Index: AQHboqPjQYlXeZrAE0u+zEMqLR0ZhQ== Date: Tue, 1 Apr 2025 01:17:51 +0000 Message-ID: <20250401011744.2267367-4-volodymyr_babchuk@epam.com> References: <20250401011744.2267367-1-volodymyr_babchuk@epam.com> In-Reply-To: <20250401011744.2267367-1-volodymyr_babchuk@epam.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.48.1 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: GV1PR03MB10456:EE_|PA4PR03MB6703:EE_ x-ms-office365-filtering-correlation-id: 399a3fc3-8d76-4b02-68f6-08dd70bb064b x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|366016|376014|1800799024|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?Jg/adk7Pyci12INTJhjq7QhoMv?= =?iso-8859-1?q?O4U8qyLLFmtl62heHCbflCPXprux4npvCj3qXUGEN33w7oH8i/p3lt8i4Max?= =?iso-8859-1?q?qm81eUBv8S/VZE5H/Ts6kDujmTeI8TeArPLxjPI9IAxPh+QZanQ/DD0nU1Tn?= =?iso-8859-1?q?cB9gY2zSYmjfmKbMGSCm7wjoCqBjBgfqSnizv6oU0KJnKKXfRPMG8Zm2zqhc?= =?iso-8859-1?q?PpZ58ZqcezLAFcjmPz5UnhIIT44Jsl6HalAXsszYYUpNxreqxqJYzvDsHqG6?= =?iso-8859-1?q?FZS7YXQQQApkrbNdpA+Tya/UaunDnsRx/VCgEGI7NQ4MLMkz2KQbWCvHznRi?= =?iso-8859-1?q?3w43NONOUBzI+yzwUkjekK7Lcfv8Ps/GTqEBVcuwd4c9WWAVb5mFC79gKtcx?= =?iso-8859-1?q?NTu7J6ay4dtBo+RKLBH9yDdp1WrtwsGLBnaA2PscFTkLkvJlk0YFjVCNI0os?= =?iso-8859-1?q?GkJOJMdCNy8apM6BoluT06wvMfsrTzhKqx9VwTsu8Xe4Snvk+t2iAI/kK/VJ?= =?iso-8859-1?q?2Q5f15AsfUyn9fusYpVuJWFyt9XlA05sB9D+SwPeqPJuXpa+2qaoN+teoiGY?= =?iso-8859-1?q?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GNQ5gDpjqB+AIcHemXHhaLzBbHe5UT5Sq?= =?iso-8859-1?q?tGp/5r?= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV1PR03MB10456.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(1800799024)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?hMD6/aby3vH4GXE36eywehf?= =?iso-8859-1?q?K2XS9uI4P1nw7FuHiB1ZMU6SwBuMm34rosLysamHclTW6Ot02r0lSJUjjF9N?= =?iso-8859-1?q?/Q0LMD+Zm07737cIdxktu4SYmkjY5X70aXG+QU2ogB4DuBwTo6wh6T6zRIis?= =?iso-8859-1?q?JDpxJ+y9W238vqhOinPFYc1VfdyyB53uqSRTAcqlqKyubFceZTkxOiJcMeeG?= =?iso-8859-1?q?hRObrmV2Bcuijxifp/nchzLD+KyPRKa7npV/LRj06GCXwaor2YBZOOD4BoCY?= =?iso-8859-1?q?z3ecItOOi3Ib6qtvImZczRduMQTquEZ1z27B5JTwKj10RUxSRvvkRatJ6JmK?= =?iso-8859-1?q?xh4mJO9AZV2nvxUkReJOp9UAS48Asx6y30ZPcF3lddyPw4UY4BcHr6+MEkDB?= =?iso-8859-1?q?bZ+BSCgS/G74DYs8uchQNUnWtUqoEIHdfNW/1Zh+4NFqH9XTGBke6uMwlrN7?= =?iso-8859-1?q?rVGG2xA2bgfZX+duRvAcGHoL+hPj9mVV1ei9+ScZIWe6hd6VDqKuQvrHtrAz?= =?iso-8859-1?q?jYqZqJfBsadz0+PjS4uuNjOfPnR9D+KN4ZWJ0/dth2fuEhQ/faj/IenSmI5w?= =?iso-8859-1?q?qKnPtL3qDsz19ZIEncSEomY60XPnl6jPzWwKNpShskuDD/15wY7utiiVPPji?= =?iso-8859-1?q?MDp/mKLqyfhx6xYIxcA2HkSHN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Ij2Z/+8W5/x/q9?= =?iso-8859-1?q?IsBPwEKXzhWOwfcRg8qvfZs7ImK47ArB72jFEXk1IhR00aiA0srN1IH+rNpe?= =?iso-8859-1?q?1GUc+G2TFMtXb9SLsAU6qH+w/CrKJ/DvG607Pvw=3D=3D?= MIME-Version: 1.0 X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: GV1PR03MB10456.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 399a3fc3-8d76-4b02-68f6-08dd70bb064b X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Apr 2025 01:17:51.9544 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: T7+UJ9blVH+nnhdI5iEPRDZCA9vRPblO5Gjod5i2A8fMYI+rg4NXqSNdfswlmS21fV/GDNtAmorupBKIBoq5eeymKCeRZ/g5kca8iKM4zFA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR03MB6703 Condition coverage, also known as MC/DC (modified condition/decision coverage) is a coverage metric that tracks separate outcomes in boolean expressions. This patch adds CONFIG_CONDITION_COVERAGE option to enable MC/DC for GCC. Clang is not supported right now. Signed-off-by: Volodymyr Babchuk --- Changes in v3: - Introduced CC_HAS_MCDC that checks if compiler supports required feature Changes in v2: - Move gcc version check from .c file to Rules.mk (I can't find an easy way to check GCC version at Kconfig level) - Check for gcc 14, not gcc 14.1 --- xen/Kconfig | 5 +++++ xen/Kconfig.debug | 9 +++++++++ xen/Rules.mk | 3 +++ 3 files changed, 17 insertions(+) diff --git a/xen/Kconfig b/xen/Kconfig index 2128f0ccfc..2bdebfc808 100644 --- a/xen/Kconfig +++ b/xen/Kconfig @@ -41,6 +41,11 @@ config CC_SPLIT_SECTIONS config CC_HAS_UBSAN def_bool $(cc-option,-fsanitize=undefined) +# Compiler supports -fcondition-coverage aka MC/DC +config CC_HAS_MCDC + def_bool $(cc-option,-fcondition-coverage) + + # Set code alignment. # # Allow setting on a boolean basis, and then convert such selection to an diff --git a/xen/Kconfig.debug b/xen/Kconfig.debug index f7cc5ffaab..f89cbd823b 100644 --- a/xen/Kconfig.debug +++ b/xen/Kconfig.debug @@ -44,6 +44,15 @@ config COVERAGE If unsure, say N here. +config CONDITION_COVERAGE + bool "Condition coverage support" + depends on COVERAGE && CC_HAS_MCDC + help + Enable condition coverage support. Used for collecting MC/DC + (Modified Condition/Decision Coverage) metrics. + + If unsure, say N here. + config DEBUG_LOCK_PROFILE bool "Lock Profiling" select DEBUG_LOCKS diff --git a/xen/Rules.mk b/xen/Rules.mk index d759cccee3..0a2933cffa 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -138,6 +138,9 @@ ifeq ($(CONFIG_CC_IS_CLANG),y) COV_FLAGS := -fprofile-instr-generate -fcoverage-mapping else COV_FLAGS := -fprofile-arcs -ftest-coverage +ifeq ($(CONFIG_CONDITION_COVERAGE),y) + COV_FLAGS += -fcondition-coverage +endif endif # Reset COV_FLAGS in cases where an objects has another one as prerequisite