From nobody Fri Oct 31 03:39:56 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass(p=quarantine dis=none) header.from=epam.com ARC-Seal: i=2; a=rsa-sha256; t=1755693880; cv=pass; d=zohomail.com; s=zohoarc; b=NNFePa9RE+Wh3C/gRK5WmRQMIoTnR/dCVPd6lML1zcWV8c4dV5ossAKO9xhgUIJSGWLUZYAewED6sO/33xGacv973SA/iJu2EVzq9JhmX+ncbeBNFSmNa7l4+m5Jts0lTPuQttRUKfFUFmkGwovpzncT51rdmF70u/VxX9JuVCc= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1755693880; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=9iH5dFHiOKWzkPchOkXAXALka1CWtQksfFajkNb5o98=; b=c0rO8C1rIQcZSOWyJxNrUVN6VaQcrUFDVs84Ak3ZAdCBLGqS+fD0W6OoG7h9lEc5q9e4uWLDPUd4a5xkFM6BrQEem2N6wrLYOGfuYzyfXn11qcaueyDF+cgbLARdgsKI6DSWm8fHqh5ulF1yxZVI8F+1va6mUwrlJnQLDCrWQJY= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1755693880418179.34993173327302; Wed, 20 Aug 2025 05:44:40 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1087438.1445484 (Exim 4.92) (envelope-from ) id 1uoiAy-0008RO-Pa; Wed, 20 Aug 2025 12:44:24 +0000 Received: by outflank-mailman (output) from mailman id 1087438.1445484; Wed, 20 Aug 2025 12:44:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uoiAy-0008RH-N2; Wed, 20 Aug 2025 12:44:24 +0000 Received: by outflank-mailman (input) for mailman id 1087438; Wed, 20 Aug 2025 12:44:23 +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 1uoiAx-0008RB-OE for xen-devel@lists.xenproject.org; Wed, 20 Aug 2025 12:44:23 +0000 Received: from MRWPR03CU001.outbound.protection.outlook.com (mail-francesouthazlp170110003.outbound.protection.outlook.com [2a01:111:f403:c207::3]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 65bd4f30-7dc3-11f0-a32b-13f23c93f187; Wed, 20 Aug 2025 14:44:23 +0200 (CEST) Received: from GV2PR03MB9572.eurprd03.prod.outlook.com (2603:10a6:150:da::5) by AS2PR03MB9194.eurprd03.prod.outlook.com (2603:10a6:20b:5fc::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9031.19; Wed, 20 Aug 2025 12:44:20 +0000 Received: from GV2PR03MB9572.eurprd03.prod.outlook.com ([fe80::edd1:842f:9b14:509e]) by GV2PR03MB9572.eurprd03.prod.outlook.com ([fe80::edd1:842f:9b14:509e%3]) with mapi id 15.20.9031.023; Wed, 20 Aug 2025 12:44:19 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 65bd4f30-7dc3-11f0-a32b-13f23c93f187 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=d8B0zMFH7QfCTV4ubQbVJnKcPGPY+1Ehj1bd9fDEzP2Bd1neBkNIClXsVD07BzllvIRxnrB/OP+TDJadSQp5LK8peTgMupEp+dPL36uYpz16ZKlwhP02VtMMpqPjGk3gkvoJY9H+eHZShYI3E25P6IhI79hTI0RSeXd9j2hf8M37yE8rnRJe+ekVBFB9zws7esRHm+RlzciJmTYmD1neuV0jBVpVR++83PZ7H3eHpkcf/K7P16XY01XHFZKwPiQQfgbAN8xqzyQ7FuujaozAuDVvLHsccmsFna2UYsMvKIUh2akwXjce5DZagHP4uPgN4Zgc3sQriek3olN9SCN/6w== 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=9iH5dFHiOKWzkPchOkXAXALka1CWtQksfFajkNb5o98=; b=H7Ujz1vOstDp/G3q9DZ3+/tGZPt8jfQwoPbLs2PuO/FON8rli2VZ30vT3xnKcH4kAnMnLO8nYQUhYxsF5wS59c1r5ve0DJARVgPV+LgvHR7YMabDl2Vk23XHp5SFe4XwAKorpaJ3m2NFXcnKUR2wnLvIDn0hQXkE9W22t4inNs8NHnhcRV/XBkvHHz+aujDIl67Yrj6yPu3JvgTDjJ4C2W/dIgKq+es3rJXDZXTRX2F0COdEQzjVZdewiM70Sf4MH7tsMwai5FsYSKw2F6Djg2lYGv+ty1yPzMgBUTIl3tZfgsHrAPoadxoT4HuQbfnZxffs4xWbwDRXO/8Jnu1zGA== 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=9iH5dFHiOKWzkPchOkXAXALka1CWtQksfFajkNb5o98=; b=bn04wJfnvvBMsQAV0KfKGJZRuupcg/kM/6rj0Ts/Lvgc8F3JNZd72HetW9xYh196ZGzsyqpAYgLFNVlc4vvS5tYLDxXRjpuES70+iDbt8abc0xDWa7WFKwjq8OiM+edkYHy75EmrNTKI86FYjyo1Pnqbj4RjBadsgF1AeKEYds3JgQikeoEVkbcKKpCtNVU171ODR7BLJApDES1jAFMnDWPxnMmCdsCc+oH7LBEFuQJQZNjeLILr5HlGvzaMrgoIRr4k+cyXB3MH5bXcxcZiBfIezsXDifRBMhY2iEvSCBXf7vWmmaubWkgUqAjWz9sXxNLpCaUeV1OM1nzpOZSo6g== From: Dmytro Prokopchuk1 To: "xen-devel@lists.xenproject.org" CC: Dmytro Prokopchuk1 , Nicola Vetrini , Doug Goldstein , Stefano Stabellini , Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , Julien Grall , =?iso-8859-1?Q?Roger_Pau_Monn=E9?= Subject: [PATCH] misra: add deviation for MISRA C Rule 18.3 Thread-Topic: [PATCH] misra: add deviation for MISRA C Rule 18.3 Thread-Index: AQHcEdAlL6ZgiilPSEOu1KBVqkWanQ== Date: Wed, 20 Aug 2025 12:44:19 +0000 Message-ID: <901917945f704643e95842a773be9e8676f76d10.1755690681.git.dmytro_prokopchuk1@epam.com> Accept-Language: en-US, uk-UA, ru-RU Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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: GV2PR03MB9572:EE_|AS2PR03MB9194:EE_ x-ms-office365-filtering-correlation-id: 9cc36d22-59f1-4ebe-0248-08dddfe74834 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|42112799006|366016|376014|7416014|1800799024|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?Q?d3DL/lU4pzWQOnhI5ZfGcVGTLGpLyODajTLVgU0JcwDErymmToouWhjQGB?= =?iso-8859-1?Q?yWdES9toJjpiz4AFu73+yRqZll6XyKLysDAglmxBq3Lko2Vdl/dzSinmFt?= =?iso-8859-1?Q?z2QGLoFimQEe/FIv+Tb+zYf0RHgqB9IyJT2/K3bSG7zULewMir7VWFhmJP?= =?iso-8859-1?Q?AA+c9xpZGjgiMg5XAPQGHDQfqffqwVbsFBoezEKtjAXevA/XDeCls+vgMj?= =?iso-8859-1?Q?7iU2Ji6JtS2dTAwjsfUWdPsGBEm9VqxrE0YDxx2FLnSuWux9HDFfK0+pV+?= =?iso-8859-1?Q?8Nd7kgFgEOemTcY8Ml2I+Olhz5ohop9brS4UIAsb7KvTWTM5Hd96DzdHrA?= =?iso-8859-1?Q?Tdh6S6dOFIN5i/6YrsaOb1+0n7uci+EF28dKurRkKR6xI3AW/0N4Tujxiy?= =?iso-8859-1?Q?Sj+Rnl2Mzs3098/BimbYJummv+dgIy9JBXFHabLMtX9v+F+o29yzgBjUPp?= =?iso-8859-1?Q?n/PV3OI2RjZU1WT7ubOP6ba7XeFvneuu7ulNwh1UppmkCVCwEDZzeu8fo+?= =?iso-8859-1?Q?tmKM27HhrqohHM0Rl8exsxvciY2V2//7zbF/qpWENfd7eZiXVi9BGO5bWF?= =?iso-8859-1?Q?47BPXqsjjWwygu4M8FiIaYk7sNyAPw8PZV1rv2Useie8ohzMPTFXftSQrZ?= =?iso-8859-1?Q?fSqJ6Mg74VN/pifdo5jdTepELkKtzSmZCPcd18gIJtzg9GsPns9gr8PsTp?= =?iso-8859-1?Q?WONGtjqkvxOXIqblOOEVuSuz9Q6lM85BU+fjQcCpyucCrFhYSQ/1RJUx/R?= =?iso-8859-1?Q?cU1TXOBHVgGk7211L9en7JEd0itf4OTvh8UsrnUSHTH1tQSw9Y71os10Hg?= =?iso-8859-1?Q?RatwpChZwFZuV/YiXcANxWREhMW4CMEIqAlSKhs4qgoaERLzam6kGSybed?= =?iso-8859-1?Q?qug7gID05/UHzv0hVV8g1QkfQBnQfCYsRezTSC1J7OwMU7HfYvTfWhqJDe?= =?iso-8859-1?Q?he28tUFSkhaO+UjfdWYymhociMYQQ7oBkj6IIB5oL4theKdbmPEsRpMmHG?= =?iso-8859-1?Q?1X7a4u77Mq2YlFhOrUyghLP/Qcqlyfo0K7jHBvN55YvpfHwkmYFuVSvfS/?= =?iso-8859-1?Q?apa8lphaigs8bx647qOvB7NOTbaL7z/2BTDibjpoEENE/jza7Tah5kZ5sB?= =?iso-8859-1?Q?3yxaaRgaYTcc1rhaP2vlbCnT3jFLkJKHUHVx5jR2GzhJn7fk2yGIy2kf/m?= =?iso-8859-1?Q?jQZ/jUbDaHKiufyw9zetRls10ljsa98P7Y6SY73BgnW0lMUKgS3N/UPymT?= =?iso-8859-1?Q?ohuM4TXcP5VlKootbwluU1SK4pkWMVb9GcJLtJwjuEQ32YdV4GCerrHc+F?= =?iso-8859-1?Q?v5UbH7SNXGHeyq8sM3RBG251oyzgopjdNrc8Qo/9EjNcpzqXpcX0vWSCPh?= =?iso-8859-1?Q?28pjYpjbRvq/xhNi9TKRYXW2LV6zNKKMHciNXB00bdflecZqLr2wklvlCR?= =?iso-8859-1?Q?Jic3yV2ZMTw9kJkSQHSKwkd3I9NlIYC/rXMr/v31/T1sGpHQg7DR1ltQVn?= =?iso-8859-1?Q?0DeNpUR17wvqpfRmPq0CvoYggIilBI/sRe/u+K5POHJ1tYGV9tngTGeuvk?= =?iso-8859-1?Q?0z3zk7g=3D?= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV2PR03MB9572.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(42112799006)(366016)(376014)(7416014)(1800799024)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?1EEt7F09NECk705Ckmgg+27kA/W5nKS3vPmqOIE1iEp5Z+4TYFtHgoOLKP?= =?iso-8859-1?Q?Ql6d3gJpxfEobxUJ5DSlcfx3p1C04waekeORkaaf4R1bNCS+/7POkgl8Lv?= =?iso-8859-1?Q?yje1MBFPfyCQDDZgVjgrcXWMQSbK1D6LxtmGpePqmLYcSFWTroP/K6pkHe?= =?iso-8859-1?Q?0kLAmowcsoQxkzBrmeGFhnVHn2FyeHsEIYr24rZlrk+KH+wDdmXB5XUQHz?= =?iso-8859-1?Q?df52jbsZrsIipTL5A0muKv8p6b8jkGzUU4/fuDPwk3wm02B/HA4JYL02y2?= =?iso-8859-1?Q?1V8/6HXTlQHXFYmHMFk8TZzSoGOp0VOZiKbE4cr5BbphqhCdpPsdHuWncj?= =?iso-8859-1?Q?OKPyj5BwGpZFSWfW8WIhGn5gcKlQwjmN1UHBzkSQ3skuCVivSTHzkXwExZ?= =?iso-8859-1?Q?hb3K4E0Tlvpp8z+GxnT8RMwodH9CnmX7gXhRBKiYjyMj+YKiO3BtTipdAK?= =?iso-8859-1?Q?3IjMPrxrl87W3R/TOLue6MeowtjEs8fA0155FaHZudgS7/DF+eZHngnkfe?= =?iso-8859-1?Q?T+mpSIzsBbIE/A6quM3nhY0zkNshlQRPmCc1D3hhyJWbUzOD/tJ5gzK4R9?= =?iso-8859-1?Q?mUKcSLZUBQIjHGDjdzeppAGmUyaCoThgr9zdQscpOi8ORmD24TAtp1fj9/?= =?iso-8859-1?Q?eYJDNBg2RYed1GfzUBwXetlgr4zQ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6GijYrUi4pruWav6lxb771AaH5DflIidqtSxhVDW5oiaZfBYL6MDO0XplZ?= =?iso-8859-1?Q?kjEqG5KupQwbGIxGFmhfI4gtBHqb9a60/GJ4aYLnLuoKjRJz62iABN4w?= =?iso-8859-1?Q?=3D=3D?= Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: GV2PR03MB9572.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9cc36d22-59f1-4ebe-0248-08dddfe74834 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Aug 2025 12:44:19.7930 (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: nIoyBKhGMwlwho09asHizkNoR2VVBNb2QpzbK1TmnKXxTi6CdIfpgWMNZ3n05aXSX03kxHmztvkIpb3BeFH19J1vJyqCPIXzz8MyVUw4XuY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR03MB9194 X-ZohoMail-DKIM: pass (identity @epam.com) X-ZM-MESSAGEID: 1755693882058124100 Content-Type: text/plain; charset="utf-8" MISRA C Rule 18.3 states:"The relational operators >, >=3D, < and <=3D shall not be applied to objects of pointer type except where they point into the same object." Comparisons in the 'find_text_region()' function are safe because linker symbols '_stext' and '_etext' represent fixed virtual addresses within the same '.text' region, and the function 'addr' argument is explicitly compared to known valid memory bounds ('text_start' and 'text_end') derived from these linker symbols: if ( (void *)addr >=3D iter->text_start && (void *)addr < iter->text_end ) Configure Eclair to suppress violation reports occured in the function 'find_text_region()'. Update 'deviations.rst' file accordingly. No functional changes. Signed-off-by: Dmytro Prokopchuk Reviewed-by: Nicola Vetrini --- Test CI pipeline: https://gitlab.com/xen-project/people/dimaprkp4k/xen/-/pipelines/1993673043 --- automation/eclair_analysis/ECLAIR/deviations.ecl | 6 ++++++ docs/misra/deviations.rst | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/= eclair_analysis/ECLAIR/deviations.ecl index 7f3fd35a33..32b596c9da 100644 --- a/automation/eclair_analysis/ECLAIR/deviations.ecl +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl @@ -590,6 +590,12 @@ C99 Undefined Behaviour 45: Pointers that do not point= into, or just beyond, the -config=3DMC3A2.R18.2,reports+=3D{safe, "any_area(any_loc(any_exp(macro(^p= age_to_mfn$))))"} -doc_end =20 +-doc_begin=3D"Comparisons in the 'find_text_region()' function are safe be= cause linker symbols '_stext' and '_etext' represent fixed +virtual addresses within the same '.text' region, and the function 'addr' = argument is explicitly compared to known valid memory +bounds ('text_start' and 'text_end') derived from these linker symbols." +-config=3DMC3A2.R18.3,reports+=3D{safe, "any_area(any_loc(file(^xen/common= /virtual_region\\.c$))&&context(name(find_text_region)))"} +-doc_end + -doc_begin=3D"Flexible array members are deliberately used and XEN develop= ers are aware of the dangers related to them: unexpected result when the structure is given as argument to a sizeof() op= erator and the truncation in assignment between structures." -config=3DMC3A2.R18.7,reports+=3D{deliberate, "any()"} diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst index 2119066531..a726fb22a8 100644 --- a/docs/misra/deviations.rst +++ b/docs/misra/deviations.rst @@ -586,6 +586,14 @@ Deviations related to MISRA C:2012 Rules: are safe. - Tagged as `safe` for ECLAIR. =20 + * - R18.3 + - Comparisons in the 'find_text_region()' function are safe because + linker symbols '_stext' and '_etext' represent fixed virtual + addresses within the same '.text' region, and the function 'addr' + argument is explicitly compared to known valid memory bounds + ('text_start' and 'text_end') derived from these linker symbols. + - Tagged as `safe` for ECLAIR. + * - R20.4 - The override of the keyword \"inline\" in xen/compiler.h is present= so that section contents checks pass when the compiler chooses not to --=20 2.43.0