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

Re: [XEN PATCH][for-4.19 v5] xen: Add deviations for MISRA C:2012 Rule 7.1


  • To: Julien Grall <julien@xxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Tue, 31 Oct 2023 14:13:51 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=WEooZUmQGmKCow4jTsxUpCM8zslkHcSbt5XsLX0OnKU=; b=Kxp5ixVJbcCh2PkGQTtPbip8kVC2zQHOhgr9yfCyGBe5xiif4MvWXsDGgjs+oY8fYuDqaX6FdxGYfreYkxhJCrV6hXKH/6hmdO0Kn9OvHnSQzyUE7CjcHuQWWLSA52kglGygo46giuwZydh8Pi6xomkx2qgJHRArfC/MIJofNxGZwsgSdHRBTBp2arUZeyWdbDdJrd3mFIu8e9TuWEZ0cjscSi612HQDbBc7WUjlIBLDIHU1ZduLkWnU5VMyyRbbmCYnctkt5OC9Yd5AHiZ5UsN86S6fKNYB5K515UHpkkbvl2v+5QxirJOdhs/A+jme9DXKskwEc0PHg3DfhT97+A==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=WEooZUmQGmKCow4jTsxUpCM8zslkHcSbt5XsLX0OnKU=; b=inH3MZVwSG8SNbfzXynnDoEbf1bzg1yc6NdLF6xy0uG5OHDTz9igRsAz1rfc+1q0AJvGa3DKvFqIqiCv4G1QuKpAXwHEupvpgavdwiIWd8XRA0PQ4UB/uH4wm/sw6rPosN+yQ1qijnClBHWSREfGWm69kZy5UG1Y4FSUxzL60/JyVJ2ZrqStbNMijZXJqr94UZs6jJkqiZtVBRMg4C0wp1zXZpMfNtl/0nhca/7Fe3b7doU+/GTG9ScJI7aLARFBgIsfXQyL0zl0hgxOgfAi0ieRvPvNG4xJu0Q3A27XxwfcXQyCZ7Eq7MBq347moYTRfBqYrM+LsnrCV4vbQQajog==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=h8Vlq0YAUwUmqTY0bqwv3dMBDm1Qt72FOxjTqZ9G5gWq5wtjcvj3KyAbtWS8P86noH/VKaYBJcZ9qeJc1GOuTic1ETwmiW4SRA1SDi47Rv4edjfpLP4tPAqhVAuwdV0ynCXt5ElKfeswLCEV/z0o3eor+VJZfu/5m+sPfYiVo5vwuUN8dHWdzfS82uXuD6DjjhCgJieWqUMkJn6heXShBdHdffxdILZy8/Szb8sRPAt/A09ye5v1paQcZLVeImORcLNDgPwrodAiIUfEmWmrrkhFLDO6Fi7dwlnoNKt4hk2cqWtUHkyEZPgeFoMlDuUP1KR1ox9HKug+NIdezdCVaw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h0thC5K6L85g2+5EWFkZ6AZ3PB/CAsfhZD/PwIA5TG4Mg90roJqpUScNZXO1d05CNac6GSMCkr0Dd4IKN4YFwW4F65abBl+UM3RMqm4p0MV7CCxE9dXEZLtW1A2ZXpcOplMf7KhVLwOZOSuT5S2/tjT1ADhf1Ey6c5gZ7+noDRcAZkAynbVm+nz2EBdsuSZcN1bu+DUoRP3cARZ+U4D8RpucbIcLCsF08A65NuXf/U1fd7TDaxoVgn02y6cP4IruTrzNq3mi3BpHIxXXaJ730qMeDPrr7JXmOlrurKqc0M1iwjhf1Amlle4ONOAD1dWRbtSiwMd6uJxx5cqRo7B5uQ==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "michal.orzel@xxxxxxx" <michal.orzel@xxxxxxx>, "xenia.ragiadakou@xxxxxxx" <xenia.ragiadakou@xxxxxxx>, "ayan.kumar.halder@xxxxxxx" <ayan.kumar.halder@xxxxxxx>, "consulting@xxxxxxxxxxx" <consulting@xxxxxxxxxxx>, "jbeulich@xxxxxxxx" <jbeulich@xxxxxxxx>, "andrew.cooper3@xxxxxxxxxx" <andrew.cooper3@xxxxxxxxxx>, "roger.pau@xxxxxxxxxx" <roger.pau@xxxxxxxxxx>, Simone Ballarin <simone.ballarin@xxxxxxxxxxx>, Doug Goldstein <cardoe@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Tue, 31 Oct 2023 14:15:26 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHaC/4b2xNoaiIkmUiyfHAuabY8yrBj8OgA
  • Thread-topic: [XEN PATCH][for-4.19 v5] xen: Add deviations for MISRA C:2012 Rule 7.1


> On 31 Oct 2023, at 13:27, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi Stefano,
> 
> On 30/10/2023 22:49, Stefano Stabellini wrote:
>> On Mon, 30 Oct 2023, Julien Grall wrote:
>>> Hi Nicola,
>>> 
>>> On 27/10/2023 16:11, Nicola Vetrini wrote:
>>>> diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
>>>> index 8511a189253b..8aaaa1473fb4 100644
>>>> --- a/docs/misra/deviations.rst
>>>> +++ b/docs/misra/deviations.rst
>>>> @@ -90,6 +90,13 @@ Deviations related to MISRA C:2012 Rules:
>>>>            - __emulate_2op and __emulate_2op_nobyte
>>>>            - read_debugreg and write_debugreg
>>>>   +   * - R7.1
>>>> +     - It is safe to use certain octal constants the way they are defined
>>>> +       in specifications, manuals, and algorithm descriptions. Such places
>>>> +       are marked safe with a /\* octal-ok \*/ in-code comment, or with a
>>>> SAF
>>>> +       comment (see safe.json).
>>> 
>>> Reading this, it is unclear to me why we have two ways to deviate the rule
>>> r7.1. And more importantely, how would the developper decide which one to 
>>> use?
>> I agree with you on this and we were discussing this topic just this
>> morning in the FUSA community call. I think we need a way to do this
>> with the SAF framework:
>> if (some code with violation) /* SAF-xx-safe */
>> This doesn't work today unfortunately. It can only be done this way:
>> /* SAF-xx-safe */
>> if (some code with violation)
>> Which is not always desirable. octal-ok is just an ad-hoc solution for
>> one specific violation but we need a generic way to do this. Luca is
>> investigating possible ways to support the previous format in SAF.
> 
> Why can't we use octal-ok everywhere for now? My point here is to make simple 
> for the developper to know what to use.
> 
>> I think we should take this patch for now and harmonize it once SAF is
>> improved.
> 
> The description of the deviation needs some improvement. To give an example, 
> with the current wording, one could they can use octal-ok everywhere. But 
> above, you are implying that SAF-xx-safe should be
> preferred.
> 
> I would still strongly prefer if we use octal-ok everywhere because this is 
> simple to remember. But if the other are happy to have both SAF-XX and 
> octal-ok, then the description needs to be completely unambiguous and the 
> patch should contain some explanation why we have two different ways to 
> deviate.

Would it be ok to have both, for example: /* SAF-XX-safe octal-ok */

So that the suppression engine do what it should (currently it doesn’t suppress 
the same line, but we could do something about it) and the developer
has a way to understand what is the violation here without going to the 
justification database.



 


Rackspace

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