[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] misra: add deviation of Rule 2.1 for BUG() macro
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@xxxxxxxx>
- Date: Mon, 25 Aug 2025 10:26:05 +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=pJeUdbutCnf2pXBFpn9waVEwo91W93IlUbP3argF9n4=; b=P2tks86qkZ1Lpt2IgXDF4XXo9mvl3viPCBGbxbfUK2tI6BJC3DbJcBv4EPZB5wclkqJ9zFOVXDhoNhlgDhc5C0DN0zrGM2NBiXnVgI5RNUabdjqiuJw+wQcXKTA92fB+VNVuS0WAYIbl0myxWkx0fJNK4fTP4rOzTGa4DNvouO5mQQlVsUsiQZpw9cabap2JtdntNc6oC+zqSI1EPtrIAqxUQbkutUhhfqbnxZMSFAFOiUSesgl8fOdQ3kxfKRIJVnhCLu4LAHgeK7OWDg6HIKhP4+Gtq0ajzupSEaIBfQt4rXwq46PCcUtMzZpMA12CH/ryJe2dOPYgSy7Ma/v8Vg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WIADFbdnBhckt3IXFo+KwvLMgtBWDU9hAuvsqhqMQZKLW6MSurWgG1gezz9Nk6jf9Ght/KQaL/NcDfUd+19OGT6tiEkP6YYSlWQ1eEKBWQRAGAjI8ibpeUfdkxHG85XtjCljuex4ViFo8qiOVpQxGETa4NkbB/s3kEW/gD/CadYSpjQ8BUnwyx6QP0i7IhvAS0TgAnzbWmJsiwSkztDpPBwUMjRuB/CopcNEtkGegqOJUZG8U8VGDC0rQdCskz2i6KXcyenRiISFViid4HwVp6iqTtSqLrILExQrjRU/CszBA5RxQ1Fczh1PWXnoKKZwzxRZQ95SA8rWGnsnksqa1w==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
- Cc: 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>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Mon, 25 Aug 2025 10:26:16 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHcFQc77bBOPokbA0m9oV6J6fEgkLRzJgAAgAAFRIA=
- Thread-topic: [PATCH] misra: add deviation of Rule 2.1 for BUG() macro
On 8/25/25 13:07, Jan Beulich wrote:
> On 24.08.2025 16:56, Dmytro Prokopchuk1 wrote:
>> --- a/docs/misra/deviations.rst
>> +++ b/docs/misra/deviations.rst
>> @@ -97,6 +97,19 @@ Deviations related to MISRA C:2012 Rules:
>> Xen expects developers to ensure code remains safe and reliable in
>> builds,
>> even when debug-only assertions like `ASSERT_UNREACHABLE() are
>> removed.
>>
>> + * - R2.1
>> + - The 'BUG()' macro is intentionally used in the 'prepare_acpi()'
>> function
>> + in specific build configuration (when the config CONFIG_ACPI is not
>> + defined) to trigger an error if ACPI-related features are used
>> incorrectly.
>> + - Tagged as `deliberate` for ECLAIR.
>
> With
>
> #define acpi_disabled true
>
> in xen/acpi.h I don't see why we even have that inline stub. When it's dropped
> and the declaration left in place without #ifdef CONFIG_ACPI around it, the
> compiler will DCE the code (much like we arrange for in many other places). No
> deviation needed then.
>
> If such a deviation was to be added, it would need disambiguating. A function
> of the given name could appear in x86 as well. That wouldn't be covered by the
> Eclair config then, but it would be covered by the text here.
>
>> + * - R2.1
>> + - The 'BUG()' macro is intentionally used in 'gicv3_do_LPI'() and
>> + 'gicv3_its_setup_collection()' functions in specific build
>> configuration
>> + (when the config CONFIG_HAS_ITS is not defined) to catch and prevent
>> any
>> + unintended execution of code that should only run when ITS is
>> available.
>> + - Tagged as `deliberate` for ECLAIR.
>
> I didn't look at this, but I would very much hope that something similar could
> be done there as well.
>
> Jan
Thank you for review, Jan.
I'll pay attention on it.
Dmytro.
|