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

Re: [XEN PATCH 2/2] Address violation of MISRA C Rule 13.1 involving asm side effects.


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
  • Date: Thu, 14 Aug 2025 19:49:07 +0200
  • Arc-authentication-results: i=1; bugseng.com; arc=none smtp.remote-ip=162.55.131.47
  • Arc-message-signature: i=1; d=bugseng.com; s=openarc; a=rsa-sha256; c=relaxed/relaxed; t=1755193747; h=DKIM-Signature:MIME-Version:Date:From:To:Cc:Subject:In-Reply-To: References:Message-ID:X-Sender:Organization:Content-Type: Content-Transfer-Encoding; bh=YO7Ya9iBWiFrBHR+XdC+uFThSUh8MFN6TXgkgn+bID8=; b=ZZLzAmdsPn/Mq4DPMasEmesxhFQLsL2s+CluNPIHkBuWm5YQxQ9TmxbUu5yHefZXUqo+ LFbs07hcz5PzTVSikyEEDUFfvxfE/65fl0wTE+AabBieMS3C8Kop2YbpJ9g8g0hepSKgg LuyrpG/jpxwvCLPKrTGkZQk98qAuwph5jnomquQ6kmCbxH+GL0991Ko5zsvO1zrXWoOWp P/+ddpUMMtI4xlQJMipTnEAstwf0upkp+h5YE+BMQsIctDFtCwvmBPSE3S+Nd2noTKuzG YcsfxNsGU1YUSyZIWfRzCYS8p2e68oNVy0Hi/NnuHJa6o4mMoSWvcssnGJgicqDS5Bk8q WSTCOA6jjOWjq2XaB3Bm/NJikQnXHAAGm/GxXux8B1WX9gKsFa0duwg7Rf4j8PbP4FUGG eZR/NEi6HQISClVTWpVcYIlu3z6BPCTnL9j+Hl9nR8iAoTHMgXkqJ8QZ/3CfJQvVd1OT+ KQVPeZL369MpgzT4upTo0OJlTNetM5nwzC4PdmzNDE320yRjGWAUakxpbmX8VAsrb35cn pCUob/9hKaMakj5v+YH776IErdFGdrzxyqcohngiJ7Udb/0a+AjfSVInvW4o08JScEG9y LoxjWvVeNUjtGSYmJe0UH5MJIsd89taKn8dxJYsEpjhjlWgDvYvNnsDS+AoETIg=
  • Arc-seal: i=1; d=bugseng.com; s=openarc; a=rsa-sha256; cv=none; t=1755193747; b=evJP8l7QeIUq/oYk43X5JBzf+yAmxLnEn2D/hfH2oJdDs71zSN4IpZl7Nc+YDO0uLp2/ bg6xqx2KOZMTMDHQnIu9m/1lJJB0P86iJX5NnononoDaLQrVk0RN40knbIG3qPP0n1C+A KkaczgVwVye5aV1ef8RKoxWpjyjjXkcNSgZIuJPpbZWEhjOgRNaGpUuhJHUP11jjSNrpD 4vKM4TSgsJIGu6qmg5hRtmJydCS4PKk5PHLKPiBK04o+lzb5hBiPYOxyF33I8XndgsLDf 4qnmsWXfuKP1YVoI5tltl2n6hTG0+BLFz6t1smYfK56zeG0ybcqprZXGhOe993P62sGgd o81Sf/4UNFnC8F4rI0HEsPxP08YLwgqGzOLakzcW7iOJRhjhHFgYxcIzqQ4koDiCpJPVf GwGl6CyGYNieaJo9tAspyTo0zv/M3REJNEAELjcPNRj4mgZgIiLGcCo4bwxVOsFrKGN9E 9wVLocHpKnyB1IIf3+rlmClAR2p9dH4TPMiT4EZDjvGZXHbCxln1O5pO+QDSfVyPaGvT0 9LGH5JyIZjKNIxNXOGxwCFV4QqEfJ9yF/EKMChwoXEqyL6jiEYomV2la9p2pCq1PChQsh 6866NXhgQkiiF8LUg5HbiSSTL2Y2U+QssL5IWpptYap7SbF5i+oEA6E2mYDURW8=
  • Authentication-results: bugseng.com; arc=none smtp.remote-ip=162.55.131.47
  • Cc: sstabellini@xxxxxxxxxx, consulting@xxxxxxxxxxx, dmytro_prokopchuk1@xxxxxxxx, andrew.cooper3@xxxxxxxxxx, Doug Goldstein <cardoe@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 14 Aug 2025 17:49:18 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2025-08-14 09:36, Jan Beulich wrote:
On 08.08.2025 23:40, Nicola Vetrini wrote:
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -437,6 +437,10 @@ write or not"
 # Series 13
 #

+-doc_begin="Consider the asm instruction to read an Arm system register to have no side effects." +-asm_properties+={"asm(any())&&child(text, ast_field(value,^mrs\\s+%0.*$))", {no_side_effect}}
+-doc_end

Is this actually strict enough to not allow multiple instructions in the asm(), where some of the others would yield side effects we actually need to respect?

Jan

Good point, I didn't think of that. As it is, there is only one MRS asm, so no worries here, but in general the remark is valid. The regex could be a bit stricter, though the real solution here would be to match the context in which this asm is present to limit the scope of the deviation. This does not make much sense for an asm property because the properties of an asm statement (at the level of granularity targeted by ECLAIR) can be derived mostly in isolation from the surrounding code.

Another improvement we are pursuing is allowing single effects in init-list-exprs, but it will take a bit of time to surface (i.e., next major release probably).

--
Nicola Vetrini, B.Sc.
Software Engineer
BUGSENG (https://bugseng.com)
LinkedIn: https://www.linkedin.com/in/nicola-vetrini-a42471253



 


Rackspace

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