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

[XEN PATCH] misra: add deviation of Rule 5.6 for shadow paging code


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
  • Date: Tue, 16 Dec 2025 01:11:29 +0100
  • Arc-authentication-results: i=1; bugseng.com; arc=none smtp.remote-ip=93.44.185.214
  • Arc-message-signature: i=1; d=bugseng.com; s=openarc; a=rsa-sha256; c=relaxed/relaxed; t=1765843898; h=DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: MIME-Version:Content-Transfer-Encoding; bh=0wvIjzYU8DB2Ky+MSUIQO68qxDoQ24PdTMnMJPEjtu4=; b=MMd+Y0/Lse0S3beJlRb7zw6gxooMGCB/+jJhmEcJcTDxF5k8iy70czCfKB9Lwoiwd1RN 3760l8b4EKQh4uyJgNeXqPWlPuO8GllypYeGIS0jN0bmpP9CT/o8WlQbbhpl2C3uN5WLs sqJFAJt4FzqFlvQc2iv8S6yWxt4ificOePwJcKHyMXMDBFWSY0HtQ9YKXntHAt7XXreCx UfgmyIUklbMjWvKweTwuXDMUDBvOS1oR7dwhZCCjR6o2Gb4u+zJ6et46Qojcl1YcMmuE3 NJE3QEb6TqOCFTyWZv/qAZjuYU2/Jb/8MgFGfxdUKsZw9ubCqZCemeRLlRbOkSWoEOLNI nNxHoro9jQvehlJZqbLRolFhqQQw1Y+gfQCIkuHDT1gibv+KjE5qZeZDtHWoP4k7+iAey zCwkLbEMEl9CeHFS2eWzKfViQ8xjJx24DTQ4UgTFWGDH8fBHaxy4JTh5Ha2Txz72gH3RU 5hS9eU8oTyH9kSPTX5hIkpTy3kuZF9BbFu2rOFLQzjV24bDjSIY+zbGeMreC+zS3tSgdY vevFEgYza7cf/epsIP18RraZIigpxISf29VFIlZN+XrdKWgFWmCoWXadTl7YPldTzxm1a M0cpH7xumMEcOwSpsJIL/rxJC03ntMmsUtfSt+AYRUVUs1TrtXVDAm0Cu34G240=
  • Arc-seal: i=1; d=bugseng.com; s=openarc; a=rsa-sha256; cv=none; t=1765843898; b=jFOprYsa4t6Yr1bge1vwFGIjjFV6q+SMisTuFubh+YEf6xFtZtRgsggfwLQbbLqt0nvz TaERSrLSnx3Oj2CRBq6xiFkR6w8jxAngBxmLNomPVZ4g8IFMRGlxCQ7siDz9wqHYCWytA gU/zavhefXG+05BJQ8ZXLVDh2lAxJRjyJbiV/3gApyJzqm6Y72dtFqJhMkne1fLhrJWcG u3ZzW3b+NonVbCg5wFIEPIPOwjc2Gfco2vow+lnlVIujQRprVXXLew/TWtaGiQiJvXIcl Tbf6+oBwH5/5yDhO2rNdu0uNSfouDL7mfRMzWbkGbvi/juX9XkJoJR4C77Zj9PuuU3gAI AlxKCk5qSjD2ZWU3q+2DbYm0SFI8lFoDSyZGn4OQ3cGlyxDWXYsConYu4vx1PDScZtUZ6 GuQue9TFR7EKLW7Jq4PD54Iza+m1f4RmJZR3zAAYJd/apSfKigwNrXZEYid+2Qb19daeG wVXHzFjDImGDX4H0hAcHeEL928HYHrzanI7p/lkpc/kO25mUnSD3e3QfBnR4B8Nkjk0fN Btz6Cgivm7dyWzK9QmvFKwofxc44JzECbKZ1sC/CMV9A2Wk8Rn+GM+zlmbPKRajCaS5rH Md0KhkShqKGckflByruBE/AplXEDTaNoPoYFHZHeHqoqCofFcUID6IhcmwYuQvo=
  • Authentication-results: bugseng.com; arc=none smtp.remote-ip=93.44.185.214
  • Cc: sstabellini@xxxxxxxxxx, consulting@xxxxxxxxxxx, Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>, Doug Goldstein <cardoe@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.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 16 Dec 2025 00:12:05 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

The rule headline states: "A typedef name shall be a unique identifier".

in x86/mm/shadow/multi.c the typedef names for `guest_va_t` and `guest_pa_t`
are deliberately reused multiple times due to the file being included with
different GUEST_PAGING_LEVELS. As a result, a deviation for the rule is
introduced.

No functional change.

Signed-off-by: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
---
CI pipeline: 
https://gitlab.com/xen-project/people/bugseng/xen/-/pipelines/2216437709
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 5 +++++
 docs/misra/deviations.rst                        | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl 
b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 219ba6993b90..86e782da3f12 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -143,6 +143,11 @@ number of guest paging levels."
 
-config=MC3A2.R5.6,reports+={deliberate,"any_area(any_loc(file(^xen/arch/x86/include/asm/guest_pt\\.h$)))&&any_area(any_loc(text(^.*(guest_intpte_t|guest_l[12]e_t).*$)))"}
 -doc_end
 
+-doc_begin="On X86 shadow paging code, the types \"guest_(va|pa)_t\" are 
deliberately
+defined multiple times, depending on the number of guest paging levels."
+-config=MC3A2.R5.6,reports+={deliberate,"any_area(any_loc(file(^xen/arch/x86/mm/shadow/multi\\.c$)))&&any_area(any_loc(text(^typedef.*guest_(va|pa)_t.*$)))"}
+-doc_end
+
 -doc_begin="The following files are imported from the gnu-efi package."
 -file_tag+={adopted_r5_6,"^xen/include/efi/.*$"}
 -file_tag+={adopted_r5_6,"^xen/arch/.*/include/asm/.*/efibind\\.h$"}
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index b3431ef24e26..7f877142109d 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -187,6 +187,8 @@ Deviations related to MISRA C:2012 Rules:
      - Tagged as `deliberate` for ECLAIR. Such types are:
          - guest_intpte_t
          - guest_l[12]e_t
+         - guest_va_t
+         - guest_pa_t
 
    * - R5.6
      - Some files are not subject to respect MISRA rules at
-- 
2.43.0




 


Rackspace

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