[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] xen/arm: deviate MISRA R11.8 for capability enable callbacks
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Dmytro Prokopchuk <dmytro_prokopchuk1@xxxxxxxx>
- Date: Wed, 18 Nov 2026 22:28:55 +0200
- 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
- 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=thrLq5TvVXcTE2FigxgmS1wlwXZMtlV0Riq6akklBtQ=; b=MuzQ8DldPmpkjSxeBTt+oP0iaxabmupo5jXHYc2Bv51BzocRb7jr9wbFmRcYTCyntrT3PG26v46QxFRrv3ZSWw0PPqAfVM7qcU9AF0yDhelXZjuLcszEti8NOu1fy8ZKqj4WA8/vNq33wZcHYfjLtwmAEzxjY2n7e3FEr+fiOiFG9J7aWUs+QDaT88gGQiD/b29VYrJAvtsAtTpmXwXPbqy42QgswYuUksGrymEapgfA+T2taG2K1J5PD2/5zXl11vXz76+2Mxqb9sfoF+c+/57yL8K7ckk34qh1SN+bQW7CpPTIAR3R78/l/Mnr9NhOlnTw6R0VATTDMCl14EBKAQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bzWYHHENP/uCoqy0ovLLw/VgTMt/fcVR2p1iVJ87AeisY8TNstIw8VPYdJwsr4bdAd83DaWV/vzk+QUvr+b3JSRRwvG9ET57WLpIacvuF8tPBWeEF5i8S+hkN2ddUyk+WiN9TgOEmxArXtkqUg+Gco3g77qKjQEje8SjP0AuaZAjl4rez39xLH5VMwg7nsishRis8xpgfX41nt/3pb0rPRisf318SwNF7F3dMYTnq68DIeHq+/YSKV+VyFsFlxj0na9bqnynGGEIXJQqqJaH1znNADgZdarp/8JKKmsV3Cqs4xM4L1ITmuNEFrl8P6i1wi4QZYd/fKsgXoRJCxw0Wg==
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
- Authentication-results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger@xxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Wed, 18 Nov 2026 20:29:15 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 11/18/26 09:41, Jan Beulich wrote:
On 17.11.2026 22:31, Dmytro Prokopchuk1 wrote:
--- a/docs/misra/safe.json
+++ b/docs/misra/safe.json
@@ -124,6 +124,14 @@
},
{
"id": "SAF-15-safe",
+ "analyser": {
+ "eclair": "MC3A2.R11.8"
+ },
+ "name": "Rule 11.8: cast const capabilities to void * for enable
callback",
+ "text": "The Arm CPU capability enable callback takes void * to match
the generic callback convention. The cast removes const only to pass a const struct
arm_cpu_capabilities * into that signature. Existing enable implementations treat the pointer as
const and do not modify the object."
+ },
Do we really want to restrict this to Arm CPU cap handling? The same pattern
could easily arise elsewhere.
Hmm, good point.
Well, the deviation could be generalized to this:
name: Rule 11.8: cast const pointer to void * for a callback
text: Generic callbacks take void * by convention. Casting a
const-qualified pointer to void * only to pass it into such a signature
is safe when the callback implementation treat the pointer as const and
do not modify the object.
If such wording is OK for maintainers, I can prepare v2.
Jan
BR, Dmytro.
|