[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v3 3/3] misra: deviate MISRA C Rule 5.5 for ARM SMMU fault handlers


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@xxxxxxxx>
  • Date: Tue, 29 Sep 2026 06:21:58 +0000
  • Accept-language: en-US, uk-UA, ru-RU
  • 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=JsoAb8FCpgxA3aZlyueleY3qgq+eWhjyCigo1phCNYI=; b=EV2/finj43iTC/XR/0srGX+BCyvPBgagJPq2zo+u1z+0rafZxU0M+0aMK5BJHvq4kUes69hs0AyL6EVlkBBioogIt5y82i+YGI4vdVALmfy+5URtxXabSCPtNYN/3DsBFhT7/8ACmYgJ5CHzzhIrnoSTWb+9iAr7URZRCpyAbXlHkok63mBtP8L8r/B29E6bYNFMebn459V7psLsGAmiqVHZR5z8C/JSEn0NPT2S1LzflnohE/b+IzuNqz5q1VQoKy6hS15VLV9HxHLb1YZtyuKOM+j+hJdu80enzqmCOwKIaHjzmj1Wi39StI45RAYs7NVjXiFeUAbxR/lgECpDJw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=C8UBlTEhGOxhuLL2Uz+8XaSUEWSVKrrovAixQUwmPRYFi/rLAGGwS7xyvXkEwqX8Lk2ec/wzGcUDOZeJOMCaMGS7ePMHBKeEAgWeUPxsysY1SGMEe0O05zVQrKJ53x4h010vnlVdGHE0wbBSXsQApC3YbQLpYqPhrzkYSFGsNrBO7mKSEsLAHyOjyOX0gjGeQ3FI6yNKSZQxBagECea33o+d1MoZLhBUiQOJXCZAMHMDtBj1h+mBlJa5dpEatqEJZQAZJF4xqjDcVOpRKVcFA/tEJXH4IGMG0jCOvHlwZbyXWUnr2sisCeEV20Eu1M0MZej235ctpA9uejPRHQpB2Q==
  • 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: Dmytro Prokopchuk1 <dmytro_prokopchuk1@xxxxxxxx>, Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>, Doug Goldstein <cardoe@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger@xxxxxxxxxxxxxx>
  • Delivery-date: Tue, 29 Sep 2026 06:22:06 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHdT9rU29h6GSd+j0KhBztsfBZSuA==
  • Thread-topic: [PATCH v3 3/3] misra: deviate MISRA C Rule 5.5 for ARM SMMU fault handlers

MISRA C Rule 5.5 states: "Identifiers shall be distinct from macro
names".

Update ECLAIR configuration to deviate identifier and macro name
clashes by specifying the macros that should be ignored.
This includes arm_smmu_global_fault() and arm_smmu_context_fault(),
where the original ARM SMMU handler returns irqreturn_t, while the
same-named macro redirects later uses to a Xen wrapper with the
void interrupt-handler signature expected by request_irq().

Update deviations.rst and rules.rst accordingly.

Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@xxxxxxxx>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 4 ++++
 docs/misra/deviations.rst                        | 9 +++++++++
 docs/misra/rules.rst                             | 5 +++++
 3 files changed, 18 insertions(+)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl 
b/automation/eclair_analysis/ECLAIR/deviations.ecl
index d62f339103..d65966f4e0 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -141,6 +141,10 @@ These macros address differences in argument count during 
compile-time, effectiv
 
-config=MC3A2.R5.5,ignored_macros+="name(request_irq)&&loc(file(^xen/drivers/passthrough/arm/smmu\\.c$))"
 -doc_end
 
+-doc_begin="Clashes between ARM SMMU fault handler functions and macro names 
in xen/drivers/passthrough/arm/smmu.c are deliberate."
+-config=MC3A2.R5.5,ignored_macros+="name(arm_smmu_global_fault||arm_smmu_context_fault)&&loc(file(^xen/drivers/passthrough/arm/smmu\\.c$))"
+-doc_end
+
 -doc_begin="The type \"ret_t\" is deliberately defined multiple times,
 depending on the guest."
 -config=MC3A2.R5.6,reports+={deliberate,"any_area(any_loc(text(^.*ret_t.*$)))"}
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index 1524895dd2..43a538938e 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -192,6 +192,15 @@ Deviations related to MISRA C:2012 Rules:
        SMMU driver that adapts calls by reordering the handler and flags 
arguments.
      - ECLAIR has been configured to ignore this macro.
 
+   * - R5.5
+     - Clashes between the ARM SMMU fault handler arm_smmu_global_fault(),
+       arm_smmu_context_fault() functions and macro names in the file
+       xen/drivers/passthrough/arm/smmu.c are deliberate.
+       The original ARM SMMU handler returns irqreturn_t, while the macro
+       redirects later uses to a wrapper with the void interrupt-handler
+       signature expected by request_irq().
+     - ECLAIR has been configured to ignore these macros.
+
    * - R5.6
      - The type ret_t is deliberately defined multiple times depending on the
        type of guest to service.
diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index 497e393d4f..6c7f0ed7dc 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -232,6 +232,11 @@ maintainers if you want to suggest a change.
        local compatibility wrapper that adapts ARM SMMU driver's request_irq()
        argument order.
 
+       Clashes between arm_smmu_global_fault(), arm_smmu_context_fault() 
functions
+       and macro names in the file xen/drivers/passthrough/arm/smmu.c are 
allowed
+       because the macros redirect ARM SMMU driver uses to a interrupt wrapper
+       with the handler signature expected by request_irq().
+
    * - `Rule 5.6 
<https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_05_06.c>`_
      - Required
      - A typedef name shall be a unique identifier
-- 
2.43.0



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.