All of lore.kernel.org
 help / color / mirror / Atom feed
* [XEN PATCH v2 0/3] xen: address violations of MISRA C:2012 Rule 13.1
@ 2023-11-24 17:29 Simone Ballarin
  2023-11-24 17:29 ` [XEN PATCH v2 1/3] automation/eclair: tag function calls to " Simone Ballarin
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Simone Ballarin @ 2023-11-24 17:29 UTC (permalink / raw)
  To: xen-devel
  Cc: consulting, Simone Ballarin, Doug Goldstein, Stefano Stabellini,
	Andrew Cooper, George Dunlap, Jan Beulich, Julien Grall, Wei Liu,
	Bertrand Marquis, Michal Orzel, Volodymyr Babchuk,
	Roger Pau Monné, Dario Faggioli

This series contains some changes and deviation to address
reports of MISRA C:2012 Rule 13.1:
Initializer lists shall not contain persistent side effects

An assignment has been moved outside the initializer lists, other
violations have been deviated with SAF comments.

Function calls do not necessarily have side-effects, in these cases this
patch proposes to add ECLAIR pure, const or noeffect attributes whenever
possible.

ECLAIR pure and const attributes have the same definition of the corresponding
GCC attributes, noeffect attribute has the following definition:
"like pure but can also read volatile variable not triggering side effects"

It has been decided to avoid GCC/clang attributes to avoid potentially
dangerous optimisations from the compiler.

Changes in v2:
- prefer ECLAIR attributes over GCC attributes;
- replace ECL deviations with equivalent SAF deviations;
- deviate violations caused by harmless volatile asm;
- deviate violations caused by debug and logging macros/functions.

Simone Ballarin (3):
  automation/eclair: tag function calls to address violations of MISRA
    C:2012 Rule 13.1
  xen/arm: add SAF deviation for debugging and logging effects
  xen: address violations of MISRA C:2012 Rule 13.1

 .../ECLAIR/call_properties.ecl                | 22 +++++++++++++++++++
 docs/misra/safe.json                          | 16 ++++++++++++++
 xen/arch/arm/device.c                         |  1 +
 xen/arch/arm/guestcopy.c                      |  4 ++++
 xen/arch/x86/hvm/hvm.c                        |  1 +
 xen/common/sched/core.c                       |  3 +++
 xen/drivers/char/ns16550.c                    |  6 +++--
 7 files changed, 51 insertions(+), 2 deletions(-)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2023-12-04 23:14 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-24 17:29 [XEN PATCH v2 0/3] xen: address violations of MISRA C:2012 Rule 13.1 Simone Ballarin
2023-11-24 17:29 ` [XEN PATCH v2 1/3] automation/eclair: tag function calls to " Simone Ballarin
2023-12-02  3:19   ` Stefano Stabellini
2023-12-04  8:34     ` Simone Ballarin
2023-12-04 23:13       ` Stefano Stabellini
2023-11-24 17:29 ` [XEN PATCH v2 2/3] xen/arm: add SAF deviation for debugging and logging effects Simone Ballarin
2023-11-27 10:46   ` Jan Beulich
2023-11-27 14:35     ` Simone Ballarin
2023-11-27 15:09       ` Jan Beulich
2023-11-27 17:34         ` Simone Ballarin
2023-11-28  8:42           ` Jan Beulich
2023-12-04 10:34             ` Simone Ballarin
2023-11-24 17:29 ` [XEN PATCH v2 3/3] xen: address violations of MISRA C:2012 Rule 13.1 Simone Ballarin
2023-11-27 10:54   ` Jan Beulich
2023-12-02  3:22     ` Stefano Stabellini
2023-12-04  7:46       ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.